|
@@ -1,25 +1,23 @@
|
|
|
package com.customs.cq.datacenter.business.mapper.impl;
|
|
|
|
|
|
-import cn.hutool.core.bean.BeanUtil;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
-import com.customs.cq.datacenter.business.domain.GridPersonPO;
|
|
|
+import com.customs.cq.datacenter.business.domain.CheckRecordPO;
|
|
|
import com.customs.cq.datacenter.business.domain.bo.GridCheckFormBo;
|
|
|
+import com.customs.cq.datacenter.business.entity.search.SearchCheckRecord;
|
|
|
+import com.customs.cq.datacenter.business.mapper.CheckRecordMapper;
|
|
|
import com.customs.cq.datacenter.common.constant.Constants;
|
|
|
+import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
|
|
|
import com.customs.cq.datacenter.common.enums.EOrderBy;
|
|
|
import com.customs.cq.datacenter.common.enums.EYesOrNo;
|
|
|
-import com.customs.cq.datacenter.common.utils.*;
|
|
|
-import com.customs.cq.datacenter.common.core.mapper.BasicMapper;
|
|
|
import com.customs.cq.datacenter.common.model.OrderByDTO;
|
|
|
import com.customs.cq.datacenter.common.model.SearchBasicDTO;
|
|
|
-import com.google.gson.JsonObject;
|
|
|
-import com.google.gson.JsonParser;
|
|
|
-import org.springframework.boot.json.GsonJsonParser;
|
|
|
+import com.customs.cq.datacenter.common.utils.ListUtil;
|
|
|
+import com.customs.cq.datacenter.common.utils.LocalDateTimeUtil;
|
|
|
+import com.customs.cq.datacenter.common.utils.NumericUtil;
|
|
|
+import com.customs.cq.datacenter.common.utils.StringUtil;
|
|
|
import org.springframework.stereotype.Repository;
|
|
|
-import com.customs.cq.datacenter.business.entity.search.SearchCheckRecord;
|
|
|
-import com.customs.cq.datacenter.business.domain.CheckRecordPO;
|
|
|
-import com.customs.cq.datacenter.business.mapper.CheckRecordMapper;
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
@@ -134,7 +132,11 @@ public class CheckRecordMapperImpl extends BasicMapper<CheckRecordPO> {
|
|
|
public List<GridCheckFormBo> checkToday4Grid(List<Long> listGridId) {
|
|
|
List<String> listColumn = new ArrayList<>();
|
|
|
listColumn.add("ID");
|
|
|
+ listColumn.add("CHECK_FORM_NO");
|
|
|
listColumn.add("GRID_ID");
|
|
|
+ listColumn.add("DANGER_CATEGORY");
|
|
|
+ listColumn.add("CHECK_FORM_ID");
|
|
|
+ listColumn.add("CHECK_FORM_NAME");
|
|
|
listColumn.add("CREATE_TIME");
|
|
|
listColumn.add("STATUS");
|
|
|
|
|
@@ -144,13 +146,21 @@ public class CheckRecordMapperImpl extends BasicMapper<CheckRecordPO> {
|
|
|
|
|
|
Long today = LocalDateTimeUtil.getTimeStamp(LocalDateTimeUtil.todayFirst()).getTime();
|
|
|
where.gt(CheckRecordPO::getCreateTime, today);
|
|
|
- List<Object> list = mapper.selectObjs(where);
|
|
|
- return BeanUtil.copyToList(list, GridCheckFormBo.class);
|
|
|
+ List<Map<String, Object>> list = mapper.selectMaps(where);
|
|
|
+ return list.stream().map(c -> new GridCheckFormBo(
|
|
|
+ NumericUtil.tryParseLong(c.get("ID")),
|
|
|
+ c.get("CHECK_FORM_NO").toString(),
|
|
|
+ NumericUtil.tryParseLong(c.get("GRID_ID")),
|
|
|
+ NumericUtil.tryParseLong(c.get("DANGER_CATEGORY")),
|
|
|
+ NumericUtil.tryParseLong(c.get("CHECK_FORM_ID")),
|
|
|
+ c.get("CHECK_FORM_NAME").toString(),
|
|
|
+ NumericUtil.tryParseLong(c.get("CREATE_TIME")),
|
|
|
+ NumericUtil.tryParseInt(c.get("STATUS"))
|
|
|
+ )).collect(Collectors.toList());
|
|
|
}
|
|
|
|
|
|
public Long checkDate4Grid(Long gridId, String dateStr) {
|
|
|
LambdaQueryWrapper<CheckRecordPO> where = super.getQuery();
|
|
|
- where.select(CheckRecordPO.class, c -> c.getColumn().equals("GRID_ID"));
|
|
|
where.eq(CheckRecordPO::getGridId, gridId);
|
|
|
|
|
|
Long date = LocalDateTimeUtil.getTimeStamp(dateStr, Constants.STR_DATE).getTime();
|