修改OTA项目状态统计
This commit is contained in:
+2
-1
@@ -9,6 +9,7 @@ import com.jero.common.aspect.annotation.AutoLog;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.util.PageUtil;
|
||||
import com.jero.modules.ota.entity.OtaManageApplyEO;
|
||||
import com.jero.modules.ota.entity.OtaManageReceive;
|
||||
import com.jero.modules.ota.service.IOtaManageApplyEOService;
|
||||
import com.jero.modules.ota.vo.VersionVO;
|
||||
import io.swagger.annotations.Api;
|
||||
@@ -271,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<OtaManageApplyEO> resList = otaManageApplyEOService.getVdrListByProject(projectId, cut);
|
||||
List<OtaManageReceive> resList = otaManageApplyEOService.getVdrListByProject(projectId, cut);
|
||||
return Result.OK("操作成功!", resList);
|
||||
}
|
||||
|
||||
|
||||
+7
@@ -111,4 +111,11 @@ public class OtaManageReceive implements Serializable {
|
||||
@ApiModelProperty(value = "适用车型")
|
||||
private String appliedVehicleProject;
|
||||
|
||||
/**发布时间*/
|
||||
@Excel(name = "发布时间", width = 15)
|
||||
@ApiModelProperty(value = "发布时间")
|
||||
private String releaseDate;
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
-3
@@ -29,9 +29,6 @@ public interface OtaManageApplyEOMapper extends BaseMapper<OtaManageApplyEO> {
|
||||
*/
|
||||
List<OtaManageApplyEO> getOtaCarPage(@Param("otaManageApplyEO") OtaManageApplyEO otaManageApplyEO);
|
||||
|
||||
List<OtaManageApplyEO> getReceiveByVdr(@Param("vdrList") List<String> vdrList);
|
||||
|
||||
|
||||
List<VersionVO> getByAppliedVehicleProject(@Param("appliedVehicleProject") String appliedVehicleProject);
|
||||
|
||||
List<OtaManageApplyEO> getOtaCarList();
|
||||
|
||||
+1
@@ -13,5 +13,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface OtaManageReceiveMapper extends BaseMapper<OtaManageReceive> {
|
||||
List<OtaManageReceive> getReceiveByVdr(@Param("vdrList") List<String> vdrList);
|
||||
|
||||
}
|
||||
|
||||
+1
-7
@@ -43,13 +43,7 @@
|
||||
</where>
|
||||
order by create_time desc
|
||||
</select>
|
||||
<select id="getReceiveByVdr" resultType="com.jero.modules.ota.entity.OtaManageApplyEO">
|
||||
select * from ota_manage_receive
|
||||
where id in
|
||||
<foreach collection="vdrList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
|
||||
<select id="getOtaCarPage" resultType="com.jero.modules.ota.entity.OtaManageApplyEO">
|
||||
select omr.id as vdr,omr.planned_bp_launch_batch_,omr.update_date,
|
||||
omr.summary,omr.status,
|
||||
|
||||
+8
@@ -18,5 +18,13 @@
|
||||
<result column="impact_eu_homo" property="impactEuHomo" />
|
||||
<result column="master_domain" property="masterDomain" />
|
||||
<result column="applied_vehicle_project" property="appliedVehicleProject" />
|
||||
<result column="release_date" property="releaseDate" />
|
||||
</resultMap>
|
||||
<select id="getReceiveByVdr" resultType="com.jero.modules.ota.entity.OtaManageReceive">
|
||||
select * from ota_manage_receive
|
||||
where id in
|
||||
<foreach collection="vdrList" index="index" item="item" open="(" separator="," close=")">
|
||||
#{item}
|
||||
</foreach>
|
||||
</select>
|
||||
</mapper>
|
||||
+2
-1
@@ -2,6 +2,7 @@ package com.jero.modules.ota.service;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.ota.entity.OtaManageApplyEO;
|
||||
import com.jero.modules.ota.entity.OtaManageReceive;
|
||||
import com.jero.modules.ota.vo.VersionVO;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
|
||||
@@ -117,7 +118,7 @@ public interface IOtaManageApplyEOService extends IService<OtaManageApplyEO> {
|
||||
|
||||
List<String> reject(String ids, String rejectReason,String cut);
|
||||
|
||||
List<OtaManageApplyEO> getVdrListByProject(String projectId, String cut);
|
||||
List<OtaManageReceive> getVdrListByProject(String projectId, String cut);
|
||||
|
||||
List<OtaManageApplyEO> getStatisticalStatus(String projectId, String plannedBpLaunchBatch, String cut);
|
||||
|
||||
|
||||
+3
@@ -1,5 +1,6 @@
|
||||
package com.jero.modules.ota.service;
|
||||
|
||||
import com.jero.modules.ota.entity.OtaManageApplyEO;
|
||||
import com.jero.modules.ota.entity.OtaManageReceive;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import java.util.List;
|
||||
@@ -58,4 +59,6 @@ public interface IOtaManageReceiveService extends IService<OtaManageReceive> {
|
||||
* @return
|
||||
*/
|
||||
List<OtaManageReceive> queryList();
|
||||
|
||||
List<OtaManageReceive> getReceiveByVdr(List<String> vdrList);
|
||||
}
|
||||
|
||||
+17
-42
@@ -9,8 +9,10 @@ import com.jero.common.system.vo.LoginUser;
|
||||
import com.jero.common.util.DateUtils;
|
||||
import com.jero.common.util.PageUtil;
|
||||
import com.jero.common.util.oConvertUtils;
|
||||
import com.jero.modules.cert.template.entity.CertCategoryParamsInfoEO;
|
||||
import com.jero.modules.dummy.enums.OrderEnum;
|
||||
import com.jero.modules.ota.entity.OtaManageApplyEO;
|
||||
import com.jero.modules.ota.entity.OtaManageReceive;
|
||||
import com.jero.modules.ota.entity.OtaManageReceiveNsdpEO;
|
||||
import com.jero.modules.ota.enums.OtaCarEnum;
|
||||
import com.jero.modules.ota.enums.OtaHomoImpactEnum;
|
||||
@@ -18,6 +20,7 @@ import com.jero.modules.ota.enums.OtaStatusEnum;
|
||||
import com.jero.modules.ota.mapper.OtaManageApplyEOMapper;
|
||||
import com.jero.modules.ota.service.IOtaManageApplyEOService;
|
||||
import com.jero.modules.ota.service.IOtaManageHistoryService;
|
||||
import com.jero.modules.ota.service.IOtaManageReceiveService;
|
||||
import com.jero.modules.ota.vo.AllCarExportVO;
|
||||
import com.jero.modules.ota.vo.OneCarExportVO;
|
||||
import com.jero.modules.ota.vo.OtaExportVO;
|
||||
@@ -52,19 +55,7 @@ import javax.servlet.http.HttpServletRequest;
|
||||
import java.text.Collator;
|
||||
import java.text.ParseException;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.Comparator;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
@@ -92,6 +83,9 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
private ISysUserService sysUserService;
|
||||
@Autowired
|
||||
private IOtaManageHistoryService otaManageHistoryService;
|
||||
@Autowired
|
||||
private IOtaManageReceiveService otaManageReceiveService;
|
||||
|
||||
|
||||
@Value(value = "${jero.path.upload}")
|
||||
private String upLoadPath;
|
||||
@@ -1018,44 +1012,25 @@ public class OtaManageApplyEOServiceImpl extends ServiceImpl<OtaManageApplyEOMap
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OtaManageApplyEO> getVdrListByProject(String projectId, String cut) {
|
||||
List<OtaManageApplyEO> res = new ArrayList<>();
|
||||
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)) {
|
||||
res = otaManageApplyEOMapper.getReceiveByVdr(vdrList);
|
||||
List<String> plannedBpLaunchBatchList = res.stream()
|
||||
.filter(e -> StringUtils.isNotBlank(e.getPlannedBpLaunchBatch()))
|
||||
.map(OtaManageApplyEO::getPlannedBpLaunchBatch).distinct().collect(Collectors.toList());
|
||||
List<OtaManageReceiveNsdpEO> manageReceiveNsdpEOList = otaManageApplyEOMapper.getReleaseDate(plannedBpLaunchBatchList);
|
||||
for (OtaManageApplyEO manageApplyEO : res) {
|
||||
manageApplyEO.setVdr(manageApplyEO.getId());
|
||||
List<OtaManageReceiveNsdpEO> collect = manageReceiveNsdpEOList.stream()
|
||||
.filter(e -> StringUtils.isNotBlank(e.getReleaseName())
|
||||
&& e.getReleaseName().equals(manageApplyEO.getPlannedBpLaunchBatch())).collect(Collectors.toList());
|
||||
if (!collect.isEmpty()) {
|
||||
List<String> releaseDateList = collect.stream().map(OtaManageReceiveNsdpEO::getReleaseDate).distinct().collect(Collectors.toList());
|
||||
List<Integer> list = new ArrayList<>();
|
||||
for (String s : releaseDateList) {
|
||||
list.add(Integer.parseInt(s.replaceAll("-", "")));
|
||||
}
|
||||
Integer max = Collections.max(list);
|
||||
try {
|
||||
//发布时间
|
||||
manageApplyEO.setReleaseName(sdf.format(dateFormat.parse(max.toString())));
|
||||
manageApplyEO.setReleaseNameDate(dateFormat.parse(max.toString()));
|
||||
} catch (ParseException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
}
|
||||
}
|
||||
resList = otaManageReceiveService.getReceiveByVdr(vdrList).stream()
|
||||
.collect(Collectors.collectingAndThen(Collectors
|
||||
.toCollection(() -> new TreeSet<>(Comparator.comparing(o -> o.getPlannedBpLaunchBatch()))), ArrayList::new));
|
||||
for (OtaManageReceive rec : resList) {
|
||||
rec.setAppliedVehicleProject("全部");
|
||||
}
|
||||
}
|
||||
|
||||
return res;
|
||||
return resList;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
+5
@@ -86,4 +86,9 @@ public class OtaManageReceiveServiceImpl extends ServiceImpl<OtaManageReceiveMap
|
||||
public List<OtaManageReceive> queryList() {
|
||||
return list();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<OtaManageReceive> getReceiveByVdr(List<String> vdrList) {
|
||||
return this.getBaseMapper().getReceiveByVdr(vdrList);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user