Commit 8a68b3d0 authored by lisong's avatar lisong

Merge branch 'develop_tzs_new_patrol' into develop_tzs_register

parents fe5366ab f48ba754
......@@ -140,6 +140,10 @@ public class ControllerAop {
// 验证token有效性,防止token失效
AgencyUserModel userModel;
try {
String authToken = RedisKey.buildReginKey(RequestContext.getExeUserId(), token);
if (redisUtils.hasKey(authToken)) {
return;
}
FeignClientResult<AgencyUserModel> agencyUserModel = Privilege.agencyUserClient.getme();
userModel = agencyUserModel.getResult();
if (userModel == null) {
......
......@@ -15,7 +15,9 @@ import java.util.List;
*/
public interface ThreeSystemsMapper extends BaseMapper<ThreeSystems> {
List<ThreeSystemsDto> getCompanyThreeSystemsStatisticsList(@Param("type") Integer type, @Param("startDay") String startDay, @Param("endDay") String endDay);
List<ThreeSystemsDto> getCompanyThreeSystemsStatisticsList(@Param("staticTableName") String staticTableName,
@Param("startDay") String startDay,
@Param("endDay") String endDay);
void saveOrUpdateBatch(@Param("resultList") List<ThreeSystems> resultList);
......
......@@ -28,5 +28,8 @@ public interface TzsTwoStaffingMapper extends BaseMapper<TzsTwoStaffing> {
void truncateTwoStaffingStatistics();
List<TzsTwoStaffing> getListByOrgCode(@Param("orgCode")String orgCode, @Param("type")String type, @Param("level")String level);
Page<TzsTwoStaffingCompanyCheckDto> getCompanyCheckList(@Param("page")Page<TzsTwoStaffingCompanyCheckDto> page, @Param("orgCode") String orgCode, @Param("companyDto")TzsTwoStaffingCompanyCheckDto companyDto);
Page<TzsTwoStaffingCompanyCheckDto> getCompanyCheckList(@Param("page")Page<TzsTwoStaffingCompanyCheckDto> page,
@Param("orgCode") String orgCode,
@Param("staticTableName") String staticTableName,
@Param("companyDto")TzsTwoStaffingCompanyCheckDto companyDto);
}
......@@ -10,27 +10,26 @@
ei.supervise_org_code supervisoryUnitOrgCode,
ei.unit_type unitType,
CASE
WHEN (
SELECT COUNT
( 1 )
FROM
amos_tzs_biz.p_plan_task pt
${staticTableName} pt
WHERE
pt.finish_status = '2'
AND ppt.use_code = pt.use_code
AND pt.check_date BETWEEN #{startDay}
pt.not_start = 0
AND pt.time_out = 0
AND (pt.risk_end > 0 or pt.no_risk_end > 0)
AND psd.unit_code = pt.unit_code
AND pt.check_time BETWEEN #{startDay}
AND #{endDay}
AND pt.plan_type = #{type}
) > 0 THEN
1 ELSE 0
END AS checkStatus
FROM
amos_tzs_biz.tz_base_enterprise_info ei
LEFT JOIN amos_tzs_biz.p_plan_task ppt ON ei.use_code = ppt.use_code
tz_base_enterprise_info ei
LEFT JOIN ${staticTableName} psd ON ei.use_code = psd.unit_code
GROUP BY
ei.use_code
</select>
<select id="saveOrUpdateBatch">
......
......@@ -65,19 +65,19 @@
ei.legal_person,
ei.contact_phone,
CASE
WHEN ( SELECT COUNT ( 1 ) FROM amos_tzs_biz.p_plan_task pt WHERE pt.finish_status = '3' AND ppt.use_code = pt.use_code AND pt.plan_type = #{companyDto.planType} AND pt.check_date BETWEEN #{companyDto.checkStartTime} AND #{companyDto.checkEndTime} ) > 0 THEN
WHEN ( SELECT COUNT ( 1 ) FROM ${staticTableName} pt WHERE pt.time_out > 0 AND psd.unit_code = ei.use_code AND pt.check_time BETWEEN #{companyDto.checkStartTime} AND #{companyDto.checkEndTime} ) > 0 THEN
'超期未检'
WHEN ( SELECT COUNT ( 1 ) FROM amos_tzs_biz.p_plan_task pt WHERE (pt.finish_status = '0' OR pt.finish_status = '1') AND ppt.use_code = pt.use_code AND pt.plan_type = #{companyDto.planType} AND pt.check_date BETWEEN #{companyDto.checkStartTime} AND #{companyDto.checkEndTime} ) > 0 THEN
WHEN ( SELECT COUNT ( 1 ) FROM ${staticTableName} pt WHERE pt.not_start > 0 AND psd.unit_code = ei.use_code AND pt.check_time BETWEEN #{companyDto.checkStartTime} AND #{companyDto.checkEndTime} ) > 0 THEN
'未完成'
WHEN ( SELECT COUNT ( 1 ) FROM amos_tzs_biz.p_plan_task pt WHERE pt.finish_status = '2' AND pt.risk_status = '1' AND ppt.use_code = pt.use_code AND pt.plan_type = #{companyDto.planType} AND pt.check_date BETWEEN #{companyDto.checkStartTime} AND #{companyDto.checkEndTime} ) > 0 THEN
WHEN ( SELECT COUNT ( 1 ) FROM ${staticTableName} pt WHERE pt.risk_end > 0 AND psd.unit_code = ei.use_code AND pt.check_time BETWEEN #{companyDto.checkStartTime} AND #{companyDto.checkEndTime} ) > 0 THEN
'已完成有风险'
WHEN ( SELECT COUNT ( 1 ) FROM amos_tzs_biz.p_plan_task pt WHERE pt.finish_status = '2' AND pt.risk_status = '2' AND ppt.use_code = pt.use_code AND pt.plan_type = #{companyDto.planType} AND pt.check_date BETWEEN #{companyDto.checkStartTime} AND #{companyDto.checkEndTime} ) > 0 THEN
WHEN ( SELECT COUNT ( 1 ) FROM ${staticTableName} pt WHERE pt.no_risk_end > 0 AND psd.unit_code = ei.use_code AND pt.check_time BETWEEN #{companyDto.checkStartTime} AND #{companyDto.checkEndTime} ) > 0 THEN
'已完成无风险'
ELSE '无任务'
END AS checkStatus
FROM
amos_tzs_biz.tz_base_enterprise_info ei
LEFT JOIN amos_tzs_biz.p_plan_task ppt ON ei.use_code = ppt.use_code
tz_base_enterprise_info ei
LEFT JOIN ${staticTableName} psd ON ei.use_code = psd.unit_code
WHERE
ei.supervise_org_code like concat(#{orgCode},'%')
<if test="companyDto.useUnit != '' and companyDto.useUnit != null">
......@@ -94,7 +94,5 @@
and tt.checkStatus = #{companyDto.checkStatus}
</if>
</where>
</select>
</mapper>
......@@ -24,7 +24,7 @@ import java.util.LinkedHashMap;
import java.util.List;
@RestController
@Api(tags = "三个规定统计")
@Api(tags = "三个制度统计")
@RequestMapping(value = "/threeProvisions")
public class ThreeSystemsController<string> extends BaseController {
private static final String REGULATOR_UNIT_TREE = "REGULATOR_UNIT_TREE";
......
......@@ -155,7 +155,10 @@ public class TzsTwoStaffingServiceImpl extends BaseService<TzsTwoStaffingDto, Tz
companyDto.setPlanType(ObjectUtils.isEmpty(companyDto.getPlanType()) ? "1" : companyDto.getPlanType());
companyDto.setCheckStartTime(ObjectUtils.isEmpty(companyDto.getCheckStartTime()) ? startDay : companyDto.getCheckStartTime());
companyDto.setCheckEndTime(ObjectUtils.isEmpty(companyDto.getCheckEndTime()) ? endDay : companyDto.getCheckEndTime());
return tzsTwoStaffingMapper.getCompanyCheckList(page, orgCode, companyDto);
// todo 此处统计表名通过接口查询得到 接口暂未实现
String planType = companyDto.getPlanType();
String staticTableName = "p_static_day";
return tzsTwoStaffingMapper.getCompanyCheckList(page, orgCode, staticTableName, companyDto);
}
......
......@@ -4,7 +4,10 @@ import java.util.List;
public class AppCheckInputRespone{
private String inputName;
private String pointId;
private String pointInputItemId;
private String inputValue;
private String inputStatus;
......@@ -24,7 +27,12 @@ public class AppCheckInputRespone{
public String getDefaultValue() {
return defaultValue;
}
public String getPointInputItemId() {
return pointInputItemId;
}
public String getPointId() {
return pointId;
}
public void setDefaultValue(String defaultValue) {
this.defaultValue = defaultValue;
}
......
......@@ -9,7 +9,10 @@ import java.util.List;
public class AppPointCheckRespone {
private long id;
private long pointId;
private long planTaskId;
private String pointName;
......@@ -175,11 +178,26 @@ public class AppPointCheckRespone {
public long getPointId() {
return pointId;
}
public long getPlanTaskId() {
return planTaskId;
}
public long getId() {
return id;
}
public void setPointId(long pointId) {
this.pointId = pointId;
}
public void setId(long id) {
this.id = id;
}
public void setPlanTaskId(long planTaskId) {
this.planTaskId = planTaskId;
}
public String getRemark() {
return remark;
}
......
package com.yeejoin.amos.patrol.dao.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.CreatedDate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
/**
* The persistent class for the p_check database table.
*
*/
@Entity
@Table(name="p_check_history")
public class CheckHistory implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 参考地址
*/
@Column(name="address")
private String address;
/**
* 巡检方式
*/
@Column(name="check_mode")
private String checkMode="";
/**
* 检查时间
*/
@Temporal(TemporalType.TIMESTAMP)
@Column(name="check_time")
private Date checkTime;
/**
* 设备编号
*/
@Column(name="device_id")
private String deviceId;
/**
* 不合格项目
*/
private String error;
/**
* 是否合格
*/
@Column(name="is_ok")
private String isOk;
/**
* 经度
*/
private String latitude;
/**
* 纬度
*/
private String longitude;
/**
* 权限系统org code
*/
@Column(name="org_code")
private String orgCode;
/**
* 计划编号
*/
@Column(name="plan_id")
private Long planId;
/**
* 线路名称
*/
@Column(name="plan_name")
private String planName;
/**
* 计划执行编号
*/
@Column(name="plan_task_id")
private Long planTaskId;
/**
* 执行计划详情id
*/
@Column(name="plan_task_detail_id")
private Long planTaskDetailId;
/**
* 巡检点id
*/
@Column(name="point_id")
private Long pointId;
/**
* 点名称
*/
@Column(name="point_name")
private String pointName;
/**
* 巡检备注说明
*/
private String remark;
/**
* 路线编号
*/
@Column(name="route_id")
private Long routeId;
/**
* 路线名称
*/
@Column(name="route_name")
private String routeName;
/**
* 评分
*/
private int score;
/**
* 拍照数量
*/
@Column(name="shot_number")
private int shotNumber;
/**
* 记录上传时间
*/
@Temporal(TemporalType.TIMESTAMP)
@Column(name="upload_time")
private Date uploadTime;
/**
* 巡检人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="error_classify")
private String errorClassify;
public CheckHistory() {
}
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 long getPlanTaskDetailId() {
return planTaskDetailId;
}
public void setPlanTaskDetailId(long planTaskDetailId) {
this.planTaskDetailId = planTaskDetailId;
}
public String getAddress() {
return this.address;
}
public void setAddress(String address) {
this.address = address;
}
public String getCheckMode() {
return this.checkMode;
}
public void setCheckMode(String checkMode) {
this.checkMode = checkMode;
}
public Date getCheckTime() {
return this.checkTime;
}
public void setCheckTime(Date checkTime) {
this.checkTime = checkTime;
}
public String getDeviceId() {
return this.deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getError() {
return this.error;
}
public void setError(String error) {
this.error = error;
}
public String getIsOk() {
return this.isOk;
}
public void setIsOk(String isOk) {
this.isOk = isOk;
}
public String getLatitude() {
return this.latitude;
}
public void setLatitude(String latitude) {
this.latitude = latitude;
}
public String getLongitude() {
return this.longitude;
}
public void setLongitude(String longitude) {
this.longitude = longitude;
}
public String getOrgCode() {
return this.orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public long getPlanId() {
return this.planId;
}
public void setPlanId(long planId) {
this.planId = planId;
}
public long getPlanTaskId() {
return this.planTaskId;
}
public void setPlanTaskId(long planTaskId) {
this.planTaskId = planTaskId;
}
public long getPointId() {
return this.pointId;
}
public void setPointId(long pointId) {
this.pointId = pointId;
}
public String getRemark() {
return this.remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public long getRouteId() {
return this.routeId;
}
public void setRouteId(long routeId) {
this.routeId = routeId;
}
public int getScore() {
return this.score;
}
public void setScore(int score) {
this.score = score;
}
public int getShotNumber() {
return this.shotNumber;
}
public void setShotNumber(int shotNumber) {
this.shotNumber = shotNumber;
}
public Date getUploadTime() {
return this.uploadTime;
}
public void setUploadTime(Date uploadTime) {
this.uploadTime = uploadTime;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public String getErrorClassify() {
return errorClassify;
}
public void setErrorClassify(String errorClassify) {
this.errorClassify = errorClassify;
}
public String getPlanName() {
return planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
public String getPointName() {
return pointName;
}
public void setPointName(String pointName) {
this.pointName = pointName;
}
public String getRouteName() {
return routeName;
}
public void setRouteName(String routeName) {
this.routeName = routeName;
}
/**
* id
*/
private long id;
@CreatedDate
@Column(name="create_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
@Id
@Column(name = "ID",nullable=false,unique=true)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}
\ No newline at end of file
package com.yeejoin.amos.patrol.dao.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.CreatedDate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* The persistent class for the p_check_input database table.
*
*/
@Entity
@Table(name="p_check_input_history")
public class CheckInputHistory implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 巡检记录id
*/
@Column(name="check_id")
private Long checkId;
/**
* 检查项id
*/
@Column(name="input_id")
private Long inputId;
/**
* 检查项名称
*/
@Column(name="input_name")
private String inputName;
/**
* 巡检点检查项
*/
@Column(name="route_point_item_id")
private Long routePointItemId;
/**
* 输入值
*/
@Column(name="input_value")
private String inputValue;
/**
* 是否合格
*/
@Column(name="is_ok")
private String isOk;
/**
* 序号
*/
@Column(name="order_no")
private int orderNo;
/**
* 权限系统org code
*/
@Column(name="org_code")
private String orgCode;
/**
* 检查点分类id
*/
@Column(name="point_classify_id")
private Long pointClassifyId;
/**
* 检查点分类名称
*/
@Column(name="point_classify_name")
private String pointClassifyName;
/**
* 评分
*/
private int score;
/**
* 备注
*/
private String remark;
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public CheckInputHistory() {
}
public Long getCheckId() {
return this.checkId;
}
public void setCheckId(Long checkId) {
this.checkId = checkId;
}
public Long getInputId() {
return this.inputId;
}
public void setInputId(Long inputId) {
this.inputId = inputId;
}
public String getInputValue() {
return this.inputValue;
}
public void setInputValue(String inputValue) {
this.inputValue = inputValue;
}
public String getIsOk() {
return this.isOk;
}
public void setIsOk(String isOk) {
this.isOk = isOk;
}
public int getOrderNo() {
return this.orderNo;
}
public void setOrderNo(int orderNo) {
this.orderNo = orderNo;
}
public String getOrgCode() {
return this.orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public int getScore() {
return this.score;
}
public void setScore(int score) {
this.score = score;
}
public String getInputName() {
return inputName;
}
public void setInputName(String inputName) {
this.inputName = inputName;
}
public Long getRoutePointItemId() {
return routePointItemId;
}
public void setRoutePointItemId(Long routePointItemId) {
this.routePointItemId = routePointItemId;
}
public Long getPointClassifyId() {
return pointClassifyId;
}
public void setPointClassifyId(Long pointClassifyId) {
this.pointClassifyId = pointClassifyId;
}
public String getPointClassifyName() {
return pointClassifyName;
}
public void setPointClassifyName(String pointClassifyName) {
this.pointClassifyName = pointClassifyName;
}
/**
* id
*/
private long id;
@CreatedDate
@Column(name="create_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
@Id
@Column(name = "ID",nullable=false,unique=true)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}
\ No newline at end of file
package com.yeejoin.amos.patrol.dao.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.CreatedDate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* The persistent class for the p_check_shot database table.
*
*/
@Entity
@Table(name="p_check_shot_history")
public class CheckShotHistory implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 巡检记录id
*/
@Column(name="check_id")
private long checkId;
/**
* 权限系统org code
*/
@Column(name="org_code")
private String orgCode;
/**
* 照片内容
*/
@Lob
@Column(name="photo_data")
private String photoData;
/**
* 拍照点名称
*/
@Column(name="point_name")
private String pointName;
/**
* 拍照类型:定点(检查项拍照),普通(检
*
*
*
*
* 点现场照片)
*/
@Column(name="shot_type")
private String shotType;
/**
* 检查项id
*/
@Column(name="check_input_id")
private long checkInputId;
/**
* 扩展分类id
*/
@Column(name="classify_id")
private long classifyId;
public long getClassifyId() {
return classifyId;
}
public void setClassifyId(long classifyId) {
this.classifyId = classifyId;
}
public long getCheckInputId() {
return checkInputId;
}
public void setCheckInputId(long checkInputId) {
this.checkInputId = checkInputId;
}
public CheckShotHistory() {
}
public long getCheckId() {
return this.checkId;
}
public void setCheckId(long checkId) {
this.checkId = checkId;
}
public String getOrgCode() {
return this.orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getPhotoData() {
return this.photoData;
}
public void setPhotoData(String photoData) {
this.photoData = photoData;
}
public String getPointName() {
return this.pointName;
}
public void setPointName(String pointName) {
this.pointName = pointName;
}
public String getShotType() {
return this.shotType;
}
public void setShotType(String shotType) {
this.shotType = shotType;
}
/**
* id
*/
private long id;
@CreatedDate
@Column(name="create_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
@Id
@Column(name = "ID",nullable=false,unique=true)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}
\ No newline at end of file
package com.yeejoin.amos.patrol.dao.entity;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.util.List;
/**
* @Author cpp
* @Description
* @Date 2023/6/5
*/
@Data
@Accessors(chain = true)
@Document(indexName = "web_app_plan_task_list", shards = 6, replicas = 2)
public class ESPlanTaskListDto {
@Id
private String planTaskId;
@Field(type = FieldType.Text)
private String orgCode;
@Field(type = FieldType.Text)
private String planId;
@Field(type = FieldType.Text)
private String useCode;
@Field(type = FieldType.Text)
private String taskName;
@Field(type = FieldType.Text)
private String type;
@Field(type = FieldType.Text)
private String beginTime;
@Field(type = FieldType.Text)
private String endTime;
@Field(type = FieldType.Text)
private String checkDate;
@Field(type = FieldType.Text)
private String finshNum;
@Field(type = FieldType.Text)
private String taskPlanNum;
@Field(type = FieldType.Text)
private String finishStatus;
@Field(type = FieldType.Text)
private String batchNo;
@Field(type = FieldType.Text)
private String executiveName;
@Field(type = FieldType.Text)
private String userName;
@Field(type = FieldType.Text)
private String userDept;
@Field(type = FieldType.Text)
private String unplan;
@Field(type = FieldType.Text)
private String userId;
@Field(type = FieldType.Text)
private String unqualified;
@Field(type = FieldType.Text)
private String inOrder;
@Field(type = FieldType.Text)
private String omission;
@Field(type = FieldType.Object)
private List points;
}
package com.yeejoin.amos.patrol.dao.entity;
import com.alibaba.fastjson.JSONObject;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import java.util.List;
/**
* @Author cpp
* @Description
* @Date 2023/6/5
*/
@Data
@Accessors(chain = true)
@Document(indexName = "web_app_task_detail", shards = 6, replicas = 2)
public class ESTaskDetailDto {
@Id
private Long id;
@Field(type = FieldType.Text)
private String pointId;
@Field(type = FieldType.Text)
private String planTaskId;
@Field(type = FieldType.Text)
private String pointName;
@Field(type = FieldType.Text)
private String pointNo;
@Field(type = FieldType.Text)
private String shortMinNumber;
@Field(type = FieldType.Text)
private String shortMaxNumber;
@Field(type = FieldType.Text)
private String checkTime;
@Field(type = FieldType.Text)
private String beginTime;
@Field(type = FieldType.Text)
private String endTime;
@Field(type = FieldType.Text)
private String pointStatus;
@Field(type = FieldType.Text)
private String planName;
@Field(type = FieldType.Text)
private String taskStatus;
@Field(type = FieldType.Text)
private String departmentName;
@Field(type = FieldType.Text)
private String username;
@Field(type = FieldType.Text)
private String strCheckTime;
@Field(type = FieldType.Text)
private String checkId;
@Field(type = FieldType.Text)
private String remark;
@Field(type = FieldType.Text)
private String score;
@Field(type = FieldType.Text)
private List<String> pointImgUrls;
@Field(type = FieldType.Object)
private JSONObject appCheckInput;
}
......@@ -34,6 +34,18 @@ public class PlanTaskDetail extends BasicEntity {
*/
@Column(name="executor_id")
private String executorId;
/**
* 点名称
*/
@Column(name="name")
private String name;
/**
* 点编号
*/
@Column(name="point_no")
private String pointNo;
/**
* 执行时间
......@@ -69,6 +81,14 @@ public class PlanTaskDetail extends BasicEntity {
this.pointId = pointId;
}
public void setName(String name) {
this.name = name;
}
public void setPointNo(String pointNo) {
this.pointNo = pointNo;
}
public long getTaskNo() {
return this.taskNo;
}
......
package com.yeejoin.amos.patrol.dao.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.CreatedDate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* The persistent class for the p_plan_task_detail database table.
*
*/
@Entity
@Table(name="p_plan_task_detail_history")
public class PlanTaskDetailHistory implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 是否完成:是否完成0-未完成,1-已完成,2-超时漏检
*/
@Column(name="is_finish")
private int isFinish;
/**
* 点编号
*/
@Column(name="point_id")
private long pointId;
/**
* 任务批次号
*/
@Column(name="task_no")
private long taskNo;
/**
* 具体执行人id
*/
@Column(name="executor_id")
private String executorId;
/**
* 执行时间
*/
@Column(name="executor_date")
private Date executorDate;
private PlanTask planTask;
/**
* 状态:0 未开始;1 合格;2 不合格;3 漏检
*/
@Column(name="status")
private String status="0";
public PlanTaskDetailHistory() {
}
public int getIsFinish() {
return this.isFinish;
}
public void setIsFinish(int isFinish) {
this.isFinish = isFinish;
}
public long getPointId() {
return this.pointId;
}
public void setPointId(long pointId) {
this.pointId = pointId;
}
public long getTaskNo() {
return this.taskNo;
}
public void setTaskNo(long taskNo) {
this.taskNo = taskNo;
}
public void setPlanTask(PlanTask planTask) {
this.planTask = planTask;
}
public String getStatus() {
return status;
}
public void setStatus(String status) {
this.status = status;
}
public String getExecutorId() {
return executorId;
}
public void setExecutorId(String executorId) {
this.executorId = executorId;
}
public Date getExecutorDate() {
return executorDate;
}
public void setExecutorDate(Date executorDate) {
this.executorDate = executorDate;
}
/**
* id
*/
private long id;
@CreatedDate
@Column(name="create_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
@Id
@Column(name = "ID",nullable=false,unique=true)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}
\ No newline at end of file
package com.yeejoin.amos.patrol.dao.entity;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.data.annotation.CreatedDate;
import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
/**
* The persistent class for the p_plan_task database table.
*
*/
@Entity
@Table(name="p_plan_task_history")
public class PlanTaskHistory implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 批次号(该字段暂时无效,取值为表id)
*/
@Column(name="batch_no")
private long batchNo;
/**
* 开始时间
*/
@Column(name="begin_time")
private String beginTime;
/**
* 巡检日期
*/
@Column(name="check_date")
private String checkDate;
/**
* 结束时间
*/
@Column(name="end_time")
private String endTime;
/**
* 已完成数量
*/
@Column(name="finish_num")
private int finishNum;
/**
* 完成状态:0-尚未开始;1-正在进行;2-已经结束;3-超时漏检
*/
@Column(name="finish_status")
private int finishStatus;
/**
* 公司Id
*/
@Column(name="org_code")
private String orgCode;
/**
* 计划编号
*/
@Column(name="plan_id")
private long planId;
/**
* 计划巡检点数
*/
@Column(name="point_num")
private int pointNum;
/**
* 信用代码
*/
@Column(name="use_code")
private String useCode;
public String getUseCode() {
return useCode;
}
public void setUseCode(String useCode) {
this.useCode = useCode;
}
public String getPlanType() {
return planType;
}
public void setPlanType(String planType) {
this.planType = planType;
}
/**
* 计划类型
*/
@Column(name="plan_type")
private String planType;
/**
* 路线编号
*/
@Column(name="route_id")
private long routeId;
/**
* 状态:0-有效;1-无效
*/
private int status;
/**
* 状态:0-有效;1-无效
*/
@Column(name="risk_status")
private int riskStatus;
public int getRiskStatus() {
return riskStatus;
}
public void setRiskStatus(int riskStatus) {
this.riskStatus = riskStatus;
}
/**
* 可执行人,一个或多个,多个用,隔开
*/
@Column(name="user_id")
private String userId;
/**
* 是否按排序0-否;1-是
*/
@Column(name="in_order")
private String inOrder;
/**
* 用户部门
*/
@Column(name="user_dept")
private String userDept;
/**
* 用户姓名
*/
@Column(name="user_name")
private String userName;
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
public String getUserDept() {
return userDept;
}
public void setUserDept(String userDept) {
this.userDept = userDept;
}
public PlanTaskHistory() {
}
public long getBatchNo() {
return batchNo;
}
public void setBatchNo(long batchNo) {
this.batchNo = batchNo;
}
public String getBeginTime() {
return this.beginTime;
}
public void setBeginTime(String beginTime) {
this.beginTime = beginTime;
}
public String getCheckDate() {
return this.checkDate;
}
public void setCheckDate(String checkDate) {
this.checkDate = checkDate;
}
public String getEndTime() {
return this.endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public int getFinishNum() {
return this.finishNum;
}
public void setFinishNum(int finishNum) {
this.finishNum = finishNum;
}
public int getFinishStatus() {
return this.finishStatus;
}
public void setFinishStatus(int finishStatus) {
this.finishStatus = finishStatus;
}
public String getOrgCode() {
return this.orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public long getPlanId() {
return this.planId;
}
public void setPlanId(long planId) {
this.planId = planId;
}
public int getPointNum() {
return this.pointNum;
}
public void setPointNum(int pointNum) {
this.pointNum = pointNum;
}
public long getRouteId() {
return this.routeId;
}
public void setRouteId(long routeId) {
this.routeId = routeId;
}
public int getStatus() {
return this.status;
}
public void setStatus(int status) {
this.status = status;
}
public String getInOrder() {
return inOrder;
}
public void setInOrder(String inOrder) {
this.inOrder = inOrder;
}
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
/**
* id
*/
private long id;
@CreatedDate
@Column(name="create_date")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createDate;
@Id
@Column(name = "ID",nullable=false,unique=true)
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date createDate) {
this.createDate = createDate;
}
}
\ No newline at end of file
package com.yeejoin.amos.patrol.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name="p_static_day")
public class StaticDay extends BasicEntity {
private static final long serialVersionUID = 1L;
/**
* 未完成
*/
@Column(name="not_start")
private int notStart;
/**
* 已完成有风险
*/
@Column(name="risk_end")
private int riskEnd;
/**
* 已完成无风险
*/
@Column(name="no_risk_end")
private int noRiskEnd;
/**
* 已超时
*/
@Column(name="time_out")
private int timeOut;
/**
* 检查时间
*/
@Column(name="check_time")
private String checkTime;
/**
* 单位code
*/
@Column(name="org_code")
private String orgCode;
/**
* 单位信用代码
*/
@Column(name="unit_code")
private String unitCode;
/**
* 开始时间
*/
@Column(name="begin_time")
private Date beginTime;
/**
* 结束时间
*/
@Column(name="end_time")
private Date endTime;
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public int getNotStart() {
return notStart;
}
public void setNotStart(int notStart) {
this.notStart = notStart;
}
public int getRiskEnd() {
return riskEnd;
}
public void setRiskEnd(int riskEnd) {
this.riskEnd = riskEnd;
}
public int getNoRiskEnd() {
return noRiskEnd;
}
public void setNoRiskEnd(int noRiskEnd) {
this.noRiskEnd = noRiskEnd;
}
public int getTimeOut() {
return timeOut;
}
public void setTimeOut(int timeOut) {
this.timeOut = timeOut;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = unitCode;
}
}
package com.yeejoin.amos.patrol.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name="p_static_month")
public class StaticMonth extends BasicEntity {
private static final long serialVersionUID = 1L;
/**
* 未完成
*/
@Column(name="not_start")
private int notStart;
/**
* 已完成有风险
*/
@Column(name="risk_end")
private int riskEnd;
/**
* 已完成无风险
*/
@Column(name="no_risk_end")
private int noRiskEnd;
/**
* 已超时
*/
@Column(name="time_out")
private int timeOut;
/**
* 检查时间
*/
@Column(name="check_time")
private String checkTime;
/**
* 单位code
*/
@Column(name="org_code")
private String orgCode;
/**
* 单位信用代码
*/
@Column(name="unit_code")
private String unitCode;
/**
* 开始时间
*/
@Column(name="begin_time")
private Date beginTime;
/**
* 结束时间
*/
@Column(name="end_time")
private Date endTime;
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public int getNotStart() {
return notStart;
}
public void setNotStart(int notStart) {
this.notStart = notStart;
}
public int getRiskEnd() {
return riskEnd;
}
public void setRiskEnd(int riskEnd) {
this.riskEnd = riskEnd;
}
public int getNoRiskEnd() {
return noRiskEnd;
}
public void setNoRiskEnd(int noRiskEnd) {
this.noRiskEnd = noRiskEnd;
}
public int getTimeOut() {
return timeOut;
}
public void setTimeOut(int timeOut) {
this.timeOut = timeOut;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = unitCode;
}
}
package com.yeejoin.amos.patrol.dao.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.util.Date;
@Entity
@Table(name="p_static_week")
public class StaticWeek extends BasicEntity {
private static final long serialVersionUID = 1L;
/**
* 未完成
*/
@Column(name="not_start")
private int notStart;
/**
* 已完成有风险
*/
@Column(name="risk_end")
private int riskEnd;
/**
* 已完成无风险
*/
@Column(name="no_risk_end")
private int noRiskEnd;
/**
* 已超时
*/
@Column(name="time_out")
private int timeOut;
/**
* 检查时间
*/
@Column(name="check_time")
private String checkTime;
/**
* 单位code
*/
@Column(name="org_code")
private String orgCode;
/**
* 单位信用代码
*/
@Column(name="unit_code")
private String unitCode;
/**
* 开始时间
*/
@Column(name="begin_time")
private Date beginTime;
/**
* 结束时间
*/
@Column(name="end_time")
private Date endTime;
public Date getBeginTime() {
return beginTime;
}
public void setBeginTime(Date beginTime) {
this.beginTime = beginTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public int getNotStart() {
return notStart;
}
public void setNotStart(int notStart) {
this.notStart = notStart;
}
public int getRiskEnd() {
return riskEnd;
}
public void setRiskEnd(int riskEnd) {
this.riskEnd = riskEnd;
}
public int getNoRiskEnd() {
return noRiskEnd;
}
public void setNoRiskEnd(int noRiskEnd) {
this.noRiskEnd = noRiskEnd;
}
public int getTimeOut() {
return timeOut;
}
public void setTimeOut(int timeOut) {
this.timeOut = timeOut;
}
public String getCheckTime() {
return checkTime;
}
public void setCheckTime(String checkTime) {
this.checkTime = checkTime;
}
public String getOrgCode() {
return orgCode;
}
public void setOrgCode(String orgCode) {
this.orgCode = orgCode;
}
public String getUnitCode() {
return unitCode;
}
public void setUnitCode(String unitCode) {
this.unitCode = unitCode;
}
}
......@@ -173,6 +173,22 @@
<artifactId>poi</artifactId>
<version>4.0.0</version>
</dependency>
<!-- <dependency>-->
<!-- <groupId>org.apache.shardingsphere</groupId>-->
<!-- <artifactId>shardingsphere-jdbc-core-spring-boot-starter</artifactId>-->
<!-- <version>5.2.1</version>-->
<!-- </dependency>-->
<!-- <dependency>-->
<!-- <groupId>org.apache.shardingsphere</groupId>-->
<!-- <artifactId>shardingsphere-transaction-xa-core</artifactId>-->
<!-- <version>5.2.1</version>-->
<!-- </dependency>-->
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
<version>1.33</version>
</dependency>
</dependencies>
<build>
<plugins>
......
......@@ -187,18 +187,18 @@ public class PointController extends AbstractBaseController {
try {
//增加判断
PointClassify PointClassifyk= iPointClassifyDao.getPointClassifyByPointIdandcode(pointClassify.getPointId(),pointClassify.getCode());
if(PointClassifyk!=null){
if(PointClassifyk.getId()!=pointClassify.getId()){
return CommonResponseUtil.failure("巡查对象code,不能重复!");
}
}
// PointClassify PointClassifyk= iPointClassifyDao.getPointClassifyByPointIdandcode(pointClassify.getPointId(),pointClassify.getCode());
// if(PointClassifyk!=null){
// if(PointClassifyk.getId()!=pointClassify.getId()){
// return CommonResponseUtil.failure("巡查对象code,不能重复!");
// }
// }
List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId());
AgencyUserModel user = getUserInfo();
PointClassify newPointClassify = new PointClassify();
newPointClassify.setEquipmentId(pointClassify.getEquipmentId());
newPointClassify.setName(pointClassify.getName());
newPointClassify.setName(ObjectUtils.isEmpty(pointClassify.getName()) ? "系统默认" : pointClassify.getName());
newPointClassify.setInspectionSpecName(pointClassify.getInspectionName());
newPointClassify.setCreatorId(user.getUserId());
newPointClassify.setPointId(pointClassify.getPointId());
......@@ -231,7 +231,7 @@ public class PointController extends AbstractBaseController {
}
newPointClassify.setCategoryCode(pointClassify.getCategoryCode());
newPointClassify.setCategoryName(pointClassify.getCategoryName());
newPointClassify.setCode(pointClassify.getCode());
newPointClassify.setCode(ObjectUtils.isEmpty(pointClassify.getCode()) ? "系统默认":pointClassify.getCode());
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
iPointService.addPointClassifyByPointId(newPointClassify);
List<PointInputItemVo> oldInputItemList = new ArrayList<>();
......@@ -1471,7 +1471,7 @@ public class PointController extends AbstractBaseController {
@GetMapping(value = "/newQueryByIds", produces = "application/json;charset=UTF-8")
public CommonResponse queryItemList4RoutePointNew(
@ApiParam(value = "巡检点ID") @RequestParam(value = "pointId") Long pointId,
@ApiParam(value = "设备ID") @RequestParam(value = "classifyId") Long classifyId,
@ApiParam(value = "设备ID") @RequestParam(value = "classifyId", required = false) Long classifyId,
@ApiParam(value = "路线ID") @RequestParam(value = "routeId") Long routeId) {
List list = iPointService.queryItemList4RoutePointNew(routeId, pointId, classifyId);
Object ob=list!=null?ToJson.tojson(list):null;
......
......@@ -746,7 +746,7 @@ public class RouteController extends AbstractBaseController {
@PostMapping(value = "/updateRoutePointInputItemNew", produces = "application/json;charset=UTF-8")
public CommonResponse updateRoutePointInputItemNew(@ApiParam(value = "巡检路线id", required = true) @RequestParam(value = "routeId") Long routeId,
@ApiParam(value = "巡检点id", required = true) @RequestParam(value = "pointId") Long pointId,
@ApiParam(value = "巡检点分类id", required = true) @RequestParam(value = "classifyId") Long classifyId,
@ApiParam(value = "巡检点分类id") @RequestParam(value = "classifyId", required = false) Long classifyId,
@ApiParam(value = "巡检点巡检项id", required = true) @RequestParam List<Long> inputItemIds) {
try {
routeService.updateRoutePointInputItemNew(routeId, pointId,classifyId, inputItemIds);
......
......@@ -49,6 +49,8 @@ public interface CheckMapper extends BaseMapper {
List<Map<String,Object>> planCount(String checkTime, String orgCode,String type,String userId, String startTime, String endTime);
List<Map<String,Object>> planCountNew(String checkTime, String orgCode,String table, String type, String startTime, String endTime);
List<Map<String, Object>> queryRecordByPointId(HashMap<String, Object> req);
Map<String, Object> queryCheckById(@Param(value="checkId") int checkId);
......
......@@ -58,4 +58,6 @@ public interface PlanMapper extends BaseMapper {
* 初始化计划下次执行时间
*/
void initUpdatePlanNextGenDate();
Plan getPlan(String planId);
}
......@@ -163,4 +163,7 @@ public interface PointMapper extends BaseMapper {
List<Point> findByName(@Param(value = "pointName") String pointName, @Param(value = "pointId") String pointId);
List<Point> findByNo(@Param(value = "pointNo") String pointNo, @Param(value = "pointId") String pointId);
Point selectPointInfo(long pointId);
}
package com.yeejoin.amos.patrol.business.dao.repository;
import com.yeejoin.amos.patrol.dao.entity.ESPlanTaskListDto;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ESPlanTaskList extends PagingAndSortingRepository<ESPlanTaskListDto, String> {
}
package com.yeejoin.amos.patrol.business.dao.repository;
import com.yeejoin.amos.patrol.dao.entity.ESPlanTaskListDto;
import com.yeejoin.amos.patrol.dao.entity.ESTaskDetailDto;
import org.springframework.data.repository.PagingAndSortingRepository;
import org.springframework.stereotype.Repository;
@Repository
public interface ESTaskDetail extends PagingAndSortingRepository<ESTaskDetailDto, String> {
}
package com.yeejoin.amos.patrol.business.dao.repository;
import com.yeejoin.amos.patrol.dao.entity.PlanTaskHistory;
import org.springframework.stereotype.Repository;
@Repository("planTaskHistoryDao")
public interface IPlanTaskHistoryDao extends BaseDao<PlanTaskHistory, Long> {
}
......@@ -59,6 +59,6 @@ public interface IPointInputItemDao extends BaseDao<PointInputItem, Long> {
@Modifying
@Transactional
@Query(value = "SELECT * FROM p_point_inputitem WHERE point_id = ?1 and classify_ids =?2", nativeQuery = true)
@Query(value = "SELECT * FROM p_point_inputitem WHERE point_id = ?1 limit 1", nativeQuery = true)
List<PointInputItem> getPointInputItemByPointIdAndClassifyId(Long pointId,Long classifyId);
}
......@@ -12,7 +12,7 @@ import java.util.List;
@Repository("iRoutePointDao")
public interface IRoutePointDao extends BaseDao<RoutePoint, Long> {
@Query(value = "SELECT COUNT( point_id ) FROM p_route_point where route_id = ?1", nativeQuery = true)
@Query(value = "SELECT COUNT( point_id ) cont FROM p_route_point where route_id = ?1", nativeQuery = true)
int countRoutePoint(Long routeId);
@Query(value = "SELECT * FROM p_route_point where point_id = ?1", nativeQuery = true)
......
......@@ -9,6 +9,7 @@ public interface RepositoryTs {
// 批量更新的方法
<S> Iterable<S> batchUpdate(Iterable<S> var1);
<S> Iterable<S> batchSaveNoAsync(Iterable<S> var1);
}
package com.yeejoin.amos.patrol.business.dto;
import lombok.Data;
import java.util.Collection;
@Data
public class PlanTaskStaticDto {
private String planTaskId;
private String finshNum;
private String omission;
private String unqualified;
private String unplan;
private String taskPlanNum;
}
\ No newline at end of file
......@@ -3,8 +3,11 @@ package com.yeejoin.amos.patrol.business.entity.mybatis;
import java.util.Date;
public class PointCheckDetailBo {
private Long id;
private long pointId;
private long inputItemId;
private String pointName;
......@@ -18,6 +21,14 @@ public class PointCheckDetailBo {
private String defaultValue;
public long getId() {
return id;
}
public long getInputItemId() {
return inputItemId;
}
public String getDefaultValue() {
return defaultValue;
}
......
......@@ -2,12 +2,16 @@ package com.yeejoin.amos.patrol.business.service.impl;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.patrol.business.bo.CheckInputSyncBo;
import com.yeejoin.amos.patrol.business.bo.PlanTaskSyncBo;
import com.yeejoin.amos.patrol.business.dao.mapper.CheckMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.patrol.business.dao.repository.IPlanTaskDao;
import com.yeejoin.amos.patrol.business.dao.repository.IPlanTaskDetailDao;
import com.yeejoin.amos.patrol.business.service.intfc.IPatrolDataSyncService;
import com.yeejoin.amos.patrol.common.enums.PatrolDataSyncTopicEnum;
import com.yeejoin.amos.patrol.common.enums.PlanTaskTypeStatusEnum;
import com.yeejoin.amos.patrol.dao.entity.*;
import com.yeejoin.amos.patrol.mqtt.WebMqttComponent;
import lombok.extern.slf4j.Slf4j;
......@@ -18,10 +22,9 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.text.ParseException;
import java.util.*;
import java.util.stream.Collectors;
@Service
@Async
......@@ -40,6 +43,19 @@ public class PatrolDataSyncServiceImpl implements IPatrolDataSyncService {
@Value("${emq.patrol.sync.switch}")
private Boolean patrolSyncSwitch;
@Autowired
private CheckMapper checkMapper;
private String P_STATIC_DAY = "p_static_day";
private String P_STATIC_MONTH = "p_static_month";
private String P_STATIC_WEEK = "p_static_week";
@Autowired
private PlanTaskMapper planTaskMapper;
@Override
public void checkDataSync(Check check) {
if (check != null) {
......@@ -238,7 +254,48 @@ public class PatrolDataSyncServiceImpl implements IPatrolDataSyncService {
}
}
@Override
@Async("asyncServiceExecutor")
public void taskStatic(String runDate) {
try {
runDate = DateUtils.dateFormat(new Date(), DateUtils.DATE_PATTERN);
} catch (ParseException e) {
e.printStackTrace();
}
log.info("开始更新统计表========");
// 插入日统计表
List<Map<String, Object>> listDay = checkMapper.planCount(runDate, null, String.valueOf(PlanTaskTypeStatusEnum.day.getValue()), null,null,null);
List<StaticDay> staticDays = listDay.stream().map(e->{
String s = JSON.toJSONString(e);
StaticDay staticDay = JSON.parseObject(s, StaticDay.class);
return staticDay;
}).collect(Collectors.toList());
// 插入周统计表
List<Map<String, Object>> listWeek = checkMapper.planCount(runDate, null, String.valueOf(PlanTaskTypeStatusEnum.week.getValue()), null,null,null);
List<StaticDay> staticWeeks = listWeek.stream().map(e->{
String s = JSON.toJSONString(e);
StaticDay staticWeek = JSON.parseObject(s, StaticDay.class);
return staticWeek;
}).collect(Collectors.toList());
// 插入月统计表
List<Map<String, Object>> listMonth = checkMapper.planCount(runDate, null, String.valueOf(PlanTaskTypeStatusEnum.month.getValue()), null,null,null);
List<StaticDay> staticMonths = listMonth.stream().map(e->{
String s = JSON.toJSONString(e);
StaticDay staticMonth = JSON.parseObject(s, StaticDay.class);
return staticMonth;
}).collect(Collectors.toList());
if(staticDays.size() > 0) {
planTaskMapper.updateData(P_STATIC_DAY,staticDays);
}
if(staticWeeks.size() > 0) {
planTaskMapper.updateData(P_STATIC_WEEK,staticDays);
}
if(staticMonths.size() > 0) {
planTaskMapper.updateData(P_STATIC_MONTH,staticDays);
}
log.info("更新统计表完成=======");
}
public String buildSyncMessage(String topic, Object object) {
Map<String, Object> map = new HashMap<>();
......
package com.yeejoin.amos.patrol.business.service.impl;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.patrol.business.constants.XJConstant;
import com.yeejoin.amos.patrol.business.dao.mapper.PlanMapper;
import com.yeejoin.amos.patrol.business.dao.repository.IPlanDao;
import com.yeejoin.amos.patrol.business.dao.repository.IPlanTaskDao;
import com.yeejoin.amos.patrol.business.dao.repository.IPlanTaskDetailDao;
import com.yeejoin.amos.patrol.business.dao.mapper.PlanTaskMapper;
import com.yeejoin.amos.patrol.business.dao.repository.*;
import com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo;
import com.yeejoin.amos.patrol.business.param.PlanInfoPageParam;
import com.yeejoin.amos.patrol.business.service.intfc.ICheckService;
import com.yeejoin.amos.patrol.business.service.intfc.IPlanService;
import com.yeejoin.amos.patrol.core.common.response.AppCheckInputRespone;
import com.yeejoin.amos.patrol.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.patrol.core.util.DateUtil;
import com.yeejoin.amos.patrol.core.util.StringUtil;
import com.yeejoin.amos.patrol.dao.entity.Check;
import com.yeejoin.amos.patrol.dao.entity.CheckInput;
import com.yeejoin.amos.patrol.dao.entity.CheckShot;
import com.yeejoin.amos.patrol.dao.entity.Plan;
import liquibase.pro.packaged.L;
import org.slf4j.Logger;
......@@ -21,6 +28,7 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.stream.Collectors;
@Service("planService")
public class PlanServiceImpl implements IPlanService {
......@@ -44,7 +52,104 @@ public class PlanServiceImpl implements IPlanService {
Page<HashMap<String, Object>> result = new PageImpl<HashMap<String, Object>>(content, param, total);
return result;
}
@Autowired
private ICheckDao checkDao;
@Autowired
private ICheckService checkService;
@Autowired
PlanTaskMapper planTaskMapper;
@Autowired
private ICheckShotDao iCheckShotDao;
@Override
public AppPointCheckRespone queryPointPlanTaskDetail(String toke, String product, String appKey, Long planTaskId, Long pointId) {
AppPointCheckRespone pointCheckRespone = new AppPointCheckRespone();
Check check = checkDao.findByPlanTaskIdAndPointId(planTaskId, pointId);
if (check != null) {
pointCheckRespone = checkService.queryCheckPointDetailInVersion2(toke, product, appKey, check.getId(), planTaskId, pointId);
} else {
PointCheckDetailBo planPointInfo = planTaskMapper.getPointPlanTaskInfo(planTaskId, pointId);
pointCheckRespone.setTaskStatus(planPointInfo.getTaskStatus());
pointCheckRespone.setPointStatus(planPointInfo.getPointStatus());
if (planPointInfo != null) {
if(check != null) {
List<CheckShot> checkShots = iCheckShotDao.findAllByCheckIdAndCheckInputId(check.getId(),
0L);
List<String> photos = new ArrayList<>();
if (!org.springframework.util.CollectionUtils.isEmpty(checkShots)) {
photos = checkShots.stream().map(e -> {
if (e != null) {
return e.getPhotoData().replaceAll("\\\\", "/");
} else {
return "";
}
}).collect(Collectors.toList());
}
pointCheckRespone.setPointImgUrls(photos);
}
pointCheckRespone.setId(planPointInfo.getId());
pointCheckRespone.setPlanTaskId(Long.valueOf(planPointInfo.getPlanTaskId()));
pointCheckRespone.setPointId(pointId);
pointCheckRespone.setPointName(planPointInfo.getPointName());
pointCheckRespone.setPointNo(planPointInfo.getPointNo());
pointCheckRespone.setBeginTime(planPointInfo.getBeginTime());
pointCheckRespone.setEndTime(planPointInfo.getEndTime());
pointCheckRespone.setPlanName(planPointInfo.getPlanName());
pointCheckRespone.setShortMaxNumber(planPointInfo.getShortMaxNumber());
pointCheckRespone.setShortMinNumber(planPointInfo.getShortMinNumber());
List<PointCheckDetailBo> pointInputs = planTaskMapper.getPointInputByRouteIdAndPointId(planPointInfo.getRouteId(), planPointInfo.getPointId());
JSONObject appResponeMap = new JSONObject();
List<AppCheckInputRespone> appCheckInputResponeList = new ArrayList<AppCheckInputRespone>();
pointInputs.forEach(action -> {
AppCheckInputRespone input = new AppCheckInputRespone();
input.setInputName(action.getInputName());
input.setCheckInputId(action.getCheckInputId());
input.setDefaultValue(action.getDefaultValue());
input.setDataJson(action.getDataJson());
input.setIsMultiline(action.getIsMultiline());
input.setIsMust(action.getIsMust());
input.setInputValue(null);
if(null != check) {
for (CheckInput ck :check.getCheckInput()
) {
if(ck.getInputId().toString().equals(String.valueOf(action.getCheckInputId()))) {
input.setInputValue(ck.getInputValue());
}
}
List<CheckShot> checkShotsNew = iCheckShotDao.findAllByCheckIdAndCheckInputId(check.getId(),
action.getCheckInputId());
List<String> photosNew = new ArrayList<>();
if (!org.springframework.util.CollectionUtils.isEmpty(checkShotsNew)) {
photosNew = checkShotsNew.stream().map(e -> {
if (e != null) {
return e.getPhotoData().replaceAll("\\\\", "/");
} else {
return "";
}
}).collect(Collectors.toList());
}
input.setPointInputImgUrls(photosNew);
}
input.setItemType(action.getItemType());
input.setOrderNo(action.getOrderNo());
input.setPictureJson(action.getPictureJson());
input.setClassifyId(action.getClassifyId());
input.setClassifyName(action.getClassifyName());
appCheckInputResponeList.add(input);
});
appResponeMap.put("items", appCheckInputResponeList);
pointCheckRespone.setAppCheckInput(appResponeMap);
}
}
return pointCheckRespone;
}
@Override
public Plan addPlan(HashMap<String, Object> map) {
Plan param = (Plan) map.get("param");
......
......@@ -927,9 +927,9 @@ public class PointServiceImpl implements IPointService {
@Override
public List queryItemList4RoutePointNew(Long routeId,Long pointId, Long classifyId) {
if (pointId == null || classifyId == null) {
throw new RuntimeException("查询条件有误");
}
// if (pointId == null || classifyId == null) {
// throw new RuntimeException("查询条件有误");
// }
List<Map<String, Object>> resList = pointMapper.queryItemList4RoutePoint(pointId, classifyId);
//查询管控字典值,并替换到返回值
HashMap<String, String> dictMap = new HashMap<>();
......@@ -1910,6 +1910,16 @@ public class PointServiceImpl implements IPointService {
content.forEach(e->{
if(e.get("id")!=null && !StringUtils.isBlank(e.get("id").toString())){
List<PointInputItemVo> inputItems = inputItemMapper.queryCustomInputItemByPointId(e.get("id").toString());
//匹配管控形式字典
//查询管控字典值,并替换到返回值
HashMap<String, String> dictMap = new HashMap<>();
List<DictionarieValueModel> result = Systemctl.dictionarieClient.dictValues(formOfManagementAndControl).getResult();
result.forEach(x-> dictMap.put(x.getDictDataKey(),x.getDictDataValue()));
inputItems.stream().peek(item->{
if (!ObjectUtils.isEmpty(item.getInputClassify())){
item.setInputClassify(dictMap.getOrDefault(item.getInputClassify(),"其他"));
}
}).collect(Collectors.toList());
e.put("equipIputDetailData",inputItems);
e.put("equipIputDetailDataNum",inputItems!=null?inputItems.size():0);
}
......
......@@ -60,4 +60,23 @@ public class RepositoryTImpl implements RepositoryTs {
}
return var1;
}
@Override
public <S> Iterable<S> batchSaveNoAsync(Iterable<S> var1) {
Iterator<S> iterator = var1.iterator();
int index = 0;
while (iterator.hasNext()){
em.persist(iterator.next());
index++;
if (index % BATCH_SIZE == 0){
em.flush();
em.clear();
}
}
if (index % BATCH_SIZE != 0){
em.flush();
em.clear();
}
return var1;
}
}
......@@ -560,23 +560,24 @@ public class RouteServiceImpl extends ServiceImpl<RouteMapper, Route> implement
if (oldRoutePointList != null && oldRoutePointList.size() > 0) {
RoutePoint RoutePoint = oldRoutePointList.get(0);
if (!"".equals(RoutePoint.getExcludeItems()) && RoutePoint.getExcludeItems() != null){
List<Long> split = Arrays.asList(RoutePoint.getExcludeItems().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
Set<Long> allPointInputItemIdSet = iPointInputItemDao.getPointInputItemByPointIdAndClassifyId(pointId, classifyId)
.stream().map(PointInputItem::getId)
.collect(Collectors.toSet());
List<Long> otherClassify = new ArrayList<>();
split.forEach(x -> {
if (!allPointInputItemIdSet.contains(x)) {
otherClassify.add(x);
}
});
List<Long> lastList = Stream.concat(otherClassify.stream(), inputItemIds.stream()).distinct().collect(Collectors.toList());
RoutePoint.setExcludeItems(StringUtils.join(lastList.toArray(), ","));
}else {
RoutePoint.setExcludeItems(StringUtils.join(inputItemIds.toArray(),","));
}
// if (!"".equals(RoutePoint.getExcludeItems()) && RoutePoint.getExcludeItems() != null){
// List<Long> split = Arrays.asList(RoutePoint.getExcludeItems().split(",")).stream().map(Long::parseLong).collect(Collectors.toList());
//
// Set<Long> allPointInputItemIdSet = iPointInputItemDao.getPointInputItemByPointIdAndClassifyId(pointId, classifyId)
// .stream().map(PointInputItem::getId)
// .collect(Collectors.toSet());
// List<Long> otherClassify = new ArrayList<>();
// split.forEach(x -> {
// if (!allPointInputItemIdSet.contains(x)) {
// otherClassify.add(x);
// }
// });
// List<Long> lastList = Stream.concat(otherClassify.stream(), inputItemIds.stream()).distinct().collect(Collectors.toList());
RoutePoint.setExcludeItems(StringUtils.join(inputItemIds, ","));
// }
// else {
// RoutePoint.setExcludeItems(StringUtils.join(inputItemIds.toArray(),","));
// }
iRoutePointDao.saveAndFlush(RoutePoint);
}
......
......@@ -33,4 +33,6 @@ public interface IPatrolDataSyncService {
void planTaskDataSync(List<PlanTask> planTaskList);
void planTaskDetailDataSync(List<PlanTaskDetail> planTaskDetailList);
void taskStatic(String runDate);
}
package com.yeejoin.amos.patrol.business.service.intfc;
import com.yeejoin.amos.patrol.business.param.PlanInfoPageParam;
import com.yeejoin.amos.patrol.core.common.response.AppPointCheckRespone;
import com.yeejoin.amos.patrol.dao.entity.Plan;
import org.springframework.data.domain.Page;
......@@ -21,6 +22,14 @@ public interface IPlanService {
* @param map
*/
Plan addPlan(HashMap<String, Object> map);
/**
* 根据任务id点id 获取点详情
* @param planTaskId
* @param pointId
* @return
*/
AppPointCheckRespone queryPointPlanTaskDetail(String toke, String product, String appKey, Long planTaskId, Long pointId);
/**
* 巡检计划删除
......
......@@ -67,6 +67,13 @@ public interface IPlanTaskService {
void taskExecution(String runDate);
/**
* 自动任务执行
* @param runDate
*/
void taskStaticExecution(String runDate);
/**
* 定时任务发送消息执行中的消息
*
* @param runDate
......@@ -114,7 +121,7 @@ public interface IPlanTaskService {
* @param params
* @return
*/
Page<Map<String, Object>> getPlanTasks(String toke,String product,String appKey,HashMap<String, Object> params);
Page<Map<String, Object>> getPlanTasks(String toke,String product,String appKey,HashMap<String, Object> params);
/**
* 根据计划任务Id获取计划任务信息
......@@ -150,13 +157,6 @@ public interface IPlanTaskService {
*/
List<PlanTaskVo> getPlanTaskListByIds(String toke,String product,String appKey,Long[] ids);
List<PlanTaskVo> getPlanTaskListByIdsNew(Long[] ids);
/**
* 根据任务id点id 获取点详情
* @param planTaskId
* @param pointId
* @return
*/
AppPointCheckRespone queryPointPlanTaskDetail(String toke,String product,String appKey,Long planTaskId,Long pointId);
AppPointCheckRespone queryPointPlanTaskDetailInVersion2(String toke,String product,String appKey,Long planTaskId,Long pointId);
......@@ -207,4 +207,6 @@ public interface IPlanTaskService {
void download(HttpServletRequest request, HttpServletResponse response, String taskDetailId) throws UnsupportedEncodingException;
Map<String,Object> queryPatrolInfoList(String bizOrgCode, Date startDate, Date endDate);
void backPatrolInfo();
}
package com.yeejoin.amos.patrol.config;
import org.apache.http.HttpHost;
import org.apache.http.auth.AuthScope;
import org.apache.http.auth.UsernamePasswordCredentials;
import org.apache.http.client.CredentialsProvider;
import org.apache.http.impl.client.BasicCredentialsProvider;
import org.elasticsearch.client.RestClient;
import org.elasticsearch.client.RestClientBuilder;
import org.elasticsearch.client.RestHighLevelClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import java.util.Arrays;
@Configuration
public class ElasticSearchClientConfig {
@Value("${spring.elasticsearch.rest.uris}")
private String uris;
@Value("${elasticsearch.username}")
private String username;
@Value("${elasticsearch.password}")
private String password;
@Bean(destroyMethod = "close")
public RestHighLevelClient restHighLevelClient() {
final CredentialsProvider credentialsProvider = new BasicCredentialsProvider();
credentialsProvider.setCredentials(AuthScope.ANY,
new UsernamePasswordCredentials(username, password));
try {
HttpHost[] httpHosts = Arrays.stream(uris.split(",")).map(HttpHost::create).toArray(HttpHost[]::new);
RestClientBuilder builder = RestClient.builder(httpHosts);
builder.setHttpClientConfigCallback(httpClientBuilder -> {
httpClientBuilder.disableAuthCaching();
return httpClientBuilder.setDefaultCredentialsProvider(credentialsProvider);
});
// 该方法接收一个RequestConfig.Builder对象,对该对象进行修改后然后返回。
builder.setRequestConfigCallback(requestConfigBuilder -> {
// 连接超时(默认为1秒)
return requestConfigBuilder.setConnectTimeout(5000 * 1000)
// 套接字超时(默认为30秒)//更改客户端的超时限制默认30秒现在改为100*1000分钟
.setSocketTimeout(6000 * 1000);
});
return new RestHighLevelClient(builder);
} catch (Exception e) {
throw new IllegalStateException("Invalid ES nodes " + "property '" + uris + "'", e);
}
}
}
//package com.yeejoin.amos.patrol.config;
//
//
//import lombok.Getter;
//import lombok.Setter;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.apache.shardingsphere.driver.jdbc.core.datasource.ShardingSphereDataSource;
//
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//import org.springframework.util.Assert;
//
//import javax.annotation.PostConstruct;
//import javax.annotation.Resource;
//import javax.sql.DataSource;
//import java.sql.Connection;
//import java.sql.ResultSet;
//import java.sql.SQLException;
//import java.sql.Statement;
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @author liran
// */
//@Slf4j
//@Setter
//@Getter
//@Component
//public class TableCreate {
//
// @Resource
// private ShardingSphereDataSource dataSource;
//
// Map<String, Object> createdTables = new HashMap<>();
// @Value("${shardingsphere.create.tables.num:10}")
// private String num;
//
// private String PLAN_TASK = "p_plan_task";
// private String PLAN_TASK_HISTORY = "p_plan_task_history_";
//
// private String PLAN_TASK_DETAIL = "p_plan_task_detail";
// private String PLAN_TASK_DETAIL_HISTORY = "p_plan_task_detail_history_";
//
// private String P_CHECK = "p_check";
// private String P_CHECK_HISTORY = "p_check_history_";
//
// private String P_CHECK_INPUT = "p_check_input";
// private String P_CHECK_INPUT_HISTORY = "p_check_input_history_";
//
// private String P_CHECK_SHOT = "p_check_shot";
// private String P_CHECK_SHOT_HISTORY = "p_check_shot_history_";
//
// private String DB = "amos_tzs_biz.";
//
//
// @PostConstruct
// public void init() {
// for(int i = 1; i<=Integer.parseInt(num); i++) {
// createNeedTime(PLAN_TASK,DB,PLAN_TASK_HISTORY+i);
// }
// for(int i = 1; i<=Integer.parseInt(num); i++) {
// createNeedTime(PLAN_TASK_DETAIL,DB,PLAN_TASK_DETAIL_HISTORY+i);
// }
// for(int i = 1; i<=Integer.parseInt(num); i++) {
// createNeedTime(P_CHECK,DB,P_CHECK_HISTORY+i);
// }
// for(int i = 1; i<=Integer.parseInt(num); i++) {
// createNeedTime(P_CHECK_INPUT,DB,P_CHECK_INPUT_HISTORY+i);
// }
// for(int i = 1; i<=Integer.parseInt(num); i++) {
// createNeedTime(P_CHECK_SHOT,DB,P_CHECK_SHOT_HISTORY+i);
// }
// }
//
//
// private void createNeedTime(String table, String db, String create) {
// DataSource dataSource = this.dataSource;
// String sql = "SHOW CREATE TABLE " + table;
// String existSql = "select * from information_schema.tables where table_name ='" + table + "'; ";
// doCreate(dataSource, sql, existSql, create, db, table);
// }
//
// private void doCreate(DataSource dataSource, String sql, String existSql, String create, String db, String table) {
// String msg = " create table: " + create + " origin table: " + table + " db: " + db;
// Connection conn = null;
// Statement stmt = null;
// try {
// conn = dataSource.getConnection().getMetaData().getConnection();
// stmt = conn.createStatement();
// ResultSet resultSet = stmt.executeQuery(existSql);
// Assert.isTrue(resultSet.next(), msg + "初始化表不存在");
//
// ResultSet resTable = stmt.executeQuery(sql);
// Assert.isTrue(resTable.next(), msg + "初始化表不存在");
// String existTableName = resTable.getString(1);
// String createSqlOrigin = resTable.getString(2);
// // log.info(existTableName, createSqlOrigin);
//
// String existSqlNew = StringUtils.replaceOnce(existSql, existTableName, create);
// ResultSet executeQuery = stmt.executeQuery(existSqlNew);
// if (executeQuery.next()) {
// log.info("table exist :" + msg);
// } else {
// createSqlOrigin = createSqlOrigin.substring(0,createSqlOrigin.indexOf(";"));
// String creatsql = StringUtils.replace(createSqlOrigin, existTableName, create).replaceFirst(create, DB+create).replace("bigint(64)", "int8").replace("smallint(16)","int2");
// if (0 == stmt.executeUpdate(creatsql)) {
// log.info(msg + "success !");
//
// } else {
// log.error(msg + "fail !");
// }
// }
// } catch (Exception e) {
// log.error("create table fail error : {} ", e.getMessage());
// } finally {
// if (stmt != null) {
// try {
// stmt.close();
// } catch (SQLException e) {
// log.error("SQLException", e);
// }
// }
// if (conn != null) {
// try {
// conn.close();
// } catch (SQLException e) {
// log.error("SQLException", e);
// }
// }
// }
// }
//
//}
......@@ -6,6 +6,7 @@ import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.yeejoin.amos.component.robot.AmosRequestContext;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.patrol.business.dao.mapper.MsgSubscribeMapper;
import com.yeejoin.amos.patrol.business.dao.repository.IMsgDao;
......@@ -59,11 +60,15 @@ public class AsyncTask {
@Autowired
private IEmailService iEmailService;
@Autowired
AmosRequestContext amosRequestContext;
private static final String TOKE = "TOKE";
private static final String TAB = "\r\n";
/**
* 检查消息推送
* @param checkId
......@@ -109,8 +114,7 @@ public class AsyncTask {
@Async("asyncTaskExecutor")
public Future<Boolean> pushCheckMessage(Long checkId) throws InterruptedException {
Toke toke= remoteSecurityService.getServerToken();
messageService.pushCheckMessage(toke.getToke(),toke.getProduct(),toke.getAppKey(),checkId);
messageService.pushCheckMessage(amosRequestContext.getToken(),amosRequestContext.getProduct(),amosRequestContext.getAppKey(),checkId);
return new AsyncResult<Boolean>(true);
}
......@@ -223,8 +227,7 @@ public class AsyncTask {
pushMsgParam.setType(JPushTypeEnum.ALIAS.getCode());
pushMsgParam.setExtras(extras);
iMsgDao.saveAll(msgs);
Toke toke= remoteSecurityService.getServerToken();
messageService.pushMsg(toke.getToke(),toke.getProduct(),toke.getAppKey(),pushMsgParam);
messageService.pushMsg(amosRequestContext.getToken(), amosRequestContext.getProduct(), amosRequestContext.getAppKey(), pushMsgParam);
}
}
......
......@@ -25,7 +25,7 @@ public class ApplicationStartListener implements ApplicationListener<ContextRefr
@Override
public void onApplicationEvent(ContextRefreshedEvent event) {
try{
if(event.getApplicationContext().getParent().getParent().getParent() == null){
if(event.getApplicationContext().getId().equals("application-1")){
iPlanTaskService.initPlanStatusOrGenDate();
pointService.initPointStatus();
jobService.initScheduler();
......
......@@ -90,42 +90,42 @@ public class RemoteSecurityService {
return null;
}
public Toke getServerToken() {
IdPasswordAuthModel dPasswordAuthModel = new IdPasswordAuthModel();
dPasswordAuthModel.setLoginId(loginId);
dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz"));
Toke toke = null;
try {
toke = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(loginId)), Toke.class);
if (ObjectUtils.isEmpty(toke)) {
toke = getLogin(dPasswordAuthModel);
} else {
RequestContext.setProduct(productWeb);
if (!TokenOperation.refresh(toke.getToke())) {
toke = getLogin(dPasswordAuthModel);
}
}
RequestContext.setAppKey(toke.getAppKey());
RequestContext.setToken(toke.getToke());
} catch (InnerInvokException e) {
e.printStackTrace();
}
return toke;
}
private Toke getLogin(IdPasswordAuthModel dPasswordAuthModel) {
Toke toke = new Toke();
RequestContext.setProduct(productWeb);
FeignClientResult feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel);
Map map = (Map) feignClientResult.getResult();
if (map != null) {
toke.setToke(map.get("token").toString());
toke.setProduct(productWeb);
toke.setAppKey(appKey);
redisTemplate.opsForValue().set(buildKey(dPasswordAuthModel.getLoginId()), JSONObject.toJSONString(toke), 28, TimeUnit.DAYS);
}
return toke;
}
// public Toke getServerToken() {
// IdPasswordAuthModel dPasswordAuthModel = new IdPasswordAuthModel();
// dPasswordAuthModel.setLoginId(loginId);
// dPasswordAuthModel.setPassword(DesUtil.encode(password, "qaz"));
// Toke toke = null;
// try {
// toke = JSON.parseObject(redisTemplate.opsForValue().get(buildKey(loginId)), Toke.class);
// if (ObjectUtils.isEmpty(toke)) {
// toke = getLogin(dPasswordAuthModel);
// } else {
// RequestContext.setProduct(productWeb);
// if (!TokenOperation.refresh(toke.getToke())) {
// toke = getLogin(dPasswordAuthModel);
// }
// }
// RequestContext.setAppKey(toke.getAppKey());
// RequestContext.setToken(toke.getToke());
// } catch (InnerInvokException e) {
// e.printStackTrace();
// }
// return toke;
// }
// private Toke getLogin(IdPasswordAuthModel dPasswordAuthModel) {
// Toke toke = new Toke();
// RequestContext.setProduct(productWeb);
// FeignClientResult feignClientResult = Privilege.authClient.idpassword(dPasswordAuthModel);
// Map map = (Map) feignClientResult.getResult();
// if (map != null) {
// toke.setToke(map.get("token").toString());
// toke.setProduct(productWeb);
// toke.setAppKey(appKey);
// redisTemplate.opsForValue().set(buildKey(dPasswordAuthModel.getLoginId()), JSONObject.toJSONString(toke), 28, TimeUnit.DAYS);
// }
// return toke;
// }
//redi缓存系统用户token信息
......
package com.yeejoin.amos.patrol.quartz;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.patrol.business.param.CheckRecordParam;
import com.yeejoin.amos.patrol.dao.entity.Msg;
import com.yeejoin.amos.patrol.dao.entity.PlanTask;
import com.yeejoin.amos.patrol.dao.entity.Task;
......@@ -63,5 +65,7 @@ public interface IJobService {
public void msgJobPerform(long msgId,String jobType,String jobName);
public void createCheckRecord(PlanTask planTask,String userId);
public JSONObject getCheckInput(Long routeId, Long pointId, String type, CheckRecordParam requestParam);
}
......@@ -41,7 +41,7 @@ public class QuartzManager {
} else {
System.out.println("定时器已存在=========");
}
} catch (Exception e) {
} catch (Exception e) {
throw new RuntimeException(e);
}
}
......
......@@ -29,6 +29,7 @@ spring.datasource.hikari.maximum-pool-size = 10
spring.datasource.testWhileIdle = true
spring.datasource.validationQuery = SELECT 1
security.password=a1234560
security.loginId=admin
security.productWeb=STUDIO_APP_WEB
......@@ -47,7 +48,9 @@ spring.redis.jedis.pool.min-idle=0
spring.redis.timeout=1000
#巡检计划定时任务
jobs.cron = 0 2 18 * * ?
jobs.cron = 0 0 22 * * ?
jobs.cron.static = 0 0 1 * * ?
jobs.cron.bak= -
#邮件配置
#params.mailPush = false
......@@ -104,6 +107,7 @@ is.zxj=true
fire-rescue=1432549862557130753
## ES properties:
action.auto_create_index:true
elasticsearch.username=elastic
elasticsearch.password=a123456
spring.elasticsearch.rest.uris=http://172.16.10.243:9200
......@@ -120,3 +124,70 @@ spring.jpa.properties.hibernate.jdbc.batch_versioned_data=true
spring.jpa.properties.hibernate.order_inserts=true
spring.jpa.properties.hibernate.order_updates =true
#spring.shardingsphere.mode.type=Standalone
#spring.shardingsphere.mode.repository.type=JDBC
## ds0
#spring.shardingsphere.datasource.ds0.type=com.zaxxer.hikari.HikariDataSource
#spring.shardingsphere.datasource.ds0.driver-class-name=cn.com.vastbase.Driver
#spring.shardingsphere.datasource.ds0.jdbc-url=jdbc:vastbase://172.16.10.243:5432/tzs_amos_tzs_biz_init?currentSchema=amos_tzs_biz&allowMultiQueries=true
#spring.shardingsphere.datasource.ds0.username=admin
#spring.shardingsphere.datasource.ds0.password=Yeejoin@2023
#spring.shardingsphere.datasource.ds0.idle-timeout=600000
#spring.shardingsphere.datasource.ds0.connection-timeout=30000
#spring.shardingsphere.datasource.ds0.validation-timeout=3000
#spring.shardingsphere.datasource.ds0.max-lifetime=58880
#spring.shardingsphere.datasource.ds0.minimum-idle=10
#spring.shardingsphere.datasource.ds0.maximum-pool-size=50
#
#
##数据源名称,多数据源以逗号分隔
#spring.shardingsphere.datasource.names=ds0
## 这里由于分库分表字段不相同配置,不然会导致使用user_id 查询找不到相应的表,如果我们分库分表都使用 user_id 则不需要这个配置
#spring.shardingsphere.rules.sharding.tables.p_plan_task_history.actual-data-nodes = ds0.p_plan_task_history_$->{1..2}
#spring.shardingsphere.rules.sharding.tables.p_plan_task_detail_history.actual-data-nodes = ds0.p_plan_task_detail_history_$->{1..2}
#spring.shardingsphere.rules.sharding.tables.p_check_history.actual-data-nodes = ds0.p_check_history_$->{1..2}
#spring.shardingsphere.rules.sharding.tables.p_check_input_history.actual-data-nodes = ds0.p_check_input_history_$->{1..2}
#spring.shardingsphere.rules.sharding.tables.p_check_shot_history.actual-data-nodes = ds0.p_check_shot_history_$->{1..2}
#
#spring.shardingsphere.sharding.default-data.source-name=ds0
#spring.main.allow-bean-definition-overriding=true
#
## -----分表开始
## 分片键位sequence_nbr,每个库分为两表,所以取模2
#spring.shardingsphere.rules.sharding.tables.p_plan_task_history.table-strategy.standard.sharding-column=id
#spring.shardingsphere.rules.sharding.tables.p_plan_task_history.table-strategy.standard.sharding-algorithm-name=task-inline
#
#spring.shardingsphere.rules.sharding.tables.p_plan_task_detail_history.table-strategy.standard.sharding-column=id
#spring.shardingsphere.rules.sharding.tables.p_plan_task_detail_history.table-strategy.standard.sharding-algorithm-name=task-detail-inline
#
#spring.shardingsphere.rules.sharding.tables.p_check_history.table-strategy.standard.sharding-column=id
#spring.shardingsphere.rules.sharding.tables.p_check_history.table-strategy.standard.sharding-algorithm-name=check-inline
#
#spring.shardingsphere.rules.sharding.tables.p_check_input_history.table-strategy.standard.sharding-column=id
#spring.shardingsphere.rules.sharding.tables.p_check_input_history.table-strategy.standard.sharding-algorithm-name=check-input-inline
#
#spring.shardingsphere.rules.sharding.tables.p_check_shot_history.table-strategy.standard.sharding-column=id
#spring.shardingsphere.rules.sharding.tables.p_check_shot_history.table-strategy.standard.sharding-algorithm-name=check-shot-inline
#
##行表达式分片算法
#spring.shardingsphere.rules.sharding.sharding-algorithms.task-inline.type=INLINE
#spring.shardingsphere.rules.sharding.sharding-algorithms.task-inline.props.algorithm-expression=p_plan_task_history_$->{id % 2 + 1}
#
#spring.shardingsphere.rules.sharding.sharding-algorithms.task-detail-inline.type=INLINE
#spring.shardingsphere.rules.sharding.sharding-algorithms.task-detail-inline.props.algorithm-expression=p_plan_task_detail_history_$->{id % 2 + 1}
#
#spring.shardingsphere.rules.sharding.sharding-algorithms.check-inline.type=INLINE
#spring.shardingsphere.rules.sharding.sharding-algorithms.check-inline.props.algorithm-expression=p_check_history_$->{id % 2 + 1}
#
#spring.shardingsphere.rules.sharding.sharding-algorithms.check-input-inline.type=INLINE
#spring.shardingsphere.rules.sharding.sharding-algorithms.check-input-inline.props.algorithm-expression=p_check_input_history_$->{id % 2 + 1}
#
#spring.shardingsphere.rules.sharding.sharding-algorithms.check-shot-inline.type=INLINE
#spring.shardingsphere.rules.sharding.sharding-algorithms.check-shot-inline.props.algorithm-expression=p_check_shot_history_$->{id % 2 + 1}
## -----分表结束
#
##是否开启SQL显示,默认值: false
#spring.shardingsphere.props.sql-show= false
#spring.shardingsphere.props.max-connections-size-per-query=5
shardingsphere.create.tables.num=10
\ No newline at end of file
......@@ -553,27 +553,21 @@
<select id="planCount" resultType="Map">
SELECT
SUM ( CASE WHEN pt.finish_status = '0' or pt.finish_status = '1' THEN ( CASE WHEN pl.plan_type = #{type} THEN 1 ELSE 0 END) ELSE 0 END ) notStart,
SUM ( CASE WHEN pt.finish_status = '2' THEN ( CASE WHEN pl.plan_type = #{type} THEN ( CASE WHEN pt.risk_status = '1' THEN 1 ELSE 0 END) ELSE 0 END) ELSE 0 END ) riskEnd,
SUM ( CASE WHEN pt.finish_status = '2' THEN ( CASE WHEN pl.plan_type = #{type} THEN ( CASE WHEN pt.risk_status = '2' THEN 1 ELSE 0 END) ELSE 0 END) ELSE 0 END ) noRiskEnd,
SUM ( CASE WHEN pt.finish_status = '3' THEN ( CASE WHEN pl.plan_type = #{type} THEN 1 ELSE 0 END) ELSE 0 END ) timeOut,
(
CASE
WHEN '2' = #{type} THEN ( 1+( date_part( 'week', pt.begin_time ) ) )
ELSE ( CASE WHEN '1' = #{type} THEN DATE_FORMAT ( pt.check_date, '%Y-%m-%d' ) ELSE ( substr( DATE_FORMAT ( pt.check_date, '%Y-%m' ) , 6)) END ) END
) stime,
pl.plan_type as type
SUM ( CASE WHEN pt.finish_status = '0' or pt.finish_status = '1' THEN ( CASE WHEN pt.plan_type = #{type} THEN 1 ELSE 0 END) ELSE 0 END ) notStart,
SUM ( CASE WHEN pt.finish_status = '2' THEN ( CASE WHEN pt.plan_type = #{type} THEN ( CASE WHEN pt.risk_status = '1' THEN 1 ELSE 0 END) ELSE 0 END) ELSE 0 END ) riskEnd,
SUM ( CASE WHEN pt.finish_status = '2' THEN ( CASE WHEN pt.plan_type = #{type} THEN ( CASE WHEN pt.risk_status = '2' THEN 1 ELSE 0 END) ELSE 0 END) ELSE 0 END ) noRiskEnd,
SUM ( CASE WHEN pt.finish_status = '3' THEN ( CASE WHEN pt.plan_type = #{type} THEN 1 ELSE 0 END) ELSE 0 END ) timeOut,
DATE_FORMAT ( pt.check_date, '%Y-%m-%d' ) checkTime,
pt.org_code orgCode,
pt.use_code unitCode,
pt.begin_time beginTime,
pt.end_time endTime
FROM
p_plan_task pt left join p_plan pl on pt.plan_id = pl.id
p_plan_task pt
WHERE
pl.plan_type = #{type}
<if test="type!=null and type==1">AND DATE_FORMAT(pt.check_date, '%Y-%m') = left(#{checkTime}, 7) </if>
<if test="type!=null and type==2">AND pt.check_date between #{startTime} and #{endTime} </if>
<if test="type!=null and type==3">AND DATE_FORMAT(pt.check_date, '%Y') = left(#{checkTime}, 4)</if>
<if test="userId!=null and userId!=0">AND FIND_IN_SET(#{userId}, pt.user_id)>0</if>
<if test="orgCode!=null">AND pt.org_code = #{orgCode} </if>
GROUP BY stime
order by stime ASC
pt.plan_type = #{type}
AND pt.check_date = #{checkTime}
GROUP BY pt.use_code
</select>
......@@ -2298,4 +2292,25 @@
</if>
</where>
</select>
<select id="planCountNew" resultType="java.util.Map">
select tb.not_start notStart, tb.risk_end riskEnd, tb.no_risk_end noRiskEnd, tb.time_out timeOut,
(
CASE
WHEN '2' = #{type} THEN ( 1+( date_part( 'week', tb.begin_time ) ) )
ELSE ( CASE WHEN '1' = #{type} THEN DATE_FORMAT ( tb.check_time, '%Y-%m-%d' ) ELSE ( substr( DATE_FORMAT ( tb.check_time, '%Y-%m' ) , 6)) END ) END
) stime
from ${table} tb
<where>
<if test="type=='1'">
DATE_FORMAT(tb.check_time, '%Y-%m') = #{checkTime}
</if>
<if test="type=='2'">
AND tb.check_time between #{startTime} and #{endTime}
</if>
<if test="type=='3'">
AND DATE_FORMAT(tb.check_time, '%Y') = #{checkTime}
</if>
<if test="orgCode!=null">AND tb.org_code = #{orgCode} </if>
</where>
</select>
</mapper>
\ No newline at end of file
......@@ -167,4 +167,8 @@
<update id="initUpdatePlanNextGenDate">
UPDATE p_plan p SET p.next_gen_date = CURDATE() WHERE p.is_delete = 0 AND p.status = 0 AND p.plan_end IS NULL AND p.next_gen_date <![CDATA[ < ]]> CURDATE();
</update>
<select id="getPlan" resultType="com.yeejoin.amos.patrol.dao.entity.Plan">
select * from p_plan where id = #{planId}
</select>
</mapper>
\ No newline at end of file
......@@ -2,7 +2,39 @@
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.patrol.business.dao.mapper.PlanTaskMapper">
<!--统计-计划执行 -->
<insert id="insertAll">
insert into
${table} (
id ,
not_start,
risk_end,
no_risk_end,
time_out,
check_time,
org_code,
unit_code,
create_date,
begin_time,
end_time
) values
<!-- <foreach collection="list" item="item" index="index" separator="," >-->
(
#{item.id},
#{item.notStart},
#{item.riskEnd},
#{item.noRiskEnd},
#{item.timeOut},
#{item.checkTime},
#{item.orgCode},
#{item.unitCode},
#{item.createDate},
#{item.beginTime},
#{item.endTime}
);
<!-- </foreach>-->
</insert>
<!--统计-计划执行 -->
<select id="countPlanTask" resultType="long">
SELECT COUNT(1) as total_num FROM (
SELECT
......@@ -148,6 +180,7 @@
#{Id}
</foreach>
</delete>
<update id="updatePlanTaskPtInfo" >
update p_plan_task a
set a.point_num = (select count(1) from p_plan_task_detail b where a.id = b.task_no),
......@@ -655,6 +688,8 @@
<select id="getPointPlanTaskInfo" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo" parameterType="long">
SELECT
pptd.id,
ppt.id planTaskId,
pp.id pointId,
pp.name pointName,
pp.point_no pointNo,
......@@ -693,6 +728,7 @@
<select id="getPointInputByRouteIdAndPointId" resultType="com.yeejoin.amos.patrol.business.entity.mybatis.PointCheckDetailBo" parameterType="long">
SELECT
pii.id inputItemId,
pii.name inputName,
pii.id checkInputId,
ppc.id classifyId,
......@@ -1625,6 +1661,27 @@
plan_id,
finish_status
</select>
<select id="findPlanTask" resultType="com.yeejoin.amos.patrol.dao.entity.PlanTask">
select * from p_plan_task
</select>
<select id="findPlanTaskDetail" resultType="com.yeejoin.amos.patrol.dao.entity.PlanTaskDetail">
select * from p_plan_task_detail
</select>
<select id="findCheck" resultType="com.yeejoin.amos.patrol.dao.entity.Check">
select * from p_check
</select>
<select id="findCheckInput" resultType="com.yeejoin.amos.patrol.dao.entity.CheckInput">
select * from p_check_input
</select>
<select id="findCheckShot" resultType="com.yeejoin.amos.patrol.dao.entity.CheckShot">
select * from p_check_shot
</select>
<select id="findStaticDay" resultType="com.yeejoin.amos.patrol.dao.entity.StaticDay">
select * from p_static_day
</select>
<select id="findStaticWeek" resultType="com.yeejoin.amos.patrol.dao.entity.StaticDay">
select * from p_static_week
</select>
<update id="updatePlanTaskList">
update
......@@ -1632,7 +1689,197 @@
set
finish_status = #{newStatus}
where
plan_id = #{planId}
and finish_status = #{oldStatus}
id in
<foreach item="id" collection="ids" index="index" open="(" separator="," close=")">
#{id}
</foreach>
</update>
<update id="updateData">
<foreach collection="list" item="item" index="index" open="" close="" separator=";">
update ${table}
<set>
not_start = #{item.notStart},risk_end = #{item.riskEnd},
no_risk_end = #{item.noRiskEnd},time_out = #{item.timeOut},
create_date = now()
</set>
where org_code = #{item.orgCode} AND check_time = #{item.checkTime}
</foreach>
</update>
<update id="updateSingle">
update ${table} set not_start = not_start - 1,risk_end = risk_end + #{riskEnd},
no_risk_end = no_risk_end + #{noRiskEnd}
where org_code = #{orgCode} AND check_time = #{checkTime}
</update>
<select id="selectPlanTaskIdList" resultType="java.lang.String">
SELECT
id
FROM
"p_plan_task"
WHERE
plan_id = #{planId}
AND finish_status = #{oldStatus}
</select>
<select id="selectTaskDetails" resultType="com.yeejoin.amos.patrol.dao.entity.PlanTaskDetail">
select
pptd.is_finish,
pptd.point_id,
pptd.task_no,
pp.name,
pp.point_no,
pptd.status,
pptd.id,
pptd.create_date
from
"p_plan_task_detail" pptd LEFT JOIN p_point pp ON pp."id"=pptd.point_id
where
task_no in ${id}
</select>
<select id="selectTaskStatus" resultType="java.util.Map">
select finish_status status, org_code orgCode, check_date checkDate, plan_type planType, risk_status riskStatus from "p_plan_task" where id = #{planTaskId}
</select>
<delete id="deleteDate">
delete from ${table} where 1=1;
</delete>
<delete id="deleteOne">
delete from ${table} where check_time = #{checkDate};
</delete>
<select id="selectRoutId" resultType="java.lang.Long">
select route_id from p_plan_task where id = #{id}
</select>
<select id="selectPlanTaskIdLists" resultType="java.lang.String">
SELECT
id
FROM
"p_plan_task"
WHERE
plan_id = #{planId}
AND (finish_status = #{status} or finish_status = #{status1} )
</select>
<select id="selectTaskList" resultType="com.yeejoin.amos.patrol.dao.entity.PlanTask">
select
*
from
"p_plan_task"
where id in
<foreach item="id" collection="newList" index="index" open="(" separator="," close=")">
#{id}
</foreach>
</select>
<select id="queryPlanTaskStaticById" resultType="com.yeejoin.amos.patrol.business.dto.PlanTaskStaticDto">
SELECT
a.planTaskId,
sum(a.finish) finshNum,
sum(a.omission) omission,
sum(a.unqualified) unqualified,
sum(a.unplan) unplan,
count(a.finish) taskPlanNum
FROM
(
SELECT
pt.id planTaskId,
CASE ptd.status
WHEN 1 THEN
1
ELSE
0
END finish,
CASE ptd.status
WHEN 3 THEN
1
ELSE
0
END omission,
CASE ptd.status
WHEN 2 THEN
1
ELSE
0
END unqualified,
CASE ptd.status
WHEN 0 THEN
1
ELSE
0
END unplan
FROM
p_plan_task_detail ptd
LEFT JOIN p_plan_task pt ON ptd.task_no = pt.id
) a
where a.planTaskId IN ${planTaskIds}
GROUP BY a.planTaskId
</select>
<select id="selectTaskDetailList" resultType="com.yeejoin.amos.patrol.dao.entity.ESTaskDetailDto">
SELECT
pptd.id,
pptd.task_no planTaskId,
pptd.status pointStatus,
pp.id pointId,
pp.name pointName,
pp.point_no pointNo,
pp.shot_min_number shortMinNumber,
pp.shot_max_number shortMaxNumber,
'0' checkId
FROM
"p_plan_task_detail" pptd LEFT JOIN p_point pp ON pp.id = pptd.point_id
WHERE
task_no IN ${ids}
</select>
<select id="selectTaskInfoList" resultType="com.yeejoin.amos.patrol.dao.entity.ESTaskDetailDto">
SELECT
id planTaskId,
date_format(ppt.begin_time,'%Y-%m-%d %H:%i:%s') beginTime,
date_format(ppt.end_time,'%Y-%m-%d %H:%i:%s') endTime,
ppt.finish_status taskStatus
FROM
p_plan_task ppt
WHERE
plan_id = #{id};
</select>
<select id="selectPointInputs" resultType="com.yeejoin.amos.patrol.core.common.response.AppCheckInputRespone">
SELECT
prp.point_id,
null inputValue,
null pointInputImgUrls,
pii.default_value,
pii.NAME inputName,
ppi.ID pointInputItemId,
pii.ID checkInputId,
pii.item_type itemType,
pii.risk_desc riskDesc,
pii.data_json dataJson,
pii.is_must isMust,
pii.default_value defaultValue,
pii.picture_json pictureJson,
pii.is_multiline isMultiline,
pii.order_no orderNo
FROM
"p_route_point" prp
LEFT JOIN p_route_point_item pi ON prp.ID = pi.route_point_id
LEFT JOIN p_point_inputitem ppi ON pi.point_input_item_id = ppi.id
LEFT JOIN p_input_item pii ON ppi.input_item_id = pii.id
WHERE
pii."id" IS NOT NULL
AND route_id = #{routeId}
</select>
<select id="getPlanTaskIds" resultType="java.lang.String">
SELECT ID FROM p_plan_task WHERE plan_id = #{id}
</select>
<select id="selectExcludeItemsByRoutId" resultType="java.util.Map">
select point_id,exclude_items from p_route_point where route_id = #{routeId}
</select>
</mapper>
\ No newline at end of file
......@@ -1423,7 +1423,7 @@
LEFT JOIN p_input_item pii ON pii.id = ppi.input_item_id
WHERE
ppi.point_id = #{pointId}
AND ppi.classify_ids = #{classifyId}
AND ppi.classify_ids = (select id from p_point_classify where point_id = #{pointId} limit 1)
</select>
<select id="getPointRefItem" parameterType="list" resultType="map">
......@@ -1509,4 +1509,8 @@
AND pp.id != #{pointId}
</if>
</select>
<select id="selectPointInfo" resultType="com.yeejoin.amos.patrol.dao.entity.Point">
select * from p_point where id = #{pointId}
</select>
</mapper>
\ No newline at end of file
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