人员出入管理修改
This commit is contained in:
parent
1d5ac3f0cb
commit
f8566dadb2
|
|
@ -41,4 +41,7 @@ public class AccessMgeDto {
|
|||
|
||||
@ApiModelProperty(value = "检测名称")
|
||||
private String modeName;
|
||||
|
||||
@ApiModelProperty(value = "文件id")
|
||||
private String fileIds;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -144,6 +144,12 @@ public class AccessMgeController extends BaseController {
|
|||
return service.getPerStatisticsPhoto(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "今日、当月人员出入场统计图片")
|
||||
@GetMapping("getPhotosById")
|
||||
public AjaxResult getPhotosById(AccessMgeDto dto) {
|
||||
return service.getPhotosById(dto);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "今日、当月人员出入场统计列表")
|
||||
@GetMapping("getPerStatisticsList")
|
||||
@Log(title = "出入管理", menu = "出入管理->今日、当月人员出入场统计列表", grade = OperationType.QUERY_BUSINESS, details = "查询今日、当月人员出入场统计列表", type = "业务日志")
|
||||
|
|
|
|||
|
|
@ -53,4 +53,6 @@ public interface AccessMgeService {
|
|||
* @return
|
||||
*/
|
||||
List<AccessMgeVo> getPerStatisticsList(AccessMgeDto dto);
|
||||
|
||||
AjaxResult getPhotosById(AccessMgeDto dto);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
|||
|
||||
@Override
|
||||
public AjaxResult getVehicleStatistics(AccessMgeDto dto) {
|
||||
return totalAccessData("1",dto);
|
||||
return totalAccessData("1", dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -77,7 +77,7 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
|||
|
||||
@Override
|
||||
public AjaxResult getPerStatistics(AccessMgeDto dto) {
|
||||
return totalAccessData("2",dto);
|
||||
return totalAccessData("2", dto);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -89,15 +89,16 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
|||
try {
|
||||
dto.setModeName(Constant.PHOTO);
|
||||
dto.setTypeCode(Constant.PERSON_CAR_TYPE);
|
||||
if(StringHelper.isEmpty(dto.getStartDate())){
|
||||
if (StringHelper.isEmpty(dto.getStartDate())) {
|
||||
dto.setStartDate(DateTimeHelper.getNowDate());
|
||||
dto.setEndDate(DateTimeHelper.getNowDate());
|
||||
}
|
||||
list = mapper.getPerStatisticsPhoto(dto);
|
||||
if(CollectionUtils.isNotEmpty(list)){
|
||||
for (int i = 0;i < list.size();i++) {
|
||||
if (CollectionUtils.isNotEmpty(list)) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
AccessMgeVo vo = list.get(i);
|
||||
if(StringUtils.isNotEmpty(vo.getVal())){
|
||||
if (StringUtils.isNotEmpty(vo.getVal())) {
|
||||
if (i <= 9) {
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(vo.getVal(), SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
|
|
@ -105,9 +106,10 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
|||
String base64 = item.getString("url");
|
||||
vo.setBase64(base64);
|
||||
}
|
||||
vo.setPersonName(handleData(vo.getSourceData(),"personName"));
|
||||
}
|
||||
if(i == 0 || i == 1){
|
||||
vo.setPersonName(handleData(vo.getSourceData(), "personName"));
|
||||
}
|
||||
if (i == 0 || i == 1) {
|
||||
noWarnList.add(vo);
|
||||
}
|
||||
warnList.add(vo);
|
||||
|
|
@ -116,22 +118,22 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
|||
} catch (Exception e) {
|
||||
log.error("今日、当月人员出入场统计图片-查询失败", e);
|
||||
}
|
||||
map.put("noWarnList",noWarnList);
|
||||
map.put("warnList",warnList);
|
||||
map.put("noWarnList", noWarnList);
|
||||
map.put("warnList", warnList);
|
||||
return AjaxResult.success(map);
|
||||
}
|
||||
|
||||
public static String handleData(String jsonStr,String fieldName){
|
||||
public static String handleData(String jsonStr, String fieldName) {
|
||||
try {
|
||||
if(StringUtils.isEmpty(jsonStr)){
|
||||
if (StringUtils.isEmpty(jsonStr)) {
|
||||
return null;
|
||||
}else{
|
||||
} else {
|
||||
JSONObject jsonObject = JSONObject.parseObject(jsonStr);
|
||||
String value = jsonObject.getString(fieldName);
|
||||
return value;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error("人员出入数据解析异常",e);
|
||||
log.error("人员出入数据解析异常", e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
|
@ -143,8 +145,28 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
|||
return list;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AjaxResult getPhotosById(AccessMgeDto dto) {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
String[] fileIdArr = dto.getFileIds().split(",");
|
||||
for (String fileId : fileIdArr) {
|
||||
Result<SysFile> result = remoteFileService.getImgBase64(fileId, SecurityConstants.INNER);
|
||||
if (result != null && result.getCode() == HttpStatus.SUCCESS && result.getData() != null) {
|
||||
String jsonString = JSON.toJSONString(result.getData());
|
||||
JSONObject item = JSON.parseObject(jsonString);
|
||||
String base64 = item.getString("url");
|
||||
Map<String, Object> mapData = new HashMap<>();
|
||||
mapData.put("fileId",fileId);
|
||||
mapData.put("base64",base64);
|
||||
list.add(mapData);
|
||||
}
|
||||
}
|
||||
return AjaxResult.success(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 人员/车辆 出入场记录
|
||||
*
|
||||
* @return List<AccessMgeVo>
|
||||
* @description
|
||||
* @author cwchen
|
||||
|
|
@ -154,9 +176,9 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
|||
// type : 1.车辆 2.人员
|
||||
List<AccessMgeVo> list = new ArrayList<>();
|
||||
try {
|
||||
dto.setTypeCode(Objects.equals(Constant.TYPE, type) ? Constant.CAR_GATE: Constant.PERSON_CAR_TYPE);
|
||||
dto.setTypeCode(Objects.equals(Constant.TYPE, type) ? Constant.CAR_GATE : Constant.PERSON_CAR_TYPE);
|
||||
dto.setModeName(Objects.equals(Constant.TYPE, type) ? Constant.CAR : Constant.PERSON);
|
||||
if(StringHelper.isEmpty(dto.getStartDate())){
|
||||
if (StringHelper.isEmpty(dto.getStartDate())) {
|
||||
dto.setStartDate(DateTimeHelper.getNowDate());
|
||||
dto.setEndDate(DateTimeHelper.getNowDate());
|
||||
}
|
||||
|
|
@ -167,13 +189,13 @@ public class AccessMgeServiceImpl implements AccessMgeService {
|
|||
return list;
|
||||
}
|
||||
|
||||
public AjaxResult totalAccessData(String type, AccessMgeDto dto){
|
||||
public AjaxResult totalAccessData(String type, AccessMgeDto dto) {
|
||||
System.err.println(type);
|
||||
// type : 1.车辆 2.人员
|
||||
List<AccessMgeVo> dataList = new ArrayList<>();
|
||||
List<AccessMgeVo> list = new ArrayList<>();
|
||||
try {
|
||||
dto.setTypeCode(Objects.equals(Constant.TYPE, type) ? Constant.CAR_GATE: Constant.PERSON_CAR_TYPE);
|
||||
dto.setTypeCode(Objects.equals(Constant.TYPE, type) ? Constant.CAR_GATE : Constant.PERSON_CAR_TYPE);
|
||||
dto.setModeName(Objects.equals(Constant.TYPE, type) ? Constant.CAR : Constant.PERSON);
|
||||
String[] dateArr = DateTimeHelper.getMonthFirstAndLastDay().split(" - ");
|
||||
dto.setStartDate(dateArr[0]);
|
||||
|
|
|
|||
Loading…
Reference in New Issue