Commit 3eb72617 authored by tangwei's avatar tangwei

解决冲突

parents 740a9b48 8c2a9bfb
...@@ -63,10 +63,10 @@ public class WaterResourcePoolDto extends BaseDto { ...@@ -63,10 +63,10 @@ public class WaterResourcePoolDto extends BaseDto {
private String recUserName; private String recUserName;
@ApiModelProperty(value = "最低报警水位(m)") @ApiModelProperty(value = "最低报警水位(m)")
private float minWaterLevel; private Float minWaterLevel;
@ApiModelProperty(value = "最高报警水位(m)") @ApiModelProperty(value = "最高报警水位(m)")
private float maxWaterLevel; private Float maxWaterLevel;
@ApiModelProperty("水池液位显示装置id") @ApiModelProperty("水池液位显示装置id")
private Long levelDeviceId; private Long levelDeviceId;
......
...@@ -105,8 +105,11 @@ ...@@ -105,8 +105,11 @@
</select> </select>
<select id="pageList" resultType="java.util.Map"> <select id="pageList" resultType="java.util.Map">
select select
d.* d.*,
jsc.*
from from
jc_shift_change jsc
LEFT JOIN
( (
select select
i.INSTANCE_ID instanceId, i.INSTANCE_ID instanceId,
...@@ -130,10 +133,10 @@ ...@@ -130,10 +133,10 @@
</if> </if>
</foreach> </foreach>
GROUP by GROUP by
i.INSTANCE_ID) d i.INSTANCE_ID) d on jsc.instance_id = d.instanceId
<if test="params != null and params.size() > 0"> <if test="params != null and params.size() > 0">
where where
1=1 jsc.is_delete = 0
<foreach collection="params" index="key" item="value" separator=""> <foreach collection="params" index="key" item="value" separator="">
<choose> <choose>
<when test="fieldCodes[key] == 'like' and value !=null and value !=''"> <when test="fieldCodes[key] == 'like' and value !=null and value !=''">
...@@ -151,6 +154,9 @@ ...@@ -151,6 +154,9 @@
<if test="params.date != null and params.lift == 'descend'"> <if test="params.date != null and params.lift == 'descend'">
order by endDate desc order by endDate desc
</if> </if>
<if test="params.systemType != null and params.systemType != '' ">
jsc.system_type is not null
</if>
<if test="params.date != null and params.lift == 'ascend'"> <if test="params.date != null and params.lift == 'ascend'">
order by endDate ASC order by endDate ASC
</if> </if>
......
...@@ -6,6 +6,7 @@ import javax.persistence.Lob; ...@@ -6,6 +6,7 @@ import javax.persistence.Lob;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
import com.baomidou.mybatisplus.annotation.TableName;
import org.hibernate.annotations.Where; import org.hibernate.annotations.Where;
...@@ -16,6 +17,7 @@ import org.hibernate.annotations.Where; ...@@ -16,6 +17,7 @@ import org.hibernate.annotations.Where;
@Table(name = "p_input_item") @Table(name = "p_input_item")
@NamedQuery(name = "InputItem.findAll", query = "SELECT c FROM InputItem c") @NamedQuery(name = "InputItem.findAll", query = "SELECT c FROM InputItem c")
@Where(clause = "is_delete=0")//表示未删除的数据 @Where(clause = "is_delete=0")//表示未删除的数据
@TableName("p_input_item")
public class InputItem extends BasicEntity { public class InputItem extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
package com.yeejoin.amos.patrol.dao.entity; package com.yeejoin.amos.patrol.dao.entity;
import com.baomidou.mybatisplus.annotation.TableName;
import javax.persistence.Column; import javax.persistence.Column;
import javax.persistence.Entity; import javax.persistence.Entity;
import javax.persistence.NamedQuery; import javax.persistence.NamedQuery;
...@@ -11,6 +13,7 @@ import javax.persistence.Table; ...@@ -11,6 +13,7 @@ import javax.persistence.Table;
*/ */
@Entity @Entity
@Table(name="p_point_inputitem") @Table(name="p_point_inputitem")
@TableName("p_point_inputitem")
@NamedQuery(name="PointInputItem.findAll", query="SELECT p FROM PointInputItem p") @NamedQuery(name="PointInputItem.findAll", query="SELECT p FROM PointInputItem p")
public class PointInputItem extends BasicEntity{ public class PointInputItem extends BasicEntity{
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -8,6 +8,8 @@ import javax.persistence.NamedQuery; ...@@ -8,6 +8,8 @@ import javax.persistence.NamedQuery;
import javax.persistence.Table; import javax.persistence.Table;
import javax.persistence.Transient; import javax.persistence.Transient;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonBackReference; import com.fasterxml.jackson.annotation.JsonBackReference;
...@@ -17,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference; ...@@ -17,6 +19,7 @@ import com.fasterxml.jackson.annotation.JsonBackReference;
*/ */
@Entity @Entity
@Table(name="p_route_point_item") @Table(name="p_route_point_item")
@TableName("p_route_point_item")
@NamedQuery(name="RoutePointItem.findAll", query="SELECT r FROM RoutePointItem r") @NamedQuery(name="RoutePointItem.findAll", query="SELECT r FROM RoutePointItem r")
public class RoutePointItem extends BasicEntity { public class RoutePointItem extends BasicEntity {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
......
...@@ -422,17 +422,19 @@ public class CommandController extends BaseController { ...@@ -422,17 +422,19 @@ public class CommandController extends BaseController {
QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>(); QueryWrapper<AirportStand> queryWrapper = new QueryWrapper<>();
queryWrapper.eq("stand_code",alertFormValue.getFieldValue()); queryWrapper.eq("stand_code",alertFormValue.getFieldValue());
AirportStand airportStand = airportStandMapper.selectOne(queryWrapper); AirportStand airportStand = airportStandMapper.selectOne(queryWrapper);
//机位坐标
par.setLatitude(Double.valueOf(airportStand.getLatitude())); par.setLatitude(Double.valueOf(airportStand.getLatitude()));
par.setLongitude(Double.valueOf(airportStand.getLongitude())); par.setLongitude(Double.valueOf(airportStand.getLongitude()));
} }
} }
//集结点坐标
par.setLatitudeTwo(alertCalled.getCoordinateX()); par.setLatitudeTwo(alertCalled.getCoordinateX());
par.setLongitudeTwo(alertCalled.getCoordinateY()); par.setLongitudeTwo(alertCalled.getCoordinateY());
break; break;
case "229": case "229"://一般火灾
if (alertCalled.getAlertSourceCode().equals("1326")){ par.setLatitude(alertCalled.getCoordinateX());
par.setLongitude(alertCalled.getCoordinateY());
if (alertCalled.getAlertSourceCode().equals("1326")){ //警情来源为物联报警的
result = this.getDetailsById(Long.valueOf(alertCalled.getRelationId()),null,null,null); result = this.getDetailsById(Long.valueOf(alertCalled.getRelationId()),null,null,null);
par.setLatitudeTwo(alertCalled.getCoordinateX()); par.setLatitudeTwo(alertCalled.getCoordinateX());
par.setLongitudeTwo(alertCalled.getCoordinateY()); par.setLongitudeTwo(alertCalled.getCoordinateY());
...@@ -453,7 +455,7 @@ public class CommandController extends BaseController { ...@@ -453,7 +455,7 @@ public class CommandController extends BaseController {
} }
ResponseModel<Page<Map<String, Object>>> data = null; ResponseModel<Page<Map<String, Object>>> data = null;
if (ValidationUtil.isEmpty(par.getLatitudeTwo()) ){ if (ValidationUtil.isEmpty(par.getLatitude()) ){
data = equipFeignClient.getVideopagList( String.valueOf((pageNum - 1) * pageSize), pageSize.toString(),par.getBuildingId(),par.getCode(),par.getEquipmentName(),par.getBizOrgCode(),par.getType()); data = equipFeignClient.getVideopagList( String.valueOf((pageNum - 1) * pageSize), pageSize.toString(),par.getBuildingId(),par.getCode(),par.getEquipmentName(),par.getBizOrgCode(),par.getType());
}else { }else {
data = equipFeignClient.pageVideoByAlertType( pageNum, pageSize, par); data = equipFeignClient.pageVideoByAlertType( pageNum, pageSize, par);
......
...@@ -128,14 +128,13 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta ...@@ -128,14 +128,13 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
return this.baseMapper.selectList(wrapper); return this.baseMapper.selectList(wrapper);
} }
public IPage<Map<String, Object>> pageList(int current, int size, String groupCode) { public IPage<Map<String, Object>> pageList(int current, int size, String groupCode,String systemType) {
Map<String, String> params = this.getRequestParamMap(); Map<String, String> params = this.getRequestParamMap();
//systemType 不是null 则查询的为120系统交接班
List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode)); List<DynamicFormColumn> columns = dynamicFormColumnService.list(new LambdaQueryWrapper<DynamicFormColumn>().eq(DynamicFormColumn::getGroupCode, groupCode));
Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class); Map<String, Object> fieldCodes = Bean.listToMap(columns, "fieldCode", "queryStrategy", DynamicFormColumn.class);
Page page = new Page(); Page page = new Page();
if (current > 0){ page.setCurrent(current);
page.setCurrent((long) (current - 1) *size);
}
page.setSize(size); page.setSize(size);
if (!params.isEmpty()&&params !=null){ if (!params.isEmpty()&&params !=null){
if (!params.get("sort").isEmpty() && params.get("sort") != null){ if (!params.get("sort").isEmpty() && params.get("sort") != null){
...@@ -144,6 +143,7 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta ...@@ -144,6 +143,7 @@ public class DynamicFormInstanceServiceImpl extends BaseService<DynamicFormInsta
params.put("lift",sorts[1]); params.put("lift",sorts[1]);
} }
} }
return this.getBaseMapper().pageList(page, RequestContext.getAppKey(), fieldCodes, groupCode, params); return this.getBaseMapper().pageList(page, RequestContext.getAppKey(), fieldCodes, groupCode, params);
} }
// 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14 // 不存在值班数据则不查找 修改sql 方法去除 by kongfm 2021-09-14
......
...@@ -3135,7 +3135,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp ...@@ -3135,7 +3135,9 @@ public class OrgUsrServiceImpl extends BaseService<OrgUsrDto, OrgUsr, OrgUsrMapp
if (map1.containsKey(fieldCode.substring(0,fieldCode.length()-4))){ if (map1.containsKey(fieldCode.substring(0,fieldCode.length()-4))){
dynamicFormInstance.setFieldValueLabel(map1.get(fieldCode.substring(0,fieldCode.length()-4)).toString()); dynamicFormInstance.setFieldValueLabel(map1.get(fieldCode.substring(0,fieldCode.length()-4)).toString());
} }
if ("birthdayTime".equals(dynamicFormInstance.getFieldCode()) && ObjectUtils.isEmpty(peopleInfoDto.getFirefighters().getBirthdayTime())){
dynamicFormInstance.setFieldValue(null);
}
dynamicFormInstancelist.add(dynamicFormInstance); dynamicFormInstancelist.add(dynamicFormInstance);
}); });
......
...@@ -171,6 +171,7 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate ...@@ -171,6 +171,7 @@ public class WaterResourceServiceImpl extends BaseService<WaterResourceDto, Wate
waterResourceNaturalService.createWithModel(waterResourceNaturalDto); waterResourceNaturalService.createWithModel(waterResourceNaturalDto);
break; break;
case "industryPool": case "industryPool":
case "waterTank":
case "pool": case "pool":
// 新增基础信息 // 新增基础信息
model.setIsIot(true); model.setIsIot(true);
......
...@@ -104,9 +104,6 @@ public class ShiftChangeController extends BaseController { ...@@ -104,9 +104,6 @@ public class ShiftChangeController extends BaseController {
public ResponseModel queryForPage( public ResponseModel queryForPage(
@RequestParam(value = "current") int current, @RequestParam(value = "current") int current,
@RequestParam(value = "size") int size) { @RequestParam(value = "size") int size) {
if (current >= 1){
current = (current-1)*size;
}
return ResponseHelper.buildResponse(iShiftChangeService.queryForShiftChangePage(current, size)); return ResponseHelper.buildResponse(iShiftChangeService.queryForShiftChangePage(current, size));
} }
......
...@@ -261,12 +261,20 @@ public class ESAlertCalledService { ...@@ -261,12 +261,20 @@ public class ESAlertCalledService {
boolMustAll.must(qb0); boolMustAll.must(qb0);
} }
//接警时间,距离当前时间不超过48小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 60 * 60 * 1000*48;
BoolQueryBuilder qb9 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
boolMustAll.must(qb9);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//接警时间,距离当前时间不超过半小时的 //接警时间,距离当前时间不超过半小时的
long currentTime = System.currentTimeMillis(); long currentTime2 = System.currentTimeMillis();
currentTime = currentTime - 30 * 60 * 1000; currentTime2 = currentTime2 - 30 * 60 * 1000;
BoolQueryBuilder qb1 = QueryBuilders.boolQuery() BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime)); .must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime2));
boolMust.should(qb1); boolMust.should(qb1);
//报警人及报警电话一致 //报警人及报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) { if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) {
...@@ -404,12 +412,20 @@ public class ESAlertCalledService { ...@@ -404,12 +412,20 @@ public class ESAlertCalledService {
} }
boolMustAll.must(qb0); boolMustAll.must(qb0);
//接警时间,距离当前时间不超过48小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 60 * 60 * 1000*48;
BoolQueryBuilder qb9 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime));
boolMustAll.must(qb9);
BoolQueryBuilder boolMust = QueryBuilders.boolQuery(); BoolQueryBuilder boolMust = QueryBuilders.boolQuery();
//接警时间,距离当前时间不超过半小时的 //接警时间,距离当前时间不超过半小时的
long currentTime = System.currentTimeMillis();
currentTime = currentTime - 30 * 60 * 1000; long currentTime2 = System.currentTimeMillis();
currentTime2 = currentTime2 - 30 * 60 * 1000;
BoolQueryBuilder qb1 = QueryBuilders.boolQuery() BoolQueryBuilder qb1 = QueryBuilders.boolQuery()
.must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime)); .must(QueryBuilders.rangeQuery("callTimeLong").gte(currentTime2));
boolMust.should(qb1); boolMust.should(qb1);
//报警人及报警电话一致 //报警人及报警电话一致
if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) { if (!ValidationUtil.isEmpty(alertCalled.getContactUser()) && !ValidationUtil.isEmpty(alertCalled.getContactPhone())) {
......
...@@ -78,6 +78,7 @@ public class RuleAlertCalledService { ...@@ -78,6 +78,7 @@ public class RuleAlertCalledService {
// 警情 报送类型 // 警情 报送类型
alertCalledRo.setAlertWay(alertWay); alertCalledRo.setAlertWay(alertWay);
alertCalledRo.setCallTimeStr(alertCalledVo.getAlertCalled().getCallTime().toString());
alertCalledRo.setReplaceContent(replaceContent); alertCalledRo.setReplaceContent(replaceContent);
alertCalledRo.setUsIds(usIds); alertCalledRo.setUsIds(usIds);
......
...@@ -4,15 +4,13 @@ import java.io.IOException; ...@@ -4,15 +4,13 @@ import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.nio.charset.StandardCharsets; import java.nio.charset.StandardCharsets;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Comparator; import java.util.*;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.function.Function; import java.util.function.Function;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -98,33 +96,14 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha ...@@ -98,33 +96,14 @@ public class ShiftChangeServiceImpl extends BaseService<ShiftChangeDto, ShiftCha
@Override @Override
public IPage<Map<String, Object>> queryForShiftChangePage(int current, int size) { public IPage<Map<String, Object>> queryForShiftChangePage(int current, int size) {
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE);
LambdaQueryWrapper<ShiftChange> wrapper = new LambdaQueryWrapper<>(); IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE,"");
wrapper.isNull(ShiftChange::getSystemType);
wrapper.eq(BaseEntity::getIsDelete,false);
List<ShiftChange> shiftChanges = this.baseMapper.selectList(wrapper);
Map<Long,ShiftChange> shiftChangeMap = shiftChanges.stream().collect(Collectors.toMap(ShiftChange::getInstanceId, Function.identity()));
page.getRecords().forEach(r->{
//instanceId 必输 所以未进行 null判断
ShiftChange shiftChange = shiftChangeMap.get(Long.parseLong(r.get("instanceId").toString()));
r.putAll(Bean.BeantoMap(shiftChange));
});
return page; return page;
} }
@Override @Override
public IPage<Map<String, Object>> queryForShiftChangePageByAid(int current, int size) { public IPage<Map<String, Object>> queryForShiftChangePageByAid(int current, int size) {
IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE); IPage<Map<String, Object>> page = dynamicFormInstanceService.pageList(current,size,GROUP_CODE,"1214");
LambdaQueryWrapper<ShiftChange> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(ShiftChange::getSystemType,"120");
wrapper.eq(BaseEntity::getIsDelete,false);
List<ShiftChange> shiftChanges = this.baseMapper.selectList(wrapper);
Map<Long,ShiftChange> shiftChangeMap = shiftChanges.stream().collect(Collectors.toMap(ShiftChange::getInstanceId, Function.identity()));
page.getRecords().forEach(r->{
//instanceId 必输 所以未进行 null判断
ShiftChange shiftChange = shiftChangeMap.get(Long.parseLong(r.get("instanceId").toString()));
r.putAll(Bean.BeantoMap(shiftChange));
});
return page; return page;
} }
......
package com.yeejoin.amos.patrol.business.controller; package com.yeejoin.amos.patrol.business.controller;
import java.util.*; import java.util.*;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.patrol.business.dao.mapper.InputItemMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.PointInputItemMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.PointMapper; import com.yeejoin.amos.patrol.business.dao.mapper.PointMapper;
import com.yeejoin.amos.patrol.business.dao.mapper.RoutePointItemMapper;
import com.yeejoin.amos.patrol.business.dao.repository.*; import com.yeejoin.amos.patrol.business.dao.repository.*;
import com.yeejoin.amos.patrol.business.feign.EquipFeign; import com.yeejoin.amos.patrol.business.feign.EquipFeign;
import com.yeejoin.amos.patrol.business.feign.JcsFeignClient; import com.yeejoin.amos.patrol.business.feign.JcsFeignClient;
...@@ -22,6 +26,7 @@ import org.springframework.data.domain.PageImpl; ...@@ -22,6 +26,7 @@ import org.springframework.data.domain.PageImpl;
import org.springframework.http.HttpStatus; import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType; import org.springframework.http.MediaType;
import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Async;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils; import org.springframework.util.ObjectUtils;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.web.bind.annotation.DeleteMapping; import org.springframework.web.bind.annotation.DeleteMapping;
...@@ -104,6 +109,15 @@ public class PointController extends AbstractBaseController { ...@@ -104,6 +109,15 @@ public class PointController extends AbstractBaseController {
@Autowired @Autowired
private IRoutePointItemDao iRoutePointItemDao; private IRoutePointItemDao iRoutePointItemDao;
@Autowired
private InputItemMapper inputItemMapper;
@Autowired
private PointInputItemMapper pointInputItemMapper;
@Autowired
private RoutePointItemMapper routePointItemMapper;
/** /**
* *
* 新增接口 * 新增接口
...@@ -181,7 +195,7 @@ public class PointController extends AbstractBaseController { ...@@ -181,7 +195,7 @@ public class PointController extends AbstractBaseController {
} }
@Transactional
@TycloudOperation(ApiLevel = UserType.AGENCY) @TycloudOperation(ApiLevel = UserType.AGENCY)
@ApiOperation(value = "新增巡查对象", notes = "新增巡查对象") @ApiOperation(value = "新增巡查对象", notes = "新增巡查对象")
@PostMapping(value = "/addPointXcdx", produces = "application/json;charset=UTF-8") @PostMapping(value = "/addPointXcdx", produces = "application/json;charset=UTF-8")
...@@ -191,48 +205,52 @@ public class PointController extends AbstractBaseController { ...@@ -191,48 +205,52 @@ public class PointController extends AbstractBaseController {
List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId()); List<RoutePoint> routePointList = iRoutePointDao.queryByPointId(pointClassify.getPointId());
AgencyUserModel user = getUserInfo(); AgencyUserModel user = getUserInfo();
PointClassify newPointClassify = new PointClassify(); PointClassify newPointClassify = new PointClassify();
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项 newPointClassify.setEquipmentId(pointClassify.getEquipmentId());
if(pointClassify.getId()==null){ newPointClassify.setName(pointClassify.getName());
newPointClassify.setInspectionSpecName(pointClassify.getInspectionName());
newPointClassify.setEquipmentId(pointClassify.getEquipmentId()); newPointClassify.setCreatorId(user.getUserId());
newPointClassify.setName(pointClassify.getName()); newPointClassify.setPointId(pointClassify.getPointId());
newPointClassify.setInspectionSpecName(pointClassify.getInspectionName()); newPointClassify.setOrderNo(0);
newPointClassify.setCreatorId(user.getUserId()); newPointClassify.setDataSourceCode(pointClassify.getDataSourceCode());
newPointClassify.setPointId(pointClassify.getPointId()); newPointClassify.setDataSourceName(pointClassify.getDataSourceName());
newPointClassify.setOrderNo(0); newPointClassify.setAddress(pointClassify.getAddress());
newPointClassify.setDataSourceCode(pointClassify.getDataSourceCode()); newPointClassify.setBuildingId(pointClassify.getBuildingId());
newPointClassify.setDataSourceName(pointClassify.getDataSourceName()); if(pointClassify.getBuildingName()==null){
newPointClassify.setAddress(pointClassify.getAddress()); FeignClientResult responseModel = equipFeign.getBuildingTreeOne(pointClassify.getBuildingId());
newPointClassify.setBuildingId(pointClassify.getBuildingId());
if (ObjectUtils.isEmpty(responseModel.getResult()) || responseModel.getStatus() != HttpStatus.OK.value()) {
if(pointClassify.getBuildingName()==null){ throw new RuntimeException(responseModel.getDevMessage());
FeignClientResult responseModel = equipFeign.getBuildingTreeOne(pointClassify.getBuildingId());
if (ObjectUtils.isEmpty(responseModel.getResult()) || responseModel.getStatus() != HttpStatus.OK.value()) {
throw new RuntimeException(responseModel.getDevMessage());
}else{
Map<String, Object> dat=(Map<String, Object>) responseModel.getResult();
newPointClassify.setBuildingName(dat.get("name").toString());
}
}else{ }else{
newPointClassify.setBuildingName(pointClassify.getBuildingName()); Map<String, Object> dat=(Map<String, Object>) responseModel.getResult();
newPointClassify.setBuildingName(dat.get("name").toString());
} }
}else{
newPointClassify.setBuildingName(pointClassify.getBuildingName());
}
if(pointClassify.getOriginalId()!=null){ if(pointClassify.getOriginalId()!=null){
newPointClassify.setOriginalId(pointClassify.getOriginalId()); newPointClassify.setOriginalId(pointClassify.getOriginalId());
}else{ }else{
String uuid= UUID.randomUUID().toString().replace("-",""); String uuid= UUID.randomUUID().toString().replace("-","");
newPointClassify.setOriginalId(uuid.substring(0,16)); newPointClassify.setOriginalId(uuid.substring(0,16));
} }
newPointClassify.setCategoryCode(pointClassify.getCategoryCode()); if (null != pointClassify.getId()) {
newPointClassify.setCategoryName(pointClassify.getCategoryName()); newPointClassify.setId(pointClassify.getId());
newPointClassify.setCode(pointClassify.getCode()); }
iPointService.addPointClassifyByPointId(newPointClassify); newPointClassify.setCategoryCode(pointClassify.getCategoryCode());
newPointClassify.setCategoryName(pointClassify.getCategoryName());
newPointClassify.setCode(pointClassify.getCode());
List<PointInputItemVo> customInputList = pointClassify.getEquipIputDetailData();//巡检项
iPointService.addPointClassifyByPointId(newPointClassify);
List<PointInputItemVo> oldInputItemList = new ArrayList<>();
List<Long> collect = new ArrayList<>();
if(pointClassify.getId()==null){
pointClassify.setId(newPointClassify.getId());
}else{ }else{
newPointClassify.setId(pointClassify.getId()); newPointClassify.setId(pointClassify.getId());
List<PointInputItemVo> oldInputItemList =iPointService.queryOldPointInputItemNew(pointClassify.getPointId(),pointClassify.getId()); // 新的巡检项的补集,即需要删除的项 oldInputItemList =iPointService.queryOldPointInputItemNew(pointClassify.getPointId(),pointClassify.getId()); // 新的巡检项的补集,即需要删除的项
collect = oldInputItemList.stream().map(PointInputItemVo::getPointItemId).collect(Collectors.toList());
List<PointInputItemVo> newInputItemList = new ArrayList<>(); List<PointInputItemVo> newInputItemList = new ArrayList<>();
List<PointInputItemVo> classList = pointClassify.getEquipIputDetailData(); List<PointInputItemVo> classList = pointClassify.getEquipIputDetailData();
newInputItemList.addAll(classList); newInputItemList.addAll(classList);
...@@ -251,8 +269,9 @@ public class PointController extends AbstractBaseController { ...@@ -251,8 +269,9 @@ public class PointController extends AbstractBaseController {
} }
}); });
if (pItemIds.size() > 0) { if (pItemIds.size() > 0) {
iPointInputItemDao.delPointInputItemById(pItemIds); inputItemMapper.delPointInputItemById(pItemIds);
iRoutePointItemDao.delRoutePointItemByItemId(pItemIds);// 删除p_route_point_item中使用到该项的行 // iPointInputItemDao.delPointInputItemById(pItemIds);
inputItemMapper.delRoutePointItemByItemId(pItemIds);// 删除p_route_point_item中使用到该项的行
} }
} }
...@@ -264,31 +283,36 @@ public class PointController extends AbstractBaseController { ...@@ -264,31 +283,36 @@ public class PointController extends AbstractBaseController {
pointInputItem.setPointId(pointClassify.getPointId()); pointInputItem.setPointId(pointClassify.getPointId());
pointInputItem.setInputItemId(pItemVo.getId()); pointInputItem.setInputItemId(pItemVo.getId());
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString()); pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
pointInputItem.setId(0); // pointInputItem.setId(0);
pointInputItem.setOrderNo(pItemVo.getpOrderNo()); pointInputItem.setOrderNo(pItemVo.getpOrderNo());
PointInputItem pointInputItemResult = iPointInputItemDao.save(pointInputItem); pointInputItemMapper.insert(pointInputItem);
// PointInputItem pointInputItemResult = iPointInputItemDao.save(pointInputItem);
//更新巡检路线 //更新巡检路线
if(routePointList.size()>0){ if(routePointList.size()>0){
Long classifyId=newPointClassify.getId(); Long classifyId=newPointClassify.getId();
for (RoutePoint routePoint :routePointList) { for (RoutePoint routePoint :routePointList) {
RoutePointItem routePointItem = new RoutePointItem(); RoutePointItem routePointItem = new RoutePointItem();
routePointItem.setPointClassifyId(classifyId); routePointItem.setPointClassifyId(classifyId);
routePointItem.setPointInputItemId(pointInputItemResult.getId()); routePointItem.setPointInputItemId(pointInputItem.getId());
routePointItem.setRoutePointId(routePoint.getId()); routePointItem.setRoutePointId(routePoint.getId());
iRoutePointItemDao.save(routePointItem); routePointItemMapper.insert(routePointItem);
// iRoutePointItemDao.save(routePointItem);
}
}
}else {
if (!collect.contains(pItemVo.getPointItemId())) {
pointInputItem.setId(pItemVo.getPointItemId());
pointInputItem.setInputItemId(pItemVo.getId());
pointInputItem.setPointId(pointClassify.getPointId());
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
pointInputItem.setId(pItemVo.getPointItemId());
pointInputItem.setOrderNo(pItemVo.getpOrderNo());
pointInputItemMapper.insert(pointInputItem);
// iPointInputItemDao.save(pointInputItem);
} }
} }
}else{
pointInputItem.setId(pItemVo.getPointItemId());
pointInputItem.setInputItemId(pItemVo.getId());
pointInputItem.setPointId(pointClassify.getPointId());
pointInputItem.setClassifyIds(Long.valueOf(newPointClassify.getId()).toString());
pointInputItem.setId(pItemVo.getPointItemId());
pointInputItem.setOrderNo(pItemVo.getpOrderNo());
iPointInputItemDao.save(pointInputItem);
}
} }
return CommonResponseUtil.success(); return CommonResponseUtil.success(pointClassify);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
log.error(e.getMessage(), e); log.error(e.getMessage(), e);
......
...@@ -4,6 +4,7 @@ import java.util.HashMap; ...@@ -4,6 +4,7 @@ import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.business.vo.PointInputItemVo; import com.yeejoin.amos.patrol.business.vo.PointInputItemVo;
import com.yeejoin.amos.patrol.dao.entity.PointInputItem; import com.yeejoin.amos.patrol.dao.entity.PointInputItem;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
...@@ -15,7 +16,8 @@ import com.yeejoin.amos.patrol.dao.entity.InputItem; ...@@ -15,7 +16,8 @@ import com.yeejoin.amos.patrol.dao.entity.InputItem;
import org.springframework.stereotype.Repository; import org.springframework.stereotype.Repository;
@Repository @Repository
public interface InputItemMapper extends BaseMapper { @Mapper
public interface InputItemMapper extends BaseMapper<InputItem> {
/** /**
* 新接口 * 新接口
...@@ -62,4 +64,8 @@ public interface InputItemMapper extends BaseMapper { ...@@ -62,4 +64,8 @@ public interface InputItemMapper extends BaseMapper {
public List<PointInputItemVo> queryCustomInputItemByPointId(@Param("classifyId") String classifyId ); public List<PointInputItemVo> queryCustomInputItemByPointId(@Param("classifyId") String classifyId );
public PointInputItemVo getInputItemByEquipmentName(@Param("equipmentName") String equipmentName ); public PointInputItemVo getInputItemByEquipmentName(@Param("equipmentName") String equipmentName );
void delPointInputItemById(@Param("ids") List<Long> ids);
void delRoutePointItemByItemId(@Param("ids") List<Long> ids);
} }
package com.yeejoin.amos.patrol.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.dao.entity.PointInputItem;
import org.apache.ibatis.annotations.Mapper;
@Mapper
public interface PointInputItemMapper extends BaseMapper<PointInputItem> {
}
package com.yeejoin.amos.patrol.business.dao.mapper; package com.yeejoin.amos.patrol.business.dao.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yeejoin.amos.patrol.dao.entity.RoutePointItem; import com.yeejoin.amos.patrol.dao.entity.RoutePointItem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
public interface RoutePointItemMapper extends BaseMapper{ @Mapper
public interface RoutePointItemMapper extends BaseMapper<RoutePointItem> {
public void updateRoutePointItem( RoutePointItem pointItem); public void updateRoutePointItem( RoutePointItem pointItem);
......
...@@ -137,7 +137,7 @@ public class PointServiceImpl implements IPointService { ...@@ -137,7 +137,7 @@ public class PointServiceImpl implements IPointService {
@Override @Override
public void addPointClassifyByPointId(PointClassify pointClassify) { public void addPointClassifyByPointId(PointClassify pointClassify) {
iPointClassifyDao.save(pointClassify); iPointClassifyDao.saveAndFlush(pointClassify);
} }
......
...@@ -4,6 +4,7 @@ package com.yeejoin.amos.supervision.business.dao.mapper; ...@@ -4,6 +4,7 @@ package com.yeejoin.amos.supervision.business.dao.mapper;
import com.yeejoin.amos.supervision.business.param.InputItemPageParam; import com.yeejoin.amos.supervision.business.param.InputItemPageParam;
import com.yeejoin.amos.supervision.business.vo.RoutePointItemVo; import com.yeejoin.amos.supervision.business.vo.RoutePointItemVo;
import com.yeejoin.amos.supervision.dao.entity.RoutePointItem; import com.yeejoin.amos.supervision.dao.entity.RoutePointItem;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
......
...@@ -359,7 +359,7 @@ ...@@ -359,7 +359,7 @@
<select id="pageBuildingVideoList" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO"> <select id="pageBuildingVideoList" resultType="com.yeejoin.equipmanage.common.entity.vo.BuildingVideoVO">
select a.* from ( select a.* from (
<if test="dto.buildingId!=null and dto.buildingId!=''">
SELECT SELECT
v.id AS id, v.id AS id,
v.name AS name, v.name AS name,
...@@ -372,7 +372,7 @@ ...@@ -372,7 +372,7 @@
<choose> <choose>
<when test="dto.buildingId!=null and dto.buildingId!=''"> <when test="dto.buildingId!=null and dto.buildingId!=''">
JOIN wl_video_source vc ON vc.video_id = v.id JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id JOIN wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE WHERE
FIND_IN_SET(#{dto.buildingId}, vc.parent_source_ids) FIND_IN_SET(#{dto.buildingId}, vc.parent_source_ids)
<if test="dto.equipmentName!=null and dto.equipmentName!=''"> <if test="dto.equipmentName!=null and dto.equipmentName!=''">
...@@ -387,6 +387,9 @@ ...@@ -387,6 +387,9 @@
<if test="dto.type!=null and dto.type!=''"> <if test="dto.type!=null and dto.type!=''">
and v.type = #{dto.type} and v.type = #{dto.type}
</if> </if>
<if test="dto.bizOrgCode!=null and dto.bizOrgCode!=''">
and v.biz_org_code LIKE CONCAT(#{dto.bizOrgCode}, '%')
</if>
GROUP BY id GROUP BY id
</when> </when>
<when test='dto.buildingId == null || dto.buildingId ==""'> <when test='dto.buildingId == null || dto.buildingId ==""'>
...@@ -410,37 +413,36 @@ ...@@ -410,37 +413,36 @@
GROUP BY id GROUP BY id
</when> </when>
</choose> </choose>
UNION
</if>
SELECT
v.id AS id,
v.name AS name,
v.token AS token,
v.url AS url,
v.code AS code,
v.address,
v.preset_position as presetPosition
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids)
<if test="dto.code!=null and dto.code!=''">
and v.code like concat('%',#{dto.code},'%')
</if>
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%')
</if>
<if test=" dto.ip!=null and dto.ip!=''">
and v.ip like concat('%',#{dto.ip},'%')
</if>
<if test="dto.type!=null and dto.type!=''">
and v.type =#{dto.type}
</if>
GROUP BY id
) AS a limit #{current},#{size} ) AS a limit #{current},#{size}
</select> </select>
<!-- UNION
SELECT
v.id AS id,
v.name AS name,
v.token AS token,
v.url AS url,
v.code AS code,
v.address,
v.preset_position as presetPosition
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids)
<if test="dto.code!=null and dto.code!=''">
and v.code like concat('%',#{dto.code},'%')
</if>
<if test="dto.equipmentName!=null and dto.equipmentName!=''">
and v.name like concat('%',#{dto.equipmentName},'%')
</if>
<if test=" dto.ip!=null and dto.ip!=''">
and v.ip like concat('%',#{dto.ip},'%')
</if>
<if test="dto.type!=null and dto.type!=''">
and v.type =#{dto.type}
</if>
GROUP BY id
) AS a limit #{current},#{size}-->
<select id="pageBuildingVideoCount" resultType="int"> <select id="pageBuildingVideoCount" resultType="int">
select count(a.id) from ( select count(a.id) from (
<if test="dto.buildingId!=null and dto.buildingId!=''"> <if test="dto.buildingId!=null and dto.buildingId!=''">
...@@ -530,8 +532,29 @@ ...@@ -530,8 +532,29 @@
a.* a.*
FROM FROM
( (
<if test='par.longitude!=null and par.latitude!=null '> <if test="par.buildingId!=null and par.buildingId!=''">
SELECT SELECT
v.id AS id,
v.name AS name,
v.token AS token,
v.url AS url,
v.code AS code,
v.address,
'' as distance,
v.longitude,
v.latitude
FROM wl_video v
JOIN wl_video_source vc ON vc.video_id = v.id
join wl_form_instance wfl on wfl.instance_id = vc.source_id
WHERE
FIND_IN_SET(#{par.buildingId}, vc.parent_source_ids)
GROUP BY id
</if>
<if test='par.longitude!=null and par.buildingId!=null '>
UNION ALL
</if>
<if test='par.longitude!=null and par.latitude!=null '>
(SELECT
wle.id , wle.id ,
wle.`code` , wle.`code` ,
wle.url, wle.url,
...@@ -556,12 +579,14 @@ ...@@ -556,12 +579,14 @@
<if test='par.code!=null and par.code!="" '> <if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%') wle.code like concat ('%',#{par.code},'%')
</if> </if>
ORDER BY
distance DESC)
</if> </if>
<if test="par.longitudeTwo != null and par.longitude != null"> <if test="par.longitudeTwo != null and par.longitude != null">
UNION UNION
</if> </if>
<if test='par.longitudeTwo !=null and par.latitudeTwo !=null '> <if test='par.longitudeTwo !=null and par.latitudeTwo !=null '>
SELECT (SELECT
wle.id, wle.id,
wle.`code`, wle.`code`,
wle.url, wle.url,
...@@ -584,14 +609,16 @@ ...@@ -584,14 +609,16 @@
&lt;= #{par.distance} &lt;= #{par.distance}
</if> </if>
<if test='par.type!=null and par.type!="" '> <if test='par.type!=null and par.type!="" '>
wle.type = #{par.type} AND wle.type = #{par.type}
</if> </if>
<if test='par.remark!=null and par.remark!="" '> <if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remark},'%') AND wle.remake like concat ('%',#{par.remark},'%')
</if> </if>
<if test='par.code!=null and par.code!="" '> <if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%') AND wle.code like concat ('%',#{par.code},'%')
</if> </if>
ORDER BY
distance DESC)
</if> </if>
union union
SELECT SELECT
...@@ -610,7 +637,7 @@ ...@@ -610,7 +637,7 @@
WHERE WHERE
FIND_IN_SET(#{deptId}, vc.parent_source_ids) FIND_IN_SET(#{deptId}, vc.parent_source_ids)
GROUP BY id GROUP BY id
) AS a ORDER BY a.distance desc limit #{pageNum},#{pageSize} ) AS a limit #{pageNum},#{pageSize}
</select> </select>
...@@ -637,13 +664,13 @@ ...@@ -637,13 +664,13 @@
&lt;= #{par.distance} &lt;= #{par.distance}
</if> </if>
<if test='par.type!=null and par.type!="" '> <if test='par.type!=null and par.type!="" '>
wle.type = #{type} AND wle.type = #{type}
</if> </if>
<if test='par.remark!=null and par.remark!="" '> <if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remake},'%') AND wle.remake like concat ('%',#{par.remake},'%')
</if> </if>
<if test='par.code!=null and par.code!="" '> <if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%') AND wle.code like concat ('%',#{par.code},'%')
</if> </if>
</if> </if>
<if test="par.longitudeTwo != null and par.longitude != null"> <if test="par.longitudeTwo != null and par.longitude != null">
...@@ -674,13 +701,13 @@ ...@@ -674,13 +701,13 @@
&lt;= #{par.distance} &lt;= #{par.distance}
</if> </if>
<if test='par.type!=null and par.type!="" '> <if test='par.type!=null and par.type!="" '>
wle.type = #{par.type} AND wle.type = #{par.type}
</if> </if>
<if test='par.remark!=null and par.remark!="" '> <if test='par.remark!=null and par.remark!="" '>
wle.remake like concat ('%',#{par.remark},'%') AND wle.remake like concat ('%',#{par.remark},'%')
</if> </if>
<if test='par.code!=null and par.code!="" '> <if test='par.code!=null and par.code!="" '>
wle.code like concat ('%',#{par.code},'%') AND wle.code like concat ('%',#{par.code},'%')
</if> </if>
</if> </if>
union union
......
...@@ -446,4 +446,19 @@ ...@@ -446,4 +446,19 @@
<select id="getAllCategoryName" resultType="java.util.Map"> <select id="getAllCategoryName" resultType="java.util.Map">
select code, `name` from wl_equipment_category select code, `name` from wl_equipment_category
</select> </select>
<delete id="delPointInputItemById">
DELETE FROM p_point_inputitem WHERE id IN
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
<delete id="delRoutePointItemByItemId">
DELETE FROM p_route_point_item WHERE point_input_item_id IN
<foreach collection="ids" item="item" index="index" separator="," open="(" close=")">
#{item}
</foreach>
</delete>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment