抽查日志分页,综述查询,备注内容新增,修改删除,分页查询,防汛周期配置新增,修改,删除,分页查询
parent
47cf11deca
commit
d6b81339c2
|
|
@ -58,8 +58,13 @@ public class ShAddressBookController {
|
|||
}
|
||||
|
||||
@Operation(summary = "抽查")
|
||||
@PostMapping("/setSpotCheck")
|
||||
public ResultJson setSpotCheck(@RequestBody List<Integer> ids) {
|
||||
@PostMapping("/setSpotCheck/{spotCheck}")
|
||||
public ResultJson setSpotCheck(@RequestBody List<Integer> ids,
|
||||
@PathVariable
|
||||
@ApiParam("是否抽查:0:不抽查,1:抽查")
|
||||
@Pattern(message = "仅支持 0 或者 1", regexp = "[01]")
|
||||
Integer spotCheck
|
||||
) {
|
||||
if (CollectionUtils.isEmpty(ids)){
|
||||
throw new RuntimeException("当前选中数据为空");
|
||||
}
|
||||
|
|
@ -68,7 +73,7 @@ public class ShAddressBookController {
|
|||
}
|
||||
|
||||
boolean update = service.lambdaUpdate()
|
||||
.set(ShAddressBook::getIsSpotCheck, 1)
|
||||
.set(ShAddressBook::getIsSpotCheck, spotCheck)
|
||||
.in(ShAddressBook::getId, ids)
|
||||
.update();
|
||||
|
||||
|
|
@ -148,6 +153,81 @@ public class ShAddressBookController {
|
|||
}
|
||||
|
||||
|
||||
@Operation(summary = "导出 (行政责任人分页查询 type1:行政责任人,包保责任人分页查询 type1:包保责任人,今日抽查分页查询 isSpotCheck:1 )")
|
||||
@PostMapping("/export")
|
||||
public void export(@RequestBody ShAddressBookDto dto,HttpServletResponse response) {
|
||||
|
||||
LambdaQueryChainWrapper<ShAddressBook> query = service.lambdaQuery();
|
||||
|
||||
String type1 = dto.getType1();
|
||||
if (StringUtils.isNotBlank(type1)) {
|
||||
query.eq(ShAddressBook::getType1, type1);
|
||||
}
|
||||
|
||||
String type2 = dto.getType2();
|
||||
|
||||
if (StringUtils.isNotBlank(type2)) {
|
||||
query.eq(ShAddressBook::getType2, type2);
|
||||
}
|
||||
|
||||
String isSpotCheck = dto.getIsSpotCheck();
|
||||
|
||||
if (StringUtils.isNotBlank(isSpotCheck)) {
|
||||
query.eq(ShAddressBook::getIsSpotCheck, isSpotCheck);
|
||||
}
|
||||
|
||||
String city = dto.getCity();
|
||||
|
||||
if (StringUtils.isNotBlank(city)) {
|
||||
query.eq(ShAddressBook::getCity, city);
|
||||
}
|
||||
|
||||
String county = dto.getCounty();
|
||||
|
||||
if (StringUtils.isNotBlank(county)) {
|
||||
query.eq(ShAddressBook::getCounty, county);
|
||||
}
|
||||
|
||||
String area = dto.getArea();
|
||||
|
||||
if (StringUtils.isNotBlank(area)) {
|
||||
query.eq(ShAddressBook::getArea, area);
|
||||
}
|
||||
|
||||
String village = dto.getVillage();
|
||||
|
||||
if (StringUtils.isNotBlank(village)) {
|
||||
query.eq(ShAddressBook::getVillage, village);
|
||||
}
|
||||
|
||||
String name = dto.getName();
|
||||
|
||||
if (StringUtils.isNotBlank(name)) {
|
||||
query.like(ShAddressBook::getName, name);
|
||||
}
|
||||
|
||||
String land = dto.getLand();
|
||||
|
||||
if (StringUtils.isNotBlank(land)) {
|
||||
query.like(ShAddressBook::getLand, land);
|
||||
}
|
||||
|
||||
String phone = dto.getPhone();
|
||||
|
||||
if (StringUtils.isNotBlank(phone)) {
|
||||
query.like(ShAddressBook::getPhone, phone);
|
||||
}
|
||||
|
||||
query.orderByAsc(ShAddressBook::getSort);
|
||||
|
||||
List<ShAddressBook> list = service.list(query);
|
||||
|
||||
ExcelCommon.exportExcel(list,
|
||||
null, "山洪责任人通讯录", ShAddressBook.class, "山洪责任人通讯录.xlsx",
|
||||
response);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "下载模板")
|
||||
@GetMapping("/downloadTemplate")
|
||||
|
|
|
|||
|
|
@ -1,20 +1,26 @@
|
|||
package com.whdc.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.whdc.model.dto.ShCallWordDto;
|
||||
import com.whdc.model.entity.ShCallWord;
|
||||
import com.whdc.model.group.Insert;
|
||||
import com.whdc.model.group.Update;
|
||||
import com.whdc.service.ShCallWordService;
|
||||
import com.whdc.service.ShPeriodService;
|
||||
import com.whdc.utils.ResultJson;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Date;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 备注
|
||||
* author: xusan
|
||||
|
|
@ -28,10 +34,17 @@ public class ShCallWordController {
|
|||
@Autowired
|
||||
private ShCallWordService service;
|
||||
|
||||
@Autowired
|
||||
private ShPeriodService shPeriodService;
|
||||
|
||||
|
||||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public ResultJson<ShCallWord> insert(@Validated(Insert.class) @RequestBody ShCallWord dto) {
|
||||
if (Objects.nonNull(dto.getShPeriodId()) && Objects.isNull(shPeriodService.getById(dto.getShPeriodId()))){
|
||||
throw new RuntimeException("当前防汛周期不存在");
|
||||
}
|
||||
dto.setCreateTime(new Date());
|
||||
boolean result = service.save(dto);
|
||||
return ResultJson.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -39,6 +52,12 @@ public class ShCallWordController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public ResultJson<ShCallWord> update(@Validated(Update.class) @RequestBody ShCallWord dto) {
|
||||
if (Objects.isNull(service.getById(dto.getId()))){
|
||||
throw new RuntimeException("当前数据不存在");
|
||||
}
|
||||
if (Objects.nonNull(dto.getShPeriodId()) && Objects.isNull(shPeriodService.getById(dto.getShPeriodId()))){
|
||||
throw new RuntimeException("当前防汛周期不存在");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return ResultJson.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -49,16 +68,27 @@ public class ShCallWordController {
|
|||
return ResultJson.ok(service.removeById(id));
|
||||
}
|
||||
|
||||
@Operation(summary = "列表")
|
||||
@PostMapping("/list")
|
||||
public ResultJson<List<ShCallWord>> list() {
|
||||
return ResultJson.ok(service.lambdaQuery().list());
|
||||
// @Operation(summary = "列表")
|
||||
// @PostMapping("/list")
|
||||
// public ResultJson<List<ShCallWord>> list() {
|
||||
// return ResultJson.ok(service.lambdaQuery().list());
|
||||
// }
|
||||
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public ResultJson<Page<ShCallWord>> page(@RequestBody ShCallWordDto dto) {
|
||||
LambdaQueryChainWrapper<ShCallWord> query = service.lambdaQuery();
|
||||
if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm())){
|
||||
query.between(ShCallWord::getCreateTime,dto.getStm(),dto.getEtm());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public ResultJson<Page<ShCallWord>> page() {
|
||||
return ResultJson.ok(service.page(null));
|
||||
if (StringUtils.isNotBlank(dto.getShAbType1())){
|
||||
query.eq(ShCallWord::getShAbType1,dto.getShAbType1());
|
||||
}
|
||||
|
||||
query.orderByDesc(ShCallWord::getCreateTime);
|
||||
|
||||
return ResultJson.ok(service.page(dto.getPage(),query));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -2,16 +2,18 @@ package com.whdc.controller;
|
|||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.whdc.exception.MyException;
|
||||
import com.whdc.model.dto.ShAddressBookDto;
|
||||
import com.whdc.model.dto.ShCallsDto;
|
||||
import com.whdc.model.entity.ShAddressBook;
|
||||
import com.whdc.model.entity.ShCallWord;
|
||||
import com.whdc.model.entity.ShCalls;
|
||||
import com.whdc.model.group.Insert;
|
||||
import com.whdc.model.vo.ShCallsTodayVo;
|
||||
import com.whdc.model.vo.ShCallsVo;
|
||||
import com.whdc.service.ShAddressBookService;
|
||||
import com.whdc.service.ShCallsService;
|
||||
import com.whdc.utils.DateUtils;
|
||||
import com.whdc.utils.ExcelCommon;
|
||||
import com.whdc.utils.ResultJson;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
|
|
@ -23,9 +25,12 @@ import org.springframework.web.bind.annotation.RequestBody;
|
|||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.time.format.DateTimeFormatter;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* 描述: 抽查日志
|
||||
|
|
@ -81,18 +86,47 @@ public class ShCallsController {
|
|||
return ResultJson.ok(query.list());
|
||||
}
|
||||
|
||||
@Operation(summary = "今日抽查分页")
|
||||
@PostMapping("/pageToday")
|
||||
public ResultJson<IPage<ShCallsTodayVo>> pageToday(@RequestBody ShCallsDto dto) {
|
||||
@Operation(summary = "抽查日志分页")
|
||||
@PostMapping("/page")
|
||||
public ResultJson<IPage<ShCallsVo>> page(@RequestBody ShCallsDto dto) {
|
||||
return ResultJson.ok(service.page(dto));
|
||||
}
|
||||
|
||||
@Operation(summary = "综述")
|
||||
@PostMapping("/statistics")
|
||||
public ResultJson<String> statistics(@RequestBody ShCallsDto dto) {
|
||||
|
||||
List<ShCallsVo> list = service.list(dto);
|
||||
|
||||
String dateStr = dto.getDate().format(DateTimeFormatter.ofPattern(DateUtils.DATE_PATTERN));
|
||||
List<String> citys = list.stream().map(ShCallsVo::getCity).distinct().collect(Collectors.toList());
|
||||
List<String> countys = list.stream().map(ShCallsVo::getCounty).distinct().collect(Collectors.toList());
|
||||
|
||||
return ResultJson.ok(String.format("%%抽查了%%个市(%%)%%个县(%%)县乡村山洪灾害防御责任人和包保责任人共计%%人。",
|
||||
dateStr,
|
||||
citys.size(),
|
||||
StringUtils.join(citys, ","),
|
||||
countys.size(),
|
||||
StringUtils.join(countys, ","),
|
||||
list.stream().map(ShCallsVo::getPhone).distinct().count()
|
||||
));
|
||||
}
|
||||
|
||||
|
||||
|
||||
@Operation(summary = "抽查日志导出(未完成)")
|
||||
@PostMapping("/export")
|
||||
public void export(@RequestBody ShAddressBookDto dto, HttpServletResponse response) {
|
||||
|
||||
@Operation(summary = "抽查日志分页")
|
||||
@PostMapping("/page")
|
||||
public ResultJson<Page<ShCalls>> page(@RequestBody ShCallsDto dto) {
|
||||
LambdaQueryChainWrapper<ShCalls> query = service.lambdaQuery();
|
||||
return ResultJson.ok(service.page(dto.getPage(), query));
|
||||
|
||||
query.orderByDesc(ShCalls::getCallTime);
|
||||
|
||||
List<ShCalls> list = service.list(query);
|
||||
|
||||
ExcelCommon.exportExcel(list,
|
||||
null, "抽查日志", ShCalls.class, "抽查日志.xlsx",
|
||||
response);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
package com.whdc.controller;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.whdc.model.dto.ShPeriodDto;
|
||||
import com.whdc.model.entity.ShPeriod;
|
||||
import com.whdc.model.group.Insert;
|
||||
import com.whdc.model.group.Update;
|
||||
|
|
@ -9,12 +11,15 @@ import com.whdc.utils.ResultJson;
|
|||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* 描述: 防汛周期
|
||||
* author: xusan
|
||||
|
|
@ -32,6 +37,9 @@ public class ShPeriodController {
|
|||
@Operation(summary = "新增")
|
||||
@PostMapping("/insert")
|
||||
public ResultJson<ShPeriod> insert(@Validated(Insert.class) @RequestBody ShPeriod dto) {
|
||||
if (service.lambdaQuery().eq(ShPeriod::getName, dto.getName()).count() > 0){
|
||||
throw new RuntimeException("名称重复");
|
||||
}
|
||||
boolean result = service.save(dto);
|
||||
return ResultJson.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -39,6 +47,12 @@ public class ShPeriodController {
|
|||
@Operation(summary = "修改")
|
||||
@PostMapping("/update")
|
||||
public ResultJson<ShPeriod> update(@Validated(Update.class) @RequestBody ShPeriod dto) {
|
||||
if (service.lambdaQuery()
|
||||
.eq(ShPeriod::getName, dto.getName())
|
||||
.ne(ShPeriod::getId, dto.getId())
|
||||
.count() > 0){
|
||||
throw new RuntimeException("名称重复");
|
||||
}
|
||||
boolean result = service.updateById(dto);
|
||||
return ResultJson.ok(result ? dto : null);
|
||||
}
|
||||
|
|
@ -55,10 +69,23 @@ public class ShPeriodController {
|
|||
return ResultJson.ok(service.lambdaQuery().list());
|
||||
}
|
||||
|
||||
// @Operation(summary = "分页")
|
||||
// @PostMapping("/page")
|
||||
public ResultJson<Page<ShPeriod>> page() {
|
||||
return ResultJson.ok(service.page(null));
|
||||
@Operation(summary = "分页")
|
||||
@PostMapping("/page")
|
||||
public ResultJson<Page<ShPeriod>> page(@RequestBody ShPeriodDto dto) {
|
||||
LambdaQueryChainWrapper<ShPeriod> query = service.lambdaQuery();
|
||||
if (Objects.nonNull(dto.getStm()) && Objects.nonNull(dto.getEtm())){
|
||||
query.between(ShPeriod::getCreateTime,dto.getStm(),dto.getEtm());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(dto.getName())){
|
||||
query.eq(ShPeriod::getName,dto.getName());
|
||||
}
|
||||
|
||||
query.orderByDesc(ShPeriod::getCreateTime);
|
||||
|
||||
return ResultJson.ok(service.page(dto.getPage(),query));
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
@ -4,10 +4,11 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
|||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.whdc.model.dto.ShCallsDto;
|
||||
import com.whdc.model.entity.ShCalls;
|
||||
import com.whdc.model.vo.ShCallsTodayVo;
|
||||
import com.whdc.model.vo.ShCallsVo;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 抽查日志
|
||||
|
|
@ -17,7 +18,8 @@ import org.apache.ibatis.annotations.Select;
|
|||
@Mapper
|
||||
public interface ShCallsMapper extends BaseMapper<ShCalls> {
|
||||
|
||||
@Select("")
|
||||
IPage<ShCallsTodayVo> page(@Param("page") IPage<ShCallsTodayVo> page, @Param("dto") ShCallsDto dto);
|
||||
IPage<ShCallsVo> page(@Param("page") IPage<ShCallsVo> page, @Param("dto") ShCallsDto dto);
|
||||
|
||||
List<ShCallsVo> page(@Param("dto") ShCallsDto dto);
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.whdc.model.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/7/31.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(description = "备注内容配置分页查询")
|
||||
public class ShCallWordDto extends FindPageDto {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private Date stm;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private Date etm;
|
||||
|
||||
@Schema(description="责任人类型1 行政责任人,包保责任人")
|
||||
private String shAbType1;
|
||||
|
||||
}
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
package com.whdc.model.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
* Created by XuSan on 2024/7/31.
|
||||
*
|
||||
* @author XuSan
|
||||
* @version 1.0
|
||||
*/
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@ApiModel(description = "防汛周期配置分页查询")
|
||||
public class ShPeriodDto extends FindPageDto {
|
||||
|
||||
|
||||
@ApiModelProperty(value = "开始时间")
|
||||
private Date stm;
|
||||
|
||||
@ApiModelProperty(value = "结束时间")
|
||||
private Date etm;
|
||||
|
||||
@Schema(description="防汛周期")
|
||||
private String name;
|
||||
|
||||
}
|
||||
|
|
@ -5,11 +5,15 @@ import com.baomidou.mybatisplus.annotation.IdType;
|
|||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.whdc.model.group.Update;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 描述: 备注
|
||||
|
|
@ -30,6 +34,7 @@ public class ShCallWord implements Serializable {
|
|||
*/
|
||||
@TableId(value="id", type= IdType.AUTO)
|
||||
@Schema(description="主键id")
|
||||
@NotNull(message = "主键id不能为空",groups = Update.class)
|
||||
@Size(max = 4,message = "主键id最大长度要小于 4")
|
||||
private Integer id;
|
||||
|
||||
|
|
@ -57,4 +62,12 @@ public class ShCallWord implements Serializable {
|
|||
@Size(max = 50,message = "责任人类型1 行政责任人,包保责任人最大长度要小于 50")
|
||||
private String shAbType1;
|
||||
|
||||
/**
|
||||
* 责任人类型1 行政责任人,包保责任人
|
||||
*/
|
||||
@TableField(value="create_time")
|
||||
@Schema(description="创建时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date createTime;
|
||||
|
||||
}
|
||||
|
|
@ -91,4 +91,12 @@ public class ShCalls implements Serializable {
|
|||
@Pattern(message = "通话类型: 0:拨打,1:回拨", regexp = "[01]")
|
||||
private String type;
|
||||
|
||||
/**
|
||||
* 叫应备注
|
||||
*/
|
||||
@TableField(value="remark")
|
||||
@Schema(description="叫应备注")
|
||||
@Size(max = 500,message = "叫应备注")
|
||||
private String remark;
|
||||
|
||||
}
|
||||
|
|
@ -1,13 +1,13 @@
|
|||
package com.whdc.model.vo;
|
||||
|
||||
import com.baomidou.mybatisplus.annotation.TableField;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import com.whdc.model.entity.ShAddressBook;
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.Size;
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* Description:
|
||||
|
|
@ -17,18 +17,20 @@ import javax.validation.constraints.Size;
|
|||
* @version 1.0
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Schema(description = "今日抽查分页视图")
|
||||
@Schema(description = "抽查日志分页视图")
|
||||
@Data
|
||||
@Accessors(chain = true)
|
||||
public class ShCallsTodayVo extends ShAddressBook {
|
||||
public class ShCallsVo extends ShAddressBook {
|
||||
|
||||
|
||||
/**
|
||||
* 是否接听0:否,1是
|
||||
*/
|
||||
@TableField(value="status")
|
||||
@Schema(description="是否接听0:否,1是")
|
||||
@Size(max = 2,message = "是否接听0:否,1是最大长度要小于 2")
|
||||
private String status;
|
||||
|
||||
@Schema(description="抽查时间")
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
|
||||
private Date callTime;
|
||||
|
||||
@Schema(description="山洪通讯录编号")
|
||||
private Integer shAbId;
|
||||
|
||||
}
|
||||
|
|
@ -5,7 +5,9 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
|||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.whdc.model.dto.ShCallsDto;
|
||||
import com.whdc.model.entity.ShCalls;
|
||||
import com.whdc.model.vo.ShCallsTodayVo;
|
||||
import com.whdc.model.vo.ShCallsVo;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 描述: 抽查日志
|
||||
|
|
@ -15,7 +17,9 @@ import com.whdc.model.vo.ShCallsTodayVo;
|
|||
public interface ShCallsService extends IService<ShCalls>
|
||||
{
|
||||
|
||||
IPage<ShCallsTodayVo> page(ShCallsDto dto);
|
||||
IPage<ShCallsVo> page(ShCallsDto dto);
|
||||
|
||||
List<ShCallsVo> list(ShCallsDto dto);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -5,10 +5,12 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|||
import com.whdc.mapper.ShCallsMapper;
|
||||
import com.whdc.model.dto.ShCallsDto;
|
||||
import com.whdc.model.entity.ShCalls;
|
||||
import com.whdc.model.vo.ShCallsTodayVo;
|
||||
import com.whdc.model.vo.ShCallsVo;
|
||||
import com.whdc.service.ShCallsService;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static com.whdc.model.MyConstant.REDIS_KEY;
|
||||
|
||||
|
||||
|
|
@ -23,7 +25,12 @@ public class ShCallsServiceImpl extends ServiceImpl<ShCallsMapper, ShCalls> impl
|
|||
private static final String THIS_REDIS_KEY = REDIS_KEY + ShCalls.thisTableName + ":";
|
||||
|
||||
@Override
|
||||
public IPage<ShCallsTodayVo> page(ShCallsDto dto) {
|
||||
public IPage<ShCallsVo> page(ShCallsDto dto) {
|
||||
return this.getBaseMapper().page(dto.getPage(),dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ShCallsVo> list(ShCallsDto dto) {
|
||||
return this.getBaseMapper().page(dto);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,7 @@ public class DateUtils {
|
|||
* 时间格式(yyyy-MM-dd HH:mm:ss)
|
||||
*/
|
||||
public final static String DATE_TIME_PATTERN = "yyyy-MM-dd HH:mm:ss";
|
||||
public final static String DATE_PATTERN = "yyyy年MM月dd日";
|
||||
|
||||
|
||||
public static final ThreadLocal<SimpleDateFormat> sdfhmsS = new ThreadLocal<SimpleDateFormat>() {
|
||||
|
|
|
|||
|
|
@ -2,4 +2,51 @@
|
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.whdc.mapper.ShCallsMapper">
|
||||
|
||||
<select id="page" resultType="com.whdc.model.vo.ShCallsVo">
|
||||
SELECT
|
||||
C.STATUS,
|
||||
C.CALL_TIME,
|
||||
C.SH_AB_ID,
|
||||
AB.*
|
||||
FROM
|
||||
FXKH_TXL.SH_CALLS C
|
||||
LEFT JOIN FXKH_TXL.SH_ADDRESS_BOOK AB ON C.SH_AB_ID = AB.ID
|
||||
WHERE
|
||||
1 = 1
|
||||
<if test="dto.date != null and dto.date != '' ">
|
||||
AND C.CALL_TIME BETWEEN '${dto.date} 00:00:00' AND '${dto.date} 23:59:59'
|
||||
</if>
|
||||
<if test="dto.status != null and dto.status != '' ">
|
||||
AND C.STATUS = #{dto.status}
|
||||
</if>
|
||||
<if test="dto.shAbId != null and dto.shAbId != '' ">
|
||||
AND C.SH_AB_ID = #{dto.shAbId}
|
||||
</if>
|
||||
<if test="dto.phone != null and dto.phone != '' ">
|
||||
AND AB.PHONE = #{dto.phone}
|
||||
</if>
|
||||
<if test="dto.land != null and dto.land != '' ">
|
||||
AND AB.LAND = #{dto.land}
|
||||
</if>
|
||||
<if test="dto.type2 != null and dto.type2 != '' ">
|
||||
AND AB.TYPE2 = #{dto.type2}
|
||||
</if>
|
||||
<if test="dto.city != null and dto.city != '' ">
|
||||
AND AB.CITY = #{dto.city}
|
||||
</if>
|
||||
<if test="dto.county != null and dto.county != '' ">
|
||||
AND AB.COUNTY = #{dto.county}
|
||||
</if>
|
||||
<if test="dto.village != null and dto.village != '' ">
|
||||
AND AB.VILLAGE = #{dto.village}
|
||||
</if>
|
||||
<if test="dto.area != null and dto.area != '' ">
|
||||
AND AB.AREA = #{dto.area}
|
||||
</if>
|
||||
<if test="dto.name != null and dto.name != '' ">
|
||||
AND AB.NAME LIKE CONCAT('%', #{dto.name}, '%')
|
||||
</if>
|
||||
ORDER BY C.CALL_TIME DESC
|
||||
</select>
|
||||
|
||||
</mapper>
|
||||
|
|
|
|||
Loading…
Reference in New Issue