feat: 清单详情添加接口

This commit is contained in:
super_liu
2021-06-09 13:48:48 +08:00
parent 6bdfb8afa4
commit 9d19ef728a
6 changed files with 330 additions and 3 deletions
@@ -1,12 +1,23 @@
package com.adc.da.slrs.sarSarAccessInfo.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarSarAccessInfo.service.ISarSarAccessInfoService;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import com.adc.da.slrs.sarSarAccessInfo.entity.SarSarAccessInfo;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RestController;
import com.adc.da.base.web.BaseController;
import java.util.Map;
import java.util.Set;
/**
* <p>
* 标准法规准入清单详情表 前端控制器
@@ -20,4 +31,15 @@ import com.adc.da.base.web.BaseController;
@RequestMapping("/sarSarAccessInfo/sar-sar-access-info")
public class SarSarAccessInfoController extends BaseController<SarSarAccessInfo> {
private static final Logger logger = LoggerFactory.getLogger(SarSarAccessInfoController.class);
@Autowired
private ISarSarAccessInfoService sarSarAccessInfoEOService;
@ApiOperation(value = "|SarSarAccessInfoEO|查询标准涉及清单实施时间")
@GetMapping("/selectProTimeInfoByStandId")
public ResponseMessage<Map<String, Set<String>>> selectProTimeInfoByStandId(String standId){
Map<String,Set<String>> map = sarSarAccessInfoEOService.selectProTimeInfoByStandId(standId);
return Result.success(map);
}
}
@@ -4,6 +4,7 @@ import com.adc.da.slrs.sarSarAccessInfo.entity.SarSarAccessInfo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
import java.util.Map;
/**
@@ -16,5 +17,7 @@ import java.util.Map;
*/
public interface SarSarAccessInfoDao extends BaseMapper<SarSarAccessInfo> {
List<SarSarAccessInfo> selectProTimeInfoByStandId(@Param("standId") String standId);
Map selectProTimeInfoByStandIdAndAccId(@Param("standId")String standId, @Param("accId")String accId);
}
@@ -3,7 +3,10 @@ package com.adc.da.slrs.sarSarAccessInfo.entity;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.util.Date;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@@ -48,15 +51,17 @@ public class SarSarAccessInfo extends BaseEntity {
@ApiModelProperty(value = "是否有效")
@TableField("VALID_FLAG")
private Boolean validFlag;
private Integer validFlag;
@ApiModelProperty(value = "创建时间")
@TableField("CREATION_TIME")
private LocalDateTime creationTime;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date creationTime;
@ApiModelProperty(value = "修改时间")
@TableField("MODIFY_TIME")
private LocalDateTime modifyTime;
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
@ApiModelProperty(value = "清单标准类型(SKILL技术要求,ADMIN行政要求)")
@TableField("ACCESS_SAR_TYPE")
@@ -100,14 +105,17 @@ public class SarSarAccessInfo extends BaseEntity {
@ApiModelProperty(value = "新车型实施日期-文本")
@TableField("NEW_PUT_TEXT_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String newPutTextTime;
@ApiModelProperty(value = "在产车实施日期-文本")
@TableField("PROD_PUT_TEXT_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String prodPutTextTime;
@ApiModelProperty(value = "EOP车型实施日期-文本")
@TableField("EOP_PUT_TEXT_TIME")
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd")
private String eopPutTextTime;
@ApiModelProperty(value = "标准\\政策编号")
@@ -119,4 +127,196 @@ public class SarSarAccessInfo extends BaseEntity {
private String color;
//===========================================//
// 新增字段
/**
* 要求性质
*/
@TableField(exist = false)
private String askNatureName;
/**
* 认证对象
*/
@TableField(exist = false)
private String authObj;
/**
* 认证责任部门
*/
@TableField(exist = false)
private String authDepart;
//==================清单扩展字段========================//
/**
* 关联参数表ID
*/
@TableField(exist = false)
private String accValId;
@TableField(exist = false)
private String newAccValId;
/**
* 标准/政策编号
*/
@TableField(exist = false)
private String code;
/**
* 标准/政策 中文名称
*/
@TableField(exist = false)
private String name;
/**
* 标准 政策 英文名称
*/
@TableField(exist = false)
private String enName;
/**
* 标准性质
*/
@TableField(exist = false)
private String nature;
/**
* 保存标准性质Code
*/
@TableField(exist = false)
private String natureId;
/**
* 实施时间
*/
@TableField(exist = false)
private String putTime;
/**
* 标准状态
*/
@TableField(exist = false)
private String state;
/**
* 保存使用的标准状态CODE
*/
@TableField(exist = false)
private String stateId;
/**
* 适用车型
*/
@TableField(exist = false)
private String applyArctic;
@TableField(exist = false)
private String applyArcticId;
/**
* 责任部门
*/
@TableField(exist = false)
private String ZRBMNAME;
/**
* 责任部门显示
*/
@TableField(exist = false)
private String ZRBM;
/**
* 维护人员
*/
@TableField(exist = false)
private String assertUser;
/**
* FO
*/
@TableField(exist = false)
private String FOName;
/**
* 保存使用的FO用户ID
*/
@TableField(exist = false)
private String FO;
/**
* 项目评估人员
*/
@TableField(exist = false)
private String proEssessUser;
/**
* 保存项目评估人员
*/
@TableField(exist = false)
private String proEssessUserId;
/**
* 文本说明
*/
@TableField(exist = false)
private String synopsis;
//=========================================//
//准入标准法规添加时页面显示(补充)
/**
* 能源种类
*/
@TableField(exist = false)
private String energyKind;
@TableField(exist = false)
private String energyKindId;
@TableField(exist = false)
private String responsibleUnit;
/**
* 标准状态
*/
@TableField(exist = false)
private String standState;
/**
* 备注
*/
@TableField(exist = false)
private String remark;
@TableField(exist = false)
private String standName;
@TableField(exist = false)
private String lawsCode;
@TableField(exist = false)
private String lawsName;
@TableField(exist = false)
private String country;
//标签
@TableField(exist = false)
private String gxhbq;
@TableField(exist = false)
private String gxhbqName;
//要求类型
@TableField(exist = false)
private String askType;
@TableField(exist = false)
private String askTypeName;
//相关部门
@TableField(exist = false)
private String XGBM;
@TableField(exist = false)
private String XGBMName;
@TableField(exist = false)
private String prcState;
@TableField(exist = false)
private String sarState;
//等效标准
@TableField(exist = false)
private String dxbz;
}
@@ -3,6 +3,9 @@ package com.adc.da.slrs.sarSarAccessInfo.service;
import com.adc.da.slrs.sarSarAccessInfo.entity.SarSarAccessInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.Map;
import java.util.Set;
/**
* <p>
* 标准法规准入清单详情表 服务类
@@ -13,4 +16,5 @@ import com.baomidou.mybatisplus.extension.service.IService;
*/
public interface ISarSarAccessInfoService extends IService<SarSarAccessInfo> {
Map<String, Set<String>> selectProTimeInfoByStandId(String standId);
}
@@ -1,11 +1,18 @@
package com.adc.da.slrs.sarSarAccessInfo.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.adc.da.slrs.sarSarAccessInfo.entity.SarSarAccessInfo;
import com.adc.da.slrs.sarSarAccessInfo.dao.SarSarAccessInfoDao;
import com.adc.da.slrs.sarSarAccessInfo.service.ISarSarAccessInfoService;
import com.adc.da.sys.dao.DicTypeEODao;
import com.adc.da.sys.entity.DicTypeEO;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.*;
/**
* <p>
* 标准法规准入清单详情表 服务实现类
@@ -17,4 +24,83 @@ import org.springframework.stereotype.Service;
@Service
public class SarSarAccessInfoServiceImpl extends ServiceImpl<SarSarAccessInfoDao, SarSarAccessInfo> implements ISarSarAccessInfoService {
@Autowired
private SarSarAccessInfoDao dao;
@Autowired
private DicTypeEODao dicTypeEODao;
public Map<String, Set<String>> selectProTimeInfoByStandId(String standId) {
List<SarSarAccessInfo> getList = dao.selectProTimeInfoByStandId(standId);
List<SarSarAccessInfo> newAccessInfoList = new ArrayList<>();
Set<String> countrySet = new LinkedHashSet<>();
Map<String, List<SarSarAccessInfo>> countryMap = new LinkedHashMap<>();
for (SarSarAccessInfo accessInfoEO : getList) {
if (StringUtils.isNotBlank(accessInfoEO.getCountry())) {
String[] countryIds = accessInfoEO.getCountry().split(",");
for (String countryId : countryIds) {
List<DicTypeEO> dicTypeEOS = dicTypeEODao.getDicEOByDicTypeCodeParent(countryId);
if (!dicTypeEOS.isEmpty()) {
SarSarAccessInfo newAccessInfoEO = new SarSarAccessInfo();
BeanUtil.copyProperties(accessInfoEO, newAccessInfoEO);
newAccessInfoEO.setCountry(dicTypeEOS.get(0).getDicTypeName());
countrySet.add(dicTypeEOS.get(0).getDicTypeName());
if (countryMap != null && countryMap.size() > 0 && countryMap.get(dicTypeEOS.get(0).getDicTypeName()) != null) {
List<SarSarAccessInfo> list = countryMap.get(dicTypeEOS.get(0).getDicTypeName());
list.add(newAccessInfoEO);
countryMap.put(dicTypeEOS.get(0).getDicTypeName(), list);
} else {
List<SarSarAccessInfo> list = new ArrayList<>();
list.add(newAccessInfoEO);
countryMap.put(dicTypeEOS.get(0).getDicTypeName(), list);
}
newAccessInfoList.add(newAccessInfoEO);
}
}
}
}
Map<String, Set<String>> map = new LinkedHashMap<>();
if (countryMap != null && countryMap.size() > 0) {
for (Map.Entry<String, List<SarSarAccessInfo>> entry : countryMap.entrySet()) {
Set<String> newPutTextTimeList = new LinkedHashSet<>();
Set<String> prodPutTextTimeList = new LinkedHashSet<>();
Set<String> eopPutTextTimeList = new LinkedHashSet<>();
for (SarSarAccessInfo sarSarAccessInfoEO : entry.getValue()) {
if (sarSarAccessInfoEO.getNewPutTime() != null) {
String key = "新车型实施日期(" + sarSarAccessInfoEO.getCountry() + ")";
Set<String> valueList = new LinkedHashSet<>();
// String time = DateUtils.dateToString(sarSarAccessInfoEO.getNewPutTime(),"yyyy-MM-dd");
// String time = sarSarAccessInfoEO.getNewPutTextTime();
List<String> list = Arrays.asList(sarSarAccessInfoEO.getNewPutTime().split(","));
newPutTextTimeList.addAll(list);
map.put(key, newPutTextTimeList);
}
}
for (SarSarAccessInfo sarSarAccessInfoEO : entry.getValue()) {
if (sarSarAccessInfoEO.getProdPutTime() != null) {
String key = "在产车实施日期(" + sarSarAccessInfoEO.getCountry() + ")";
Set<String> valueList = new LinkedHashSet<>();
// String time = DateUtils.dateToString(sarSarAccessInfoEO.getProdPutTextTime(),"yyyy-MM-dd");
// String time = sarSarAccessInfoEO.getProdPutTextTime();
List<String> list = Arrays.asList(sarSarAccessInfoEO.getProdPutTime().split(","));
prodPutTextTimeList.addAll(list);
map.put(key, prodPutTextTimeList);
}
}
for (SarSarAccessInfo sarSarAccessInfoEO : entry.getValue()) {
if (sarSarAccessInfoEO.getEopPutTime() != null) {
String key = "EOP车型实施日期(" + sarSarAccessInfoEO.getCountry() + ")";
Set<String> valueList = new LinkedHashSet<>();
// String time = DateUtils.dateToString(sarSarAccessInfoEO.getEopPutTextTime(),"yyyy-MM-dd");
// String time = sarSarAccessInfoEO.getEopPutTextTime();
List<String> list = Arrays.asList(sarSarAccessInfoEO.getEopPutTime().split(","));
eopPutTextTimeList.addAll(list);
map.put(key, eopPutTextTimeList);
}
}
}
}
return map;
}
}
@@ -109,6 +109,18 @@
</trim>
</sql>
<select id="selectProTimeInfoByStandId" resultMap="BaseResultMap"
parameterType="java.lang.String">
SELECT
SAR_SAR_ACCESS.COUNTRY,SAR_SAR_ACCESS_INFO.NEW_PUT_TIME,SAR_SAR_ACCESS_INFO.PROD_PUT_TIME,
SAR_SAR_ACCESS_INFO.EOP_PUT_TIME
FROM SAR_SAR_ACCESS_INFO
left join SAR_SAR_ACCESS on SAR_SAR_ACCESS_INFO.ACCESS_ID=SAR_SAR_ACCESS.ID
WHERE
SAR_SAR_ACCESS_INFO.res_id = #{standId} and SAR_SAR_ACCESS_INFO.valid_flag = 0
and SAR_SAR_ACCESS.valid_flag = 0
</select>
<select id="selectProTimeInfoByStandIdAndAccId" resultType="java.util.Map"
parameterType="java.lang.String">
SELECT