Commit 524d5d73 authored by chenzhao's avatar chenzhao

任务反馈接口开发

parent a062db1f
...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.command.api.dto; ...@@ -2,6 +2,8 @@ package com.yeejoin.amos.boot.module.command.api.dto;
import org.springframework.web.bind.annotation.PathVariable; import org.springframework.web.bind.annotation.PathVariable;
import java.util.List;
/** /**
* @description: * @description:
* @author: tw * @author: tw
...@@ -15,6 +17,16 @@ public class CarTaskDto { ...@@ -15,6 +17,16 @@ public class CarTaskDto {
private int type; private int type;
private String remarks; private String remarks;
public List<String> getPhotos() {
return photos;
}
public void setPhotos(List<String> photos) {
this.photos = photos;
}
private List<String> photos;
public Long getCarid() { public Long getCarid() {
return carid; return carid;
} }
......
...@@ -29,4 +29,8 @@ public class JcSituationDetail extends BaseEntity { ...@@ -29,4 +29,8 @@ public class JcSituationDetail extends BaseEntity {
@ApiModelProperty(value = "警情ID") @ApiModelProperty(value = "警情ID")
private Long alertCalledId; private Long alertCalledId;
@ApiModelProperty(value = "图片")
@TableField(exist = false)
private List<String> photoUrl;
} }
package com.yeejoin.amos.boot.module.jcs.api.service; package com.yeejoin.amos.boot.module.jcs.api.service;
import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.jcs.api.entity.AlertCalled;
import com.yeejoin.amos.boot.module.jcs.api.entity.JcSituationDetail;
import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources; import com.yeejoin.amos.boot.module.jcs.api.entity.PowerTransferCompanyResources;
import java.util.List;
/** /**
* 调派单位资源 服务类 * 调派单位资源 服务类
* *
...@@ -19,7 +22,9 @@ public interface IPowerTransferCompanyResourcesService { ...@@ -19,7 +22,9 @@ public interface IPowerTransferCompanyResourcesService {
void updateByAlertCalledId(Long alertCalledId); void updateByAlertCalledId(Long alertCalledId);
void updatePowerTransferCompanyResourcesService(Long alertCalledId, Long carId, String code, int type, String remarks); void updatePowerTransferCompanyResourcesService(Long alertCalledId, Long carId, String code, int type, String remarks, List<String> photos);
List<JcSituationDetail> getTaskFeedback(Long carid, Long alertCalledId);
/** /**
* 根据ID获取资源信息 * 根据ID获取资源信息
......
...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.command.biz.controller; ...@@ -3,6 +3,7 @@ package com.yeejoin.amos.boot.module.command.biz.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.metadata.OrderItem; import com.baomidou.mybatisplus.core.metadata.OrderItem;
...@@ -162,7 +163,6 @@ public class CommandController extends BaseController { ...@@ -162,7 +163,6 @@ public class CommandController extends BaseController {
private static final String JW = "mechinePosition"; private static final String JW = "mechinePosition";
private static final String KEYSITE = "keySiteExcle"; private static final String KEYSITE = "keySiteExcle";
private OrgUsrMapper orgUsrMapper;
/** /**
...@@ -1575,6 +1575,18 @@ public class CommandController extends BaseController { ...@@ -1575,6 +1575,18 @@ public class CommandController extends BaseController {
return ResponseHelper.buildResponse(powerTransferCompanyResources); return ResponseHelper.buildResponse(powerTransferCompanyResources);
} }
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "getTaskFeedback/{carid}/{alertCalledId}", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
@ApiOperation(httpMethod = "GET", value = "获取当前车辆任务反馈", notes = "获取当前车辆任务反馈")
public ResponseModel<List<JcSituationDetail>> getTaskFeedback(@PathVariable Long carid,
@PathVariable Long alertCalledId) {
return ResponseHelper.buildResponse(powerTransferCompanyResourcesService.getTaskFeedback(carid,alertCalledId));
}
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY) @TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "getPowerTransferCompanyResourcesServiceNew", produces = "application/json;charset=UTF-8", method = RequestMethod.GET) @RequestMapping(value = "getPowerTransferCompanyResourcesServiceNew", produces = "application/json;charset=UTF-8", method = RequestMethod.GET)
...@@ -1660,7 +1672,7 @@ public class CommandController extends BaseController { ...@@ -1660,7 +1672,7 @@ public class CommandController extends BaseController {
carTaskDto.getCarid(), carTaskDto.getCarid(),
carTaskDto.getCode(), carTaskDto.getCode(),
carTaskDto.getType(), carTaskDto.getType(),
carTaskDto.getRemarks()); carTaskDto.getRemarks(),carTaskDto.getPhotos());
ReginParams reginParams = getSelectedOrgInfo(); ReginParams reginParams = getSelectedOrgInfo();
String userId = reginParams.getUserModel().getUserId(); String userId = reginParams.getUserModel().getUserId();
......
...@@ -1476,6 +1476,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al ...@@ -1476,6 +1476,16 @@ public class AlertSubmittedServiceImpl extends BaseService<AlertSubmittedDto, Al
instructionsZHDto.setType(item.getInfoType()); instructionsZHDto.setType(item.getInfoType());
instructionsZHDto.setContent(item.getInfo()); instructionsZHDto.setContent(item.getInfo());
if ("车辆反馈".equals(item.getInfoType())) { if ("车辆反馈".equals(item.getInfoType())) {
if (item.getInfo().contains("/photo:")){
String[] info = item.getInfo().split("/photos:");
String photoUrl = info[1];
StringBuffer stringBuffer = new StringBuffer();
if (photoUrl.contains(",")){
List<String> list = Arrays.asList(photoUrl.split(","));
list.forEach(photo-> stringBuffer .append("<img src=\""+photo+"\""+"width=\""+"251\""+"height=\""+"251\""+"/>"));
instructionsZHDto.setContent("<div>"+info[0]+stringBuffer+"</div>");
}
}
instructionsZHDto.setCompany("现场反馈"); instructionsZHDto.setCompany("现场反馈");
} }
instructionsZHDto.setSubmissionTime(item.getRecDate()); instructionsZHDto.setSubmissionTime(item.getRecDate());
......
package com.yeejoin.amos.boot.module.jcs.biz.service.impl; package com.yeejoin.amos.boot.module.jcs.biz.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.xiaoymin.knife4j.core.util.StrUtil; import com.github.xiaoymin.knife4j.core.util.StrUtil;
import com.google.common.base.Joiner;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.common.api.entity.FireTeam; import com.yeejoin.amos.boot.module.common.api.entity.FireTeam;
import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient; import com.yeejoin.amos.boot.module.common.api.feign.EquipFeignClient;
import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService; import com.yeejoin.amos.boot.module.common.api.service.IFireTeamService;
...@@ -17,6 +20,7 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResources ...@@ -17,6 +20,7 @@ import com.yeejoin.amos.boot.module.jcs.api.mapper.PowerTransferCompanyResources
import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyResourcesService; import com.yeejoin.amos.boot.module.jcs.api.service.IPowerTransferCompanyResourcesService;
import com.yeejoin.amos.boot.module.jcs.api.service.IUserCarService; import com.yeejoin.amos.boot.module.jcs.api.service.IUserCarService;
import com.yeejoin.amos.component.rule.config.RuleConfig; import com.yeejoin.amos.component.rule.config.RuleConfig;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -26,10 +30,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService; ...@@ -26,10 +30,7 @@ import org.typroject.tyboot.core.rdbms.service.BaseService;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/** /**
* 调派单位资源 服务实现类 * 调派单位资源 服务实现类
...@@ -86,7 +87,7 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT ...@@ -86,7 +87,7 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
@Override @Override
@Transactional @Transactional
public void updatePowerTransferCompanyResourcesService(Long alertCalledId, Long carId, String code, int type, String remarks) { public void updatePowerTransferCompanyResourcesService(Long alertCalledId, Long carId, String code, int type, String remarks,List<String> photos) {
PowerTransferCompanyResources powerTransferCompanyResources = powerTransferCompanyResourcesMapper.getByAlertCalledIdCarId(alertCalledId, carId); PowerTransferCompanyResources powerTransferCompanyResources = powerTransferCompanyResourcesMapper.getByAlertCalledIdCarId(alertCalledId, carId);
UserCar userCar = userCarService.selectByCarId(carId); UserCar userCar = userCarService.selectByCarId(carId);
...@@ -94,12 +95,9 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT ...@@ -94,12 +95,9 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
try { try {
if (type == 2) { if (type == 2) {
powerTransferCompanyResources.setStatus(code); powerTransferCompanyResources.setStatus(code);
powerTransferCompanyResources.setRemarks(remarks); powerTransferCompanyResources.setRemarks(remarks);
powerTransferCompanyResourcesMapper.updateById(powerTransferCompanyResources); powerTransferCompanyResourcesMapper.updateById(powerTransferCompanyResources);
if("finished".equals(code)){ if("finished".equals(code)){
List<Object> carStatusInfoDtoList = new ArrayList(); List<Object> carStatusInfoDtoList = new ArrayList();
//修改装备信息 //修改装备信息
...@@ -110,9 +108,6 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT ...@@ -110,9 +108,6 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
// 更新所有车辆状态为执勤 // 更新所有车辆状态为执勤
equipFeignClient.updateCarStatus(carStatusInfoDtoList); equipFeignClient.updateCarStatus(carStatusInfoDtoList);
} }
} else { } else {
if (FireCarStatusEnum.到场.getCode().equals(code)){ if (FireCarStatusEnum.到场.getCode().equals(code)){
SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
...@@ -129,6 +124,9 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT ...@@ -129,6 +124,9 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
jcSituationDetail.setAlertCalledId(alertCalledId); jcSituationDetail.setAlertCalledId(alertCalledId);
jcSituationDetail.setInfoType("车辆反馈"); jcSituationDetail.setInfoType("车辆反馈");
jcSituationDetail.setInfo(info); jcSituationDetail.setInfo(info);
if (CollectionUtils.isNotEmpty(photos)){
jcSituationDetail.setInfo(info+"/photos:"+Joiner.on(",").join(photos));
}
jcSituationDetailMapper.insert(jcSituationDetail); jcSituationDetailMapper.insert(jcSituationDetail);
// 车辆状态更改消息推送 // 车辆状态更改消息推送
// 定义指令信息消息推送 页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化 // 定义指令信息消息推送 页面发送mqtt 默认发送 String 类型 0, 新警情 1 警情状态变化
...@@ -136,10 +134,32 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT ...@@ -136,10 +134,32 @@ public class PowerTransferCompanyResourcesServiceImpl extends BaseService<PowerT
} catch (Exception e) { } catch (Exception e) {
throw new RuntimeException("修改失败!"); throw new RuntimeException("修改失败!");
} }
}
@Override
public List<JcSituationDetail> getTaskFeedback(Long carid, Long alertCalledId) {
PowerTransferCompanyResources powerTransferCompanyResources = powerTransferCompanyResourcesMapper.getByAlertCalledIdCarId(alertCalledId, carid);
LambdaQueryWrapper<JcSituationDetail> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(JcSituationDetail::getAlertCalledId,alertCalledId);
wrapper.like(JcSituationDetail::getInfo,powerTransferCompanyResources.getResourcesNum());
wrapper.eq(JcSituationDetail::getInfoType,"车辆反馈");
wrapper.orderByDesc(BaseEntity::getRecDate);
List<JcSituationDetail> list = jcSituationDetailMapper.selectList(wrapper);
list.stream().forEach(e->{
if (e.getInfo().contains("/photos:")){
String[] content = e.getInfo().split("/photos:");
String info = content[0];
String photoUrls = content[1];
List<String> photos = Arrays.asList(photoUrls);
e.setInfo(info);
e.setPhotoUrl(photos);
}
});
return list;
} }
@Override @Override
public PowerTransferCompanyResources getResourceById(String resourceId) { public PowerTransferCompanyResources getResourceById(String resourceId) {
QueryWrapper<PowerTransferCompanyResources> powerTransferCompanyResourcesQueryWrapper = new QueryWrapper<>(); QueryWrapper<PowerTransferCompanyResources> powerTransferCompanyResourcesQueryWrapper = new QueryWrapper<>();
......
...@@ -153,14 +153,16 @@ ...@@ -153,14 +153,16 @@
<if test="nameOrItemNo!=null and nameOrItemNo !='' "> <if test="nameOrItemNo!=null and nameOrItemNo !='' ">
and (name like concat("%", #{nameOrItemNo}, "%") or item_no like concat("%", #{nameOrItemNo}, "%")) and (name like concat("%", #{nameOrItemNo}, "%") or item_no like concat("%", #{nameOrItemNo}, "%"))
</if> </if>
<if test="equipmentType!=null and equipmentType !=''"> <if test="equipmentType!=null and equipmentType.size()>0">
and equipment_type = #{equipmentType} or equipment_type = '-1' and equipment_type in
<foreach collection="equipmentType" item="value" index="index" open="(" separator="," close=")" >#{value}</foreach>
</if> </if>
<if test="keyPartsType!=null and keyPartsType !=''"> <if test="keyPartsType!=null and keyPartsType !=''">
and key_parts_type is not null and key_parts_type is not null
</if> </if>
<if test="facilitiesType!=null and facilitiesType !=''"> <if test="facilitiesType!=null and facilitiesType.size() > 0 ">
and facilities_type = #{facilitiesType} or facilities_type = '-1' and facilities_type in
<foreach collection="facilitiesType" item="value" index="index" open="(" separator="," close=")" >#{value}</foreach>
</if> </if>
<if test="customType!=null and customType !=''"> <if test="customType!=null and customType !=''">
and custom_type is not null and custom_type is not null
...@@ -325,6 +327,13 @@ ...@@ -325,6 +327,13 @@
</choose> </choose>
</select> </select>
<select id="getEquipParentCode" resultType="map">
select * from wl_equipment_category where code = #{code} and industry_code = '2'
</select>
<select id="getEquipParent" resultType="map">
select * from wl_equipment_category where id = #{parentId}
</select>
......
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