Commit 9148cce7 authored by chenzhao's avatar chenzhao

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

parents e2b5c1fa ba4387c6
...@@ -11,21 +11,21 @@ ...@@ -11,21 +11,21 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java"> <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
<attributes> <attributes>
<attribute name="test" value="true"/>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes> <attributes>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"> <classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes> <attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/classes"/> <classpathentry kind="output" path="target/classes"/>
......
...@@ -3,11 +3,7 @@ ...@@ -3,11 +3,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-biz-common</artifactId> <artifactId>amos-boot-biz-common</artifactId>
<packaging>jar</packaging> <packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
<parent> <parent>
<artifactId>amos-biz-boot</artifactId> <artifactId>amos-biz-boot</artifactId>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
...@@ -15,6 +11,73 @@ ...@@ -15,6 +11,73 @@
</parent> </parent>
<dependencies> <dependencies>
<dependency>
<groupId>com.yeejoin</groupId>
<artifactId>amos-feign-systemctl</artifactId>
<version>${amos.version}</version>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-core-rdbms</artifactId>
<version>${tyboot-version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</exclusion>
<exclusion>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<artifactId>mysql-connector-java</artifactId>
<groupId>mysql</groupId>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-core-restful</artifactId>
<version>${tyboot-version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger-ui</artifactId>
</exclusion>
<exclusion>
<groupId>io.springfox</groupId>
<artifactId>springfox-swagger2</artifactId>
</exclusion>
<exclusion>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-core-auth</artifactId>
<version>${tyboot-version}</version>
<exclusions>
<exclusion>
<groupId>org.typroject</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-core</artifactId>
<version>1.0.0</version>
</dependency>
<dependency> <dependency>
<groupId>com.baomidou</groupId> <groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId> <artifactId>mybatis-plus-generator</artifactId>
...@@ -27,18 +90,7 @@ ...@@ -27,18 +90,7 @@
<groupId>org.mybatis.spring.boot</groupId> <groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId> <artifactId>mybatis-spring-boot-starter</artifactId>
</dependency> </dependency>
<!-- knife4j -->
<dependency>
<groupId>com.github.xiaoymin</groupId>
<artifactId>knife4j-spring-boot-starter</artifactId>
<version>${knife4j-spring-boot-starter.version}</version>
<exclusions>
<exclusion>
<groupId>org.javassist</groupId>
<artifactId>javassist</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>org.javassist</groupId> <groupId>org.javassist</groupId>
<artifactId>javassist</artifactId> <artifactId>javassist</artifactId>
......
...@@ -17,4 +17,9 @@ public interface DataDictionaryMapper extends BaseMapper<DataDictionary> { ...@@ -17,4 +17,9 @@ public interface DataDictionaryMapper extends BaseMapper<DataDictionary> {
* @return * @return
*/ */
public List<DataDictionary> getDataDictionaryListAndCount(); public List<DataDictionary> getDataDictionaryListAndCount();
/**
* 获取包含联动单位的联动单位树信息
* @return
*/
public List<DataDictionary> getNoInLinkUnit();
} }
...@@ -23,4 +23,26 @@ GROUP BY ...@@ -23,4 +23,26 @@ GROUP BY
</select> </select>
<select id ="getNoInLinkUnit" resultType="com.yeejoin.amos.boot.biz.common.entity.DataDictionary">
SELECT
cbb.*
FROM
cb_data_dictionary cbb
LEFT JOIN (
SELECT
emergency_linkage_unit_code,
COUNT(1) count
FROM
cb_linkage_unit
GROUP BY
emergency_linkage_unit_code
) elink ON elink.emergency_linkage_unit_code = cbb.`code`
WHERE
cbb.type = 'YJLDDW'
AND elink.count IS NOT NULL
</select>
</mapper> </mapper>
...@@ -3,33 +3,18 @@ ...@@ -3,33 +3,18 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 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"> 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> <modelVersion>4.0.0</modelVersion>
<artifactId>amos-boot-core</artifactId>
<packaging>jar</packaging>
<parent> <parent>
<artifactId>amos-biz-boot</artifactId> <artifactId>amos-biz-boot</artifactId>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<artifactId>amos-boot-system-jpush</artifactId>
<version>8.0.0</version>
<dependencies> <dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-jpush-biz</artifactId>
<version>${amos-biz-boot.version}</version>
<exclusions>
<exclusion>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies> </dependencies>
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project> </project>
package com.yeejoin.amos.boot.biz.config; package com.yeejoin.amos.boot.core.config;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
...@@ -7,8 +7,6 @@ import org.springframework.context.annotation.Bean; ...@@ -7,8 +7,6 @@ import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import springfox.documentation.builders.ApiInfoBuilder; import springfox.documentation.builders.ApiInfoBuilder;
import springfox.documentation.builders.ParameterBuilder; import springfox.documentation.builders.ParameterBuilder;
...@@ -23,10 +21,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc; ...@@ -23,10 +21,6 @@ import springfox.documentation.swagger2.annotations.EnableSwagger2WebMvc;
/** /**
* @Author lichenglong * @Author lichenglong
*/ */
//@Configuration
//@EnableSwagger2
//@EnableKnife4j
//@Import(BeanValidatorPluginsConfiguration.class)
@Configuration @Configuration
@EnableSwagger2WebMvc @EnableSwagger2WebMvc
public class Swagger2Config { public class Swagger2Config {
...@@ -67,16 +61,6 @@ public class Swagger2Config { ...@@ -67,16 +61,6 @@ public class Swagger2Config {
.globalOperationParameters(setHeaderToken()); .globalOperationParameters(setHeaderToken());
} }
/***
* oauth2配置
* 需要增加swagger授权回调地址
* http://localhost:8888/webjars/springfox-swagger-ui/o2c.html
* @return
*/
// @Bean
// SecurityScheme securityScheme() {
// return new ApiKey(CommonConstant.X_ACCESS_TOKEN, CommonConstant.X_ACCESS_TOKEN, "header");
// }
/** /**
* JWT token * JWT token
* @return * @return
...@@ -116,25 +100,5 @@ public class Swagger2Config { ...@@ -116,25 +100,5 @@ public class Swagger2Config {
.build(); .build();
} }
/**
* 新增 securityContexts 保持登录状态
*/
// private List<SecurityContext> securityContexts() {
// return new ArrayList(
// Collections.singleton(SecurityContext.builder()
// .securityReferences(defaultAuth())
// .forPaths(PathSelectors.regex("^(?!auth).*$"))
// .build())
// );
// }
//
// private List<SecurityReference> defaultAuth() {
// AuthorizationScope authorizationScope = new AuthorizationScope("global", "accessEverything");
// AuthorizationScope[] authorizationScopes = new AuthorizationScope[1];
// authorizationScopes[0] = authorizationScope;
// return new ArrayList(
// Collections.singleton(new SecurityReference(CommonConstant.X_ACCESS_TOKEN, authorizationScopes)));
// }
} }
package org.typroject.tyboot.core.restful.doc;
/**
* 此类是为了覆盖原有类,为空,不用写具体实现
* @author lichenglong
*
*/
public class Swagger2 {
}
...@@ -38,4 +38,7 @@ public class CompanyDto { ...@@ -38,4 +38,7 @@ public class CompanyDto {
@ApiModelProperty(value = "单位名称") @ApiModelProperty(value = "单位名称")
private String name; private String name;
@ApiModelProperty(value = "重点部位数量")
private int keySiteNum;
} }
...@@ -220,8 +220,12 @@ ...@@ -220,8 +220,12 @@
a.companyMaleEmployees, a.companyMaleEmployees,
a.companyFemaleEmployees, a.companyFemaleEmployees,
a.managementType, a.managementType,
Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) AS distance,
FROM important_companys a case when cks_d.count is null then 0 else cks_d.count end as keySiteNum
FROM important_companys a left join (
SELECT cks.belong_id ,count(cks.belong_id) count from cb_key_site cks GROUP BY cks.belong_id
)cks_d
on a.id=cks_d.belong_id
where a.longitude is not null and a.latitude is not null where a.longitude is not null and a.latitude is not null
<if test='par.distance!=null'> <if test='par.distance!=null'>
and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;= and Round(st_distance(point(a.longitude,a.latitude),point(#{par.longitude},#{par.latitude}))*111195,1) &lt;=
......
...@@ -105,7 +105,7 @@ ...@@ -105,7 +105,7 @@
select distinct (case select distinct (case
when ISNULL(belong_fighting_system_id) = 0 and LENGTH(trim(belong_fighting_system_id)) > 0 when ISNULL(belong_fighting_system_id) = 0 and LENGTH(trim(belong_fighting_system_id)) > 0
then belong_fighting_system_id then belong_fighting_system_id
else 0 end) belong_fighting_system_id, else -2 end) belong_fighting_system_id,
(case (case
when ISNULL(belong_fighting_system) = 0 and LENGTH(trim(belong_fighting_system)) > 0 when ISNULL(belong_fighting_system) = 0 and LENGTH(trim(belong_fighting_system)) > 0
then belong_fighting_system then belong_fighting_system
...@@ -125,7 +125,7 @@ ...@@ -125,7 +125,7 @@
<if test="belongFightingSystemId > -1"> <if test="belongFightingSystemId > -1">
and belong_fighting_system_id = #{belongFightingSystemId} and belong_fighting_system_id = #{belongFightingSystemId}
</if> </if>
<if test="belongFightingSystemId == -1"> <if test="belongFightingSystemId == -2">
and belong_fighting_system_id is null and belong_fighting_system_id is null
</if> </if>
</if> </if>
......
...@@ -43,6 +43,11 @@ ...@@ -43,6 +43,11 @@
<artifactId>jsoup</artifactId> <artifactId>jsoup</artifactId>
<version>1.11.2</version> <version>1.11.2</version>
</dependency> </dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
<version>3.3.10</version>
</dependency>
</dependencies> </dependencies>
</project> </project>
<?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-module-api</artifactId>
<groupId>com.amosframework.boot</groupId>
<version>1.0.0</version>
</parent>
<artifactId>amos-boot-module-jpush-api</artifactId>
<dependencies>
<dependency>
<groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-biz-common</artifactId>
<version>${amos-biz-boot.version}</version>
<exclusions>
<exclusion>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
</exclusion>
<exclusion>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</exclusion>
<exclusion>
<groupId>org.mybatis.spring.boot</groupId>
<artifactId>mybatis-spring-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</project>
package com.yeejoin.amos.maintenance.common.enums;
import lombok.Data;
import java.util.Arrays;
import java.util.Optional;
/**
* @author DELL
*/
public enum PlanTypeEnum {
/**
* 计划类型枚举
*/
PLAN_TYPE_DAY("1","日计划"),
PLAN_TYPE_WEEK("2","周计划"),
PLAN_TYPE_MONTH("3","月计划"),
PLAN_TYPE_YEAR("4","年计划");
/**
* 名称
*/
private String name;
/**
* code
*/
private String code;
PlanTypeEnum(String code, String name){
this.code = code;
this.name = name;
}
public String getName() {
return name;
}
public static PlanTypeEnum getEnumByCode(String code) {
Optional<PlanTypeEnum> op = Arrays.stream(PlanTypeEnum.values()).filter(e->e.code.equals(code)).findFirst();
return op.orElse(null);
}
public void setName(String name) {
this.name = name;
}
public String getCode() {
return code;
}
public void setCode(String code) {
this.code = code;
}
}
...@@ -26,7 +26,6 @@ public class Check extends BasicEntity { ...@@ -26,7 +26,6 @@ public class Check extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** /**
* 参考地址 * 参考地址
...@@ -175,6 +174,18 @@ public class Check extends BasicEntity { ...@@ -175,6 +174,18 @@ public class Check extends BasicEntity {
*/ */
@Column(name="dep_name") @Column(name="dep_name")
private String depName; private String depName;
/**
* 责任单位id
*/
@Column(name="company_id")
private String companyId;
/**
* 责任单位名称
*/
@Column(name="company_name")
private String companyName;
@Column(name="error_classify") @Column(name="error_classify")
private String errorClassify; private String errorClassify;
...@@ -412,4 +423,19 @@ public class Check extends BasicEntity { ...@@ -412,4 +423,19 @@ public class Check extends BasicEntity {
this.routeName = routeName; this.routeName = routeName;
} }
public String getCompanyId() {
return companyId;
}
public void setCompanyId(String companyId) {
this.companyId = companyId;
}
public String getCompanyName() {
return companyName;
}
public void setCompanyName(String companyName) {
this.companyName = companyName;
}
} }
\ No newline at end of file
package com.yeejoin.amos.supervision.dao.entity; package com.yeejoin.amos.supervision.dao.entity;
import javax.persistence.Column; import javax.persistence.*;
import javax.persistence.Entity; import java.util.List;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
/** /**
...@@ -89,6 +85,53 @@ public class CheckInput extends BasicEntity { ...@@ -89,6 +85,53 @@ public class CheckInput extends BasicEntity {
*/ */
private String remark; private String remark;
/**
* 执行人ids
*/
@Column(name="user_id")
private String userId;
/**
* 执行人名称
*/
@Column(name="user_name")
private String userName;
/**
* 执行部门ids
*/
@Column(name="dep_id")
private String depId;
/**
* 执行部门名称
*/
@Column(name="dep_name")
private String depName;
/**
* 安全隐患个数
*/
@Column(name="safety_danger_num")
private int safetyDangerNum;
/**
* 重大隐患个数
*/
@Column(name="major_danger_num")
private int majorDangerNum;
@Transient
public List<CheckShot> getCheckShotList() {
return checkShotList;
}
public void setCheckShotList(List<CheckShot> checkShotList) {
this.checkShotList = checkShotList;
}
private List<CheckShot> checkShotList;
public String getRemark() { public String getRemark() {
return remark; return remark;
} }
...@@ -201,4 +244,51 @@ public class CheckInput extends BasicEntity { ...@@ -201,4 +244,51 @@ public class CheckInput extends BasicEntity {
this.pointClassifyName = pointClassifyName; this.pointClassifyName = pointClassifyName;
} }
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getDepId() {
return depId;
}
public void setDepId(String depId) {
this.depId = depId;
}
public String getDepName() {
return depName;
}
public void setDepName(String depName) {
this.depName = depName;
}
public int getMajorDangerNum() {
return majorDangerNum;
}
public void setMajorDangerNum(int majorDangerNum) {
this.majorDangerNum = majorDangerNum;
}
public int getSafetyDangerNum() {
return safetyDangerNum;
}
public void setSafetyDangerNum(int safetyDangerNum) {
this.safetyDangerNum = safetyDangerNum;
}
} }
\ No newline at end of file
...@@ -55,6 +55,30 @@ public class PlanTaskDetail extends BasicEntity { ...@@ -55,6 +55,30 @@ public class PlanTaskDetail extends BasicEntity {
@Column(name="status") @Column(name="status")
private String status="0"; private String status="0";
/**
* 检查项个数
*/
@Column(name="item_num")
private int itemNum;
/**
* 已执行个数
*/
@Column(name="executed_num")
private int executedNum;
/**
* 已执行个数
*/
@Column(name="safety_danger_num")
private int safetyDangerNum;
/**
* 已执行个数
*/
@Column(name="major_danger_num")
private int majorDangerNum;
public PlanTaskDetail() { public PlanTaskDetail() {
} }
...@@ -112,6 +136,45 @@ public class PlanTaskDetail extends BasicEntity { ...@@ -112,6 +136,45 @@ public class PlanTaskDetail extends BasicEntity {
public void setExecutorId(String executorId) { public void setExecutorId(String executorId) {
this.executorId = executorId; this.executorId = executorId;
} }
public int getItemNum() {
return itemNum;
}
public void setItemNum(int itemNum) {
this.itemNum = itemNum;
}
public int getExecutedNum() {
return executedNum;
}
public void setExecutedNum(int executedNum) {
this.executedNum = executedNum;
}
public Date getExecutorDate() {
return executorDate;
}
public void setExecutorDate(Date executorDate) {
this.executorDate = executorDate;
}
public int getSafetyDangerNum() {
return safetyDangerNum;
}
public void setSafetyDangerNum(int safetyDangerNum) {
this.safetyDangerNum = safetyDangerNum;
}
public int getMajorDangerNum() {
return majorDangerNum;
}
public void setMajorDangerNum(int majorDangerNum) {
this.majorDangerNum = majorDangerNum;
}
} }
\ No newline at end of file
...@@ -140,4 +140,7 @@ public class AlertCalledDto extends BaseDto { ...@@ -140,4 +140,7 @@ public class AlertCalledDto extends BaseDto {
@ApiModelProperty(value = "结案说明") @ApiModelProperty(value = "结案说明")
private String finalReason; private String finalReason;
@ApiModelProperty(value = "是否辅屏查询")
private String isAuxiliaryScreen;
} }
...@@ -217,4 +217,8 @@ public class AlertCalled extends BaseEntity { ...@@ -217,4 +217,8 @@ public class AlertCalled extends BaseEntity {
@ApiModelProperty(value = "响应级别") @ApiModelProperty(value = "响应级别")
private String responseLevel; private String responseLevel;
@TableField(exist=false)
@ApiModelProperty(value = "是否辅屏查询")
private String isAuxiliaryScreen;
} }
...@@ -23,7 +23,6 @@ ...@@ -23,7 +23,6 @@
<module>amos-boot-module-fas-api</module> <module>amos-boot-module-fas-api</module>
<module>amos-boot-module-maintenance-api</module> <module>amos-boot-module-maintenance-api</module>
<module>amos-boot-module-supervision-api</module> <module>amos-boot-module-supervision-api</module>
<module>amos-boot-module-jpush-api</module>
<module>amos-boot-module-knowledgebase-api</module> <module>amos-boot-module-knowledgebase-api</module>
</modules> </modules>
</project> </project>
\ No newline at end of file
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.yeejoin.amos.boot.biz.common.constants.CommonConstant; import com.yeejoin.amos.boot.biz.common.constants.CommonConstant;
import com.yeejoin.amos.boot.module.common.api.dto.*; import com.yeejoin.amos.boot.module.common.api.dto.*;
...@@ -37,10 +38,6 @@ import java.util.Map; ...@@ -37,10 +38,6 @@ import java.util.Map;
public class OrgPersonController { public class OrgPersonController {
@Autowired @Autowired
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
@Autowired
EmqKeeper emqKeeper;
@Value("${jcs.company.topic.delete}")
private String airportDeleteTopic;
/** /**
* 新增人员信息 * 新增人员信息
...@@ -69,11 +66,6 @@ public class OrgPersonController { ...@@ -69,11 +66,6 @@ public class OrgPersonController {
// 删除时,只作逻辑删除 // 删除时,只作逻辑删除
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete",
CommonConstant.IS_DELETE_01)); CommonConstant.IS_DELETE_01));
try {
emqKeeper.getMqttClient().publish(airportDeleteTopic, String.valueOf(id).getBytes(), 2, true);
} catch (Exception e) {
e.getMessage();
}
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
......
package com.yeejoin.amos.boot.module.common.biz.controller; package com.yeejoin.amos.boot.module.common.biz.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
...@@ -17,7 +18,9 @@ import io.swagger.annotations.Api; ...@@ -17,7 +18,9 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.component.emq.EmqKeeper;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper; import org.typroject.tyboot.core.restful.utils.ResponseHelper;
...@@ -44,6 +47,10 @@ public class OrgUsrController extends BaseController { ...@@ -44,6 +47,10 @@ public class OrgUsrController extends BaseController {
OrgUsrServiceImpl iOrgUsrService; OrgUsrServiceImpl iOrgUsrService;
@Autowired @Autowired
ESOrgUsrService eSOrgUsrService; ESOrgUsrService eSOrgUsrService;
@Autowired
EmqKeeper emqKeeper;
@Value("${jcs.company.topic.delete}")
private String airportDeleteTopic;
/** /**
...@@ -74,12 +81,11 @@ public class OrgUsrController extends BaseController { ...@@ -74,12 +81,11 @@ public class OrgUsrController extends BaseController {
iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01)); iOrgUsrService.update(new UpdateWrapper<OrgUsr>().eq("sequence_nbr", id).set("is_delete", CommonConstant.IS_DELETE_01));
try { try {
eSOrgUsrService.deleteById(id); eSOrgUsrService.deleteById(id);
emqKeeper.getMqttClient().publish(airportDeleteTopic, JSON.toJSONString(id).getBytes(), 2, false);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
throw new RuntimeException(); throw new RuntimeException();
} }
return ResponseHelper.buildResponse(null); return ResponseHelper.buildResponse(null);
} }
......
package com.yeejoin.amos.boot.module.common.biz.service.impl; package com.yeejoin.amos.boot.module.common.biz.service.impl;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import javax.annotation.Resource;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
...@@ -39,6 +21,22 @@ import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit; ...@@ -39,6 +21,22 @@ import com.yeejoin.amos.boot.module.common.api.entity.LinkageUnit;
import com.yeejoin.amos.boot.module.common.api.entity.SourceFile; import com.yeejoin.amos.boot.module.common.api.entity.SourceFile;
import com.yeejoin.amos.boot.module.common.api.mapper.LinkageUnitMapper; import com.yeejoin.amos.boot.module.common.api.mapper.LinkageUnitMapper;
import com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService; import com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/** /**
* 联动单位服务实现类 * 联动单位服务实现类
...@@ -90,7 +88,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU ...@@ -90,7 +88,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
} }
}); });
}); });
List<LinkageUnitDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(linkageUnitList.getRecords()), List<LinkageUnitDto> resultDtoList = JSONArray.parseArray(JSONArray.toJSONString(linkageUnitListMap),
LinkageUnitDto.class); LinkageUnitDto.class);
List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> { List<LinkageUnitDto> detaiList = resultDtoList.stream().map(item -> {
Date now = new Date(); Date now = new Date();
......
...@@ -359,6 +359,12 @@ public class MaintenanceCompanyServiceImpl ...@@ -359,6 +359,12 @@ public class MaintenanceCompanyServiceImpl
filedParamsMap.put("status", paramsMap.get("status").toString()); filedParamsMap.put("status", paramsMap.get("status").toString());
} }
mainTableList = this.checkMaintenanceCompanyList(wrapper, paramsMap); mainTableList = this.checkMaintenanceCompanyList(wrapper, paramsMap);
/*BUG 2503 人员头像存在附件中,获取附件信息返回前端 start*/
for (MaintenanceCompany m:mainTableList
) {
m.setAttachments(sourceFileService.getAttachments(m.getSequenceNbr()));
}
/* *BUG 2503 end*/
List<Long> instanceIds = Lists.transform(mainTableList, MaintenanceCompany::getInstanceId); List<Long> instanceIds = Lists.transform(mainTableList, MaintenanceCompany::getInstanceId);
filedParamsMap.put("instanceIds", Joiner.on(",").join(instanceIds)); filedParamsMap.put("instanceIds", Joiner.on(",").join(instanceIds));
break; break;
...@@ -388,6 +394,7 @@ public class MaintenanceCompanyServiceImpl ...@@ -388,6 +394,7 @@ public class MaintenanceCompanyServiceImpl
if (!ObjectUtils.isEmpty(detail)) { if (!ObjectUtils.isEmpty(detail)) {
r.putAll(Bean.BeantoMap(detail)); r.putAll(Bean.BeantoMap(detail));
} }
}); });
return page; return page;
} }
......
...@@ -24,11 +24,22 @@ ...@@ -24,11 +24,22 @@
<exclusions> <exclusions>
<exclusion> <exclusion>
<groupId>org.typroject</groupId> <groupId>org.typroject</groupId>
<artifactId>tyboot-core-auth</artifactId> <artifactId>*</artifactId>
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.typroject</groupId>
<artifactId>tyboot-component-emq</artifactId>
<version>${tyboot-version}</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
<version>4.0.1</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId> <groupId>org.apache.poi</groupId>
<artifactId>poi-scratchpad</artifactId> <artifactId>poi-scratchpad</artifactId>
<version>3.15</version> <version>3.15</version>
......
...@@ -24,6 +24,10 @@ ...@@ -24,6 +24,10 @@
<groupId>org.typroject</groupId> <groupId>org.typroject</groupId>
<artifactId>tyboot-core-auth</artifactId> <artifactId>tyboot-core-auth</artifactId>
</exclusion> </exclusion>
<exclusion>
<artifactId>fastjson</artifactId>
<groupId>com.alibaba</groupId>
</exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<dependency> <dependency>
...@@ -36,12 +40,6 @@ ...@@ -36,12 +40,6 @@
</exclusion> </exclusion>
</exclusions> </exclusions>
</dependency> </dependency>
<!-- 添加fastjson 依赖包. -->
<dependency>
<groupId>com.alibaba</groupId>
<artifactId>fastjson</artifactId>
<version>1.2.15</version>
</dependency>
<dependency> <dependency>
<groupId>org.quartz-scheduler</groupId> <groupId>org.quartz-scheduler</groupId>
<artifactId>quartz</artifactId> <artifactId>quartz</artifactId>
...@@ -97,7 +95,10 @@ ...@@ -97,7 +95,10 @@
<dependency> <dependency>
<groupId>org.liquibase</groupId> <groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId> <artifactId>liquibase-core</artifactId>
<version>3.8.9</version> </dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
</dependency> </dependency>
</dependencies> </dependencies>
......
...@@ -519,9 +519,9 @@ public class CheckController extends AbstractBaseController { ...@@ -519,9 +519,9 @@ public class CheckController extends AbstractBaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保记录详情", notes = "维保记录详情") @ApiOperation(value = "维保记录详情", notes = "维保记录详情")
@GetMapping(value = "/detail/{id}") @GetMapping(value = "/{id}/detail")
public CommonResponse getCheckDetail( public CommonResponse getCheckDetail(
@ApiParam(value = "记录Id") @PathVariable(value = "id") String id) throws Exception { @ApiParam(value = "记录Id",required = true) @PathVariable(value = "id") String id) {
return CommonResponseUtil.success(checkService.getCheckDetail(id)); return CommonResponseUtil.success(checkService.getCheckDetail(id));
} }
......
...@@ -23,6 +23,7 @@ import org.slf4j.Logger; ...@@ -23,6 +23,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page; import org.springframework.data.domain.Page;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import org.typroject.tyboot.core.foundation.enumeration.UserType; import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean; import org.typroject.tyboot.core.foundation.utils.Bean;
...@@ -35,6 +36,9 @@ import java.util.HashMap; ...@@ -35,6 +36,9 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
/**
* @author DELL
*/
@RestController @RestController
@RequestMapping(value = "/api/planTask") @RequestMapping(value = "/api/planTask")
@Api(tags = "计划执行api") @Api(tags = "计划执行api")
...@@ -155,23 +159,6 @@ public class PlanTaskController extends AbstractBaseController { ...@@ -155,23 +159,6 @@ public class PlanTaskController extends AbstractBaseController {
} }
/** /**
* 定时查询任务状态
*
* @return
*/
@ApiOperation(value = "定时执行任务表生成", notes = "定时执行任务表生成")
@RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse pushCarData() {
try {
planTaskService.taskExecution(null);
return CommonResponseUtil.success();
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure();
}
}
/**
* 模拟定时任务调起服务 * 模拟定时任务调起服务
* *
* @return * @return
......
...@@ -209,7 +209,6 @@ public class PointController extends AbstractBaseController { ...@@ -209,7 +209,6 @@ public class PointController extends AbstractBaseController {
Page<PointDto> pointList = iPointService.queryPointInfoWithItem(criterias, commonPageable, ownerId); Page<PointDto> pointList = iPointService.queryPointInfoWithItem(criterias, commonPageable, ownerId);
return CommonResponseUtil.success(pointList); return CommonResponseUtil.success(pointList);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
return CommonResponseUtil.failure("查询巡检点信息失败"); return CommonResponseUtil.failure("查询巡检点信息失败");
} }
......
package com.yeejoin.amos.maintenance.business.controller; package com.yeejoin.amos.maintenance.business.controller;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
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.PutMapping;
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.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams; import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.maintenance.business.param.RoutePageParam; import com.yeejoin.amos.maintenance.business.param.RoutePageParam;
import com.yeejoin.amos.maintenance.business.service.intfc.IRouteService; import com.yeejoin.amos.maintenance.business.service.intfc.IRouteService;
...@@ -35,14 +9,23 @@ import com.yeejoin.amos.maintenance.business.util.RoutePageParamUtil; ...@@ -35,14 +9,23 @@ import com.yeejoin.amos.maintenance.business.util.RoutePageParamUtil;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable; import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.request.CommonRequest; import com.yeejoin.amos.maintenance.core.common.request.CommonRequest;
import com.yeejoin.amos.maintenance.core.common.request.RoutePointInputItemRequest; import com.yeejoin.amos.maintenance.core.common.request.RoutePointInputItemRequest;
import com.yeejoin.amos.maintenance.core.framework.PersonIdentify;
import com.yeejoin.amos.maintenance.dao.entity.InputItem; import com.yeejoin.amos.maintenance.dao.entity.InputItem;
import com.yeejoin.amos.maintenance.dao.entity.Plan;
import com.yeejoin.amos.maintenance.dao.entity.Route; import com.yeejoin.amos.maintenance.dao.entity.Route;
import com.yeejoin.amos.maintenance.dao.entity.RoutePoint; import com.yeejoin.amos.maintenance.dao.entity.RoutePoint;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
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 java.util.*;
import java.util.stream.Collectors;
@RestController @RestController
@RequestMapping(value = "/api/route") @RequestMapping(value = "/api/route")
...@@ -122,39 +105,8 @@ public class RouteController extends AbstractBaseController { ...@@ -122,39 +105,8 @@ public class RouteController extends AbstractBaseController {
@ApiOperation(value = "删除巡检路线", notes = "删除巡检路线") @ApiOperation(value = "删除巡检路线", notes = "删除巡检路线")
@DeleteMapping(value = "/deleteRoute", produces = "application/json;charset=UTF-8") @DeleteMapping(value = "/deleteRoute", produces = "application/json;charset=UTF-8")
public CommonResponse deleteRoute(@ApiParam(value = "巡检路线ID", required = false) @RequestParam List<Long> routeIds) { public CommonResponse deleteRoute(@ApiParam(value = "巡检路线ID", required = false) @RequestParam List<Long> routeIds) {
try { routeService.delRouteById(routeIds.toArray(new Long[0]));
//校验1:线路上有点时返回删除失败 return CommonResponseUtil.success();
Map<Long, String> idNameMap = new HashMap<>();
for (long id : routeIds) {
int routePointCount = routeService.countRoutePoint(id);
if (routePointCount > 0) {
Route route = routeService.queryRouteById(id);
idNameMap.put(id, route.getName());
}
}
if (idNameMap.size() > 0) {
return CommonResponseUtil.failure(idNameMap, "删除路线失败:路线上已设置巡检点");
}
//校验2:计划在使用,删除失败
idNameMap.clear();
for (long id : routeIds) {
int routePointCount = routeService.countRoutePoint(id);
if (routePointCount > 0) {
List<Plan> planList = routeService.queryPlanByRouteId(id);
if (planList != null && planList.size() > 0) {
idNameMap.put(id, planList.get(0).getName());
}
}
}
if (idNameMap.size() > 0) {
return CommonResponseUtil.failure(idNameMap, "删除路线失败:计划在使用");
}
routeService.delRouteById(routeIds.toArray(new Long[0]));
return CommonResponseUtil.success();
} catch (Exception e) {
log.error(e.getMessage(), e);
return CommonResponseUtil.failure("删除巡检路线失败");
}
} }
/** /**
......
...@@ -18,8 +18,27 @@ public class CheckInputDto { ...@@ -18,8 +18,27 @@ public class CheckInputDto {
private String inputValue; private String inputValue;
private String isOk; private String isOk;
private String isOkDesc; private String isOkDesc;
/**
* 拍照配置
*/
private String pictureJson; private String pictureJson;
/**
* 选择项和文本项配置
*/
private String dataJson; private String dataJson;
/**
* 检查依据
*/
private String basisJson;
/**
* 是否必输
*/
private String isMust;
/**
* 测试要求
*/
private String testRequirement;
private String remark; private String remark;
private List<CheckShotDto> checkInputShot; private List<CheckShotDto> checkInputShot;
} }
...@@ -35,6 +35,12 @@ public class PlanTaskPointInputItemBo { ...@@ -35,6 +35,12 @@ public class PlanTaskPointInputItemBo {
* 编号 * 编号
*/ */
private String pointNo; private String pointNo;
/**
* 地址
*/
private String address;
/** /**
* 巡检任务id * 巡检任务id
...@@ -47,6 +53,11 @@ public class PlanTaskPointInputItemBo { ...@@ -47,6 +53,11 @@ public class PlanTaskPointInputItemBo {
private String ownerId; private String ownerId;
/** /**
* 业主单位名称
*/
private String ownerName;
/**
* 单位id * 单位id
*/ */
private String companyId; private String companyId;
...@@ -75,6 +86,12 @@ public class PlanTaskPointInputItemBo { ...@@ -75,6 +86,12 @@ public class PlanTaskPointInputItemBo {
* 巡检任务详情id * 巡检任务详情id
*/ */
private long planTaskDetailId; private long planTaskDetailId;
/**
* 风险辨识与管控措施
*/
private String riskAndManage;
/** /**
* 巡检路线 * 巡检路线
......
...@@ -33,10 +33,7 @@ import com.yeejoin.amos.maintenance.business.util.DaoCriteria; ...@@ -33,10 +33,7 @@ import com.yeejoin.amos.maintenance.business.util.DaoCriteria;
import com.yeejoin.amos.maintenance.business.util.ToolUtils; import com.yeejoin.amos.maintenance.business.util.ToolUtils;
import com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo; import com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.maintenance.business.vo.CheckInfoVo; import com.yeejoin.amos.maintenance.business.vo.CheckInfoVo;
import com.yeejoin.amos.maintenance.common.enums.CheckStatusEnum; import com.yeejoin.amos.maintenance.common.enums.*;
import com.yeejoin.amos.maintenance.common.enums.PlanTaskFinishStatusEnum;
import com.yeejoin.amos.maintenance.common.enums.PointLevelEnum;
import com.yeejoin.amos.maintenance.common.enums.PointStatusEnum;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable; import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.response.*; import com.yeejoin.amos.maintenance.core.common.response.*;
import com.yeejoin.amos.maintenance.core.enums.QueryOperatorEnum; import com.yeejoin.amos.maintenance.core.enums.QueryOperatorEnum;
...@@ -115,6 +112,9 @@ public class CheckServiceImpl implements ICheckService { ...@@ -115,6 +112,9 @@ public class CheckServiceImpl implements ICheckService {
@Value("${file.url}") @Value("${file.url}")
private String fileUrl; private String fileUrl;
@Autowired
IRouteDao iRouteDao;
final String CHECK_UPDATE_TOPIC = "maintenance/date/update"; final String CHECK_UPDATE_TOPIC = "maintenance/date/update";
...@@ -141,6 +141,7 @@ public class CheckServiceImpl implements ICheckService { ...@@ -141,6 +141,7 @@ public class CheckServiceImpl implements ICheckService {
//1.前置校验 //1.前置校验
this.checkCanFinishTask(mtUserSeq, planTask, recordParam.getPointId()); this.checkCanFinishTask(mtUserSeq, planTask, recordParam.getPointId());
Point point = iPointService.queryPointById(recordParam.getPointId()); Point point = iPointService.queryPointById(recordParam.getPointId());
Route route = iRouteDao.findById(planTask.getRouteId()).orElseThrow(() -> new RuntimeException("路线不存在"));
Check check = new Check(); Check check = new Check();
if (ObjectUtils.isEmpty(point) || ObjectUtils.isEmpty(detail)) { if (ObjectUtils.isEmpty(point) || ObjectUtils.isEmpty(detail)) {
throw new Exception("前置校验不通过"); throw new Exception("前置校验不通过");
...@@ -156,13 +157,18 @@ public class CheckServiceImpl implements ICheckService { ...@@ -156,13 +157,18 @@ public class CheckServiceImpl implements ICheckService {
check.setPointName(point.getName()); check.setPointName(point.getName());
check.setPointId(point.getId()); check.setPointId(point.getId());
check.setPointNo(point.getPointNo()); check.setPointNo(point.getPointNo());
check.setRiskAndManage(point.getRemark());
check.setRemark(recordParam.getRemark()); check.setRemark(recordParam.getRemark());
check.setCheckTime(new Date()); check.setCheckTime(new Date());
check.setBeginTime(planTask.getBeginTime());
check.setEndTime(planTask.getEndTime());
check.setUploadTime(new Date()); check.setUploadTime(new Date());
check.setOrgCode(recordParam.getOrgCode()); check.setOrgCode(recordParam.getOrgCode());
check.setUserId(mtUserSeq); check.setUserId(mtUserSeq);
check.setOwnerId(point.getOwnerId()); check.setOwnerId(route.getOwnerId());
check.setOwnerName(route.getOwnerName());
check.setBuildingName(point.getBuildingName()); check.setBuildingName(point.getBuildingName());
check.setAddress(point.getAddress());
check.setEquipmentName(point.getEquipmentName()); check.setEquipmentName(point.getEquipmentName());
check.setPlanType(detail.get("planType").toString()); check.setPlanType(detail.get("planType").toString());
check.setUserName(personIdentity.getPersonName()); check.setUserName(personIdentity.getPersonName());
...@@ -268,8 +274,8 @@ public class CheckServiceImpl implements ICheckService { ...@@ -268,8 +274,8 @@ public class CheckServiceImpl implements ICheckService {
//7.返回不合格记录 //7.返回不合格记录
return new CheckDto(check.getId(), unqualifiedCheckItemList); return new CheckDto(check.getId(), unqualifiedCheckItemList);
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(),e); log.error(e.getMessage(), e);
throw new Exception(e.getMessage(),e); throw new Exception(e.getMessage(), e);
} }
} }
...@@ -445,10 +451,10 @@ public class CheckServiceImpl implements ICheckService { ...@@ -445,10 +451,10 @@ public class CheckServiceImpl implements ICheckService {
@Override @Override
public List<CheckInputDto> getInputDetail(String checkId) { public List<CheckInputDto> getInputDetail(String checkId) {
List<CheckInputDto> list = this.checkMapper.queryCheckInputDetail(checkId,fileUrl); List<CheckInputDto> list = this.checkMapper.queryCheckInputDetail(checkId, fileUrl);
list.forEach(input->{ list.forEach(input -> {
CheckStatusEnum statusEnum = CheckStatusEnum.getEnum(input.getIsOk()); CheckStatusEnum statusEnum = CheckStatusEnum.getEnum(input.getIsOk());
if(statusEnum != null){ if (statusEnum != null) {
input.setIsOkDesc(statusEnum.getName()); input.setIsOkDesc(statusEnum.getName());
} }
}); });
...@@ -1110,15 +1116,23 @@ public class CheckServiceImpl implements ICheckService { ...@@ -1110,15 +1116,23 @@ public class CheckServiceImpl implements ICheckService {
} }
@Override @Override
public Map<String, Object> getCheckDetail(String id) { public Map<String, Object> getCheckDetail(String checkId) {
Map<String, Object> map = checkMapper.getCheckDetail(id); Map<String, Object> result = new HashMap<>();
if (map.containsKey("isOk")) { result.put("facility", this.buildCheckMainInfo(checkId));
map.put("status", CheckStatusEnum.getEnum(String.valueOf(map.get("isOk"))).getName()); result.put("itemList", this.getInputDetail(checkId));
return result;
}
private Map<String, Object> buildCheckMainInfo(String checkId) {
Map<String, Object> facility = checkMapper.getCheckDetail(checkId);
if (facility.containsKey("isOk")) {
facility.put("isOkDesc", CheckStatusEnum.getEnum(String.valueOf(facility.get("isOk"))).getName());
} }
if (map.containsKey("picture")) { if (facility.containsKey("planType")) {
map.put("picture", fileUrl + map.get("picture")); PlanTypeEnum planType = PlanTypeEnum.getEnumByCode(String.valueOf(facility.get("planType")));
facility.put("planTypeDesc", planType != null ? planType.getName() : "其他");
} }
return map; return facility;
} }
@Override @Override
......
...@@ -8,10 +8,8 @@ import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskDetailMapper; ...@@ -8,10 +8,8 @@ import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskDetailMapper;
import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper; import com.yeejoin.amos.maintenance.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.maintenance.business.dao.repository.*; import com.yeejoin.amos.maintenance.business.dao.repository.*;
import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo; import com.yeejoin.amos.maintenance.business.entity.mybatis.CheckChkExListBo;
import com.yeejoin.amos.maintenance.business.feign.EquipFeignClient;
import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam; import com.yeejoin.amos.maintenance.business.param.CheckPtListPageParam;
import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam; import com.yeejoin.amos.maintenance.business.param.PlanTaskPageParam;
import com.yeejoin.amos.maintenance.business.service.intfc.ICheckService;
import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService; import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService;
import com.yeejoin.amos.maintenance.business.util.PlanTaskUtil; import com.yeejoin.amos.maintenance.business.util.PlanTaskUtil;
import com.yeejoin.amos.maintenance.business.vo.CalDateVo; import com.yeejoin.amos.maintenance.business.vo.CalDateVo;
...@@ -57,29 +55,17 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -57,29 +55,17 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired @Autowired
IPlanDao iplanDao; IPlanDao iplanDao;
@Autowired @Autowired
private ICheckDao checkDao;
@Autowired
private RemoteSecurityService remoteSecurityService; private RemoteSecurityService remoteSecurityService;
@Autowired @Autowired
private IPlanTaskDetailDao planTaskDetail; private IPlanTaskDetailDao planTaskDetail;
@Autowired @Autowired
IRoutePointDao iRoutePointDao; IRoutePointDao iRoutePointDao;
@Autowired @Autowired
IJobService jobService; IJobService jobService;
@Autowired
private ICheckService checkService;
@Autowired
private EquipFeignClient equipFeign;
@Autowired @Autowired
IPointDao iPointDao; IPointDao iPointDao;
@Autowired @Autowired
IPlanTaskDetailDao iPlanTaskDetailDao; IPlanTaskDetailDao iPlanTaskDetailDao;
@Autowired @Autowired
InputItemMapper inputItemMapper; InputItemMapper inputItemMapper;
...@@ -301,10 +287,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -301,10 +287,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
//2.4.删除今天可能重做生成的数据(计划重做后进行了计划的编辑) //2.4.删除今天可能重做生成的数据(计划重做后进行了计划的编辑)
if (iplanTaskDao.findById(plan.getPlanTaskId()) != null && plan.getFirstFlag() == XJConstant.PLAN_FIRST_STATUS_YES) if (iplanTaskDao.findById(plan.getPlanTaskId()).isPresent() && plan.getFirstFlag() == XJConstant.PLAN_FIRST_STATUS_YES) {
if (iplanTaskDao.existsById(plan.getPlanTaskId())) { if (iplanTaskDao.existsById(plan.getPlanTaskId())) {
iplanTaskDao.deleteById(plan.getPlanTaskId()); iplanTaskDao.deleteById(plan.getPlanTaskId());
} }
}
//2.5.插入planTask及planTaskDetail //2.5.插入planTask及planTaskDetail
insertPlanTaskAndDet(list, plan, XJConstant.SCHED_FLAG, now); insertPlanTaskAndDet(list, plan, XJConstant.SCHED_FLAG, now);
...@@ -515,12 +502,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -515,12 +502,12 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
} }
@Override @Override
public List<Map<String,Object>> getPlanTaskPoints(Map<String, Object> param) { public List<Map<String, Object>> getPlanTaskPoints(Map<String, Object> param) {
List<Map<String,Object>> result = planTaskMapper.getPlanTaskPoints(param); List<Map<String, Object>> result = planTaskMapper.getPlanTaskPoints(param);
result.forEach(r->{ result.forEach(r -> {
if(r.containsKey("isFinish")){ if (r.containsKey("isFinish")) {
String isFinishDesc = PlanTaskDetailIsFinishEnum.getName(Integer.parseInt(r.get("isFinish").toString())); String isFinishDesc = PlanTaskDetailIsFinishEnum.getName(Integer.parseInt(r.get("isFinish").toString()));
r.put("isFinishDesc",isFinishDesc); r.put("isFinishDesc", isFinishDesc);
} }
}); });
return result; return result;
......
...@@ -235,8 +235,6 @@ public class PointServiceImpl implements IPointService { ...@@ -235,8 +235,6 @@ public class PointServiceImpl implements IPointService {
public List<Long> delPointById(Long[] ids) { public List<Long> delPointById(Long[] ids) {
List<Long> idList = new ArrayList<Long>(); List<Long> idList = new ArrayList<Long>();
idList.addAll(Arrays.asList(ids)); idList.addAll(Arrays.asList(ids));
List<PointInputItem> pointInputItem = iPointInputItemDao.findAllById(idList);
List<Long> pointInputItemIds = Lists.transform(pointInputItem, PointInputItem::getId);
// 物理删除p_point_inputitem表对应行 // 物理删除p_point_inputitem表对应行
iPointInputItemDao.deleteByPointId(idList); iPointInputItemDao.deleteByPointId(idList);
// 物理删除p_route_point、p_route_point_item中相关行 // 物理删除p_route_point、p_route_point_item中相关行
...@@ -245,6 +243,7 @@ public class PointServiceImpl implements IPointService { ...@@ -245,6 +243,7 @@ public class PointServiceImpl implements IPointService {
iRoutePointItemDao.delRoutePointItem(routePointId.longValue()); iRoutePointItemDao.delRoutePointItem(routePointId.longValue());
iRoutePointDao.deleteById(Long.parseLong(routePointId.toString())); iRoutePointDao.deleteById(Long.parseLong(routePointId.toString()));
} }
//更新任务完成点数量、点总数量
for (long pointId : idList) { for (long pointId : idList) {
List<PlanTaskDetail> planDetailList = iPlanTaskDetailDao.findALLByPointId(pointId); List<PlanTaskDetail> planDetailList = iPlanTaskDetailDao.findALLByPointId(pointId);
for (PlanTaskDetail planTaskDetail : planDetailList) { for (PlanTaskDetail planTaskDetail : planDetailList) {
...@@ -262,9 +261,9 @@ public class PointServiceImpl implements IPointService { ...@@ -262,9 +261,9 @@ public class PointServiceImpl implements IPointService {
} }
} }
} }
// 删除p_plan_task_detail相关行 // 物联删除p_plan_task_detail相关行
iPlanTaskDetailDao.deletePlanTaskDetailByPointId(idList); iPlanTaskDetailDao.deletePlanTaskDetailByPointId(idList);
// 删除p_point相关行 // 删除p_point相关行
iPointDao.delPointById(idList); iPointDao.delPointById(idList);
return idList; return idList;
} }
......
...@@ -76,30 +76,37 @@ public class RouteServiceImpl implements IRouteService { ...@@ -76,30 +76,37 @@ public class RouteServiceImpl implements IRouteService {
@Override @Override
@Transactional @Transactional
public Route addRoute(Route route) { public Route addRoute(Route route) {
String creatorId = route.getCreatorId(); String creatorId = route.getCreatorId();
String orgCode = route.getOrgCode(); String orgCode = route.getOrgCode();
//1.保存主表
route = iRouteDao.saveAndFlush(route); route = iRouteDao.saveAndFlush(route);
Long rId = route.getId(); Long rId = route.getId();
List<RoutePoint> routePoints = route.getRoutePointList(); List<RoutePoint> routePoints = route.getRoutePointList();
//2.保存子表
routePoints.forEach(rp -> { routePoints.forEach(rp -> {
rp.setOrgCode(orgCode); rp.setOrgCode(orgCode);
rp.setRouteId(rId); rp.setRouteId(rId);
rp.setCreatorId(creatorId); rp.setCreatorId(creatorId);
List<RoutePointItem> routePointItems = rp.getRoutePointItem(); List<RoutePointItem> routePointItems = rp.getRoutePointItem();
//2.1保存点路线关系表
rp = iRoutePointDao.saveAndFlush(rp); rp = iRoutePointDao.saveAndFlush(rp);
Long rpId = rp.getId(); Long rpId = rp.getId();
routePointItems = routePointItems.stream().filter(RoutePointItem::getIsBound).collect(Collectors.toList());
routePointItems.forEach(rpi -> { routePointItems.forEach(rpi -> {
rpi.setRoutePointId(rpId); rpi.setRoutePointId(rpId);
rpi.setCreatorId(creatorId); rpi.setCreatorId(creatorId);
iRoutePointItemDao.saveAndFlush(rpi);
}); });
//2.2保存点项关系表
if (!routePointItems.isEmpty()) {
iRoutePointItemDao.saveAll(routePointItems);
}
}); });
return route; return route;
} }
@Override @Override
@Transactional @Transactional(rollbackFor = Exception.class)
public void delRouteById(Long[] ids) { public void delRouteById(Long[] ids) {
//0.删除路线 //0.删除路线
iRouteDao.delRouteById(Arrays.asList(ids)); iRouteDao.delRouteById(Arrays.asList(ids));
...@@ -126,7 +133,7 @@ public class RouteServiceImpl implements IRouteService { ...@@ -126,7 +133,7 @@ public class RouteServiceImpl implements IRouteService {
iRoutePointItemDao.delRoutePointItem(rp.getId()); iRoutePointItemDao.delRoutePointItem(rp.getId());
iRoutePointDao.deleteById(rp.getId()); iRoutePointDao.deleteById(rp.getId());
//删除p_plan_task_detail 对应点、更新p_plan_task点数量、完成数量 //删除p_plan_task_detail 对应点、更新p_plan_task点数量、完成数量
this.updatePlanTask(rp.getPointId(),finalRoute.getId()); this.updatePlanTask(rp.getPointId(), finalRoute.getId());
} else { } else {
List<RoutePointItem> routePointItems = rp.getRoutePointItem(); List<RoutePointItem> routePointItems = rp.getRoutePointItem();
iRoutePointDao.saveAndFlush(rp); iRoutePointDao.saveAndFlush(rp);
...@@ -156,9 +163,15 @@ public class RouteServiceImpl implements IRouteService { ...@@ -156,9 +163,15 @@ public class RouteServiceImpl implements IRouteService {
} }
private void updatePlanTask(long pointId, long routeId) { private void updatePlanTask(long pointId, long routeId) {
//1.查询指定路线的任务
List<PlanTask> planTaskList = planTaskDao.findByRouteId(routeId); List<PlanTask> planTaskList = planTaskDao.findByRouteId(routeId);
Map<Long, PlanTask> planTaskMap = planTaskList.stream().collect(Collectors.toMap(BasicEntity::getId, Function.identity()));
//2.查询指定的点
List<PlanTaskDetail> planTaskDetailList = iPlanTaskDetailDao.findByPointId(pointId); List<PlanTaskDetail> planTaskDetailList = iPlanTaskDetailDao.findByPointId(pointId);
Map<Long,PlanTask> planTaskMap = planTaskList.stream().collect(Collectors.toMap(BasicEntity::getId, Function.identity())); //3.过滤指定父任务id的执行数据
planTaskDetailList = planTaskDetailList.stream().filter(e ->
planTaskList.stream().map(BasicEntity::getId).collect(Collectors.toList()).contains(e.getTaskNo())).collect(Collectors.toList());
//4.更新任务主表点的数量及完成数量
for (PlanTaskDetail planTaskDetail : planTaskDetailList) { for (PlanTaskDetail planTaskDetail : planTaskDetailList) {
PlanTask planTask = planTaskMap.get(planTaskDetail.getTaskNo()); PlanTask planTask = planTaskMap.get(planTaskDetail.getTaskNo());
if (1 == planTaskDetail.getIsFinish()) { if (1 == planTaskDetail.getIsFinish()) {
...@@ -168,9 +181,9 @@ public class RouteServiceImpl implements IRouteService { ...@@ -168,9 +181,9 @@ public class RouteServiceImpl implements IRouteService {
planTask.setPointNum(planTask.getPointNum() - 1); planTask.setPointNum(planTask.getPointNum() - 1);
} }
} }
//更新主表完成数量,点数量 //5.更新主表完成数量,点数量
planTaskDao.saveAll(planTaskList); planTaskDao.saveAll(planTaskList);
//删除路线下的维保点 //6.删除路线下的维保点
planTaskDetailMapper.deleteByPointIdAndRouteId(pointId, routeId); planTaskDetailMapper.deleteByPointIdAndRouteId(pointId, routeId);
} }
......
...@@ -47,7 +47,7 @@ public class PersonIdentifyAspect { ...@@ -47,7 +47,7 @@ public class PersonIdentifyAspect {
if (ObjectUtils.isEmpty(responseModel.getResult()) || responseModel.getStatus() != HTTP_OK_STATUS) { if (ObjectUtils.isEmpty(responseModel.getResult()) || responseModel.getStatus() != HTTP_OK_STATUS) {
throw new RuntimeException(responseModel.getDevMessage()); throw new RuntimeException(responseModel.getDevMessage());
} }
ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(),ReginParams.PersonIdentity.class); ReginParams.PersonIdentity personIdentity = (ReginParams.PersonIdentity) Bean.mapToBean((Map<String, Object>) responseModel.getResult(), ReginParams.PersonIdentity.class);
reginParam.setPersonIdentity(personIdentity); reginParam.setPersonIdentity(personIdentity);
redisUtils.set(buildKey(RequestContext.getToken()), JSONObject.toJSONString(reginParam)); redisUtils.set(buildKey(RequestContext.getToken()), JSONObject.toJSONString(reginParam));
} }
......
...@@ -198,7 +198,11 @@ public class JobService implements IJobService { ...@@ -198,7 +198,11 @@ public class JobService implements IJobService {
check.setPointName(arg.getPointName()); check.setPointName(arg.getPointName());
check.setPointId(arg.getPointId()); check.setPointId(arg.getPointId());
check.setPointNo(arg.getPointNo()); check.setPointNo(arg.getPointNo());
check.setRiskAndManage(arg.getRiskAndManage());
check.setBeginTime(planTask.getBeginTime());
check.setEndTime(planTask.getEndTime());
check.setBuildingName(arg.getBuildingName()); check.setBuildingName(arg.getBuildingName());
check.setAddress(arg.getAddress());
check.setUploadTime(new Date()); check.setUploadTime(new Date());
check.setPlanId(arg.getPlanId()); check.setPlanId(arg.getPlanId());
check.setPlanName(arg.getPlanName()); check.setPlanName(arg.getPlanName());
...@@ -209,6 +213,7 @@ public class JobService implements IJobService { ...@@ -209,6 +213,7 @@ public class JobService implements IJobService {
check.setRouteName(arg.getRouteName()); check.setRouteName(arg.getRouteName());
check.setCheckTime(arg.getEndTime()); check.setCheckTime(arg.getEndTime());
check.setOwnerId(arg.getOwnerId()); check.setOwnerId(arg.getOwnerId());
check.setOwnerName(arg.getOwnerName());
check.setCompanyId(arg.getCompanyId()); check.setCompanyId(arg.getCompanyId());
check.setCompanyName(arg.getCompanyName()); check.setCompanyName(arg.getCompanyName());
check.setEquipmentName(arg.getEquipmentName()); check.setEquipmentName(arg.getEquipmentName());
...@@ -320,8 +325,7 @@ public class JobService implements IJobService { ...@@ -320,8 +325,7 @@ public class JobService implements IJobService {
updatePlanTaskStatus(planTask, PlanTaskFinishStatusEnum.OVERTIME.getValue()); updatePlanTaskStatus(planTask, PlanTaskFinishStatusEnum.OVERTIME.getValue());
} }
} catch (Exception e) { } catch (Exception e) {
log.error(e.getMessage(), e); log.error("任务加到定时任务或者更新失败", e);
e.printStackTrace();
} }
} }
......
package com.yeejoin.amos.maintenance.task;
import com.yeejoin.amos.maintenance.business.service.intfc.IPlanTaskService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
/**
* @author DELL
*/
@Component
@EnableScheduling
public class PlanTaskJob {
@Autowired
private IPlanTaskService planTaskService;
/**
* 定时查询任务状态
*/
@Scheduled(cron = "${jobs.cron}")
public void scheduleJob() {
planTaskService.taskExecution(null);
}
}
...@@ -95,6 +95,10 @@ ...@@ -95,6 +95,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId> <artifactId>spring-boot-starter-mail</artifactId>
</dependency> </dependency>
<dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
</dependency>
</dependencies> </dependencies>
</project> </project>
<?xml version="1.0" encoding="UTF-8"?> <?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"> <project xmlns="http://maven.apache.org/POM/4.0.0"
<modelVersion>4.0.0</modelVersion> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<parent> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>amos-boot-module-biz</artifactId> <modelVersion>4.0.0</modelVersion>
<groupId>com.amosframework.boot</groupId> <parent>
<version>1.0.0</version> <artifactId>amos-boot-module-biz</artifactId>
</parent> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-supervision-biz</artifactId> <version>1.0.0</version>
</parent>
<artifactId>amos-boot-module-supervision-biz</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-supervision-api</artifactId> <artifactId>amos-boot-module-supervision-api</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
...@@ -92,6 +94,10 @@ ...@@ -92,6 +94,10 @@
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-mail</artifactId> <artifactId>spring-boot-starter-mail</artifactId>
</dependency> </dependency>
</dependencies> <dependency>
<groupId>cn.jpush.api</groupId>
<artifactId>jpush-client</artifactId>
</dependency>
</dependencies>
</project> </project>
...@@ -249,77 +249,6 @@ public class CheckController extends AbstractBaseController { ...@@ -249,77 +249,6 @@ public class CheckController extends AbstractBaseController {
FileHelper.exportZip(list, fileName, response); FileHelper.exportZip(list, fileName, response);
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存巡检记录<font color='blue'>手机app</font>", notes = "保存巡检记录<font color='blue'>手机app</font>")
@RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse saveCheckRecord(
@ApiParam(value = "检查信息", required = false) @RequestBody(required = true) CheckRecordParam requestParam) {
Toke token = new Toke();
token.setProduct(request.getHeader("product"));
token.setToke(request.getHeader("X-Access-Token"));
token.setAppKey(request.getHeader("appKey"));
int statu = -1;
PlanTask planTask = null;
if (requestParam.getPlanTaskId() != null && requestParam.getPlanTaskId() != 0) {
planTask = planTaskService.selectPlanTaskStatus(requestParam.getPlanTaskId());
}
AgencyUserModel user = getUserInfo();
String userId = user.getUserId();
String realName = user.getRealName();
requestParam.setIsOffline(requestParam.getIsOffline() == null ? false : requestParam.getIsOffline());
try {
if (planTask != null) {
if (!ToolUtils.transBeanList(planTask.getUserId()).contains(userId.toString())) {
return CommonResponseUtil.failure("无权执行该任务");
}
statu = planTask.getFinishStatus();
if (!requestParam.getIsOffline() && statu == PlanTaskFinishStatusEnum.OVERTIME.getValue()) {
return CommonResponseUtil.failure("任务已超时,上传失败!");
} else if (statu == PlanTaskFinishStatusEnum.FINISHED.getValue()) {
return CommonResponseUtil.failure("任务已完成!");
}
Date checkTime = requestParam.getIsOffline() ? DateUtil.getLongDate(requestParam.getCheckTime()) : new Date();
Date beginTime = DateUtil.getLongDate(planTask.getBeginTime());
Date endTime = DateUtil.getLongDate(planTask.getEndTime());
int beginCompareTo = checkTime.compareTo(beginTime);
int endCompareTo = checkTime.compareTo(endTime);
if (beginCompareTo == -1 || endCompareTo == 1) {
return CommonResponseUtil.failure("请在计划时间内完成任务!");
}
}
int count = checkService.checkHasRecord(requestParam);
if (count < 1 || requestParam.getPlanTaskId() < 1) {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
String departmentId = getDepartmentId(reginParams);
requestParam.setOrgCode(orgCode);
requestParam.setUserId(getUserId());
requestParam.setCheckDepartmentId(departmentId);
CheckDto checkDto = checkService.saveCheckRecord(requestParam, getUserInfo(), reginParams.getDepartment(), token);
if (StringUtil.isNotEmpty(checkDto)) {
asyncTaskf(checkDto.getCheckId());
}
is.pointCheckInfoPushToB(checkDto.getCheckId());
//数字换流站页面刷新
try {
webMqttComponent.publish(patrolTopic, "");
} catch (Exception e) {
log.error("数字换流站页面推送失败-----------" + e.getMessage());
}
return CommonResponseUtil.success(checkDto);
} else {
return CommonResponseUtil.success("无需重新巡检");
}
} catch (Exception e) {
e.printStackTrace();
// TODO Auto-generated catch block
log.error(e.getMessage());
return CommonResponseUtil.failure("数据提交失败");
}
}
@Async @Async
public void asyncTaskf(Long id) { public void asyncTaskf(Long id) {
...@@ -645,4 +574,20 @@ public class CheckController extends AbstractBaseController { ...@@ -645,4 +574,20 @@ public class CheckController extends AbstractBaseController {
return ResponseHelper.buildResponse(checkService.getPlanExecuteTeams()); return ResponseHelper.buildResponse(checkService.getPlanExecuteTeams());
} }
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "保存检查记录", notes = "保存检查记录")
@RequestMapping(value = "/saveRecord", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public ResponseModel saveSupervisionCheckRecord( @ApiParam(value = "检查信息", required = false) @RequestBody(required = true) CheckRecordParam requestParam) {
try {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
requestParam.setOrgCode(orgCode);
CheckDto checkDto = checkService.saveCheckRecord(requestParam, reginParams);
return ResponseHelper.buildResponse(checkDto);
} catch (Exception e) {
log.error(e.getMessage(), e);
return ResponseHelper.buildResponse(e.getMessage());
}
}
} }
...@@ -283,4 +283,6 @@ public interface CheckMapper extends BaseMapper { ...@@ -283,4 +283,6 @@ public interface CheckMapper extends BaseMapper {
List<Map<String, Object>> getPlanExecuteTeams(); List<Map<String, Object>> getPlanExecuteTeams();
int checkHasRecord(@Param(value = "planTaskId") Long planTaskId, @Param(value = "pointId") Long pointId);
} }
...@@ -36,4 +36,6 @@ public interface InputItemMapper { ...@@ -36,4 +36,6 @@ public interface InputItemMapper {
List<InputItemVo> getInputItemParent(@Param("id") String id); List<InputItemVo> getInputItemParent(@Param("id") String id);
void updatePointById(Map<String, Object> param); void updatePointById(Map<String, Object> param);
List<Long> getIds();
} }
...@@ -6,7 +6,9 @@ import org.apache.ibatis.annotations.Param; ...@@ -6,7 +6,9 @@ import org.apache.ibatis.annotations.Param;
public interface PlanTaskDetailMapper extends BaseMapper { public interface PlanTaskDetailMapper extends BaseMapper {
void finishTaskDetail(@Param(value="planTaskDetailId") long planTaskDetailId, @Param(value="pointId") long pointId, @Param(value="planTaskId") long planTaskId void finishTaskDetail(@Param(value="planTaskDetailId") long planTaskDetailId, @Param(value="pointId") long pointId, @Param(value="planTaskId") long planTaskId
, @Param(value="executorId") String executorId); , @Param(value="executorId") String executorId , @Param(value="executorName") String executorName);
Map findPlanTaskByTaskIdAndPointId(@Param(value="planTaskId") long planTaskId,@Param(value="pointId") long pointId); Map findPlanTaskByTaskIdAndPointId(@Param(value="planTaskId") long planTaskId,@Param(value="pointId") long pointId);
int findPlanTaskDetailByTaskId( @Param(value="planTaskId") long planTaskId);
} }
...@@ -27,8 +27,8 @@ public interface IPointDao extends BaseDao<Point, Long> { ...@@ -27,8 +27,8 @@ public interface IPointDao extends BaseDao<Point, Long> {
Optional<Point> findById(Long id); Optional<Point> findById(Long id);
@Query(value = "SELECT id FROM p_point p WHERE p.point_no = (?1) AND p.original_id = (?2)", nativeQuery = true) @Query(value = "SELECT id FROM p_point p WHERE p.point_no = (?1) and is_delete =0 limit 1", nativeQuery = true)
Long findPointByEquipmentIdAndFireFacilityId(String equipmentId, String specificId); Long findPointByPointNoId(String id);
@Modifying @Modifying
@Transactional @Transactional
...@@ -39,7 +39,7 @@ public interface IPointDao extends BaseDao<Point, Long> { ...@@ -39,7 +39,7 @@ public interface IPointDao extends BaseDao<Point, Long> {
@Modifying @Modifying
@Transactional @Transactional
@Query(value = "UPDATE p_point SET is_delete = 1 WHERE point_no IN (?1)", nativeQuery = true) @Query(value = "UPDATE p_point SET is_delete = 1 WHERE point_no = (?1)", nativeQuery = true)
void delPointByPointNo(Long id); void delPointByPointNo(Long id);
@Query(value = "SELECT id FROM p_point p WHERE is_delete = 0 AND p.point_no = (?1)", nativeQuery = true) @Query(value = "SELECT id FROM p_point p WHERE is_delete = 0 AND p.point_no = (?1)", nativeQuery = true)
......
package com.yeejoin.amos.supervision.business.param; package com.yeejoin.amos.supervision.business.param;
import com.yeejoin.amos.supervision.dao.entity.CheckShot;
import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Data
public class CheckInputParam { public class CheckInputParam {
private long inputItemId; private long inputItemId;
private String inputValue; private String inputValue;
private String selectName; private String selectName;
private boolean isCheck; private boolean isCheck;
private String remark; private String remark;
private Long classifyIds;
private Long routePointItemId; private Long routePointItemId;
private List<String> checkInputImg; private String userId;
public List<String> getCheckInputImg() { private String userName;
return checkInputImg; private String depId;
} private String depName;
private List<CheckShot> checkInputShot = new ArrayList<>();
public void setCheckInputImg(List<String> checkInputImg) {
this.checkInputImg = checkInputImg;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public long getInputItemId() {
return inputItemId;
}
public void setInputItemId(long inputItemId) {
this.inputItemId = inputItemId;
}
public String getInputValue() {
return inputValue;
}
public void setInputValue(String inputValue) {
this.inputValue = inputValue;
}
public String getSelectName() {
return selectName;
}
public void setSelectName(String selectName) {
this.selectName = selectName;
}
public boolean getIsCheck() {
return isCheck;
}
public void setIsCheck(boolean isCheck) {
this.isCheck = isCheck;
}
public Long getClassifyIds() {
return classifyIds;
}
public void setClassifyIds(Long classifyIds) {
this.classifyIds = classifyIds;
}
public Long getRoutePointItemId() {
return routePointItemId;
}
public void setRoutePointItemId(Long routePointItemId) {
this.routePointItemId = routePointItemId;
}
} }
package com.yeejoin.amos.supervision.business.param; package com.yeejoin.amos.supervision.business.param;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.ArrayList;
import java.util.List; import java.util.List;
@Data
public class CheckRecordParam { public class CheckRecordParam {
@ApiModelProperty(value = "任务id",required = true)
private Long planTaskId; private Long planTaskId;
private Long pointId;
private String pointName;
private Long checkId;
private String remark;
private String userId;
private String orgCode;
private String checkDepartmentId;
private List<String> checkRecordImg;
/**
* 检查项分类
*/
private Long classId;
/**
* 路线id
*/
private Long routeId;
/**
* 检查时间
*/
private String checkTime;
private String checkMode;
/**
* 是否离线提交
*/
private Boolean isOffline = false;
private List<CheckInputParam> checkItems;
public Long getPointId() {
return pointId;
}
public void setPointId(Long pointId) {
this.pointId = pointId;
}
public Long getCheckId() {
return checkId;
}
public void setCheckId(Long checkId) {
this.checkId = checkId;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public List<CheckInputParam> getCheckItems() {
return checkItems;
}
public void setCheckItems(List<CheckInputParam> checkItems) {
this.checkItems = checkItems;
}
public Long getPlanTaskId() { @ApiModelProperty(value = "点id",required = true)
return planTaskId; private Long pointId;
}
public void setPlanTaskId(Long planTaskId) {
this.planTaskId = planTaskId;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getCheckTime() {
return checkTime;
}
public String getCheckMode() {
return checkMode;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
public Long getRouteId() {
return routeId;
}
public void setRouteId(Long routeId) {
this.routeId = routeId;
}
public String getPointName() {
return pointName;
}
public void setPointName(String pointName) {
this.pointName = pointName;
}
public void setCheckMode(String checkMode) {
this.checkMode = checkMode;
}
public Long getClassId() {
return classId;
}
public void setClassId(Long classId) {
this.classId = classId;
}
public Boolean getIsOffline() {
return isOffline;
}
public void setIsOffline(Boolean isOffline) { @ApiModelProperty(value = "组织机构")
this.isOffline = isOffline; private String orgCode;
}
public String getCheckDepartmentId() { @ApiModelProperty(value = "备注")
return checkDepartmentId; private String remark;
}
public void setCheckDepartmentId(String checkDepartmentId) { @ApiModelProperty(value = "路线id")
this.checkDepartmentId = checkDepartmentId; private Long routeId;
}
public List<String> getCheckRecordImg() { @ApiModelProperty(value = "检查时间")
return checkRecordImg; private String checkTime;
}
public void setCheckRecordImg(List<String> checkRecordImg) { /**
this.checkRecordImg = checkRecordImg; * 检查项
} */
@ApiModelProperty(value = "检查项",required = true)
private List<CheckInputParam> checkItems = new ArrayList<>();
} }
...@@ -62,6 +62,12 @@ public class PlanInfoPageParam extends CommonPageable { ...@@ -62,6 +62,12 @@ public class PlanInfoPageParam extends CommonPageable {
*/ */
private String leadPerson; private String leadPerson;
/**
* 计划执行状态
* @return
*/
private int finishStatus;
public String getOwnerId() { public String getOwnerId() {
return ownerId; return ownerId;
} }
...@@ -141,4 +147,12 @@ public class PlanInfoPageParam extends CommonPageable { ...@@ -141,4 +147,12 @@ public class PlanInfoPageParam extends CommonPageable {
public void setLeadPerson(String leadPerson) { public void setLeadPerson(String leadPerson) {
this.leadPerson = leadPerson; this.leadPerson = leadPerson;
} }
public int getFinishStatus() {
return finishStatus;
}
public void setFinishStatus(int finishStatus) {
this.finishStatus = finishStatus;
}
} }
...@@ -36,15 +36,13 @@ import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone; ...@@ -36,15 +36,13 @@ import com.yeejoin.amos.supervision.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone; import com.yeejoin.amos.supervision.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.supervision.core.util.DateUtil; import com.yeejoin.amos.supervision.core.util.DateUtil;
import com.yeejoin.amos.supervision.core.util.StringUtil; import com.yeejoin.amos.supervision.core.util.StringUtil;
import com.yeejoin.amos.supervision.dao.entity.Check; import com.yeejoin.amos.supervision.dao.entity.*;
import com.yeejoin.amos.supervision.dao.entity.Plan;
import com.yeejoin.amos.supervision.dao.entity.PlanTask;
import com.yeejoin.amos.supervision.dao.entity.PlanTaskDetail;
import com.yeejoin.amos.supervision.exception.YeeException; import com.yeejoin.amos.supervision.exception.YeeException;
import com.yeejoin.amos.supervision.feign.RemoteSecurityService; import com.yeejoin.amos.supervision.feign.RemoteSecurityService;
import com.yeejoin.amos.supervision.quartz.IJobService; import com.yeejoin.amos.supervision.quartz.IJobService;
import org.apache.commons.collections.CollectionUtils; import org.apache.commons.collections.CollectionUtils;
import org.assertj.core.util.Lists; import org.assertj.core.util.Lists;
import org.checkerframework.checker.units.qual.A;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
...@@ -96,6 +94,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -96,6 +94,9 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
@Autowired @Autowired
private EquipFeign equipFeign; private EquipFeign equipFeign;
@Autowired
private IPointInputItemDao pointInputItemDao;
@Override @Override
public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) { public Page<HashMap<String, Object>> getPlanTaskInfo(PlanTaskPageParam params) {
long total = planTaskMapper.countPlanTask(params); long total = planTaskMapper.countPlanTask(params);
...@@ -510,6 +511,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService { ...@@ -510,6 +511,11 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
planTaskDetailInstance.setIsFinish(Integer.parseInt(XJConstant.PLAN_TASK_DET_FINISH_YES)); planTaskDetailInstance.setIsFinish(Integer.parseInt(XJConstant.PLAN_TASK_DET_FINISH_YES));
planTaskDetailInstance.setStatus("1"); planTaskDetailInstance.setStatus("1");
} }
// 查询点下检查项的个数
List<PointInputItem> pointInputItemByPointId = pointInputItemDao.getPointInputItemByPointId(pointId.longValue());
planTaskDetailInstance.setItemNum(pointInputItemByPointId.size());
// 2.保存执行数据明细表 // 2.保存执行数据明细表
planTaskDetail.saveAndFlush(planTaskDetailInstance); planTaskDetail.saveAndFlush(planTaskDetailInstance);
} }
......
...@@ -1162,26 +1162,27 @@ public class PointServiceImpl implements IPointService { ...@@ -1162,26 +1162,27 @@ public class PointServiceImpl implements IPointService {
} }
} }
point.setOrgCode(StringUtil.isNotEmpty(orgUsrFormDto.getAmosOrgCode()) ? orgUsrFormDto.getAmosOrgCode() : ""); point.setOrgCode(StringUtil.isNotEmpty(orgUsrFormDto.getAmosOrgCode()) ? orgUsrFormDto.getAmosOrgCode() : "");
Long pointId = iPointDao.findPointByEquipmentIdAndFireFacilityId(id, point.getOriginalId()); Long pointId = iPointDao.findPointByPointNoId(point.getPointNo());
if (null != pointId) { if (null != pointId) {
ids.add(pointId); ids.add(pointId);
iPointDao.delPointBIds(pointId); iPointDao.delPointBIds(pointId);
} }
iPointDao.save(point); iPointDao.save(point);
List<InputItem> inputItemVos = inputItemMapper.getInputItemByEquipmentName(point.getName()); List<Long> itemIds = inputItemMapper.getIds();
if (0 < inputItemVos.size()) { if (0 < itemIds.size()) {
inputItemVos.forEach(y -> { itemIds.forEach(y -> {
PointInputItem inputItem = new PointInputItem(); PointInputItem inputItem = new PointInputItem();
inputItem.setPointId(point.getId()); inputItem.setPointId(point.getId());
inputItem.setOrderNo(y.getOrderNo()); inputItem.setInputItemId(y);
inputItem.setInputItemId(y.getId());
inputItems.add(inputItem); inputItems.add(inputItem);
}); });
} }
if (0 < ids.size()) { if (0 < ids.size()) {
iPointInputItemDao.deleteByPointId(ids); iPointInputItemDao.deleteByPointId(ids);
} }
iPointInputItemDao.saveAll(inputItems); if (0 < inputItems.size()) {
iPointInputItemDao.saveAll(inputItems);
}
} }
@Override @Override
......
...@@ -4,6 +4,7 @@ import java.util.HashMap; ...@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo; import com.yeejoin.amos.supervision.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.supervision.business.vo.CheckInfoVo; import com.yeejoin.amos.supervision.business.vo.CheckInfoVo;
import com.yeejoin.amos.supervision.core.common.request.CommonPageable; import com.yeejoin.amos.supervision.core.common.request.CommonPageable;
...@@ -46,7 +47,7 @@ public interface ICheckService { ...@@ -46,7 +47,7 @@ public interface ICheckService {
void saveCheckImg(List<CheckShot> imgList); void saveCheckImg(List<CheckShot> imgList);
CheckDto saveCheckRecord(CheckRecordParam requestParam, AgencyUserModel user, DepartmentBo departmentModel, Toke token); // CheckDto saveCheckRecord(CheckRecordParam requestParam, AgencyUserModel user, DepartmentBo departmentModel, Toke token);
/** /**
* 巡检记录删除 * 巡检记录删除
...@@ -64,15 +65,6 @@ public interface ICheckService { ...@@ -64,15 +65,6 @@ public interface ICheckService {
*/ */
List<Map> queryUnqualifiedInputItem(int checkId); List<Map> queryUnqualifiedInputItem(int checkId);
/**
* 检查该店时候已经巡检完成
*
* @param requestParam
* @return
*/
int checkHasRecord(CheckRecordParam requestParam);
AppPointCheckRespone queryCheckPointDetail(String toke,String product,String appKey,long checkId); AppPointCheckRespone queryCheckPointDetail(String toke,String product,String appKey,long checkId);
AppPointCheckRespone queryCheckPointDetailInVersion2(String toke,String product,String appKey,long checkId); AppPointCheckRespone queryCheckPointDetailInVersion2(String toke,String product,String appKey,long checkId);
...@@ -278,4 +270,20 @@ public interface ICheckService { ...@@ -278,4 +270,20 @@ public interface ICheckService {
List<Map<String, String>> getPlanExecuteStates(); List<Map<String, String>> getPlanExecuteStates();
List<Map<String, Object>> getPlanExecuteTeams(); List<Map<String, Object>> getPlanExecuteTeams();
/**
* 保存检查记录
* @param recordParam 填写记录
* @param reginParams 权限信息
* @return CheckDto
*/
CheckDto saveCheckRecord(CheckRecordParam recordParam, ReginParams reginParams) throws Exception;
/**
* 校验是否已经填写过
* @param planTaskId
* @param pointId
* @return
*/
int checkHasRecord(Long planTaskId, Long pointId);
} }
...@@ -17,8 +17,6 @@ public class CheckParamUtil { ...@@ -17,8 +17,6 @@ public class CheckParamUtil {
if("checkTime".equals(name)){ if("checkTime".equals(name)){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM");
param.setCheckTime(daoCriterias.get(i).getValue().toString()); param.setCheckTime(daoCriterias.get(i).getValue().toString());
}else if("userId".equals(name)){
param.setUserId(daoCriterias.get(i).getValue().toString());
}else if("routeId".equals(name)){ }else if("routeId".equals(name)){
param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString())); param.setRouteId(Long.valueOf(daoCriterias.get(i).getValue().toString()));
}else if("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())){ }else if("orgCode".equals(name) && operator.equals(QueryOperatorEnum.EQUAL.getName())){
......
...@@ -270,9 +270,11 @@ public class AlertCalledController extends BaseController { ...@@ -270,9 +270,11 @@ public class AlertCalledController extends BaseController {
queryWrapper.orderByDesc("call_time"); queryWrapper.orderByDesc("call_time");
if(null != alertCalled.getCallTimeStart() && null != alertCalled.getCallTimeEnd()) { if(!ValidationUtil.isEmpty(alertCalled.getIsAuxiliaryScreen())) {
queryWrapper.between("call_time", alertCalled.getCallTimeStart(), if(!ValidationUtil.isEmpty(alertCalled.getCallTimeStart()) && !ValidationUtil.isEmpty(alertCalled.getCallTimeEnd())) {
alertCalled.getCallTimeEnd().getTime()); queryWrapper.between("call_time", alertCalled.getCallTimeStart(),
alertCalled.getCallTimeEnd().getTime());
}
} else { } else {
queryWrapper.between("call_time", DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN), queryWrapper.between("call_time", DateUtils.stampToDate(System.currentTimeMillis(),DateUtils.DATE_PATTERN),
DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN)); DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN));
...@@ -282,15 +284,15 @@ public class AlertCalledController extends BaseController { ...@@ -282,15 +284,15 @@ public class AlertCalledController extends BaseController {
queryWrapper.isNull("father_alert"); queryWrapper.isNull("father_alert");
} }
if(ValidationUtil.isEmpty(alertCalled.getType())) { if(!ValidationUtil.isEmpty(alertCalled.getType())) {
queryWrapper.eq("type",alertCalled.getType()); queryWrapper.eq("type",alertCalled.getType());
} }
if(ValidationUtil.isEmpty(alertCalled.getAlarmType())) { if(!ValidationUtil.isEmpty(alertCalled.getAlarmType())) {
queryWrapper.eq("alarm_type",alertCalled.getAlarmType()); queryWrapper.eq("alarm_type",alertCalled.getAlarmType());
} }
if(ValidationUtil.isEmpty(alertCalled.getAlertSource())) { if(!ValidationUtil.isEmpty(alertCalled.getAlertSource())) {
queryWrapper.eq("alert_source",alertCalled.getAlertSource()); queryWrapper.eq("alert_source",alertCalled.getAlertSource());
} }
return queryWrapper; return queryWrapper;
......
...@@ -81,10 +81,13 @@ public class CtiController extends BaseController { ...@@ -81,10 +81,13 @@ public class CtiController extends BaseController {
* @return * @return
*/ */
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/info/{connectId}") @GetMapping(value = "/info/{serviceconnectionid}")
@ApiOperation(httpMethod = "GET", value = "获取通话话单详情", notes = "获取通话话单详情") @ApiOperation(httpMethod = "GET", value = "获取通话话单详情", notes = "获取通话话单详情")
public ResponseModel<JSONObject> getCallInfo(@PathVariable String connectId) { public ResponseModel<JSONObject> getCallInfo(@PathVariable String serviceconnectionid) {
JSONArray recordInfos = ctiService.getCallInfo(connectId); JSONArray recordInfos = ctiService.getCallInfo(serviceconnectionid);
if(recordInfos.size() == 0) {
throw new BadRequest("未找到相关通话信息");
}
JSONObject recordInfo = recordInfos.getJSONObject(0); JSONObject recordInfo = recordInfos.getJSONObject(0);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ"); SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
return ResponseHelper.buildResponse(recordInfo); return ResponseHelper.buildResponse(recordInfo);
......
...@@ -116,7 +116,7 @@ public class VoiceRecordFileController extends BaseController { ...@@ -116,7 +116,7 @@ public class VoiceRecordFileController extends BaseController {
/** /**
* 新增通话记录 * 新增-通话记录
* *
* @return * @return
*/ */
...@@ -135,13 +135,13 @@ public class VoiceRecordFileController extends BaseController { ...@@ -135,13 +135,13 @@ public class VoiceRecordFileController extends BaseController {
} }
JSONObject recordInfo = recordInfos.getJSONObject(0); JSONObject recordInfo = recordInfos.getJSONObject(0);
model.setTel(recordInfo.getString("telephone")); model.setTel(recordInfo.getString("telephone"));
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ");
Date telStartTime = null; Date telStartTime = null;
Date telEndTime = null; Date telEndTime = null;
try { try {
telStartTime = sdf.parse(recordInfo.getString("connectTime")); telStartTime = DateUtils.longStr2Date(recordInfo.getString("connectTime"));
telEndTime = sdf.parse(recordInfo.getString("hangupTime")); telEndTime = DateUtils.longStr2Date(recordInfo.getString("hangupTime"));
} catch (ParseException e) { } catch (Exception e) {
throw new BadRequest("日期转换错误"); throw new BadRequest("日期转换错误");
} }
model.setTelStartTime(telStartTime); model.setTelStartTime(telStartTime);
...@@ -152,8 +152,13 @@ public class VoiceRecordFileController extends BaseController { ...@@ -152,8 +152,13 @@ public class VoiceRecordFileController extends BaseController {
model.setFileType("坐席呼出"); model.setFileType("坐席呼出");
} }
// 获取附件 // 获取附件 需要延时5S
Map<String, String> downloadFile = ctiService.downLoadRecordFile(model.getConnectId()); try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
}
Map<String, String> downloadFile = ctiService.downLoadRecordFile(recordInfo.getString("connectionid"));
if(downloadFile.isEmpty()) { if(downloadFile.isEmpty()) {
throw new BadRequest("未找到附件文件"); throw new BadRequest("未找到附件文件");
} }
......
package com.yeejoin.amos.boot.module.tzs.biz.service.impl; package com.yeejoin.amos.boot.module.tzs.biz.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.google.common.collect.Maps;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey; import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils; import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledFormDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledObjsDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.AlertCalledQueryDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.FormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.tzs.api.entity.Elevator;
import com.yeejoin.amos.boot.module.tzs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.tzs.api.enums.DispatchPaperEnums;
import com.yeejoin.amos.boot.module.tzs.api.mapper.AlertCalledMapper;
import com.yeejoin.amos.boot.module.tzs.api.service.IAlertCalledService;
import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService; import com.yeejoin.amos.boot.module.tzs.api.service.ICtiService;
import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils; import com.yeejoin.amos.boot.module.tzs.biz.utils.HttpUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.feign.systemctl.Systemctl; import com.yeejoin.amos.feign.systemctl.Systemctl;
import com.yeejoin.amos.feign.systemctl.model.FileInfoModel;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileItemFactory;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.MediaType;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.security.MessageDigest; import java.security.MessageDigest;
import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.List;
import java.util.Map; import java.util.Map;
/** /**
...@@ -70,11 +36,14 @@ public class CtiServiceImpl implements ICtiService { ...@@ -70,11 +36,14 @@ public class CtiServiceImpl implements ICtiService {
*/ */
private long time = 6000l; private long time = 6000l;
private final String APP_KEY = "4e805006-3fef-ae43-3915-a153731007c4"; @Value("${tzs.cti.appkey}")
private String APP_KEY;
private final String SECRET_KEY = "7bd29115-99ee-4f7d-1fb1-7c4719d5f43a"; @Value("${tzs.cti.secretkey}")
private String SECRET_KEY;
private String ctiUrl = "http://36.46.151.113:8000"; @Value("${tzs.cti.url}")
private String ctiUrl;
@Override @Override
public String getAccessToken() { public String getAccessToken() {
...@@ -144,11 +113,11 @@ public class CtiServiceImpl implements ICtiService { ...@@ -144,11 +113,11 @@ public class CtiServiceImpl implements ICtiService {
} }
@Override @Override
public JSONArray getCallInfo(String connectionid) { public JSONArray getCallInfo(String serviceconnectionid) {
String token = this.getAccessToken(); String token = this.getAccessToken();
String url = ctiUrl + "/onOpenAuth/cti/openApi/querycalllist1"; String url = ctiUrl + "/onOpenAuth/cti/openApi/queryservicelist1";
JSONObject params = new JSONObject(); JSONObject params = new JSONObject();
params.put("connectionid",connectionid); params.put("serviceconnectionid",serviceconnectionid);
Map<String,String> header = new HashMap<>(); Map<String,String> header = new HashMap<>();
header.put("accessToken",token); header.put("accessToken",token);
String responseStr = HttpUtils.doPostWithHeader(url,params.toJSONString(),header); String responseStr = HttpUtils.doPostWithHeader(url,params.toJSONString(),header);
......
...@@ -51,6 +51,5 @@ ...@@ -51,6 +51,5 @@
<module>amos-boot-module-fas-biz</module> <module>amos-boot-module-fas-biz</module>
<module>amos-boot-module-maintenance-biz</module> <module>amos-boot-module-maintenance-biz</module>
<module>amos-boot-module-supervision-biz</module> <module>amos-boot-module-supervision-biz</module>
<module>amos-boot-module-jpush-biz</module>
</modules> </modules>
</project> </project>
\ No newline at end of file
...@@ -29,7 +29,7 @@ emqx.password=a123456 ...@@ -29,7 +29,7 @@ emqx.password=a123456
rule.definition.load=false rule.definition.load=false
rule.definition.model-package=com.yeejoin.amos.boot.module.jcs.api.dto rule.definition.model-package=com.yeejoin.amos.boot.module.jcs.api.dto
rule.definition.default-agency=jcs rule.definition.default-agency=jcs
rule.definition.localIp=172.16.3.39 rule.definition.localIp=172.16.10.66
## mongodb properties: ## mongodb properties:
spring.data.mongodb.uri=mongodb://172.16.10.66:27017/command_db spring.data.mongodb.uri=mongodb://172.16.10.66:27017/command_db
......
...@@ -154,5 +154,11 @@ ...@@ -154,5 +154,11 @@
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="chenhao" id="2021-08-31-chenhao-1">
<comment>modify table cb_firefighters_thought add one columns</comment>
<sql>
ALTER TABLE `cb_firefighters_thought` modify talking_time datetime COMMENT '谈话时间';
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
...@@ -13,11 +13,13 @@ import org.springframework.cloud.openfeign.EnableFeignClients; ...@@ -13,11 +13,13 @@ import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.FilterType;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.data.jpa.repository.config.EnableJpaAuditing; import org.springframework.data.jpa.repository.config.EnableJpaAuditing;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement; import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate; import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.restful.config.JsonSerializerManage;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler; import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import java.io.IOException; import java.io.IOException;
...@@ -42,8 +44,9 @@ import java.net.UnknownHostException; ...@@ -42,8 +44,9 @@ import java.net.UnknownHostException;
@EnableFeignClients @EnableFeignClients
@EnableAsync @EnableAsync
@EnableEurekaClient @EnableEurekaClient
@ComponentScan({"org.typroject", "com.yeejoin.amos"}) @ComponentScan(value = {"org.typroject", "com.yeejoin.amos"}, excludeFilters = {
@MapperScan(basePackages = {"com.yeejoin.amos.maintenance.business.dao.mapper", "org.typroject.tyboot.core.auth.face.orm.dao","com.yeejoin.amos.boot.biz.common.dao.mapper"}) @ComponentScan.Filter(type = FilterType.ASSIGNABLE_TYPE, classes = {JsonSerializerManage.class})})
@MapperScan(basePackages = {"com.yeejoin.amos.maintenance.business.dao.mapper", "org.typroject.tyboot.core.auth.face.orm.dao", "com.yeejoin.amos.boot.biz.common.dao.mapper"})
public class MaintenanceApplication { public class MaintenanceApplication {
private static final Logger logger = LoggerFactory.getLogger(MaintenanceApplication.class); private static final Logger logger = LoggerFactory.getLogger(MaintenanceApplication.class);
...@@ -61,9 +64,9 @@ public class MaintenanceApplication { ...@@ -61,9 +64,9 @@ public class MaintenanceApplication {
* @throws IOException * @throws IOException
* @throws URISyntaxException * @throws URISyntaxException
*/ */
public static void main(String[] args) throws UnknownHostException{ public static void main(String[] args) throws UnknownHostException {
logger.info("start Service.........."); logger.info("start Service..........");
ConfigurableApplicationContext context = SpringApplication.run(MaintenanceApplication.class, args); ConfigurableApplicationContext context = SpringApplication.run(MaintenanceApplication.class, args);
GlobalExceptionHandler.setAlwaysOk(true); GlobalExceptionHandler.setAlwaysOk(true);
Environment env = context.getEnvironment(); Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress(); String ip = InetAddress.getLocalHost().getHostAddress();
......
...@@ -190,4 +190,48 @@ ...@@ -190,4 +190,48 @@
ALTER TABLE p_plan_task add COLUMN `company_name` varchar(255) DEFAULT NULL COMMENT '维保公司名称'; ALTER TABLE p_plan_task add COLUMN `company_name` varchar(255) DEFAULT NULL COMMENT '维保公司名称';
</sql> </sql>
</changeSet> </changeSet>
<changeSet author="suhuiguang" id="1630291249911-1">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_check" columnName="risk_and_manage"/>
</not>
</preConditions>
<comment>p_check add COLUMN risk_and_manage '风险辨识与管控措施'</comment>
<sql>
ALTER TABLE p_check add COLUMN `risk_and_manage` varchar(255) DEFAULT NULL COMMENT '风险辨识与管控措施' after `point_no`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1630291249911-2">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_check" columnName="begin_time"/>
</not>
</preConditions>
<comment>p_check add COLUMN begin_time '开始时间'</comment>
<sql>
ALTER TABLE p_check add COLUMN `begin_time` datetime DEFAULT NULL COMMENT '开始时间' after `plan_task_detail_id`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1630291249911-3">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_check" columnName="end_time"/>
</not>
</preConditions>
<comment>p_check add COLUMN end_time '结束时间'</comment>
<sql>
ALTER TABLE p_check add COLUMN `end_time` datetime DEFAULT NULL COMMENT '结束时间' after `begin_time`;
</sql>
</changeSet>
<changeSet author="suhuiguang" id="1630291249911-4">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="p_check" columnName="owner_name"/>
</not>
</preConditions>
<comment>p_check add COLUMN owner_name '业主单位名称'</comment>
<sql>
ALTER TABLE p_check add COLUMN `owner_name` varchar(255) DEFAULT NULL COMMENT '业主单位名称' after `owner_id`;
</sql>
</changeSet>
</databaseChangeLog> </databaseChangeLog>
\ No newline at end of file
...@@ -1965,6 +1965,9 @@ ...@@ -1965,6 +1965,9 @@
) )
) )
</if> </if>
<if test="result !=null and result !=''">
and a.isOk = #{result}
</if>
<choose> <choose>
<when test="identityType==1"> <when test="identityType==1">
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} ) And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )
...@@ -2023,42 +2026,31 @@ ...@@ -2023,42 +2026,31 @@
</select> </select>
<select id="getCheckDetail" resultType="Map"> <select id="getCheckDetail" resultType="Map">
SELECT SELECT
pc.id checkId, pc.id,
pci.is_ok isOk, pc.point_name as pointName,
pc.point_no as pointNo,
pc.is_ok isOk,
CONCAT_WS(',',pc.building_name,pc.address) address,
pc.user_name as userName,
pc.plan_id as planId,
pc.plan_name as planName,
pc.plan_type as planType,
pc.owner_name as ownerName,
date_format( date_format(
pc.check_time, pc.begin_time,
'%Y-%m-%d %H:%i:%s' '%Y-%m-%d %H:%i:%s'
) maintenanceDate, ) as beginTime,
pp.id pointId, date_format(
pp.equipment_id equipmentId, pc.end_time,
pp.remark remark, '%Y-%m-%d %H:%i:%s'
pp.owner_name ownerName, ) as endTime,
pp.equipment_name equipmentName, date_format(
pp.belong_system_id systemId, pc.check_time,
pp.belong_system_name systemName, '%Y-%m-%d %H:%i:%s'
CONCAT_WS(',',pp.building_name,pp.address) address, ) as checkTime,
CONCAT(date_format( pc.risk_and_manage as riskAndManage,
ppl.plan_begin, pc.remark
'%Y-%m-%d %H:%i:%s'
), '-', date_format(
ppl.plan_end,
'%Y-%m-%d %H:%i:%s'
)) planDate,
ppl.name planName,
ppl.plan_type planType,
ppt.user_name planUser,
pci.input_name itemName,
pii.maintenance_content itemContent,
pcs.photo_data picture,
pcs.point_name pointName,
pcs.shot_type shotType
FROM p_check pc FROM p_check pc
LEFT JOIN p_point pp ON pp.id = pc.point_id
LEFT JOIN p_plan ppl ON ppl.id = pc.plan_id
LEFT JOIN p_check_input pci ON pci.check_id = pc.id
LEFT JOIN p_input_item pii ON pii.id = pci.input_id
LEFT JOIN p_check_shot pcs ON pcs.check_id = pc.id
LEFT JOIN p_plan_task ppt ON ppt.id = pc.plan_task_id
WHERE WHERE
pc.id = #{id} pc.id = #{id}
</select> </select>
...@@ -2073,7 +2065,10 @@ ...@@ -2073,7 +2065,10 @@
ci.order_no, ci.order_no,
#{fileUrl} as prefix, #{fileUrl} as prefix,
ii.picture_json, ii.picture_json,
ii.data_json ii.data_json,
ii.test_requirement as testRequirement,
ii.basis_json as basisJson,
ii.is_must as isMust
from p_check_input ci from p_check_input ci
left join p_input_item ii on ci.input_id = ii.id left join p_input_item ii on ci.input_id = ii.id
where ci.check_id=#{checkId} where ci.check_id=#{checkId}
......
...@@ -239,6 +239,8 @@ ...@@ -239,6 +239,8 @@
pii.item_type itemType, pii.item_type itemType,
pii.test_requirement testRequirement, pii.test_requirement testRequirement,
pii.data_json dataJson, pii.data_json dataJson,
pii.basis_json as basisJson,
pii.default_value as defaultValue,
pii.is_must isMust, pii.is_must isMust,
pii.picture_json pictureJson, pii.picture_json pictureJson,
pii.order_no orderNo, pii.order_no orderNo,
......
...@@ -392,6 +392,9 @@ ...@@ -392,6 +392,9 @@
temp1.pointNo, temp1.pointNo,
temp1.buildingName, temp1.buildingName,
temp1.equipmentName, temp1.equipmentName,
temp1.remark as riskAndManage,
temp1.address,
temp1.ownerName,
pii.`name` inputName, pii.`name` inputName,
temp2.* temp2.*
FROM FROM
...@@ -410,9 +413,12 @@ ...@@ -410,9 +413,12 @@
r.name as routeName, r.name as routeName,
p.name as pointName, p.name as pointName,
p.owner_id as ownerId, p.owner_id as ownerId,
p.owner_name as ownerName,
p.point_no as pointNo, p.point_no as pointNo,
p.building_name as buildingName, p.building_name as buildingName,
p.equipment_name as equipmentName p.equipment_name as equipmentName,
p.remark,
p.address
FROM FROM
p_route_point_item prpi p_route_point_item prpi
LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id LEFT JOIN p_route_point prp ON prp.id = prpi.route_point_id
...@@ -430,7 +436,7 @@ ...@@ -430,7 +436,7 @@
ptd.plan_id planId, ptd.plan_id planId,
ptd.user_id AS userId, ptd.user_id AS userId,
ptd.org_code AS orgCode, ptd.org_code AS orgCode,
ptd.end_time AS endTime, ptd.begin_time AS beginTime,
ptd.end_time AS endTime, ptd.end_time AS endTime,
ptd.company_id as companyId, ptd.company_id as companyId,
ptd.company_name as companyName, ptd.company_name as companyName,
......
<?xml version="1.0" encoding="UTF-8"?> <?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" <project xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
<modelVersion>4.0.0</modelVersion> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent> <modelVersion>4.0.0</modelVersion>
<artifactId>amos-biz-boot</artifactId> <parent>
<groupId>com.amosframework.boot</groupId> <artifactId>amos-biz-boot</artifactId>
<version>1.0.0</version> <groupId>com.amosframework.boot</groupId>
</parent> <version>1.0.0</version>
<artifactId>amos-boot-system-supervision</artifactId> </parent>
<dependencies> <artifactId>amos-boot-system-supervision</artifactId>
<dependency> <dependencies>
<groupId>com.amosframework.boot</groupId> <dependency>
<artifactId>amos-boot-module-supervision-biz</artifactId> <groupId>com.amosframework.boot</groupId>
<version>${amos-biz-boot.version}</version> <artifactId>amos-boot-module-supervision-biz</artifactId>
</dependency> <version>${amos-biz-boot.version}</version>
</dependencies> </dependency>
<build> <dependency>
<plugins> <groupId>cn.jpush.api</groupId>
<plugin> <artifactId>jpush-client</artifactId>
<groupId>org.springframework.boot</groupId> </dependency>
<artifactId>spring-boot-maven-plugin</artifactId> </dependencies>
</plugin> <build>
</plugins> <plugins>
</build> <plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
</build>
</project> </project>
...@@ -250,16 +250,16 @@ ...@@ -250,16 +250,16 @@
order by pci.order_no order by pci.order_no
</select> </select>
<select id="checkHasRecord" resultType="int"> <!-- <select id="checkHasRecord" resultType="int">-->
SELECT <!-- SELECT-->
count(1) num <!-- count(1) num-->
FROM <!-- FROM-->
p_check c <!-- p_check c-->
WHERE <!-- WHERE-->
is_ok in (1,2) <!-- is_ok in (1,2)-->
and c.point_id = #{pointId} <!-- and c.point_id = #{pointId}-->
and c.plan_task_id = #{planTaskId} <!-- and c.plan_task_id = #{planTaskId}-->
</select> <!-- </select>-->
<select id="pieChartData" resultType="Map"> <select id="pieChartData" resultType="Map">
SELECT SELECT
...@@ -1956,4 +1956,15 @@ ...@@ -1956,4 +1956,15 @@
FROM FROM
p_check pc p_check pc
</select> </select>
<select id="checkHasRecord" resultType="int">
SELECT
count(1) num
FROM
p_check c
WHERE
c.point_id = #{pointId}
and c.plan_task_id = #{planTaskId}
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -296,4 +296,13 @@ ...@@ -296,4 +296,13 @@
<update id="updatePointById" parameterType="map"> <update id="updatePointById" parameterType="map">
update p_input_item SET item_start = #{itemStart} WHERE id = #{id} update p_input_item SET item_start = #{itemStart} WHERE id = #{id}
</update> </update>
<select id="getIds" resultType="long">
SELECT
id
FROM
p_input_item
WHERE
is_delete = 0
</select>
</mapper> </mapper>
\ No newline at end of file
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"http://mybatis.org/dtd/mybatis-3-mapper.dtd"> "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper"> <mapper namespace="com.yeejoin.amos.supervision.business.dao.mapper.PlanTaskDetailMapper">
<update id="finishTaskDetail"> <update id="finishTaskDetail">
call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId}) call updatePlanTask(#{planTaskId}, #{pointId}, #{planTaskDetailId} ,#{executorId},#{executorName})
</update> </update>
<select id="findPlanTaskByTaskIdAndPointId" resultType="Map"> <select id="findPlanTaskByTaskIdAndPointId" resultType="Map">
......
...@@ -37,7 +37,6 @@ emqx.broker=tcp://172.16.10.85:1883 ...@@ -37,7 +37,6 @@ emqx.broker=tcp://172.16.10.85:1883
emqx.user-name=super emqx.user-name=super
emqx.password=a123456 emqx.password=a123456
## redisʱʱ tzs.cti.appkey=4e805006-3fef-ae43-3915-a153731007c4
redis.cache.failure.time=10800 tzs.cti.secretkey=7bd29115-99ee-4f7d-1fb1-7c4719d5f43a
tzs.cti.url=http://36.46.151.113:8000
failure.work.flow.processDefinitionKey=malfunction_repair
\ No newline at end of file
...@@ -8,6 +8,8 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss ...@@ -8,6 +8,8 @@ spring.jackson.date-format=yyyy-MM-dd HH:mm:ss
logging.config=classpath:logback-${spring.profiles.active}.xml logging.config=classpath:logback-${spring.profiles.active}.xml
mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl mybatis-plus.configuration.log-impl=org.apache.ibatis.logging.stdout.StdOutImpl
## DB properties:
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
spring.datasource.type=com.zaxxer.hikari.HikariDataSource spring.datasource.type=com.zaxxer.hikari.HikariDataSource
spring.datasource.hikari.minimum-idle=10 spring.datasource.hikari.minimum-idle=10
spring.datasource.hikari.maximum-pool-size=25 spring.datasource.hikari.maximum-pool-size=25
...@@ -17,6 +19,24 @@ spring.datasource.hikari.pool-name=DatebookHikariCP ...@@ -17,6 +19,24 @@ spring.datasource.hikari.pool-name=DatebookHikariCP
spring.datasource.hikari.max-lifetime=120000 spring.datasource.hikari.max-lifetime=120000
spring.datasource.hikari.connection-timeout=30000 spring.datasource.hikari.connection-timeout=30000
spring.datasource.hikari.connection-test-query=SELECT 1 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
iot.fegin.name=AMOS-API-IOT iot.fegin.name=AMOS-API-IOT
...@@ -24,4 +44,12 @@ equip.fegin.name=AMOS-EQUIPMANAGE ...@@ -24,4 +44,12 @@ equip.fegin.name=AMOS-EQUIPMANAGE
supervision.feign.name = AMOS-SUPERVISION-API supervision.feign.name = AMOS-SUPERVISION-API
security.systemctl.name=AMOS-API-SYSTEMCTL security.systemctl.name=AMOS-API-SYSTEMCTL
\ No newline at end of file
jcs.company.topic.add=jcs/company/topic/add
jcs.company.topic.delete=jcs/company/topic/delete
## 设备联动服务(车库门、广播、警铃)
control.fegin.name=JCS-API-CONTROL
## redis超时时间
redis.cache.failure.time=10800
failure.work.flow.processDefinitionKey=malfunction_repair
...@@ -4,34 +4,23 @@ ...@@ -4,34 +4,23 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> 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> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<artifactId>amos-boot-module-biz</artifactId> <artifactId>amos-boot-utils</artifactId>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<version>1.0.0</version> <version>1.0.0</version>
</parent> </parent>
<artifactId>amos-boot-module-jpush-biz</artifactId> <artifactId>amos-boot-utils-jpush</artifactId>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.amosframework.boot</groupId> <groupId>com.amosframework.boot</groupId>
<artifactId>amos-boot-module-jpush-api</artifactId> <artifactId>amos-boot-core</artifactId>
<version>${amos-biz-boot.version}</version> <version>${amos-biz-boot.version}</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.amosframework.boot</groupId> <groupId>cn.jpush.api</groupId>
<artifactId>amos-boot-biz-common</artifactId> <artifactId>jpush-client</artifactId>
<version>${amos-biz-boot.version}</version>
<exclusions>
<exclusion>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-generator</artifactId>
</exclusion>
<exclusion>
<groupId>com.baomidou</groupId>
<artifactId>mybatis-plus-boot-starter</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
</dependencies> </dependencies>
</project> </project>
...@@ -16,7 +16,7 @@ import org.springframework.context.ConfigurableApplicationContext; ...@@ -16,7 +16,7 @@ import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment; import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.annotation.EnableAsync;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler; //import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
/** /**
* <pre> * <pre>
...@@ -40,7 +40,7 @@ public class JpushApplication { ...@@ -40,7 +40,7 @@ public class JpushApplication {
public static void main(String[] args) throws UnknownHostException { public static void main(String[] args) throws UnknownHostException {
ConfigurableApplicationContext context = SpringApplication.run(JpushApplication.class, args); ConfigurableApplicationContext context = SpringApplication.run(JpushApplication.class, args);
GlobalExceptionHandler.setAlwaysOk(true); // GlobalExceptionHandler.setAlwaysOk(true);
Environment env = context.getEnvironment(); Environment env = context.getEnvironment();
String ip = InetAddress.getLocalHost().getHostAddress(); String ip = InetAddress.getLocalHost().getHostAddress();
String port = env.getProperty("server.port"); String port = env.getProperty("server.port");
......
package com.yeejoin.amos.jpush.service.business.controller; package com.yeejoin.amos.jpush.service.business.controller;
import com.yeejoin.amos.jpush.common.entity.CommonResponse;
import com.yeejoin.amos.jpush.common.entity.CommonResponseUtil;
import com.yeejoin.amos.jpush.service.business.param.PushMsgParam;
import com.yeejoin.amos.jpush.service.jpush.AppMessagePushService;
import cn.jpush.api.push.model.PushPayload; import cn.jpush.api.push.model.PushPayload;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
...@@ -17,8 +12,11 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -17,8 +12,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation; import com.yeejoin.amos.jpush.common.entity.CommonResponse;
import com.yeejoin.amos.jpush.common.entity.CommonResponseUtil;
import com.yeejoin.amos.jpush.service.business.param.PushMsgParam;
import com.yeejoin.amos.jpush.service.jpush.AppMessagePushService;
/** /**
...@@ -40,7 +38,7 @@ public class UserController { ...@@ -40,7 +38,7 @@ public class UserController {
//极光推送 //极光推送
@ApiOperation(value = "发送消息", notes = "发送消息") @ApiOperation(value = "发送消息", notes = "发送消息")
@RequestMapping(value = "/sendMessage", method = RequestMethod.POST) @RequestMapping(value = "/sendMessage", method = RequestMethod.POST)
public CommonResponse sendMessage(@RequestBody List<PushMsgParam> responses) { public CommonResponse sendMessage(@RequestBody List<PushMsgParam> responses) {
...@@ -53,7 +51,7 @@ public class UserController { ...@@ -53,7 +51,7 @@ public class UserController {
return CommonResponseUtil.failure("发送失败"); return CommonResponseUtil.failure("发送失败");
} }
} }
@ApiOperation(value = "发送消息", notes = "发送消息") @ApiOperation(value = "发送消息", notes = "发送消息")
@RequestMapping(value = "/sendMessageone", method = RequestMethod.POST) @RequestMapping(value = "/sendMessageone", method = RequestMethod.POST)
public CommonResponse sendMessageone(@RequestBody PushMsgParam responses) { public CommonResponse sendMessageone(@RequestBody PushMsgParam responses) {
...@@ -66,7 +64,6 @@ public class UserController { ...@@ -66,7 +64,6 @@ public class UserController {
return CommonResponseUtil.failure("发送失败"); return CommonResponseUtil.failure("发送失败");
} }
} }
@ApiOperation(value = "发送消息", notes = "发送消息") @ApiOperation(value = "发送消息", notes = "发送消息")
@RequestMapping(value = "/pushNoticeMany", method = RequestMethod.POST) @RequestMapping(value = "/pushNoticeMany", method = RequestMethod.POST)
public CommonResponse pushNoticeMany(@RequestBody PushMsgParam responses) { public CommonResponse pushNoticeMany(@RequestBody PushMsgParam responses) {
...@@ -79,7 +76,6 @@ public class UserController { ...@@ -79,7 +76,6 @@ public class UserController {
return CommonResponseUtil.failure("发送失败"); return CommonResponseUtil.failure("发送失败");
} }
} }
@ApiOperation(value = "发送消息", notes = "发送消息") @ApiOperation(value = "发送消息", notes = "发送消息")
@RequestMapping(value = "/buildPushPayload", method = RequestMethod.POST) @RequestMapping(value = "/buildPushPayload", method = RequestMethod.POST)
public CommonResponse buildPushPayload(@RequestBody PushMsgParam responses) { public CommonResponse buildPushPayload(@RequestBody PushMsgParam responses) {
...@@ -92,7 +88,7 @@ public class UserController { ...@@ -92,7 +88,7 @@ public class UserController {
return CommonResponseUtil.failure("发送失败"); return CommonResponseUtil.failure("发送失败");
} }
} }
@ApiOperation(value = "删除别名关联设备", notes = "删除别名关联设备") @ApiOperation(value = "删除别名关联设备", notes = "删除别名关联设备")
@RequestMapping(value = "/pushDevice", method = RequestMethod.GET) @RequestMapping(value = "/pushDevice", method = RequestMethod.GET)
public CommonResponse pushDevice(@RequestParam("alias") String alias) { public CommonResponse pushDevice(@RequestParam("alias") String alias) {
...@@ -108,7 +104,6 @@ public class UserController { ...@@ -108,7 +104,6 @@ public class UserController {
return CommonResponseUtil.failure(); return CommonResponseUtil.failure();
} }
} }
@ApiOperation(value = "别名关联设备", notes = "别名关联设备") @ApiOperation(value = "别名关联设备", notes = "别名关联设备")
@RequestMapping(value = "/PushDeviceRegistration", method = RequestMethod.GET) @RequestMapping(value = "/PushDeviceRegistration", method = RequestMethod.GET)
public CommonResponse PushDeviceRegistration(@RequestParam("registrationId") String registrationId,@RequestParam("alias") String alias) { public CommonResponse PushDeviceRegistration(@RequestParam("registrationId") String registrationId,@RequestParam("alias") String alias) {
......
...@@ -3,20 +3,16 @@ ...@@ -3,20 +3,16 @@
*/ */
package com.yeejoin.amos.jpush.service.constants; package com.yeejoin.amos.jpush.service.constants;
import java.text.SimpleDateFormat;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.slf4j.LoggerFactory; import org.slf4j.LoggerFactory;
import java.text.SimpleDateFormat;
/** /**
* 常量 * 常量
*/ */
public class XJConstant { public class XJConstant {
private static final Logger logger = LoggerFactory.getLogger(XJConstant.class); private static final Logger logger = LoggerFactory.getLogger(XJConstant.class);
/**
* 构造方法
*/
private XJConstant() { private XJConstant() {
logger.debug(XJConstant.CONSTRUCTOR); logger.debug(XJConstant.CONSTRUCTOR);
} }
......
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