1、巡检记录

2、水电双计灌溉记录和刷卡记录
3、水电双计充值记录和卡信息
This commit is contained in:
wuyw
2024-08-12 08:30:02 +08:00
parent d1c9afecd8
commit 7d08d3ca47
47 changed files with 4999 additions and 1 deletions

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>fastbee-service</artifactId>
<groupId>com.fastbee</groupId>
<version>3.8.5</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>fastbee-xunjian-service</artifactId>
<description>
巡检系统模块
</description>
<dependencies>
<!-- 通用工具-->
<dependency>
<groupId>com.fastbee</groupId>
<artifactId>fastbee-common</artifactId>
</dependency>
</dependencies>
</project>

View File

@ -0,0 +1,90 @@
package com.fastbee.xunjian.domain;
import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
/**
* 巡检注意事项对象 xj_inspection_note
*
* @author
* @date 2023-08-23
*/
@Data
public class XjInspectionNote extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* $column.columnComment
*/
private Long id;
/**
* 工程对象类型
*/
@Excel(name = "工程对象类型")
private String engineeringObjectType;
/**
* 标题
*/
@Excel(name = "标题")
private String title;
/**
* 注意事项
*/
@Excel(name = "注意事项")
private String content;
/**
* 项目id
*/
@Excel(name = "项目id")
private Long projectId;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getContent() {
return content;
}
public void setContent(String content) {
this.content = content;
}
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("title", getTitle())
.append("content", getContent())
.append("projectId", getProjectId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@ -0,0 +1,262 @@
package com.fastbee.xunjian.domain;
import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.Date;
/**
* 记录对象 klxj_inspection_records
*
* @author kenlixunjian
* @date 2023-08-04
*/
@Data
public class XjInspectionRecords extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
/**
* 名称
*/
@Excel(name = "名称")
private String name;
private String personnelsOrTasksOrRecords;
//查询开始时间
private String chaxunBeginTime;
//查询结束时间
private String chaxunEndTime;
//点位集合
private String routesIds;
/**
* 任务id
*/
@Excel(name = "任务id")
private Long inspectionTaskId;
/**
* 计划id
*/
@Excel(name = "计划id")
private Long inspectionPlanId;
/**
* 开始时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* 终止时间
*/
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "终止时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date endTime;
/** 执行人 */
@Excel(name = "执行人")
private Long inspectionPersonnelId;
/** 点位id */
@Excel(name = "点位id")
private Long inspectionRouteId;
/** 完成状态 */
@Excel(name = "完成状态")
private String recordStatus;
/** 异常状态 */
@Excel(name = "异常状态")
private String abnormalStatus;
/** 经纬度 */
@Excel(name = "经纬度")
private String latAndLong;
/** 图片 */
@Excel(name = "图片")
private String picture;
/**
* 备注
*/
@Excel(name = "备注")
private String remarks;
private String abnormalType;
/**
* 行政区域码
*/
@Excel(name = "行政区域码")
private String quyuma;
/**
* 项目id
*/
@Excel(name = "项目id")
private Long projectId;
/**
* 班组id
*/
@Excel(name = "班组id")
private Long groupId;
public XjInspectionRoutes route;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public Long getInspectionTaskId() {
return inspectionTaskId;
}
public void setInspectionTaskId(Long inspectionTaskId) {
this.inspectionTaskId = inspectionTaskId;
}
public Long getInspectionPlanId() {
return inspectionPlanId;
}
public void setInspectionPlanId(Long inspectionPlanId) {
this.inspectionPlanId = inspectionPlanId;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public Long getInspectionPersonnelId() {
return inspectionPersonnelId;
}
public void setInspectionPersonnelId(Long inspectionPersonnelId) {
this.inspectionPersonnelId = inspectionPersonnelId;
}
public Long getInspectionRouteId() {
return inspectionRouteId;
}
public void setInspectionRouteId(Long inspectionRouteId) {
this.inspectionRouteId = inspectionRouteId;
}
public String getRecordStatus() {
return recordStatus;
}
public void setRecordStatus(String recordStatus) {
this.recordStatus = recordStatus;
}
public String getAbnormalStatus() {
return abnormalStatus;
}
public void setAbnormalStatus(String abnormalStatus) {
this.abnormalStatus = abnormalStatus;
}
public String getLatAndLong() {
return latAndLong;
}
public void setLatAndLong(String latAndLong) {
this.latAndLong = latAndLong;
}
public String getPicture() {
return picture;
}
public void setPicture(String picture) {
this.picture = picture;
}
public String getRemarks() {
return remarks;
}
public void setRemarks(String remarks) {
this.remarks = remarks;
}
public String getQuyuma() {
return quyuma;
}
public void setQuyuma(String quyuma) {
this.quyuma = quyuma;
}
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("inspectionTaskId", getInspectionTaskId())
.append("inspectionPlanId", getInspectionPlanId())
.append("startTime", getStartTime())
.append("endTime", getEndTime())
.append("inspectionPersonnelId", getInspectionPersonnelId())
.append("inspectionRouteId", getInspectionRouteId())
.append("recordStatus", getRecordStatus())
.append("abnormalStatus", getAbnormalStatus())
.append("latAndLong", getLatAndLong())
.append("picture", getPicture())
.append("remarks", getRemarks())
.append("quyuma", getQuyuma())
.append("projectId", getProjectId())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@ -0,0 +1,227 @@
package com.fastbee.xunjian.domain;
import com.fastbee.common.annotation.Excel;
import com.fastbee.common.core.domain.BaseEntity;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.util.List;
/**
* 巡检路线对象 klxj_inspection_routes
*
* @author kenlixunjian
* @date 2023-08-04
*/
@Data
public class XjInspectionRoutes extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* ID
*/
private Long id;
private String abnormalType;
/**
* 名称
*/
@Excel(name = "名称")
private String name;
/**
* 点线类型(1点2线
*/
@Excel(name = "点线类型(1点2线")
private String dotLineType;
/**
* 工程对象类型
*/
@Excel(name = "工程对象类型")
private String engineeringObjectType;
/**
* 工程对象id
*/
@Excel(name = "工程对象Id")
private Long engineeringObjectId;
/**
* 注意事项ids
*/
private String inspectionNoteIds;
private List<XjInspectionNote> inspectionNote;
/**
* 项目id
*/
@Excel(name = "项目id")
private Long projectId;
/**
* 经纬度
*/
@Excel(name = "经纬度", prompt = "以,隔开")
private String latAndLong;
/**
* 位置
*/
@Excel(name = "位置")
private String position;
/**
* 范围单位m
*/
@Excel(name = "巡检距离")
private String range;
/**
* 编码
*/
@Excel(name = "绑定二维码编码")
private String qrCodeSn;
/**
* 范围线
*/
// @Excel(name = "范围线")
private String rangeArea;
/**
* 二维码
*/
// @Excel(name = "二维码")
private Long qrCodeId;
/**
* 行政区域码
*/
// @Excel(name = "行政区域码")
private String quyuma;
private String recordStatus = "0";
private Long recordId;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getDotLineType() {
return dotLineType;
}
public void setDotLineType(String dotLineType) {
this.dotLineType = dotLineType;
}
public String getEngineeringObjectType() {
return engineeringObjectType;
}
public void setEngineeringObjectType(String engineeringObjectType) {
this.engineeringObjectType = engineeringObjectType;
}
public Long getEngineeringObjectId() {
return engineeringObjectId;
}
public void setEngineeringObjectId(Long engineeringObjectId) {
this.engineeringObjectId = engineeringObjectId;
}
public Long getProjectId() {
return projectId;
}
public void setProjectId(Long projectId) {
this.projectId = projectId;
}
public String getLatAndLong() {
return latAndLong;
}
public void setLatAndLong(String latAndLong) {
this.latAndLong = latAndLong;
}
public String getPosition() {
return position;
}
public void setPosition(String position) {
this.position = position;
}
public String getRange() {
return range;
}
public void setRange(String range) {
this.range = range;
}
public String getRangeArea() {
return rangeArea;
}
public void setRangeArea(String rangeArea) {
this.rangeArea = rangeArea;
}
public Long getQrCodeId() {
return qrCodeId;
}
public void setQrCodeId(Long qrCodeId) {
this.qrCodeId = qrCodeId;
}
public String getQuyuma() {
return quyuma;
}
public void setQuyuma(String quyuma) {
this.quyuma = quyuma;
}
@Override
public String toString() {
return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("name", getName())
.append("dotLineType", getDotLineType())
.append("engineeringObjectType", getEngineeringObjectType())
.append("engineeringObjectId", getEngineeringObjectId())
.append("projectId", getProjectId())
.append("latAndLong", getLatAndLong())
.append("position", getPosition())
.append("range", getRange())
.append("rangeArea", getRangeArea())
.append("qrCodeId", getQrCodeId())
.append("quyuma", getQuyuma())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.append("updateBy", getUpdateBy())
.toString();
}
}

View File

@ -0,0 +1,62 @@
package com.fastbee.xunjian.mapper;
import com.fastbee.xunjian.domain.XjInspectionNote;
import java.util.List;
/**
* 巡检注意事项Mapper接口
*
* @author kenlixunjian
* @date 2023-08-23
*/
public interface XjInspectionNoteMapper {
/**
* 查询巡检注意事项
*
* @param id 巡检注意事项主键
* @return 巡检注意事项
*/
public XjInspectionNote selectXjInspectionNoteById(Long id);
/**
* 查询巡检注意事项列表
*
* @param XjInspectionNote 巡检注意事项
* @return 巡检注意事项集合
*/
public List<XjInspectionNote> selectXjInspectionNoteList(XjInspectionNote XjInspectionNote);
/**
* 新增巡检注意事项
*
* @param XjInspectionNote 巡检注意事项
* @return 结果
*/
public int insertXjInspectionNote(XjInspectionNote XjInspectionNote);
/**
* 修改巡检注意事项
*
* @param XjInspectionNote 巡检注意事项
* @return 结果
*/
public int updateXjInspectionNote(XjInspectionNote XjInspectionNote);
/**
* 删除巡检注意事项
*
* @param id 巡检注意事项主键
* @return 结果
*/
public int deleteXjInspectionNoteById(Long id);
/**
* 批量删除巡检注意事项
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteXjInspectionNoteByIds(Long[] ids);
}

View File

@ -0,0 +1,70 @@
package com.fastbee.xunjian.mapper;
import com.fastbee.xunjian.domain.XjInspectionRecords;
import org.apache.ibatis.annotations.Mapper;
import java.util.HashMap;
import java.util.List;
/**
* 记录Mapper接口
*
* @author kenlixunjian
* @date 2023-08-04
*/
@Mapper
public interface XjInspectionRecordsMapper {
/**
* 查询记录
*
* @param id 记录主键
* @return 记录
*/
public XjInspectionRecords selectXjInspectionRecordsById(Long id);
/**
* 查询记录列表
*
* @param XjInspectionRecords 记录
* @return 记录集合
*/
public List<XjInspectionRecords> selectXjInspectionRecordsList(XjInspectionRecords XjInspectionRecords);
// List<XjInspectionRecords> selectListByRoutesIds(KlxjInspectiontargetGroup klxjInspectiontargetGroup);
/**
* 新增记录
*
* @param XjInspectionRecords 记录
* @return 结果
*/
public int insertXjInspectionRecords(XjInspectionRecords XjInspectionRecords);
/**
* 修改记录
*
* @param XjInspectionRecords 记录
* @return 结果
*/
public int updateXjInspectionRecords(XjInspectionRecords XjInspectionRecords);
/**
* 删除记录
*
* @param id 记录主键
* @return 结果
*/
public int deleteXjInspectionRecordsById(Long id);
/**
* 批量删除记录
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteXjInspectionRecordsByIds(Long[] ids);
List<HashMap> getInspectionTasksYichangCountByParmas(HashMap<String, Object> params);
}

View File

@ -0,0 +1,68 @@
package com.fastbee.xunjian.mapper;
import com.fastbee.xunjian.domain.XjInspectionRoutes;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 巡检路线Mapper接口
*
* @author kenlixunjian
* @date 2023-08-04
*/
@Mapper
public interface XjInspectionRoutesMapper {
/**
* 查询巡检路线
*
* @param id 巡检路线主键
* @return 巡检路线
*/
public XjInspectionRoutes selectXjInspectionRoutesById(Long id);
/**
* 查询巡检路线列表
*
* @param XjInspectionRoutes 巡检路线
* @return 巡检路线集合
*/
public List<XjInspectionRoutes> selectXjInspectionRoutesList(XjInspectionRoutes XjInspectionRoutes);
/**
* 新增巡检路线
*
* @param XjInspectionRoutes 巡检路线
* @return 结果
*/
public int insertXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes);
/**
* 修改巡检路线
*
* @param XjInspectionRoutes 巡检路线
* @return 结果
*/
public int updateXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes);
/**
* 删除巡检路线
*
* @param id 巡检路线主键
* @return 结果
*/
public int deleteXjInspectionRoutesById(Long id);
/**
* 批量删除巡检路线
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deleteXjInspectionRoutesByIds(Long[] ids);
XjInspectionRoutes selectXjInspectionRoutesByName(@Param("name") String name);
XjInspectionRoutes selectXjInspectionRoutesByQrSn(String qrSn);
}

View File

@ -0,0 +1,62 @@
package com.fastbee.xunjian.service;
import com.fastbee.xunjian.domain.XjInspectionNote;
import java.util.List;
/**
* 巡检注意事项Service接口
*
* @author kenlixunjian
* @date 2023-08-23
*/
public interface IXjInspectionNoteService {
/**
* 查询巡检注意事项
*
* @param id 巡检注意事项主键
* @return 巡检注意事项
*/
public XjInspectionNote selectXjInspectionNoteById(Long id);
/**
* 查询巡检注意事项列表
*
* @param XjInspectionNote 巡检注意事项
* @return 巡检注意事项集合
*/
public List<XjInspectionNote> selectXjInspectionNoteList(XjInspectionNote XjInspectionNote);
/**
* 新增巡检注意事项
*
* @param XjInspectionNote 巡检注意事项
* @return 结果
*/
public int insertXjInspectionNote(XjInspectionNote XjInspectionNote);
/**
* 修改巡检注意事项
*
* @param XjInspectionNote 巡检注意事项
* @return 结果
*/
public int updateXjInspectionNote(XjInspectionNote XjInspectionNote);
/**
* 批量删除巡检注意事项
*
* @param ids 需要删除的巡检注意事项主键集合
* @return 结果
*/
public int deleteXjInspectionNoteByIds(Long[] ids);
/**
* 删除巡检注意事项信息
*
* @param id 巡检注意事项主键
* @return 结果
*/
public int deleteXjInspectionNoteById(Long id);
}

View File

@ -0,0 +1,66 @@
package com.fastbee.xunjian.service;
import com.fastbee.xunjian.domain.XjInspectionRecords;
import java.util.HashMap;
import java.util.List;
/**
* 记录Service接口
*
* @author kenlixunjian
* @date 2023-08-04
*/
public interface IXjInspectionRecordsService {
/**
* 查询记录
*
* @param id 记录主键
* @return 记录
*/
public XjInspectionRecords selectXjInspectionRecordsById(Long id);
/**
* 查询记录列表
*
* @param XjInspectionRecords 记录
* @return 记录集合
*/
public List<XjInspectionRecords> selectXjInspectionRecordsList(XjInspectionRecords XjInspectionRecords);
/**
* 新增记录
*
* @param XjInspectionRecords 记录
* @return 结果
*/
public int insertXjInspectionRecords(XjInspectionRecords XjInspectionRecords);
/**
* 修改记录
*
* @param XjInspectionRecords 记录
* @return 结果
*/
public int updateXjInspectionRecords(XjInspectionRecords XjInspectionRecords);
/**
* 批量删除记录
*
* @param ids 需要删除的记录主键集合
* @return 结果
*/
public int deleteXjInspectionRecordsByIds(Long[] ids);
/**
* 删除记录信息
*
* @param id 记录主键
* @return 结果
*/
public int deleteXjInspectionRecordsById(Long id);
List<HashMap> getInspectionTasksYichangCountByParmas(HashMap<String, Object> params);
}

View File

@ -0,0 +1,69 @@
package com.fastbee.xunjian.service;
import com.fastbee.xunjian.domain.XjInspectionRoutes;
import java.util.List;
/**
* 巡检路线Service接口
*
* @author kenlixunjian
* @date 2023-08-04
*/
public interface IXjInspectionRoutesService {
/**
* 查询巡检路线
*
* @param id 巡检路线主键
* @return 巡检路线
*/
public XjInspectionRoutes selectXjInspectionRoutesById(Long id);
/**
* 查询巡检路线列表
*
* @param XjInspectionRoutes 巡检路线
* @return 巡检路线集合
*/
public List<XjInspectionRoutes> selectXjInspectionRoutesList(XjInspectionRoutes XjInspectionRoutes);
/**
* 新增巡检路线
*
* @param XjInspectionRoutes 巡检路线
* @return 结果
*/
public int insertXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes);
/**
* 修改巡检路线
*
* @param XjInspectionRoutes 巡检路线
* @return 结果
*/
public int updateXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes);
/**
* 批量删除巡检路线
*
* @param ids 需要删除的巡检路线主键集合
* @return 结果
*/
public int deleteXjInspectionRoutesByIds(Long[] ids);
/**
* 删除巡检路线信息
*
* @param id 巡检路线主键
* @return 结果
*/
public int deleteXjInspectionRoutesById(Long id);
String importData(List<XjInspectionRoutes> userList, boolean updateSupport, String operName);
XjInspectionRoutes selectXjInspectionRoutesByQrSn(String qrSn);
}

