新增抽查日志修改

master
徐杰盟 2024-08-08 14:07:46 +08:00
parent 78878c984c
commit c1721e90af
4 changed files with 47 additions and 13 deletions

View File

@ -33,6 +33,7 @@ import javax.servlet.http.HttpServletResponse;
import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.Objects;
@ -65,7 +66,7 @@ public class ShCallsController {
if (StringUtils.isNotBlank(dto.getCallType()) && "0".equals(dto.getCallType())){
boolean update = shAddressBookService.lambdaUpdate()
.set(ShAddressBook::getCallStatus, dto.getCallType())
.set(ShAddressBook::getCallStatus, 1)
.eq(ShAddressBook::getId, dto.getShAbId())
.update();
if (!update){
@ -87,6 +88,11 @@ public class ShCallsController {
if (Objects.nonNull(dto.getDate())){
query.between(ShCalls::getCallTime, dto.getDate() + " 00:00:00",dto.getDate() + " 23:59:59");
}else{
if (StringUtils.isNotBlank(dto.getCallTime())){
String dateStr = dto.getCallTime().split(" ")[0];
query.between(ShCalls::getCallTime, dateStr + " 00:00:00",dateStr + " 23:59:59");
}
}
if (Objects.nonNull(dto.getShAbId())){
query.eq(ShCalls::getShAbId, dto.getShAbId());
@ -144,7 +150,6 @@ public class ShCallsController {
dateCalls.forEach((k,v) ->{
ShCallsExcelVo excel = new ShCallsExcelVo();
excel.setId(i.getAndIncrement());
excel.setDateStr(k);
excel.setType2(item.getType2());
excel.setName(item.getName());
@ -153,6 +158,22 @@ public class ShCallsController {
excel.setCity(item.getCity());
excel.setCounty(item.getCounty());
excel.setLand(item.getLand());
excel.setCallStatus(item.getCallStatus());
long count = v.stream().map(ShCalls::getKnow).filter("是"::equals)
.count();
if (count > 0){
excel.setKnow("是");
}else{
excel.setKnow("否");
}
long count1 = v.stream().filter(o -> Objects.nonNull(o.getStatus()) && "1".equals(o.getStatus())).count();
if (count1 > 0){
excel.setCallStatus("是");
}else {
excel.setCallStatus("否");
}
excel.setTimeStr(StringUtils.join(v.stream().map(o ->{
String type = o.getType();
if (StringUtils.isNotBlank(type)){
@ -182,7 +203,10 @@ public class ShCallsController {
}
});
ExcelCommon.exportExcel(excels,
List<ShCallsExcelVo> data = excels.stream().sorted(Comparator.comparing(ShCallsExcelVo::getDateStr).reversed()).collect(Collectors.toList());
data.forEach(o->o.setId(i.getAndIncrement()));
ExcelCommon.exportExcel(data,
null, "抽查日志", ShCallsExcelVo.class, "抽查日志.xlsx",
response);
}

View File

@ -30,6 +30,9 @@ public class ShCallsDto extends ShAddressBookDto {
@Schema(description="是否接听0:否,1是")
private String status;
@Schema(description="抽查日期")
private String callTime;
@Schema(description="山洪通讯录编号")
private Integer shAbId;
}

View File

@ -11,12 +11,12 @@ spring:
datasource:
type: com.alibaba.druid.pool.DruidDataSource
driver-class-name: dm.jdbc.driver.DmDriver
# url: jdbc:dm://local.gunshiiot.com:5236?schema=FXKH_TXL
# username: SYSDBA
# password: SYSDBA001
url: jdbc:dm://10.42.6.247:5236?schema=FXKH_TXL
username: SHZH
password: Shzh_890
url: jdbc:dm://local.gunshiiot.com:5236?schema=FXKH_TXL
username: SYSDBA
password: SYSDBA001
# url: jdbc:dm://10.42.6.247:5236?schema=FXKH_TXL
# username: SHZH
# password: Shzh_890
druid:
initialSize: 5
minIdle: 5
@ -41,12 +41,13 @@ spring:
# Redis
redis:
database: 5
host: 10.42.6.75
# host: 10.42.6.75
# host: 127.0.0.1
# password:
password: Whdc_890
# password: Whdc_890
port: 6379
host: 10.0.41.112
password: 1234567a
servlet:
multipart:
max-file-size: 1100MB

View File

@ -22,7 +22,9 @@
AB."IS_SPOT_CHECK",
AB."CALL_STATUS"
FROM
FXKH_TXL.SH_CALLS C
( SELECT MAX(CALL_TIME) CALL_TIME,SH_AB_ID FROM FXKH_TXL.SH_CALLS
GROUP BY DATE_FORMAT(CALL_TIME,'YYYY-MM-dd'),SH_AB_ID) T
LEFT JOIN FXKH_TXL.SH_CALLS C ON T.CALL_TIME = C.CALL_TIME AND T.SH_AB_ID = C.SH_AB_ID
LEFT JOIN FXKH_TXL.SH_ADDRESS_BOOK AB ON C.SH_AB_ID = AB.ID
WHERE
1 = 1
@ -82,7 +84,9 @@
<result column="CALL_TIME" property="callTime" />
<result column="CALL_TYPE" property="callType" />
<result column="SH_AB_ID" property="shAbId" />
<result column="TYPE" property="type" />
<result column="REMARK" property="remark" />
<result column="STATUS" property="status" />
<result column="KNOW" property="know" />
</collection>
</resultMap>
@ -93,6 +97,8 @@
C.CALL_TIME,
C.CALL_TYPE,
C.SH_AB_ID,
C.TYPE,
C.STATUS,
C.REMARK,
IF(C.KNOW = 1, '是', '否') KNOW,
AB."ID",