Commit 81bfc3cd authored by chenhao's avatar chenhao

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

parents e9901c1b 75f45f58
......@@ -14,6 +14,7 @@ import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import java.util.Date;
import java.util.Map;
/**
* @author Dell
......@@ -39,10 +40,10 @@ public class MetaHandler implements MetaObjectHandler {
*/
@Override
public void insertFill(MetaObject metaObject) {
autoFillUser(metaObject);
autoFillUser(metaObject, metaObject.getOriginalObject());
}
private void autoFillUser(MetaObject metaObject) {
private void autoFillUser(MetaObject metaObject, Object entity) {
//获取用户信息 以及当前用户登录公司部门,角色
ReginParams reginParams =
JSONObject.parseObject(null != redisUtils.get(RedisKey.buildKey(getToken())) ?
......@@ -54,12 +55,12 @@ public class MetaHandler implements MetaObjectHandler {
if(ObjectUtils.isEmpty(reginParams) || ObjectUtils.isEmpty(agencyUserModel)){
return;
}
Object entity = metaObject.getOriginalObject();
}
// Object entity = metaObject.getOriginalObject();
if (isExistField("recUserId", entity)) {
this.setFieldValByName("recUserId", agencyUserModel.getUserId(), metaObject);
}
if (isExistField("recUserName", entity)) {
this.setFieldValByName("recUserName", agencyUserModel.getUserName(), metaObject);
}
......@@ -71,8 +72,8 @@ public class MetaHandler implements MetaObjectHandler {
Date currentDate = new Date();
this.setFieldValByName("recDate", currentDate, metaObject);
}
// if (isExistField("companyCode", entity)) {
// this.setFieldValByName("companyCode", reginParams.getDepartment().getOrgCode(), metaObject);
// }
......@@ -102,6 +103,8 @@ public class MetaHandler implements MetaObjectHandler {
*/
@Override
public void updateFill(MetaObject metaObject) {
Object updateEntity = ((Map)metaObject.getOriginalObject()).get("et");
autoFillUser(metaObject, updateEntity);
Date currentDate = new Date();
this.setFieldValByName("updateTime", currentDate, metaObject);
}
......
......@@ -35,7 +35,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
<#else>
@Controller
</#if>
@RequestMapping(value = "<#if package.ModuleName??>/${package.ModuleName}</#if>/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
@RequestMapping(value = "/<#if controllerMappingHyphenStyle??>${controllerMappingHyphen}<#else>${table.entityPath}</#if>")
<#if kotlin>
class ${table.controllerName}<#if superControllerClass??> : ${superControllerClass}()</#if>
<#else>
......
......@@ -306,10 +306,16 @@ public class WaterResourceDto extends BaseDto {
@ApiModelProperty(value = "物联参数")
private WaterResourceIotDto waterResourceIotDto;
@ApiModelProperty("设施定义id")
private Long equipId;
@ApiModelProperty("设施定义名称")
@ExcelProperty(value = "设施定义名称", index = 44)
private String equipName;
@ApiModelProperty("设施分类id")
private Long equipCategoryId;
@ApiModelProperty("设施分类名称")
@ExcelProperty(value = "设施分类名称", index = 45)
private String equipCategoryName;
......
......@@ -51,4 +51,5 @@ public interface ILinkageUnitService {
public List<Menu> getEmergencyLinkageUnitCodeGroupBy(String type, String rootName) ;
List<LinkageUnitDto> exportToExcel();
List<LinkageUnitDto> queryForLinkageUnitList(Boolean isDelete);
}
......@@ -110,8 +110,8 @@
when ISNULL(belong_fighting_system) = 0 and LENGTH(trim(belong_fighting_system)) > 0
then belong_fighting_system
else '其他' end) belong_fighting_system,
resource_type,
resource_type_name
equip_id as resource_type,
equip_name as resource_type_name
from cb_water_resource
where is_delete = #{isDelete}
</select>
......
package com.yeejoin.amos.boot.module.jcs.api.dto;
import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.metadata.BaseRowModel;
import com.yeejoin.amos.boot.module.common.api.excel.ExplicitConstraint;
import com.yeejoin.amos.boot.module.common.api.excel.RoleNameExplicitConstraint;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
@Data
public class AircraftDtos extends BaseRowModel {
@ExcelIgnore
private static final long serialVersionUID = 1L;
@ExcelProperty(value = "飞机型号", index = 0)
@ApiModelProperty(value = "飞机型号")
private String aircraftModel;
@ExcelProperty(value = "中文全称", index = 1)
@ApiModelProperty(value = "中文全称")
private String fullName;
@ExcelProperty(value = "飞机长度", index = 2)
@ApiModelProperty(value = "飞机长度")
private Double aircraftLength;
@ExcelProperty(value = "机舱长度", index = 3)
@ApiModelProperty(value = "机舱长度")
private Double cabinLength;
@ExcelProperty(value = "尾翼高度", index = 4)
@ApiModelProperty(value = "尾翼高度")
private Double tailHeight;
@ExcelProperty(value = "翼展", index = 5)
@ApiModelProperty(value = "翼展")
private Double wingspan;
@ExcelProperty(value = "机身直径", index = 6)
@ApiModelProperty(value = "机身直径")
private Double fuselageDiameter;
@ExcelProperty(value = "翼展面积", index = 7)
@ApiModelProperty(value = "翼展面积")
private Double wingspanArea;
@ExplicitConstraint(type = "FDJLX", indexNum = 8, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "发动机类型", index = 8)
@ApiModelProperty(value = "发动机类型")
private String engineType;
@ExcelIgnore
@ApiModelProperty(value = "发动机类型code")
private String engineTypeCode;
@ExcelProperty(value = "发动机数量", index = 9)
@ApiModelProperty(value = "发动机数量")
private Integer enginesmNum;
@ExcelProperty(value = "发动机型号", index = 10)
@ApiModelProperty(value = "发动机型号")
private String engineModel;
@ExplicitConstraint(type = "RYLX", indexNum = 11, sourceClass = RoleNameExplicitConstraint.class) //动态下拉内容
@ExcelProperty(value = "燃油类型", index = 11)
@ApiModelProperty(value = "燃油类型")
private String fuelType;
@ExcelIgnore
@ApiModelProperty(value = "燃油类型code")
private String fuelTypeCode;
@ExcelProperty(value = "最大载油量", index = 12)
@ApiModelProperty(value = "最大载油量")
private Double oilLoadMax;
@ExcelProperty(value = "标准燃油", index = 13)
@ApiModelProperty(value = "标准燃油")
private Double standardFuel;
@ExcelProperty(value = "空重", index = 14)
@ApiModelProperty(value = "空重")
private Double emptyWeight;
@ExcelProperty(value = "飞机主要构造材料", index = 15)
@ApiModelProperty(value = "飞机主要构造材料")
private String structuralMaterial;
@ExcelProperty(value = "氧气瓶数量", index = 16)
@ApiModelProperty(value = "氧气瓶数量")
private Integer oxygenCylinderNum;
@ExcelProperty(value = "氧气瓶位置描述", index = 17)
@ApiModelProperty(value = "氧气瓶位置描述")
private String oxygenCylinderLocation;
@ExcelProperty(value = "标准坐席数", index = 18)
@ApiModelProperty(value = "标准坐席数")
private Integer seatNum;
@ExcelProperty(value = "商载(吨)", index = 19)
@ApiModelProperty(value = "商载(吨)")
private Double commercialLoad;
@ExcelProperty(value = "货仓容积(立方米)", index = 20)
@ApiModelProperty(value = "货仓容积(立方米)")
private Double warehouseVolume;
@ExcelProperty(value = "最大起飞总重(吨)", index = 21)
@ApiModelProperty(value = "最大起飞总重(吨)")
private Double takeoffWeightNum;
@ExcelProperty(value = "最大巡航速度(马赫)", index = 22)
@ApiModelProperty(value = "最大巡航速度(马赫)")
private Double cruiseSpeedNum;
@ExcelProperty(value = "航程", index = 23)
@ApiModelProperty(value = "航程")
private Double voyage;
@ExcelProperty(value = "主要设施", index = 24)
@ApiModelProperty(value = "主要设施")
private String facilitie;
@ExcelProperty(value = "主要燃烧物质", index = 25)
@ApiModelProperty(value = "主要燃烧物质")
private String combustionMaterial;
@ExcelProperty(value = "疏散出口及安全通道", index = 26)
@ApiModelProperty(value = "疏散出口及安全通道")
private String exitPassage;
@ExcelProperty(value = "备注", index = 27)
@ApiModelProperty(value = "备注")
private String remark;
@ExcelProperty(value = "外观图", index = 28)
@ApiModelProperty(value = "外观图")
private String appearanceImages;
@ExcelProperty(value = "平面图", index = 29)
@ApiModelProperty(value = "平面图")
private String planeImages;
@ExcelProperty(value = "救援图", index = 30)
@ApiModelProperty(value = "救援图")
private String rescueImages;
@ExcelProperty(value = "方位图", index = 31)
@ApiModelProperty(value = "方位图")
private String positionImages;
@ExcelProperty(value = "三维模型", index = 32)
@ApiModelProperty(value = "三维模型")
private String models;
@ApiModelProperty(value = "现场图片")
private List<String> scenePicture;
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
*
*
* @author system_generator
* @date 2021-08-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="AlertLocationLogDto", description="")
public class AlertLocationLogDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "警情id")
private Long alertId;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
}
package com.yeejoin.amos.boot.module.jcs.api.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
/**
* 集结点
*
* @author system_generator
* @date 2021-08-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@ApiModel(value="RallyPointDto", description="集结点")
public class RallyPointDto extends BaseDto {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "名称")
private String name;
@ApiModelProperty(value = "地址")
private String address;
@ApiModelProperty(value = "警情id")
private Long alertId;
@ApiModelProperty(value = "经度")
private String longitude;
@ApiModelProperty(value = "纬度")
private String latitude;
}
package com.yeejoin.amos.boot.module.jcs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
*
*
* @author system_generator
* @date 2021-08-26
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_alert_location_log")
public class AlertLocationLog extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 警情id
*/
@TableField("alert_id")
private Long alertId;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
}
package com.yeejoin.amos.boot.module.jcs.api.entity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import java.util.Date;
/**
* 集结点
*
* @author system_generator
* @date 2021-08-25
*/
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("jc_rally_point")
public class RallyPoint extends BaseEntity {
private static final long serialVersionUID = 1L;
/**
* 名称
*/
@TableField("name")
private String name;
/**
* 地址
*/
@TableField("address")
private String address;
/**
* 警情id
*/
@TableField("alert_id")
private Long alertId;
/**
* 经度
*/
@TableField("longitude")
private String longitude;
/**
* 纬度
*/
@TableField("latitude")
private String latitude;
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* Mapper 接口
*
* @author system_generator
* @date 2021-08-26
*/
public interface AlertLocationLogMapper extends BaseMapper<AlertLocationLog> {
}
package com.yeejoin.amos.boot.module.jcs.api.mapper;
import com.yeejoin.amos.boot.module.jcs.api.entity.RallyPoint;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 集结点 Mapper 接口
*
* @author system_generator
* @date 2021-08-25
*/
public interface RallyPointMapper extends BaseMapper<RallyPoint> {
}
package com.yeejoin.amos.boot.module.jcs.api.service;
/**
* 接口类
*
* @author system_generator
* @date 2021-08-26
*/
public interface IAlertLocationLogService {
}
package com.yeejoin.amos.boot.module.jcs.api.service;
/**
* 集结点接口类
*
* @author system_generator
* @date 2021-08-25
*/
public interface IRallyPointService {
}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.AlertLocationLogMapper">
</mapper>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.yeejoin.amos.boot.module.jcs.api.mapper.RallyPointMapper">
</mapper>
......@@ -6,6 +6,7 @@ import java.util.List;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import io.swagger.annotations.ApiImplicitParam;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -178,8 +179,8 @@ public class FailureDetailsController extends BaseController {
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "流程信息", notes = "流程信息")
@GetMapping(value = "/processHistory/{sequenceNbr}")
public ResponseModel<Object> selectHistoryt(@PathVariable Long sequenceNbr) {
@GetMapping(value = "/processHistory")
public ResponseModel<Object> selectHistoryt(@RequestParam Long sequenceNbr) {
return ResponseHelper.buildResponse(failureDetailsServiceImpl.getCurrentProcessHistoryTask(sequenceNbr));
}
......
package com.yeejoin.amos.boot.module.common.biz.controller;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
......@@ -13,20 +16,14 @@ import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
import com.yeejoin.amos.boot.biz.common.utils.TreeParser;
import com.yeejoin.amos.boot.module.common.api.dto.FireExpertsDto;
import com.yeejoin.amos.boot.module.common.api.entity.FireExperts;
import com.yeejoin.amos.boot.module.common.api.excel.ExcelUtil;
import com.yeejoin.amos.boot.module.common.biz.service.impl.FireExpertsServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
......@@ -59,8 +56,7 @@ public class FireExpertsController extends BaseController {
@Autowired
DataDictionaryServiceImpl dataDictionaryService;
@Autowired
DataDictionaryMapper dataDictionaryMapper;
/**
* 新增
......@@ -188,4 +184,40 @@ public class FireExpertsController extends BaseController {
// 创建挂在主节点
return ResponseHelper.buildResponse(menuList);
}
/**
*
* 导入航空器信息
*
* **/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/ImportData")
@ApiOperation(httpMethod = "POST", value = "导入消防专家", notes = "导入消防专家")
public Boolean ImportData (@RequestPart MultipartFile multipartFile) {
List<FireExperts> aircraftList = new ArrayList<>();
try {
EasyExcel.read(multipartFile.getInputStream(), FireExpertsDto.class, new AnalysisEventListener<FireExpertsDto>() {
// 每读取一行就调用该方法
@Override
public void invoke(FireExpertsDto data, AnalysisContext context) {
FireExperts fireExperts = new FireExperts();
BeanUtils.copyProperties(data,fireExperts);
aircraftList.add(fireExperts);
}
// 全部读取完成就调用该方法
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
System.out.println("读取完成");
}
}).sheet().doRead();
fireExpertsServiceImpl.saveBatch(aircraftList);
return true;
} catch (Exception e) {
return false;
}
}
}
......@@ -268,6 +268,14 @@ public class OrgUsrController extends BaseController {
return ResponseHelper.buildResponse(iOrgUsrService.returnCompanyPerson(ids));
}
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/company/person/{amosUserId}", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "根据amosUserId获取单位ID", notes = "根据amosUserId获取单位ID")
public ResponseModel<String> selectPersonId(@PathVariable String amosUserId) throws Exception {
return ResponseHelper.buildResponse(iOrgUsrService.getParentId(amosUserId));
}
/**
* 根据id获取单位人员列表
*
......
......@@ -348,12 +348,12 @@ public class WaterResourceController extends BaseController {
@RequestParam(value = "size") int size, String name,
@RequestParam(value = "belongBuildingId", required = false) ArrayList<Long> belongBuildingId,
Long belongFightingSystemId, Long sequenceNbr,
String resourceType) {
String classifyId) {
Page<WaterResourceDto> page = new Page<>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(waterResourceServiceImpl.queryForWaterResourcePage(page, name,
resourceType, belongBuildingId, belongFightingSystemId, sequenceNbr));
classifyId, belongBuildingId, belongFightingSystemId, sequenceNbr));
}
/**
......@@ -384,9 +384,9 @@ public class WaterResourceController extends BaseController {
@GetMapping(value = "/select_list")
public ResponseModel<List<WaterResourceDto>> selectList(String name, Long sequenceNbr,
Long belongFightingSystemId, Long belongBuildingId,
String belongBuilding, String resourceType, String classifyId) {
String belongBuilding, String resourceType) {
return ResponseHelper.buildResponse(waterResourceServiceImpl.queryWaterResourceList(true, name,
sequenceNbr, belongFightingSystemId, belongBuildingId, belongBuilding, resourceType, classifyId));
sequenceNbr, belongFightingSystemId, belongBuildingId, belongBuilding, resourceType));
}
/**
......
......@@ -4,6 +4,7 @@ import java.util.Date;
import java.util.List;
import java.util.Map;
import com.yeejoin.amos.boot.module.common.api.service.IOrgUsrService;
import org.apache.commons.lang3.ObjectUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -44,6 +45,8 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
@Autowired
FailureRepairlogServiceImpl failureRepairlogService;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
/**
......@@ -62,8 +65,9 @@ public class FailureAuditServiceImpl extends BaseService<FailureAuditDto, Failur
int auditResult = 0;
Boolean repairResult = null;
Long seq = Long.valueOf(iOrgUsrService.getParentId(userInfo.getUserModel().getUserId()));
//根据审核的结果进行业务操作
if (condition == AuditResultEnum.AGREE.getCode() && userInfo.getDepartment().getSequenceNbr().equals(failureDetailsDto.getBizCode())) {
if (condition == AuditResultEnum.AGREE.getCode() && seq.equals(failureDetailsDto.getBizCode())) {
auditResult = AuditResultEnum.AGREE.getCode();
repairResult = updateStatus(model, FailureStatuEnum.WAITING_AUDIT, userInfo, condition);
} else if (condition == (AuditResultEnum.REFUSE.getCode())) {
......
......@@ -65,6 +65,8 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
@Autowired
IFailureRepairlogService failureRepairlog;
@Autowired
OrgUsrServiceImpl iOrgUsrService;
public static String EMERGENCY_COMMAND = "应急指挥科";
public static String[] PROCESS_NAME = {"提交报修单", "审核", "维修", "验收", "维修中"};
......@@ -222,7 +224,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
failureDetailsDto.setSubmissionTime(new Date());
failureDetailsDto.setFailureCode(buildOrderNo());
failureDetailsDto.setSubmissionName(userInfo.getUserModel().getRealName());
failureDetailsDto.setBizCode(userInfo.getDepartment().getSequenceNbr());
failureDetailsDto.setBizCode(Long.valueOf(iOrgUsrService.getParentId(userInfo.getUserModel().getUserId())));
model = this.createWithModel(failureDetailsDto);
if (ObjectUtils.isNotEmpty(failureDetailsDto.getAttachment())) {
......@@ -234,7 +236,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Integer processAuditorId = model.getSubmissionPid();
String processResult = "提交报修单";
String processDepartment = userInfo.getDepartment().getDepartmentName();
Long departmentId = userInfo.getDepartment().getSequenceNbr();
Long departmentId = failureDetailsDto.getBizCode();
Date processTime = model.getSubmissionTime();
String processAuditorName = failureDetailsDto.getSubmissionName();
repairlog(faultId, processAuditorId, departmentId, processTime, processDepartment, processResult, processAuditorName);
......@@ -266,7 +268,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Integer processAuditorId = model.getSubmissionPid();
String processResult = "重新提交报修单";
String processDepartment = userInfo.getDepartment().getDepartmentName();
Long departmentId = userInfo.getDepartment().getSequenceNbr();
Long departmentId = failureDetailsDto.getBizCode();
Date processTime = model.getSubmissionTime();
String processAuditorName = failureDetailsDto.getSubmissionName();
repairlog(faultId, processAuditorId, departmentId, processTime, processDepartment, processResult, processAuditorName);
......@@ -396,6 +398,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
public Map<String, Object> checkExcuteTaskAuthMap(Long sequenceNbr, ReginParams userInfo) {
// 获取当前登录用户的角色
String currentLoginUserRole = userInfo.getRole().getRoleName();
Map<String, Object> map = new HashMap<String, Object>();
map.put("checkFlag", false);
......@@ -404,7 +407,7 @@ public class FailureDetailsServiceImpl extends BaseService<FailureDetailsDto, Fa
Long failureEquipmentId = failureDetailsDto.getSubmissionBranchId();
FailureDetails details = this.baseMapper.selectById(sequenceNbr);
String procressId = details.getProcessId();
Long seq = userInfo.getDepartment().getSequenceNbr();
Long seq = Long.valueOf(iOrgUsrService.getParentId(userInfo.getUserModel().getUserId()));
JSONObject teskObject = workflowFeignService.getTaskList(procressId);
if (ObjectUtils.isNotEmpty(teskObject)) {
JSONArray taskDetailArray = teskObject.getJSONArray("data");
......
......@@ -114,6 +114,7 @@ public class LinkageUnitServiceImpl extends BaseService<LinkageUnitDto, LinkageU
/**
* 列表查询 示例
*/
@Override
public List<LinkageUnitDto> queryForLinkageUnitList(@Condition(Operator.eq) Boolean isDelete) {
return this.queryForList("", false, isDelete);
}
......
......@@ -967,6 +967,18 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
return this.queryBySeq(Long.valueOf(person.getParentId()));
}
public String getParentId(String amosOrgId) {
List<OrgUsrDto> orgUsrDtos = queryForList("", false, amosOrgId);
String parentId = null;
if (orgUsrDtos.size() >= 1){
parentId = orgUsrDtos.get(0).getParentId();
}else {
return null;
}
return parentId;
}
public OrgUsrDto queryForListByParentIdAndOrgType(String amosOrgId) {
return this.queryModelByParams(amosOrgId);
}
......
......@@ -56,13 +56,11 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
*/
public Page<WaterResourceDto> queryForWaterResourcePage(Page<WaterResourceDto> page,
@Condition(Operator.like) String name,
@Condition(Operator.eq) String resourceType,
@Condition(Operator.eq) String equipId,
@Condition(Operator.in) ArrayList<Long> belongBuildingId,
@Condition(Operator.eq) Long belongFightingSystemId,
@Condition(Operator.eq) Long sequenceNbr) {
// return this.queryForPage(page, null, false, name, resourceType, belongBuildingId, belongFightingSystemId,
// sequenceNbr, isDelete);
return this.waterResourceMapper.getWaterResourcePageByParams(page, name, resourceType, belongBuildingId,
return this.waterResourceMapper.getWaterResourcePageByParams(page, name, equipId, belongBuildingId,
belongFightingSystemId, sequenceNbr);
}
......@@ -82,10 +80,9 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
@Condition(Operator.eq) Long belongFightingSystemId,
@Condition(Operator.eq) Long belongBuildingId,
@Condition(Operator.like) String belongBuilding,
@Condition(Operator.eq) String resourceType,
@Condition(Operator.eq) String equipId) {
@Condition(Operator.eq) String resourceType) {
return this.queryForList("", false, isDelete, name, sequenceNbr, belongFightingSystemId, belongBuildingId,
belongBuilding, resourceType, equipId);
belongBuilding, resourceType);
}
......
......@@ -299,4 +299,17 @@ public class AlertCalledController extends BaseController {
return ResponseHelper.buildResponse(iAlertCalledService.controlEquip());
}
/**
* 警情重新定位
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/reLocate")
@ApiOperation(httpMethod = "PUT", value = "警情重新定位", notes = "警情重新定位")
public ResponseModel<Boolean> reLocateById(@RequestParam String alertCalled, @RequestParam String longitude,
@RequestParam String latitude) {
return ResponseHelper.buildResponse(iAlertCalledService.reLocate(alertCalled, longitude, latitude));
}
}
\ No newline at end of file
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import org.springframework.web.bind.annotation.RequestMapping;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import java.util.List;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.AlertLocationLogServiceImpl;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import org.springframework.beans.factory.annotation.Autowired;
import javax.servlet.http.HttpServletRequest;
import org.springframework.web.bind.annotation.*;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertLocationLogDto;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
/**
*
*
* @author system_generator
* @date 2021-08-26
*/
@RestController
@Api(tags = "Api")
@RequestMapping(value = "/alert-location-log")
public class AlertLocationLogController extends BaseController {
@Autowired
AlertLocationLogServiceImpl alertLocationLogServiceImpl;
/**
* 新增
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增", notes = "新增")
public ResponseModel<AlertLocationLogDto> save(@RequestBody AlertLocationLogDto model) {
model = alertLocationLogServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新", notes = "根据sequenceNbr更新")
public ResponseModel<AlertLocationLogDto> updateBySequenceNbrAlertLocationLog(@RequestBody AlertLocationLogDto model,@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.updateWithModel(model));
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除", notes = "根据sequenceNbr删除")
public ResponseModel<Boolean> deleteBySequenceNbr(HttpServletRequest request, @PathVariable(value = "sequenceNbr") Long sequenceNbr){
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET",value = "根据sequenceNbr查询单个", notes = "根据sequenceNbr查询单个")
public ResponseModel<AlertLocationLogDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET",value = "分页查询", notes = "分页查询")
public ResponseModel<Page<AlertLocationLogDto>> queryForPage(@RequestParam(value = "current") int current,@RequestParam
(value = "size") int size) {
Page<AlertLocationLogDto> page = new Page<AlertLocationLogDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.queryForAlertLocationLogPage(page));
}
/**
* 列表全部数据查询
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET",value = "列表全部数据查询", notes = "列表全部数据查询")
@GetMapping(value = "/list")
public ResponseModel<List<AlertLocationLogDto>> selectForList() {
return ResponseHelper.buildResponse(alertLocationLogServiceImpl.queryForAlertLocationLogList());
}
}
package com.yeejoin.amos.boot.module.jcs.biz.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.module.jcs.api.dto.RallyPointDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.RallyPoint;
import com.yeejoin.amos.boot.module.jcs.biz.service.impl.RallyPointServiceImpl;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.foundation.utils.Bean;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import org.typroject.tyboot.core.restful.utils.ResponseHelper;
import org.typroject.tyboot.core.restful.utils.ResponseModel;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
/**
* 集结点
*
* @author system_generator
* @date 2021-08-25
*/
@RestController
@Api(tags = "集结点Api")
@RequestMapping(value = "/rally-point")
public class RallyPointController extends BaseController {
@Autowired
RallyPointServiceImpl rallyPointServiceImpl;
/**
* 新增集结点
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PostMapping(value = "/save")
@ApiOperation(httpMethod = "POST", value = "新增集结点", notes = "新增集结点")
public ResponseModel<RallyPointDto> save(@RequestBody RallyPointDto model) {
model = rallyPointServiceImpl.createWithModel(model);
return ResponseHelper.buildResponse(model);
}
/**
* 根据sequenceNbr更新
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PutMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "PUT", value = "根据sequenceNbr更新集结点", notes = "根据sequenceNbr更新集结点")
public ResponseModel<RallyPoint> updateBySequenceNbrRallyPoint(@RequestBody RallyPointDto model,
@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
model.setSequenceNbr(sequenceNbr);
RallyPoint rallyPoint = new RallyPoint();
BeanUtils.copyProperties(model, rallyPoint);
rallyPointServiceImpl.saveOrUpdate(rallyPoint);
return ResponseHelper.buildResponse(rallyPoint);
}
/**
* 根据sequenceNbr删除
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@DeleteMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "DELETE", value = "根据sequenceNbr删除集结点", notes = "根据sequenceNbr删除集结点")
public ResponseModel<Boolean> deleteBySequenceNbr(@PathVariable(value = "sequenceNbr") Long sequenceNbr) {
return ResponseHelper.buildResponse(rallyPointServiceImpl.removeById(sequenceNbr));
}
/**
* 根据sequenceNbr查询
*
* @param sequenceNbr 主键
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/{sequenceNbr}")
@ApiOperation(httpMethod = "GET", value = "根据sequenceNbr查询单个集结点", notes = "根据sequenceNbr查询单个集结点")
public ResponseModel<RallyPointDto> selectOne(@PathVariable Long sequenceNbr) {
return ResponseHelper.buildResponse(rallyPointServiceImpl.queryBySeq(sequenceNbr));
}
/**
* 列表分页查询
*
* @param current 当前页
* @param current 每页大小
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@GetMapping(value = "/page")
@ApiOperation(httpMethod = "GET", value = "集结点分页查询", notes = "集结点分页查询")
public ResponseModel<Page<RallyPointDto>> queryForPage(@RequestParam(value = "current") int current, @RequestParam
(value = "size") int size) {
Page<RallyPointDto> page = new Page<RallyPointDto>();
page.setCurrent(current);
page.setSize(size);
return ResponseHelper.buildResponse(rallyPointServiceImpl.queryForRallyPointPage(page));
}
/**
* 根据警情id查询集结点列表
*
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(httpMethod = "GET", value = "根据警情id查询集结点列表", notes = "根据警情id查询集结点列表")
@GetMapping(value = "/list")
public ResponseModel<List<RallyPointDto>> selectForList(@RequestParam String alertId) {
return ResponseHelper.buildResponse(rallyPointServiceImpl.queryForRallyPointList(alertId));
}
}
......@@ -27,6 +27,7 @@ import com.yeejoin.amos.boot.module.jcs.api.dto.KeyValueLabel;
import com.yeejoin.amos.boot.module.jcs.api.dto.PowerData;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertFormValue;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog;
import com.yeejoin.amos.boot.module.jcs.api.entity.Template;
import com.yeejoin.amos.boot.module.jcs.api.enums.AlertStageEnums;
import com.yeejoin.amos.boot.module.jcs.api.enums.ControllerTypeEnum;
......@@ -86,6 +87,10 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
private ControllerServiceImpl controllerService;
@Autowired
private ControllerEquipServiceImpl controllerEquipService;
@Autowired
private AlertLocationLogServiceImpl alertLocationLogService;
@Autowired
private EmqKeeper emqKeeper;
@Value("${mqtt.topic.command.alert.notice}")
......@@ -538,4 +543,34 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto, AlertCal
return true;
}
/**
* 警情重新定位
*
* @param alertId 警情id
* @param longitude 经度
* @param latitude 纬度
* @return
*/
public Boolean reLocate(String alertId, String longitude, String latitude) {
try {
// 更新警情主表
AlertCalled alertCalled = this.baseMapper.selectById(alertId);
alertCalled.setCoordinateX(Double.valueOf(longitude));
alertCalled.setCoordinateY(Double.valueOf(latitude));
this.updateById(alertCalled);
// 插入定位日志表
AlertLocationLog alertLocationLog = new AlertLocationLog();
alertLocationLog.setAlertId(Long.valueOf(alertId));
alertLocationLog.setLongitude(longitude);
alertLocationLog.setLatitude(latitude);
alertLocationLogService.save(alertLocationLog);
return true;
} catch (Exception e) {
log.error(e.toString());
e.printStackTrace();
throw new RuntimeException("警情定位失败!");
}
}
}
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertLocationLog;
import com.yeejoin.amos.boot.module.jcs.api.mapper.AlertLocationLogMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IAlertLocationLogService;
import com.yeejoin.amos.boot.module.jcs.api.dto.AlertLocationLogDto;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import java.util.List;
/**
* 服务实现类
*
* @author system_generator
* @date 2021-08-26
*/
@Service
public class AlertLocationLogServiceImpl extends BaseService<AlertLocationLogDto,AlertLocationLog,AlertLocationLogMapper> implements IAlertLocationLogService {
/**
* 分页查询
*/
public Page<AlertLocationLogDto> queryForAlertLocationLogPage(Page<AlertLocationLogDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<AlertLocationLogDto> queryForAlertLocationLogList() {
return this.queryForList("" , false);
}
}
\ No newline at end of file
......@@ -9,7 +9,7 @@ import javax.annotation.Resource;
import com.yeejoin.amos.boot.module.common.api.dto.LinkageUnitDto;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.biz.service.impl.LinkageUnitServiceImpl;
import com.yeejoin.amos.boot.module.common.api.service.ILinkageUnitService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
......@@ -70,7 +70,7 @@ public class DataSourcesImpl implements DataSources {
private RestTemplate restTemplate;
@Autowired
LinkageUnitServiceImpl linkageUnitServiceImpl;
ILinkageUnitService linkageUnitServiceImpl;
@Value("${security.systemctl.name}")
private String systemctl;
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.module.jcs.api.dto.RallyPointDto;
import com.yeejoin.amos.boot.module.jcs.api.entity.RallyPoint;
import com.yeejoin.amos.boot.module.jcs.api.mapper.RallyPointMapper;
import com.yeejoin.amos.boot.module.jcs.api.service.IRallyPointService;
import org.springframework.stereotype.Service;
import org.typroject.tyboot.core.rdbms.service.BaseService;
import java.util.List;
/**
* 集结点服务实现类
*
* @author system_generator
* @date 2021-08-25
*/
@Service
public class RallyPointServiceImpl extends BaseService<RallyPointDto, RallyPoint, RallyPointMapper> implements IRallyPointService {
/**
* 分页查询
*/
public Page<RallyPointDto> queryForRallyPointPage(Page<RallyPointDto> page) {
return this.queryForPage(page, null, false);
}
/**
* 列表查询 示例
*/
public List<RallyPointDto> queryForRallyPointList(String alertId) {
return this.queryForList("", false, alertId);
}
}
\ No newline at end of file
......@@ -3,8 +3,6 @@ package com.yeejoin.amos.maintenance.business.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dto.CheckDto;
import com.yeejoin.amos.maintenance.business.dto.CheckInputDto;
import com.yeejoin.amos.maintenance.business.dto.CheckShotDto;
import com.yeejoin.amos.maintenance.business.param.CheckInfoPageParam;
import com.yeejoin.amos.maintenance.business.param.CheckRecordParam;
import com.yeejoin.amos.maintenance.business.param.CheckStatisticalParam;
......@@ -13,6 +11,7 @@ import com.yeejoin.amos.maintenance.business.util.*;
import com.yeejoin.amos.maintenance.business.vo.CheckAnalysisVo;
import com.yeejoin.amos.maintenance.business.vo.CheckInfoVo;
import com.yeejoin.amos.maintenance.common.enums.CheckRecordOrderByEnum;
import com.yeejoin.amos.maintenance.common.enums.CheckStatusEnum;
import com.yeejoin.amos.maintenance.core.async.AsyncTask;
import com.yeejoin.amos.maintenance.core.common.request.CommonPageable;
import com.yeejoin.amos.maintenance.core.common.request.CommonRequest;
......@@ -80,10 +79,11 @@ public class CheckController extends AbstractBaseController {
* @return
*/
@TycloudOperation(ApiLevel = UserType.AGENCY)
@PersonIdentify
@ApiOperation(value = "巡检记录查询", notes = "巡检记录查询")
@RequestMapping(value = "/list", produces = "application/json;charset=UTF-8", method = RequestMethod.POST)
public CommonResponse qryCheckInfoPage(
@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "查询条件") @RequestBody(required = false) List<CommonRequest> queryRequests,
@ApiParam(value = "分页参数", required = true) CommonPageable commonPageable) {
ReginParams reginParams = getSelectedOrgInfo();
String orgCode = getOrgCode(reginParams);
......@@ -307,7 +307,7 @@ public class CheckController extends AbstractBaseController {
@ApiOperation(value = "维保日历-mobile", notes = "维保日历-mobile")
@GetMapping(value = "/{date}/checkCalendar", produces = "application/json;charset=UTF-8")
public CommonResponse checkCalendar(
@ApiParam(value = "date,格式YYYY-MM-DD",required = true)@PathVariable String date) {
@ApiParam(value = "date,格式YYYY-MM-DD", required = true) @PathVariable String date) {
Map<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
......@@ -480,7 +480,7 @@ public class CheckController extends AbstractBaseController {
return CommonResponseUtil.success(checkService.obtainLastCheckRecord(relationId));
}
@PersonIdentify(isNeedIdentity = true)
@PersonIdentify
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保记录分页查询", notes = "维保记录分页查询")
@GetMapping(value = "/page")
......@@ -492,10 +492,10 @@ public class CheckController extends AbstractBaseController {
@ApiParam(value = "开始时间") @RequestParam(value = "beginTime", required = false) String beginTime,
@ApiParam(value = "结束时间") @RequestParam(value = "endTime", required = false) String endTime,
@ApiParam(value = "维保人员") @RequestParam(value = "personId", required = false) String person,
@ApiParam(value = "业主单位") @RequestParam(value = "teamId", required = false) String teamId,
@ApiParam(value = "业主单位") @RequestParam(value = "companyId", required = false) String companyId,
@ApiParam(value = "设施Id") @RequestParam(value = "equipId", required = false) String equipId,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception{
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) throws Exception {
HashMap<String, Object> params = new HashMap<>();
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
......@@ -510,7 +510,7 @@ public class CheckController extends AbstractBaseController {
params.put("beginTime", beginTime);
params.put("endTime", endTime);
params.put("person", person);
params.put("teamId", teamId);
params.put("companyId", companyId);
params.put("equipId", equipId);
params.put("orgCode", loginOrgCode);
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
......@@ -521,7 +521,7 @@ public class CheckController extends AbstractBaseController {
@ApiOperation(value = "维保记录详情", notes = "维保记录详情")
@GetMapping(value = "/detail/{id}")
public CommonResponse getCheckDetail(
@ApiParam(value = "记录Id") @PathVariable(value = "id") String id) throws Exception{
@ApiParam(value = "记录Id") @PathVariable(value = "id") String id) throws Exception {
return CommonResponseUtil.success(checkService.getCheckDetail(id));
}
......@@ -532,21 +532,28 @@ public class CheckController extends AbstractBaseController {
return ResponseHelper.buildResponse(CheckRecordOrderByEnum.getEnumList());
}
@ApiOperation(value = "/设备设施维保记录分页列表",notes = "外部接口装备和者水源使用")
@ApiOperation(value = "/设备设施维保记录分页列表", notes = "外部接口装备和者水源使用")
@GetMapping(value = "page/{originalId}/list")
public ResponseModel getCheckListByOriginalId(
@PathVariable String originalId,
@RequestParam(value = "current") int pageNum,
@RequestParam(value = "size") int pageSize
){
CommonPageable pageable = new CommonPageable(pageNum,pageSize);
return ResponseHelper.buildResponse(checkService.getCheckListByOriginalId(originalId,pageable));
) {
CommonPageable pageable = new CommonPageable(pageNum, pageSize);
return ResponseHelper.buildResponse(checkService.getCheckListByOriginalId(originalId, pageable));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "web端维保记录详情")
@GetMapping(value = "input/{checkId}/detail")
public ResponseModel inputDetail(@ApiParam(value = "记录主表id") @PathVariable String checkId){
public ResponseModel inputDetail(@ApiParam(value = "记录主表id") @PathVariable String checkId) {
return ResponseHelper.buildResponse(checkService.getInputDetail(checkId));
}
@TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "维保检查结果下拉列表")
@GetMapping(value = "/isOk-list")
public ResponseModel statusList() {
return ResponseHelper.buildResponse(CheckStatusEnum.getEnumList());
}
}
package com.yeejoin.amos.maintenance.business.controller;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.maintenance.business.dto.PointDto;
import com.yeejoin.amos.maintenance.business.param.PointImportParam;
import com.yeejoin.amos.maintenance.business.param.PointImportQueryParam;
......@@ -636,10 +635,9 @@ public class PointController extends AbstractBaseController {
public CommonResponse syncSavePoint(
@ApiParam(value = "同步请求参数") @RequestBody() List<MaintenanceResourceData> list) {
ReginParams reginParams = getSelectedOrgInfo();
AgencyUserModel model = getUserInfo();
String orgCode = getOrgCode(reginParams);
iPointService.syncSavePoint(list, orgCode, model.getUserId());
iPointService.syncSavePoint(list, reginParams);
return CommonResponseUtil.success();
}
}
......@@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.toolkit.Sequence;
import com.google.common.base.Joiner;
import com.google.common.collect.Lists;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import com.yeejoin.amos.maintenance.business.constants.XJConstant;
import com.yeejoin.amos.maintenance.business.dao.mapper.InputItemMapper;
......@@ -35,11 +36,11 @@ import org.springframework.data.domain.*;
import org.springframework.data.domain.Sort.Direction;
import org.springframework.data.domain.Sort.Order;
import org.springframework.data.jpa.domain.Specification;
import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
import org.springframework.util.ObjectUtils;
import org.typroject.tyboot.core.foundation.context.RequestContext;
import org.typroject.tyboot.core.foundation.utils.Bean;
import javax.annotation.Resource;
......@@ -273,7 +274,7 @@ public class PointServiceImpl implements IPointService {
public Point updatePoint(PointParam pointParam) {
//1.更新点
long pointId = pointParam.getPoint().getId();
Point newPoint = iPointDao.findById(pointId).orElseThrow(()->new RuntimeException("找不到原始数据"));
Point newPoint = iPointDao.findById(pointId).orElseThrow(() -> new RuntimeException("找不到原始数据"));
Bean.copyExistPropertis(pointParam.getPoint(), newPoint);
newPoint.setLastUpdateTime(new Date());
iPointDao.save(newPoint);
......@@ -1087,25 +1088,10 @@ public class PointServiceImpl implements IPointService {
@Override
@Async
public void syncSavePoint(List<MaintenanceResourceData> list, String orgCode, String userId) {
public void syncSavePoint(List<MaintenanceResourceData> list, ReginParams reginParams) {
List<Point> points = new ArrayList<>();
List<PointInputItem> inputItems = new ArrayList<>();
List<Long> ids = new ArrayList<>();
//1.删除已有数据
for (MaintenanceResourceData x : list) {
String pointNo = x.getFireFacilityCode();
String originalId = String.valueOf(x.getFireFacilityId());
Long id = iPointDao.findPointByEquipmentIdAndFireFacilityId(pointNo, originalId);
if (null != id) {
ids.add(id);
}
}
if (!ids.isEmpty()) {
Long[] idsArray = ids.toArray(new Long[0]);
delPointById(idsArray);
}
//2.创建
//1.创建
for (MaintenanceResourceData x : list) {
Point point = new Point();
String pointNo = StringUtil.isNotEmpty(x.getFireFacilityCode()) ? x.getFireFacilityCode() : String.valueOf(sequence.nextId());
......@@ -1123,11 +1109,14 @@ public class PointServiceImpl implements IPointService {
point.setBuildingName(x.getBuildingName());
point.setAddress(x.getArea());
point.setLevel("");
point.setCreatorId(userId);
point.setOrgCode(orgCode);
point.setCreatorId(RequestContext.getExeUserId());
//TODO BUG orgCode 取值 没值来源
point.setOrgCode(reginParams.getCompany().getOrgCode());
point.setCompanyId(String.valueOf(x.getMaintenanceCompanyId()));
point.setCompanyName(x.getMaintenanceCompanyName());
points.add(point);
iPointDao.save(point);
List<InputItem> inputItemVos = inputItemMapper.getInputItemByEquipmentName(x.getClassifyName(), orgCode);
List<InputItem> inputItemVos = inputItemMapper.getInputItemByEquipmentName(x.getClassifyName(), null);
if (0 < inputItemVos.size()) {
inputItemVos.forEach(y -> {
PointInputItem inputItem = new PointInputItem();
......
package com.yeejoin.amos.maintenance.business.service.intfc;
import com.alibaba.fastjson.JSONObject;
import com.yeejoin.amos.boot.biz.common.bo.ReginParams;
import com.yeejoin.amos.maintenance.business.dto.PointDto;
import com.yeejoin.amos.maintenance.business.param.*;
import com.yeejoin.amos.maintenance.business.util.DaoCriteria;
......@@ -299,7 +300,6 @@ public interface IPointService {
LinkedHashMap<String,Object> getRegionTress();
void syncSavePoint(List<MaintenanceResourceData> list, String orgCode, String userId);
/**
* 查询巡检点及点及点的项
* @param queryRequests 请求参数
......@@ -309,4 +309,5 @@ public interface IPointService {
*/
Page<PointDto> queryPointInfoWithItem(List<DaoCriteria> queryRequests, CommonPageable commonPageable, Long ownerId);
void syncSavePoint(List<MaintenanceResourceData> list, ReginParams reginParams);
}
package com.yeejoin.amos.maintenance.business.service.intfc;
import com.yeejoin.amos.maintenance.business.param.SynInputItemParam;
import com.yeejoin.amos.maintenance.business.util.CommonResponse;
import com.yeejoin.amos.maintenance.business.util.Toke;
import com.yeejoin.amos.maintenance.business.param.SynPlanParam;
import com.yeejoin.amos.maintenance.business.param.SynPointParam;
import com.yeejoin.amos.maintenance.business.param.SynRouteParam;
import java.util.List;
public interface ISynDataService {
CommonResponse saveInputItem(SynInputItemParam synInputItemParam, String userId, String orgCode);
CommonResponse updateInputItem(SynInputItemParam synInputItemParam);
CommonResponse deleteInputItem(SynInputItemParam synInputItemParam);
CommonResponse saveSinglePoint(SynPointParam synPointParam, String userId, String orgCode);
CommonResponse updateSinglePoint(SynPointParam synPointParam);
CommonResponse deleteSinglePoint(SynPointParam synPointParam);
CommonResponse synPointItemRelation(SynPointParam synPointParam, Boolean isSave, String userId);
CommonResponse saveRoute(SynRouteParam synRouteParam, String userId, String orgCode);
CommonResponse updateRoute(SynRouteParam synRouteParam, String userId, String orgCode);
CommonResponse savePlan(SynPlanParam synPlanParam, String userId, String orgCode, Toke toke);
CommonResponse updatePlan(SynPlanParam synPlanParam, String userId, String orgCode);
CommonResponse stopPlan(String originalId);
CommonResponse getPlanFinishTimes(String originalIds);
/**
* 删除维保项(原巡检点)
* @param ids 原ids
* @return Boolean
*/
List<Long> pointDelete(String ids);
}
......@@ -423,14 +423,12 @@ public class CheckController extends AbstractBaseController {
@ApiOperation(value = "获取巡检日历数据<font color='blue'>手机app</font>", notes = "获取巡检日历数据<font color='blue'>手机app</font>")
@PostMapping(value = "/checkCalendar", produces = "application/json;charset=UTF-8")
public CommonResponse checkCalendar(
@ApiParam(value = "查询条件", required = false) @RequestBody(required = false) List<CommonRequest> queryRequests) {
@ApiParam(value = "查询条件") @RequestBody(required = false) List<CommonRequest> queryRequests) {
try {
ReginParams reginParams = getSelectedOrgInfo();
String loginOrgCode = getOrgCode(reginParams);
String roleTypeName = getRoleTypeName(reginParams);
List<DaoCriteria> daoCriterias = buildDaoCriterias(queryRequests, true, loginOrgCode, roleTypeName);
Map<String, Object> map = checkService.checkCalendar(CheckParamUtil.checkCalendar(daoCriterias));
return CommonResponseUtil.success(map);
} catch (Exception e) {
......@@ -618,9 +616,9 @@ public class CheckController extends AbstractBaseController {
public ResponseModel getPlanExecuteInfo(
@ApiParam(value = "计划id") @RequestParam(value = "planId") Long planId,
@ApiParam(value = "点id") @RequestParam(value = "pointId", required = false) Long pointId,
@ApiParam(value = "点id") @RequestParam(value = "pointId", required = false) String executeState,
@ApiParam(value = "点id") @RequestParam(value = "pointId", required = false) String status,
@ApiParam(value = "点id") @RequestParam(value = "pointId", required = false) String teamId,
@ApiParam(value = "执行状态") @RequestParam(value = "executeState", required = false) String executeState,
@ApiParam(value = "状态") @RequestParam(value = "status", required = false) String status,
@ApiParam(value = "单位id") @RequestParam(value = "companyName", required = false) String companyName,
@ApiParam(value = "当前页") @RequestParam(value = "pageNumber") int pageNumber,
@ApiParam(value = "页大小") @RequestParam(value = "pageSize") int pageSize) {
HashMap<String, Object> map = new HashMap<>();
......@@ -628,7 +626,7 @@ public class CheckController extends AbstractBaseController {
map.put("pointId", pointId);
map.put("executeState", executeState);
map.put("status", status);
map.put("teamId", teamId);
map.put("companyName", companyName);
CommonPageable pageable = new CommonPageable(pageNumber, pageSize);
return ResponseHelper.buildResponse(checkService.getPlanExecuteInfo(map, pageable));
}
......
......@@ -1156,6 +1156,8 @@ public class CheckServiceImpl implements ICheckService {
if (total == 0) {
return new PageImpl<>(content, page, total);
}
;
map.put("status", PlanTaskFinishStatusEnum.getValue(String.valueOf(map.get("status"))));
map.put("offset", page.getOffset());
map.put("pageSize", page.getPageSize());
content = checkMapper.getCheckItems(map);
......
......@@ -97,5 +97,49 @@
ADD COLUMN maintenance_period VARCHAR ( 10 ) COMMENT '维保周期';
</sql>
</changeSet>
<changeSet author="tb" id="2021-08-27-tb-1">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="jc_rally_point"/>
</not>
</preConditions>
<comment>create table jc_rally_point</comment>
<sql>
CREATE TABLE `jc_rally_point` (
`sequence_nbr` bigint(30) NOT NULL COMMENT '主键',
`name` varchar(100) DEFAULT NULL COMMENT '名称',
`address` varchar(255) DEFAULT NULL COMMENT '地址',
`alert_id` bigint(30) NOT NULL COMMENT '警情id',
`longitude` varchar(20) NOT NULL COMMENT '经度',
`latitude` varchar(20) NOT NULL COMMENT '纬度',
`rec_user_id` bigint(30) NOT NULL COMMENT '更新用户id',
`rec_user_name` varchar(30) NOT NULL COMMENT '更新用户名称',
`rec_date` datetime NOT NULL COMMENT '更新日期',
`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(1:删除,0:未删除)',
PRIMARY KEY (`sequence_nbr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='集结点';
</sql>
</changeSet>
<changeSet author="tb" id="2021-08-27-tb-2">
<preConditions onFail="MARK_RAN">
<not>
<tableExists tableName="jc_alert_location_log"/>
</not>
</preConditions>
<comment>create table jc_alert_location_log</comment>
<sql>
CREATE TABLE `jc_alert_location_log` (
`sequence_nbr` bigint(30) NOT NULL COMMENT '主键',
`alert_id` bigint(30) NOT NULL COMMENT '警情id',
`longitude` varchar(30) NOT NULL COMMENT '经度',
`latitude` varchar(30) NOT NULL COMMENT '纬度',
`rec_user_id` bigint(30) NOT NULL COMMENT '更新人员id',
`rec_user_name` varchar(50) NOT NULL COMMENT '更新人员名称',
`rec_date` datetime NOT NULL COMMENT '更新时间',
`is_delete` bit(1) NOT NULL DEFAULT b'0' COMMENT '是否删除(1: 已删除,0:未删除)',
PRIMARY KEY (`sequence_nbr`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
</sql>
</changeSet>
</databaseChangeLog>
package com.yeejoin.amos;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
import org.mybatis.spring.annotation.MapperScan;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
......@@ -25,6 +20,11 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.web.client.RestTemplate;
import org.typroject.tyboot.core.restful.exception.GlobalExceptionHandler;
import java.io.IOException;
import java.net.InetAddress;
import java.net.URISyntaxException;
import java.net.UnknownHostException;
/**
* <pre>
* 服务启动类
......
......@@ -266,7 +266,7 @@
ELSE
0
END
),0) AS "qualified",
),0) AS '合格',
COALESCE(SUM(
CASE
WHEN is_ok = '2' THEN
......@@ -274,7 +274,7 @@
ELSE
0
END
),0) AS "unqualified",
),0) AS '不合格',
COALESCE(SUM(
CASE
WHEN is_ok = '3' THEN
......@@ -282,8 +282,7 @@
ELSE
0
END
),0) AS "omission",
COUNT(id) count
),0) AS '漏检'
FROM
p_check
<include refid="calendar-where"/>
......@@ -1968,10 +1967,10 @@
<choose>
<when test="identityType==1">
And (a.orgCode LIKE CONCAT( #{orgCode}, '-%' ) or a.orgCode= #{orgCode} )
<if test="companyId != null"> and a.ownerId = #{teamId}</if>
<if test="companyId != null and companyId != ''"> and a.ownerId = #{companyId}</if>
</when>
<when test="identityType==2">
And a.ownerId = #{teamId}
And a.ownerId = #{companyId}
</when>
</choose>
</where>
......@@ -2021,7 +2020,6 @@
) a
<include refid="mobile-check-record-where" />
</select>
<select id="getCheckDetail" resultType="Map">
SELECT
pc.id checkId,
......@@ -2046,7 +2044,7 @@
'%Y-%m-%d %H:%i:%s'
)) planDate,
ppl.name planName,
pp.plan_type planType,
ppl.plan_type planType,
ppt.user_name planUser,
pci.input_name itemName,
pii.maintenance_content itemContent,
......
......@@ -3,7 +3,7 @@ spring.datasource.url = jdbc:mysql://172.16.11.20:3306/amos-supervision_v1.0?use
spring.datasource.username= root
spring.datasource.password= root_123
## eureka properties:
eureka.client.serviceUrl.defaultZone=http://172.16.10.72:10001/eureka/
eureka.client.serviceUrl.defaultZone=http://172.16.11.20:10001/eureka/
security.password=a1234560
security.loginId=jc_wjk006
......@@ -12,10 +12,10 @@ security.productApp=STUDIO_APP_MOBILE
security.appKey=studio_normalapp_3168830
#redis 配置
spring.redis.database=0
spring.redis.host=172.16.10.85
spring.redis.database=1
spring.redis.host=172.16.11.20
spring.redis.port=6379
spring.redis.password=amos2019Redis
spring.redis.password=1234560
spring.redis.jedis.pool.max-active=200
spring.redis.jedis.pool.max-wait=-1
spring.redis.jedis.pool.max-idle=10
......@@ -45,9 +45,9 @@ linux.img.path = /
## emqx
emqx.clean-session=true
emqx.client-id=${spring.application.name}-${random.int[1024,65536]}-1
emqx.broker=tcp://172.16.10.85:1883
emqx.user-name=super
emqx.password=a123456
emqx.broker=tcp://172.16.11.33:1883
emqx.user-name=admin
emqx.password=public
emqx.max-inflight=1000
file.url=http://39.98.45.134:9000/
\ No newline at end of file
......@@ -1894,7 +1894,7 @@
d.date
</select>
<select id="getItemCount" resultType="Map">
<select id="getItemCount" resultType="long">
SELECT
count(1)
FROM
......@@ -1934,17 +1934,17 @@
pc.id = pci.check_id
AND pc.plan_task_detail_id = pptd.id
AND pc.plan_id = #{planId}
<if test="pointId != null and pointId != ''">
<if test="pointId != null and pointId != '' and pointId != -1">
AND pc.point_id = #{pointId}
</if>
<if test="executeState != null and executeState != ''">
AND pptd.is_finish = #{executeState}
<if test="status != null and status != ''">
AND pptd.is_finish = #{status}
</if>
<!-- <if test="status != null and status != ''">-->
<!-- AND pc.point_id = #{status}-->
<!-- </if>-->
<if test="teamId != null and teamId != ''">
AND pc.company_id = #{teamId}
<if test="companyName != null and companyName != ''">
AND pc.company_name = #{company_name}
</if>
LIMIT limit #{offset},#{pageSize}
</select>
......
......@@ -119,7 +119,7 @@
<if test="name!=null"> and a.name like concat(concat("%",#{name}),"%")</if>
<if test="itemNo!=null"> and a.item_no like concat(concat("%",#{itemNo}),"%")</if>
<if test="itemType!=null"> and a.item_Type = #{itemType} </if>
<if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>
<!-- <if test="orgCode!=null"> and a.org_Code = #{orgCode}</if>-->
<if test="itemClassify != null"> and a.item_classify = #{itemClassify}</if>
order by a.id desc
<choose>
......
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