Merge remote-tracking branch 'origin/develop_master' into develop_master

# Conflicts:
#	adc-da-slrs/src/main/resources/mybatis/mapper/SarStandItems/SarStandItemsMapper.xml
This commit is contained in:
yuezhihang
2021-08-09 17:55:11 +08:00
11 changed files with 517 additions and 250 deletions
@@ -9,6 +9,7 @@ import com.adc.da.utils.util.InitStandAttrUtil;
import com.rabbitmq.client.Channel;
import net.sf.json.JSONObject;
import org.apache.commons.lang.StringUtils;
import org.json.JSONTokener;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.Exchange;
@@ -72,6 +73,7 @@ public class SendStandMQService {
SarStandardsInfo infoEO = (SarStandardsInfo) JSONObject.toBean(jsonobject,SarStandardsInfo.class);
String sarStandAttrEOStr = infoEO.getSarStandAttrEOStr();
Map<String,Object> attrInfoMap = JSONObject.fromObject(sarStandAttrEOStr);
Map<String,Object> infoMap = infoEO.getAttrInfoMap();
// 往索引表中插入数据
String getCodeName = "";
@@ -111,6 +113,7 @@ public class SendStandMQService {
}
saveMap.put("issueTime",dateFormatToStr(infoEO.getIssueTime()));
saveMap.put("standNature",infoEO.getStandNature());
saveMap.put("synopsis",infoEO.getSynopsis());
saveMap.put("standType",infoEO.getStandType());
saveMap.put("textStatus",infoEO.getTextStatus());
@@ -134,6 +137,12 @@ public class SendStandMQService {
// 动态存储属性字段
for (String field : fieldInfoList) {
saveMap.put(field,attrInfoMap.getOrDefault(field,""));
Object json= new JSONTokener(infoMap.get(field).toString()).nextValue();
String fieldValue = "";
if(!json.toString().equals("null")){
fieldValue = infoMap.get(field).toString();
}
saveMap.put(field+"Name",fieldValue);
}
@@ -5,9 +5,7 @@ import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.slrs.sarLawsAttrDetailedList.entity.LawsDto;
import com.adc.da.slrs.sarStandItems.entity.FindStandDto;
import com.adc.da.slrs.sarStandItems.entity.SarItemsTime;
import com.adc.da.slrs.sarStandItems.entity.SarStandItemsDto;
import com.adc.da.slrs.sarStandItems.entity.*;
import com.adc.da.slrs.sarStandItems.service.impl.SarStandItemsServiceImpl;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -15,7 +13,6 @@ import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
import io.swagger.annotations.Api;
import com.adc.da.base.web.BaseController;
@@ -55,6 +52,17 @@ public class SarStandItemsController extends BaseController<SarStandItems> {
}
}
@ApiOperation(value = "分解单查询")
@GetMapping("/querySarItemAndInterpretation")
public ResponseMessage querySarItemAndInterpretation(FindSarItemsPageReqDTO page){
List<SarItemVO> sarItemVOS = ServiceImpl.querySarItemAndInterpretation(page);
return Result.success("200",sarItemVOS);
}
@ApiOperation(value = "分解单查询(带时间)")
@GetMapping("/findAllItemsTimes")
public List<SarItemsTime> findAllItemsTimes(@RequestParam("type") String type,@RequestParam("ids") String ids){
@@ -1,8 +1,6 @@
package com.adc.da.slrs.sarStandItems.dao;
import com.adc.da.slrs.sarStandItems.entity.SarStandItems;
import com.adc.da.slrs.sarStandItems.entity.SarStandItemsDto;
import com.adc.da.slrs.sarStandItems.entity.StandsTimeDto;
import com.adc.da.slrs.sarStandItems.entity.*;
import com.adc.da.slrs.sarStandItems.page.SarStandItemsEOPage;
import com.adc.da.sys.common.SelectionResult;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
@@ -24,6 +22,8 @@ import java.util.Set;
@Mapper
public interface SarStandItemsDao extends BaseMapper<SarStandItems> {
List<SarItemVO> querySarItemAndInterpretation(FindSarItemsPageReqDTO page);
List<SarStandItems> querySarStandItemsList(SarStandItemsEOPage page);
int querySarStandItemsListCount(SarStandItemsEOPage page);
@@ -0,0 +1,36 @@
package com.adc.da.slrs.sarStandItems.entity;
import com.adc.da.base.page.BasePage;
import com.baomidou.mybatisplus.annotation.TableField;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
public class FindSarItemsPageReqDTO {
private static final long serialVersionUID = 1L;
private Integer page = 1;
private Integer pageSize = 20;
@ApiModelProperty(value = "标准id")
private String standId;
@ApiModelProperty(value = "条款名称")
private String itemsName;
@ApiModelProperty(value = "新车型实施日期")
@DateTimeFormat(pattern = "yyy-MM-dd")
private Date XCXSSRQ;
@ApiModelProperty(value = "在产车实施日期")
@DateTimeFormat(pattern = "yyy-MM-dd")
private Date ZCCSSRQ;
@ApiModelProperty(value = "文件类型")
private String fileType;
}
@@ -0,0 +1,67 @@
package com.adc.da.slrs.sarStandItems.entity;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import java.util.Date;
@Data
@ApiModel(value="标准分解单显示对象", description="")
public class SarItemVO extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
private String id;
@ApiModelProperty(value = "标准ID")
private String standId;
@ApiModelProperty(value = "条款号")
private String itemsNum;
@ApiModelProperty(value = "条款名称")
private String itemsName;
@ApiModelProperty(value = "条款内容")
private String itemsTitle;
@ApiModelProperty(value = "解读内容--条款要求")
private String termsConditions;
@ApiModelProperty(value = "新车实施日期")
@DateTimeFormat
private Date XCXSSRQ;
@ApiModelProperty(value = "在产车实施日期")
@DateTimeFormat
private Date ZCCSSRQ;
@ApiModelProperty(value = "适用车型")
private String applyArctic;
@ApiModelProperty(value = "责任部门")
private String responsibleUnit;
@ApiModelProperty(value = "责任工程师")
private String dutyEngineer;
@ApiModelProperty(value = "相对于上一版本变化点")
private String comparedWithPrevious;
@ApiModelProperty(value = "合规性分析")
private String complianceState;
@ApiModelProperty(value = "符合性要求-符合性状态")
private String complianceRequire;
@ApiModelProperty(value = "文件类型")
private String fileType;
}
@@ -189,4 +189,9 @@ public class SarStandItemsServiceImpl extends ServiceImpl<SarStandItemsDao, SarS
public List<SarStandItemsDto> findAllItems(String type,String[] ids){
return dao.selectAllItemsByIds(type,ids);
}
public List<SarItemVO> querySarItemAndInterpretation(FindSarItemsPageReqDTO page){
return dao.querySarItemAndInterpretation(page);
}
}
@@ -382,6 +382,30 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
public void attrInfoSearchDetails(SarStandardsInfo row) throws Exception {
String fieldInfo = InitStandAttrUtil.queryField;
String collectId = personCollectEOService.queryCollectByUserAndId(row.getId());
row.setCollectId(collectId);
// 查询属性表数据
if (StringUtils.isNotBlank(fieldInfo)) {
Map<String, Object> getAttrMap = sarStandAttrInfoEODao.selectStandFieldAndData(fieldInfo, row.getId());
if (InitStandAttrUtil.clobFieldList != null && !InitStandAttrUtil.clobFieldList.isEmpty()) {
// 遍历修改所有clob类型的值
for (String clobField : InitStandAttrUtil.clobFieldList) {
Clob clobValue = (Clob) getAttrMap.get(clobField);
String fieldValue = FieldConvertUtil.ClobToString(clobValue);
getAttrMap.put(clobField, fieldValue);
}
}
if (getAttrMap != null && !getAttrMap.isEmpty()) {
row.setAttrInfoCaseMap(transformUpperCase(getAttrMap));
}
row.setAttrInfoMap(getAttrMap);
}
}
private Map<String, Object> transformUpperCase(Map<String, Object> orgMap) {
Map<String, Object> resultMap = new HashMap<>();
@@ -428,6 +452,25 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
}
}
public void attrInfoShowSearchDetails(SarStandardsInfo row) throws Exception {
if (row != null) {
attrInfoSearchDetails(row);
Map<String, Object> getAttrMap = row.getAttrInfoMap();
if (getAttrMap != null && getAttrMap.size() > 0) {
for (Map.Entry<String, Object> entry : getAttrMap.entrySet()) {
String name = entry.getKey();
String value = "";
if (entry.getValue() != null && InitStandAttrUtil.selectionFieldList != null && InitStandAttrUtil.selectionFieldList.size() > 0 && InitStandAttrUtil.selectionFieldList.contains(name)) {
value = entry.getValue().toString();
List<String> valArr = Arrays.asList(value.split(","));
value = dicTypeEODao.getDicNamesByCodes(valArr);
entry.setValue(value);
}
}
}
}
}
public void attrInfoShow(List<SarStandardsInfo> sarlist) throws Exception {
for (SarStandardsInfo row : sarlist) {
attrInfoDetails(row);
@@ -1099,7 +1142,8 @@ public class SarStandardsInfoServiceImpl extends ServiceImpl<SarStandardsInfoDao
// replaseStandState(sarStandardsInfoEO);
// 记录修改日志
saveUpdateLog(sarStandardsInfoEO, beforeSarStandardsInfo);
if(elasflag) {
if(elasflag) { //what?
attrInfoShowSearchDetails(sarStandardsInfoEO);
createStandMQService.sendStandMQ(sarStandardsInfoEO,"update");
List<String> bhs = new ArrayList<>(Arrays.asList(String.valueOf(map.get("DTBJH")).split(",")));
for (String bh :bhs) {