|
|
@@ -1,19 +1,29 @@
|
|
|
package com.steerinfo.meterwork.meterworkcarnoidentify.service.impl;
|
|
|
|
|
|
+import com.steerinfo.baseinfo.meterbasespotinfo.mapper.MeterBaseSpotInfoMapper;
|
|
|
+import com.steerinfo.baseinfo.meterbasespotinfo.model.MeterBaseSpotInfo;
|
|
|
import com.steerinfo.framework.mapper.IBaseMapper;
|
|
|
import com.steerinfo.framework.service.impl.BaseServiceImpl;
|
|
|
+import com.steerinfo.framework.service.pagehelper.PageHelper;
|
|
|
+import com.steerinfo.framework.service.pagehelper.PageList;
|
|
|
import com.steerinfo.meterwork.meterworkcarmetertime.model.PointDetailsBo;
|
|
|
+import com.steerinfo.meterwork.meterworkcarnoidentify.model.CarNoIndentifyAndCarFirst;
|
|
|
import com.steerinfo.meterwork.meterworkcarnoidentify.model.GroupByNumVo;
|
|
|
import com.steerinfo.meterwork.meterworkcarnoidentify.model.MeterWorkCarnoIdentify;
|
|
|
import com.steerinfo.meterwork.meterworkcarnoidentify.mapper.MeterWorkCarnoIdentifyMapper;
|
|
|
import com.steerinfo.meterwork.meterworkcarnoidentify.model.PointDetailsVo;
|
|
|
import com.steerinfo.meterwork.meterworkcarnoidentify.service.IMeterWorkCarnoIdentifyService;
|
|
|
+import com.steerinfo.util.StringUtils;
|
|
|
+import org.apache.shiro.crypto.hash.Hash;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
-import java.util.Date;
|
|
|
+
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.*;
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.util.HashMap;
|
|
|
-import java.util.List;
|
|
|
+import java.util.stream.Collectors;
|
|
|
+
|
|
|
+import static java.lang.Math.abs;
|
|
|
|
|
|
/**
|
|
|
* MeterWorkCarnoIdentify服务实现:
|
|
|
@@ -31,9 +41,12 @@ import java.util.List;
|
|
|
@Service(value = "meterWorkCarnoIdentifyService")
|
|
|
public class MeterWorkCarnoIdentifyServiceImpl extends BaseServiceImpl<MeterWorkCarnoIdentify, String> implements IMeterWorkCarnoIdentifyService {
|
|
|
|
|
|
- @Autowired
|
|
|
+ @Resource
|
|
|
private MeterWorkCarnoIdentifyMapper meterWorkCarnoIdentifyMapper;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private MeterBaseSpotInfoMapper meterBaseSpotInfoMapper;
|
|
|
+
|
|
|
@Override
|
|
|
protected IBaseMapper<MeterWorkCarnoIdentify, String> getMapper() {
|
|
|
return meterWorkCarnoIdentifyMapper;
|
|
|
@@ -45,6 +58,127 @@ public class MeterWorkCarnoIdentifyServiceImpl extends BaseServiceImpl<MeterWork
|
|
|
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public List<HashMap> getGroupByCarNoNum(HashMap params) {
|
|
|
+ List<HashMap> mapList = new ArrayList<>();
|
|
|
+ //汽车衡类型
|
|
|
+ params.put("spotTypeNo", "001002001");
|
|
|
+ //车号根据实绩ID左连接一次数据表
|
|
|
+ List<CarNoIndentifyAndCarFirst> models = meterWorkCarnoIdentifyMapper.selectGroupByCarNoNum(params);
|
|
|
+
|
|
|
+ List<MeterBaseSpotInfo> spotModels = meterBaseSpotInfoMapper.spotInfoByList(params);
|
|
|
+ if(spotModels.size() >= 1) {
|
|
|
+ for(MeterBaseSpotInfo spot: spotModels) {
|
|
|
+ //一次计量车数
|
|
|
+ long countCarFirst = 0L;
|
|
|
+ //球机车号识别数
|
|
|
+ long countBallIdentify = 0L;
|
|
|
+ //枪机车号识别数
|
|
|
+ long countGunIdentify = 0L;
|
|
|
+ //枪机球机识别差数
|
|
|
+ long countBallDifferGun = 0L;
|
|
|
+ //Rfid车号识别数
|
|
|
+ long countRfidIdentify = 0L;
|
|
|
+ //修正车号数
|
|
|
+ long countResetCar = 0L;
|
|
|
+ //枪机修改车号数
|
|
|
+ long countGunResetCar = 0L;
|
|
|
+ //球机修改车号数
|
|
|
+ long countBallResetCar = 0L;
|
|
|
+ //枪机车号识别率
|
|
|
+ double countGunIndentifyRate = 0;
|
|
|
+ //枪机识别准确率
|
|
|
+ double countGunIndentifyAccuracyRate = 0;
|
|
|
+ //球机车号识别率
|
|
|
+ double countBallIndentifyRate = 0;
|
|
|
+ //球机识别准确率
|
|
|
+ double countBallIndentifyAccuracyRate = 0;
|
|
|
+ if(models != null && models.size() >= 1) {
|
|
|
+ //一次计量车数
|
|
|
+ countCarFirst = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
|
|
|
+ && model.getBaseSpotName().equals(spot.getBaseSpotName())).count();
|
|
|
+ //球机车号识别数
|
|
|
+ countBallIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
|
|
|
+ && model.getBaseSpotName().equals(spot.getBaseSpotName())
|
|
|
+ && model.getCarNoType().equals("1")
|
|
|
+ && StringUtils.isNotEmpty(model.getVideoCarNo1())).count();
|
|
|
+ //枪机车号识别数
|
|
|
+ countGunIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
|
|
|
+ && model.getBaseSpotName().equals(spot.getBaseSpotName())
|
|
|
+ && model.getCarNoType().equals("1")
|
|
|
+ && StringUtils.isNotEmpty(model.getVideoCarNo2())).count();
|
|
|
+ //枪机球机识别差数
|
|
|
+ countBallDifferGun = abs(countBallIdentify - countGunIdentify);
|
|
|
+ //Rfid车号识别数
|
|
|
+ countRfidIdentify = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
|
|
|
+ && model.getBaseSpotName().equals(spot.getBaseSpotName())
|
|
|
+ && model.getCarNoType().equals("2")
|
|
|
+ && StringUtils.isNotEmpty(model.getRfidCarNo())).count();
|
|
|
+ //修正车号数
|
|
|
+ countResetCar = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
|
|
|
+ && model.getBaseSpotName().equals(spot.getBaseSpotName())
|
|
|
+ && model.getCarNoType().equals("4")).count();
|
|
|
+ //枪机修改车号数
|
|
|
+ countGunResetCar = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
|
|
|
+ && model.getBaseSpotName().equals(spot.getBaseSpotName())
|
|
|
+ && model.getCarNoType().equals("1")
|
|
|
+ && StringUtils.isNotEmpty(model.getVideoCarNo2())
|
|
|
+ && model.getCarNo() != model.getFirstCarNo()).count();
|
|
|
+ //球机修改车号数
|
|
|
+ countBallResetCar = models.stream().filter(model -> model.getBaseSpotNo().equals(spot.getBaseSpotNo())
|
|
|
+ && model.getBaseSpotName().equals(spot.getBaseSpotName())
|
|
|
+ && model.getCarNoType().equals("1")
|
|
|
+ && StringUtils.isNotEmpty(model.getVideoCarNo1())
|
|
|
+ && model.getCarNo() != model.getFirstCarNo()).count();
|
|
|
+ //枪机车号识别率------枪机车号识别数/一次计量车数
|
|
|
+ if(countCarFirst != 0) {
|
|
|
+ countGunIndentifyRate = Math.round(countGunIdentify/(countCarFirst*1.0)*100*100)/100.0; //(Math.round(*100))/100.0;
|
|
|
+ }
|
|
|
+ //枪机识别准确率------(枪机识别车号数-枪机识别错误修正数)/枪机识别车号数
|
|
|
+ if(countGunIdentify != 0) {
|
|
|
+ countGunIndentifyAccuracyRate = Math.round((countGunIdentify-countGunResetCar)/(countGunIdentify*1.0)*100*100)/100.0; //(Math.round((*100))/100.0;
|
|
|
+ }
|
|
|
+ //球机车号识别率
|
|
|
+ if(countCarFirst != 0) {
|
|
|
+ countBallIndentifyRate = Math.round(countBallIdentify/(countCarFirst*1.0)*100*100)/100.0; //(Math.round(*100))/100.0;
|
|
|
+ }
|
|
|
+ //球机识别准确率
|
|
|
+ if(countBallIdentify != 0) {
|
|
|
+ countBallIndentifyAccuracyRate = Math.round((countBallIdentify-countBallResetCar)/(countBallIdentify*1.0)*100*100)/100.0; //(Math.round((*100))/100.0;
|
|
|
+ }
|
|
|
+
|
|
|
+ HashMap<String, Object> obj = new HashMap<>();
|
|
|
+ //一次计量车数、球机车号识别数、枪机车号识别数、枪机球机识别差数、Rfid车号识别数、
|
|
|
+ // 修正车号数、枪机修改车号数、球机修改车号数、枪机车号识别率、枪机识别准确率、球机车号识别率、球机识别准确率
|
|
|
+ obj.put("spotNo", spot.getBaseSpotNo());
|
|
|
+ obj.put("spotName", spot.getBaseSpotName());
|
|
|
+ obj.put("countCarFirst", countCarFirst);
|
|
|
+ obj.put("countBallIdentify", countBallIdentify);
|
|
|
+ obj.put("countGunIdentify", countGunIdentify);
|
|
|
+ obj.put("countBallDifferGun", countBallDifferGun);
|
|
|
+ obj.put("countRfidIdentify", countRfidIdentify);
|
|
|
+ obj.put("countResetCar", countResetCar);
|
|
|
+ obj.put("countGunResetCar", countGunResetCar);
|
|
|
+ obj.put("countBallResetCar", countBallResetCar);
|
|
|
+ obj.put("countGunIndentifyRate", countGunIndentifyRate);
|
|
|
+ obj.put("countGunIndentifyAccuracyRate", countGunIndentifyAccuracyRate);
|
|
|
+ obj.put("countBallIndentifyRate", countBallIndentifyRate);
|
|
|
+ obj.put("countBallIndentifyAccuracyRate", countBallIndentifyAccuracyRate);
|
|
|
+ mapList.add(obj);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return mapList;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public PageList<HashMap> getCarNoDetail(HashMap params) {
|
|
|
+ PageHelper.startPage(Integer.parseInt(params.get("pageNum").toString()), Integer.parseInt(params.get("pageSize").toString()));
|
|
|
+ List<HashMap> rows = meterWorkCarnoIdentifyMapper.getCarNoDetail(params);
|
|
|
+ PageList pageInfo = new PageList(rows);
|
|
|
+ return pageInfo;
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public List<PointDetailsVo> getPointDetails(PointDetailsBo pointDetailsBo) {
|
|
|
return meterWorkCarnoIdentifyMapper.selectPointDetails(pointDetailsBo);
|