View File

@ -0,0 +1,90 @@
package com.fastbee.xunjian.service.impl;
import com.fastbee.common.utils.DateUtils;
import com.fastbee.xunjian.domain.XjInspectionNote;
import com.fastbee.xunjian.service.IXjInspectionNoteService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.fastbee.xunjian.mapper.XjInspectionNoteMapper;
import java.util.List;
/**
* 巡检注意事项Service业务层处理
*
* @author kenlixunjian
* @date 2023-08-23
*/
@Service
public class XjInspectionNoteServiceImpl implements IXjInspectionNoteService {
@Autowired
private XjInspectionNoteMapper XjInspectionNoteMapper;
/**
* 查询巡检注意事项
*
* @param id 巡检注意事项主键
* @return 巡检注意事项
*/
@Override
public XjInspectionNote selectXjInspectionNoteById(Long id) {
return XjInspectionNoteMapper.selectXjInspectionNoteById(id);
}
/**
* 查询巡检注意事项列表
*
* @param XjInspectionNote 巡检注意事项
* @return 巡检注意事项
*/
@Override
public List<XjInspectionNote> selectXjInspectionNoteList(XjInspectionNote XjInspectionNote) {
return XjInspectionNoteMapper.selectXjInspectionNoteList(XjInspectionNote);
}
/**
* 新增巡检注意事项
*
* @param XjInspectionNote 巡检注意事项
* @return 结果
*/
@Override
public int insertXjInspectionNote(XjInspectionNote XjInspectionNote) {
XjInspectionNote.setCreateTime(DateUtils.getNowDate());
return XjInspectionNoteMapper.insertXjInspectionNote(XjInspectionNote);
}
/**
* 修改巡检注意事项
*
* @param XjInspectionNote 巡检注意事项
* @return 结果
*/
@Override
public int updateXjInspectionNote(XjInspectionNote XjInspectionNote) {
XjInspectionNote.setUpdateTime(DateUtils.getNowDate());
return XjInspectionNoteMapper.updateXjInspectionNote(XjInspectionNote);
}
/**
* 批量删除巡检注意事项
*
* @param ids 需要删除的巡检注意事项主键
* @return 结果
*/
@Override
public int deleteXjInspectionNoteByIds(Long[] ids) {
return XjInspectionNoteMapper.deleteXjInspectionNoteByIds(ids);
}
/**
* 删除巡检注意事项信息
*
* @param id 巡检注意事项主键
* @return 结果
*/
@Override
public int deleteXjInspectionNoteById(Long id) {
return XjInspectionNoteMapper.deleteXjInspectionNoteById(id);
}
}

View File

