修改OTA项目状态统计
This commit is contained in:
+3
-4
@@ -272,7 +272,7 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
|
||||
@ApiOperation(value = "查询项目涉及的VDR版本", notes = "查询项目涉及的VDR版本")
|
||||
@GetMapping(value = "/getVdrListByProject")
|
||||
public Result<?> getVdrListByProject(String projectId, String cut) {
|
||||
List<OtaManageReceive> resList = otaManageApplyEOService.getVdrListByProject(projectId, cut);
|
||||
List<OtaManageApplyEO> resList = otaManageApplyEOService.getVdrListByProject(projectId, cut);
|
||||
return Result.OK("操作成功!", resList);
|
||||
}
|
||||
|
||||
@@ -280,11 +280,10 @@ public class OtaManageApplyEOController extends JeroController<OtaManageApplyEO,
|
||||
@ApiOperation(value = "通过软件版本和项目ID查询状态", notes = "通过软件版本和项目ID查询状态")
|
||||
@GetMapping(value = "/getStatisticalStatus")
|
||||
public Result<?> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut) {
|
||||
List<OtaManageApplyEO> resList = otaManageApplyEOService.getStatisticalStatus(projectId, plannedBpLaunchBatch, cut);
|
||||
return Result.OK("操作成功!", resList);
|
||||
Map<String, Object> res = otaManageApplyEOService.getStatisticalStatus(projectId, plannedBpLaunchBatch, cut);
|
||||
return Result.OK("操作成功!", res);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* OTA管理导出excel
|
||||
*
|
||||
|
||||
+1
@@ -39,4 +39,5 @@ public interface OtaManageApplyEOMapper extends BaseMapper<OtaManageApplyEO> {
|
||||
|
||||
List<VersionVO> getVersionInfo(@Param("vdr") String vdr);
|
||||
|
||||
List<OtaManageApplyEO> getListByProjectId(@Param("projectId") String projectId,@Param("plannedBpLaunchBatch") String plannedBpLaunchBatch);
|
||||
}
|
||||
|
||||
+12
@@ -15,6 +15,18 @@
|
||||
<result column="remark" property="remark" />
|
||||
</resultMap>
|
||||
|
||||
<select id="getListByProjectId" resultType="com.jero.modules.ota.entity.OtaManageApplyEO">
|
||||
select * from ota_manage_apply
|
||||
JOIN ota_manage_receive ON ota_manage_apply.vdr = ota_manage_receive.id
|
||||
<where>
|
||||
ota_manage_apply =#{projectId}
|
||||
<if test="plannedBpLaunchBatch != null and plannedBpLaunchBatch != ''">
|
||||
and ota_manage_receive.planned_bp_launch_batch_ =#{plannedBpLaunchBatch}
|
||||
</if>
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
<select id="getOtaList" resultType="com.jero.modules.ota.entity.OtaManageApplyEO">
|
||||
select * from ota_manage_receive
|
||||
<where>
|
||||
|
||||
+2
-2
@@ -118,9 +118,9 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
|
||||
|
||||
List<String> reject(String ids, String rejectReason,String cut);
|
||||
|
||||
List<OtaManageReceive> getVdrListByProject(String projectId, String cut);
|
||||
List<OtaManageApplyEO> getVdrListByProject(String projectId, String cut);
|
||||
|
||||
List<OtaManageApplyEO> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut);
|
||||
Map<String, Object> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut);
|
||||
|
||||
ModelAndView otaExportXls(HttpServletRequest request, OtaManageApplyEO otaManageApplyEO);
|
||||
|
||||
|
||||
+96
-41
@@ -27,6 +27,7 @@ import com.jero.modules.ota.service.IOtaManageReceiveService;
|
||||
import com.jero.modules.ota.vo.VersionVO;
|
||||
import com.jero.modules.project.entity.ProjectLibraryBase;
|
||||
import com.jero.modules.project.entity.ProjectTaskPlanning;
|
||||
import com.jero.modules.project.enums.CertificationProgressEnum;
|
||||
import com.jero.modules.project.service.IProjectLibraryBaseService;
|
||||
import com.jero.modules.project.service.impl.ProjectTaskPlanningServiceImpl;
|
||||
import com.jero.modules.system.entity.SysDictItem;
|
||||
@@ -66,8 +67,6 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMapper, OtaManageApplyEO> implements IOtaManageApplyEOService {
|
||||
|
||||
@Autowired
|
||||
private OtaManageApplyEOMapper otaManageApplyEOMapper;
|
||||
@Autowired
|
||||
private ProjectTaskPlanningServiceImpl projectTaskPlanningService;
|
||||
@Autowired
|
||||
@@ -85,16 +84,12 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
@Autowired
|
||||
private IOtaManageReceiveService otaManageReceiveService;
|
||||
|
||||
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String upLoadPath;
|
||||
|
||||
|
||||
private static SimpleDateFormat sdf=new SimpleDateFormat("yyyy-MM-dd");
|
||||
private static SimpleDateFormat dateFormat = new SimpleDateFormat("yyyyMMdd");
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 保存
|
||||
*
|
||||
@@ -152,7 +147,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
*/
|
||||
@Override
|
||||
public List<VersionVO> getByAppliedVehicleProject(String appliedVehicleProject) {
|
||||
otaManageApplyEOMapper.getByAppliedVehicleProject(appliedVehicleProject);
|
||||
this.getBaseMapper().getByAppliedVehicleProject(appliedVehicleProject);
|
||||
|
||||
|
||||
return new ArrayList<>();
|
||||
@@ -175,14 +170,14 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
*/
|
||||
@Override
|
||||
public List<OtaManageApplyEO> getOtaPage(OtaManageApplyEO otaManageApplyEO) {
|
||||
List<OtaManageApplyEO> otaManageApplyEOList = otaManageApplyEOMapper.getOtaList(otaManageApplyEO);
|
||||
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaList(otaManageApplyEO);
|
||||
if(!otaManageApplyEOList.isEmpty()){
|
||||
List<String> otaNameList = OtaCarEnum.getOtaNameList();
|
||||
List<String> plannedBpLaunchBatchList = otaManageApplyEOList.stream()
|
||||
.filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch()))
|
||||
.map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList());
|
||||
if(!plannedBpLaunchBatchList.isEmpty()){
|
||||
List<OtaManageReceiveNsdpEO> manageReceiveNsdpEOList = otaManageApplyEOMapper.getReleaseDate(plannedBpLaunchBatchList);
|
||||
List<OtaManageReceiveNsdpEO> manageReceiveNsdpEOList = this.getBaseMapper().getReleaseDate(plannedBpLaunchBatchList);
|
||||
for (OtaManageApplyEO manageApplyEO : otaManageApplyEOList) {
|
||||
manageApplyEO.setVdr(manageApplyEO.getId());
|
||||
List<OtaManageReceiveNsdpEO> collect = manageReceiveNsdpEOList.stream()
|
||||
@@ -575,7 +570,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
*/
|
||||
@Override
|
||||
public List<OtaManageApplyEO> getOtaCarPage(OtaManageApplyEO otaManageApplyEO,String cut) {
|
||||
List<OtaManageApplyEO> otaManageApplyEOList = otaManageApplyEOMapper.getOtaCarPage(otaManageApplyEO);
|
||||
List<OtaManageApplyEO> otaManageApplyEOList = this.getBaseMapper().getOtaCarPage(otaManageApplyEO);
|
||||
List<OtaManageApplyEO> list = new ArrayList<>();
|
||||
String carMarket = otaManageApplyEO.getAppliedVehicleProject();
|
||||
if(StringUtils.isNotBlank(carMarket) && !"全部".equals(carMarket) && !otaManageApplyEOList.isEmpty()){
|
||||
@@ -700,7 +695,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
*/
|
||||
@Override
|
||||
public Map<String,Object> getPullDownList() {
|
||||
List<OtaManageApplyEO> otaManageApplyEOS = otaManageApplyEOMapper.getOtaCarList();
|
||||
List<OtaManageApplyEO> otaManageApplyEOS = this.getBaseMapper().getOtaCarList();
|
||||
Map<String,Object> result = new HashMap<>();
|
||||
if(!otaManageApplyEOS.isEmpty()){
|
||||
//软件版本 planned_bp_launch_batch_
|
||||
@@ -746,7 +741,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
*/
|
||||
@Override
|
||||
public List<String> getCarList() {
|
||||
List<OtaManageApplyEO> otaManageApplyEOS = otaManageApplyEOMapper.getOtaCarList();
|
||||
List<OtaManageApplyEO> otaManageApplyEOS = this.getBaseMapper().getOtaCarList();
|
||||
List<String> result = new LinkedList<>();
|
||||
result.add("全部");
|
||||
if(!otaManageApplyEOS.isEmpty()){
|
||||
@@ -797,7 +792,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
market = "UK";
|
||||
}
|
||||
}
|
||||
versionVOList = otaManageApplyEOMapper.getProjectVersion(car, market);
|
||||
versionVOList = this.getBaseMapper().getProjectVersion(car, market);
|
||||
List<VersionVO> oneList = versionVOList.stream().filter(e -> StringUtils.isBlank(e.getParentId())).collect(Collectors.toList());
|
||||
List<VersionVO> twoList = versionVOList.stream().filter(e -> StringUtils.isNotBlank(e.getParentId())).collect(Collectors.toList());
|
||||
|
||||
@@ -830,7 +825,7 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
//认证进度数据字典 certification_progress
|
||||
List<SysDictItem> regionDictList = sysDictItemServiceImpl.selectItemsByDictCode("certification_progress");
|
||||
|
||||
List<VersionVO> versionVOList = otaManageApplyEOMapper.getVersionInfo(vdr);
|
||||
List<VersionVO> versionVOList = this.getBaseMapper().getVersionInfo(vdr);
|
||||
List<VersionVO> result = new LinkedList<>();
|
||||
if(!versionVOList.isEmpty()){
|
||||
List<VersionVO> oneList = versionVOList.stream().filter(e -> StringUtils.isBlank(e.getParentId())).collect(Collectors.toList());
|
||||
@@ -1011,42 +1006,102 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OtaManageReceive> getVdrListByProject(String projectId, String cut) {
|
||||
List<OtaManageReceive> resList = new ArrayList<>();
|
||||
QueryWrapper<OtaManageApplyEO> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.lambda().eq(OtaManageApplyEO::getProjectVersion, projectId);
|
||||
List<OtaManageApplyEO> otaManageApplyEOS = this.list(queryWrapper);
|
||||
//查找已维护项目的数据,根据VDR去重
|
||||
List<String> vdrList = otaManageApplyEOS.stream()
|
||||
.filter(e -> StringUtils.isNotBlank(e.getVdr()))
|
||||
.map(OtaManageApplyEO::getVdr).distinct().collect(Collectors.toList());
|
||||
|
||||
if (CollectionUtils.isNotEmpty(vdrList)) {
|
||||
resList = otaManageReceiveService.getReceiveByVdr(vdrList).stream()
|
||||
public List<OtaManageApplyEO> getVdrListByProject(String projectId, String cut) {
|
||||
List<OtaManageApplyEO> receiveList = this.getBaseMapper().getListByProjectId(projectId, "");
|
||||
if (CollectionUtils.isNotEmpty(receiveList)) {
|
||||
receiveList = receiveList.stream()
|
||||
.collect(Collectors.collectingAndThen(Collectors
|
||||
.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPlannedBpLaunchBatch()))), ArrayList::new));
|
||||
for (OtaManageReceive rec : resList) {
|
||||
rec.setAppliedVehicleProject("全部");
|
||||
for (OtaManageApplyEO rec : receiveList) {
|
||||
if (CutEnum.CN.getValue().equals(cut)) {
|
||||
rec.setAppliedVehicleProject("全部");
|
||||
} else {
|
||||
rec.setAppliedVehicleProject("All");
|
||||
}
|
||||
}
|
||||
}
|
||||
return resList;
|
||||
return receiveList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OtaManageApplyEO> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut) {
|
||||
List<String> plannedBpLaunchBatchList = new ArrayList<>();
|
||||
plannedBpLaunchBatchList.add(plannedBpLaunchBatch);
|
||||
// List<OtaManageApplyEO> receiveList = otaManageApplyEOMapper.getReceiveByplannedBpLaunchBatch(plannedBpLaunchBatchList);
|
||||
// List<String> vdrList = receiveList.stream()
|
||||
// .filter(e -> StringUtils.isNotBlank(e.getId()))
|
||||
// .map(OtaManageApplyEO::getId).distinct().collect(Collectors.toList());
|
||||
// QueryWrapper<OtaManageApplyEO> queryWrapper = new QueryWrapper<>();
|
||||
// queryWrapper.lambda().eq(OtaManageApplyEO::getProjectVersion, projectId);
|
||||
// queryWrapper.lambda().in(OtaManageApplyEO::getVdr, vdrList);
|
||||
// List<OtaManageApplyEO> otaManageApplyEOS = this.list(queryWrapper);
|
||||
public Map<String, Object> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut) {
|
||||
List<OtaManageApplyEO> receiveList = this.getBaseMapper().getListByProjectId(projectId, plannedBpLaunchBatch);
|
||||
int total = receiveList.size();
|
||||
//匹配状态
|
||||
int toBeMatched = 0;//待匹配
|
||||
int toBeApproved = 0;//待审批
|
||||
int locked = 0;//锁定
|
||||
int rejected = 0;//退回
|
||||
int toBeRematched = 0;//待重新匹配
|
||||
//认证进度
|
||||
int notStart = 0;//未开始
|
||||
int inProgress = 0;//进行中
|
||||
int testPassed = 0;//实验通过
|
||||
int testFailed = 0;//实验失败
|
||||
int notSubmitted = 0;//部件报告未提交
|
||||
int submitted = 0;//部件报告已提交
|
||||
int stored = 0;//部件报告已入库
|
||||
|
||||
for (OtaManageApplyEO oma : receiveList) {
|
||||
if (StringUtils.isBlank(oma.getMatchStatus()) || oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_MATCHED.getKey())) {
|
||||
toBeMatched++;
|
||||
} else if (oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_APPROVED.getKey())) {
|
||||
toBeApproved++;
|
||||
} else if (oma.getMatchStatus().equals(OtaStatusEnum.LOCKED.getKey())) {
|
||||
locked++;
|
||||
} else if (oma.getMatchStatus().equals(OtaStatusEnum.REJECTED.getKey())) {
|
||||
rejected++;
|
||||
} else if (oma.getMatchStatus().equals(OtaStatusEnum.TO_BE_REMATCHED.getKey())) {
|
||||
toBeRematched++;
|
||||
} else {
|
||||
toBeMatched++;
|
||||
}
|
||||
if (StringUtils.isBlank(oma.getAttestationSchedule()) || oma.getAttestationSchedule().equals(CertificationProgressEnum.NOT_START.getValue())) {
|
||||
notStart++;
|
||||
} else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.IN_PROGRESS.getValue())) {
|
||||
inProgress++;
|
||||
} else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.TEST_PASSED.getValue())) {
|
||||
testPassed++;
|
||||
} else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.TEST_FAILED.getValue())) {
|
||||
testFailed++;
|
||||
} else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue())) {
|
||||
notSubmitted++;
|
||||
} else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue())) {
|
||||
submitted++;
|
||||
} else if (oma.getAttestationSchedule().equals(CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue())) {
|
||||
stored++;
|
||||
} else {
|
||||
notStart++;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
Map<String, Object> statisticalMap = new HashMap<>();
|
||||
statisticalMap.put("allCount", total);
|
||||
List<Map<String, Object>> matchStatusMapList = new ArrayList<>();
|
||||
matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_MATCHED.getKey(), toBeMatched + toBeRematched));
|
||||
matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.TO_BE_APPROVED.getKey(), toBeApproved));
|
||||
matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.LOCKED.getKey(), locked));
|
||||
matchStatusMapList.add(wrapStatMap("matchStatus", "matchStatusCount", OtaStatusEnum.REJECTED.getKey(), rejected));
|
||||
statisticalMap.put("matchStatusMapList", matchStatusMapList);
|
||||
|
||||
Map<String, Object> attestationScheduleMap = new HashMap<>();
|
||||
List<Map<String, Object>> attestationScheduleMapList = new ArrayList<>();
|
||||
attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.NOT_START.getValue(), notStart));
|
||||
attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.IN_PROGRESS.getValue(), inProgress));
|
||||
attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.TEST_PASSED.getValue(), testPassed));
|
||||
attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.TEST_FAILED.getValue(), testFailed));
|
||||
attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_NOT_SUBMITTED.getValue(), notSubmitted));
|
||||
attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_SUBMITTED.getValue(), submitted));
|
||||
attestationScheduleMapList.add(wrapStatMap("attestationSchedule", "attestationScheduleCount", CertificationProgressEnum.COMPONENT_REPORT_HAS_BEEN_STORED.getValue(), stored));
|
||||
statisticalMap.put("attestationScheduleMapList", attestationScheduleMapList);
|
||||
|
||||
return statisticalMap;
|
||||
}
|
||||
private Map<String,Object> wrapStatMap(String key,String val,String keyStr,Object valObj) {
|
||||
Map<String,Object> map = new HashMap<>();
|
||||
map.put(key,keyStr);
|
||||
map.put(val,valObj);
|
||||
return map;
|
||||
}
|
||||
|
||||
private List<OtaManageApplyEO> getListByIds(List<String> idList) {
|
||||
|
||||
Reference in New Issue
Block a user