|
@@ -1,11 +1,13 @@
|
|
package com.usky.fire.service.impl;
|
|
package com.usky.fire.service.impl;
|
|
|
|
|
|
|
|
+import com.alibaba.fastjson.JSON;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.alibaba.fastjson.JSONObject;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.usky.common.core.bean.CommonPage;
|
|
import com.usky.common.core.bean.CommonPage;
|
|
|
|
+import com.usky.common.core.util.HttpUtils;
|
|
import com.usky.common.core.util.StringUtils;
|
|
import com.usky.common.core.util.StringUtils;
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
import com.usky.common.mybatis.core.AbstractCrudService;
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
import com.usky.common.security.utils.SecurityUtils;
|
|
@@ -86,7 +88,7 @@ public class MhPostInspectServiceImpl extends AbstractCrudService<MhPostInspectM
|
|
String endTime = format.format(date);
|
|
String endTime = format.format(date);
|
|
if (StringUtils.isNotBlank(companyId)) {
|
|
if (StringUtils.isNotBlank(companyId)) {
|
|
Integer spentTimeAvg = baseMapper.mhPostInspectStatistics(" AVG(spent_time) ", 1, startTime, endTime, null, companyId);
|
|
Integer spentTimeAvg = baseMapper.mhPostInspectStatistics(" AVG(spent_time) ", 1, startTime, endTime, null, companyId);
|
|
- if (spentTimeAvg==null){
|
|
|
|
|
|
+ if (spentTimeAvg == null) {
|
|
spentTimeAvg = 0;
|
|
spentTimeAvg = 0;
|
|
}
|
|
}
|
|
answeredCount = baseMapper.mhPostInspectStatistics(" count(*) ", 1, startTime, endTime, null, companyId);
|
|
answeredCount = baseMapper.mhPostInspectStatistics(" count(*) ", 1, startTime, endTime, null, companyId);
|
|
@@ -115,7 +117,7 @@ public class MhPostInspectServiceImpl extends AbstractCrudService<MhPostInspectM
|
|
long data1 = LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"));
|
|
long data1 = LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8"));
|
|
long data2 = mhPostInspect.getInspectTime().toEpochSecond(ZoneOffset.of("+8"));
|
|
long data2 = mhPostInspect.getInspectTime().toEpochSecond(ZoneOffset.of("+8"));
|
|
long time = data1 - data2;
|
|
long time = data1 - data2;
|
|
- mhPostInspect.setCountdown(600-time);
|
|
|
|
|
|
+ mhPostInspect.setCountdown(600 - time);
|
|
String message = JSONObject.toJSONString(mhPostInspect);
|
|
String message = JSONObject.toJSONString(mhPostInspect);
|
|
List<BaseUserCompany> userCompanyList = baseUserCompanyService.userCompanyList(mhPostInspect.getCompanyId());
|
|
List<BaseUserCompany> userCompanyList = baseUserCompanyService.userCompanyList(mhPostInspect.getCompanyId());
|
|
for (int i = 0; i < userCompanyList.size(); i++) {
|
|
for (int i = 0; i < userCompanyList.size(); i++) {
|
|
@@ -156,4 +158,24 @@ public class MhPostInspectServiceImpl extends AbstractCrudService<MhPostInspectM
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
+ public void postInspectAnswerRequest() {
|
|
|
|
+ String url = "http://172.16.120.165:13200/prod-api/service-fire/postInspect/postInspectAnswerRecept";
|
|
|
|
+ String res = null;
|
|
|
|
+ try {
|
|
|
|
+ res = HttpUtils.get(url, null);
|
|
|
|
+ } catch (IOException e) {
|
|
|
|
+ e.printStackTrace();
|
|
|
|
+ }
|
|
|
|
+ if (StringUtils.isNotBlank(res)) {
|
|
|
|
+ JSONObject jsonObj = JSONObject.parseObject(res);
|
|
|
|
+ String userStr = jsonObj.getString("data");
|
|
|
|
+ if (StringUtils.isNotBlank(userStr) && !userStr.equals("[]")) {
|
|
|
|
+ List<MhPostInspect> mhPostInspectList = JSON.parseArray(userStr, MhPostInspect.class);
|
|
|
|
+ for (int i = 0; i < mhPostInspectList.size(); i++) {
|
|
|
|
+ this.updateById(mhPostInspectList.get(i));
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+ }
|
|
}
|
|
}
|