@ -0,0 +1,249 @@
package com.fastbee.xunjian.service.impl;
import cn.hutool.core.date.DateUtil;
import com.fastbee.common.utils.DateUtils;
import com.fastbee.common.utils.SecurityUtils;
import com.fastbee.xunjian.domain.XjInspectionRecords;
import com.fastbee.xunjian.mapper.XjInspectionRecordsMapper;
import com.fastbee.xunjian.service.IXjInspectionRecordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
/**
* 记录Service业务层处理
*
* @author kenlixunjian
* @date 2023-08-04
*/
@Service
public class XjInspectionRecordsServiceImpl implements IXjInspectionRecordsService {
@Autowired
private XjInspectionRecordsMapper XjInspectionRecordsMapper;
/**
* 查询记录
*
* @param id 记录主键
* @return 记录
*/
@Override
public XjInspectionRecords selectXjInspectionRecordsById(Long id) {
XjInspectionRecords XjInspectionRecords = XjInspectionRecordsMapper.selectXjInspectionRecordsById(id);
return XjInspectionRecords;
}
/**
* 查询记录列表
*
* @param XjInspectionRecords 记录
* @return 记录
*/
@Override
public List<XjInspectionRecords> selectXjInspectionRecordsList(XjInspectionRecords XjInspectionRecords) {
// try {
// if (SecurityUtils.getLoginUser().getUser().isZuzhang()) {
// KlxjInspectionPersonnels klxjInspectionPersonnels = SecurityUtils.getLoginUser().getPersonnels();
// if (klxjInspectionPersonnels != null) {
// XjInspectionRecords.setGroupId(klxjInspectionPersonnels.getGroupId());
// }
// } else if (SecurityUtils.getLoginUser().getUser().isXunjianyuan()) {
// KlxjInspectionPersonnels klxjInspectionPersonnels = SecurityUtils.getLoginUser().getPersonnels();
// if (klxjInspectionPersonnels != null) {
// XjInspectionRecords.setInspectionPersonnelId(klxjInspectionPersonnels.getId());
// }
// }
// } catch (Exception a) {
// }
List<XjInspectionRecords> XjInspectionRecords1 =
XjInspectionRecordsMapper.selectXjInspectionRecordsList(XjInspectionRecords);
// for (XjInspectionRecords inspectionRecords : XjInspectionRecords1) {
// List<KlxjInspectionEvents> list = inspectionEventsService.selectKlxjInspectionEventsList(new KlxjInspectionEvents() {{
// setInspectionRecordId(inspectionRecords.getId());
// }});
// if (list != null && list.size() > 0) {
// inspectionRecords.setAbnormalType(list.get(0).getAbnormalType());
// }
// }
return XjInspectionRecords1;
}
/**
* 新增记录
*
* @param XjInspectionRecords 记录
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertXjInspectionRecords(XjInspectionRecords XjInspectionRecords) {
XjInspectionRecords.setCreateTime(DateUtils.getNowDate());
// //执行人
// KlxjInspectionPersonnels klxjInspectionPersonnels =
// inspectionPersonnelsService.selectKlxjInspectionPersonnelsById(XjInspectionRecords.getInspectionPersonnelId());
// XjInspectionRecords.setGroupId(klxjInspectionPersonnels.getGroupId());
// if (XjInspectionRecords.getInspectionRouteId() != null) {
// KlxjInspectionTasks klxjInspectionTasks = new KlxjInspectionTasks();
// klxjInspectionTasks.setParams(new HashMap<String, Object>() {{
// put("taskTime", DateUtil.date().toString());
// }});
// klxjInspectionTasks.setInspectionPersonnelId(XjInspectionRecords.getInspectionPersonnelId());
// List<KlxjInspectionTasks> klxjInspectionTasks1 = inspectionTasksService.selectKlxjInspectionTasksList(klxjInspectionTasks);
// if (klxjInspectionTasks1 != null) {
// for (KlxjInspectionTasks inspectionTasks : klxjInspectionTasks1) {
// if (XjInspectionRecords.getInspectionTaskId() != null && XjInspectionRecords.getInspectionTaskId() != 0) {
// break;
// }
// for (KlxjInspectionRoutes klxjInspectionRoutes : inspectionTasks.getInspectionRouteList()) {
// if (klxjInspectionRoutes.getId().equals(XjInspectionRecords.getInspectionRouteId())) {
// XjInspectionRecords.setInspectionPlanId(inspectionTasks.getInspectionPlanId());
// XjInspectionRecords.setInspectionTaskId(inspectionTasks.getId());
// break;
// }
// }
// }
// }
// }
// if (XjInspectionRecords.getInspectionTaskId() != null && XjInspectionRecords.getInspectionTaskId() != 0) {
// KlxjInspectionTasks klxjInspectionTasks = inspectionTasksService.selectKlxjInspectionTasksById(XjInspectionRecords.getInspectionTaskId());
//
//
// if (klxjInspectionTasks != null && klxjInspectionTasks.getInspectionRouteIds() != null && !klxjInspectionTasks.getInspectionRouteIds().equals("")) {
//
// List<Long> collect = klxjInspectionTasks.getCompletedInspectionRouteList().stream().map(t -> t.getId()).collect(Collectors.toList());
// if (!collect.contains(XjInspectionRecords.getInspectionRouteId())) {
// String completedInspectionRouteIds = klxjInspectionTasks.getCompletedInspectionRouteIds() == null || klxjInspectionTasks.getCompletedInspectionRouteIds().equals("")
// ? "" + XjInspectionRecords.getInspectionRouteId()
// : klxjInspectionTasks.getCompletedInspectionRouteIds() + "," + XjInspectionRecords.getInspectionRouteId();
// klxjInspectionTasks.setCompletedInspectionRouteIds(completedInspectionRouteIds);
// if (!klxjInspectionTasks.getTaskStatus().equals("4")) {
// if (klxjInspectionTasks.getInspectionRouteIds().split(",").length == klxjInspectionTasks.getCompletedInspectionRouteIds().split(",").length) {
// klxjInspectionTasks.setTaskStatus("3");
// } else {
// klxjInspectionTasks.setTaskStatus("2");
// }
// }
// }
// inspectionTasksService.updateKlxjInspectionTasks(klxjInspectionTasks);
// }
// }
return XjInspectionRecordsMapper.insertXjInspectionRecords(XjInspectionRecords);
}
/**
* 修改记录
*
* @param XjInspectionRecords 记录
* @return 结果
*/
@Override
public int updateXjInspectionRecords(XjInspectionRecords XjInspectionRecords) {
XjInspectionRecords.setUpdateTime(DateUtils.getNowDate());
// KlxjInspectionPersonnels klxjInspectionPersonnels = inspectionPersonnelsService.selectKlxjInspectionPersonnelsById(XjInspectionRecords.getInspectionPersonnelId());
// XjInspectionRecords.setGroupId(klxjInspectionPersonnels.getGroupId());
// if (XjInspectionRecords.getInspectionRouteId() != null) {
// KlxjInspectionTasks klxjInspectionTasks = new KlxjInspectionTasks();
// klxjInspectionTasks.setParams(new HashMap<String, Object>() {{
// put("taskTime", DateUtil.date().toString());
// }});
// klxjInspectionTasks.setInspectionPersonnelId(XjInspectionRecords.getInspectionPersonnelId());
// List<KlxjInspectionTasks> klxjInspectionTasks1 = inspectionTasksService.selectKlxjInspectionTasksList(klxjInspectionTasks);
// if (klxjInspectionTasks1 != null) {
// for (KlxjInspectionTasks inspectionTasks : klxjInspectionTasks1) {
// if (XjInspectionRecords.getInspectionTaskId() != null && XjInspectionRecords.getInspectionTaskId() != 0) {
// break;
// }
// for (KlxjInspectionRoutes klxjInspectionRoutes : inspectionTasks.getInspectionRouteList()) {
// if (klxjInspectionRoutes.getId().equals(XjInspectionRecords.getInspectionRouteId())) {
// XjInspectionRecords.setInspectionPlanId(inspectionTasks.getInspectionPlanId());
// XjInspectionRecords.setInspectionTaskId(inspectionTasks.getId());
// break;
// }
// }
// }
// }
// }
// if (XjInspectionRecords.getInspectionTaskId() != null && XjInspectionRecords.getInspectionTaskId() != 0) {
// KlxjInspectionTasks klxjInspectionTasks = inspectionTasksService.selectKlxjInspectionTasksById(XjInspectionRecords.getInspectionTaskId());
//
//
// if (klxjInspectionTasks != null && klxjInspectionTasks.getInspectionRouteIds() != null && !klxjInspectionTasks.getInspectionRouteIds().equals("")) {
//
// List<Long> collect = klxjInspectionTasks.getCompletedInspectionRouteList().stream().map(t -> t.getId()).collect(Collectors.toList());
// if (!collect.contains(XjInspectionRecords.getInspectionRouteId())) {
// klxjInspectionTasks.setCompletedInspectionRouteIds(klxjInspectionTasks.getCompletedInspectionRouteIds() == null
// ? "" + XjInspectionRecords.getInspectionRouteId()
// : klxjInspectionTasks.getCompletedInspectionRouteIds() + "," + XjInspectionRecords.getInspectionRouteId());
// if (!klxjInspectionTasks.getTaskStatus().equals("4")) {
// if (klxjInspectionTasks.getCompletedInspectionRouteIds().split(",").length == klxjInspectionTasks.getCompletedInspectionRouteIds().split(",").length) {
// klxjInspectionTasks.setTaskStatus("3");
// } else {
// klxjInspectionTasks.setTaskStatus("2");
// }
// }
// }
// inspectionTasksService.updateKlxjInspectionTasks(klxjInspectionTasks);
// }
// }
return XjInspectionRecordsMapper.updateXjInspectionRecords(XjInspectionRecords);
}
/**
* 批量删除记录
*
* @param ids 需要删除的记录主键
* @return 结果
*/
@Override
public int deleteXjInspectionRecordsByIds(Long[] ids) {
return XjInspectionRecordsMapper.deleteXjInspectionRecordsByIds(ids);
}
/**
* 删除记录信息
*
* @param id 记录主键
* @return 结果
*/
@Override
public int deleteXjInspectionRecordsById(Long id) {
return XjInspectionRecordsMapper.deleteXjInspectionRecordsById(id);
}
@Override
public List<HashMap> getInspectionTasksYichangCountByParmas(HashMap<String, Object> params) {
return XjInspectionRecordsMapper.getInspectionTasksYichangCountByParmas(params);
}
// @Override
// public List<XjInspectionRecords> listByGroupName(KlxjInspectiontargetGroup
// klxjInspectiontargetGroup) {
// KlxjInspectiontargetGroup klxjInspectiontargetGroup1 =
// klxjInspectiontargetGroupMapper.selectByName(klxjInspectiontargetGroup.getName());
// if(null == klxjInspectiontargetGroup1){
// return new ArrayList<XjInspectionRecords>();
// }
// if(StringUtils.isEmpty(klxjInspectiontargetGroup1.getRoutesIds())){
// return new ArrayList<XjInspectionRecords>();
// }
// klxjInspectiontargetGroup.setRoutesIds(klxjInspectiontargetGroup1.getRoutesIds());
// if(StringUtils.isEmpty(klxjInspectiontargetGroup.getEndTime())){
// klxjInspectiontargetGroup.setEndTime(DateUtils.getTime());
// }
// if(StringUtils.isEmpty(klxjInspectiontargetGroup.getBeginTime())){
// Calendar calendar = Calendar.getInstance();
// int year = calendar.get(Calendar.YEAR);
//// calendar.add(Calendar.DATE,-30);
//// Date beginDate = calendar.getTime();
// klxjInspectiontargetGroup.setBeginTime(year + "-01-01 00:00:00");
// }
// PageUtils.startPage();
// List<XjInspectionRecords> XjInspectionRecords = XjInspectionRecordsMapper.selectListByRoutesIds(klxjInspectiontargetGroup);
// return XjInspectionRecords;
// }
}

View File

