Commit b2599efc authored by hanbing's avatar hanbing

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

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