Commit 8799b9ee authored by 曹盼盼's avatar 曹盼盼

今日值班人员接警数量统计

parent f4f04e51
...@@ -58,6 +58,7 @@ public class TzsCitInfoDto extends BaseDto { ...@@ -58,6 +58,7 @@ public class TzsCitInfoDto extends BaseDto {
private Boolean isOnline; private Boolean isOnline;
private Integer countNum;
} }
...@@ -11,9 +11,11 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto; ...@@ -11,9 +11,11 @@ import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyBussinessDto;
import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto; import com.yeejoin.amos.boot.module.tzs.api.dto.WechatMyTaskListDto;
import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled; import com.yeejoin.amos.boot.module.tzs.api.entity.AlertCalled;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.typroject.tyboot.core.rdbms.annotation.Condition; import org.typroject.tyboot.core.rdbms.annotation.Condition;
import org.typroject.tyboot.core.rdbms.annotation.Operator; import org.typroject.tyboot.core.rdbms.annotation.Operator;
import java.util.Date;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -107,4 +109,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> { ...@@ -107,4 +109,7 @@ public interface AlertCalledMapper extends BaseMapper<AlertCalled> {
Integer getEquipmentHistoryCount(@Param("regionCodes") List<String> regionCodes,@Param("equipmentClassCode") String equipmentClassCode, @Param("equipmentCode") String equipmentCode); Integer getEquipmentHistoryCount(@Param("regionCodes") List<String> regionCodes,@Param("equipmentClassCode") String equipmentClassCode, @Param("equipmentCode") String equipmentCode);
List<AlertPaperInfoDto> getEquipmentHistory(@Param("regionCodes") List<String> regionCodes,@Param("equipmentClassCode") String equipmentClassCode,@Param("current") Integer current, @Param("pageNum") Integer pageNum, @Param("equipmentCode") String equipmentCode); List<AlertPaperInfoDto> getEquipmentHistory(@Param("regionCodes") List<String> regionCodes,@Param("equipmentClassCode") String equipmentClassCode,@Param("current") Integer current, @Param("pageNum") Integer pageNum, @Param("equipmentCode") String equipmentCode);
@Select("select count(1) from tz_alert_called where rec_user_name =#{userName} and rec_date >= #{startTime} and rec_date <= #{endTime}")
Integer getCountNum(String userName, Date startTime,Date endTime);
} }
...@@ -25,6 +25,7 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils; ...@@ -25,6 +25,7 @@ import com.yeejoin.amos.boot.module.tzs.biz.utils.BeanDtoVoUtils;
import com.yeejoin.amos.component.feign.model.FeignClientResult; import com.yeejoin.amos.component.feign.model.FeignClientResult;
import com.yeejoin.amos.feign.privilege.Privilege; import com.yeejoin.amos.feign.privilege.Privilege;
import com.yeejoin.amos.feign.privilege.model.AgencyUserModel; import com.yeejoin.amos.feign.privilege.model.AgencyUserModel;
import org.apache.commons.lang.text.StrBuilder;
import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger; import org.apache.logging.log4j.Logger;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
...@@ -37,6 +38,8 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil; ...@@ -37,6 +38,8 @@ import org.typroject.tyboot.core.foundation.utils.ValidationUtil;
import org.typroject.tyboot.core.rdbms.service.BaseService; import org.typroject.tyboot.core.rdbms.service.BaseService;
import org.typroject.tyboot.core.restful.exception.instance.BadRequest; import org.typroject.tyboot.core.restful.exception.instance.BadRequest;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
...@@ -395,6 +398,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -395,6 +398,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
citInfoDto.setServiceSocre("100"); citInfoDto.setServiceSocre("100");
//在线 //在线
citInfoDto.setIsOnline(true); citInfoDto.setIsOnline(true);
citInfoDto.setCountNum(countNum(citInfo.getCtiUserName()));
citInfoDtoList.add(citInfoDto); citInfoDtoList.add(citInfoDto);
} }
// List<AgencyUserModel> userList = userListResult.getResult(); // List<AgencyUserModel> userList = userListResult.getResult();
...@@ -430,6 +434,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -430,6 +434,7 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
// } // }
// //
// }); // });
return citInfoDtoList; return citInfoDtoList;
} }
...@@ -743,4 +748,24 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall ...@@ -743,4 +748,24 @@ public class AlertCalledServiceImpl extends BaseService<AlertCalledDto,AlertCall
public Integer getEquipmentHistoryCount(List<String> useRegionCode, String equipmentClassCode, String equipmentCode) { public Integer getEquipmentHistoryCount(List<String> useRegionCode, String equipmentClassCode, String equipmentCode) {
return baseMapper.getEquipmentHistoryCount(useRegionCode,equipmentClassCode,equipmentCode); return baseMapper.getEquipmentHistoryCount(useRegionCode,equipmentClassCode,equipmentCode);
} }
// 今日值班人员接警数量统计
public Integer countNum(String userName){
SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd");
String format = simpleDateFormat.format(new Date());
StrBuilder strBuilderStart = new StrBuilder();
String startTimeString = strBuilderStart.append(format).append(" ").append("00:00:00").toString();
StrBuilder strBuilderEnd = new StrBuilder();
String endTimeString = strBuilderEnd.append(format).append(" ").append(" ").append("23:59:59").toString();
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
Date startTime =null;
Date endTime =null;
try {
startTime= sdf.parse(startTimeString);
endTime = sdf.parse(endTimeString);
} catch (ParseException e) {
e.printStackTrace();
logger.error("日期转化失敗:" + e.getMessage());
}
return alertCalledMapper.getCountNum(userName,startTime,endTime);
}
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment