14 changed files with 626 additions and 2 deletions
@ -0,0 +1,65 @@ |
|||||
|
package com.kms.yxgh.sz.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.kms.yxgh.base.Response; |
||||
|
import com.kms.yxgh.sz.dto.SzOperaRecordDto; |
||||
|
import com.kms.yxgh.sz.service.SzOperaRecordService; |
||||
|
import com.shuili.common.core.domain.SearchParam; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import io.swagger.annotations.ApiOperation; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzOperaRecordController |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 下午2:46 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
|
||||
|
@RestController |
||||
|
@RequestMapping("/run/sz/opera-record") |
||||
|
@AllArgsConstructor |
||||
|
@Api(tags = "水闸操作记录管理") |
||||
|
public class SzOperaRecordController { |
||||
|
|
||||
|
private final SzOperaRecordService szOperaRecordService; |
||||
|
|
||||
|
//操作记录列表
|
||||
|
@PostMapping("/list") |
||||
|
@ApiOperation("操作记录列表") |
||||
|
public IPage<SzOperaRecordDto> list(@RequestBody SearchParam<SzOperaRecordDto> sp) { |
||||
|
return szOperaRecordService.search(sp); |
||||
|
} |
||||
|
|
||||
|
//操作记录详情
|
||||
|
@GetMapping("/{id}") |
||||
|
@ApiOperation("操作记录详情") |
||||
|
public Response<SzOperaRecordDto> detail(@PathVariable String id) { |
||||
|
return Response.ok(szOperaRecordService.detail(id)); |
||||
|
} |
||||
|
|
||||
|
//操作记录新增
|
||||
|
@PostMapping("") |
||||
|
@ApiOperation("操作记录新增") |
||||
|
public Response<SzOperaRecordDto> add(@RequestBody SzOperaRecordDto dto) { |
||||
|
return Response.ok(szOperaRecordService.add(dto)); |
||||
|
} |
||||
|
|
||||
|
//操作记录修改
|
||||
|
@PutMapping("") |
||||
|
@ApiOperation("操作记录修改") |
||||
|
public Response<SzOperaRecordDto> update(@RequestBody SzOperaRecordDto dto) { |
||||
|
return Response.ok(szOperaRecordService.modify(dto)); |
||||
|
} |
||||
|
//操作记录删除
|
||||
|
|
||||
|
@DeleteMapping("/{id}") |
||||
|
@ApiOperation("操作记录删除") |
||||
|
public Response<Boolean> delete(@PathVariable String id) { |
||||
|
return Response.ok(szOperaRecordService.delete(id)); |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,67 @@ |
|||||
|
package com.kms.yxgh.sz.controller; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.kms.yxgh.base.Response; |
||||
|
import com.kms.yxgh.sz.dto.SzSchedulingDto; |
||||
|
import com.kms.yxgh.sz.service.SzSchedulingService; |
||||
|
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.web.bind.annotation.*; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzSchedulingController |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 上午11:06 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
@RestController |
||||
|
@AllArgsConstructor |
||||
|
@RequestMapping("/run/sz/scheduling") |
||||
|
@Api(tags = "水闸调度计划管理") |
||||
|
public class SzSchedulingController { |
||||
|
|
||||
|
private final SzSchedulingService szSchedulingService; |
||||
|
|
||||
|
//调度计划列表
|
||||
|
@PostMapping("/list") |
||||
|
@ApiOperation("调度计划列表") |
||||
|
public IPage<SzSchedulingDto> list(@RequestBody SearchParam<SzSchedulingDto> sp) { |
||||
|
return szSchedulingService.search(sp); |
||||
|
} |
||||
|
//调度计划详情
|
||||
|
@GetMapping("/{id}") |
||||
|
@ApiOperation("调度计划详情") |
||||
|
public Response<SzSchedulingDto> detail(@PathVariable String id) { |
||||
|
return Response.ok(szSchedulingService.detail(id)); |
||||
|
} |
||||
|
|
||||
|
//调度计划新增
|
||||
|
@PostMapping("") |
||||
|
@ApiOperation("调度计划新增") |
||||
|
@Log(title = "调度计划新增", businessType = BusinessType.INSERT) |
||||
|
public Response<SzSchedulingDto> add(@RequestBody SzSchedulingDto dto) { |
||||
|
return Response.ok(szSchedulingService.add(dto)); |
||||
|
} |
||||
|
|
||||
|
//调度计划修改
|
||||
|
@PutMapping("") |
||||
|
@ApiOperation("调度计划修改") |
||||
|
@Log(title = "调度计划修改", businessType = BusinessType.UPDATE) |
||||
|
public Response<SzSchedulingDto> update(@RequestBody SzSchedulingDto dto) { |
||||
|
return Response.ok(szSchedulingService.modify(dto)); |
||||
|
} |
||||
|
|
||||
|
//调度计划删除
|
||||
|
@DeleteMapping("/{id}") |
||||
|
@ApiOperation("调度计划删除") |
||||
|
@Log(title = "调度计划删除", businessType = BusinessType.DELETE) |
||||
|
public Response<Boolean> delete(@PathVariable String id) { |
||||
|
return Response.ok(szSchedulingService.delete(id)); |
||||
|
} |
||||
|
} |
@ -0,0 +1,59 @@ |
|||||
|
package com.kms.yxgh.sz.domain; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzOperaRecord |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 下午2:43 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
@TableName("bs_sgc_sz_czjl") |
||||
|
@Data |
||||
|
@ApiModel("水闸操作记录") |
||||
|
public class SzOperaRecord extends SyBaseEntity { |
||||
|
@ApiModelProperty(value = "水闸编码") |
||||
|
private String wagaCode; |
||||
|
|
||||
|
@ApiModelProperty(value = "闸门") |
||||
|
private String gate; |
||||
|
|
||||
|
@ApiModelProperty(value = "闸号") |
||||
|
private String gateNum; |
||||
|
|
||||
|
@ApiModelProperty(value = "指令号") |
||||
|
private String commandNum; |
||||
|
|
||||
|
@ApiModelProperty(value = "控制水位") |
||||
|
private Float controlLevel; |
||||
|
|
||||
|
@ApiModelProperty(value = "左干") |
||||
|
private Float leftDry; |
||||
|
|
||||
|
@ApiModelProperty(value = "右干") |
||||
|
private Float rightDry; |
||||
|
|
||||
|
@ApiModelProperty(value = "上游水位") |
||||
|
private Float upstreamLevel; |
||||
|
|
||||
|
@ApiModelProperty(value = "下游水位") |
||||
|
private Float downstreamLevel; |
||||
|
|
||||
|
@ApiModelProperty(value = "开度") |
||||
|
private Float opening; |
||||
|
|
||||
|
@ApiModelProperty(value = "操作时间") |
||||
|
private Date operatorTime; |
||||
|
|
||||
|
@TableField(exist = false) |
||||
|
private String remark; |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
package com.kms.yxgh.sz.domain; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzScheduling |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 上午10:02 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableField; |
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.kms.yxgh.base.SyBaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
@TableName("bs_sgc_sz_ddjh") |
||||
|
@Data |
||||
|
@ApiModel("水闸调度计划") |
||||
|
public class SzScheduling extends SyBaseEntity { |
||||
|
|
||||
|
private String wagaCode; |
||||
|
private String name; |
||||
|
private String doc; |
||||
|
|
||||
|
@TableField(exist = false) |
||||
|
private String remark; |
||||
|
} |
@ -0,0 +1,56 @@ |
|||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzOperaRecordDto |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 下午2:49 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel(value = "操作记录") |
||||
|
public class SzOperaRecordDto { |
||||
|
|
||||
|
@ApiModelProperty(value = "主键") |
||||
|
private String id; |
||||
|
@ApiModelProperty(value = "水闸编码") |
||||
|
private String wagaCode; |
||||
|
@ApiModelProperty(value = "闸门") |
||||
|
private String gate; |
||||
|
@ApiModelProperty(value = "闸号") |
||||
|
private String gateNum; |
||||
|
@ApiModelProperty(value = "指令号") |
||||
|
private String commandNum; |
||||
|
@ApiModelProperty(value = "控制水位") |
||||
|
private Float controlLevel; |
||||
|
@ApiModelProperty(value = "左干") |
||||
|
private Float leftDry; |
||||
|
@ApiModelProperty(value = "右干") |
||||
|
private Float rightDry; |
||||
|
@ApiModelProperty(value = "上游水位") |
||||
|
private Float upstreamLevel; |
||||
|
@ApiModelProperty(value = "下游水位") |
||||
|
private Float downstreamLevel; |
||||
|
@ApiModelProperty(value = "开度") |
||||
|
private Float opening; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
@ApiModelProperty(value = "操作时间") |
||||
|
private Date operatorTime; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
@ApiModelProperty(value = "创建时间") |
||||
|
private Date createTime; |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
@ApiModelProperty(value = "更新时间") |
||||
|
private Date updateTime; |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,74 @@ |
|||||
|
package com.kms.yxgh.sz.dto; |
||||
|
|
||||
|
import com.alibaba.fastjson.annotation.JSONField; |
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import com.fasterxml.jackson.annotation.JsonIgnore; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzSchedulingDto |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 上午11:19 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
|
||||
|
@Data |
||||
|
@ApiModel(value = "水闸调度计划管理") |
||||
|
public class SzSchedulingDto { |
||||
|
|
||||
|
@ApiModelProperty(value = "调度计划id") |
||||
|
private String id; |
||||
|
|
||||
|
@ApiModelProperty(value = "水闸编码") |
||||
|
private String wagaCode; |
||||
|
|
||||
|
@ApiModelProperty(value = "计划名称") |
||||
|
private String planName; |
||||
|
//水闸名称
|
||||
|
@ApiModelProperty(value = "水闸名称") |
||||
|
private String wagaName; |
||||
|
//主管单位
|
||||
|
@ApiModelProperty(value = "主管单位") |
||||
|
private String engineeringManagementUnit; |
||||
|
|
||||
|
@ApiModelProperty(value = "文件") |
||||
|
private List<Doc> docs; |
||||
|
|
||||
|
@JSONField(serialize = false) |
||||
|
@JsonIgnore |
||||
|
private String docStr; |
||||
|
|
||||
|
@ApiModelProperty(value = "创建时间") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
private String createTime; |
||||
|
|
||||
|
@ApiModelProperty(value = "更新时间") |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") |
||||
|
private String updateTime; |
||||
|
|
||||
|
//责任人
|
||||
|
@ApiModelProperty(value = "责任人") |
||||
|
private List<Person> chargePerson; |
||||
|
|
||||
|
@Data |
||||
|
public static class Person { |
||||
|
@ApiModelProperty(value = "人员id") |
||||
|
private String id; |
||||
|
@ApiModelProperty(value = "人员名称") |
||||
|
private String name; |
||||
|
} |
||||
|
|
||||
|
@Data |
||||
|
public static class Doc { |
||||
|
@ApiModelProperty(value = "文档名称") |
||||
|
private String name; |
||||
|
@ApiModelProperty(value = "文档url") |
||||
|
private String url; |
||||
|
} |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.kms.yxgh.sz.mapper; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.kms.yxgh.sz.domain.SzOperaRecord; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzOperaRecordMapper |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 下午2:44 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
|
||||
|
@Repository |
||||
|
public interface SzOperaRecordMapper extends BaseMapper<SzOperaRecord> { |
||||
|
} |
@ -0,0 +1,45 @@ |
|||||
|
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.SzScheduling; |
||||
|
import com.kms.yxgh.sz.dto.SzSchedulingDto; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
import org.apache.ibatis.annotations.Select; |
||||
|
import org.springframework.stereotype.Repository; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzSchedulingMapper |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 上午11:08 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
|
||||
|
@Repository |
||||
|
public interface SzSchedulingMapper extends BaseMapper<SzScheduling> { |
||||
|
|
||||
|
@Select("<script>" + |
||||
|
"SELECT sz.id, sz.waga_code, sz.name as plan_name, jb.waga_name , sz.create_time, sz.update_time " + |
||||
|
"FROM bs_sgc_sz_ddjh sz " + |
||||
|
"LEFT JOIN bs_sgc_sz_jbxx jb ON sz.waga_code = jb.waga_code and jb.expr_date is null " + |
||||
|
"WHERE 1=1 " + |
||||
|
"<if test='dto.wagaCode != null and dto.wagaCode != \"\"'> " + |
||||
|
"AND sz.waga_code = #{dto.wagaCode} " + |
||||
|
"</if>" + |
||||
|
"<if test='dto.planName != null and dto.planName != \"\"'> " + |
||||
|
"AND sz.name LIKE CONCAT('%', #{dto.planName}, '%') " + |
||||
|
"</if>" + |
||||
|
"</script>") |
||||
|
IPage<SzSchedulingDto> search(Page<SzScheduling> page, @Param("dto") SzSchedulingDto dto); |
||||
|
|
||||
|
//调度计划详情
|
||||
|
@Select("SELECT sz.id, sz.waga_code, sz.name as plan_name, jb.waga_name as waga_name, sz.doc as docStr , sz.create_time, sz.update_time, jd.engineering_management_unit engineering_management_unit " + |
||||
|
"FROM bs_sgc_sz_ddjh sz " + |
||||
|
"LEFT JOIN bs_sgc_sz_jbxx jb ON sz.waga_code = jb.waga_code and jb.expr_date is null " + |
||||
|
"LEFT JOIN bs_sgc_sz_gcgl jd ON sz.waga_code = jd.waga_code and jd.expr_date is null " + |
||||
|
"WHERE sz.id = #{id}") |
||||
|
SzSchedulingDto selectDetailById(String id); |
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
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.yxgh.sz.domain.SzOperaRecord; |
||||
|
import com.kms.yxgh.sz.dto.SzOperaRecordDto; |
||||
|
import com.kms.yxgh.sz.mapper.SzOperaRecordMapper; |
||||
|
import com.kms.yxgh.util.BeanCopyUtils; |
||||
|
import com.shuili.common.core.domain.SearchParam; |
||||
|
import com.shuili.common.core.service.BaseService; |
||||
|
import com.shuili.common.utils.StringUtils; |
||||
|
import lombok.AllArgsConstructor; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzOperaRecordService |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 下午2:45 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
|
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class SzOperaRecordService extends BaseService<SzOperaRecordMapper, SzOperaRecord> { |
||||
|
//针对闸门、指令号、闸号进行关键词模糊检索
|
||||
|
public IPage<SzOperaRecordDto> search(SearchParam<SzOperaRecordDto> sp) { |
||||
|
IPage<SzOperaRecord> page = new Page<>(sp.getPageNum(), sp.getPageSize()); |
||||
|
SzOperaRecordDto dto = sp.getData(); |
||||
|
if (dto != null) { |
||||
|
Wrapper<SzOperaRecord> wrapper = Wrappers.<SzOperaRecord>lambdaQuery() |
||||
|
.eq(SzOperaRecord::getWagaCode, dto.getWagaCode()) |
||||
|
.like(StringUtils.isNotEmpty(dto.getGate()), SzOperaRecord::getGate, dto.getGate()) |
||||
|
.like(StringUtils.isNotEmpty(dto.getCommandNum()), SzOperaRecord::getCommandNum, dto.getCommandNum()) |
||||
|
.like(StringUtils.isNotEmpty(dto.getGateNum()), SzOperaRecord::getGateNum, dto.getGateNum()); |
||||
|
IPage<SzOperaRecord> iPage = baseMapper.selectPage(page, wrapper); |
||||
|
return iPage.convert(item -> BeanCopyUtils.copy(item, SzOperaRecordDto.class)); |
||||
|
} else { |
||||
|
return new Page<>(); |
||||
|
} |
||||
|
|
||||
|
} |
||||
|
|
||||
|
public SzOperaRecordDto detail(String id) { |
||||
|
SzOperaRecord entity = baseMapper.selectById(id); |
||||
|
return BeanCopyUtils.copy(entity, SzOperaRecordDto.class); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public SzOperaRecordDto add(SzOperaRecordDto dto) { |
||||
|
SzOperaRecord entity = BeanCopyUtils.copy(dto, SzOperaRecord.class); |
||||
|
baseMapper.insert(entity); |
||||
|
return BeanCopyUtils.copy(entity, SzOperaRecordDto.class); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public SzOperaRecordDto modify(SzOperaRecordDto dto) { |
||||
|
SzOperaRecord entity = BeanCopyUtils.copy(dto, SzOperaRecord.class); |
||||
|
baseMapper.updateById(entity); |
||||
|
return BeanCopyUtils.copy(entity, SzOperaRecordDto.class); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public Boolean delete(String id) { |
||||
|
return baseMapper.deleteById(id) > 0; |
||||
|
} |
||||
|
} |
@ -0,0 +1,71 @@ |
|||||
|
package com.kms.yxgh.sz.service; |
||||
|
|
||||
|
import com.alibaba.fastjson.JSON; |
||||
|
import com.alibaba.fastjson.TypeReference; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
||||
|
import com.kms.yxgh.sz.domain.SzScheduling; |
||||
|
import com.kms.yxgh.sz.dto.SzSchedulingDto; |
||||
|
import com.kms.yxgh.sz.mapper.SzSchedulingMapper; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* @ClassName: SzSchedulingService |
||||
|
* @Description: TODO |
||||
|
* @Date: 2024/3/12 上午11:07 |
||||
|
* * |
||||
|
* @author: hxh |
||||
|
* @version: 1.0 |
||||
|
*/ |
||||
|
|
||||
|
@Service |
||||
|
@AllArgsConstructor |
||||
|
public class SzSchedulingService extends BaseService<SzSchedulingMapper, SzScheduling> { |
||||
|
|
||||
|
|
||||
|
public IPage<SzSchedulingDto> search(SearchParam<SzSchedulingDto> sp) { |
||||
|
Page<SzScheduling> page = new Page<>(sp.getPageNum(), sp.getPageSize()); |
||||
|
SzSchedulingDto dto = sp.getData(); |
||||
|
return baseMapper.search(page, dto); |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public SzSchedulingDto add(SzSchedulingDto dto) { |
||||
|
SzScheduling entity = new SzScheduling(); |
||||
|
entity.setWagaCode(dto.getWagaCode()); |
||||
|
entity.setName(dto.getPlanName()); |
||||
|
entity.setDoc(JSON.toJSONString(dto.getDocs())); |
||||
|
baseMapper.insert(entity); |
||||
|
dto.setId(entity.getId()); |
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public SzSchedulingDto modify(SzSchedulingDto dto) { |
||||
|
SzScheduling entity = new SzScheduling(); |
||||
|
entity.setId(dto.getId()); |
||||
|
entity.setWagaCode(dto.getWagaCode()); |
||||
|
entity.setName(dto.getPlanName()); |
||||
|
entity.setDoc(JSON.toJSONString(dto.getDocs())); |
||||
|
baseMapper.updateById(entity); |
||||
|
return dto; |
||||
|
} |
||||
|
|
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
public Boolean delete(String id) { |
||||
|
return baseMapper.deleteById(id) > 0; |
||||
|
} |
||||
|
|
||||
|
public SzSchedulingDto detail(String id) { |
||||
|
SzSchedulingDto dto = baseMapper.selectDetailById(id); |
||||
|
dto.setDocs(JSON.parseObject(dto.getDocStr(), new TypeReference<List<SzSchedulingDto.Doc>>() { |
||||
|
})); |
||||
|
return dto; |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue