Commit b2599efc authored by hanbing's avatar hanbing

[add] 快速特勤,快速特勤列表

parent 2f8b1844
......@@ -14,10 +14,7 @@ import net.wanji.web.service.SpecialServiceService;
import net.wanji.web.vo.RouteElementVO;
import net.wanji.web.vo.specialService.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.validation.Valid;
import javax.ws.rs.core.MediaType;
......@@ -69,20 +66,17 @@ public class SpecialServiceController {
return jsonViewObject.success();
}
@AspectLog(description = "特勤列表", operationType = BaseEnum.OperationTypeEnum.QUERY)
@ApiOperation(value = "特勤列表", notes = "特勤列表", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/listSpecialServices",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@AspectLog(description = "快速特勤列表", operationType = BaseEnum.OperationTypeEnum.QUERY)
@ApiOperation(value = "快速特勤列表", notes = "快速特勤列表", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON)
@GetMapping(value = "/listSpecialServices",
produces = MediaType.APPLICATION_JSON)
@ApiResponses({
@ApiResponse(code = 200, message = "OK", response = ListSpecialServicesOutVO.class),
@ApiResponse(code = 200, message = "OK", response = ListSpecialServicesVO.class),
})
public JsonViewObject listSpecialServices(@RequestBody ListSpecialServicesInVO listSpecialServicesInVO) {
String adCode = listSpecialServicesInVO.getAdCode();
List<ListSpecialServicesOutVO> listSpecialServicesOutVOList = specialServiceService.listSpecialServices(adCode);
JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(listSpecialServicesOutVOList);
public JsonViewObject listSpecialServices() {
List<ListSpecialServicesVO> listSpecialServicesVOList = specialServiceService.listSpecialServices();
return JsonViewObject.newInstance().success(listSpecialServicesVOList);
}
@AspectLog(description = "编辑特勤", operationType = BaseEnum.OperationTypeEnum.UPDATE)
......
......@@ -29,4 +29,6 @@ public interface SpecialServiceMapper {
void updateStatusEnable(@Param("specialServiceId") Integer specialServiceId);
void updateStatusDisable(@Param("specialServiceId") Integer specialServiceId);
List<SpecialServicePO> selectAll();
}
......@@ -16,7 +16,7 @@ import java.util.Set;
public interface SpecialServiceService {
void addSpecialService(AddSpecialServiceBO addSpecialServiceBO);
List<ListSpecialServicesOutVO> listSpecialServices(String adCode);
List<ListSpecialServicesVO> listSpecialServices();
void updateSpecialService(UpdateSpecialServiceInVO updateSpecialServiceInVO);
......
......@@ -19,18 +19,16 @@ import net.wanji.web.bo.SpecialServiceRouteBO;
import net.wanji.web.common.enums.CrossDirEnum;
import net.wanji.web.mapper.*;
import net.wanji.web.po.CrossDirTurnPO;
import net.wanji.web.po.RidInfoPO;
import net.wanji.web.po.SpecialServiceCrossPO;
import net.wanji.web.po.SpecialServicePO;
import net.wanji.web.service.SpecialServiceService;
import net.wanji.web.vo.RouteElementVO;
import net.wanji.web.vo.specialService.DeleteCrossInVO;
import net.wanji.web.vo.specialService.ListSpecialServicesOutVO;
import net.wanji.web.vo.specialService.ListSpecialServicesVO;
import net.wanji.web.vo.specialService.UpdateCrossInVO;
import net.wanji.web.vo.specialService.UpdateSpecialServiceInVO;
import org.jetbrains.annotations.NotNull;
import org.locationtech.jts.geom.Geometry;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -165,29 +163,19 @@ public class SpecialServiceServiceImpl implements SpecialServiceService {
}
@Override
public List<ListSpecialServicesOutVO> listSpecialServices(String adCode) {
List<SpecialServicePO> specialServicePOList = specialServiceMapper.selectByAdCode(adCode);
List<ListSpecialServicesOutVO> listSpecialServicesOutVOList = new ArrayList<>();
public List<ListSpecialServicesVO> listSpecialServices() {
List<ListSpecialServicesVO> res = new ArrayList<>();
List<SpecialServicePO> specialServicePOList = specialServiceMapper.selectAll();
for (SpecialServicePO specialServicePO : specialServicePOList) {
ListSpecialServicesOutVO listSpecialServicesOutVO = new ListSpecialServicesOutVO();
BeanUtils.copyProperties(specialServicePO, listSpecialServicesOutVO);
// 构造wkt列表
List<String> wkts = new ArrayList<>();
Integer specialServiceId = specialServicePO.getId();
List<SpecialServiceCrossPO> specialServiceCrossPOList =
specialServiceCrossMapper.selectBySpecialServiceId(specialServiceId);
int size = specialServiceCrossPOList.size();
for (int i = 0; i < size - 1; i++) {
SpecialServiceCrossPO currentCross = specialServiceCrossPOList.get(i);
SpecialServiceCrossPO nextCross = specialServiceCrossPOList.get(i + 1);
RidInfoPO ridInfoPO = customRidInfoMapper.selectOne(currentCross.getCrossId(), nextCross.getCrossId());
String wkt = ridInfoPO.getWkt();
wkts.add(wkt);
}
listSpecialServicesOutVO.setWkts(wkts);
listSpecialServicesOutVOList.add(listSpecialServicesOutVO);
ListSpecialServicesVO listSpecialServicesVO = new ListSpecialServicesVO();
listSpecialServicesVO.setName(specialServicePO.getName());
listSpecialServicesVO.setStatus(specialServicePO.getStatus());
listSpecialServicesVO.setGmtModified(specialServicePO.getGmtModified());
res.add(listSpecialServicesVO);
}
return listSpecialServicesOutVOList;
return res;
}
@Override
......
......@@ -13,7 +13,7 @@ import java.util.List;
* @date 2022/11/9 13:10
*/
@Data
@ApiModel(value = "ListSpecialServicesOutVO", description = "快速特勤-一键特勤、一键取消特勤请求体")
@ApiModel(value = "ListSpecialServicesVO", description = "快速特勤-一键特勤、一键取消特勤请求体")
public class EnableDisableSpecialServiceOutVO {
@ApiModelProperty(name = "相位锁定参数",notes = "")
List<PhaseLockVO> phases;
......
......@@ -8,7 +8,7 @@ import lombok.Data;
* @date 2022/11/9 14:39
*/
@Data
@ApiModel(value = "ListSpecialServicesOutVO", description = "快速特勤-一键特勤、一键取消特勤响应体")
@ApiModel(value = "ListSpecialServicesVO", description = "快速特勤-一键特勤、一键取消特勤响应体")
public class EnableDisableSpecialServiceResponseVO {
String msg;
Integer status;
......
package net.wanji.web.vo.specialService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author Kent HAN
* @date 2022/11/8 13:04
*/
@Data
@ApiModel(value = "ListSpecialServicesInVO", description = "查询快速特勤-特勤列表输入参数")
public class ListSpecialServicesInVO {
@ApiModelProperty(value = "城市代码,示例值:110000")
String adCode;
}
\ No newline at end of file
package net.wanji.web.vo.specialService;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.util.List;
import java.util.Date;
/**
* @author Kent HAN
* @date 2022/11/8 13:07
*/
@Data
@ApiModel(value = "ListSpecialServicesOutVO", description = "查询快速特勤-特勤列表返回值")
public class ListSpecialServicesOutVO {
@ApiModelProperty( value = "特勤ID",notes = "")
private Integer id ;
/** 特勤名称 */
@ApiModel(value = "ListSpecialServicesVO", description = "查询快速特勤-特勤列表返回值")
public class ListSpecialServicesVO {
@ApiModelProperty(value = "特勤名称",notes = "")
private String name ;
/** 控制类型:1手动;2自动 */
@ApiModelProperty(value = "控制类型:1手动;2自动",notes = "")
private Integer controlModel = 1;
/** 特勤线路长度 */
@ApiModelProperty(value = "特勤线路长度",notes = "")
private Double length = 0.0 ;
/** 特勤状态:1执行;0未执行 */
@ApiModelProperty(value = "特勤状态:1执行;0未执行",notes = "")
private Integer status = 0 ;
@ApiModelProperty(value = "wkt列表",notes = "")
private List<String> wkts;
@ApiModelProperty(value = "执行时间")
@JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
Date gmtModified;
}
......@@ -79,4 +79,9 @@
where id = #{specialServiceId}
</select>
<select id="selectAll" resultType="net.wanji.web.po.SpecialServicePO">
select <include refid="Base_Column_List"></include>
from t_special_service_info
</select>
</mapper>
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