Commit 89342b18 authored by tianyiming's avatar tianyiming

1、96333警情填报-填报

2、96333警情填报-报送
parent 51c5b9e7
...@@ -225,7 +225,7 @@ public class AlertCalled extends BaseEntity { ...@@ -225,7 +225,7 @@ public class AlertCalled extends BaseEntity {
@TableField("equipment_id") @TableField("equipment_id")
@ApiModelProperty(value = "设备id") @ApiModelProperty(value = "设备id")
private Long equipmentId; private String equipmentId;
@TableField(exist=false) @TableField(exist=false)
......
...@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param; ...@@ -8,6 +8,7 @@ import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select; import org.apache.ibatis.annotations.Select;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* Mapper 接口 * Mapper 接口
...@@ -34,4 +35,6 @@ public interface ElevatorMapper extends BaseMapper<Elevator> { ...@@ -34,4 +35,6 @@ public interface ElevatorMapper extends BaseMapper<Elevator> {
List<ElevatorDto> selectExportData(@Param("ids") List<String> ids); List<ElevatorDto> selectExportData(@Param("ids") List<String> ids);
@Select("select * from tcb_elevator where address like concat('%',#{address},'%')") @Select("select * from tcb_elevator where address like concat('%',#{address},'%')")
List<ElevatorDto> getAddressList(String address); List<ElevatorDto> getAddressList(String address);
Map<String,Object> selectElevatorList(@Param("elevator") Elevator elevator);
} }
...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.elevator.api.dto.ElevatorDto; ...@@ -5,6 +5,7 @@ import com.yeejoin.amos.boot.module.elevator.api.dto.ElevatorDto;
import com.yeejoin.amos.boot.module.elevator.api.entity.Elevator; import com.yeejoin.amos.boot.module.elevator.api.entity.Elevator;
import java.util.List; import java.util.List;
import java.util.Map;
/** /**
* 服务类 * 服务类
...@@ -28,4 +29,6 @@ public interface IElevatorService extends IService<Elevator> { ...@@ -28,4 +29,6 @@ public interface IElevatorService extends IService<Elevator> {
String saveElevatorQrCode(Long elevatorId); String saveElevatorQrCode(Long elevatorId);
List<ElevatorDto> selectExportData(String exportId); List<ElevatorDto> selectExportData(String exportId);
Map<String,Object> selectElevatorList(Elevator elevator);
} }
...@@ -94,4 +94,30 @@ ...@@ -94,4 +94,30 @@
</if> </if>
</select> </select>
<select id="selectElevatorList" resultType="java.util.Map">
SELECT
jui.RECORD AS sequenceNbr,
ifnull ( joi.CODE96333, '' ) AS rescueCode,
ifnull ( jri.EQU_CODE, '' ) AS registerCode,
ifnull ( jui.USE_UNIT_NAME, '' ) AS useUnit,
ifnull ( jui.EQU_STATE,'')AS useStatus,
ifnull ( ( SELECT NAME FROM cb_data_dictionary WHERE code = jui.USE_PLACE and type = 'ADDRESS' ), '' ) AS useSiteCategory,
ifnull ( jui.ADDRESS, '' ) AS address,
ifnull ( jui.PROVINCE_NAME, '' ) AS province,
ifnull ( jui.CITY_NAME, '' ) AS city,
ifnull ( jui.COUNTY_NAME, '' ) AS district,
concat(jui.PROVINCE, '#',jui.CITY, '#',jui.COUNTY) AS regionCode
FROM
idx_biz_jg_use_info jui
LEFT JOIN idx_biz_jg_other_info joi ON jui.RECORD = joi.RECORD
LEFT JOIN idx_biz_jg_register_info jri ON jri.RECORD = jui.RECORD
WHERE
jri.EQU_LIST = '3000'
<if test="elevator.rescueCode!=null and elevator.rescueCode!='' ">
AND joi.CODE96333 = #{elevator.rescueCode}
</if>
<if test="elevator.registerCode!=null and elevator.registerCode!='' ">
AND jri.EQU_CODE = #{elevator.registerCode}
</if>
</select>
</mapper> </mapper>
...@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.elevator.biz.utils.BeanDtoVoUtils; ...@@ -26,6 +26,7 @@ import com.yeejoin.amos.boot.module.elevator.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.eclipse.paho.client.mqttv3.MqttException; import org.eclipse.paho.client.mqttv3.MqttException;
import org.slf4j.Logger; import org.slf4j.Logger;
...@@ -125,8 +126,10 @@ public class AlertCalledController extends BaseController { ...@@ -125,8 +126,10 @@ public class AlertCalledController extends BaseController {
LambdaQueryWrapper<Elevator> queryWrapper = new LambdaQueryWrapper<>(); LambdaQueryWrapper<Elevator> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(Elevator::getRescueCode,alertCalledObjsDto.getAlertCalledDto().getDeviceId()); queryWrapper.eq(Elevator::getRescueCode,alertCalledObjsDto.getAlertCalledDto().getDeviceId());
Elevator elevator = iElevatorService.getOne(queryWrapper); Elevator elevator = new Elevator();
if(elevator == null) { elevator.setRescueCode(Integer.valueOf(alertCalledObjsDto.getAlertCalledDto().getDeviceId()));
Map<String,Object> map = iElevatorService.selectElevatorList(elevator);
if(ObjectUtils.isEmpty(map)) {
throw new BadRequest("未找到相关电梯."); throw new BadRequest("未找到相关电梯.");
} }
......
...@@ -217,47 +217,50 @@ public class ElevatorController extends BaseController { ...@@ -217,47 +217,50 @@ public class ElevatorController extends BaseController {
@TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = false, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/page/similar", method = RequestMethod.POST) @RequestMapping(value = "/page/similar", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "相似电梯模糊查询", notes = "相似电梯模糊查询") @ApiOperation(httpMethod = "POST", value = "相似电梯模糊查询", notes = "相似电梯模糊查询")
public ResponseModel<List<ElevatorDto>> similar(@RequestBody ElevatorNewDto elevatorNewDto) { public ResponseModel<List<Map<String,Object>>> similar(@RequestBody ElevatorNewDto elevatorNewDto) {
Elevator elevator = BeanDtoVoUtils.convert(elevatorNewDto.getElevatorDto(), Elevator.class); Elevator elevator = BeanDtoVoUtils.convert(elevatorNewDto.getElevatorDto(), Elevator.class);
QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>(); // QueryWrapper<Elevator> elevatorQueryWrapper = new QueryWrapper<>();
Class<? extends Elevator> aClass = elevator.getClass(); // Class<? extends Elevator> aClass = elevator.getClass();
Arrays.stream(aClass.getDeclaredFields()).forEach(field -> { // Arrays.stream(aClass.getDeclaredFields()).forEach(field -> {
try { // try {
field.setAccessible(true); // field.setAccessible(true);
Object o = field.get(elevator); // Object o = field.get(elevator);
if (o != null) { // if (o != null) {
String name = NameUtils.camel2Underline(field.getName()); // String name = NameUtils.camel2Underline(field.getName());
if ("rescue_code".equalsIgnoreCase(name)) { // if ("rescue_code".equalsIgnoreCase(name)) {
Integer fileValue = (Integer) o; // Integer fileValue = (Integer) o;
elevatorQueryWrapper.like(name, fileValue); // elevatorQueryWrapper.like(name, fileValue);
} else if ("city".equalsIgnoreCase(name) || "district".equalsIgnoreCase(name)) { // } else if ("city".equalsIgnoreCase(name) || "district".equalsIgnoreCase(name)) {
String fileValue = (String) o; // String fileValue = (String) o;
elevatorQueryWrapper.eq(name, fileValue); // elevatorQueryWrapper.eq(name, fileValue);
} else { // } else {
String fileValue = (String) o; // String fileValue = (String) o;
elevatorQueryWrapper.like(name, fileValue); // elevatorQueryWrapper.like(name, fileValue);
} // }
} // }
} catch (Exception e) { // } catch (Exception e) {
logger.error(e.getMessage()); // logger.error(e.getMessage());
} // }
}); // });
List<Elevator> elevators = iElevatorService.list(elevatorQueryWrapper); // List<Elevator> elevators = iElevatorService.list(elevatorQueryWrapper);
List<ElevatorDto> elevatorDtoList = new ArrayList<>(); Map<String,Object> map = iElevatorService.selectElevatorList(elevator);
for (Elevator ele : elevators ) { // List<ElevatorDto> elevatorDtoList = new ArrayList<>();
ElevatorDto eleDto = new ElevatorDto(); // for (Elevator ele : elevators ) {
BeanUtils.copyProperties(ele,eleDto); // ElevatorDto eleDto = new ElevatorDto();
if(!ValidationUtil.isEmpty(eleDto.getUseSiteCategory())) { // BeanUtils.copyProperties(ele,eleDto);
LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>(); // if(!ValidationUtil.isEmpty(eleDto.getUseSiteCategory())) {
wrapper.eq(DataDictionary::getCode, eleDto.getUseSiteCategory()); // LambdaQueryWrapper<DataDictionary> wrapper = new LambdaQueryWrapper<>();
DataDictionary dataDictionary = iDataDictionaryService.getOne(wrapper); // wrapper.eq(DataDictionary::getCode, eleDto.getUseSiteCategory());
if (!ValidationUtil.isEmpty(dataDictionary)) { // DataDictionary dataDictionary = iDataDictionaryService.getOne(wrapper);
eleDto.setUseSiteCategory(dataDictionary.getName()); // if (!ValidationUtil.isEmpty(dataDictionary)) {
} // eleDto.setUseSiteCategory(dataDictionary.getName());
} // }
elevatorDtoList.add(eleDto); // }
} // elevatorDtoList.add(eleDto);
return ResponseHelper.buildResponse(elevatorDtoList); // }
List<Map<String,Object>> list = new ArrayList<>();
list.add(map);
return ResponseHelper.buildResponse(list);
} }
/** /**
......
...@@ -27,6 +27,7 @@ import com.yeejoin.amos.boot.module.elevator.api.service.TzsAuthService; ...@@ -27,6 +27,7 @@ import com.yeejoin.amos.boot.module.elevator.api.service.TzsAuthService;
import com.yeejoin.amos.boot.module.elevator.biz.utils.BeanDtoVoUtils; import com.yeejoin.amos.boot.module.elevator.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang.text.StrBuilder; import org.apache.commons.lang.text.StrBuilder;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -534,13 +535,17 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -534,13 +535,17 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
alertCalled.setAlertStageCode(AlertStageEnums.JJ.getId()); alertCalled.setAlertStageCode(AlertStageEnums.JJ.getId());
alertCalled.setType(AlertStageEnums.JQCB.getValue()); alertCalled.setType(AlertStageEnums.JQCB.getValue());
alertCalled.setTypeCode(AlertStageEnums.JQCB.getId()); alertCalled.setTypeCode(AlertStageEnums.JQCB.getId());
LambdaQueryWrapper<Elevator> queryWrapper = new LambdaQueryWrapper<>(); Elevator elevator = new Elevator();
queryWrapper.eq(Elevator::getRescueCode,alertCalled.getDeviceId()); elevator.setRescueCode(Integer.valueOf(alertCalledObjsDto.getAlertCalledDto().getDeviceId()));
Elevator elevator = iElevatorService.getOne(queryWrapper); Map<String,Object> map = iElevatorService.selectElevatorList(elevator);
alertCalled.setEquipmentId(elevator.getSequenceNbr()); if(!ObjectUtils.isEmpty(map)){
alertCalled.setCity(elevator.getCity()); alertCalled.setEquipmentId(map.get("sequenceNbr").toString());
alertCalled.setDistrict(elevator.getDistrict()); alertCalled.setCity(map.get("city").toString());
alertCalled.setRegionCode(elevator.getRegionCode()); alertCalled.setDistrict(map.get("district").toString());
alertCalled.setRegionCode(map.get("regionCode").toString());
}
this.save(alertCalled); this.save(alertCalled);
// 动态表单 // 动态表单
......
...@@ -160,12 +160,12 @@ public class ESElevatorServiceImpl { ...@@ -160,12 +160,12 @@ public class ESElevatorServiceImpl {
queryWrapper.le(AlertCalled::getCallTime, DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN)); queryWrapper.le(AlertCalled::getCallTime, DateUtils.stampToDate(DateUtils.dateAddDays(new Date(),1).getTime(),DateUtils.DATE_PATTERN));
} }
alertCalleds = iAlertCalledService.list(queryWrapper); alertCalleds = iAlertCalledService.list(queryWrapper);
List<Long> stringList = new ArrayList<>(); List<String> stringList = new ArrayList<>();
for (AlertCalled al: alertCalleds for (AlertCalled al: alertCalleds
) { ) {
stringList.add(al.getEquipmentId()); stringList.add(al.getEquipmentId());
} }
List<Long> listL = stringList.stream().distinct().collect(Collectors.toList()); List<String> listL = stringList.stream().distinct().collect(Collectors.toList());
qb0.should(QueryBuilders.termsQuery("sequenceNbr", listL.toArray())); qb0.should(QueryBuilders.termsQuery("sequenceNbr", listL.toArray()));
boolMust.must(qb0); boolMust.must(qb0);
} }
......
...@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.elevator.api.entity.Elevator; ...@@ -18,6 +18,7 @@ import com.yeejoin.amos.boot.module.elevator.api.entity.Elevator;
import com.yeejoin.amos.boot.module.elevator.api.entity.ElevatorInsure; import com.yeejoin.amos.boot.module.elevator.api.entity.ElevatorInsure;
import com.yeejoin.amos.boot.module.elevator.api.entity.ElevatorInsureRelation; import com.yeejoin.amos.boot.module.elevator.api.entity.ElevatorInsureRelation;
import com.yeejoin.amos.boot.module.elevator.api.entity.EquipmentCategory; import com.yeejoin.amos.boot.module.elevator.api.entity.EquipmentCategory;
import com.yeejoin.amos.boot.module.elevator.api.enums.EquimentEnum;
import com.yeejoin.amos.boot.module.elevator.api.enums.TzsCommonParam; import com.yeejoin.amos.boot.module.elevator.api.enums.TzsCommonParam;
import com.yeejoin.amos.boot.module.elevator.api.mapper.ElevatorMapper; import com.yeejoin.amos.boot.module.elevator.api.mapper.ElevatorMapper;
import com.yeejoin.amos.boot.module.elevator.api.service.IElevatorInsureRelationService; import com.yeejoin.amos.boot.module.elevator.api.service.IElevatorInsureRelationService;
...@@ -30,6 +31,7 @@ import org.apache.logging.log4j.Logger; ...@@ -30,6 +31,7 @@ import org.apache.logging.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mock.web.MockMultipartFile; import org.springframework.mock.web.MockMultipartFile;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.util.ObjectUtils;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.typroject.tyboot.core.foundation.utils.ValidationUtil; import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
...@@ -72,6 +74,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev ...@@ -72,6 +74,8 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
@Autowired @Autowired
ElevatorInsureServiceImpl iElevatorInsureServiceImpl; ElevatorInsureServiceImpl iElevatorInsureServiceImpl;
//一码通设备使用场所字典type
private static final String ADDRESS = "ADDRESS";
/** /**
* 保存电梯信息 * 保存电梯信息
...@@ -226,6 +230,12 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev ...@@ -226,6 +230,12 @@ public class ElevatorServiceImpl extends BaseService<ElevatorDto, Elevator, Elev
} }
@Override
public Map<String,Object> selectElevatorList(Elevator elevator) {
return elevatorMapper.selectElevatorList(elevator);
}
public List<ElevatorWlInfoDto> queryElevatorList(ElevatorWlInfoDto esElevatorDto) { public List<ElevatorWlInfoDto> queryElevatorList(ElevatorWlInfoDto esElevatorDto) {
return elevatorMapper.queryElevatorList(esElevatorDto.getAddress(), return elevatorMapper.queryElevatorList(esElevatorDto.getAddress(),
esElevatorDto.getRegisterCode(),esElevatorDto.getRescueCode(), esElevatorDto.getRegisterCode(),esElevatorDto.getRescueCode(),
......
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