56627
This commit is contained in:
+129
-124
@@ -136,154 +136,159 @@ public class SarLawsAttrDetailedListController extends BaseController<SarLawsAtt
|
||||
List<LawsDto> data = new ArrayList<>();
|
||||
if (CollectionUtils.isEmpty(standExcelVo.getIds())){
|
||||
List<String> list= sarLawsAttrDetailedListDao.selectLawsId2(standExcelVo.getId());
|
||||
if (CollectionUtils.isEmpty(list)) return;
|
||||
data=sarLawsAttrDetailedListDao.selectLawsByIdE(list);
|
||||
if (!CollectionUtils.isEmpty(list)) {
|
||||
data = sarLawsAttrDetailedListDao.selectLawsByIdE(list);
|
||||
}
|
||||
}else {
|
||||
data=sarLawsAttrDetailedListDao.selectLawsByIdE(standExcelVo.getIds());
|
||||
}
|
||||
if ("1".equals(type)){
|
||||
List<String> lawsIds=new ArrayList<>();
|
||||
SarFindDto sarFindDto=new SarFindDto();
|
||||
sarFindDto.setId(standExcelVo.getId());
|
||||
data.forEach(lawsDto -> {lawsIds.add(lawsDto.getId());});
|
||||
List<LawsDto> list = sarLawsAttrDetailedListDao.selectLawsById(lawsIds,sarFindDto);
|
||||
for (LawsDto lawsDto:data){
|
||||
if (StringUtils.isNoneEmpty(lawsDto.getApplyArctic())){
|
||||
lawsDto.setApplyArctic(lawsDto.getApplyArctic());
|
||||
}
|
||||
QueryWrapper<SarLawsAttrDetailedList> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("stand_id",lawsDto.getId())
|
||||
.eq("detailed_list_id",sarFindDto.getId());
|
||||
List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists = sarLawsAttrDetailedListDao.selectList(queryWrapper);
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getSsrq()) && "null" != sarLawsAttrDetailedLists.get(0).getSsrq()) {
|
||||
lawsDto.setSSRQ(sarLawsAttrDetailedLists.get(0).getSsrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getXcxssrq()) && "null" != sarLawsAttrDetailedLists.get(0).getXcxssrq()) {
|
||||
lawsDto.setXCXSSRQGJ(sarLawsAttrDetailedLists.get(0).getXcxssrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getZccssrq()) && "null" != sarLawsAttrDetailedLists.get(0).getZccssrq()) {
|
||||
lawsDto.setZCCSSRQGJ(sarLawsAttrDetailedLists.get(0).getZccssrq());
|
||||
}
|
||||
if ("INLAND".equals(lawsDto.getStandType())) lawsDto.setStandType("INLAND_STAND");
|
||||
if ("FOREIGN".equals(lawsDto.getStandType())) lawsDto.setStandType("FOREIGN_STAND");
|
||||
if (!CollectionUtils.isEmpty(data)) {
|
||||
if ("1".equals(type)) {
|
||||
List<String> lawsIds = new ArrayList<>();
|
||||
SarFindDto sarFindDto = new SarFindDto();
|
||||
sarFindDto.setId(standExcelVo.getId());
|
||||
data.forEach(lawsDto -> {
|
||||
lawsIds.add(lawsDto.getId());
|
||||
});
|
||||
List<LawsDto> list = sarLawsAttrDetailedListDao.selectLawsById(lawsIds, sarFindDto);
|
||||
for (LawsDto lawsDto : data) {
|
||||
if (StringUtils.isNoneEmpty(lawsDto.getApplyArctic())) {
|
||||
lawsDto.setApplyArctic(lawsDto.getApplyArctic());
|
||||
}
|
||||
QueryWrapper<SarLawsAttrDetailedList> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("stand_id", lawsDto.getId())
|
||||
.eq("detailed_list_id", sarFindDto.getId());
|
||||
List<SarLawsAttrDetailedList> sarLawsAttrDetailedLists = sarLawsAttrDetailedListDao.selectList(queryWrapper);
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getSsrq()) && "null" != sarLawsAttrDetailedLists.get(0).getSsrq()) {
|
||||
lawsDto.setSSRQ(sarLawsAttrDetailedLists.get(0).getSsrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getXcxssrq()) && "null" != sarLawsAttrDetailedLists.get(0).getXcxssrq()) {
|
||||
lawsDto.setXCXSSRQGJ(sarLawsAttrDetailedLists.get(0).getXcxssrq());
|
||||
}
|
||||
if (StringUtils.isNoneEmpty(sarLawsAttrDetailedLists.get(0).getZccssrq()) && "null" != sarLawsAttrDetailedLists.get(0).getZccssrq()) {
|
||||
lawsDto.setZCCSSRQGJ(sarLawsAttrDetailedLists.get(0).getZccssrq());
|
||||
}
|
||||
if ("INLAND".equals(lawsDto.getStandType())) lawsDto.setStandType("INLAND_STAND");
|
||||
if ("FOREIGN".equals(lawsDto.getStandType())) lawsDto.setStandType("FOREIGN_STAND");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
//适用车型
|
||||
Map<String,Object> map= iDicTypeEOService.getDicTypeListCode();
|
||||
List<Map<String, String>> typeApplicable = (List<Map<String, String>>)map.get("ENERGYTYPES");
|
||||
for (LawsDto list1:data){
|
||||
if (StringUtils.isNotBlank(list1.getTypeApplicable()) && list1.getTypeApplicable().contains(",")){
|
||||
String[] split = list1.getTypeApplicable().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s:split){
|
||||
for (Map<String,String> map1:typeApplicable) {
|
||||
if (map1.get("value").equals(s)){
|
||||
s=map1.get("label");
|
||||
builder.append(s+",");
|
||||
//适用车型
|
||||
Map<String, Object> map = iDicTypeEOService.getDicTypeListCode();
|
||||
List<Map<String, String>> typeApplicable = (List<Map<String, String>>) map.get("ENERGYTYPES");
|
||||
for (LawsDto list1 : data) {
|
||||
if (StringUtils.isNotBlank(list1.getTypeApplicable()) && list1.getTypeApplicable().contains(",")) {
|
||||
String[] split = list1.getTypeApplicable().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s : split) {
|
||||
for (Map<String, String> map1 : typeApplicable) {
|
||||
if (map1.get("value").equals(s)) {
|
||||
s = map1.get("label");
|
||||
builder.append(s + ",");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
list1.setTypeApplicable(completedString);
|
||||
} else {
|
||||
for (Map<String, String> map1 : typeApplicable) {
|
||||
if (map1.get("value").equals(list1.getTypeApplicable())) {
|
||||
list1.setTypeApplicable(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
list1.setTypeApplicable(completedString);
|
||||
}else {
|
||||
for (Map<String, String> map1 : typeApplicable) {
|
||||
if (map1.get("value").equals(list1.getTypeApplicable())) {
|
||||
list1.setTypeApplicable(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//能源类型
|
||||
List<Map<String, String>> nylx = (List<Map<String, String>>)map.get("NYLXCLASS");
|
||||
for (LawsDto list1:data){
|
||||
if (StringUtils.isNotBlank(list1.getNYLX()) && list1.getNYLX().contains(",")){
|
||||
String[] split = list1.getNYLX().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s:split){
|
||||
for (Map<String,String> map1:nylx) {
|
||||
if (map1.get("value").equals(s)){
|
||||
s=map1.get("label");
|
||||
builder.append(s+",");
|
||||
//能源类型
|
||||
List<Map<String, String>> nylx = (List<Map<String, String>>) map.get("NYLXCLASS");
|
||||
for (LawsDto list1 : data) {
|
||||
if (StringUtils.isNotBlank(list1.getNYLX()) && list1.getNYLX().contains(",")) {
|
||||
String[] split = list1.getNYLX().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s : split) {
|
||||
for (Map<String, String> map1 : nylx) {
|
||||
if (map1.get("value").equals(s)) {
|
||||
s = map1.get("label");
|
||||
builder.append(s + ",");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
list1.setNYLX(completedString);
|
||||
} else {
|
||||
for (Map<String, String> map1 : nylx) {
|
||||
if (map1.get("value").equals(list1.getNYLX())) {
|
||||
list1.setNYLX(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
list1.setNYLX(completedString);
|
||||
}else {
|
||||
for (Map<String, String> map1 : nylx) {
|
||||
if (map1.get("value").equals(list1.getNYLX())) {
|
||||
list1.setNYLX(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
//责任部门
|
||||
List<Map<String, String>> zrbn = (List<Map<String, String>>)map.get("ZRBMCLASS");
|
||||
for (LawsDto list1:data){
|
||||
if (StringUtils.isNotBlank(list1.getZRBM()) && list1.getZRBM().contains(",")){
|
||||
String[] split = list1.getZRBM().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s:split){
|
||||
for (Map<String,String> map1:zrbn) {
|
||||
if (map1.get("value").equals(s)){
|
||||
s=map1.get("label");
|
||||
builder.append(s+",");
|
||||
//责任部门
|
||||
List<Map<String, String>> zrbn = (List<Map<String, String>>) map.get("ZRBMCLASS");
|
||||
for (LawsDto list1 : data) {
|
||||
if (StringUtils.isNotBlank(list1.getZRBM()) && list1.getZRBM().contains(",")) {
|
||||
String[] split = list1.getZRBM().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s : split) {
|
||||
for (Map<String, String> map1 : zrbn) {
|
||||
if (map1.get("value").equals(s)) {
|
||||
s = map1.get("label");
|
||||
builder.append(s + ",");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
String completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
list1.setZRBM(completedString);
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
}
|
||||
} else {
|
||||
for (Map<String, String> map1 : zrbn) {
|
||||
if (map1.get("value").equals(list1.getZRBM())) {
|
||||
list1.setZRBM(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
list1.setZRBM(completedString);
|
||||
}catch (Exception e){
|
||||
System.out.println(e);
|
||||
}
|
||||
//产品线
|
||||
List<Map<String, String>> sycpx = (List<Map<String, String>>) map.get("SYCPXCLASS");
|
||||
for (LawsDto list1 : data) {
|
||||
if (list1.getSSRQ() != null) {
|
||||
list1.setSSRQ(list1.getSSRQ());
|
||||
}
|
||||
}else {
|
||||
for (Map<String, String> map1 : zrbn) {
|
||||
if (map1.get("value").equals(list1.getZRBM())) {
|
||||
list1.setZRBM(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
if (list1.getZCCSSRQGJ() != null) {
|
||||
list1.setZCCSSRQGJ(list1.getZCCSSRQGJ());
|
||||
}
|
||||
if (list1.getXCXSSRQGJ() != null) {
|
||||
list1.setXCXSSRQGJ(list1.getXCXSSRQGJ());
|
||||
}
|
||||
}
|
||||
}
|
||||
//产品线
|
||||
List<Map<String, String>> sycpx = (List<Map<String, String>>)map.get("SYCPXCLASS");
|
||||
for (LawsDto list1:data){
|
||||
if (list1.getSSRQ()!=null){
|
||||
list1.setSSRQ(list1.getSSRQ());
|
||||
}
|
||||
if (list1.getZCCSSRQGJ()!=null){
|
||||
list1.setZCCSSRQGJ(list1.getZCCSSRQGJ());
|
||||
}
|
||||
if (list1.getXCXSSRQGJ()!=null){
|
||||
list1.setXCXSSRQGJ(list1.getXCXSSRQGJ());
|
||||
}
|
||||
|
||||
if (StringUtils.isNotBlank(list1.getSYCPX()) && list1.getSYCPX().contains(",")){
|
||||
String[] split = list1.getSYCPX().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s:split){
|
||||
for (Map<String,String> map1:sycpx) {
|
||||
if (map1.get("value").equals(s)){
|
||||
s=map1.get("label");
|
||||
builder.append(s+",");
|
||||
break;
|
||||
if (StringUtils.isNotBlank(list1.getSYCPX()) && list1.getSYCPX().contains(",")) {
|
||||
String[] split = list1.getSYCPX().split(",");
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (String s : split) {
|
||||
for (Map<String, String> map1 : sycpx) {
|
||||
if (map1.get("value").equals(s)) {
|
||||
s = map1.get("label");
|
||||
builder.append(s + ",");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
String completedString = builder.delete(builder.length()-1,builder.length()).toString();
|
||||
list1.setSYCPX(completedString);
|
||||
}else {
|
||||
for (Map<String, String> map1 : sycpx) {
|
||||
if (map1.get("value").equals(list1.getSYCPX())) {
|
||||
list1.setSYCPX(map1.get("label"));
|
||||
break;
|
||||
String completedString = builder.delete(builder.length() - 1, builder.length()).toString();
|
||||
list1.setSYCPX(completedString);
|
||||
} else {
|
||||
for (Map<String, String> map1 : sycpx) {
|
||||
if (map1.get("value").equals(list1.getSYCPX())) {
|
||||
list1.setSYCPX(map1.get("label"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user