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

This commit is contained in:
yuezhihang
2021-08-19 10:41:20 +08:00
8 changed files with 229 additions and 82 deletions
@@ -22,7 +22,7 @@ import java.util.List;
public interface SarLawsAttrDetailedListDao extends BaseMapper<SarLawsAttrDetailedList> { public interface SarLawsAttrDetailedListDao extends BaseMapper<SarLawsAttrDetailedList> {
//根据清单id,查出标准的id并排序 //根据清单id,查出标准的id并排序
List<String> selectLawsId(@Param("standId") String standId,@Param("param3") Integer page,@Param("param2") Integer size); List<String> selectLawsId(@Param("standId") String standId,@Param("param3") Integer page,@Param("param2") Integer size,@Param("sar") SarFindDto sarFindDto);
//根据标准id查出数据 //根据标准id查出数据
List<LawsDto> selectLawsById(@Param("param1") List<String> LawsIds, @Param("sarFindDto") SarFindDto sarFindDto); List<LawsDto> selectLawsById(@Param("param1") List<String> LawsIds, @Param("sarFindDto") SarFindDto sarFindDto);
//根据标准id查出数据用于清单查询 //根据标准id查出数据用于清单查询
@@ -45,7 +45,7 @@ public class SarLawsAttrDetailedListServiceImpl extends ServiceImpl<SarLawsAttrD
wrapper.eq("detailed_list_id", sarFindDto.getId()); wrapper.eq("detailed_list_id", sarFindDto.getId());
IPage<SarLawsAttrDetailedList> selectPage = sarLawsAttrDetailedListDao.selectPage(pageRes,wrapper); IPage<SarLawsAttrDetailedList> selectPage = sarLawsAttrDetailedListDao.selectPage(pageRes,wrapper);
//查询标准id //查询标准id
List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize()); List<String> lawsIds = sarLawsAttrDetailedListDao.selectLawsId(sarFindDto.getId(),(sarFindDto.getPage())-1,sarFindDto.getSize(),sarFindDto);
if (CollectionUtils.isEmpty(lawsIds)){ if (CollectionUtils.isEmpty(lawsIds)){
return null; return null;
} }
@@ -16,6 +16,8 @@ public class AddDetailedDto {
private String countryArea; private String countryArea;
@ApiModelProperty(value = "项目名称") @ApiModelProperty(value = "项目名称")
private String projectName; private String projectName;
@ApiModelProperty(value = "车型类别")
private String carType;
@ApiModelProperty(value = "清单类别") @ApiModelProperty(value = "清单类别")
private String detailedList; private String detailedList;
@ApiModelProperty(value = "区分,国家地区为1,项目名称为2,清单类别为3") @ApiModelProperty(value = "区分,国家地区为1,项目名称为2,清单类别为3")
@@ -40,6 +42,4 @@ public class AddDetailedDto {
private String inforlist2; private String inforlist2;
@ApiModelProperty(value = "新车型实施时间") @ApiModelProperty(value = "新车型实施时间")
private String inforlist3; private String inforlist3;
@ApiModelProperty(value = "车辆类别")
private String carType;
} }
@@ -23,6 +23,9 @@ public class DetailedUpDto {
@ApiModelProperty(value = "项目名称") @ApiModelProperty(value = "项目名称")
private String projectName; private String projectName;
@ApiModelProperty(value = "车型类别")
private String carType;
@ApiModelProperty(value = "清单类别") @ApiModelProperty(value = "清单类别")
private String detailedList; private String detailedList;
@@ -41,6 +41,10 @@ public class SarLawsDetailedList extends BaseEntity {
@TableField("project_name") @TableField("project_name")
private String projectName; private String projectName;
@ApiModelProperty(value = "车型类别")
@TableField("car_type")
private String carType;
@ApiModelProperty(value = "清单类别") @ApiModelProperty(value = "清单类别")
@TableField("detailed_list") @TableField("detailed_list")
private String detailedList; private String detailedList;
@@ -81,8 +85,5 @@ public class SarLawsDetailedList extends BaseEntity {
@TableField("file_id") @TableField("file_id")
private String fileIds; private String fileIds;
@ApiModelProperty(value = "附件id")
@TableField("car_type")
private String carType;
} }
@@ -60,19 +60,158 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
@Override @Override
public String add(AddDetailedDto addDetailedDto) { public String add(AddDetailedDto addDetailedDto) {
//判断页面的国家地区是否和数据库里的字段长度相等
QueryWrapper<SarLawsDetailedList> wrapper = new QueryWrapper<>();
wrapper.select("DISTINCT country_area,car_type");
List<SarLawsDetailedList> sarLawsDetailedLists = sarLawsDetailedListDao.selectList(wrapper);
//国家/地区清单 多选是否可以添加的标识,true表示可以添加,false表示不许添加
boolean multiAddFlag = true;
//国家/地区清单 单选是否可以添加的标识,true表示可以添加,false表示不许添加
boolean singleAddFlag = true;
//车型类别是否可以添加的标识,true表示可以添加,false表示不许添加
boolean carAddFlag = true;
// System.out.println("数据库的值"+sarLawsDetailedLists);
// System.out.println("数据库里有多少条数据"+sarLawsDetailedLists.size());
// System.out.println("数据库里第一条"+sarLawsDetailedLists.get(1));
//先判断数据库里有没有值,如果没有,就直接新增
if (sarLawsDetailedLists.size() == 0) {
//下面放添加的具体方法
newListMethod(addDetailedDto);
return "数据库为空,添加成功";
}
//如果数据库有值,根据页面的字段进行判断是哪个清单的新增
else {
//如果是其他新增
if (addDetailedDto.getCountryArea() == null && addDetailedDto.getCarType() == null) {
//下面放添加的具体方法
newListMethod(addDetailedDto);
return "其他清单添加成功";
}
//如果是车辆新增
else if (addDetailedDto.getCarType() != null) {
//就判断页面的值和数据库里的值是否相等
for (int i = 0; i < sarLawsDetailedLists.size(); i++) {
//相等就不许添加
if (Objects.equals(addDetailedDto.getCarType(), sarLawsDetailedLists.get(i).getCarType())) {
System.out.println("数据库里第" + (i + 1) + "条的车型类别字段和页面一样,重复,不许添加");
carAddFlag = false;
}
}
}
//如果是国家新增
else if (addDetailedDto.getCountryArea() != null) {
for (int i = 0; i < sarLawsDetailedLists.size(); i++) {
//就先判断数据库里的数据的国家/地区字段是否为空
if (null == sarLawsDetailedLists.get(i) || null == sarLawsDetailedLists.get(i).getCountryArea()) {
System.out.println("数据库里第" + (i + 1) + "条的国家地区字段长度为空,不重复,目前可以添加");
}
//再判断页面字段长度是否与数据库里的长度一样,如果长度不一样,允许新增
else if (addDetailedDto.getCountryArea().length() != sarLawsDetailedLists.get(i).getCountryArea().length()) {
System.out.println("数据库里第" + (i + 1) + "条的国家地区字段长度和页面的国家地区字段长度不一样,不重复,目前可以添加");
}
//如果不为空且长度一样
else {
//判断页面的国家地区是单选还是多选(判断能不能拆)
if (addDetailedDto.getCountryArea().contains(",")) {
System.out.println("页面是多选");
//如果数据库里的国家地区字段存在",",说明是多选,如果不存在说明是单选
if (sarLawsDetailedLists.get(i).getCountryArea().contains(",")) {
System.out.println("数据库是多选,如果页面字段拆分之后都包含于数据库字段拆分之后,则说明重复,目前不许添加");
System.out.println("页面字段为" + addDetailedDto.getCountryArea());
//页面字段以“,”为分隔符拆分后的结果
String[] frontCountryArea = addDetailedDto.getCountryArea().split(",");
//数据库字段以“,”为分隔符拆分后的结果
String[] databaseCountryArea = sarLawsDetailedLists.get(i).getCountryArea().split(",");
//如果页面字段拆分之后都包含于数据库字段拆分之后,则说明重复,不许添加
for (int j = 0; j < frontCountryArea.length; j++) {
//如果数据库包含了页面字段的所有值,说明这俩完全相同,重复,不许添加
List<String> databaseCountryAreaList = Arrays.asList(databaseCountryArea);
if (databaseCountryAreaList.contains(frontCountryArea[j])) {
System.out.println("数据库" + databaseCountryAreaList);
System.out.println("页面" + frontCountryArea[j]);
System.out.println("数据库里的字段包含页面里的字段,可能重复,目前不许添加");
multiAddFlag = false;
} else {
System.out.println("数据库" + databaseCountryAreaList);
System.out.println("页面" + frontCountryArea[j]);
System.out.println("数据库里的字段和页面字段虽然长度相同,但是里面有不一样的元素,可以添加");
multiAddFlag = true;
}
}
if (multiAddFlag == true) {
System.out.println("长度相同,只要有一个不重复,就可以添加");
} else {
System.out.println("长度相同,整个循环下来都重复,说明两个字段重复,不许添加");
break;
}
}
} else {
System.out.println("页面是单选");
//如果数据库里的国家地区字段存在",",说明是多选,如果不存在说明是单选
if (sarLawsDetailedLists.get(i).getCountryArea().contains(",")) {
System.out.println("数据库是多选,肯定不重复,目前可以添加");
} else {
System.out.println("数据库是单选,如果数据库里的字段和页面的字段相等,重复,不许添加");
//如果数据库里的字段和页面的字段相等,重复,不许添加
if (Objects.equals(sarLawsDetailedLists.get(i).getCountryArea(), addDetailedDto.getCountryArea())) {
System.out.println("数据库里的字段和页面的字段相等,重复,不许添加");
singleAddFlag = false;
break;
} else {
System.out.println("数据库里的字段和页面的字段不相等,不重复,允许添加");
}
}
}
}
}
}
}
//如果是国家和车型清单
//如果整个循环下来都没有重复,则可以添加,不然就说明有重复,不能添加
if (carAddFlag == true && multiAddFlag == true && singleAddFlag == true) {
//下面放添加的具体方法
newListMethod(addDetailedDto);
return "车型类别清单添加成功";
//添加方法结束
} else if (carAddFlag == false){
//0表示添加成功,1表示添加失败
return "车型类别清单添加失败";
}
//如果循环完整个数据库,都没有重复使当前数据无法添加,则添加
if (multiAddFlag == true && singleAddFlag == true && carAddFlag == true) {
//下面放添加的具体方法
newListMethod(addDetailedDto);
//0表示添加成功,1表示添加失败
return "国家/地区清单添加成功";
//添加方法结束
} else {
//0表示添加成功,1表示添加失败
return "国家/地区清单添加失败";
}
}
/**
* 具体用来新增清单的方法
*
* @param addDetailedDto
*/
private void newListMethod(AddDetailedDto addDetailedDto) {
try { try {
SarLawsDetailedList sarLawsDetailedList = SarLawsDetailedList.builder() SarLawsDetailedList sarLawsDetailedList = SarLawsDetailedList.builder()
.id(UUIDUtils.randomUUID20()) .id(UUIDUtils.randomUUID20())
.sortKey(addDetailedDto.getSortKey()) .sortKey(addDetailedDto.getSortKey())
.detailedListName(addDetailedDto.getDetailedListName()) .detailedListName(addDetailedDto.getDetailedListName())
.detailedListState("0") .detailedListState("0")
.detailedListVision("v0")
.applicationScope(addDetailedDto.getApplicationScope()) .applicationScope(addDetailedDto.getApplicationScope())
.updateTime(new Date()) .updateTime(new Date())
.updatePeople(addDetailedDto.getUpdatePeople()) .updatePeople(addDetailedDto.getUpdatePeople())
.remark(addDetailedDto.getRemark()) .remark(addDetailedDto.getRemark())
.updatePeople(getUserName()) .updatePeople(getUserName())
.fileIds(addDetailedDto.getFileIds()) .fileIds(addDetailedDto.getFileIds())
.carType(addDetailedDto.getCarType())
.build(); .build();
List<TimeDto> timeDto = new ArrayList<>(); List<TimeDto> timeDto = new ArrayList<>();
switch (addDetailedDto.getSortKey()) { switch (addDetailedDto.getSortKey()) {
@@ -81,7 +220,7 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
break; break;
case "2": case "2":
sarLawsDetailedList.setProjectName(addDetailedDto.getProjectName()); sarLawsDetailedList.setCarType(addDetailedDto.getCarType());
break; break;
@@ -92,36 +231,38 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
default: default:
break; break;
} }
if ("admin".equals(getUserName()))sarLawsDetailedList.setUpdatePeople("管理员"); if ("admin".equals(getUserName())) sarLawsDetailedList.setUpdatePeople("管理员");
else {sarLawsDetailedList.setUpdatePeople(getUserName());} else {
sarLawsDetailedList.setUpdatePeople(getUserName());
}
sarLawsDetailedListDao.insert(sarLawsDetailedList); sarLawsDetailedListDao.insert(sarLawsDetailedList);
if (addDetailedDto.getInforlist()!=null){ if (addDetailedDto.getInforlist() != null) {
if (addDetailedDto.getInforlist().contains(",")){ if (addDetailedDto.getInforlist().contains(",")) {
String[] id = addDetailedDto.getInforlist().split(","); String[] id = addDetailedDto.getInforlist().split(",");
String[] ssrq = addDetailedDto.getInforlist1().split(","); String[] putTime = addDetailedDto.getInforlist1().split(",");
String[] zcc = addDetailedDto.getInforlist2().split(","); String[] zcc = addDetailedDto.getInforlist2().split(",");
String[] xcx = addDetailedDto.getInforlist3().split(","); String[] xcx = addDetailedDto.getInforlist3().split(",");
for (int a =0;a< id.length;a++){ for (int a = 0; a < id.length; a++) {
TimeDto dto = new TimeDto(); TimeDto dto = new TimeDto();
dto.setStandId(id[a]); dto.setStandId(id[a]);
if ("-".equals(ssrq[a]) || null==ssrq[a] ){ if ("-".equals(putTime[a]) || null == putTime[a]) {
dto.setSsrq(null); dto.setSsrq(null);
}else { } else {
dto.setSsrq(ssrq[a]); dto.setSsrq(putTime[a]);
} }
if ("-".equals(ssrq[a]) || null == xcx[a]){ if ("-".equals(putTime[a]) || null == xcx[a]) {
dto.setXcxssrqgj(null); dto.setXcxssrqgj(null);
}else { } else {
dto.setXcxssrqgj(xcx[a]); dto.setXcxssrqgj(xcx[a]);
} }
if ("-".equals(ssrq[a]) || null == zcc[a]){ if ("-".equals(putTime[a]) || null == zcc[a]) {
dto.setZccssrqgj(null); dto.setZccssrqgj(null);
}else { } else {
dto.setZccssrqgj(zcc[a]); dto.setZccssrqgj(zcc[a]);
} }
timeDto.add(dto); timeDto.add(dto);
} }
}else { } else {
TimeDto dto = new TimeDto(); TimeDto dto = new TimeDto();
dto.setStandId(addDetailedDto.getInforlist()); dto.setStandId(addDetailedDto.getInforlist());
dto.setSsrq(addDetailedDto.getInforlist1()); dto.setSsrq(addDetailedDto.getInforlist1());
@@ -129,30 +270,28 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
dto.setZccssrqgj(addDetailedDto.getInforlist3()); dto.setZccssrqgj(addDetailedDto.getInforlist3());
timeDto.add(dto); timeDto.add(dto);
} }
}else { } else {
timeDto=null; timeDto = null;
} }
service.insertDetailedList(sarLawsDetailedList.getId(),timeDto); service.insertDetailedList(sarLawsDetailedList.getId(), timeDto);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
return "添加成功";
} }
@Override @Override
public IPage<SarLawsDetailedList> AllSelectD(Integer page, Integer pageSize, String sortKey, public IPage<SarLawsDetailedList> AllSelectD(Integer page, Integer pageSize, String sortKey,
String countryArea, String projectName, String countryArea, String projectName, String carType,
String detailedList, String detailedListName,String carType) { String detailedList, String detailedListName) {
QueryWrapper<SarLawsDetailedList> wrapper = new QueryWrapper<>(); QueryWrapper<SarLawsDetailedList> wrapper = new QueryWrapper<>();
if ("1".equals(sortKey)) { if ("1".equals(sortKey)) {
wrapper.like(StringUtils.isNotEmpty(countryArea), "country_area", countryArea). wrapper.like(StringUtils.isNotEmpty(countryArea), "country_area", countryArea).
like(StringUtils.isNotEmpty(detailedListName), "detailed_list_name", detailedListName); like(StringUtils.isNotEmpty(detailedListName), "detailed_list_name", detailedListName);
} else if ("2".equals(sortKey)) { } else if ("2".equals(sortKey)) {
wrapper.like(StringUtils.isNotEmpty(projectName), "project_name", projectName). wrapper.like(StringUtils.isNotEmpty(carType), "car_type", carType).
like(StringUtils.isNotEmpty(detailedListName), "detailed_list_name", detailedListName). like(StringUtils.isNotEmpty(detailedListName), "detailed_list_name", detailedListName);
like(StringUtils.isNotEmpty(carType), "car_type", carType);
} else if ("3".equals(sortKey)) { } else if ("3".equals(sortKey)) {
wrapper.like(StringUtils.isNotEmpty(detailedList), "detailed_list", detailedList). wrapper.like(StringUtils.isNotEmpty(detailedList), "detailed_list", detailedList).
@@ -180,9 +319,9 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
} }
String completedString = builder.delete(builder.length() - 1, builder.length()).toString(); String completedString = builder.delete(builder.length() - 1, builder.length()).toString();
list1.setCountryArea(completedString); list1.setCountryArea(completedString);
}else { } else {
for (Map<String,String> map1:arr) { for (Map<String, String> map1 : arr) {
if (map1.get("value").equals(list1.getCountryArea())){ if (map1.get("value").equals(list1.getCountryArea())) {
list1.setCountryArea(map1.get("label")); list1.setCountryArea(map1.get("label"));
break; break;
} }
@@ -201,46 +340,46 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
SarLawsDetailedList list = sarLawsDetailedListDao.selectById(detailedUpDto.getId()); SarLawsDetailedList list = sarLawsDetailedListDao.selectById(detailedUpDto.getId());
//国家或地区 //国家或地区
if (StringUtils.isBlank(detailedUpDto.getCountryArea())) list.setCountryArea(null); if (StringUtils.isBlank(detailedUpDto.getCountryArea())) list.setCountryArea(null);
else if ("null".equals(detailedUpDto.getCountryArea())); else if ("null".equals(detailedUpDto.getCountryArea())) ;
else list.setCountryArea(detailedUpDto.getCountryArea()); else list.setCountryArea(detailedUpDto.getCountryArea());
//项目名称 //车型类别
if (StringUtils.isBlank(detailedUpDto.getProjectName())) list.setProjectName(null); if (StringUtils.isBlank(detailedUpDto.getCarType())) list.setCarType(null);
else if ("null".equals(detailedUpDto.getProjectName())); else if ("null".equals(detailedUpDto.getCarType())) ;
else list.setProjectName(detailedUpDto.getProjectName()); else list.setCarType(detailedUpDto.getCarType());
//清单类别 //清单类别
if (StringUtils.isBlank(detailedUpDto.getDetailedList())) list.setDetailedList(null); if (StringUtils.isBlank(detailedUpDto.getDetailedList())) list.setDetailedList(null);
else if ("null".equals(detailedUpDto.getDetailedList())); else if ("null".equals(detailedUpDto.getDetailedList())) ;
else list.setDetailedList(detailedUpDto.getDetailedList()); else list.setDetailedList(detailedUpDto.getDetailedList());
//清单名称 //清单名称
if (StringUtils.isBlank(detailedUpDto.getDetailedListName())) list.setDetailedListName(null); if (StringUtils.isBlank(detailedUpDto.getDetailedListName())) list.setDetailedListName(null);
else if ("null".equals(detailedUpDto.getDetailedListName())); else if ("null".equals(detailedUpDto.getDetailedListName())) ;
else list.setDetailedListName(detailedUpDto.getDetailedListName()); else list.setDetailedListName(detailedUpDto.getDetailedListName());
//适用领域 //适用领域
if (StringUtils.isBlank(detailedUpDto.getApplicationScope())) list.setApplicationScope(null); if (StringUtils.isBlank(detailedUpDto.getApplicationScope())) list.setApplicationScope(null);
else if ("null".equals(detailedUpDto.getApplicationScope())); else if ("null".equals(detailedUpDto.getApplicationScope())) ;
else list.setApplicationScope(detailedUpDto.getApplicationScope()); else list.setApplicationScope(detailedUpDto.getApplicationScope());
//清单详情 //清单详情
if (StringUtils.isBlank(detailedUpDto.getRemark())) list.setRemark(null); if (StringUtils.isBlank(detailedUpDto.getRemark())) list.setRemark(null);
else if ("null".equals(detailedUpDto.getRemark())); else if ("null".equals(detailedUpDto.getRemark())) ;
list.setRemark(detailedUpDto.getRemark()); list.setRemark(detailedUpDto.getRemark());
//版本号 //版本号
if (StringUtils.isBlank(detailedUpDto.getDetailedListVision())) list.setDetailedListVision(null); if (StringUtils.isBlank(detailedUpDto.getDetailedListVision())) list.setDetailedListVision(null);
else if ("null".equals(detailedUpDto.getDetailedListVision())); else if ("null".equals(detailedUpDto.getDetailedListVision())) ;
list.setDetailedListVision(detailedUpDto.getDetailedListVision()); list.setDetailedListVision(detailedUpDto.getDetailedListVision());
//更新时间 //更新时间
list.setUpdateTime(new Date()); list.setUpdateTime(new Date());
//更新人 //更新人
if (StringUtils.isBlank(detailedUpDto.getReNewPeople())) list.setUpdatePeople(null); if (StringUtils.isBlank(detailedUpDto.getReNewPeople())) list.setUpdatePeople(null);
else if ("null".equals(detailedUpDto.getReNewPeople())); else if ("null".equals(detailedUpDto.getReNewPeople())) ;
else list.setUpdatePeople(detailedUpDto.getReNewPeople()); else list.setUpdatePeople(detailedUpDto.getReNewPeople());
//更新人 //更新人
if (StringUtils.isBlank(detailedUpDto.getDetailedListState())) list.setDetailedListState(null); if (StringUtils.isBlank(detailedUpDto.getDetailedListState())) list.setDetailedListState(null);
else if ("null".equals(detailedUpDto.getDetailedListState())); else if ("null".equals(detailedUpDto.getDetailedListState())) ;
else list.setDetailedListState(detailedUpDto.getDetailedListState()); else list.setDetailedListState(detailedUpDto.getDetailedListState());
//文件 //文件
if (StringUtils.isBlank(detailedUpDto.getFileIds())) list.setFileIds(null); if (StringUtils.isBlank(detailedUpDto.getFileIds())) list.setFileIds(null);
else if ("null".equals(detailedUpDto.getFileIds())); else if ("null".equals(detailedUpDto.getFileIds())) ;
else list.setFileIds(detailedUpDto.getFileIds()); else list.setFileIds(detailedUpDto.getFileIds());
sarLawsDetailedListDao.updateById(list); sarLawsDetailedListDao.updateById(list);
@@ -248,31 +387,31 @@ public class SarLawsDetailedListServiceImpl extends ServiceImpl<SarLawsDetailedL
if (src.equals(detailedUpDto.getInforlist()) || null != detailedUpDto.getInforlist()) { if (src.equals(detailedUpDto.getInforlist()) || null != detailedUpDto.getInforlist()) {
List<TimeDto> timeDto = new ArrayList<>(); List<TimeDto> timeDto = new ArrayList<>();
if ( detailedUpDto.getInforlist().contains(",")) { if (detailedUpDto.getInforlist().contains(",")) {
String[] id = detailedUpDto.getInforlist().split(","); String[] id = detailedUpDto.getInforlist().split(",");
String[] ssrq = detailedUpDto.getInforlist1().split(","); String[] putTime = detailedUpDto.getInforlist1().split(",");
String[] zcc = detailedUpDto.getInforlist2().split(","); String[] zcc = detailedUpDto.getInforlist2().split(",");
String[] xcx = detailedUpDto.getInforlist3().split(","); String[] xcx = detailedUpDto.getInforlist3().split(",");
for (int a = 0; a < id.length; a++) { for (int a = 0; a < id.length; a++) {
TimeDto dto = new TimeDto(); TimeDto dto = new TimeDto();
dto.setStandId(id[a]); dto.setStandId(id[a]);
if (ssrq.length<=a) { if (putTime.length <= a) {
dto.setSsrq(null); dto.setSsrq(null);
} else { } else {
dto.setSsrq(ssrq[a]); dto.setSsrq(putTime[a]);
}
if (ssrq.length<=a) {
dto.setXcxssrqgj(null);
} else {
dto.setXcxssrqgj(xcx[a]);
}
if (ssrq.length<=a) {
dto.setZccssrqgj(null);
} else {
dto.setZccssrqgj(zcc[a]);
}
timeDto.add(dto);
} }
if (putTime.length <= a) {
dto.setXcxssrqgj(null);
} else {
dto.setXcxssrqgj(xcx[a]);
}
if (putTime.length <= a) {
dto.setZccssrqgj(null);
} else {
dto.setZccssrqgj(zcc[a]);
}
timeDto.add(dto);
}
} else { } else {
TimeDto dto = new TimeDto(); TimeDto dto = new TimeDto();
dto.setStandId(detailedUpDto.getInforlist()); dto.setStandId(detailedUpDto.getInforlist());
@@ -85,9 +85,7 @@ public class SarStandardComplianceAssessResultController {
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) { if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim()); queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
} }
// if (eo.getType() != null && !eo.getType().trim().equals("")) {
// queryWrapper.like("type",eo.getType().trim());
// }
IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper); IPage<SarInterpretationNationalStandard> page = iSarInterpretationNationalStandardService.page(iPage, queryWrapper);
while (page.getRecords().remove(null)) ; while (page.getRecords().remove(null)) ;
@@ -103,17 +101,15 @@ public class SarStandardComplianceAssessResultController {
if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) { if (eo.getStandNumber() != null && !eo.getStandNumber().trim().equals("")) {
queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim()); queryWrapper.like("STAND_NUMBER", eo.getStandNumber().trim());
} }
// if (eo.getType() != null && !eo.getType().trim().equals("")) {
// queryWrapper.like("type",eo.getType().trim());
// }
IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper); IPage<SarInterpretationForeignStandard> page = iSarInterpretationForeignStandardService.page(iPage, queryWrapper);
while (page.getRecords().remove(null)) ; while(page.getRecords().remove(null));
return Result.success(page); return Result.success(page);
} }
} }
} }
private static class InsertEntity<T> { private static class InsertEntity<T>{
List<Map> entityList; List<Map> entityList;
T eo; T eo;
} }
@@ -145,7 +141,7 @@ public class SarStandardComplianceAssessResultController {
} }
iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList); iSarInterpretationNationalStandardService.saveOrUpdateBatch(entityList);
} else { }else{
List<SarInterpretationForeignStandard> entityList = new ArrayList<>(); List<SarInterpretationForeignStandard> entityList = new ArrayList<>();
for (int i = 0; i < insertEntity.entityList.size(); i++) { for (int i = 0; i < insertEntity.entityList.size(); i++) {
SarInterpretationForeignStandard obj = new SarInterpretationForeignStandard(); SarInterpretationForeignStandard obj = new SarInterpretationForeignStandard();
@@ -166,10 +162,10 @@ public class SarStandardComplianceAssessResultController {
public ResponseMessage<IPage<SarStandardComplianceProductAssess>> selectProduct(SarStandardComplianceProductAssessEO eo) throws Exception { public ResponseMessage<IPage<SarStandardComplianceProductAssess>> selectProduct(SarStandardComplianceProductAssessEO eo) throws Exception {
IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize()); IPage<SarStandardComplianceProductAssess> iPage = new Page<>(eo.getCurrent(), eo.getSize());
QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>(); QueryWrapper<SarStandardComplianceProductAssess> queryWrapper = new QueryWrapper<>();
if (eo.getType() != null) queryWrapper.eq("type", eo.getType());
if (eo.getProductName() != null) queryWrapper.like("product_name", eo.getProductName()); if (eo.getProductName() != null) queryWrapper.like("product_name", eo.getProductName());
if (eo.getStandId() != null) queryWrapper.like("STAND_ID", eo.getStandId()); // if (eo.getStandId() != null) queryWrapper.like("STAND_ID", eo.getStandId());
if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime()); // if (eo.getInterpretationTime() != null) queryWrapper.eq("INTERPRETATION_TIME", eo.getInterpretationTime());
IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper); IPage<SarStandardComplianceProductAssess> page = iSarStandardComplianceProductAssessService.page(iPage, queryWrapper);
return Result.success(page); return Result.success(page);
} }
@@ -91,6 +91,10 @@ public class SarStandardComplianceProductAssess extends BaseEntity {
@ApiModelProperty(value = "在产产品合规信息") @ApiModelProperty(value = "在产产品合规信息")
private String productionCompliance; private String productionCompliance;
@ApiModelProperty(value = "在产产品不合规信息")
@TableField("production_non_compliance")
private String productionNonCompliance;
@ApiModelProperty(value = "在产产品不合规应对措施") @ApiModelProperty(value = "在产产品不合规应对措施")
private String productionCountermeasures; private String productionCountermeasures;
@@ -113,6 +117,10 @@ public class SarStandardComplianceProductAssess extends BaseEntity {
@TableField("clause_name") @TableField("clause_name")
private String clauseName; private String clauseName;
@ApiModelProperty(value = "流程UUID")
@TableField("type")
private String type;
private String id; private String id;