@ -0,0 +1,831 @@
package com.fastbee.xunjian.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.convert.Convert;
import cn.hutool.http.HttpUtil;
import cn.hutool.json.JSONArray;
import cn.hutool.json.JSONObject;
import com.fastbee.common.exception.ServiceException;
import com.fastbee.common.utils.DateUtils;
import com.fastbee.common.utils.StringUtils;
import com.fastbee.xunjian.domain.XjInspectionNote;
import com.fastbee.xunjian.domain.XjInspectionRoutes;
import com.fastbee.xunjian.mapper.XjInspectionRoutesMapper;
import com.fastbee.xunjian.service.IXjInspectionNoteService;
import com.fastbee.xunjian.service.IXjInspectionRoutesService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;
/**
* 巡检路线Service业务层处理
*
* @author kenlixunjian
* @date 2023-08-04
*/
@Service
public class XjInspectionRoutesServiceImpl implements IXjInspectionRoutesService {
@Autowired
private XjInspectionRoutesMapper XjInspectionRoutesMapper;
// @Autowired
// private KlxjQrCodeMapper klxjQrCodeMapper;
private static final Logger log = LoggerFactory.getLogger(XjInspectionRoutesServiceImpl.class);
@Autowired
private IXjInspectionNoteService iXjInspectionNoteService;
// @Autowired
// private ISysConfigService configService;
//
// @Autowired
// private ISysDictTypeService dictTypeService;
/**
* 查询巡检路线
*
* @param id 巡检路线主键
* @return 巡检路线
*/
@Override
public XjInspectionRoutes selectXjInspectionRoutesById(Long id) {
XjInspectionRoutes XjInspectionRoutes = XjInspectionRoutesMapper.selectXjInspectionRoutesById(id);
if (XjInspectionRoutes.getInspectionNoteIds() != null && !XjInspectionRoutes.getInspectionNoteIds().equals("")) {
XjInspectionNote xjInspectionNote = new XjInspectionNote();
// XjInspectionNote.setParams(new HashMap<String, Object>() {{
// put("ids", XjInspectionRoutes.getInspectionNoteIds());
// }});
List<XjInspectionNote> XjInspectionNotes =
iXjInspectionNoteService.selectXjInspectionNoteList(xjInspectionNote);
XjInspectionRoutes.setInspectionNote(XjInspectionNotes);
}
return XjInspectionRoutes;
}
/**
* 查询巡检路线列表
*
* @param XjInspectionRoutes 巡检路线
* @return 巡检路线
*/
@Override
public List<XjInspectionRoutes> selectXjInspectionRoutesList(XjInspectionRoutes XjInspectionRoutes) {
List<XjInspectionRoutes> XjInspectionRoutes1 = XjInspectionRoutesMapper.selectXjInspectionRoutesList(XjInspectionRoutes);
return XjInspectionRoutes1;
}
/**
* 新增巡检路线
*
* @param XjInspectionRoutes 巡检路线
* @return 结果
*/
@Override
public int insertXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes) {
XjInspectionRoutes.setCreateTime(DateUtils.getNowDate());
// if (XjInspectionRoutes.getQrCodeId() != null && XjInspectionRoutes.getQrCodeId() != 0) {
// KlxjQrCode klxjQrCode = klxjQrCodeMapper.selectKlxjQrCodeById(XjInspectionRoutes.getQrCodeId());
// if (selectXjInspectionRoutesByQrSn(klxjQrCode.getCodeSn()) != null) {
// throw new RuntimeException("二维码已被绑定");
// }
// XjInspectionRoutes.setQrCodeSn(klxjQrCode.getCodeSn());
// }
// if (XjInspectionRoutes.getEngineeringObjectType() != null && XjInspectionRoutes.getEngineeringObjectId() != null && XjInspectionRoutes.getEngineeringObjectId() != 0L) {
// KlxjEngineeringVo klxjEngineeringVo = new KlxjEngineeringVo();
// klxjEngineeringVo.setEngineeringObjectType(XjInspectionRoutes.getEngineeringObjectType());
// klxjEngineeringVo.setEngineeringObjectId(XjInspectionRoutes.getEngineeringObjectId().toString());
// Object engineeringData = getEngineeringData(klxjEngineeringVo);
// setRouteDataByEngineeringObjectId(XjInspectionRoutes, klxjEngineeringVo, engineeringData);
// }
return XjInspectionRoutesMapper.insertXjInspectionRoutes(XjInspectionRoutes);
}
// private void setRouteDataByEngineeringObjectId(XjInspectionRoutes XjInspectionRoutes, KlxjEngineeringVo klxjEngineeringVo, Object engineeringData) {
//// switch (EngineeringObjectType.getName(klxjEngineeringVo.getEngineeringObjectType())) {
//// case SHUIZHA_TYPE:
////
//// BaseSluiceInfo baseSluiceInfo = BeanUtil.toBean(engineeringData, BaseSluiceInfo.class);
//// if (baseSluiceInfo != null) {
//// XjInspectionRoutes.setName(baseSluiceInfo.getName());
//// XjInspectionRoutes.setQuyuma(baseSluiceInfo.getRegion());
//// XjInspectionRoutes.setPosition(baseSluiceInfo.getPosition());
//// ArrayList<Object> list = new ArrayList<>();
//// if (StringUtils.isNotEmpty(baseSluiceInfo.getLatitude()) || StringUtils.isNotEmpty(baseSluiceInfo.getLongitude())) {
//// list.add(baseSluiceInfo.getLongitude());
//// list.add(baseSluiceInfo.getLatitude());
//// }
//// String str = "{\"geometry\":{\"coordinates\":" + list.toString() + ",\"type\":\"Point\"},\"type\":\"Feature\",\"properties\":{\"altitude\":\"0\",\"textDisplayStyle\":\"0\",\"iconStyle\":\"33\"}}";
//// XjInspectionRoutes.setLatAndLong(str);
//// }
//// break;
//// case BENGFANG_TYPE:
//// BasePumpHouseInfo basePumpHouseInfo = BeanUtil.toBean(engineeringData, BasePumpHouseInfo.class);
//// if (basePumpHouseInfo != null) {
//// XjInspectionRoutes.setName(basePumpHouseInfo.getName());
//// XjInspectionRoutes.setQuyuma(basePumpHouseInfo.getRegion());
//// XjInspectionRoutes.setPosition(basePumpHouseInfo.getPosition());
//// ArrayList<Object> list = new ArrayList<>();
//// if (StringUtils.isNotEmpty(basePumpHouseInfo.getLatitude()) || StringUtils.isNotEmpty(basePumpHouseInfo.getLongitude())) {
//// list.add(basePumpHouseInfo.getLongitude());
//// list.add(basePumpHouseInfo.getLatitude());
//// }
//// String str = "{\"geometry\":{\"coordinates\":" + list.toString() + ",\"type\":\"Point\"},\"type\":\"Feature\",\"properties\":{\"altitude\":\"0\",\"textDisplayStyle\":\"0\",\"iconStyle\":\"33\"}}";
//// XjInspectionRoutes.setLatAndLong(str);
//// }
////
//// break;
//// case SHUIKU_TYPE:
//// BaseReservoirInfo baseReservoirInfo = BeanUtil.toBean(engineeringData, BaseReservoirInfo.class);
//// if (baseReservoirInfo != null) {
//// XjInspectionRoutes.setName(baseReservoirInfo.getName());
//// XjInspectionRoutes.setQuyuma(baseReservoirInfo.getRegion());
//// XjInspectionRoutes.setPosition(baseReservoirInfo.getPosition());
//// ArrayList<Object> list = new ArrayList<>();
//// if (StringUtils.isNotEmpty(baseReservoirInfo.getLatitude()) || StringUtils.isNotEmpty(baseReservoirInfo.getLongitude())) {
//// list.add(baseReservoirInfo.getLongitude());
//// list.add(baseReservoirInfo.getLatitude());
//// }
//// String str = "{\"geometry\":{\"coordinates\":" + list.toString() + ",\"type\":\"Point\"},\"type\":\"Feature\",\"properties\":{\"altitude\":\"0\",\"textDisplayStyle\":\"0\",\"iconStyle\":\"33\"}}";
//// XjInspectionRoutes.setLatAndLong(str);
//// }
//// break;
//// case DUCAO_TYPE:
//// KlAqueduct klAqueduct = BeanUtil.toBean(engineeringData, KlAqueduct.class);
//// if (klAqueduct != null) {
//// XjInspectionRoutes.setName(klAqueduct.getName());
//// XjInspectionRoutes.setPosition(klAqueduct.getPosition());
//// ArrayList<Object> list = new ArrayList<>();
//// if (StringUtils.isNotEmpty(klAqueduct.getLongLat())) {
//// list.addAll(Arrays.asList(klAqueduct.getLongLat().split(",")));
//// }
//// String str = "{\"geometry\":{\"coordinates\":" + list.toString() + ",\"type\":\"Point\"},\"type\":\"Feature\",\"properties\":{\"altitude\":\"0\",\"textDisplayStyle\":\"0\",\"iconStyle\":\"33\"}}";
//// XjInspectionRoutes.setLatAndLong(str);
//// }
//// break;
//// }
// }
// private void getRange(HhReachInfo hhReachInfo, Map mapparse, int type) {
//
// List<Map<String, Object>> features = (List<Map<String, Object>>) mapparse.get("features");
// ArrayList<Object> list1 = new ArrayList<>();
// if (features != null && features.size() > 0) {
// for (Map<String, Object> feature : features) {
// ArrayList<ArrayList> list = new ArrayList<>();
// ArrayList<ArrayList> listfan = new ArrayList<>();
// ArrayList<ArrayList> listdata = new ArrayList<>();
// Map<String, Object> geometry = (Map<String, Object>) feature.get("geometry");
// List<List<String>> coordinates = (List<List<String>>) geometry.get("coordinates");
// for (int i = 1; i < coordinates.size(); i++) {
// List<BigDecimal> objects1 = (List<BigDecimal>) Convert.toList(coordinates.get(i - 1));
// List<BigDecimal> objects2 = (List<BigDecimal>) Convert.toList(coordinates.get(i));
// BigDecimal long1 = objects1.get(0);
// BigDecimal lat1 = objects1.get(1);
// BigDecimal long2 = objects2.get(0);
// BigDecimal lat2 = objects2.get(1);
// if (long1 != null && lat1 != null && lat2 != null && long2 != null) {
// if (long2.compareTo(long1) == 0 || lat2.compareTo(lat1) == 0) {
// BigDecimal longdata = long2;
// BigDecimal latdata = lat2;
// BigDecimal longdatafan = long2;
// BigDecimal latdatafan = lat2;
//
// BigDecimal lomglat = new BigDecimal(0.00001);
// BigDecimal num = lomglat.multiply(new BigDecimal(type)).setScale(12, RoundingMode.FLOOR);
// if (i == 1) {
// BigDecimal longdata1 = long1;
// BigDecimal latdata1 = lat1;
// BigDecimal longdata1fan = long1;
// BigDecimal latdata1fan = lat1;
// if (long2.compareTo(long1) == 0) {
// if (lat2.compareTo(lat1) > 0) {
// longdata1 = long1.subtract(num);
// longdata1fan = long1.add(num);
// } else if (lat2.compareTo(lat1) < 0) {
// longdata1 = long1.add(num);
// longdata1fan = long1.subtract(num);
// }
// }
// if (lat2.compareTo(lat1) == 0) {
// if (long2.compareTo(long1) > 0) {
// latdata1 = lat1.add(num);
// latdata1fan = lat1.subtract(num);
// } else if (long2.compareTo(long1) < 0) {
// latdata1 = lat1.subtract(num);
// latdata1fan = lat1.add(num);
// }
// }
// ArrayList newlist = new ArrayList<>();
// ArrayList newlistfan = new ArrayList<>();
// newlistfan.add(longdata1fan);
// newlistfan.add(latdata1fan);
// listfan.add(newlist);
// newlist.add(longdata1);
// newlist.add(latdata1);
// list.add(newlist);
// }
//
// if (long2.compareTo(long1) == 0) {
// if (lat2.compareTo(lat1) > 0) {
// longdata = long2.subtract(num);
// longdatafan = long2.add(num);
// } else if (lat2.compareTo(lat1) < 0) {
// longdata = long2.add(num);
// longdatafan = long2.subtract(num);
// }
// }
// if (lat2.compareTo(lat1) == 0) {
// if (long2.compareTo(long1) > 0) {
// latdata = lat2.add(num);
// latdatafan = lat2.subtract(num);
// } else if (long2.compareTo(long1) < 0) {
// latdata = lat2.subtract(num);
// latdatafan = lat2.add(num);
// }
// }
// ArrayList newlist = new ArrayList<>();
// ArrayList newlistfan = new ArrayList<>();
// newlist.add(longdata);
// newlist.add(latdata);
// newlistfan.add(longdatafan);
// newlistfan.add(latdatafan);
// listfan.add(newlistfan);
// list.add(newlist);
//
// } else {
// isSanjiaoxing(type, list, listfan, i, long1, lat1, long2, lat2);
// }
// }
//
// }
// ArrayList<ArrayList> oneSemicircle = new ArrayList<>();
// ArrayList<ArrayList> twoSemicircle = new ArrayList<>();
// if (list.size() > 0 && listfan.size() > 0) {
// oneSemicircle = getSemicircle(list.get(0), coordinates.get(0), type, true);
// twoSemicircle = getSemicircle(list.get(list.size() - 1), coordinates.get(coordinates.size() - 1), type, false);
// }
// Collections.reverse(listfan);
// listdata.addAll(oneSemicircle);
// listdata.addAll(list);
// listdata.addAll(twoSemicircle);
// listdata.addAll(listfan);
// String str = "{\"type\": \"Feature\",\"properties\": {\"type\": \"polyline\",\"style\": {\"color\": \"#ff0000\", \"opacity\": 0.5,\"outline\": true,\"clampToGround\": true},\"group\": \"默认分组\"},\"geometry\": {\"type\": \"LineString\",\"coordinates\": " + listdata + "} }";
// Map<String, Object> newparse = (Map<String, Object>) JSON.parse(str);
//// features.add(newparse); //在原有内容上添加
//// mapparse.put("features",features);
// list1.add(newparse);
// }
// }
//
//
// mapparse.put("features", list1);
// if (type == 1000) {
// hhReachInfo.setRange1000(mapparse.toString());
// } else if (type == 5000) {
// hhReachInfo.setRange5000(mapparse.toString());
// } else if (type == 10000) {
// hhReachInfo.setRange10000(mapparse.toString());
// }
// }
private ArrayList<ArrayList> getSemicircle(ArrayList arrayList, List<String> strings, int type, boolean flag) {
BigDecimal long1 = (BigDecimal) arrayList.get(0);
List<BigDecimal> objects1 = (List<BigDecimal>) Convert.toList(strings);
BigDecimal long2 = objects1.get(0);
BigDecimal lat1 = (BigDecimal) arrayList.get(1);
BigDecimal lat2 = objects1.get(1);
BigDecimal angle = new BigDecimal(0);
BigDecimal lomglat = new BigDecimal(0.00001);
BigDecimal num = lomglat.multiply(new BigDecimal(type)).setScale(8, RoundingMode.FLOOR);
ArrayList<ArrayList> data = new ArrayList<>();
// 平行于经纬度
if (long2.compareTo(long1) == 0 || lat2.compareTo(lat1) == 0) {
if (long2.compareTo(long1) == 0) {
if (lat2.compareTo(lat1) > 0) {
angle = flag ? new BigDecimal(90) : new BigDecimal(270);
}
if (lat2.compareTo(lat1) < 0) {
angle = flag ? new BigDecimal(270) : new BigDecimal(90);
}
}
if (lat2.compareTo(lat1) == 0) {
if (long2.compareTo(long1) > 0) {
angle = flag ? new BigDecimal(360) : new BigDecimal(180);
}
if (long2.compareTo(long1) < 0) {
angle = flag ? new BigDecimal(180) : new BigDecimal(360);
}
}
} else {
// double degrees = Math.acos((a*a + b*b -c*c)/(2.0*a*b));
// // 用角度表示的角
// Math.toDegrees(degrees);
if (long2.compareTo(long1) > 0 && lat2.compareTo(lat1) > 0) {
BigDecimal c = lat2.subtract(lat1);
BigDecimal b = long2.subtract(long1);
BigDecimal a = num;
double degrees = getjiaodu(c, b, a);
if (flag) {
angle = new BigDecimal((180 + degrees - 180) < 0 ? 360.0 + (180 + degrees - 180) : 180 + degrees - 180).setScale(12, RoundingMode.FLOOR);
} else {
angle = new BigDecimal(180 + degrees).setScale(12, RoundingMode.FLOOR);
}
//右下画
} else if (long2.compareTo(long1) > 0 && lat2.compareTo(lat1) < 0) {
BigDecimal c = lat1.subtract(lat2);
BigDecimal b = num;
BigDecimal a = long2.subtract(long1);
double degrees = getjiaodu(c, b, a);
if (flag) {
angle = new BigDecimal((180 - degrees - 180) < 0 ? 360.0 + (180 - degrees - 180) : 180 - degrees - 180).setScale(12, RoundingMode.FLOOR);
} else {
angle = new BigDecimal(180 - degrees).setScale(12, RoundingMode.FLOOR);
}
//左上画
} else if (long2.compareTo(long1) < 0 && lat2.compareTo(lat1) > 0) {
BigDecimal c = lat2.subtract(lat1);
BigDecimal b = num;
BigDecimal a = long1.subtract(long2);
double degrees = getjiaodu(c, b, a);
if (flag) {
angle = new BigDecimal((360.0 - degrees - 180) < 0 ? 360.0 + (360.0 - degrees - 180) : 360.0 - degrees - 180).setScale(12, RoundingMode.FLOOR);
} else {
angle = new BigDecimal(360.0 - degrees).setScale(12, RoundingMode.FLOOR);
}
//坐下画
} else if (long2.compareTo(long1) < 0 && lat2.compareTo(lat1) < 0) {
BigDecimal c = lat1.subtract(lat2);
BigDecimal b = num;
BigDecimal a = long1.subtract(long2);
double degrees = getjiaodu(c, b, a);
if (flag) {
angle = new BigDecimal((degrees - 180) < 0 ? 360.0 + (degrees - 180) : degrees - 180).setScale(12, RoundingMode.FLOOR);
} else {
angle = new BigDecimal(degrees).setScale(12, RoundingMode.FLOOR);
}
}
}
// x1 = x0 + r * cos(a0 * π/180)
// y1 = y0 + r * sin(a0 * π/180)
if (angle.compareTo(new BigDecimal(0)) > 0) {
for (int i = 1; i < 17; i++) {
BigDecimal newangle = angle.subtract(new BigDecimal(i * 10));
newangle = newangle.compareTo(BigDecimal.ZERO) < 1 ? (new BigDecimal(360)).add(newangle) : newangle;
BigDecimal longdata = long2.add(num.multiply(BigDecimal.valueOf(Math.cos(Double.valueOf(String.valueOf(newangle)) * Math.PI / 180.0))).setScale(12, RoundingMode.FLOOR));
BigDecimal latdata = lat2.add(num.multiply(BigDecimal.valueOf(Math.sin(Double.valueOf(String.valueOf(newangle)) * Math.PI / 180.0))).setScale(12, RoundingMode.FLOOR));
ArrayList<BigDecimal> newlist = new ArrayList<>();
newlist.add(longdata);
newlist.add(latdata);
data.add(newlist);
}
}
return data;
}
private double getjiaodu(BigDecimal c, BigDecimal b, BigDecimal a) {
//a2+b2-c2* / 2*ab
BigDecimal aa = a.multiply(a);
BigDecimal bb = b.multiply(b);
BigDecimal cc = b.multiply(c);
BigDecimal abc = aa.add(bb).subtract(cc);
BigDecimal ab2 = (new BigDecimal(2.0)).multiply(a).multiply(b);
BigDecimal divide = abc.divide(ab2, 26, RoundingMode.FLOOR);
double degrees = Math.toDegrees(Math.acos(new Double(String.valueOf(divide))));
return degrees;
}
private void isSanjiaoxing(int type, ArrayList<ArrayList> list, ArrayList<ArrayList> listfan, int i, BigDecimal long1, BigDecimal lat1, BigDecimal long2, BigDecimal lat2) {
BigDecimal subtract = long2.subtract(long1);
BigDecimal subtract1 = lat2.subtract(lat1);
BigDecimal mu = new BigDecimal(100000000);
BigDecimal longabs = subtract.abs().multiply(mu).setScale(0, RoundingMode.FLOOR);
BigDecimal latabs = subtract1.abs().multiply(mu).setScale(0, RoundingMode.FLOOR);
//斜边的长度
BigDecimal sqrt = BigDecimal.valueOf(Math.sqrt(Math.pow(Double.valueOf(String.valueOf(longabs)), 2) + Math.pow(Double.valueOf(String.valueOf(latabs)), 2))).setScale(8, RoundingMode.FLOOR);
//米数
BigDecimal lomglat = new BigDecimal(0.00001);
//1千米的经纬度度数
BigDecimal multiply = lomglat.multiply(new BigDecimal(type)).setScale(8, RoundingMode.FLOOR);
//
BigDecimal bizhi = multiply.divide(sqrt, 12, RoundingMode.FLOOR);
BigDecimal longnum = bizhi.multiply(longabs).setScale(8, RoundingMode.FLOOR);
BigDecimal latnum = bizhi.multiply(latabs).setScale(8, RoundingMode.FLOOR);
// break;
ArrayList<Object> newlist = new ArrayList<>();
ArrayList<Object> newlistfan = new ArrayList<>();
//右上画
if (long2.compareTo(long1) > 0 && lat2.compareTo(lat1) > 0) {
if (i == 1) {
ArrayList<Object> listone = new ArrayList<>();
listone.add(long1.subtract(latnum));
listone.add(lat1.add(longnum));
list.add(listone);
ArrayList<Object> listonefan = new ArrayList<>();
listonefan.add(long1.add(latnum));
listonefan.add(lat1.subtract(longnum));
listfan.add(listonefan);
}
newlist.add(long2.subtract(latnum));
newlist.add(lat2.add(longnum));
newlistfan.add(long2.add(latnum));
newlistfan.add(lat2.subtract(longnum));
//右下画
} else if (long2.compareTo(long1) > 0 && lat2.compareTo(lat1) < 0) {
if (i == 1) {
ArrayList<Object> listone = new ArrayList<>();
listone.add(long1.add(latnum));
listone.add(lat1.add(longnum));
list.add(listone);
ArrayList<Object> listonefan = new ArrayList<>();
listonefan.add(long1.subtract(latnum));
listonefan.add(lat1.subtract(longnum));
listfan.add(listonefan);
}
newlist.add(long2.add(latnum));
newlist.add(lat2.add(longnum));
newlistfan.add(long2.subtract(latnum));
newlistfan.add(lat2.subtract(longnum));
//左上画
} else if (long2.compareTo(long1) < 0 && lat2.compareTo(lat1) > 0) {
if (i == 1) {
ArrayList<Object> listone = new ArrayList<>();
listone.add(long1.subtract(latnum));
listone.add(lat1.subtract(longnum));
list.add(listone);
ArrayList<Object> listonefan = new ArrayList<>();
listonefan.add(long1.add(latnum));
listonefan.add(lat1.add(longnum));
listfan.add(listonefan);
}
newlist.add(long2.subtract(latnum));
newlist.add(lat2.subtract(longnum));
newlistfan.add(long2.add(latnum));
newlistfan.add(lat2.add(longnum));
//坐下画
} else if (long2.compareTo(long1) < 0 && lat2.compareTo(lat1) < 0) {
if (i == 1) {
ArrayList<Object> listone = new ArrayList<>();
listone.add(long1.add(latnum));
listone.add(lat1.subtract(longnum));
list.add(listone);
ArrayList<Object> listonefan = new ArrayList<>();
listonefan.add(long1.subtract(latnum));
listonefan.add(lat1.add(longnum));
listfan.add(listonefan);
}
newlist.add(long2.add(latnum));
newlist.add(lat2.subtract(longnum));
newlistfan.add(long2.subtract(latnum));
newlistfan.add(lat2.add(longnum));
}
listfan.add(newlistfan);
list.add(newlist);
}
/**
* 修改巡检路线
*
* @param XjInspectionRoutes 巡检路线
* @return 结果
*/
@Override
public int updateXjInspectionRoutes(XjInspectionRoutes XjInspectionRoutes) {
XjInspectionRoutes.setUpdateTime(DateUtils.getNowDate());
// if (XjInspectionRoutes.getQrCodeId() != null && XjInspectionRoutes.getQrCodeId() != 0) {
// KlxjQrCode klxjQrCode = klxjQrCodeMapper.selectKlxjQrCodeById(XjInspectionRoutes.getQrCodeId());
// XjInspectionRoutes XjInspectionRoutes1 = selectXjInspectionRoutesByQrSn(klxjQrCode.getCodeSn());
// if (XjInspectionRoutes1 != null && !XjInspectionRoutes1.getId().equals(XjInspectionRoutes.getId())) {
// throw new RuntimeException("二维码已被绑定");
// }
// XjInspectionRoutes.setQrCodeSn(klxjQrCode.getCodeSn());
// }
// if (XjInspectionRoutes.getEngineeringObjectType() != null && XjInspectionRoutes.getEngineeringObjectId() != null && XjInspectionRoutes.getEngineeringObjectId() != 0L) {
// KlxjEngineeringVo klxjEngineeringVo = new KlxjEngineeringVo();
// klxjEngineeringVo.setEngineeringObjectType(XjInspectionRoutes.getEngineeringObjectType());
// klxjEngineeringVo.setEngineeringObjectId(XjInspectionRoutes.getEngineeringObjectId().toString());
// Object engineeringData = getEngineeringData(klxjEngineeringVo);
// setRouteDataByEngineeringObjectId(XjInspectionRoutes, klxjEngineeringVo, engineeringData);
// }
return XjInspectionRoutesMapper.updateXjInspectionRoutes(XjInspectionRoutes);
}
/**
* 批量删除巡检路线
*
* @param ids 需要删除的巡检路线主键
* @return 结果
*/
@Override
public int deleteXjInspectionRoutesByIds(Long[] ids) {
return XjInspectionRoutesMapper.deleteXjInspectionRoutesByIds(ids);
}
/**
* 删除巡检路线信息
*
* @param id 巡检路线主键
* @return 结果
*/
@Override
public int deleteXjInspectionRoutesById(Long id) {
return XjInspectionRoutesMapper.deleteXjInspectionRoutesById(id);
}
@Override
public String importData(List<XjInspectionRoutes> userList, boolean updateSupport, String operName) {
if (StringUtils.isNull(userList) || userList.size() == 0) {
throw new ServiceException("导入巡检对象数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
List<String> collect = userList.stream().filter(t -> t.getQrCodeSn() != null && !t.getQrCodeSn().equals("")).map(t -> t.getQrCodeSn()).collect(Collectors.toList());
Map<String, Long> idmap = new HashMap<>();
// if (collect != null && collect.size() > 0) {
// List<KlxjQrCode> qrCodeSn = klxjQrCodeMapper.selectKlxjQrCodeList(new KlxjQrCode() {{
// setParams(new HashMap<String, Object>() {{
// put("qrCodeSns", collect);
// }});
// }});
// idmap = qrCodeSn.stream().collect(Collectors.toMap(t -> t.getCodeSn(), t -> t.getId(), (key1, key2) -> key2));
// }
HashMap<String, List<Object>> EngineeringMap = new HashMap<>();
// KlxjEngineeringVo klxjEngineeringVo = new KlxjEngineeringVo();
// klxjEngineeringVo.setEngineeringObjectType(SHUIZHA_TYPE.getType());
// List<Object> shuizhaList = getEngineeringList(klxjEngineeringVo);
//// Map<String, BaseSluiceInfo> collect1 = ;
// EngineeringMap.put(SHUIZHA_TYPE.getType(), shuizhaList);
// klxjEngineeringVo.setEngineeringObjectType(BENGFANG_TYPE.getType());
// List<Object> bengfangList = getEngineeringList(klxjEngineeringVo);
//// Map<String, BaseSluiceInfo> collect1 = ;
// EngineeringMap.put(BENGFANG_TYPE.getType(), bengfangList);
// klxjEngineeringVo.setEngineeringObjectType(SHUIKU_TYPE.getType());
// List<Object> shuikuList = getEngineeringList(klxjEngineeringVo);
//// Map<String, BaseSluiceInfo> collect1 = ;
// EngineeringMap.put(SHUIKU_TYPE.getType(), shuikuList);
// klxjEngineeringVo.setEngineeringObjectType(DUCAO_TYPE.getType());
// List<Object> ducaoList = getEngineeringList(klxjEngineeringVo);
//// Map<String, BaseSluiceInfo> collect1 = ;
// EngineeringMap.put(DUCAO_TYPE.getType(), ducaoList);
//
//
// for (XjInspectionRoutes user : userList) {
// try {
// user.setQrCodeId(idmap.get(user.getQrCodeSn()));
// // 验证是否存在这个用户
// XjInspectionRoutes u = XjInspectionRoutesMapper.selectXjInspectionRoutesByName(user.getName());
// if (StringUtils.isNull(u)) {
// if (StringUtils.isNotEmpty(user.getEngineeringObjectType())) {
// if (EngineeringMap.get(user.getEngineeringObjectType()) != null) {
// if ((user.getEngineeringObjectId() == null && StringUtils.isNotEmpty(user.getName())) || user.getEngineeringObjectId() == 0L && StringUtils.isNotEmpty(user.getName())) {
// switch (EngineeringObjectType.getName(user.getEngineeringObjectType())) {
// case SHUIZHA_TYPE:
// List<Object> objects = EngineeringMap.get(user.getEngineeringObjectType());
// for (Object t : objects) {
// BaseSluiceInfo basePumpHouseInfo = BeanUtil.toBean(t, BaseSluiceInfo.class);
// if (basePumpHouseInfo.getName().contains(user.getName())) {
// user.setEngineeringObjectId(basePumpHouseInfo.getId());
// break;
// }
// }
// break;
// case BENGFANG_TYPE:
// List<Object> objects1 = EngineeringMap.get(user.getEngineeringObjectType());
// for (Object t : objects1) {
// BasePumpHouseInfo basePumpHouseInfo = BeanUtil.toBean(t, BasePumpHouseInfo.class);
// if (basePumpHouseInfo.getName().contains(user.getName())) {
// user.setEngineeringObjectId(basePumpHouseInfo.getId());
// }
// }
//
// break;
// case SHUIKU_TYPE:
// List<Object> objects2 = EngineeringMap.get(user.getEngineeringObjectType());
// for (Object t : objects2) {
// BaseReservoirInfo basePumpHouseInfo = BeanUtil.toBean(t, BaseReservoirInfo.class);
// if (basePumpHouseInfo.getName().contains(user.getName())) {
// user.setEngineeringObjectId(basePumpHouseInfo.getId());
// }
// }
//
// break;
// case DUCAO_TYPE:
// List<Object> objects3 = EngineeringMap.get(user.getEngineeringObjectType());
// for (Object t : objects3) {
// KlAqueduct basePumpHouseInfo = BeanUtil.toBean(t, KlAqueduct.class);
// if (basePumpHouseInfo.getName().contains(user.getName())) {
// user.setEngineeringObjectId(basePumpHouseInfo.getId());
// }
// }
// break;
// }
// }
// }
// }
// user.setCreateBy(operName);
// this.insertXjInspectionRoutes(user);
// successNum++;
// successMsg.append("<br/>" + successNum + "、水库 " + user.getName() + " 导入成功");
// } else if (updateSupport) {
//
// if (StringUtils.isNotEmpty(user.getEngineeringObjectType())) {
// if (EngineeringMap.get(user.getEngineeringObjectType()) != null) {
// if (u.getEngineeringObjectId() != null && !u.getEngineeringObjectId().equals(0L) && (user.getEngineeringObjectId() == null || user.getEngineeringObjectId() == 0L)) {
// user.setEngineeringObjectId(u.getEngineeringObjectId());
// }
// if ((user.getEngineeringObjectId() == null && StringUtils.isNotEmpty(user.getName())) || user.getEngineeringObjectId() == 0L && StringUtils.isNotEmpty(user.getName())) {
// switch (EngineeringObjectType.getName(user.getEngineeringObjectType())) {
// case SHUIZHA_TYPE:
// List<Object> objects = EngineeringMap.get(user.getEngineeringObjectType());
// for (Object t : objects) {
// BaseSluiceInfo basePumpHouseInfo = BeanUtil.toBean(t, BaseSluiceInfo.class);
// if (basePumpHouseInfo.getName().contains(user.getName())) {
// user.setEngineeringObjectId(basePumpHouseInfo.getId());
// break;
// }
// }
// break;
// case BENGFANG_TYPE:
// List<Object> objects1 = EngineeringMap.get(user.getEngineeringObjectType());
// for (Object t : objects1) {
// BasePumpHouseInfo basePumpHouseInfo = BeanUtil.toBean(t, BasePumpHouseInfo.class);
// if (basePumpHouseInfo.getName().contains(user.getName())) {
// user.setEngineeringObjectId(basePumpHouseInfo.getId());
// }
// }
//
// break;
// case SHUIKU_TYPE:
// List<Object> objects2 = EngineeringMap.get(user.getEngineeringObjectType());
// for (Object t : objects2) {
// BaseReservoirInfo basePumpHouseInfo = BeanUtil.toBean(t, BaseReservoirInfo.class);
// if (basePumpHouseInfo.getName().contains(user.getName())) {
// user.setEngineeringObjectId(basePumpHouseInfo.getId());
// }
// }
//
// break;
// case DUCAO_TYPE:
// List<Object> objects3 = EngineeringMap.get(user.getEngineeringObjectType());
// for (Object t : objects3) {
// KlAqueduct basePumpHouseInfo = BeanUtil.toBean(t, KlAqueduct.class);
// if (basePumpHouseInfo.getName().contains(user.getName())) {
// user.setEngineeringObjectId(basePumpHouseInfo.getId());
// }
// }
// break;
// }
// }
// }
// }
//
//
// user.setUpdateBy(operName);
// user.setId(u.getId());
// this.updateXjInspectionRoutes(user);
// successNum++;
// successMsg.append("<br/>" + successNum + "、水库 " + user.getName() + " 更新成功");
// } else {
// failureNum++;
// failureMsg.append("<br/>" + failureNum + "、水库 " + user.getName() + " 已存在");
// }
// } catch (Exception e) {
// failureNum++;
// String msg = "<br/>" + failureNum + "、水库 " + user.getName() + " 导入失败:";
// failureMsg.append(msg + e.getMessage());
// log.error(msg, e);
// }
// }
// if (failureNum > 0) {
// failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
// throw new ServiceException(failureMsg.toString());
// } else {
// successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
// }
return "";
}
@Override
public XjInspectionRoutes selectXjInspectionRoutesByQrSn(String qrSn) {
XjInspectionRoutes XjInspectionRoutes = XjInspectionRoutesMapper.selectXjInspectionRoutesByQrSn(qrSn);
if (XjInspectionRoutes != null && XjInspectionRoutes.getInspectionNoteIds() != null && !XjInspectionRoutes.getInspectionNoteIds().equals("")) {
XjInspectionNote XjInspectionNote = new XjInspectionNote();
XjInspectionNote.setParams(new HashMap<String, Object>() {{
put("ids", XjInspectionRoutes.getInspectionNoteIds());
}});
List<XjInspectionNote> XjInspectionNotes = iXjInspectionNoteService.selectXjInspectionNoteList(XjInspectionNote);
XjInspectionRoutes.setInspectionNote(XjInspectionNotes);
}
return XjInspectionRoutes;
}
// @Override
// public List<Object> getEngineeringList(KlxjEngineeringVo klxjEngineeringVo) {
//
// if (!StringUtils.isNotEmpty(klxjEngineeringVo.getEngineeringObjectType())) {
// throw new RuntimeException("工程类型不能为空");
// }
// JSONObject formMap = new JSONObject();
// String ip = configService.selectConfigByKey("kenli.ip");
// String username = configService.selectConfigByKey("kenli.user");
// String password = configService.selectConfigByKey("kenli.password");
// formMap.set("username", username);
// formMap.set("password", password);
// String body = HttpUtil.createPost(ip + "/login").body(formMap.toString()).execute().body();
// JSONObject jsonObject = new JSONObject(body);
// if (jsonObject.get("code").toString().equals("200")) {
// String token = jsonObject.get("token").toString();
// String Bearer = "Bearer " + token;
// List<SysDictData> engineering_object_type
// = dictTypeService.selectDictDataByType("engineering_object_type");
// if (engineering_object_type
// != null) {
// Map<String, SysDictData> collect = engineering_object_type.stream().collect(Collectors.toMap(t -> t.getDictValue(), t -> t));
// SysDictData sysDictData = collect.get(klxjEngineeringVo.getEngineeringObjectType());
// JSONObject map = new JSONObject();
// map.set("pageSize", 99999);
// map.set("pageNum", 1);
// HashMap<String, String> headers = new HashMap<>();
// headers.put("Authorization", Bearer);
// String body1 = HttpUtil.createGet(ip + sysDictData.getParam() + "list").headerMap(headers, false).form(map).execute().body();
// Object rows = new JSONObject(body1).get("rows");
// if (rows != null) {
// JSONArray dataList = new JSONArray(rows.toString());
// return dataList.toBean(List.class);
// }
//
// }
// }
// return new ArrayList<>();
// }
// @Override
// public Object getEngineeringData(KlxjEngineeringVo klxjEngineeringVo) {
// if (!StringUtils.isNotEmpty(klxjEngineeringVo.getEngineeringObjectType())) {
// throw new RuntimeException("工程类型不能为空");
// }
// JSONObject formMap = new JSONObject();
// String ip = configService.selectConfigByKey("kenli.ip");
// String username = configService.selectConfigByKey("kenli.user");
// String password = configService.selectConfigByKey("kenli.password");
// formMap.set("username", username);
// formMap.set("password", password);
// String body = HttpUtil.createPost(ip + "/login").body(formMap.toString()).execute().body();
// JSONObject jsonObject = new JSONObject(body);
// if (jsonObject.get("code").toString().equals("200")) {
// String token = jsonObject.get("token").toString();
// String Bearer = "Bearer " + token;
// List<SysDictData> engineering_object_type
// = dictTypeService.selectDictDataByType("engineering_object_type");
// if (engineering_object_type
// != null) {
// Map<String, SysDictData> collect = engineering_object_type.stream().collect(Collectors.toMap(t -> t.getDictValue(), t -> t));
// SysDictData sysDictData = collect.get(klxjEngineeringVo.getEngineeringObjectType());
// HashMap<String, String> headers = new HashMap<>();
// headers.put("Authorization", Bearer);
// String body1 = HttpUtil.createGet(ip + sysDictData.getParam() + klxjEngineeringVo.getEngineeringObjectId()).headerMap(headers, false).execute().body();
// JSONObject data = new JSONObject(body1).getJSONObject("data");
// if (data != null) {
// switch (EngineeringObjectType.getName(klxjEngineeringVo.getEngineeringObjectType())) {
// case SHUIZHA_TYPE:
// return data.toBean(BaseSluiceInfo.class);
// case BENGFANG_TYPE:
// return data.toBean(BasePumpHouseInfo.class);
// case SHUIKU_TYPE:
// return data.toBean(BaseReservoirInfo.class);
// case DUCAO_TYPE:
// return data.toBean(KlAqueduct.class);
// }
// }
// }
// }
// return null;
// }
}

View File

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fastbee.xunjian.mapper.XjInspectionNoteMapper">
<resultMap type="com.fastbee.xunjian.domain.XjInspectionNote" id="XjInspectionNoteResult">
<result property="id" column="id"/>
<result property="title" column="title"/>
<result property="content" column="content"/>
<result property="projectId" column="project_id"/>
<result property="engineeringObjectType" column="engineering_object_type"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
</resultMap>
<sql id="selectXjInspectionNoteVo">
select *
from xj_inspection_note
</sql>
<select id="selectXjInspectionNoteList" parameterType="com.fastbee.xunjian.domain.XjInspectionNote"
resultMap="XjInspectionNoteResult">
<include refid="selectXjInspectionNoteVo"/>
<where>
<if test="title != null and title != ''">and title = #{title}</if>
<if test="content != null and content != ''">and content = #{content}</if>
<if test="projectId != null ">and project_id = #{projectId}</if>
<if test="engineeringObjectType != null and engineeringObjectType != ''">and engineering_object_type =
#{engineeringObjectType}
</if>
<if test="params != null and params.ids!= null and params.ids!= ''">
AND id in
<foreach item="id" collection="params.ids.split(',')" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
order by id desc
</select>
<select id="selectXjInspectionNoteById" parameterType="Long" resultMap="XjInspectionNoteResult">
<include refid="selectXjInspectionNoteVo"/>
where id = #{id}
</select>
<insert id="insertXjInspectionNote" parameterType="com.fastbee.xunjian.domain.XjInspectionNote"
useGeneratedKeys="true" keyProperty="id">
insert into xj_inspection_note
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="title != null">title,</if>
<if test="content != null">content,</if>
<if test="projectId != null">project_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="engineeringObjectType != null">engineering_object_type,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="title != null">#{title},</if>
<if test="content != null">#{content},</if>
<if test="projectId != null">#{projectId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="engineeringObjectType != null">#{engineeringObjectType},</if>
</trim>
</insert>
<update id="updateXjInspectionNote" parameterType="com.fastbee.xunjian.domain.XjInspectionNote">
update xj_inspection_note
<trim prefix="SET" suffixOverrides=",">
<if test="title != null">title = #{title},</if>
<if test="content != null">content = #{content},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="engineeringObjectType != null">engineering_object_type = #{engineeringObjectType},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteXjInspectionNoteById" parameterType="Long">
delete
from xj_inspection_note
where id = #{id}
</delete>
<delete id="deleteXjInspectionNoteByIds" parameterType="String">
delete from xj_inspection_note where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,162 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fastbee.xunjian.mapper.XjInspectionRecordsMapper">
<resultMap type="com.fastbee.xunjian.domain.XjInspectionRecords" id="XjInspectionRecordsResult">
<result property="id" column="id" />
<result property="name" column="name" />
<result property="inspectionTaskId" column="inspection_task_id" />
<result property="inspectionPlanId" column="inspection_plan_id" />
<result property="startTime" column="start_time" />
<result property="endTime" column="end_time" />
<result property="inspectionPersonnelId" column="inspection_personnel_id" />
<result property="inspectionRouteId" column="inspection_route_id" />
<result property="recordStatus" column="record_status" />
<result property="abnormalStatus" column="abnormal_status"/>
<result property="latAndLong" column="lat_and_long"/>
<result property="picture" column="picture"/>
<result property="remarks" column="remarks"/>
<result property="quyuma" column="quyuma"/>
<result property="projectId" column="project_id"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="groupId" column="group_id"/>
</resultMap>
<sql id="selectXjInspectionRecordsVo">
select *
from xj_inspection_records
</sql>
<select id="selectXjInspectionRecordsList"
parameterType="com.fastbee.xunjian.domain.XjInspectionRecords"
resultMap="XjInspectionRecordsResult">
<include refid="selectXjInspectionRecordsVo"/>
<where>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="inspectionTaskId != null ">and inspection_task_id = #{inspectionTaskId}</if>
<if test="inspectionPlanId != null ">and inspection_plan_id = #{inspectionPlanId}</if>
<if test="startTime != null ">and start_time = #{startTime}</if>
<if test="endTime != null ">and end_time = #{endTime}</if>
<if test="inspectionPersonnelId != null ">and inspection_personnel_id = #{inspectionPersonnelId}</if>
<if test="inspectionRouteId != null ">and inspection_route_id = #{inspectionRouteId}</if>
<if test="recordStatus != null and recordStatus != ''">and record_status = #{recordStatus}</if>
<if test="abnormalStatus != null and abnormalStatus != ''">and abnormal_status = #{abnormalStatus}</if>
<if test="latAndLong != null and latAndLong != ''">and lat_and_long = #{latAndLong}</if>
<if test="picture != null and picture != ''">and picture = #{picture}</if>
<if test="remarks != null and remarks != ''">and remarks = #{remarks}</if>
<if test="quyuma != null and quyuma != ''">and quyuma = #{quyuma}</if>
<if test="projectId != null ">and project_id = #{projectId}</if>
<if test="groupId != null ">and group_id = #{groupId}</if>
<if test="params != null and params.tasksIds != null and params.tasksIds.size>0">
and inspection_task_id in
<foreach collection="params.tasksIds" item="id" open="(" separator="," close=")">
#{id}
</foreach>
</if>
<if test="params.beginTime != null and params.beginTime != ''"><!-- 开始时间检索 -->
AND date_format(end_time ,'%y%m%d') &gt;= date_format(#{params.beginTime},'%y%m%d')
</if>
<if test="params.endTime != null and params.endTime != ''"><!-- 结束时间检索 -->
AND date_format(end_time ,'%y%m%d') &lt;= date_format(#{params.endTime},'%y%m%d')
</if>
</where>
order by id desc
</select>
<select id="selectXjInspectionRecordsById" parameterType="Long" resultMap="XjInspectionRecordsResult">
<include refid="selectXjInspectionRecordsVo"/>
where id = #{id}
</select>
<insert id="insertXjInspectionRecords" parameterType="com.fastbee.xunjian.domain.XjInspectionRecords"
useGeneratedKeys="true" keyProperty="id">
insert into xj_inspection_records
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="inspectionTaskId != null">inspection_task_id,</if>
<if test="inspectionPlanId != null">inspection_plan_id,</if>
<if test="startTime != null">start_time,</if>
<if test="endTime != null">end_time,</if>
<if test="inspectionPersonnelId != null">inspection_personnel_id,</if>
<if test="inspectionRouteId != null">inspection_route_id,</if>
<if test="recordStatus != null">record_status,</if>
<if test="abnormalStatus != null">abnormal_status,</if>
<if test="latAndLong != null">lat_and_long,</if>
<if test="picture != null">picture,</if>
<if test="remarks != null">remarks,</if>
<if test="quyuma != null">quyuma,</if>
<if test="projectId != null">project_id,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="groupId != null">group_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="inspectionTaskId != null">#{inspectionTaskId},</if>
<if test="inspectionPlanId != null">#{inspectionPlanId},</if>
<if test="startTime != null">#{startTime},</if>
<if test="endTime != null">#{endTime},</if>
<if test="inspectionPersonnelId != null">#{inspectionPersonnelId},</if>
<if test="inspectionRouteId != null">#{inspectionRouteId},</if>
<if test="recordStatus != null">#{recordStatus},</if>
<if test="abnormalStatus != null">#{abnormalStatus},</if>
<if test="latAndLong != null">#{latAndLong},</if>
<if test="picture != null">#{picture},</if>
<if test="remarks != null">#{remarks},</if>
<if test="quyuma != null">#{quyuma},</if>
<if test="projectId != null">#{projectId},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="groupId != null">#{groupId},</if>
</trim>
</insert>
<update id="updateXjInspectionRecords" parameterType="com.fastbee.xunjian.domain.XjInspectionRecords">
update xj_inspection_records
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="inspectionTaskId != null">inspection_task_id = #{inspectionTaskId},</if>
<if test="inspectionPlanId != null">inspection_plan_id = #{inspectionPlanId},</if>
<if test="startTime != null">start_time = #{startTime},</if>
<if test="endTime != null">end_time = #{endTime},</if>
<if test="inspectionPersonnelId != null">inspection_personnel_id = #{inspectionPersonnelId},</if>
<if test="inspectionRouteId != null">inspection_route_id = #{inspectionRouteId},</if>
<if test="recordStatus != null">record_status = #{recordStatus},</if>
<if test="abnormalStatus != null">abnormal_status = #{abnormalStatus},</if>
<if test="latAndLong != null">lat_and_long = #{latAndLong},</if>
<if test="picture != null">picture = #{picture},</if>
<if test="remarks != null">remarks = #{remarks},</if>
<if test="quyuma != null">quyuma = #{quyuma},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="groupId != null">group_id = #{groupId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteXjInspectionRecordsById" parameterType="Long">
delete from xj_inspection_records where id = #{id}
</delete>
<delete id="deleteXjInspectionRecordsByIds" parameterType="String">
delete from xj_inspection_records where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>

View File

@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.fastbee.xunjian.mapper.XjInspectionRoutesMapper">
<resultMap type="com.fastbee.xunjian.domain.XjInspectionRoutes" id="XjInspectionRoutesResult">
<result property="id" column="id"/>
<result property="name" column="name"/>
<result property="dotLineType" column="dot_line_type"/>
<result property="engineeringObjectType" column="engineering_object_type"/>
<result property="engineeringObjectId" column="engineering_object_id"/>
<result property="projectId" column="project_id"/>
<result property="latAndLong" column="lat_and_long"/>
<result property="position" column="position"/>
<result property="range" column="range"/>
<result property="rangeArea" column="range_area"/>
<result property="qrCodeId" column="qr_code_id"/>
<result property="inspectionNoteIds" column="inspection_note_ids"/>
<result property="quyuma" column="quyuma"/>
<result property="createBy" column="create_by"/>
<result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
<result property="qrCodeSn" column="qr_code_sn"/>
</resultMap>
<sql id="selectXjInspectionRoutesVo">
select *
from xj_inspection_routes
</sql>
<select id="selectXjInspectionRoutesList"
parameterType="com.fastbee.xunjian.domain.XjInspectionRoutes"
resultMap="XjInspectionRoutesResult">
<include refid="selectXjInspectionRoutesVo"/>
<where>
<if test="name != null and name != ''">and name like concat('%', #{name}, '%')</if>
<if test="dotLineType != null and dotLineType != ''">and dot_line_type = #{dotLineType}</if>
<if test="engineeringObjectType != null and engineeringObjectType != ''">and engineering_object_type =
#{engineeringObjectType}
</if>
<if test="engineeringObjectId != null ">and engineering_object_id = #{engineeringObjectId}</if>
<if test="projectId != null ">and project_id = #{projectId}</if>
<if test="latAndLong != null and latAndLong != ''">and lat_and_long = #{latAndLong}</if>
<if test="position != null and position != ''">and position = #{position}</if>
<if test="range != null and range != ''">and range = #{range}</if>
<if test="rangeArea != null and rangeArea != ''">and range_area = #{rangeArea}</if>
<if test="qrCodeId != null ">and qr_code_id = #{qrCodeId}</if>
<if test="quyuma != null and quyuma != ''">and quyuma = #{quyuma}</if>
<if test="qrCodeSn != null and qrCodeSn != ''">and qr_code_sn = #{qrCodeSn}</if>
<if test="params != null and params.ids!= null and params.ids!= ''">
AND id in
<foreach item="id" collection="params.ids.split(',')" open="(" separator="," close=")">
#{id}
</foreach>
</if>
</where>
order by id desc
</select>
<select id="selectXjInspectionRoutesById" parameterType="Long" resultMap="XjInspectionRoutesResult">
<include refid="selectXjInspectionRoutesVo"/>
where id = #{id}
</select>
<select id="selectXjInspectionRoutesByName"
resultType="string" resultMap="XjInspectionRoutesResult">
<include refid="selectXjInspectionRoutesVo"/>
where name = #{name} limit 1
</select>
<select id="selectXjInspectionRoutesByQrSn"
parameterType="string" resultMap="XjInspectionRoutesResult">
<include refid="selectXjInspectionRoutesVo"/>
WHERE kqc.code_sn = #{qrSn} limit 1
</select>
<insert id="insertXjInspectionRoutes" parameterType="com.fastbee.xunjian.domain.XjInspectionRoutes"
useGeneratedKeys="true" keyProperty="id">
insert into xj_inspection_routes
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="qrCodeSn != null">qr_code_sn,</if>
<if test="dotLineType != null">dot_line_type,</if>
<if test="engineeringObjectType != null">engineering_object_type,</if>
<if test="engineeringObjectId != null">engineering_object_id,</if>
<if test="projectId != null">project_id,</if>
<if test="latAndLong != null">lat_and_long,</if>
<if test="position != null">position,</if>
<if test="range != null">`range`,</if>
<if test="rangeArea != null">range_area,</if>
<if test="qrCodeId != null">qr_code_id,</if>
<if test="quyuma != null">quyuma,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="inspectionNoteIds != null">inspection_note_ids,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="qrCodeSn != null">#{qrCodeSn},</if>
<if test="dotLineType != null">#{dotLineType},</if>
<if test="engineeringObjectType != null">#{engineeringObjectType},</if>
<if test="engineeringObjectId != null">#{engineeringObjectId},</if>
<if test="projectId != null">#{projectId},</if>
<if test="latAndLong != null">#{latAndLong},</if>
<if test="position != null">#{position},</if>
<if test="range != null">#{range},</if>
<if test="rangeArea != null">#{rangeArea},</if>
<if test="qrCodeId != null">#{qrCodeId},</if>
<if test="quyuma != null">#{quyuma},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="inspectionNoteIds != null">#{inspectionNoteIds},</if>
</trim>
</insert>
<update id="updateXjInspectionRoutes" parameterType="com.fastbee.xunjian.domain.XjInspectionRoutes">
update xj_inspection_routes
<trim prefix="SET" suffixOverrides=",">
<if test="inspectionNoteIds != null">inspection_note_ids = #{inspectionNoteIds},</if>
<if test="name != null">name = #{name},</if>
<if test="dotLineType != null">dot_line_type = #{dotLineType},</if>
<if test="engineeringObjectType != null">engineering_object_type = #{engineeringObjectType},</if>
<if test="engineeringObjectId != null">engineering_object_id = #{engineeringObjectId},</if>
<if test="projectId != null">project_id = #{projectId},</if>
<if test="latAndLong != null">lat_and_long = #{latAndLong},</if>
<if test="position != null">position = #{position},</if>
<if test="range != null">`range` = #{range},</if>
<if test="rangeArea != null">range_area = #{rangeArea},</if>
<if test="qrCodeId != null">qr_code_id = #{qrCodeId},</if>
<if test="quyuma != null">quyuma = #{quyuma},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="qrCodeSn != null">qr_code_sn = #{qrCodeSn},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteXjInspectionRoutesById" parameterType="Long">
delete
from xj_inspection_routes
where id = #{id}
</delete>
<delete id="deleteXjInspectionRoutesByIds" parameterType="String">
delete from xj_inspection_routes where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>