21 changed files with 740 additions and 23 deletions
@ -0,0 +1,17 @@ |
|||
package com.kms.yxgh.common.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
@ApiModel("巡查责任人") |
|||
public class DutyHolderDto { |
|||
|
|||
@ApiModelProperty("巡查责任人类型") |
|||
private String dutyHolderType; |
|||
@ApiModelProperty("巡查责任人名称") |
|||
private String name; |
|||
@ApiModelProperty("巡查责任人电话") |
|||
private String phone; |
|||
} |
@ -0,0 +1,85 @@ |
|||
package com.kms.yxgh.df.controller; |
|||
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.kms.yxgh.base.AddGroup; |
|||
import com.kms.yxgh.base.Response; |
|||
import com.kms.yxgh.base.UpdateGroup; |
|||
import com.kms.yxgh.df.dto.DfCheckingLineDto; |
|||
import com.kms.yxgh.df.dto.DfCheckingLineSearchDto; |
|||
import com.kms.yxgh.df.service.DfCheckingLineService; |
|||
import com.shuili.common.annotation.Log; |
|||
import com.shuili.common.core.domain.SearchParam; |
|||
import com.shuili.common.enums.BusinessType; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
|
|||
/** |
|||
* 堤防巡视检查路线Controller |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@RestController |
|||
@AllArgsConstructor |
|||
@RequestMapping("/run/df/checking-line") |
|||
@Api(tags = "堤防巡视检查路线管理") |
|||
public class DfCheckingLineController { |
|||
|
|||
private final DfCheckingLineService dfCheckingLineService; |
|||
|
|||
/** |
|||
* 查询堤防巡视检查路线列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("堤防巡视检查路线列表") |
|||
public IPage<DfCheckingLineDto> list(@RequestBody SearchParam<DfCheckingLineSearchDto> sp) { |
|||
return dfCheckingLineService.search(sp); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取堤防巡视检查路线详细信息 |
|||
*/ |
|||
@ApiOperation("堤防巡视检查路线详情") |
|||
@GetMapping(value = "/{id}") |
|||
public Response<DfCheckingLineDto> getInfo(@PathVariable("id") String id) { |
|||
return Response.ok(dfCheckingLineService.getDetailById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增堤防巡视检查路线 |
|||
*/ |
|||
@Log(title = "堤防巡视检查路线新增", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("堤防巡视检查路线新增") |
|||
public Response<DfCheckingLineDto> add(@Validated(AddGroup.class) |
|||
@RequestBody DfCheckingLineDto dfCheckingLineDto) { |
|||
return Response.ok(dfCheckingLineService.add(dfCheckingLineDto)); |
|||
} |
|||
|
|||
/** |
|||
* 修改堤防巡视检查路线 |
|||
*/ |
|||
@ApiOperation("堤防巡视检查路线修改") |
|||
@Log(title = "堤防巡视检查路线修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public Response<DfCheckingLineDto> edit(@Validated(UpdateGroup.class) |
|||
@RequestBody DfCheckingLineDto dfCheckingLineDto) { |
|||
return Response.ok(dfCheckingLineService.update(dfCheckingLineDto)); |
|||
} |
|||
|
|||
/** |
|||
* 删除堤防巡视检查路线 |
|||
*/ |
|||
@ApiOperation("堤防巡视检查路线删除") |
|||
@Log(title = "堤防巡视检查路线删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{id}") |
|||
public Response<Boolean> remove(@PathVariable String id) { |
|||
return Response.ok(dfCheckingLineService.deleteById(id)); |
|||
} |
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.kms.yxgh.df.domain; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.kms.yxgh.base.SyBaseEntity; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* 堤防巡视检查路线表 bs_sgc_df_xslx |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@TableName("bs_sgc_df_xslx") |
|||
@Data |
|||
@ApiModel("堤防巡视检查路线表") |
|||
public class DfCheckingLine extends SyBaseEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 堤防代码 |
|||
*/ |
|||
@ApiModelProperty("堤防代码") |
|||
private String dikeCode; |
|||
|
|||
/** |
|||
* 巡查名称 |
|||
*/ |
|||
@ApiModelProperty("巡查名称") |
|||
private String name; |
|||
|
|||
/** |
|||
* 巡查路线类型 |
|||
*/ |
|||
@ApiModelProperty("巡查路线类型") |
|||
private String type; |
|||
|
|||
/** |
|||
* 巡查责任人类型 |
|||
*/ |
|||
@ApiModelProperty("巡查责任人类型") |
|||
private String dutyHolderType; |
|||
|
|||
/** |
|||
* 巡查ID |
|||
*/ |
|||
@ApiModelProperty("巡查ID") |
|||
private String xcId; |
|||
|
|||
/** |
|||
* 巡查路线点位 |
|||
*/ |
|||
@ApiModelProperty("巡查路线点位") |
|||
private String points; |
|||
|
|||
/** |
|||
* 状态 |
|||
*/ |
|||
@ApiModelProperty("状态") |
|||
private String status = "0"; |
|||
|
|||
|
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.kms.yxgh.df.domain; |
|||
|
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.kms.yxgh.base.SyBaseEntity; |
|||
import com.shuili.common.annotation.Excel; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 堤防巡视检查计划详情表 bs_sgc_df_xsjhxq |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@TableName("bs_sgc_df_xsjhxq") |
|||
@Data |
|||
@ApiModel("堤防巡视检查计划详情表") |
|||
public class DfCheckingPlanContent extends SyBaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 巡查路线ID |
|||
*/ |
|||
@Excel(name = "巡查路线ID") |
|||
@ApiModelProperty("巡查路线ID") |
|||
private Integer lineId; |
|||
|
|||
/** |
|||
* 计划开始时间 |
|||
*/ |
|||
@Excel(name = "计划开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("计划开始时间") |
|||
private Date startDate; |
|||
|
|||
/** |
|||
* 计划结束时间 |
|||
*/ |
|||
@Excel(name = "计划结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("计划结束时间") |
|||
private Date endDate; |
|||
|
|||
/** |
|||
* 巡查范围 |
|||
*/ |
|||
@Excel(name = "巡查范围") |
|||
@ApiModelProperty("巡查范围") |
|||
private String scope; |
|||
|
|||
/** |
|||
* 执行人 |
|||
*/ |
|||
@Excel(name = "执行人") |
|||
@ApiModelProperty("执行人") |
|||
private String operator; |
|||
|
|||
/** |
|||
* 状态 |
|||
*/ |
|||
@Excel(name = "状态") |
|||
@ApiModelProperty("状态") |
|||
private Integer status; |
|||
} |
@ -0,0 +1,100 @@ |
|||
package com.kms.yxgh.df.dto; |
|||
|
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.kms.yxgh.base.AddGroup; |
|||
import com.kms.yxgh.base.UpdateGroup; |
|||
import com.kms.yxgh.common.dto.DutyHolderDto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import javax.validation.constraints.NotBlank; |
|||
import javax.validation.constraints.Size; |
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 堤防巡视检查路线详情 |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@Data |
|||
@ApiModel("堤防巡视检查路线表") |
|||
public class DfCheckingLineDto { |
|||
|
|||
@NotBlank(message = "堤防巡视检查路线表ID不能为空", groups = {UpdateGroup.class}) |
|||
@ApiModelProperty("堤防巡视检查路线表ID") |
|||
private String id; |
|||
|
|||
/** |
|||
* 堤防代码 |
|||
*/ |
|||
@NotBlank(message = "堤防代码不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
@ApiModelProperty("堤防代码") |
|||
private String dikeCode; |
|||
|
|||
@ApiModelProperty("堤防名称") |
|||
private String dikeName; |
|||
|
|||
@ApiModelProperty("堤防类型") |
|||
private String dikeType; |
|||
|
|||
@ApiModelProperty("责任人列表") |
|||
private List<DutyHolderDto> dutyHolders; |
|||
|
|||
/** |
|||
* 巡查名称 |
|||
*/ |
|||
@NotBlank(message = "巡查名称不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
@Size(max = 50, message = "巡查名称长度不能超过50个字符", groups = {AddGroup.class, UpdateGroup.class}) |
|||
@ApiModelProperty("巡查名称") |
|||
private String name; |
|||
|
|||
/** |
|||
* 巡查路线类型 |
|||
*/ |
|||
@NotBlank(message = "巡查路线类型不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
@ApiModelProperty("巡查路线类型") |
|||
private String type; |
|||
|
|||
/** |
|||
* 巡查责任人类型 |
|||
*/ |
|||
@NotBlank(message = "巡查责任人类型不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
@ApiModelProperty("巡查责任人类型") |
|||
private String dutyHolderType; |
|||
|
|||
/** |
|||
* 巡查ID |
|||
*/ |
|||
@NotBlank(message = "巡查ID不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
@ApiModelProperty("巡查ID") |
|||
private String xcId; |
|||
|
|||
@ApiModelProperty("巡查详情") |
|||
private DfCheckingDetailDto checkingDetail; |
|||
|
|||
/** |
|||
* 巡查路线点位 |
|||
*/ |
|||
@ApiModelProperty("巡查路线点位") |
|||
private List<DfPointDto> points; |
|||
|
|||
/** |
|||
* 状态 |
|||
*/ |
|||
@NotBlank(message = "状态不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
@ApiModelProperty("状态") |
|||
private String status; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("创建时间") |
|||
private Date createTime; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("更新时间") |
|||
private Date updateTime; |
|||
|
|||
} |
@ -0,0 +1,26 @@ |
|||
package com.kms.yxgh.df.dto; |
|||
|
|||
import com.kms.yxgh.common.dto.DutyHolderDto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* DfCheckingLineProjectListDto类是一个数据传输对象,用于表示堤防项目列表的信息。 |
|||
* 包含堤防编号、堤防名称、工程管理单位、水务行政部门和最后巡查时间等属性。 |
|||
*/ |
|||
@Data |
|||
public class DfCheckingLineProjectListDto { |
|||
@ApiModelProperty(value = "堤防编号") |
|||
private String dikeCode; |
|||
@ApiModelProperty(value = "堤防名称") |
|||
private String dikeName; |
|||
@ApiModelProperty(value = "堤防类型") |
|||
private String dikeType; |
|||
|
|||
@ApiModelProperty("责任人列表") |
|||
private List<DutyHolderDto> dutyHolders; |
|||
|
|||
} |
@ -0,0 +1,31 @@ |
|||
package com.kms.yxgh.df.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
@Data |
|||
@ApiModel("堤防巡视检查路线查询") |
|||
public class DfCheckingLineSearchDto { |
|||
|
|||
@ApiModelProperty("堤防编码") |
|||
private String dikeCode; |
|||
|
|||
@ApiModelProperty("堤防名称") |
|||
private String dikeName; |
|||
|
|||
@ApiModelProperty("巡查路线名称") |
|||
private String lineName; |
|||
|
|||
@ApiModelProperty("堤防类型") |
|||
private String dikeType; |
|||
|
|||
@ApiModelProperty("行政区划") |
|||
private String adcd; |
|||
|
|||
@ApiModelProperty("巡查路线类型") |
|||
private String type; |
|||
|
|||
@ApiModelProperty("巡查责任人类型") |
|||
private String dutyHolderType; |
|||
} |
@ -0,0 +1,63 @@ |
|||
package com.kms.yxgh.df.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.kms.yxgh.df.domain.DfCheckingLine; |
|||
import com.kms.yxgh.df.domain.DfPlan; |
|||
import com.kms.yxgh.df.dto.DfCheckingLineDto; |
|||
import com.kms.yxgh.df.dto.DfCheckingLineSearchDto; |
|||
import org.apache.ibatis.annotations.*; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 堤防巡视检查路线Mapper接口 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Repository |
|||
public interface DfCheckingLineMapper extends BaseMapper<DfCheckingLine> { |
|||
|
|||
//根据条件查询堤防巡视检查路线
|
|||
@Select({ |
|||
"<script>", |
|||
"SELECT ", |
|||
"line.dike_code dike_code, df.dike_name dike_name, df.dike_type dike_type, ", |
|||
"line.id id, line.name name, line.type type, line.duty_holder_type duty_holder_type, line.xc_id xc_id, line.status status, ", |
|||
"line.create_time create_time, line.update_time update_time ", |
|||
"FROM bs_sgc_df_xslx line ", |
|||
"left join att_dike_base df on line.dike_code = df.dike_code and df.expr_date is null ", |
|||
"left join bs_sgc_df_xs xc on line.xc_id = xc.id ", |
|||
"where 1=1 ", |
|||
"<if test='dto.dikeName != null and dto.dikeName != \"\"'>", |
|||
"and df.dike_name like concat('%', #{dto.dikeName}, '%') ", |
|||
"</if>", |
|||
"<if test='dto.dikeType != null and dto.dikeType != \"\"'>", |
|||
"and df.dike_type = #{dto.dikeType} ", |
|||
"</if>", |
|||
"<if test='dto.adcd != null and dto.adcd != \"\"'>", |
|||
"and df.adcd like concat(#{dto.adcd}, '%') ", |
|||
"</if>", |
|||
"<if test='dto.lineName != null and dto.lineName != \"\"'>", |
|||
"and line.line_name like concat('%', #{dto.lineName}, '%') ", |
|||
"</if>", |
|||
"<if test='dto.type != null and dto.type != \"\"'>", |
|||
"and line.type = #{dto.type} ", |
|||
"</if>", |
|||
"<if test='dto.dutyHolderType != null and dto.dutyHolderType != \"\"'>", |
|||
"and line.duty_holder_type = #{dto.dutyHolderType} ", |
|||
"</if>", |
|||
"</script>" |
|||
}) |
|||
@Results(value = { |
|||
@Result(property = "dikeCode", column = "dike_code"), |
|||
@Result(property = "dutyHolders", column = "dike_code", |
|||
javaType = List.class, |
|||
many = @Many(select = "com.kms.yg.df.mapper.BsSgcDfFzrMapper.getByDikeCode")) |
|||
}) |
|||
IPage<DfCheckingLineDto> search(Page<DfPlan> page, @Param("dto") DfCheckingLineSearchDto dto); |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.kms.yxgh.df.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.yxgh.df.domain.DfCheckingPlanContent; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
/** |
|||
* 堤防巡视检查计划详情Mapper接口 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Repository |
|||
public interface DfCheckingPlanContentMapper extends BaseMapper<DfCheckingPlanContent> { |
|||
|
|||
} |
@ -0,0 +1,129 @@ |
|||
package com.kms.yxgh.df.service; |
|||
|
|||
import com.alibaba.fastjson.JSON; |
|||
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
|||
import com.kms.yg.df.domain.BsSgcDfFzr; |
|||
import com.kms.yg.df.domain.BsSgcDfSafeJbxx; |
|||
import com.kms.yg.df.mapper.BsSgcDfFzrMapper; |
|||
import com.kms.yg.df.mapper.BsSgcDfSafeJbxxMapper; |
|||
import com.kms.yxgh.base.DfException; |
|||
import com.kms.yxgh.common.dto.DutyHolderDto; |
|||
import com.kms.yxgh.df.domain.DfCheckingLine; |
|||
import com.kms.yxgh.df.domain.DfCheckingPlanContent; |
|||
import com.kms.yxgh.df.domain.DfPlan; |
|||
import com.kms.yxgh.df.dto.DfCheckingLineDto; |
|||
import com.kms.yxgh.df.dto.DfCheckingLineSearchDto; |
|||
import com.kms.yxgh.df.dto.DfPointDto; |
|||
import com.kms.yxgh.df.mapper.DfCheckingLineMapper; |
|||
import com.kms.yxgh.df.mapper.DfCheckingPlanContentMapper; |
|||
import com.kms.yxgh.util.BeanCopyUtils; |
|||
import com.shuili.common.core.domain.SearchParam; |
|||
import com.shuili.common.core.service.BaseService; |
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 堤防巡视检查路线Service接口 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class DfCheckingLineService extends BaseService<DfCheckingLineMapper, DfCheckingLine> { |
|||
|
|||
private final DfCheckingPlanContentMapper dfCheckingPlanContentMapper; |
|||
private final BsSgcDfFzrMapper dfFzrMapper; |
|||
private final DfCheckingService dfCheckingService; |
|||
private final BsSgcDfSafeJbxxMapper dfSafeJbxxMapper; |
|||
|
|||
|
|||
public IPage<DfCheckingLineDto> search(SearchParam<DfCheckingLineSearchDto> sp) { |
|||
Page<DfPlan> page = new Page<>(sp.getPageNum(), sp.getPageSize()); |
|||
DfCheckingLineSearchDto searchDto = Optional.ofNullable(sp.getData()).orElse(new DfCheckingLineSearchDto()); |
|||
return this.baseMapper.search(page, searchDto); |
|||
} |
|||
|
|||
public DfCheckingLineDto getDetailById(String id) { |
|||
DfCheckingLine checkingLine = this.getById(id); |
|||
DfCheckingLineDto dto = BeanCopyUtils.copy(checkingLine, DfCheckingLineDto.class); |
|||
if (dto != null) { |
|||
dto.setPoints(JSON.parseArray(checkingLine.getPoints(), DfPointDto.class)); |
|||
dto.setCheckingDetail(dfCheckingService.getDetailById(dto.getXcId())); |
|||
BsSgcDfSafeJbxx df = dfSafeJbxxMapper.getByDikeCode(dto.getDikeCode()); |
|||
if (df != null) { |
|||
dto.setDikeName(df.getDikeName()); |
|||
dto.setDikeType(df.getDikeType()); |
|||
} |
|||
List<BsSgcDfFzr> fzrList = dfFzrMapper.selectList(Wrappers.<BsSgcDfFzr>lambdaQuery().eq(BsSgcDfFzr::getDikeCode, dto.getDikeCode())); |
|||
dto.setDutyHolders(fzrList.stream().map(fzr -> { |
|||
DutyHolderDto dutyHolderDto = new DutyHolderDto(); |
|||
dutyHolderDto.setName(fzr.getName()); |
|||
dutyHolderDto.setPhone(fzr.getPhone()); |
|||
dutyHolderDto.setDutyHolderType(fzr.getType()); |
|||
return dutyHolderDto; |
|||
}).collect(Collectors.toList())); |
|||
} |
|||
return dto; |
|||
} |
|||
|
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public DfCheckingLineDto add(DfCheckingLineDto dto) { |
|||
DfCheckingLine checkingLine = BeanCopyUtils.copy(dto, DfCheckingLine.class); |
|||
if (checkingLine != null) { |
|||
checkingLine.setId(null); |
|||
checkingLine.setPoints(JSON.toJSONString(dto.getPoints())); |
|||
getBaseMapper().insert(checkingLine); |
|||
String id = checkingLine.getId(); |
|||
return this.getDetailById(id); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public DfCheckingLineDto update(DfCheckingLineDto dto) { |
|||
if (exist(dto.getId())) { |
|||
DfCheckingLine checkingLine = BeanCopyUtils.copy(dto, DfCheckingLine.class); |
|||
if (checkingLine != null) { |
|||
checkingLine.setPoints(JSON.toJSONString(dto.getPoints())); |
|||
getBaseMapper().updateById(checkingLine); |
|||
String id = checkingLine.getId(); |
|||
return this.getDetailById(id); |
|||
} |
|||
} |
|||
throw new DfException("源数据不存在,请确认id值是否正确"); |
|||
|
|||
} |
|||
|
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public Boolean deleteById(String id) { |
|||
if (isUsed(id)) { |
|||
throw new DfException("该路线已被使用,无法删除"); |
|||
} |
|||
return removeById(id); |
|||
} |
|||
|
|||
private boolean isUsed(String planId) { |
|||
Wrapper<DfCheckingPlanContent> wp = Wrappers.<DfCheckingPlanContent>lambdaQuery() |
|||
.eq(DfCheckingPlanContent::getLineId, planId); |
|||
return dfCheckingPlanContentMapper.selectCount(wp) > 0; |
|||
} |
|||
|
|||
private boolean exist(String id) { |
|||
Wrapper<DfCheckingLine> wp = Wrappers.<DfCheckingLine>lambdaQuery() |
|||
.eq(DfCheckingLine::getId, id); |
|||
return this.getBaseMapper().selectCount(wp) > 0; |
|||
} |
|||
|
|||
|
|||
} |
@ -0,0 +1,10 @@ |
|||
package com.kms.yxgh.df.service; |
|||
|
|||
|
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
@Service |
|||
@AllArgsConstructor |
|||
public class DfInfoService { |
|||
} |
@ -1 +1,37 @@ |
|||
SET NAMES utf8mb4; |
|||
SET NAMES utf8mb4; |
|||
|
|||
CREATE TABLE `bs_sgc_df_xslx` ( |
|||
`ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查路线查编号', |
|||
`DIKE_CODE` varchar(255) COLLATE utf8mb4_general_ci COMMENT '堤防代码', |
|||
`NAME` varchar(50) COLLATE utf8mb4_general_ci NOT NULL COMMENT '巡查名称', |
|||
`TYPE` int DEFAULT NULL COMMENT '巡查路线类型', |
|||
`DUTY_HOLDER_TYPE` int DEFAULT NULL COMMENT '巡查责任人类型', |
|||
`XC_ID` int NOT NULL COMMENT '巡查ID', |
|||
`POINTS` text COLLATE utf8mb4_general_ci COMMENT '巡查路线点位', |
|||
`STATUS` int NOT NULL COMMENT '状态', |
|||
`REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注', |
|||
`CREATE_UID` varchar(16) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人', |
|||
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间', |
|||
`UPDATE_UID` varchar(16) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最近修改人', |
|||
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '最近修改时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='堤防巡视检查路线表'; |
|||
|
|||
ALTER TABLE `bs_sgc_df_xsjh` ADD `STATUS` int NOT NULL COMMENT '状态'; |
|||
|
|||
CREATE TABLE `bs_sgc_df_xsjhxq` ( |
|||
`ID` int NOT NULL AUTO_INCREMENT COMMENT '堤防巡视检查计划详情编号', |
|||
`LINE_ID` int NOT NULL COMMENT '巡查路线ID', |
|||
`REMARK` text COLLATE utf8mb4_general_ci COMMENT '备注', |
|||
`START_TIME` datetime DEFAULT NULL COMMENT '计划开始时间', |
|||
`END_TIME` datetime DEFAULT NULL COMMENT '计划结束时间', |
|||
`SCOPE` text COLLATE utf8mb4_general_ci COMMENT '巡查范围', |
|||
`OPERATOR` text COLLATE utf8mb4_general_ci COMMENT '执行人', |
|||
`STATUS` int NOT NULL COMMENT '状态', |
|||
`CREATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '创建人', |
|||
`CREATE_TIME` datetime DEFAULT NULL COMMENT '创建时间', |
|||
`UPDATE_UID` varchar(32) COLLATE utf8mb4_general_ci DEFAULT NULL COMMENT '最近修改人', |
|||
`UPDATE_TIME` datetime DEFAULT NULL COMMENT '最近修改时间', |
|||
PRIMARY KEY (`ID`) |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='堤防巡视检查计划详情表'; |
|||
|
|||
|
Loading…
Reference in new issue