山洪责任人修改,分页查询,抽查日志新增,综述,抽查日志导出,分页查询,备注内容新增修改,防汛周期新增,修改等接口自测修改
parent
694b2defde
commit
a8dedb325e
|
|
@ -26,6 +26,9 @@ import javax.validation.constraints.Pattern;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
|
||||||
|
import static com.whdc.model.MyConstant.DEL;
|
||||||
|
import static com.whdc.model.MyConstant.REC;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述: 山洪责任人通讯录
|
* 描述: 山洪责任人通讯录
|
||||||
* author: xusan
|
* author: xusan
|
||||||
|
|
@ -43,19 +46,36 @@ public class ShAddressBookController {
|
||||||
@ApiOperation(value = "修改")
|
@ApiOperation(value = "修改")
|
||||||
@PostMapping("/update")
|
@PostMapping("/update")
|
||||||
public ResultJson<ShAddressBook> update(@Validated(Update.class) @RequestBody ShAddressBook dto) {
|
public ResultJson<ShAddressBook> update(@Validated(Update.class) @RequestBody ShAddressBook dto) {
|
||||||
if (Objects.isNull(service.getById(dto.getId()))){
|
ShAddressBook dbData = service.getById(dto.getId());
|
||||||
|
if (Objects.isNull(dbData)){
|
||||||
throw new MyException("当前数据不存在");
|
throw new MyException("当前数据不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
dto
|
boolean result;
|
||||||
.setLand(null)
|
// 判断是新增还是修改 名字相同是修改
|
||||||
.setCity(null)
|
if (StringUtils.isNotBlank(dto.getName()) && StringUtils.isNotBlank(dbData.getName()) && !dto.getName().equals(dbData.getName())){
|
||||||
.setCounty(null)
|
dbData
|
||||||
.setArea(null)
|
.setName(dto.getName())
|
||||||
.setVillage(null)
|
.setPhone(dto.getPhone())
|
||||||
.setType2(null)
|
.setPosition(dto.getPosition());
|
||||||
.setType1(null);
|
result = service.updateById(dbData);
|
||||||
boolean result = service.updateById(dto);
|
}else{
|
||||||
|
// 删除原数据
|
||||||
|
boolean update = service.lambdaUpdate().set(ShAddressBook::getDel, DEL)
|
||||||
|
.eq(ShAddressBook::getId, dto.getId())
|
||||||
|
.update();
|
||||||
|
if (!update){
|
||||||
|
throw new MyException("修改原数据失败");
|
||||||
|
}
|
||||||
|
// 新增
|
||||||
|
dbData.setId(null)
|
||||||
|
.setName(dto.getName())
|
||||||
|
.setPhone(dto.getPhone())
|
||||||
|
.setPosition(dto.getPosition());
|
||||||
|
result = service.save(dbData);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
return ResultJson.ok(result ? dto : null);
|
return ResultJson.ok(result ? dto : null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -221,7 +241,9 @@ public class ShAddressBookController {
|
||||||
query.like(ShAddressBook::getPhone, phone);
|
query.like(ShAddressBook::getPhone, phone);
|
||||||
}
|
}
|
||||||
|
|
||||||
query.orderByAsc(ShAddressBook::getSort);
|
query
|
||||||
|
.eq(ShAddressBook::getDel, REC)
|
||||||
|
.orderByAsc(ShAddressBook::getSort);
|
||||||
|
|
||||||
List<ShAddressBook> list = service.list(query);
|
List<ShAddressBook> list = service.list(query);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,7 @@ public class ShCallWordController {
|
||||||
if (Objects.nonNull(dto.getShPeriodId()) && Objects.isNull(shPeriodService.getById(dto.getShPeriodId()))){
|
if (Objects.nonNull(dto.getShPeriodId()) && Objects.isNull(shPeriodService.getById(dto.getShPeriodId()))){
|
||||||
throw new MyException("当前防汛周期不存在");
|
throw new MyException("当前防汛周期不存在");
|
||||||
}
|
}
|
||||||
|
dto.setId(null);
|
||||||
dto.setCreateTime(new Date());
|
dto.setCreateTime(new Date());
|
||||||
boolean result = service.save(dto);
|
boolean result = service.save(dto);
|
||||||
return ResultJson.ok(result ? dto : null);
|
return ResultJson.ok(result ? dto : null);
|
||||||
|
|
@ -57,6 +58,7 @@ public class ShCallWordController {
|
||||||
if (Objects.nonNull(dto.getShPeriodId()) && Objects.isNull(shPeriodService.getById(dto.getShPeriodId()))){
|
if (Objects.nonNull(dto.getShPeriodId()) && Objects.isNull(shPeriodService.getById(dto.getShPeriodId()))){
|
||||||
throw new MyException("当前防汛周期不存在");
|
throw new MyException("当前防汛周期不存在");
|
||||||
}
|
}
|
||||||
|
dto.setCreateTime(null);
|
||||||
boolean result = service.updateById(dto);
|
boolean result = service.updateById(dto);
|
||||||
return ResultJson.ok(result ? dto : null);
|
return ResultJson.ok(result ? dto : null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,12 +3,14 @@ package com.whdc.controller;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
import com.baomidou.mybatisplus.extension.conditions.query.LambdaQueryChainWrapper;
|
||||||
import com.whdc.exception.MyException;
|
import com.whdc.exception.MyException;
|
||||||
import com.whdc.model.dto.ShAddressBookDto;
|
|
||||||
import com.whdc.model.dto.ShCallsDto;
|
import com.whdc.model.dto.ShCallsDto;
|
||||||
import com.whdc.model.entity.ShAddressBook;
|
import com.whdc.model.entity.ShAddressBook;
|
||||||
import com.whdc.model.entity.ShCallWord;
|
import com.whdc.model.entity.ShCallWord;
|
||||||
import com.whdc.model.entity.ShCalls;
|
import com.whdc.model.entity.ShCalls;
|
||||||
|
import com.whdc.model.enums.CallType;
|
||||||
|
import com.whdc.model.enums.CallingType;
|
||||||
import com.whdc.model.group.Insert;
|
import com.whdc.model.group.Insert;
|
||||||
|
import com.whdc.model.vo.ShCallsExcelVo;
|
||||||
import com.whdc.model.vo.ShCallsVo;
|
import com.whdc.model.vo.ShCallsVo;
|
||||||
import com.whdc.service.ShAddressBookService;
|
import com.whdc.service.ShAddressBookService;
|
||||||
import com.whdc.service.ShCallsService;
|
import com.whdc.service.ShCallsService;
|
||||||
|
|
@ -17,6 +19,8 @@ import com.whdc.utils.ExcelCommon;
|
||||||
import com.whdc.utils.ResultJson;
|
import com.whdc.utils.ResultJson;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
|
import org.apache.commons.compress.utils.Lists;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
|
|
@ -26,10 +30,13 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -56,7 +63,7 @@ public class ShCallsController {
|
||||||
throw new MyException("当前通讯录不存在");
|
throw new MyException("当前通讯录不存在");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotBlank(dto.getStatus()) && "0".equals(dto.getCallType())){
|
if (StringUtils.isNotBlank(dto.getCallType()) && "0".equals(dto.getCallType())){
|
||||||
boolean update = shAddressBookService.lambdaUpdate()
|
boolean update = shAddressBookService.lambdaUpdate()
|
||||||
.set(ShAddressBook::getCallStatus, dto.getCallType())
|
.set(ShAddressBook::getCallStatus, dto.getCallType())
|
||||||
.eq(ShAddressBook::getId, dto.getShAbId())
|
.eq(ShAddressBook::getId, dto.getShAbId())
|
||||||
|
|
@ -64,7 +71,11 @@ public class ShCallsController {
|
||||||
if (!update){
|
if (!update){
|
||||||
throw new MyException("更新通讯录状态失败");
|
throw new MyException("更新通讯录状态失败");
|
||||||
}
|
}
|
||||||
|
dto.setStatus("1");
|
||||||
|
}else{
|
||||||
|
dto.setStatus("0");
|
||||||
}
|
}
|
||||||
|
dto.setId(null);
|
||||||
boolean result = service.save(dto);
|
boolean result = service.save(dto);
|
||||||
return ResultJson.ok(result ? dto : null);
|
return ResultJson.ok(result ? dto : null);
|
||||||
}
|
}
|
||||||
|
|
@ -93,38 +104,81 @@ public class ShCallsController {
|
||||||
|
|
||||||
@ApiOperation(value = "综述")
|
@ApiOperation(value = "综述")
|
||||||
@PostMapping("/statistics")
|
@PostMapping("/statistics")
|
||||||
public ResultJson<String> statistics(@RequestBody ShCallsDto dto) {
|
public ResultJson<String> statistics(@RequestBody @Validated ShCallsDto dto) {
|
||||||
|
|
||||||
List<ShCallsVo> list = service.list(dto);
|
List<ShCallsVo> list = service.listVo(dto);
|
||||||
|
|
||||||
String dateStr = dto.getDate().format(DateTimeFormatter.ofPattern(DateUtils.DATE_PATTERN));
|
String dateStr = LocalDate.parse(dto.getDate(),DateTimeFormatter.ofPattern(DateUtils.DATE_PATTERN1))
|
||||||
List<String> citys = list.stream().map(ShCallsVo::getCity).distinct().collect(Collectors.toList());
|
.format(DateTimeFormatter.ofPattern(DateUtils.DATE_PATTERN));
|
||||||
List<String> countys = list.stream().map(ShCallsVo::getCounty).distinct().collect(Collectors.toList());
|
List<String> citys = list.stream().map(ShCallsVo::getCity).distinct().filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||||
|
List<String> countys = list.stream().map(ShCallsVo::getCounty).distinct().filter(StringUtils::isNotBlank).collect(Collectors.toList());
|
||||||
|
|
||||||
return ResultJson.ok(String.format("%%抽查了%%个市(%%)%%个县(%%)县乡村山洪灾害防御责任人和包保责任人共计%%人。",
|
// return ResultJson.ok(String.format("%%抽查了%%个市(%%)%%个县(%%)县乡村山洪灾害防御责任人和包保责任人共计%%人。",
|
||||||
|
return ResultJson.ok(String.format("%s抽查了%d个市(%s)%d个县(%s)县乡村山洪灾害防御责任人和包保责任人共计%d人。",
|
||||||
dateStr,
|
dateStr,
|
||||||
citys.size(),
|
citys.size(),
|
||||||
StringUtils.join(citys, ","),
|
StringUtils.join(citys, ","),
|
||||||
countys.size(),
|
countys.size(),
|
||||||
StringUtils.join(countys, ","),
|
StringUtils.join(countys, ","),
|
||||||
list.stream().map(ShCallsVo::getPhone).distinct().count()
|
list.stream().map(ShCallsVo::getPhone).distinct().filter(StringUtils::isNotBlank).count()
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ApiOperation(value = "抽查日志导出(未完成)")
|
@ApiOperation(value = "抽查日志导出")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
public void export(@RequestBody ShAddressBookDto dto, HttpServletResponse response) {
|
public void export(@RequestBody ShCallsDto dto, HttpServletResponse response) {
|
||||||
|
|
||||||
LambdaQueryChainWrapper<ShCalls> query = service.lambdaQuery();
|
List<ShAddressBook> list = service.list(dto);
|
||||||
|
|
||||||
query.orderByDesc(ShCalls::getCallTime);
|
List<ShCallsExcelVo> excels = Lists.newArrayList();
|
||||||
|
AtomicInteger i = new AtomicInteger(1);
|
||||||
|
list.forEach(item -> {
|
||||||
|
List<ShCalls> calls = item.getList();
|
||||||
|
if (CollectionUtils.isNotEmpty(calls)){
|
||||||
|
Map<String, List<ShCalls>> dateCalls = calls.stream()
|
||||||
|
// .filter(o-> Objects.nonNull(o.getCallTime()))
|
||||||
|
.collect(Collectors.groupingBy(o -> DateUtils.dateToStr(o.getCallTime(), DateUtils.sdfymd), Collectors.toList()));
|
||||||
|
dateCalls.forEach((k,v) ->{
|
||||||
|
|
||||||
List<ShCalls> list = service.list(query);
|
ShCallsExcelVo excel = new ShCallsExcelVo();
|
||||||
|
excel.setId(i.getAndIncrement());
|
||||||
|
excel.setDateStr(k);
|
||||||
|
excel.setType2(item.getType2());
|
||||||
|
excel.setName(item.getName());
|
||||||
|
excel.setPhone(item.getPhone());
|
||||||
|
excel.setPosition(item.getPosition());
|
||||||
|
excel.setCity(item.getCity());
|
||||||
|
excel.setCounty(item.getCounty());
|
||||||
|
excel.setLand(item.getLand());
|
||||||
|
excel.setTimeStr(StringUtils.join(v.stream().map(o ->{
|
||||||
|
String type = o.getType();
|
||||||
|
if (StringUtils.isNotBlank(type)){
|
||||||
|
CallType callType = CallType.getByName(type);
|
||||||
|
if (Objects.nonNull(callType)){
|
||||||
|
type = callType.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String callType = o.getCallType();
|
||||||
|
if (StringUtils.isNotBlank(callType)){
|
||||||
|
CallingType callingType = CallingType.getByName(callType);
|
||||||
|
if (Objects.nonNull(callingType)){
|
||||||
|
callType = callingType.getValue();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return DateUtils.dateToStr(o.getCallTime(),ThreadLocal.withInitial(() -> new SimpleDateFormat(DateUtils.DATE_PATTERN_HM))) + " " + type + " " + callType;
|
||||||
|
}).distinct().collect(Collectors.toList()), ","));
|
||||||
|
|
||||||
ExcelCommon.exportExcel(list,
|
excel.setRemark(StringUtils.join(v.stream().map(ShCalls::getRemark).distinct().collect(Collectors.toList()), "/n"));
|
||||||
null, "抽查日志", ShCalls.class, "抽查日志.xlsx",
|
|
||||||
|
excels.add(excel);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
ExcelCommon.exportExcel(excels,
|
||||||
|
null, "抽查日志", ShCallsExcelVo.class, "抽查日志.xlsx",
|
||||||
response);
|
response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ public class ShPeriodController {
|
||||||
if (service.lambdaQuery().eq(ShPeriod::getName, dto.getName()).count() > 0){
|
if (service.lambdaQuery().eq(ShPeriod::getName, dto.getName()).count() > 0){
|
||||||
throw new MyException("名称重复");
|
throw new MyException("名称重复");
|
||||||
}
|
}
|
||||||
|
dto.setId(null);
|
||||||
boolean result = service.save(dto);
|
boolean result = service.save(dto);
|
||||||
return ResultJson.ok(result ? dto : null);
|
return ResultJson.ok(result ? dto : null);
|
||||||
}
|
}
|
||||||
|
|
@ -51,6 +52,7 @@ public class ShPeriodController {
|
||||||
.count() > 0){
|
.count() > 0){
|
||||||
throw new MyException("名称重复");
|
throw new MyException("名称重复");
|
||||||
}
|
}
|
||||||
|
dto.setCreateTime(null);
|
||||||
boolean result = service.updateById(dto);
|
boolean result = service.updateById(dto);
|
||||||
return ResultJson.ok(result ? dto : null);
|
return ResultJson.ok(result ? dto : null);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.whdc.mapper;
|
||||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.whdc.model.dto.ShCallsDto;
|
import com.whdc.model.dto.ShCallsDto;
|
||||||
|
import com.whdc.model.entity.ShAddressBook;
|
||||||
import com.whdc.model.entity.ShCalls;
|
import com.whdc.model.entity.ShCalls;
|
||||||
import com.whdc.model.vo.ShCallsVo;
|
import com.whdc.model.vo.ShCallsVo;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
@ -20,6 +21,7 @@ public interface ShCallsMapper extends BaseMapper<ShCalls> {
|
||||||
|
|
||||||
IPage<ShCallsVo> page(@Param("page") IPage<ShCallsVo> page, @Param("dto") ShCallsDto dto);
|
IPage<ShCallsVo> page(@Param("page") IPage<ShCallsVo> page, @Param("dto") ShCallsDto dto);
|
||||||
|
|
||||||
List<ShCallsVo> page(@Param("dto") ShCallsDto dto);
|
List<ShAddressBook> list(@Param("dto") ShCallsDto dto);
|
||||||
|
List<ShCallsVo> listVo(@Param("dto") ShCallsDto dto);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -48,4 +48,7 @@ public class ShAddressBookDto extends FindPageDto {
|
||||||
@Schema(description = "是否抽查:0:不抽查,1:抽查")
|
@Schema(description = "是否抽查:0:不抽查,1:抽查")
|
||||||
private String isSpotCheck;
|
private String isSpotCheck;
|
||||||
|
|
||||||
|
@Schema(description = "是否接听0:否,1是")
|
||||||
|
private String callStatus;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
package com.whdc.model.dto;
|
package com.whdc.model.dto;
|
||||||
|
|
||||||
|
import com.whdc.utils.DateUtils;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.v3.oas.annotations.media.Schema;
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
|
@ -7,7 +8,7 @@ import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
import java.time.LocalDate;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Description:
|
* Description:
|
||||||
|
|
@ -22,8 +23,9 @@ import java.time.LocalDate;
|
||||||
@ApiModel(description = "山洪责任人抽查分页查询")
|
@ApiModel(description = "山洪责任人抽查分页查询")
|
||||||
public class ShCallsDto extends ShAddressBookDto {
|
public class ShCallsDto extends ShAddressBookDto {
|
||||||
|
|
||||||
@ApiModelProperty(value = "抽查日期")
|
@ApiModelProperty(value = "抽查日期 格式: " + DateUtils.DATE_PATTERN1)
|
||||||
private LocalDate date;
|
@NotNull(message = "日期不能为空")
|
||||||
|
private String date;
|
||||||
|
|
||||||
@Schema(description="是否接听0:否,1是")
|
@Schema(description="是否接听0:否,1是")
|
||||||
private String status;
|
private String status;
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@ import lombok.experimental.Accessors;
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
import javax.validation.constraints.Size;
|
import javax.validation.constraints.Size;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 描述: 山洪责任人通讯录
|
* 描述: 山洪责任人通讯录
|
||||||
|
|
@ -23,7 +24,7 @@ import java.io.Serializable;
|
||||||
@Schema(description = "山洪责任人通讯录")
|
@Schema(description = "山洪责任人通讯录")
|
||||||
@Data
|
@Data
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("FXKH_TXL.SH_ADDRESS_BOOK")
|
@TableName(value = "FXKH_TXL.SH_ADDRESS_BOOK",autoResultMap = true)
|
||||||
public class ShAddressBook implements Serializable {
|
public class ShAddressBook implements Serializable {
|
||||||
|
|
||||||
public final static String thisTableName = "ShAddressBook";
|
public final static String thisTableName = "ShAddressBook";
|
||||||
|
|
@ -149,4 +150,14 @@ public class ShAddressBook implements Serializable {
|
||||||
@Schema(description = "是否接听0:否,1是")
|
@Schema(description = "是否接听0:否,1是")
|
||||||
private String callStatus;
|
private String callStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否接听
|
||||||
|
*/
|
||||||
|
@TableField(value = "del")
|
||||||
|
@Schema(description = "是否删除0:是,1:否")
|
||||||
|
private String del;
|
||||||
|
|
||||||
|
@TableField(exist = false)
|
||||||
|
List<ShCalls> list;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,7 @@ public class ShCalls implements Serializable {
|
||||||
@Schema(description="知晓本人为山洪责任人, 0:否,1:是")
|
@Schema(description="知晓本人为山洪责任人, 0:否,1:是")
|
||||||
@Size(max = 2,message = "知晓本人为山洪责任人, 0:否,1:是最大长度要小于 2")
|
@Size(max = 2,message = "知晓本人为山洪责任人, 0:否,1:是最大长度要小于 2")
|
||||||
@Pattern(message = "知晓本人为山洪责任人, 0:否,1:是", regexp = "[01]")
|
@Pattern(message = "知晓本人为山洪责任人, 0:否,1:是", regexp = "[01]")
|
||||||
|
@NotNull(message = "知晓本人为山洪责任人不能为空", groups = {Insert.class, Update.class})
|
||||||
private String know;
|
private String know;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -71,6 +72,7 @@ public class ShCalls implements Serializable {
|
||||||
@TableField(value="call_time")
|
@TableField(value="call_time")
|
||||||
@Schema(description="抽查时间")
|
@Schema(description="抽查时间")
|
||||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
|
||||||
|
@NotNull(message = "抽查时间不能为空", groups = {Insert.class, Update.class})
|
||||||
private Date callTime;
|
private Date callTime;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -80,6 +82,7 @@ public class ShCalls implements Serializable {
|
||||||
@Schema(description="叫应状态: 0:接通,1:拒接,2:忙线")
|
@Schema(description="叫应状态: 0:接通,1:拒接,2:忙线")
|
||||||
@Size(max = 2,message = "叫应状态: 0:接通,1:拒接,2:忙线最大长度要小于 2")
|
@Size(max = 2,message = "叫应状态: 0:接通,1:拒接,2:忙线最大长度要小于 2")
|
||||||
@Pattern(message = "叫应状态: 0:接通,1:拒接,2:忙线", regexp = "[012]")
|
@Pattern(message = "叫应状态: 0:接通,1:拒接,2:忙线", regexp = "[012]")
|
||||||
|
@NotNull(message = "叫应状态不能为空", groups = {Insert.class, Update.class})
|
||||||
private String callType;
|
private String callType;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -89,6 +92,7 @@ public class ShCalls implements Serializable {
|
||||||
@Schema(description="通话类型: 0:拨打,1:回拨")
|
@Schema(description="通话类型: 0:拨打,1:回拨")
|
||||||
@Size(max = 2,message = "通话类型: 0:拨打,1:回拨最大长度要小于 2")
|
@Size(max = 2,message = "通话类型: 0:拨打,1:回拨最大长度要小于 2")
|
||||||
@Pattern(message = "通话类型: 0:拨打,1:回拨", regexp = "[01]")
|
@Pattern(message = "通话类型: 0:拨打,1:回拨", regexp = "[01]")
|
||||||
|
@NotNull(message = "通话类型不能为空", groups = {Insert.class, Update.class})
|
||||||
private String type;
|
private String type;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -97,6 +101,7 @@ public class ShCalls implements Serializable {
|
||||||
@TableField(value="remark")
|
@TableField(value="remark")
|
||||||
@Schema(description="叫应备注")
|
@Schema(description="叫应备注")
|
||||||
@Size(max = 500,message = "叫应备注")
|
@Size(max = 500,message = "叫应备注")
|
||||||
|
@NotNull(message = "叫应备注不能为空", groups = {Insert.class, Update.class})
|
||||||
private String remark;
|
private String remark;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.whdc.model.enums;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xusan
|
||||||
|
* @date 2022/7/14 16:55
|
||||||
|
* 通话类型枚举类
|
||||||
|
*/
|
||||||
|
public enum CallType {
|
||||||
|
|
||||||
|
R000("0", "拨打"),
|
||||||
|
R001("1", "回拨"),
|
||||||
|
R099("99", "系统管理员");
|
||||||
|
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private CallType(String name, String value) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, CallType> map() {
|
||||||
|
Map<String, CallType> map = new HashMap<>();
|
||||||
|
CallType[] values = CallType.values();
|
||||||
|
for (CallType e : values) {
|
||||||
|
map.put(e.getValue(), e);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, CallType> mapName() {
|
||||||
|
Map<String, CallType> map = new HashMap<>();
|
||||||
|
CallType[] values = CallType.values();
|
||||||
|
for (CallType e : values) {
|
||||||
|
map.put(e.getName(), e);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CallType getByValue(String value) {
|
||||||
|
if (Objects.isNull(value)) return null;
|
||||||
|
return map().get(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CallType getByName(String name) {
|
||||||
|
if (StringUtils.isEmpty(name)) return null;
|
||||||
|
return mapName().get(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,72 @@
|
||||||
|
package com.whdc.model.enums;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author xusan
|
||||||
|
* @date 2022/7/14 16:55
|
||||||
|
* 通话类型枚举类
|
||||||
|
*/
|
||||||
|
public enum CallingType {
|
||||||
|
|
||||||
|
R000("0", "接通"),
|
||||||
|
R001("1", "拒接"),
|
||||||
|
R099("2", "忙线");
|
||||||
|
|
||||||
|
|
||||||
|
private String name;
|
||||||
|
private String value;
|
||||||
|
|
||||||
|
public String getName() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setName(String name) {
|
||||||
|
this.name = name;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String getValue() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setValue(String value) {
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
private CallingType(String name, String value) {
|
||||||
|
this.name = name;
|
||||||
|
this.value = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, CallingType> map() {
|
||||||
|
Map<String, CallingType> map = new HashMap<>();
|
||||||
|
CallingType[] values = CallingType.values();
|
||||||
|
for (CallingType e : values) {
|
||||||
|
map.put(e.getValue(), e);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static Map<String, CallingType> mapName() {
|
||||||
|
Map<String, CallingType> map = new HashMap<>();
|
||||||
|
CallingType[] values = CallingType.values();
|
||||||
|
for (CallingType e : values) {
|
||||||
|
map.put(e.getName(), e);
|
||||||
|
}
|
||||||
|
return map;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CallingType getByValue(String value) {
|
||||||
|
if (Objects.isNull(value)) return null;
|
||||||
|
return map().get(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static CallingType getByName(String name) {
|
||||||
|
if (StringUtils.isEmpty(name)) return null;
|
||||||
|
return mapName().get(name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,104 @@
|
||||||
|
package com.whdc.model.vo;
|
||||||
|
|
||||||
|
import cn.afterturn.easypoi.excel.annotation.Excel;
|
||||||
|
import io.swagger.v3.oas.annotations.media.Schema;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.experimental.Accessors;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Description:
|
||||||
|
* Created by XuSan on 2024/7/30.
|
||||||
|
*
|
||||||
|
* @author XuSan
|
||||||
|
* @version 1.0
|
||||||
|
*/
|
||||||
|
@Schema(description = "抽查日志导出")
|
||||||
|
@Data
|
||||||
|
@Accessors(chain = true)
|
||||||
|
public class ShCallsExcelVo {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 主键id
|
||||||
|
*/
|
||||||
|
@Excel(name = "序号", width = 20,orderNum = "1")
|
||||||
|
private Integer id;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 日期
|
||||||
|
*/
|
||||||
|
@Excel(name = "日期", width = 20,orderNum = "2")
|
||||||
|
private String dateStr;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 市
|
||||||
|
*/
|
||||||
|
@Excel(name = "市", width = 20,orderNum = "3")
|
||||||
|
private String city;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 县
|
||||||
|
*/
|
||||||
|
@Excel(name = "县", width = 20,orderNum = "4")
|
||||||
|
private String county;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 责任人类型1 行政责任人,包保责任人
|
||||||
|
*/
|
||||||
|
@Excel(name = "责任人类型", width = 20,orderNum = "5")
|
||||||
|
private String type2;
|
||||||
|
/**
|
||||||
|
* 名字
|
||||||
|
*/
|
||||||
|
@Excel(name = "责任人姓名", width = 20,orderNum = "6")
|
||||||
|
private String name;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 职务
|
||||||
|
*/
|
||||||
|
@Excel(name = "职务", width = 20,orderNum = "7")
|
||||||
|
private String position;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 手机号
|
||||||
|
*/
|
||||||
|
@Excel(name = "手机号", width = 20,orderNum = "8")
|
||||||
|
private String phone;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 负责区域
|
||||||
|
*/
|
||||||
|
@Excel(name = "负责区域", width = 20,orderNum = "9")
|
||||||
|
private String land;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 抽查时间
|
||||||
|
*/
|
||||||
|
@Excel(name = "抽查时间", width = 20,orderNum = "10")
|
||||||
|
private String timeStr;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否接听
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否接听电话", width = 20,orderNum = "11")
|
||||||
|
private String callStatus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 是否知晓本人为山洪责任人
|
||||||
|
*/
|
||||||
|
@Excel(name = "是否知晓本人为山洪责任人", width = 20,orderNum = "12")
|
||||||
|
private String know;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 叫应备注
|
||||||
|
*/
|
||||||
|
@Excel(name = "备注", width = 40,orderNum = "13")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -4,6 +4,7 @@ package com.whdc.service;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.IService;
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
import com.whdc.model.dto.ShCallsDto;
|
import com.whdc.model.dto.ShCallsDto;
|
||||||
|
import com.whdc.model.entity.ShAddressBook;
|
||||||
import com.whdc.model.entity.ShCalls;
|
import com.whdc.model.entity.ShCalls;
|
||||||
import com.whdc.model.vo.ShCallsVo;
|
import com.whdc.model.vo.ShCallsVo;
|
||||||
|
|
||||||
|
|
@ -19,7 +20,9 @@ public interface ShCallsService extends IService<ShCalls>
|
||||||
|
|
||||||
IPage<ShCallsVo> page(ShCallsDto dto);
|
IPage<ShCallsVo> page(ShCallsDto dto);
|
||||||
|
|
||||||
List<ShCallsVo> list(ShCallsDto dto);
|
List<ShAddressBook> list(ShCallsDto dto);
|
||||||
|
|
||||||
|
List<ShCallsVo> listVo(ShCallsDto dto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
package com.whdc.service.impl;
|
package com.whdc.service.impl;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.whdc.exception.MyException;
|
import com.whdc.exception.MyException;
|
||||||
|
|
@ -17,8 +16,10 @@ import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.function.Function;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.whdc.model.MyConstant.REC;
|
||||||
import static com.whdc.model.MyConstant.REDIS_KEY;
|
import static com.whdc.model.MyConstant.REDIS_KEY;
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -63,10 +64,16 @@ public class ShAddressBookServiceImpl extends ServiceImpl<ShAddressBookMapper, S
|
||||||
throw new MyException("参数错误");
|
throw new MyException("参数错误");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.lambdaQuery().eq(ShAddressBook::getType1,type1Str).count() > 0) {
|
if (this.lambdaQuery()
|
||||||
|
.eq(ShAddressBook::getDel, REC)
|
||||||
|
.eq(ShAddressBook::getType1, type1Str).count() > 0) {
|
||||||
|
|
||||||
// 清空数据
|
// 清空数据
|
||||||
boolean remove = this.remove(new LambdaQueryWrapper<ShAddressBook>().eq(ShAddressBook::getType1, type1Str));
|
boolean remove = this.lambdaUpdate()
|
||||||
|
.set(ShAddressBook::getDel, 0)
|
||||||
|
.eq(ShAddressBook::getDel, 1)
|
||||||
|
.eq(ShAddressBook::getType1, type1Str)
|
||||||
|
.update();
|
||||||
if (!remove) {
|
if (!remove) {
|
||||||
throw new MyException("清空数据失败");
|
throw new MyException("清空数据失败");
|
||||||
}
|
}
|
||||||
|
|
@ -92,7 +99,9 @@ public class ShAddressBookServiceImpl extends ServiceImpl<ShAddressBookMapper, S
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<AdcdTree> tree() {
|
public List<AdcdTree> tree() {
|
||||||
List<ShAddressBook> list = this.lambdaQuery().orderByAsc(ShAddressBook::getSort).list();
|
List<ShAddressBook> list = this.lambdaQuery()
|
||||||
|
.eq(ShAddressBook::getDel, REC)
|
||||||
|
.orderByAsc(ShAddressBook::getSort).list();
|
||||||
if (CollectionUtils.isEmpty(list)) {
|
if (CollectionUtils.isEmpty(list)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
@ -121,10 +130,37 @@ public class ShAddressBookServiceImpl extends ServiceImpl<ShAddressBookMapper, S
|
||||||
if (CollectionUtils.isEmpty(trees)) {
|
if (CollectionUtils.isEmpty(trees)) {
|
||||||
trees = Lists.newArrayList();
|
trees = Lists.newArrayList();
|
||||||
}
|
}
|
||||||
trees.add(new AdcdTree().setSort(o.getSort()).setAdcd(o.getVillage()).setAdnm(o.getVillage()).setAdlevel(4).setChildren(null));
|
trees.add(new AdcdTree().setSort(o.getSort()).setAdcd(o.getId().toString()).setAdnm(o.getVillage()).setAdlevel(4).setChildren(null));
|
||||||
|
|
||||||
|
trees = new ArrayList<>(trees.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
AdcdTree::getAdnm,
|
||||||
|
Function.identity(),
|
||||||
|
(o1, o2) -> o1.getSort() < o2.getSort() ? o1 : o2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.values());
|
||||||
|
|
||||||
village.put(data, trees);
|
village.put(data, trees);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
village.keySet().forEach(k ->{
|
||||||
|
List<AdcdTree> trees = village.get(k);
|
||||||
|
trees = new ArrayList<>(trees.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
AdcdTree::getAdnm,
|
||||||
|
Function.identity(),
|
||||||
|
(o1, o2) -> o1.getSort() < o2.getSort() ? o1 : o2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.values());
|
||||||
|
|
||||||
|
village.put(k, trees);
|
||||||
});
|
});
|
||||||
|
|
||||||
areaMap.forEach((k, v) -> {
|
areaMap.forEach((k, v) -> {
|
||||||
|
|
@ -135,12 +171,38 @@ public class ShAddressBookServiceImpl extends ServiceImpl<ShAddressBookMapper, S
|
||||||
if (CollectionUtils.isEmpty(trees)) {
|
if (CollectionUtils.isEmpty(trees)) {
|
||||||
trees = Lists.newArrayList();
|
trees = Lists.newArrayList();
|
||||||
}
|
}
|
||||||
trees.add(new AdcdTree().setSort(o.getSort()).setAdcd(o.getArea()).setAdnm(o.getArea()).setAdlevel(3).setChildren(village.get( o.getCity() + "_" + o.getCounty() + "_" + o.getArea())));
|
trees.add(new AdcdTree().setSort(o.getSort()).setAdcd(o.getId().toString()).setAdnm(o.getArea()).setAdlevel(3).setChildren(village.get(o.getCity() + "_" + o.getCounty() + "_" + o.getArea())));
|
||||||
|
|
||||||
|
trees = new ArrayList<>(trees.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
AdcdTree::getAdnm,
|
||||||
|
Function.identity(),
|
||||||
|
(o1, o2) -> o1.getSort() < o2.getSort() ? o1 : o2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.values());
|
||||||
|
|
||||||
area.put(data, trees);
|
area.put(data, trees);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
area.keySet().forEach(k ->{
|
||||||
|
List<AdcdTree> trees = area.get(k);
|
||||||
|
trees = new ArrayList<>(trees.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
AdcdTree::getAdnm,
|
||||||
|
Function.identity(),
|
||||||
|
(o1, o2) -> o1.getSort() < o2.getSort() ? o1 : o2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.values());
|
||||||
|
|
||||||
|
area.put(k, trees);
|
||||||
|
});
|
||||||
|
|
||||||
countyMap.forEach((k, v) -> {
|
countyMap.forEach((k, v) -> {
|
||||||
v.forEach(o -> {
|
v.forEach(o -> {
|
||||||
String data = o.getCity();
|
String data = o.getCity();
|
||||||
|
|
@ -149,20 +211,34 @@ public class ShAddressBookServiceImpl extends ServiceImpl<ShAddressBookMapper, S
|
||||||
if (CollectionUtils.isEmpty(trees)) {
|
if (CollectionUtils.isEmpty(trees)) {
|
||||||
trees = Lists.newArrayList();
|
trees = Lists.newArrayList();
|
||||||
}
|
}
|
||||||
trees.add(new AdcdTree().setSort(o.getSort()).setAdcd(o.getCounty()).setAdnm(o.getCounty()).setAdlevel(2).setChildren(area.get(o.getCity() + "_" + o.getCounty())));
|
trees.add(new AdcdTree().setSort(o.getSort()).setAdcd(o.getId().toString()).setAdnm(o.getCounty()).setAdlevel(2).setChildren(area.get(o.getCity() + "_" + o.getCounty())));
|
||||||
county.put(data, trees);
|
county.put(data, trees);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
county.keySet().forEach(k ->{
|
||||||
|
List<AdcdTree> trees = county.get(k);
|
||||||
|
trees = new ArrayList<>(trees.stream()
|
||||||
|
.collect(
|
||||||
|
Collectors.toMap(
|
||||||
|
AdcdTree::getAdnm,
|
||||||
|
Function.identity(),
|
||||||
|
(o1, o2) -> o1.getSort() < o2.getSort() ? o1 : o2
|
||||||
|
)
|
||||||
|
)
|
||||||
|
.values());
|
||||||
|
|
||||||
|
county.put(k, trees);
|
||||||
|
});
|
||||||
|
|
||||||
List<AdcdTree> cityList = Lists.newArrayList();
|
List<AdcdTree> cityList = Lists.newArrayList();
|
||||||
|
|
||||||
cityMap.forEach((k, v) -> {
|
cityMap.forEach((k, v) -> {
|
||||||
if (CollectionUtils.isNotEmpty(v)){
|
if (CollectionUtils.isNotEmpty(v)) {
|
||||||
ShAddressBook o = v.get(0);
|
ShAddressBook o = v.get(0);
|
||||||
cityList.add(new AdcdTree().setSort(o.getSort()).setAdcd(o.getCity()).setAdnm(o.getCity()).setAdlevel(1).setChildren(county.get(o.getCity())));
|
cityList.add(new AdcdTree().setSort(o.getSort()).setAdcd(o.getId().toString()).setAdnm(o.getCity()).setAdlevel(1).setChildren(county.get(o.getCity())));
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.whdc.mapper.ShCallsMapper;
|
import com.whdc.mapper.ShCallsMapper;
|
||||||
import com.whdc.model.dto.ShCallsDto;
|
import com.whdc.model.dto.ShCallsDto;
|
||||||
|
import com.whdc.model.entity.ShAddressBook;
|
||||||
import com.whdc.model.entity.ShCalls;
|
import com.whdc.model.entity.ShCalls;
|
||||||
import com.whdc.model.vo.ShCallsVo;
|
import com.whdc.model.vo.ShCallsVo;
|
||||||
import com.whdc.service.ShCallsService;
|
import com.whdc.service.ShCallsService;
|
||||||
|
|
@ -30,7 +31,12 @@ public class ShCallsServiceImpl extends ServiceImpl<ShCallsMapper, ShCalls> impl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ShCallsVo> list(ShCallsDto dto) {
|
public List<ShAddressBook> list(ShCallsDto dto) {
|
||||||
return this.getBaseMapper().page(dto);
|
return this.getBaseMapper().list(dto);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<ShCallsVo> listVo(ShCallsDto dto) {
|
||||||
|
return this.getBaseMapper().listVo(dto);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ import java.time.LocalDateTime;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.GregorianCalendar;
|
import java.util.GregorianCalendar;
|
||||||
|
import java.util.Objects;
|
||||||
import java.util.SimpleTimeZone;
|
import java.util.SimpleTimeZone;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -18,6 +19,8 @@ public class DateUtils {
|
||||||
*/
|
*/
|
||||||
public final static String DATE_TIME_PATTERN = "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 final static String DATE_PATTERN = "yyyy年MM月dd日";
|
||||||
|
public final static String DATE_PATTERN1 = "yyyy-MM-dd";
|
||||||
|
public final static String DATE_PATTERN_HM = "HH:mm";
|
||||||
|
|
||||||
|
|
||||||
public static final ThreadLocal<SimpleDateFormat> sdfhmsS = new ThreadLocal<SimpleDateFormat>() {
|
public static final ThreadLocal<SimpleDateFormat> sdfhmsS = new ThreadLocal<SimpleDateFormat>() {
|
||||||
|
|
@ -33,6 +36,11 @@ public class DateUtils {
|
||||||
return new SimpleDateFormat(DATE_TIME_PATTERN);
|
return new SimpleDateFormat(DATE_TIME_PATTERN);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
public static final ThreadLocal<SimpleDateFormat> sdfymd = new ThreadLocal<SimpleDateFormat>() {
|
||||||
|
protected SimpleDateFormat initialValue() {
|
||||||
|
return new SimpleDateFormat(DATE_PATTERN);
|
||||||
|
}
|
||||||
|
};
|
||||||
public static final ThreadLocal<SimpleDateFormat> sdf_utc = new ThreadLocal<SimpleDateFormat>() {
|
public static final ThreadLocal<SimpleDateFormat> sdf_utc = new ThreadLocal<SimpleDateFormat>() {
|
||||||
protected SimpleDateFormat initialValue() {
|
protected SimpleDateFormat initialValue() {
|
||||||
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
return new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ssZ");
|
||||||
|
|
@ -79,6 +87,9 @@ public class DateUtils {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String dateToStr(Date date, ThreadLocal<SimpleDateFormat> format){
|
public static String dateToStr(Date date, ThreadLocal<SimpleDateFormat> format){
|
||||||
|
if (Objects.isNull(date)){
|
||||||
|
return null;
|
||||||
|
}
|
||||||
return format.get().format(date);
|
return format.get().format(date);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,11 +17,12 @@
|
||||||
T."SORT",
|
T."SORT",
|
||||||
T."LAND",
|
T."LAND",
|
||||||
T."IS_SPOT_CHECK",
|
T."IS_SPOT_CHECK",
|
||||||
T."CALL_STATUS"
|
IFNULL(T."CALL_STATUS",0) CALL_STATUS
|
||||||
FROM
|
FROM
|
||||||
"FXKH_TXL"."SH_ADDRESS_BOOK" T
|
"FXKH_TXL"."SH_ADDRESS_BOOK" T
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
|
AND DEL = 1
|
||||||
<if test="dto.type1 != null and dto.type1 != '' ">
|
<if test="dto.type1 != null and dto.type1 != '' ">
|
||||||
AND T.TYPE1 = #{dto.type1}
|
AND T.TYPE1 = #{dto.type1}
|
||||||
</if>
|
</if>
|
||||||
|
|
@ -49,10 +50,19 @@
|
||||||
<if test="dto.land != null and dto.land != '' ">
|
<if test="dto.land != null and dto.land != '' ">
|
||||||
AND T.LAND = #{dto.land}
|
AND T.LAND = #{dto.land}
|
||||||
</if>
|
</if>
|
||||||
|
<if test="dto.callStatus != null and dto.callStatus != '' ">
|
||||||
|
AND T.CALL_STATUS = #{dto.callStatus}
|
||||||
|
</if>
|
||||||
<if test="dto.phone != null and dto.phone != '' ">
|
<if test="dto.phone != null and dto.phone != '' ">
|
||||||
AND T.PHONE CONCAT('%', #{dto.phone}, '%')
|
AND T.PHONE CONCAT('%', #{dto.phone}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
ORDER BY T.SORT DESC
|
ORDER BY
|
||||||
|
T.CITY NULLS FIRST,
|
||||||
|
T.COUNTY NULLS FIRST,
|
||||||
|
T.AREA NULLS FIRST,
|
||||||
|
T.VILLAGE NULLS FIRST,
|
||||||
|
T.SORT ASC
|
||||||
|
|
||||||
</select>
|
</select>
|
||||||
</mapper>
|
</mapper>
|
||||||
|
|
|
||||||
|
|
@ -62,4 +62,155 @@
|
||||||
ORDER BY C.CALL_TIME DESC
|
ORDER BY C.CALL_TIME DESC
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
<resultMap id="shCallsExcelVo" type="com.whdc.model.entity.ShAddressBook">
|
||||||
|
<id column="ID" property="id" />
|
||||||
|
<result column="CITY" property="city" />
|
||||||
|
<result column="COUNTY" property="county" />
|
||||||
|
<result column="AREA" property="area" />
|
||||||
|
<result column="VILLAGE" property="village" />
|
||||||
|
<result column="TYPE1" property="type1" />
|
||||||
|
<result column="TYPE2" property="type2" />
|
||||||
|
<result column="NAME" property="name" />
|
||||||
|
<result column="POSITION" property="position" />
|
||||||
|
<result column="PHONE" property="phone" />
|
||||||
|
<result column="SORT" property="sort" />
|
||||||
|
<result column="LAND" property="land" />
|
||||||
|
<result column="IS_SPOT_CHECK" property="isSpotCheck" />
|
||||||
|
<result column="CALL_STATUS" property="callStatus" />
|
||||||
|
<collection property="list" ofType="com.whdc.model.entity.ShCalls">
|
||||||
|
<id column="CID" property="id" />
|
||||||
|
<result column="CALL_TIME" property="callTime" />
|
||||||
|
<result column="CALL_TYPE" property="callType" />
|
||||||
|
<result column="SH_AB_ID" property="shAbId" />
|
||||||
|
<result column="REMARK" property="remark" />
|
||||||
|
<result column="KNOW" property="know" />
|
||||||
|
</collection>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<select id="list" resultMap="shCallsExcelVo" >
|
||||||
|
SELECT
|
||||||
|
C.ID CID,
|
||||||
|
C.CALL_TIME,
|
||||||
|
C.CALL_TYPE,
|
||||||
|
C.SH_AB_ID,
|
||||||
|
C.REMARK,
|
||||||
|
IF(C.KNOW = 1, '是', '否') KNOW,
|
||||||
|
AB."ID",
|
||||||
|
AB."CITY",
|
||||||
|
AB."COUNTY",
|
||||||
|
AB."AREA",
|
||||||
|
AB."VILLAGE",
|
||||||
|
AB."TYPE1",
|
||||||
|
AB."TYPE2",
|
||||||
|
AB."NAME",
|
||||||
|
AB."POSITION",
|
||||||
|
AB."PHONE",
|
||||||
|
AB."SORT",
|
||||||
|
AB."LAND",
|
||||||
|
AB."IS_SPOT_CHECK",
|
||||||
|
AB."CALL_STATUS"
|
||||||
|
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>
|
||||||
|
|
||||||
|
<select id="listVo" resultType="com.whdc.model.vo.ShCallsVo" >
|
||||||
|
SELECT
|
||||||
|
C.ID CID,
|
||||||
|
C.CALL_TIME,
|
||||||
|
C.CALL_TYPE,
|
||||||
|
C.SH_AB_ID,
|
||||||
|
C.REMARK,
|
||||||
|
IF(C.KNOW = 1, '是', '否') KNOW,
|
||||||
|
AB."ID",
|
||||||
|
AB."CITY",
|
||||||
|
AB."COUNTY",
|
||||||
|
AB."AREA",
|
||||||
|
AB."VILLAGE",
|
||||||
|
AB."TYPE1",
|
||||||
|
AB."TYPE2",
|
||||||
|
AB."NAME",
|
||||||
|
AB."POSITION",
|
||||||
|
AB."PHONE",
|
||||||
|
AB."SORT",
|
||||||
|
AB."LAND",
|
||||||
|
AB."IS_SPOT_CHECK",
|
||||||
|
AB."CALL_STATUS"
|
||||||
|
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>
|
</mapper>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue