Commit cfe32d1c authored by xixinzhao's avatar xixinzhao

Merge branch 'develop_dl' into develop_0504

parents 1b534637 d71ffd74
......@@ -185,12 +185,10 @@ public class Car extends BaseEntity {
private String importStr;
@TableField(exist = false)
private Integer totalTravel;
private Double totalTravel;
@TableField(exist = false)
private double longitude;
@TableField(exist = false)
private double latitude;
@TableField(exist = false)
......
......@@ -12,7 +12,7 @@ public class CarTravelDto {
String totalTime;
Integer totalTravel;
Double totalTravel;
List<WlCarMileageDto> records;
......
......@@ -20,6 +20,7 @@ import org.typroject.tyboot.core.foundation.enumeration.UserType;
import org.typroject.tyboot.core.restful.doc.TycloudOperation;
import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -159,7 +160,7 @@ public class WlCarMileageController {
CarTravelDto carTravelDto = new CarTravelDto();
carTravelDto.setTotal(page.getTotal());
long totalTime = 0;
int totalTravel = 0;
double totalTravel = 0;
List<WlCarMileageDto> list = new ArrayList<WlCarMileageDto>();
for (WlCarMileage wl : page.getRecords()) {
WlCarMileageDto wlCarMileageDto = new WlCarMileageDto();
......@@ -179,7 +180,9 @@ public class WlCarMileageController {
//
// String timeStr = dateFormat.format(totalTime);
carTravelDto.setTotalTime(millisToStringShort(totalTime));
carTravelDto.setTotalTravel(totalTravel);
BigDecimal two = BigDecimal.valueOf(totalTravel);
double result = two.setScale(2,BigDecimal.ROUND_HALF_UP).doubleValue();
carTravelDto.setTotalTravel(result);
return carTravelDto;
}
......
......@@ -15,6 +15,6 @@ public interface WlCarMileageMapper extends BaseMapper<WlCarMileage> {
Page<WlCarMileage> page(Page<WlCarMileage> page,@Param("wlCarMileage") WlCarMileage wlCarMileage);
Integer totalMileage(String iotCode);
Double totalMileage(String iotCode);
}
......@@ -19,7 +19,7 @@ public interface IWlCarMileageService extends IService<WlCarMileage> {
Page<WlCarMileage> page(Page<WlCarMileage> page, WlCarMileage wlCarMileage);
Integer totalMileage(String iotCode);
Double totalMileage(String iotCode);
List<Coordinate> getCoordinateList(long id);
......
......@@ -1355,7 +1355,7 @@ public class CarServiceImpl extends ServiceImpl<CarMapper, Car> implements ICarS
car.setImportStr(car.getIsImport() ? "进口" : "国产");
}
if (!ObjectUtils.isEmpty(car.getIotCode())) {
Integer totalTravel = iWlCarMileageService.totalMileage(car.getIotCode());
Double totalTravel = iWlCarMileageService.totalMileage(car.getIotCode());
car.setTotalTravel(totalTravel);
WlCarMileage last = iWlCarMileageService
.getOne(new LambdaQueryWrapper<WlCarMileage>().eq(WlCarMileage::getIotCode, car.getIotCode())
......
......@@ -1699,6 +1699,14 @@ public class EquipmentSpecificSerivceImpl extends ServiceImpl<EquipmentSpecificM
return data;
}
List<EquipmentSpecificVo> resultData = data.stream().filter(a -> a.getIotCode().equals(iotCode)).collect(Collectors.toList());
if (CollectionUtils.isEmpty(resultData)) {
List<EquipmentSpecificVo> equipOrCarByIotCode = equipmentSpecificMapper.getEquipOrCarByIotCode(iotCode);
if (!CollectionUtils.isEmpty(equipOrCarByIotCode)) {
data.addAll(equipOrCarByIotCode);
redisUtils.set("equipAndCarIotCodes", JSONObject.toJSONString(data));
return equipOrCarByIotCode;
}
}
return resultData;
}
......
......@@ -59,7 +59,7 @@ public class WlCarMileageServiceImpl extends ServiceImpl<WlCarMileageMapper, WlC
}
@Override
public Integer totalMileage(String iotCode) {
public Double totalMileage(String iotCode) {
return this.baseMapper.totalMileage(iotCode);
}
......
......@@ -30,6 +30,7 @@ import io.swagger.annotations.ApiParam;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.data.domain.Page;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.scheduling.annotation.Scheduled;
......@@ -64,6 +65,9 @@ public class PlanTaskController extends AbstractBaseController {
@Autowired
private IRouteService routeService;
@Value("${params.isPush:false}")
private Boolean isZxj;
@Autowired
private RemoteSecurityService remoteSecurityService;
......@@ -349,6 +353,7 @@ public class PlanTaskController extends AbstractBaseController {
@ApiOperation(value = "定时执行任务表生成(<font color='blue'>release</font>)", notes = "定时执行任务表生成")
@RequestMapping(value = "/queryOmission", method = RequestMethod.GET, produces = "application/json;charset=UTF-8")
public CommonResponse pushCarData() {
if (Boolean.TRUE.equals(!isZxj)) {
try {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
......@@ -360,16 +365,20 @@ public class PlanTaskController extends AbstractBaseController {
return CommonResponseUtil.failure();
}
}
return CommonResponseUtil.success();
}
/**
* 定时任务推送巡检待办任务消息
*/
@Scheduled(cron = "${jobs.cron}")
public void taskMessage() {
if (Boolean.TRUE.equals(!isZxj)) {
RequestAttributes reqs = RequestContextHolder.getRequestAttributes();
RequestContextHolder.setRequestAttributes(reqs, true);
planTaskService.taskMessage(null);
}
}
/**
* 模拟发送巡检待办任务消息定时任务
......
......@@ -2,7 +2,7 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace="com.yeejoin.equipmanage.mapper.WlCarMileageMapper">
<select id="totalMileage" resultType="Integer">
<select id="totalMileage" resultType="Double">
SELECT SUM(travel) FROM wl_car_mileage WHERE iot_code = #{iotCode}
</select>
......
......@@ -96,3 +96,6 @@ file.url=http://172.16.11.201:9000/
##代码中有部分逻辑冲突需要处理 为区分机场和电力逻辑 增加开关 若为true 则为机场逻辑 为false 则为电力逻辑
logic=false
#是否为中心级系统 true-中心级系统 false-站端系统
is.zxj=true
\ 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