清单修改 使用mq
This commit is contained in:
+4
@@ -55,4 +55,8 @@ public class SarLawsAttrDetailedList extends BaseEntity {
|
||||
@TableField(value = "zccssrq")
|
||||
private String zccssrq;
|
||||
|
||||
@ApiModelProperty(value = "适用认证")
|
||||
@TableField(value = "syrz")
|
||||
private String syrz;
|
||||
|
||||
}
|
||||
|
||||
+1
@@ -224,6 +224,7 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
|
||||
.ssrq(timeDto1.getSsrq())
|
||||
.xcxssrq(timeDto1.getXcxssrqgj())
|
||||
.zccssrq(timeDto1.getZccssrqgj())
|
||||
.syrz(timeDto1.getSyrz())
|
||||
.build();
|
||||
attrDetailedLists.add(sarLawsAttrDetailedList);
|
||||
a++;
|
||||
|
||||
+4
@@ -3,6 +3,8 @@ package com.adc.da.slrs.sarLawsAttrInfo.service;
|
||||
import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
@@ -16,4 +18,6 @@ public interface ISarLawsAttrInfoService extends IService<SarLawsAttrInfo> {
|
||||
String selectFieldValByLawsId(String field,String standId);
|
||||
|
||||
int updateLawsInfo(String standId,String field,String value);
|
||||
|
||||
Map<String, Object> getBussAttrInfo(String standId);
|
||||
}
|
||||
|
||||
+9
@@ -3,9 +3,12 @@ package com.adc.da.slrs.sarLawsAttrInfo.service.impl;
|
||||
import com.adc.da.slrs.sarLawsAttrInfo.entity.SarLawsAttrInfo;
|
||||
import com.adc.da.slrs.sarLawsAttrInfo.dao.SarLawsAttrInfoDao;
|
||||
import com.adc.da.slrs.sarLawsAttrInfo.service.ISarLawsAttrInfoService;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
@@ -26,4 +29,10 @@ public class SarLawsAttrInfoServiceImpl extends ServiceImpl<SarLawsAttrInfoDao,
|
||||
public int updateLawsInfo(String standId,String field,String value){
|
||||
return this.baseMapper.updateLawsInfo(standId,field,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> getBussAttrInfo(String standId) {
|
||||
String fieldInfo = InitStandAttrUtil.queryFieldLaws;
|
||||
return this.baseMapper.selectLawsFieldAndData(fieldInfo,standId);
|
||||
}
|
||||
}
|
||||
|
||||
+4
@@ -68,4 +68,8 @@ public class DetailedUpDto {
|
||||
@ApiModelProperty(value = "新车型实施时间")
|
||||
private String inforlist3;
|
||||
|
||||
@ApiModelProperty(value = "适用认证")
|
||||
private String inforlist4;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -23,4 +23,7 @@ public class TimeDto {
|
||||
@ApiModelProperty(value = "新车型实施日期")
|
||||
private String xcxssrqgj;
|
||||
|
||||
@ApiModelProperty(value = "适用认证")
|
||||
private String syrz;
|
||||
|
||||
}
|
||||
|
||||
+57
-7
@@ -1,6 +1,7 @@
|
||||
package com.adc.da.slrs.sarLawsDetailedList.service.impl;
|
||||
|
||||
import com.adc.da.att.service.IAttFileEOService;
|
||||
import com.adc.da.mq.CreateUpdateMQService;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.sarBussionessStand.dao.SarBussionessStandDao;
|
||||
import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand;
|
||||
@@ -86,6 +87,10 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
@Autowired
|
||||
private IDicTypeEOService dicTypeEOService;
|
||||
|
||||
//查询数据字典
|
||||
@Autowired
|
||||
private CreateUpdateMQService createUpdateMQService;
|
||||
|
||||
|
||||
@Override
|
||||
public String del(List<String> idList) {
|
||||
@@ -633,6 +638,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
String[] putTime = detailedUpDto.getInforlist1().split(";");
|
||||
String[] zcc = detailedUpDto.getInforlist2().split(";");
|
||||
String[] xcx = detailedUpDto.getInforlist3().split(";");
|
||||
String[] syrz = detailedUpDto.getInforlist4().split(";");
|
||||
for (int a = 0; a < id.length; a++) {
|
||||
TimeDto dto = new TimeDto();
|
||||
dto.setStandId(id[a]);
|
||||
@@ -641,16 +647,21 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
} else {
|
||||
dto.setSsrq(putTime[a]);
|
||||
}
|
||||
if (putTime.length <= a) {
|
||||
if (xcx.length <= a) {
|
||||
dto.setXcxssrqgj(null);
|
||||
} else {
|
||||
dto.setXcxssrqgj(xcx[a]);
|
||||
}
|
||||
if (putTime.length <= a) {
|
||||
if (zcc.length <= a) {
|
||||
dto.setZccssrqgj(null);
|
||||
} else {
|
||||
dto.setZccssrqgj(zcc[a]);
|
||||
}
|
||||
if (syrz.length <= a) {
|
||||
dto.setSyrz(null);
|
||||
} else {
|
||||
dto.setSyrz(syrz[a]);
|
||||
}
|
||||
timeDto.add(dto);
|
||||
}
|
||||
} else {
|
||||
@@ -659,6 +670,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
dto.setSsrq(detailedUpDto.getInforlist1());
|
||||
dto.setXcxssrqgj(detailedUpDto.getInforlist2());
|
||||
dto.setZccssrqgj(detailedUpDto.getInforlist3());
|
||||
dto.setSyrz(detailedUpDto.getInforlist4());
|
||||
timeDto.add(dto);
|
||||
}
|
||||
service.updateDetailedLaws(detailedUpDto.getId(), timeDto);
|
||||
@@ -666,24 +678,62 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
|
||||
wrapper.eq("detailed_list_id",detailedUpDto.getId());
|
||||
List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists=sarLawsAttrDetailedListDao.selectList(wrapper);
|
||||
List<String> list1=new ArrayList<>();
|
||||
List<String> list2=new ArrayList<>();
|
||||
//避免出现数据丢失 处理一下适用认证信息
|
||||
Hashtable<String,String> hashtable=new Hashtable<>();
|
||||
if (sarLawsAttrDetailedLists.size()>0){
|
||||
sarLawsAttrDetailedLists.forEach(sarLawsAttrDetailedList -> {list1.add(sarLawsAttrDetailedList.getStandId());});
|
||||
sarLawsAttrDetailedLists.forEach(sarLawsAttrDetailedList -> {
|
||||
dealWithHashTableData(list1, list2, hashtable, sarLawsAttrDetailedList);
|
||||
});
|
||||
}
|
||||
list1.removeAll(Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
||||
if (list1.size()>0){
|
||||
QueryWrapper<SarLawsAttrDetailedList> wrapper1 = new QueryWrapper<>();
|
||||
wrapper1.in("stand_id",list1);
|
||||
List<SarLawsAttrDetailedList> res=sarLawsAttrDetailedListDao.selectList(wrapper);
|
||||
if (res.size()>0){
|
||||
res.forEach(sarLawsAttrDetailedList -> {
|
||||
dealWithHashTableData(list1, list2, hashtable, sarLawsAttrDetailedList);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
res.forEach(sarLawsAttrDetailedList -> {
|
||||
list1.remove(sarLawsAttrDetailedList.getStandId());
|
||||
});
|
||||
//前面筛选出 移除认证清单
|
||||
if (null!=list1 && list1.size()>0){
|
||||
sarStandardsInfoDao.updateISRELATEACCESSById("2", list1);
|
||||
sarStandardsInfoDao.updateISRELATEACCESSById("1", list1);
|
||||
}
|
||||
//剩下的数据是需要加入到认证清单的
|
||||
list2.removeAll(list1);
|
||||
//下面写消息队列了开始
|
||||
createUpdateMQService.sendMQ(hashtable,list1,list2);
|
||||
}
|
||||
// //更新标准是否纳入认证清单
|
||||
// sarStandardsInfoDao.updateISRELATEACCESSById("1", Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void dealWithHashTableData(List<String> list1, List<String> list2, Hashtable<String, String> hashtable, SarLawsAttrDetailedList sarLawsAttrDetailedList) {
|
||||
list1.add(sarLawsAttrDetailedList.getStandId());
|
||||
list2.add(sarLawsAttrDetailedList.getStandId());
|
||||
if (null != hashtable.get(sarLawsAttrDetailedList.getId()) && null != sarLawsAttrDetailedList.getSyrz()) {
|
||||
if (sarLawsAttrDetailedList.getSyrz().contains(",")) {
|
||||
List<String> middle = new ArrayList<>(Arrays.asList(sarLawsAttrDetailedList.getSyrz().split(",")));
|
||||
middle.forEach(s -> {
|
||||
String as = hashtable.get(sarLawsAttrDetailedList.getId());
|
||||
if (!as.contains(s)) {
|
||||
hashtable.put(sarLawsAttrDetailedList.getId(), as + "," + s);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
// 先确定hashTable中不为空
|
||||
if (null != sarLawsAttrDetailedList.getSyrz()) {
|
||||
hashtable.put(sarLawsAttrDetailedList.getId(), sarLawsAttrDetailedList.getSyrz());
|
||||
}
|
||||
}
|
||||
//更新标准是否纳入认证清单
|
||||
sarStandardsInfoDao.updateISRELATEACCESSById("1", Arrays.asList(detailedUpDto.getInforlist().split(",")));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+4
@@ -3,6 +3,8 @@ package com.adc.da.slrs.sarStandAttrInfo.service;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务类
|
||||
@@ -16,4 +18,6 @@ public interface ISarStandAttrInfoService extends IService<SarStandAttrInfo> {
|
||||
String selectFieldValByStandId(String field,String standId);
|
||||
|
||||
int updateStandInfo(String standId,String field,String value);
|
||||
|
||||
Map<String, Object> getBussAttrInfo(String standId);
|
||||
}
|
||||
|
||||
+9
@@ -3,10 +3,13 @@ package com.adc.da.slrs.sarStandAttrInfo.service.impl;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.entity.SarStandAttrInfo;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.dao.SarStandAttrInfoDao;
|
||||
import com.adc.da.slrs.sarStandAttrInfo.service.ISarStandAttrInfoService;
|
||||
import com.adc.da.utils.util.InitStandAttrUtil;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 服务实现类
|
||||
@@ -30,4 +33,10 @@ public class SarStandAttrInfoServiceImpl extends ServiceImpl<SarStandAttrInfoDao
|
||||
public int updateStandInfo(String standId,String field,String value){
|
||||
return dao.updateStandInfo(standId,field,value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map getBussAttrInfo(String standId){
|
||||
String fieldInfo = InitStandAttrUtil.queryField;
|
||||
return this.baseMapper.selectStandFieldAndData(fieldInfo,standId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user