|
@@ -1,10 +1,12 @@
|
|
|
package com.fjhx.service.check.impl;
|
|
|
|
|
|
+import cn.hutool.core.util.ObjectUtil;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fjhx.base.Condition;
|
|
|
import com.fjhx.constants.HouseConstant;
|
|
|
import com.fjhx.constants.StatusConstant;
|
|
|
import com.fjhx.constants.WebSocketConstant;
|
|
@@ -19,7 +21,6 @@ import com.fjhx.service.check.CheckDetailService;
|
|
|
import com.fjhx.service.check.CheckInfoService;
|
|
|
import com.fjhx.service.stock.StockService;
|
|
|
import com.fjhx.service.water.WaterTagService;
|
|
|
-import com.fjhx.utils.WrapperUtil;
|
|
|
import org.springblade.core.tool.utils.ThreadUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
@@ -55,15 +56,16 @@ public class CheckInfoServiceImpl extends ServiceImpl<CheckInfoMapper, CheckInfo
|
|
|
private CheckDetailService checkDetailService;
|
|
|
|
|
|
@Override
|
|
|
- public Page<CheckInfo> getPage(Map<String, String> condition) {
|
|
|
+ public Page<Map<String, Object>> getPage(Condition condition) {
|
|
|
+ String keyword = condition.getKeyword();
|
|
|
+ Integer status = condition.getStatus();
|
|
|
|
|
|
- QueryWrapper<CheckInfo> wrapper = Wrappers.query();
|
|
|
+ QueryWrapper<Object> wrapper = Wrappers.query();
|
|
|
+ wrapper.and(ObjectUtil.isNotEmpty(keyword),
|
|
|
+ q -> q.like("m.name", keyword).or().like("m.code", keyword))
|
|
|
+ .eq(ObjectUtil.isNotEmpty(status), "cd.complete_check", status);
|
|
|
|
|
|
- WrapperUtil.init(condition, wrapper)
|
|
|
- .createTimeDesc();
|
|
|
-
|
|
|
- Page<CheckInfo> page = page(condition, wrapper);
|
|
|
- return page;
|
|
|
+ return baseMapper.getPage(condition.getPage(), wrapper);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
@@ -92,7 +94,7 @@ public class CheckInfoServiceImpl extends ServiceImpl<CheckInfoMapper, CheckInfo
|
|
|
|
|
|
WebSocketServer.sendInfo(WebSocketConstant.WEB_STOCK_PROGRAM, WebSocketConstant.OPERATING_UPPER_COMPUTER, data);
|
|
|
|
|
|
- ThreadUtil.sleep(1000);
|
|
|
+ ThreadUtil.sleep(1000 * 60 * 10);
|
|
|
|
|
|
data.clear();
|
|
|
data.put("type", 9);
|
|
@@ -115,7 +117,6 @@ public class CheckInfoServiceImpl extends ServiceImpl<CheckInfoMapper, CheckInfo
|
|
|
savaCheckDetailList(errorMaterialId, checkId);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
}
|
|
|
|
|
|
/**
|
|
@@ -204,7 +205,6 @@ public class CheckInfoServiceImpl extends ServiceImpl<CheckInfoMapper, CheckInfo
|
|
|
checkDetail.setCompleteCheck(StatusConstant.NO);
|
|
|
checkDetail.setStockHouseId(HouseConstant.GROUND_FLOOR_ID);
|
|
|
|
|
|
-
|
|
|
return checkDetail;
|
|
|
}).collect(Collectors.toList());
|
|
|
|