工作组查询 修改

This commit is contained in:
yuezhihang
2021-11-12 09:27:49 +08:00
parent b714156172
commit 0158e29009
8 changed files with 98 additions and 8 deletions
@@ -21,4 +21,6 @@ public interface WgStandorpolicyInfoDao extends BaseMapper<WgStandorpolicyInfo>
List<WgStandorpolicyInfo> researchAllDatas(@Param(value = "type")String type);
List<WgStandorpolicyInfo> researchAllDatasPartTwo(@Param(value = "type")String type);
}
@@ -2,6 +2,7 @@ package com.adc.da.slrs.wgStandorpolicyInfo.entity;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
@@ -32,31 +33,50 @@ public class WgStandorpolicyInfo extends BaseEntity {
private String id;
@ApiModelProperty(value = "工作组id")
@TableField("wg_id")
private String wgId;
@ApiModelProperty(value = "关联标准政策id")
@TableField("stand_id")
private String standId;
@ApiModelProperty(value = "政策/标准 类别")
@TableField(exist = false)
private String categary;
@ApiModelProperty(value = "政策/标准 编号")
@TableField(exist = false)
private String number;
@ApiModelProperty(value = "政策/标准 年份")
@TableField(exist = false)
private String year;
@ApiModelProperty(value = "政策标准 名称")
@TableField(exist = false)
private String name;
@ApiModelProperty(value = "政策/标准 英文名称")
@TableField(exist = false)
private String usname;
@ApiModelProperty(value = "文本状态")
@TableField(exist = false)
private String status;
@ApiModelProperty(value = "参与制定情况")
@TableField(exist = false)
private String joinDevelop;
@ApiModelProperty(value = "相关材料")
@TableField(exist = false)
private String netDatum;
@ApiModelProperty(value = "相关材料")
@TableField(exist = false)
private String dataType;
}
@@ -25,6 +25,13 @@ public class WgStandorpolicyInfoServiceImpl extends ServiceImpl<WgStandorpolicyI
@Override
public List<WgStandorpolicyInfo> getAllDatas(String type) {
return wgStandorpolicyInfoDao.researchAllDatas(type);
List<WgStandorpolicyInfo> wgStandorpolicyInfos=wgStandorpolicyInfoDao.researchAllDatas(type);
if ("0".equals(type)) {
List<WgStandorpolicyInfo> wgStandorpolicyInfos1 = wgStandorpolicyInfoDao.researchAllDatasPartTwo(type);
wgStandorpolicyInfos1.forEach(wgStandorpolicyInfo -> wgStandorpolicyInfo.setDataType("3"));
wgStandorpolicyInfos.addAll(wgStandorpolicyInfos1);
}
wgStandorpolicyInfos.removeIf(wgStandorpolicyInfo -> null==wgStandorpolicyInfo.getName());
return wgStandorpolicyInfos;
}
}
@@ -38,6 +38,12 @@ public class WgWorkGroupController extends BaseController<WgWorkGroup> {
return Result.success(wgWorkGroupService.saveDatas(wgWorkGroup));
}
@ApiOperation("添加标准/政策节点数据")
@PostMapping("/addStand")
public ResponseMessage<Object> addResourceData(@RequestBody WgWorkGroupDTO wgWorkGroup){
return Result.success(wgWorkGroupService.saveStandDatas(wgWorkGroup));
}
@ApiOperation("搜索工作组节点数据")
@GetMapping("/researchData")
@@ -20,6 +20,8 @@ public interface IWgWorkGroupService extends IService<WgWorkGroup> {
String saveDatas(WgWorkGroupDTO wgWorkGroupDTO);
String saveStandDatas(WgWorkGroupDTO wgWorkGroupDTO);
WgWorkGroupShowDTO researchData(String type);
//优化查询接口 速度
@@ -87,7 +87,7 @@ public class WgWorkGroupServiceImpl extends ServiceImpl<WgWorkGroupDao, WgWorkGr
wgMeetingUserRelations.add(wgMeetingUserRelation);
});
});
flag = wgMeetingUserRelationService.saveBatch(wgMeetingUserRelations);
wgMeetingUserRelationService.saveBatch(wgMeetingUserRelations);
flag = wgMeetingInfoService.saveBatch(wgWorkGroupDTO.getWgMeetingInfos());
}
//存储秘书联系方式信息
@@ -119,6 +119,30 @@ public class WgWorkGroupServiceImpl extends ServiceImpl<WgWorkGroupDao, WgWorkGr
}
}
@Override
public String saveStandDatas(WgWorkGroupDTO wgWorkGroupDTO) {
if (null!=wgWorkGroupDTO.getWgStandorpolicyInfos() && wgWorkGroupDTO.getWgStandorpolicyInfos().size()>0){
List<WgWorkGroup> wgWorkGroups=new ArrayList<>();
wgWorkGroupDTO.getWgStandorpolicyInfos().forEach(wgStandorpolicyInfo -> {
WgWorkGroup wgWorkGroup=new WgWorkGroup();
BeanUtils.copyProperties(wgWorkGroupDTO,wgWorkGroup);
wgWorkGroup.setId(String.valueOf(UUID.randomUUID()));
wgStandorpolicyInfo.setWgId(wgWorkGroup.getId());
wgWorkGroups.add(wgWorkGroup);
});
boolean flag=wgWorkGroupService.saveOrUpdateBatch(wgWorkGroups);
boolean flag1=wgStandorpolicyInfoService.saveOrUpdateBatch(wgWorkGroupDTO.getWgStandorpolicyInfos());
if (flag && flag1){
return "添加成功";
}else {
return "添加失败";
}
}else {
return "数据有误,请检查数据";
}
}
@Override
public WgWorkGroupShowDTO researchData(String type) {
//构建最初的节点 用来向下搜索
@@ -209,13 +233,16 @@ public class WgWorkGroupServiceImpl extends ServiceImpl<WgWorkGroupDao, WgWorkGr
}
});
}
//处理标准政策数据
if (null!=wgStandorpolicyInfos && wgStandorpolicyInfos.size()>0) {
wgStandorpolicyInfos.forEach(wgStandorpolicyInfo -> {
if (null!=wgWorkGroupMap.get(wgStandorpolicyInfo.getWgId()).getWgStandorpolicyInfos()) {
wgWorkGroupMap.get(wgStandorpolicyInfo.getWgId()).setName(wgStandorpolicyInfo.getName());
wgWorkGroupMap.get(wgStandorpolicyInfo.getWgId()).getWgStandorpolicyInfos().add(wgStandorpolicyInfo);
}else {
List<WgStandorpolicyInfo> wgStandorpolicyInfos1=new ArrayList<>();
wgStandorpolicyInfos1.add(wgStandorpolicyInfo);
wgWorkGroupMap.get(wgStandorpolicyInfo.getWgId()).setName(wgStandorpolicyInfo.getName());
wgWorkGroupMap.get(wgStandorpolicyInfo.getWgId()).setWgStandorpolicyInfos(wgStandorpolicyInfos1);
}
});