Commit 3ee2cf8a authored by hkl's avatar hkl

feat:1.修改轨检查仪数据问题

parent 6359c104
...@@ -608,11 +608,11 @@ public class AnalysisAlgorithm { ...@@ -608,11 +608,11 @@ public class AnalysisAlgorithm {
BigDecimal sumUnitScore = null; BigDecimal sumUnitScore = null;
BigDecimal finalZontalSpeed = null; BigDecimal finalZontalSpeed = null;
BigDecimal sumZontalSpeed = BigDecimal.ZERO; BigDecimal sumZontalSpeed = BigDecimal.ZERO;
int zontalSpeedSize = 1; int zontalSpeedSize = 0;
BigDecimal finalVerticalSpeed = null; BigDecimal finalVerticalSpeed = null;
BigDecimal sumVerticalSpeed = BigDecimal.ZERO; BigDecimal sumVerticalSpeed = BigDecimal.ZERO;
int verticalSpeedSize = 1; int verticalSpeedSize = 0;
List<AnalysisBatchUnitDevicePointScore> scoreList = new ArrayList<>(); List<AnalysisBatchUnitDevicePointScore> scoreList = new ArrayList<>();
for (MovementAdditiveInfo movementAdditiveInfo : currentUnitDeviceAdditiveList) { for (MovementAdditiveInfo movementAdditiveInfo : currentUnitDeviceAdditiveList) {
...@@ -1302,6 +1302,13 @@ public class AnalysisAlgorithm { ...@@ -1302,6 +1302,13 @@ public class AnalysisAlgorithm {
// 1.2 处理检查项目是公里的情况 // 1.2 处理检查项目是公里的情况
BigDecimal checkItemStartingMileage = checkItem.getCourseStartingMileage().multiply(new BigDecimal("1000")); BigDecimal checkItemStartingMileage = checkItem.getCourseStartingMileage().multiply(new BigDecimal("1000"));
BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage().multiply(new BigDecimal("1000")); BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage().multiply(new BigDecimal("1000"));
// 如果 开始里程>结束里程 就两两交换位置
if (checkItemStartingMileage.compareTo(checkItemEndMileage) > 0) {
BigDecimal tempMileage = checkItemStartingMileage;
checkItemStartingMileage = checkItemEndMileage;
checkItemEndMileage = tempMileage;
}
checkItem.setCourseStartingMileage(checkItemStartingMileage); checkItem.setCourseStartingMileage(checkItemStartingMileage);
checkItem.setCourseEndMileage(checkItemEndMileage); checkItem.setCourseEndMileage(checkItemEndMileage);
} }
...@@ -1311,16 +1318,15 @@ public class AnalysisAlgorithm { ...@@ -1311,16 +1318,15 @@ public class AnalysisAlgorithm {
for (Map<String, Object> unitDevice : unitDeviceList) { for (Map<String, Object> unitDevice : unitDeviceList) {
BigDecimal centerMileage = Convert.toBigDecimal(unitDevice.get("centerMileage")); BigDecimal centerMileage = Convert.toBigDecimal(unitDevice.get("centerMileage"));
System.out.println("单元设备code:" + unitDevice.get("unitCode") + "单元中心里程:" + centerMileage);
// 2.1 循环遍历检查项目比较【开始-结束】来映射关联关系 // 2.1 循环遍历检查项目比较【开始-结束】来映射关联关系
System.out.println("单元设备名称=" + unitDevice.get("unitCode"));
System.out.println("单元中心里程=" + centerMileage);
for (RailInspectionEquipmentItem checkItem : checkItemList) { for (RailInspectionEquipmentItem checkItem : checkItemList) {
BigDecimal checkItemStartingMileage = checkItem.getCourseStartingMileage(); BigDecimal checkItemStartingMileage = checkItem.getCourseStartingMileage();
BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage(); BigDecimal checkItemEndMileage = checkItem.getCourseEndMileage();
System.out.printf("检查项目[开始-结束]=[" + centerMileage + "-" + checkItemEndMileage + "]");
System.out.printf("【" + checkItemStartingMileage + "-" + checkItemEndMileage + "]");
// 2.2.1 命中检查项目 // 2.2.1 命中检查项目
if (checkItemStartingMileage.compareTo(centerMileage) <= 0 && checkItemEndMileage.compareTo(centerMileage) > 0) { if (checkItemStartingMileage.compareTo(centerMileage) <= 0 && checkItemEndMileage.compareTo(centerMileage) > 0) {
List<RailInspectionEquipmentItemDetail> movementCourseInfos = checkItemItemDetailMap.get(checkItem.getId()); List<RailInspectionEquipmentItemDetail> movementCourseInfos = checkItemItemDetailMap.get(checkItem.getId());
......
...@@ -210,6 +210,7 @@ ...@@ -210,6 +210,7 @@
LEFT JOIN t_djt_movement_records_master t3 ON t2.movement_master_id = t3.id LEFT JOIN t_djt_movement_records_master t3 ON t2.movement_master_id = t3.id
WHERE t1.analysis_batch_unit_device_id = #{id} WHERE t1.analysis_batch_unit_device_id = #{id}
AND t1.ek_type = 4 AND t1.ek_type = 4
GROUP BY t2.id
ORDER BY t3.ek_code ASC ORDER BY t3.ek_code ASC
</select> </select>
......
...@@ -46,52 +46,47 @@ public class SysLogController { ...@@ -46,52 +46,47 @@ public class SysLogController {
private static final String ALL_ClEAR = "allclear"; private static final String ALL_ClEAR = "allclear";
/** /**
* @功能:查询日志记录
* @param syslog * @param syslog
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param req * @param req
* @return * @return
* @功能:查询日志记录
*/ */
@RequestMapping(value = "/list", method = RequestMethod.GET) @RequestMapping(value = "/list", method = RequestMethod.GET)
public Result<IPage<SysLog>> queryPageList(SysLog syslog,@RequestParam(name="pageNo", defaultValue="1") Integer pageNo, public Result<IPage<SysLog>> queryPageList(SysLog syslog, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,HttpServletRequest req) { @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
Result<IPage<SysLog>> result = new Result<IPage<SysLog>>(); Result<IPage<SysLog>> result = new Result<IPage<SysLog>>();
QueryWrapper<SysLog> queryWrapper = QueryGenerator.initQueryWrapper(syslog, req.getParameterMap()); QueryWrapper<SysLog> queryWrapper = QueryGenerator.initQueryWrapper(syslog, req.getParameterMap());
queryWrapper.lambda().orderByDesc(SysLog::getCreateTime);
Page<SysLog> page = new Page<SysLog>(pageNo, pageSize); Page<SysLog> page = new Page<SysLog>(pageNo, pageSize);
//日志关键词 //日志关键词
String keyWord = req.getParameter("keyWord"); String keyWord = req.getParameter("keyWord");
if(oConvertUtils.isNotEmpty(keyWord)) { if (oConvertUtils.isNotEmpty(keyWord)) {
queryWrapper.like("log_content",keyWord); queryWrapper.like("log_content", keyWord);
} }
//TODO 过滤逻辑处理
//TODO begin、end逻辑处理
//TODO 一个强大的功能,前端传一个字段字符串,后台只返回这些字符串对应的字段
//创建时间/创建人的赋值 //创建时间/创建人的赋值
IPage<SysLog> pageList = sysLogService.page(page, queryWrapper); IPage<SysLog> pageList = sysLogService.page(page, queryWrapper);
log.info("查询当前页:"+pageList.getCurrent());
log.info("查询当前页数量:"+pageList.getSize());
log.info("查询结果数量:"+pageList.getRecords().size());
log.info("数据总数:"+pageList.getTotal());
result.setSuccess(true); result.setSuccess(true);
result.setResult(pageList); result.setResult(pageList);
return result; return result;
} }
/** /**
* @功能:删除单个日志记录
* @param id * @param id
* @return * @return
* @功能:删除单个日志记录
*/ */
@RequestMapping(value = "/delete", method = RequestMethod.DELETE) @RequestMapping(value = "/delete", method = RequestMethod.DELETE)
public Result<SysLog> delete(@RequestParam(name="id",required=true) String id) { public Result<SysLog> delete(@RequestParam(name = "id", required = true) String id) {
Result<SysLog> result = new Result<SysLog>(); Result<SysLog> result = new Result<SysLog>();
SysLog sysLog = sysLogService.getById(id); SysLog sysLog = sysLogService.getById(id);
if(sysLog==null) { if (sysLog == null) {
result.error500("未找到对应实体"); result.error500("未找到对应实体");
}else { } else {
boolean ok = sysLogService.removeById(id); boolean ok = sysLogService.removeById(id);
if(ok) { if (ok) {
result.success("删除成功!"); result.success("删除成功!");
} }
} }
...@@ -99,17 +94,17 @@ public class SysLogController { ...@@ -99,17 +94,17 @@ public class SysLogController {
} }
/** /**
* @功能:批量,全部清空日志记录
* @param ids * @param ids
* @return * @return
* @功能:批量,全部清空日志记录
*/ */
@RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE) @RequestMapping(value = "/deleteBatch", method = RequestMethod.DELETE)
public Result<SysRole> deleteBatch(@RequestParam(name="ids",required=true) String ids) { public Result<SysRole> deleteBatch(@RequestParam(name = "ids", required = true) String ids) {
Result<SysRole> result = new Result<SysRole>(); Result<SysRole> result = new Result<SysRole>();
if(ids==null || "".equals(ids.trim())) { if (ids == null || "".equals(ids.trim())) {
result.error500("参数不识别!"); result.error500("参数不识别!");
}else { } else {
if(ALL_ClEAR.equals(ids)) { if (ALL_ClEAR.equals(ids)) {
this.sysLogService.removeAll(); this.sysLogService.removeAll();
result.success("清除成功!"); result.success("清除成功!");
} }
......
...@@ -167,7 +167,7 @@ mybatis-plus: ...@@ -167,7 +167,7 @@ mybatis-plus:
table-underline: true table-underline: true
configuration: configuration:
# 这个配置会将执行的sql打印出来,在开发或测试的时候可以用 # 这个配置会将执行的sql打印出来,在开发或测试的时候可以用
log-impl: org.apache.ibatis.logging.stdout.StdOutImpl # log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# 返回类型为Map,显示null对应的字段 # 返回类型为Map,显示null对应的字段
call-setters-on-nulls: true call-setters-on-nulls: true
# 驼峰 # 驼峰
......
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