抽查名单去重,手机号需要支持模糊查询,用责任人电话查询时接口报错, 今日抽查责任人电话查询报错, 导入模版的格式需要调整,抽查日志中叫应记录应该按叫应时间倒序排列,导出行政区划责任人,表格样式,首行首列应该是“序号”;序号从1开始,不能从0开始
parent
b6d9107218
commit
83673394b2
|
|
@ -25,6 +25,8 @@ import javax.servlet.http.HttpServletResponse;
|
||||||
import javax.validation.constraints.Pattern;
|
import javax.validation.constraints.Pattern;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import static com.whdc.model.MyConstant.DEL;
|
import static com.whdc.model.MyConstant.DEL;
|
||||||
import static com.whdc.model.MyConstant.REC;
|
import static com.whdc.model.MyConstant.REC;
|
||||||
|
|
@ -246,7 +248,9 @@ public class ShAddressBookController {
|
||||||
.orderByAsc(ShAddressBook::getSort);
|
.orderByAsc(ShAddressBook::getSort);
|
||||||
|
|
||||||
List<ShAddressBook> list = service.list(query);
|
List<ShAddressBook> list = service.list(query);
|
||||||
|
AtomicInteger integer = new AtomicInteger(1);
|
||||||
|
list = list.stream().map(o->o.setSort(integer.getAndIncrement()))
|
||||||
|
.collect(Collectors.toList());
|
||||||
ExcelCommon.exportExcel(list,
|
ExcelCommon.exportExcel(list,
|
||||||
null, "山洪责任人通讯录", ShAddressBook.class, "山洪责任人通讯录.xlsx",
|
null, "山洪责任人通讯录", ShAddressBook.class, "山洪责任人通讯录.xlsx",
|
||||||
response);
|
response);
|
||||||
|
|
|
||||||
|
|
@ -93,6 +93,7 @@ public class ShCallsController {
|
||||||
}else{
|
}else{
|
||||||
throw new MyException("山洪通讯录编号不能为空");
|
throw new MyException("山洪通讯录编号不能为空");
|
||||||
}
|
}
|
||||||
|
query.orderByDesc(ShCalls::getCallTime);
|
||||||
return ResultJson.ok(query.list());
|
return ResultJson.ok(query.list());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -159,6 +160,8 @@ public class ShCallsController {
|
||||||
if (Objects.nonNull(callType)){
|
if (Objects.nonNull(callType)){
|
||||||
type = callType.getValue();
|
type = callType.getValue();
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
type = "未填写";
|
||||||
}
|
}
|
||||||
String callType = o.getCallType();
|
String callType = o.getCallType();
|
||||||
if (StringUtils.isNotBlank(callType)){
|
if (StringUtils.isNotBlank(callType)){
|
||||||
|
|
@ -166,6 +169,8 @@ public class ShCallsController {
|
||||||
if (Objects.nonNull(callingType)){
|
if (Objects.nonNull(callingType)){
|
||||||
callType = callingType.getValue();
|
callType = callingType.getValue();
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
callType = "未填写";
|
||||||
}
|
}
|
||||||
return DateUtils.dateToStr(o.getCallTime(),ThreadLocal.withInitial(() -> new SimpleDateFormat(DateUtils.DATE_PATTERN_HM))) + " " + type + " " + callType;
|
return DateUtils.dateToStr(o.getCallTime(),ThreadLocal.withInitial(() -> new SimpleDateFormat(DateUtils.DATE_PATTERN_HM))) + " " + type + " " + callType;
|
||||||
}).distinct().collect(Collectors.toList()), ","));
|
}).distinct().collect(Collectors.toList()), ","));
|
||||||
|
|
|
||||||
|
|
@ -133,7 +133,7 @@ public class ShAddressBook implements Serializable {
|
||||||
*/
|
*/
|
||||||
@TableField(value = "sort")
|
@TableField(value = "sort")
|
||||||
@Schema(description = "顺序排序")
|
@Schema(description = "顺序排序")
|
||||||
@Excel(name = "展示顺序", width = 20,orderNum = "0")
|
@Excel(name = "序号", width = 20,orderNum = "0")
|
||||||
private Integer sort;
|
private Integer sort;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -51,6 +51,17 @@ public class ShAddressBookServiceImpl extends ServiceImpl<ShAddressBookMapper, S
|
||||||
throw new MyException("文件解析数据为空");
|
throw new MyException("文件解析数据为空");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 去重
|
||||||
|
appends = new ArrayList<>(appends.stream()
|
||||||
|
.collect(Collectors.toMap(o -> o.getCity() + System.lineSeparator() +
|
||||||
|
o.getCounty() + System.lineSeparator() +
|
||||||
|
o.getArea() + System.lineSeparator() +
|
||||||
|
o.getVillage() + System.lineSeparator() +
|
||||||
|
o.getName() + System.lineSeparator() +
|
||||||
|
o.getPhone() + System.lineSeparator() +
|
||||||
|
o.getType2(), Function.identity(), (o1, o2) -> o1))
|
||||||
|
.values());
|
||||||
|
|
||||||
// 删除全部数据
|
// 删除全部数据
|
||||||
String type1Str = null;
|
String type1Str = null;
|
||||||
switch (type1) {
|
switch (type1) {
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@
|
||||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||||
<mapper namespace="com.whdc.mapper.ShAddressBookMapper">
|
<mapper namespace="com.whdc.mapper.ShAddressBookMapper">
|
||||||
|
|
||||||
<select id="page" resultType="com.whdc.model.entity.ShAddressBook">
|
<!--
|
||||||
SELECT
|
SELECT
|
||||||
T."ID",
|
T."ID",
|
||||||
T."CITY",
|
T."CITY",
|
||||||
|
|
@ -22,6 +22,53 @@
|
||||||
"FXKH_TXL"."SH_ADDRESS_BOOK" T
|
"FXKH_TXL"."SH_ADDRESS_BOOK" T
|
||||||
WHERE
|
WHERE
|
||||||
1 = 1
|
1 = 1
|
||||||
|
-->
|
||||||
|
<select id="page" resultType="com.whdc.model.entity.ShAddressBook">
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
T."ID",
|
||||||
|
T."CITY",
|
||||||
|
T."COUNTY",
|
||||||
|
T."AREA",
|
||||||
|
T."VILLAGE",
|
||||||
|
T."TYPE1",
|
||||||
|
T."TYPE2",
|
||||||
|
T."NAME",
|
||||||
|
T."POSITION",
|
||||||
|
T."PHONE",
|
||||||
|
T."SORT",
|
||||||
|
T."LAND",
|
||||||
|
T."IS_SPOT_CHECK",
|
||||||
|
IFNULL( T."CALL_STATUS", 0 ) CALL_STATUS
|
||||||
|
FROM
|
||||||
|
(
|
||||||
|
SELECT
|
||||||
|
T."CITY",
|
||||||
|
T."COUNTY",
|
||||||
|
T."AREA",
|
||||||
|
T."VILLAGE",
|
||||||
|
T."NAME",
|
||||||
|
T."PHONE"
|
||||||
|
FROM
|
||||||
|
"FXKH_TXL"."SH_ADDRESS_BOOK" T
|
||||||
|
WHERE
|
||||||
|
DEL = 1
|
||||||
|
GROUP BY
|
||||||
|
T."CITY",
|
||||||
|
T."COUNTY",
|
||||||
|
T."AREA",
|
||||||
|
T."VILLAGE",
|
||||||
|
T."NAME",
|
||||||
|
T."PHONE"
|
||||||
|
) T1
|
||||||
|
LEFT JOIN "FXKH_TXL"."SH_ADDRESS_BOOK" T ON T.CITY = T1.CITY
|
||||||
|
AND T.COUNTY = T1.COUNTY
|
||||||
|
AND T.AREA = T1.AREA
|
||||||
|
AND T.VILLAGE = T1.VILLAGE
|
||||||
|
AND T.NAME = T1.NAME
|
||||||
|
AND T.PHONE = T1.PHONE
|
||||||
|
WHERE
|
||||||
|
1 = 1
|
||||||
AND DEL = 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}
|
||||||
|
|
@ -54,7 +101,7 @@
|
||||||
AND T.CALL_STATUS = #{dto.callStatus}
|
AND T.CALL_STATUS = #{dto.callStatus}
|
||||||
</if>
|
</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 LIKE CONCAT('%', #{dto.phone}, '%')
|
||||||
</if>
|
</if>
|
||||||
|
|
||||||
ORDER BY
|
ORDER BY
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue