法规清单人名回显问题

This commit is contained in:
yuezhihang
2021-12-21 10:12:55 +08:00
parent e8b84b3088
commit d05f5eb388
@@ -13,6 +13,7 @@ import com.adc.da.slrs.sarLawsDetailedList.entity.TimeDto;
import com.adc.da.slrs.sarLawsDetailedList.service.ISarLawsDetailedListService; import com.adc.da.slrs.sarLawsDetailedList.service.ISarLawsDetailedListService;
import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao; import com.adc.da.slrs.sarStandardsInfo.dao.SarStandardsInfoDao;
import com.adc.da.slrs.sarStandardsInfo.service.impl.SarStandardsInfoServiceImpl; import com.adc.da.slrs.sarStandardsInfo.service.impl.SarStandardsInfoServiceImpl;
import com.adc.da.slrs.sarUser.entity.UpDTO;
import com.adc.da.slrs.sarUser.service.ITsUserService; import com.adc.da.slrs.sarUser.service.ITsUserService;
import com.adc.da.sys.service.IDicTypeEOService; import com.adc.da.sys.service.IDicTypeEOService;
import com.adc.da.util.UUIDUtils; import com.adc.da.util.UUIDUtils;
@@ -348,11 +349,22 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
} }
} }
} }
/////asdfghjkl
userIPage.setRecords(list); userIPage.setRecords(list);
} }
List<String> names = new ArrayList<>();
userIPage.getRecords().forEach(sarLawsDetailedList -> {
names.add(sarLawsDetailedList.getUpdatePeople());
});
List<UpDTO> upDTOS = iTsUserService.selectNameById(names, "0");
Map<String, String> stringMap = new HashMap<>();
upDTOS.forEach(upDTO -> {
stringMap.put(upDTO.getId(), upDTO.getValue());
});
userIPage.getRecords().forEach(sarLawsDetailedList -> {
if (null != stringMap.get(sarLawsDetailedList.getUpdatePeople())) {
sarLawsDetailedList.setUpdatePeople(stringMap.get(sarLawsDetailedList.getUpdatePeople()));
}
});
System.out.println("总条数" + userIPage.getTotal()); System.out.println("总条数" + userIPage.getTotal());
System.out.println("总页数" + userIPage.getPages()); System.out.println("总页数" + userIPage.getPages());
return userIPage; return userIPage;
@@ -391,8 +403,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
//判断数据库里的数据的车型类别字段是否为空 //判断数据库里的数据的车型类别字段是否为空
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()) { if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCarType()) {
System.out.println("数据库里第" + (i + 1) + "条的车型类别字段长度为空,不重复,目前可以添加"); System.out.println("数据库里第" + (i + 1) + "条的车型类别字段长度为空,不重复,目前可以添加");
} } else if (Objects.equals(detailedUpDto.getCarType(), list.getCarType())) {
else if (Objects.equals(detailedUpDto.getCarType(), list.getCarType())){
System.out.println("页面的数据和数据库里存的当前数据相同,说明没有做更改,允许提交"); System.out.println("页面的数据和数据库里存的当前数据相同,说明没有做更改,允许提交");
} }
//相等就不许添加 //相等就不许添加
@@ -408,8 +419,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
//就先判断数据库里的数据的国家/地区字段是否为空 //就先判断数据库里的数据的国家/地区字段是否为空
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCountryArea()) { if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCountryArea()) {
System.out.println("数据库里第" + (i + 1) + "条的国家地区字段长度为空,不重复,目前可以添加"); System.out.println("数据库里第" + (i + 1) + "条的国家地区字段长度为空,不重复,目前可以添加");
} } else if (Objects.equals(detailedUpDto.getCountryArea(), list.getCountryArea())) {
else if (Objects.equals(detailedUpDto.getCountryArea(), list.getCountryArea())){
System.out.println("页面的数据和数据库里存的当前数据相同,说明没有做更改,允许提交"); System.out.println("页面的数据和数据库里存的当前数据相同,说明没有做更改,允许提交");
} }
//再判断页面字段长度是否与数据库里的长度一样,如果长度不一样,允许新增 //再判断页面字段长度是否与数据库里的长度一样,如果长度不一样,允许新增
@@ -503,7 +513,6 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
} }
} }
private void updateListMethod(DetailedUpDto detailedUpDto) { private void updateListMethod(DetailedUpDto detailedUpDto) {
@@ -634,7 +643,6 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
String[] split = countryArea.split(","); //拆分标准中的国家地区 String[] split = countryArea.split(","); //拆分标准中的国家地区
//遍历清单 对比国家地区 //遍历清单 对比国家地区
for (SarLawsDetailedList lawsDetailed : sarLawsDetailedLists) { for (SarLawsDetailedList lawsDetailed : sarLawsDetailedLists) {
if (lawsDetailed.getCountryArea() == null) { if (lawsDetailed.getCountryArea() == null) {