Commit 760d8b20 authored by hanbing's avatar hanbing

[add] 快速特勤,特勤详情

parent f18a7fc6
...@@ -3,7 +3,7 @@ package net.wanji.web.bo; ...@@ -3,7 +3,7 @@ package net.wanji.web.bo;
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 net.wanji.web.vo.RouteElementVO; import net.wanji.web.vo.specialService.RouteElementVO;
import javax.validation.constraints.Pattern; import javax.validation.constraints.Pattern;
import java.util.List; import java.util.List;
...@@ -15,6 +15,8 @@ import java.util.List; ...@@ -15,6 +15,8 @@ import java.util.List;
@Data @Data
@ApiModel(value = "AddSpecialServiceBO", description = "快速特勤-添加特勤输入参数") @ApiModel(value = "AddSpecialServiceBO", description = "快速特勤-添加特勤输入参数")
public class AddSpecialServiceBO { public class AddSpecialServiceBO {
@ApiModelProperty(value = "特勤ID")
Integer id;
@ApiModelProperty(value = "特勤名称") @ApiModelProperty(value = "特勤名称")
@Pattern(regexp = "^[\\u4E00-\\u9FA5\\w\\-]{0,16}$", message = "只能包含中文、英文、数字、下划线和中横线,0~16个字符") @Pattern(regexp = "^[\\u4E00-\\u9FA5\\w\\-]{0,16}$", message = "只能包含中文、英文、数字、下划线和中横线,0~16个字符")
String name; String name;
......
package net.wanji.web.vo.specialService; package net.wanji.web.bo;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -9,8 +9,8 @@ import lombok.Data; ...@@ -9,8 +9,8 @@ import lombok.Data;
* @date 2022/11/8 13:18 * @date 2022/11/8 13:18
*/ */
@Data @Data
@ApiModel(value = "DeleteSpecialServiceBO", description = "快速特勤-删除特勤输入参数") @ApiModel(value = "SpecialServiceIdBO", description = "快速特勤-删除特勤输入参数")
public class DeleteSpecialServiceBO { public class SpecialServiceIdBO {
@ApiModelProperty(value = "特勤ID") @ApiModelProperty(value = "特勤ID")
Integer id; Integer id;
} }
...@@ -9,9 +9,10 @@ import net.wanji.common.enums.BaseEnum; ...@@ -9,9 +9,10 @@ import net.wanji.common.enums.BaseEnum;
import net.wanji.common.framework.rest.JsonViewObject; import net.wanji.common.framework.rest.JsonViewObject;
import net.wanji.web.bo.AddSpecialServiceBO; import net.wanji.web.bo.AddSpecialServiceBO;
import net.wanji.web.bo.IsValidPointBO; import net.wanji.web.bo.IsValidPointBO;
import net.wanji.web.bo.SpecialServiceIdBO;
import net.wanji.web.bo.SpecialServiceRouteBO; import net.wanji.web.bo.SpecialServiceRouteBO;
import net.wanji.web.service.SpecialServiceService; import net.wanji.web.service.SpecialServiceService;
import net.wanji.web.vo.RouteElementVO; import net.wanji.web.vo.specialService.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.*; import org.springframework.web.bind.annotation.*;
...@@ -54,13 +55,13 @@ public class SpecialServiceController { ...@@ -54,13 +55,13 @@ public class SpecialServiceController {
return JsonViewObject.newInstance().success(res); return JsonViewObject.newInstance().success(res);
} }
@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, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/addSpecialService", @PostMapping(value = "/addOrUpdateSpecialService",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject addSpecialService(@RequestBody @Valid AddSpecialServiceBO addSpecialServiceBO) { public JsonViewObject addOrUpdateSpecialService(@RequestBody @Valid AddSpecialServiceBO addSpecialServiceBO) {
specialServiceService.addSpecialService(addSpecialServiceBO); specialServiceService.addOrUpdateSpecialService(addSpecialServiceBO);
JsonViewObject jsonViewObject = JsonViewObject.newInstance(); JsonViewObject jsonViewObject = JsonViewObject.newInstance();
return jsonViewObject.success(); return jsonViewObject.success();
...@@ -84,12 +85,22 @@ public class SpecialServiceController { ...@@ -84,12 +85,22 @@ public class SpecialServiceController {
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/deleteSpecialService", @PostMapping(value = "/deleteSpecialService",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject deleteSpecialService(@RequestBody DeleteSpecialServiceBO deleteSpecialServiceBO) { public JsonViewObject deleteSpecialService(@RequestBody SpecialServiceIdBO specialServiceIdBO) {
Integer id = deleteSpecialServiceBO.getId(); Integer id = specialServiceIdBO.getId();
specialServiceService.deleteSpecialService(id); specialServiceService.deleteSpecialService(id);
return JsonViewObject.newInstance().success(); return JsonViewObject.newInstance().success();
} }
@AspectLog(description = "特勤详情", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "特勤详情", notes = "特勤详情", response = SpecialServiceDetailVO.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
@PostMapping(value = "/specialServiceDetail",
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
public JsonViewObject specialServiceDetail(@RequestBody SpecialServiceIdBO specialServiceIdBO) {
SpecialServiceDetailVO specialServiceDetailVO = specialServiceService.specialServiceDetail(specialServiceIdBO);
return JsonViewObject.newInstance().success(specialServiceDetailVO);
}
@AspectLog(description = "编辑特勤", operationType = BaseEnum.OperationTypeEnum.UPDATE) @AspectLog(description = "编辑特勤", operationType = BaseEnum.OperationTypeEnum.UPDATE)
@ApiOperation(value = "编辑特勤", notes = "编辑特勤", response = JsonViewObject.class, @ApiOperation(value = "编辑特勤", notes = "编辑特勤", response = JsonViewObject.class,
produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON) produces = MediaType.APPLICATION_JSON, consumes = MediaType.APPLICATION_JSON)
......
...@@ -31,4 +31,8 @@ public interface SpecialServiceMapper { ...@@ -31,4 +31,8 @@ public interface SpecialServiceMapper {
void updateStatusDisable(@Param("specialServiceId") Integer specialServiceId); void updateStatusDisable(@Param("specialServiceId") Integer specialServiceId);
List<SpecialServicePO> selectAll(); List<SpecialServicePO> selectAll();
SpecialServicePO selectById(Integer specialServiceId);
void updateOne(Integer specialServiceId, SpecialServicePO specialServicePO);
} }
...@@ -2,8 +2,9 @@ package net.wanji.web.service; ...@@ -2,8 +2,9 @@ package net.wanji.web.service;
import net.wanji.web.bo.AddSpecialServiceBO; import net.wanji.web.bo.AddSpecialServiceBO;
import net.wanji.web.bo.IsValidPointBO; import net.wanji.web.bo.IsValidPointBO;
import net.wanji.web.bo.SpecialServiceIdBO;
import net.wanji.web.bo.SpecialServiceRouteBO; import net.wanji.web.bo.SpecialServiceRouteBO;
import net.wanji.web.vo.RouteElementVO; import net.wanji.web.vo.specialService.RouteElementVO;
import net.wanji.web.vo.specialService.*; import net.wanji.web.vo.specialService.*;
import java.util.List; import java.util.List;
...@@ -14,7 +15,7 @@ import java.util.Set; ...@@ -14,7 +15,7 @@ import java.util.Set;
* @date 2022/11/8 11:06 * @date 2022/11/8 11:06
*/ */
public interface SpecialServiceService { public interface SpecialServiceService {
void addSpecialService(AddSpecialServiceBO addSpecialServiceBO); void addOrUpdateSpecialService(AddSpecialServiceBO addSpecialServiceBO);
List<ListSpecialServicesVO> listSpecialServices(); List<ListSpecialServicesVO> listSpecialServices();
...@@ -31,4 +32,6 @@ public interface SpecialServiceService { ...@@ -31,4 +32,6 @@ public interface SpecialServiceService {
List<List<RouteElementVO>> specialServiceRoute(SpecialServiceRouteBO specialServiceRouteBO); List<List<RouteElementVO>> specialServiceRoute(SpecialServiceRouteBO specialServiceRouteBO);
void isValidPoint(IsValidPointBO isValidPointBO); void isValidPoint(IsValidPointBO isValidPointBO);
SpecialServiceDetailVO specialServiceDetail(SpecialServiceIdBO specialServiceIdBO);
} }
package net.wanji.web.vo; package net.wanji.web.vo.specialService;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
...@@ -13,10 +13,14 @@ import lombok.Data; ...@@ -13,10 +13,14 @@ import lombok.Data;
public class RouteElementVO { public class RouteElementVO {
@ApiModelProperty(value = "起点坐标") @ApiModelProperty(value = "起点坐标")
private String startLonLat; private String startLonLat;
@ApiModelProperty(value = "起点路口ID")
private String startId;
@ApiModelProperty(value = "起点路口名称") @ApiModelProperty(value = "起点路口名称")
private String startName; private String startName;
@ApiModelProperty(value = "终点坐标") @ApiModelProperty(value = "终点坐标")
private String endLonLat; private String endLonLat;
@ApiModelProperty(value = "终点路口ID")
private String endId;
@ApiModelProperty(value = "终点路口名称") @ApiModelProperty(value = "终点路口名称")
private String endName; private String endName;
@ApiModelProperty(value = "路况 1畅通;2缓行;3拥堵;4严重拥堵;5未知") @ApiModelProperty(value = "路况 1畅通;2缓行;3拥堵;4严重拥堵;5未知")
......
package net.wanji.web.vo.specialService;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.NoArgsConstructor;
import java.util.List;
/**
* @author Kent HAN
* @date 2023/5/16 14:27
*/
@NoArgsConstructor
@Data
@ApiModel(value = "SpecialServiceDetailVO", description = "特勤详情")
public class SpecialServiceDetailVO {
@ApiModelProperty(value = "特勤名称")
private String name;
@ApiModelProperty(value = "路口列表")
private List<CrossListElement> crossList;
@NoArgsConstructor
@Data
public static class CrossListElement {
@ApiModelProperty(value = "路口名称")
private String crossName;
@ApiModelProperty(value = "路口ID")
private String crossId;
@ApiModelProperty(value = "路口路线起点")
private String routeStart;
@ApiModelProperty(value = "路口路线终点")
private String routeEnd;
@ApiModelProperty(value = "锁定状态:1锁定;0解锁")
private Integer status;
@ApiModelProperty(value = "路口顺序号")
private Integer sort;
}
}
...@@ -78,10 +78,8 @@ ...@@ -78,10 +78,8 @@
where special_service_id = #{specialServiceId} and sort = #{preSort} where special_service_id = #{specialServiceId} and sort = #{preSort}
</select> </select>
<select id="selectBySpecialServiceId" resultMap="BaseResultMap"> <select id="selectBySpecialServiceId" resultMap="BaseResultMap">
select id,special_service_id,cross_id,dir,turn,sort,status,gmt_create,gmt_modified select <include refid="Base_Column_List"></include>
from t_special_service_cross from t_special_service_cross
where special_service_id = #{specialServiceId} where special_service_id = #{specialServiceId}
order by sort order by sort
......
...@@ -64,6 +64,37 @@ ...@@ -64,6 +64,37 @@
where id = #{specialServiceId} where id = #{specialServiceId}
</update> </update>
<update id="updateOne">
update t_special_service_info
<set>
<if test="name != null and name != ''">
name = #{name},
</if>
<if test="plateNum != null and plateNum != ''">
plate_num = #{plateNum},
</if>
<if test="controlModel != null and controlModel != ''">
control_model = #{controlModel},
</if>
<if test="length != null and length != ''">
length = #{length},
</if>
<if test="status != null and status != ''">
status = #{status},
</if>
<if test="startLocation != null and startLocation != ''">
start_location = #{startLocation},
</if>
<if test="endLocation != null and endLocation != ''">
end_location = #{endLocation},
</if>
<if test="isDel != null and isDel != ''">
is_del = #{isDel},
</if>
</set>
where id = #{specialServiceId}
</update>
<select id="selectByAdCode" resultMap="BaseResultMap"> <select id="selectByAdCode" resultMap="BaseResultMap">
select select
id,name,control_model,length,is_del,status,gmt_create,gmt_modified id,name,control_model,length,is_del,status,gmt_create,gmt_modified
...@@ -84,4 +115,10 @@ ...@@ -84,4 +115,10 @@
order by gmt_modified desc order by gmt_modified desc
</select> </select>
<select id="selectById" resultType="net.wanji.web.po.SpecialServicePO">
select <include refid="Base_Column_List"></include>
from t_special_service_info
where id = #{specialServiceId}
</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