49 changed files with 2132 additions and 466 deletions
@ -0,0 +1,93 @@ |
|||
package com.kms.yxgh.sz.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.sz.dto.SzCheckingLineDto; |
|||
import com.kms.yxgh.sz.dto.SzCheckingLineSearchDto; |
|||
import com.kms.yxgh.sz.service.SzCheckingLineService; |
|||
import com.shuili.common.annotation.Log; |
|||
import com.shuili.common.core.domain.AjaxResult; |
|||
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/sz/checking-line") |
|||
@Api(tags = "水闸巡视检查路线管理") |
|||
public class SzCheckingLineController { |
|||
|
|||
private final SzCheckingLineService dfCheckingLineService; |
|||
|
|||
/** |
|||
* 查询水闸巡视检查路线列表 |
|||
*/ |
|||
@PostMapping("/list") |
|||
@ApiOperation("水闸巡视检查路线列表") |
|||
public IPage<SzCheckingLineDto> list(@RequestBody SearchParam<SzCheckingLineSearchDto> sp) { |
|||
return dfCheckingLineService.search(sp); |
|||
} |
|||
|
|||
|
|||
/** |
|||
* 获取水闸巡视检查路线详细信息 |
|||
*/ |
|||
@ApiOperation("水闸巡视检查路线详情") |
|||
@GetMapping(value = "/{id}") |
|||
public Response<SzCheckingLineDto> getInfo(@PathVariable("id") String id) { |
|||
return Response.ok(dfCheckingLineService.getDetailById(id)); |
|||
} |
|||
|
|||
/** |
|||
* 新增水闸巡视检查路线 |
|||
*/ |
|||
@Log(title = "水闸巡视检查路线新增", businessType = BusinessType.INSERT) |
|||
@PostMapping |
|||
@ApiOperation("水闸巡视检查路线新增") |
|||
public Response<SzCheckingLineDto> add(@Validated(AddGroup.class) |
|||
@RequestBody SzCheckingLineDto dfCheckingLineDto) { |
|||
return Response.ok(dfCheckingLineService.add(dfCheckingLineDto)); |
|||
} |
|||
|
|||
/** |
|||
* 修改水闸巡视检查路线 |
|||
*/ |
|||
@ApiOperation("水闸巡视检查路线修改") |
|||
@Log(title = "水闸巡视检查路线修改", businessType = BusinessType.UPDATE) |
|||
@PutMapping |
|||
public Response<SzCheckingLineDto> edit(@Validated(UpdateGroup.class) |
|||
@RequestBody SzCheckingLineDto dfCheckingLineDto) { |
|||
return Response.ok(dfCheckingLineService.update(dfCheckingLineDto)); |
|||
} |
|||
|
|||
/** |
|||
* 删除水闸巡视检查路线 |
|||
*/ |
|||
@ApiOperation("水闸巡视检查路线删除") |
|||
@Log(title = "水闸巡视检查路线删除", businessType = BusinessType.DELETE) |
|||
@DeleteMapping("/{ids}") |
|||
public Response<Boolean> remove(@PathVariable("ids") String[] ids) { |
|||
return Response.ok(dfCheckingLineService.deleteById(ids)); |
|||
} |
|||
|
|||
@Log(title = "堤防巡视路线导出", businessType = BusinessType.EXPORT) |
|||
@PostMapping("/export") |
|||
@ApiOperation("内容记录导出") |
|||
public AjaxResult export(@RequestBody SzCheckingLineSearchDto searchDto) { |
|||
return dfCheckingLineService.export(searchDto.getIds()); |
|||
|
|||
} |
|||
} |
@ -0,0 +1,66 @@ |
|||
package com.kms.yxgh.sz.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_sz_xslx |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@TableName("bs_sgc_sz_xslx") |
|||
@Data |
|||
@ApiModel("水闸巡视检查路线表") |
|||
public class SzCheckingLine extends SyBaseEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 水闸代码 |
|||
*/ |
|||
@ApiModelProperty("水闸代码") |
|||
private String wagaCode; |
|||
|
|||
/** |
|||
* 巡查名称 |
|||
*/ |
|||
@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,61 @@ |
|||
package com.kms.yxgh.sz.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; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* 水闸巡视检查计划详情表 bs_sgc_sz_xsjhxq |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@TableName("bs_sgc_sz_xsjhxq") |
|||
@Data |
|||
@ApiModel("水闸巡视检查计划详情表") |
|||
public class SzCheckingPlanContent extends SyBaseEntity { |
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
|
|||
@ApiModelProperty("计划ID") |
|||
private String planId; |
|||
|
|||
/** |
|||
* 巡查路线ID |
|||
*/ |
|||
@ApiModelProperty("巡查路线ID") |
|||
private String lineId; |
|||
|
|||
@ApiModelProperty("名称") |
|||
private String name; |
|||
|
|||
/** |
|||
* 计划开始时间 |
|||
*/ |
|||
@ApiModelProperty("计划开始时间") |
|||
private Date startDate; |
|||
|
|||
/** |
|||
* 计划结束时间 |
|||
*/ |
|||
@ApiModelProperty("计划结束时间") |
|||
private Date endDate; |
|||
|
|||
/** |
|||
* 巡查范围 |
|||
*/ |
|||
@ApiModelProperty("巡查范围") |
|||
private String scope; |
|||
|
|||
|
|||
/** |
|||
* 状态 |
|||
*/ |
|||
@ApiModelProperty("状态") |
|||
private String status; |
|||
} |
@ -0,0 +1,102 @@ |
|||
package com.kms.yxgh.sz.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 SzCheckingLineDto { |
|||
|
|||
@NotBlank(message = "水闸巡视检查路线表ID不能为空", groups = {UpdateGroup.class}) |
|||
@ApiModelProperty("水闸巡视检查路线表ID") |
|||
private String id; |
|||
|
|||
@ApiModelProperty("水闸ID") |
|||
private String wagaId; |
|||
|
|||
/** |
|||
* 水闸代码 |
|||
*/ |
|||
@NotBlank(message = "水闸代码不能为空", groups = {AddGroup.class, UpdateGroup.class}) |
|||
@ApiModelProperty("水闸代码") |
|||
private String wagaCode; |
|||
|
|||
@ApiModelProperty("水闸名称") |
|||
private String wagaName; |
|||
|
|||
@ApiModelProperty("水闸类型") |
|||
private String wagaType; |
|||
|
|||
@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 SzCheckingDetailDto checkingDetail; |
|||
|
|||
/** |
|||
* 巡查路线点位 |
|||
*/ |
|||
@ApiModelProperty("巡查路线点位") |
|||
private String entries; |
|||
/** |
|||
* 状态 |
|||
*/ |
|||
@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,36 @@ |
|||
package com.kms.yxgh.sz.dto; |
|||
|
|||
import com.shuili.common.annotation.Excel; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
@ApiModel("水闸巡视检查路线导出") |
|||
public class SzCheckingLineExportDto { |
|||
|
|||
@Excel(name = "水闸编码", sort = 3) |
|||
@ApiModelProperty("水闸代码") |
|||
private String wagaCode; |
|||
@Excel(name = "水闸名称", sort = 1) |
|||
@ApiModelProperty("水闸名称") |
|||
private String wagaName; |
|||
@Excel(name = "水闸类型", dictType = "embankment_type", sort = 2) |
|||
@ApiModelProperty("水闸类型") |
|||
private String wagaType; |
|||
@Excel(name = "巡查路线名称", sort = 4) |
|||
@ApiModelProperty("巡查名称") |
|||
private String name; |
|||
@Excel(name = "巡查类型", dictType = "xs_classfy", sort = 5) |
|||
@ApiModelProperty("巡查路线类型") |
|||
private String type; |
|||
@Excel(name = "巡查责任人类型", sort = 6, dictType = "person_type") |
|||
@ApiModelProperty("巡查责任人类型") |
|||
private String dutyHolderType; |
|||
@Excel(name = "创建时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 7) |
|||
@ApiModelProperty("创建时间") |
|||
private Date createTime; |
|||
|
|||
} |
@ -0,0 +1,28 @@ |
|||
package com.kms.yxgh.sz.dto; |
|||
|
|||
import com.kms.yxgh.common.dto.DutyHolderDto; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
|
|||
/** |
|||
* SzCheckingLineProjectListDto类是一个数据传输对象,用于表示水闸项目列表的信息。 |
|||
* 包含水闸编号、水闸名称、工程管理单位、水务行政部门和最后巡查时间等属性。 |
|||
*/ |
|||
@Data |
|||
public class SzCheckingLineProjectListDto { |
|||
@ApiModelProperty(value = "水闸ID") |
|||
private String wagaId; |
|||
@ApiModelProperty(value = "水闸编号") |
|||
private String wagaCode; |
|||
@ApiModelProperty(value = "水闸名称") |
|||
private String wagaName; |
|||
@ApiModelProperty(value = "水闸类型") |
|||
private String wagaType; |
|||
|
|||
@ApiModelProperty("责任人列表") |
|||
private List<DutyHolderDto> dutyHolders; |
|||
|
|||
} |
@ -0,0 +1,36 @@ |
|||
package com.kms.yxgh.sz.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@ApiModel("水闸巡视检查路线查询") |
|||
public class SzCheckingLineSearchDto { |
|||
|
|||
@ApiModelProperty("水闸编码") |
|||
private String wagaCode; |
|||
|
|||
@ApiModelProperty("水闸名称") |
|||
private String wagaName; |
|||
|
|||
@ApiModelProperty("巡查路线名称") |
|||
private String lineName; |
|||
|
|||
@ApiModelProperty("水闸类型") |
|||
private String wagaType; |
|||
|
|||
@ApiModelProperty("行政区划") |
|||
private String adcd; |
|||
|
|||
@ApiModelProperty("巡查路线类型") |
|||
private String type; |
|||
|
|||
@ApiModelProperty("巡查责任人类型") |
|||
private String dutyHolderType; |
|||
|
|||
@ApiModelProperty("路线ids") |
|||
private List<String> ids; |
|||
} |
@ -0,0 +1,78 @@ |
|||
package com.kms.yxgh.sz.dto; |
|||
|
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.kms.yxgh.common.dto.OperatorDto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 水闸巡视检查计划内容 bs_sgc_sz_xsjhxq |
|||
* |
|||
* @author sy |
|||
* @date 2024-01-04 |
|||
*/ |
|||
@Data |
|||
@ApiModel("水闸巡视检查计划内容") |
|||
public class SzCheckingPlanContentDto { |
|||
|
|||
@ApiModelProperty("主键") |
|||
private String id; |
|||
|
|||
@ApiModelProperty("名称") |
|||
private String name; |
|||
|
|||
@ApiModelProperty("计划ID") |
|||
private String planId; |
|||
|
|||
/** |
|||
* 巡查路线ID |
|||
*/ |
|||
@ApiModelProperty("巡查路线ID") |
|||
private String lineId; |
|||
|
|||
@ApiModelProperty("巡查路线名称") |
|||
private String lineName; |
|||
|
|||
/** |
|||
* 计划开始时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("计划开始时间") |
|||
private Date startDate; |
|||
|
|||
/** |
|||
* 计划结束时间 |
|||
*/ |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") |
|||
@ApiModelProperty("计划结束时间") |
|||
private Date endDate; |
|||
|
|||
/** |
|||
* 巡查范围 |
|||
*/ |
|||
@ApiModelProperty("巡查范围") |
|||
private String scope; |
|||
|
|||
/** |
|||
* 执行人 |
|||
*/ |
|||
@ApiModelProperty("执行人") |
|||
private List<OperatorDto> operator; |
|||
|
|||
/** |
|||
* 状态 |
|||
*/ |
|||
@ApiModelProperty("状态") |
|||
private String status; |
|||
|
|||
|
|||
@ApiModelProperty("备注") |
|||
private String remark; |
|||
|
|||
|
|||
} |
@ -0,0 +1,29 @@ |
|||
package com.kms.yxgh.sz.dto; |
|||
|
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
@Data |
|||
@ApiModel(value = "水闸巡视检查计划查询") |
|||
public class SzPlanSearchDto { |
|||
|
|||
@ApiModelProperty(value = "水闸编号") |
|||
private String wagaCode; |
|||
@ApiModelProperty(value = "名称") |
|||
private String name; |
|||
@ApiModelProperty(value = "状态") |
|||
private String status; |
|||
@ApiModelProperty(value = "记录状态") |
|||
private String recordStatus; |
|||
private String user; |
|||
@ApiModelProperty(value = "巡查人员id") |
|||
private List<String> userIds; |
|||
@ApiModelProperty(value = "开始时间") |
|||
private Date startTime; |
|||
@ApiModelProperty(value = "结束时间") |
|||
private Date endTime; |
|||
} |
@ -0,0 +1,78 @@ |
|||
package com.kms.yxgh.sz.dto; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.shuili.common.annotation.Excel; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
/** |
|||
* @ClassName: DfRecordDetailDto |
|||
* @Description: TODO |
|||
* @Date: 2023/11/15 上午10:36 * |
|||
* @author: hxh |
|||
* @version: 1.0 |
|||
*/ |
|||
|
|||
@Data |
|||
@ApiModel("水闸巡视检查记录详情导出") |
|||
public class SzRecordDetailExportDto { |
|||
|
|||
|
|||
@Excel(name = "水闸名称", sort = 1) |
|||
@ApiModelProperty("水闸名称") |
|||
private String wagaName; |
|||
|
|||
@Excel(name = "水闸类型", dictType = "embankment_type", sort = 2) |
|||
@ApiModelProperty("水闸类型") |
|||
private String wagaType; |
|||
|
|||
@Excel(name = "巡查计划名称", sort = 3) |
|||
@ApiModelProperty("计划名称") |
|||
private String planName; |
|||
|
|||
@Excel(name = "巡查计划子项名称", sort = 4) |
|||
@ApiModelProperty("子计划名称") |
|||
private String subPlanName; |
|||
|
|||
@Excel(name = "巡查计划开始时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 5) |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("子项开始时间") |
|||
private Date subPlanStartDate; |
|||
|
|||
@Excel(name = "巡查计划结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 6) |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("子项结束时间") |
|||
private Date subPlanEndDate; |
|||
|
|||
@Excel(name = "巡查人", sort = 7) |
|||
private String createName; |
|||
|
|||
@Excel(name = "巡查时长", sort = 8) |
|||
@ApiModelProperty("巡查时长") |
|||
private String duration; |
|||
|
|||
@Excel(name = "巡查开始时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 9) |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("巡查开始时间") |
|||
private Date startDate; |
|||
|
|||
@Excel(name = "巡查结束时间", dateFormat = "yyyy-MM-dd HH:mm:ss", sort = 10) |
|||
@ApiModelProperty("巡查结束时间") |
|||
private Date endDate; |
|||
|
|||
@Excel(name = "隐患状态", sort = 11) |
|||
@ApiModelProperty("状态") |
|||
private String status; |
|||
|
|||
public void initDuration() { |
|||
if (this.startDate != null && this.endDate != null) { |
|||
long diff = this.endDate.getTime() - this.startDate.getTime(); |
|||
long hours = diff / (1000 * 60 * 60); |
|||
this.duration = hours + ""; |
|||
} |
|||
} |
|||
|
|||
} |
@ -0,0 +1,96 @@ |
|||
package com.kms.yxgh.sz.dto; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.kms.yxgh.common.dto.OperatorDto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @ClassName: DfRecordSearchDto |
|||
* @Description: TODO |
|||
* @Date: 2023/11/15 下午4:02 * |
|||
* @author: hxh |
|||
* @version: 1.0 |
|||
*/ |
|||
@Data |
|||
@ApiModel("水闸巡视检查记录检索详情") |
|||
public class SzRecordSimpleDto { |
|||
|
|||
@ApiModelProperty("主键") |
|||
private String id; |
|||
|
|||
@ApiModelProperty("巡查计划ID") |
|||
private String planId; |
|||
|
|||
@ApiModelProperty("计划类型") |
|||
private String planType; |
|||
|
|||
@ApiModelProperty("巡查范围") |
|||
private String scope; |
|||
|
|||
@ApiModelProperty("水闸代码") |
|||
private String wagaCode; |
|||
|
|||
@ApiModelProperty("水闸名称") |
|||
private String wagaName; |
|||
|
|||
@ApiModelProperty("水闸类型") |
|||
private String wagaType; |
|||
|
|||
@ApiModelProperty("状态") |
|||
private String status; |
|||
|
|||
@ApiModelProperty("处置状态") |
|||
private String handleStatus; |
|||
|
|||
@ApiModelProperty("计划名称") |
|||
private String planName; |
|||
|
|||
@ApiModelProperty("子计划ID") |
|||
private String subPlanId; |
|||
|
|||
@ApiModelProperty("子计划名称") |
|||
private String subPlanName; |
|||
|
|||
@ApiModelProperty("巡查路线ID") |
|||
private String lineId; |
|||
|
|||
@ApiModelProperty("路线名称") |
|||
private String lineName; |
|||
|
|||
@ApiModelProperty("路线类型") |
|||
private String lineType; |
|||
|
|||
@ApiModelProperty("巡查责任人类型") |
|||
private String dutyHolderType; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("记录开始时间") |
|||
private Date startDate; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("记录结束时间") |
|||
private Date endDate; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("子项开始时间") |
|||
private Date subPlanStartDate; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("子项结束时间") |
|||
private Date subPlanEndDate; |
|||
|
|||
@ApiModelProperty("创建者") |
|||
private String createUid; |
|||
|
|||
@ApiModelProperty("创建者名称") |
|||
private String createName; |
|||
|
|||
@ApiModelProperty("计划执行人") |
|||
List<OperatorDto> operators; |
|||
|
|||
} |
@ -0,0 +1,34 @@ |
|||
package com.kms.yxgh.sz.dto; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
|
|||
@Data |
|||
@ApiModel(value = "水闸巡视检查子计划查询") |
|||
public class SzSubPlanSearchDto { |
|||
|
|||
@ApiModelProperty(value = "计划名称") |
|||
private String planName; |
|||
@ApiModelProperty("巡查计划类型") |
|||
private String planType; |
|||
@ApiModelProperty(value = "水闸编号") |
|||
private String wagaCode; |
|||
@ApiModelProperty(value = "记录状态") |
|||
private String recordStatus; |
|||
private String user; |
|||
@ApiModelProperty("路线类型") |
|||
private String lineType; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty(value = "开始时间") |
|||
private Date startTime; |
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty(value = "结束时间") |
|||
private Date endTime; |
|||
|
|||
@ApiModelProperty("是否开始") |
|||
private Boolean isStart; |
|||
} |
@ -0,0 +1,77 @@ |
|||
package com.kms.yxgh.sz.dto; |
|||
|
|||
import com.fasterxml.jackson.annotation.JsonFormat; |
|||
import com.kms.yxgh.common.dto.OperatorDto; |
|||
import io.swagger.annotations.ApiModel; |
|||
import io.swagger.annotations.ApiModelProperty; |
|||
import lombok.Data; |
|||
|
|||
import java.util.Date; |
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @ClassName: DfPlanSimpleDto |
|||
* @Description: TODO |
|||
* @Date: 2024/1/23 下午3:26 |
|||
* * |
|||
* @author: hxh |
|||
* @version: 1.0 |
|||
*/ |
|||
@ApiModel(value = "巡查子计划查询信息") |
|||
@Data |
|||
public class SzSubPlanSimpleDto { |
|||
|
|||
@ApiModelProperty("水闸编码") |
|||
private String wagaCode; |
|||
@ApiModelProperty("水闸名称") |
|||
private String wagaName; |
|||
@ApiModelProperty("水闸类型") |
|||
private String wagaType; |
|||
|
|||
@ApiModelProperty("计划id") |
|||
private String planId; |
|||
|
|||
@ApiModelProperty("计划名称") |
|||
private String planName; |
|||
|
|||
@ApiModelProperty("巡查计划类型") |
|||
private String planType; |
|||
|
|||
@ApiModelProperty("子计划id") |
|||
private String subPlanId; |
|||
|
|||
@ApiModelProperty("子计划名称") |
|||
private String subPlanName; |
|||
|
|||
@ApiModelProperty("路线类型") |
|||
private String lineType; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("子计划开始时间") |
|||
private Date subPlanStartDate; |
|||
|
|||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
|||
@ApiModelProperty("子计划结束时间") |
|||
private Date subPlanEndDate; |
|||
|
|||
@ApiModelProperty("记录id") |
|||
private String recordId; |
|||
|
|||
@ApiModelProperty("记录状态") |
|||
private String recordStatus; |
|||
|
|||
@ApiModelProperty("记录隐患状态") |
|||
private String recordHandleStatus; |
|||
|
|||
@ApiModelProperty("当前已巡查项") |
|||
private Long currentItem; |
|||
|
|||
@ApiModelProperty("所有巡查项目") |
|||
private Long allItem; |
|||
|
|||
/** |
|||
* 执行人 |
|||
*/ |
|||
@ApiModelProperty("执行人") |
|||
private List<OperatorDto> operator; |
|||
} |
@ -0,0 +1,68 @@ |
|||
package com.kms.yxgh.sz.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.sz.domain.SzCheckingLine; |
|||
import com.kms.yxgh.sz.domain.SzPlan; |
|||
import com.kms.yxgh.sz.dto.SzCheckingLineDto; |
|||
import com.kms.yxgh.sz.dto.SzCheckingLineSearchDto; |
|||
import org.apache.ibatis.annotations.*; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 水闸巡视检查路线Mapper接口 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Repository |
|||
public interface SzCheckingLineMapper extends BaseMapper<SzCheckingLine> { |
|||
|
|||
//根据条件查询水闸巡视检查路线
|
|||
@Select({ |
|||
"<script>", |
|||
"SELECT ", |
|||
"df.id waga_id,", |
|||
"line.waga_code waga_code, df.waga_name waga_name, df.waga_type waga_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_sz_xslx line ", |
|||
"left join att_waga_base df on line.waga_code = df.waga_code and df.expr_date is null ", |
|||
"left join bs_sgc_sz_xs xc on line.xc_id = xc.id ", |
|||
"where 1=1 ", |
|||
"<if test='dto.wagaCode != null and dto.wagaCode != \"\"'>", |
|||
"and df.waga_code = #{dto.wagaCode} ", |
|||
"</if>", |
|||
"<if test='dto.wagaName != null and dto.wagaName != \"\"'>", |
|||
"and df.waga_name like concat('%', #{dto.wagaName}, '%') ", |
|||
"</if>", |
|||
"<if test='dto.wagaType != null and dto.wagaType != \"\"'>", |
|||
"and df.waga_type = #{dto.wagaType} ", |
|||
"</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.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>", |
|||
"order by line.update_time desc ", |
|||
"</script>" |
|||
}) |
|||
@Results(value = { |
|||
@Result(property = "wagaCode", column = "waga_code"), |
|||
@Result(property = "dutyHolders", column = "waga_code", |
|||
javaType = List.class, |
|||
many = @Many(select = "com.kms.yg.sz.mapper.BsSgcSzFzrMapper.getByWagaCode")) |
|||
}) |
|||
IPage<SzCheckingLineDto> search(Page<SzPlan> page, @Param("dto") SzCheckingLineSearchDto dto); |
|||
|
|||
} |
@ -0,0 +1,30 @@ |
|||
package com.kms.yxgh.sz.mapper; |
|||
|
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.kms.yxgh.sz.domain.SzCheckingPlanContent; |
|||
import org.apache.ibatis.annotations.Insert; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.springframework.stereotype.Repository; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* 水闸巡视检查计划详情Mapper接口 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Repository |
|||
public interface SzCheckingPlanContentMapper extends BaseMapper<SzCheckingPlanContent> { |
|||
|
|||
@Insert({ |
|||
"<script>", |
|||
"INSERT INTO bs_sgc_sz_xsjhxq (plan_id, line_id, name, start_date, end_date, scope, operator, status) VALUES ", |
|||
"<foreach collection='list' item='item' index='index' separator=','>", |
|||
"(#{item.planId}, #{item.lineId}, #{item.name}, #{item.startDate}, #{item.endDate}, #{item.scope}, #{item.operator}, #{item.status})", |
|||
"</foreach>", |
|||
"</script>" |
|||
}) |
|||
void insertBatch(@Param("list") List<SzCheckingPlanContent> list); |
|||
} |
|||
|
@ -0,0 +1,148 @@ |
|||
package com.kms.yxgh.sz.service; |
|||
|
|||
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.sz.domain.BsSgcSzFzr; |
|||
import com.kms.yg.sz.domain.BsSgcSzSafeJbxx; |
|||
import com.kms.yg.sz.mapper.BsSgcSzFzrMapper; |
|||
import com.kms.yg.sz.mapper.BsSgcSzSafeJbxxMapper; |
|||
import com.kms.yxgh.base.SzException; |
|||
import com.kms.yxgh.common.dto.DutyHolderDto; |
|||
import com.kms.yxgh.sz.domain.SzCheckingLine; |
|||
import com.kms.yxgh.sz.domain.SzCheckingPlanContent; |
|||
import com.kms.yxgh.sz.domain.SzPlan; |
|||
import com.kms.yxgh.sz.dto.SzCheckingLineDto; |
|||
import com.kms.yxgh.sz.dto.SzCheckingLineExportDto; |
|||
import com.kms.yxgh.sz.dto.SzCheckingLineSearchDto; |
|||
import com.kms.yxgh.sz.mapper.SzCheckingLineMapper; |
|||
import com.kms.yxgh.sz.mapper.SzCheckingPlanContentMapper; |
|||
import com.kms.yxgh.util.BeanCopyUtils; |
|||
import com.shuili.common.core.domain.AjaxResult; |
|||
import com.shuili.common.core.domain.SearchParam; |
|||
import com.shuili.common.core.service.BaseService; |
|||
import com.shuili.common.utils.poi.ExcelUtil; |
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
import org.springframework.transaction.annotation.Transactional; |
|||
|
|||
import java.util.Arrays; |
|||
import java.util.Collections; |
|||
import java.util.List; |
|||
import java.util.Optional; |
|||
import java.util.stream.Collectors; |
|||
|
|||
/** |
|||
* 水闸巡视检查路线Service接口 |
|||
* |
|||
* @author sy |
|||
* @date 2023-11-09 |
|||
*/ |
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SzCheckingLineService extends BaseService<SzCheckingLineMapper, SzCheckingLine> { |
|||
|
|||
private final SzCheckingPlanContentMapper szCheckingPlanContentMapper; |
|||
private final BsSgcSzFzrMapper szFzrMapper; |
|||
private final SzCheckingService szCheckingService; |
|||
private final BsSgcSzSafeJbxxMapper szSafeJbxxMapper; |
|||
|
|||
public IPage<SzCheckingLineDto> search(SearchParam<SzCheckingLineSearchDto> sp) { |
|||
Page<SzPlan> page = new Page<>(sp.getPageNum(), sp.getPageSize()); |
|||
SzCheckingLineSearchDto searchDto = Optional.ofNullable(sp.getData()).orElse(new SzCheckingLineSearchDto()); |
|||
return this.baseMapper.search(page, searchDto); |
|||
} |
|||
|
|||
public SzCheckingLineDto getDetailById(String id) { |
|||
SzCheckingLine checkingLine = this.getById(id); |
|||
SzCheckingLineDto dto = BeanCopyUtils.copy(checkingLine, SzCheckingLineDto.class); |
|||
if (dto != null) { |
|||
dto.setEntries(checkingLine.getPoints()); |
|||
dto.setCheckingDetail(szCheckingService.getDetailById(dto.getXcId())); |
|||
BsSgcSzSafeJbxx sz = szSafeJbxxMapper.getByWagaCode(dto.getWagaCode()); |
|||
if (sz != null) { |
|||
dto.setWagaName(sz.getWagaName()); |
|||
dto.setWagaType(sz.getWagaType()); |
|||
} |
|||
List<BsSgcSzFzr> fzrList = szFzrMapper.selectList(Wrappers.<BsSgcSzFzr>lambdaQuery().eq(BsSgcSzFzr::getWagaCode, dto.getWagaCode())); |
|||
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 SzCheckingLineDto add(SzCheckingLineDto dto) { |
|||
SzCheckingLine checkingLine = BeanCopyUtils.copy(dto, SzCheckingLine.class); |
|||
if (checkingLine != null) { |
|||
checkingLine.setId(null); |
|||
checkingLine.setPoints(dto.getEntries()); |
|||
getBaseMapper().insert(checkingLine); |
|||
String id = checkingLine.getId(); |
|||
return this.getDetailById(id); |
|||
} |
|||
return null; |
|||
} |
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public SzCheckingLineDto update(SzCheckingLineDto dto) { |
|||
if (exist(dto.getId())) { |
|||
SzCheckingLine checkingLine = BeanCopyUtils.copy(dto, SzCheckingLine.class); |
|||
if (checkingLine != null) { |
|||
checkingLine.setPoints(dto.getEntries()); |
|||
getBaseMapper().updateById(checkingLine); |
|||
String id = checkingLine.getId(); |
|||
return this.getDetailById(id); |
|||
} |
|||
} |
|||
throw new SzException("源数据不存在,请确认id值是否正确"); |
|||
|
|||
} |
|||
|
|||
|
|||
@Transactional(rollbackFor = Exception.class) |
|||
public Boolean deleteById(String[] ids) { |
|||
if (ids.length == 1) { |
|||
if (isUsed(ids[0])) { |
|||
throw new SzException("该路线已被使用,无法删除"); |
|||
} |
|||
} |
|||
return removeByIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
private boolean isUsed(String planId) { |
|||
Wrapper<SzCheckingPlanContent> wp = Wrappers.<SzCheckingPlanContent>lambdaQuery() |
|||
.eq(SzCheckingPlanContent::getLineId, planId); |
|||
return szCheckingPlanContentMapper.selectCount(wp) > 0; |
|||
} |
|||
|
|||
private boolean exist(String id) { |
|||
Wrapper<SzCheckingLine> wp = Wrappers.<SzCheckingLine>lambdaQuery() |
|||
.eq(SzCheckingLine::getId, id); |
|||
return this.getBaseMapper().selectCount(wp) > 0; |
|||
} |
|||
|
|||
|
|||
public AjaxResult export(List<String> ids) { |
|||
List<SzCheckingLine> list = Optional.ofNullable(this.listByIds(ids)).orElse(Collections.emptyList()); |
|||
ExcelUtil<SzCheckingLineExportDto> util = new ExcelUtil<>(SzCheckingLineExportDto.class); |
|||
return util.exportExcel(list.stream().map(line -> { |
|||
SzCheckingLineExportDto exportDto = BeanCopyUtils.copy(line, SzCheckingLineExportDto.class); |
|||
if (exportDto != null) { |
|||
BsSgcSzSafeJbxx sz = szSafeJbxxMapper.getByWagaCode(exportDto.getWagaCode()); |
|||
if (sz != null) { |
|||
exportDto.setWagaName(sz.getWagaName()); |
|||
exportDto.setWagaType(sz.getWagaType()); |
|||
} |
|||
} |
|||
return exportDto; |
|||
}).collect(Collectors.toList()), "checking-line"); |
|||
} |
|||
} |
@ -0,0 +1,13 @@ |
|||
package com.kms.yxgh.sz.service; |
|||
|
|||
import com.kms.yxgh.sz.domain.SzCheckingPlanContent; |
|||
import com.kms.yxgh.sz.mapper.SzCheckingPlanContentMapper; |
|||
import com.shuili.common.core.service.BaseService; |
|||
import lombok.AllArgsConstructor; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
|
|||
@Service |
|||
@AllArgsConstructor |
|||
public class SzCheckingPlanContentService extends BaseService<SzCheckingPlanContentMapper, SzCheckingPlanContent> { |
|||
} |
Loading…
Reference in new issue