工作组查询 修改

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);
}
});
@@ -8,8 +8,34 @@
</select>
<select id="researchAllDatas" resultType="com.adc.da.slrs.wgStandorpolicyInfo.entity.WgStandorpolicyInfo">
select * from wg_standorpolicy_info
select wg_standorpolicy_info.id ,wg_standorpolicy_info.wg_id , wg_standorpolicy_info.stand_id
<if test="type == 0 ">
, sar_standards_info.STAND_NAME as name ,sar_standards_info.STAND_TYPE as dataType
</if>
<if test="type == 1 ">
,sar_laws_stand_info.LAWS_NAME as name
</if>
from wg_standorpolicy_info
left join wg_work_group on wg_work_group.id = wg_standorpolicy_info.wg_id
<if test="type == 0">
left join sar_standards_info on sar_standards_info.ID = wg_standorpolicy_info.stand_id
</if>
<if test="type == 1">
left join sar_laws_stand_info on sar_laws_stand_info.ID = wg_standorpolicy_info.stand_id
</if>
where wg_work_group.type = #{type}
</select>
<select id="researchAllDatasPartTwo" resultType="com.adc.da.slrs.wgStandorpolicyInfo.entity.WgStandorpolicyInfo">
select wg_standorpolicy_info.id ,wg_standorpolicy_info.wg_id , wg_standorpolicy_info.stand_id
<if test="type == 0 ">
, sar_bussioness_stand.STAND_NAME as name
</if>
from wg_standorpolicy_info
left join wg_work_group on wg_work_group.id = wg_standorpolicy_info.wg_id
<if test="type == 0">
left join sar_bussioness_stand on sar_bussioness_stand.ID = wg_standorpolicy_info.stand_id
</if>
where wg_work_group.type = #{type}
</select>
</mapper>
@@ -22,10 +22,10 @@
<!--select="com.adc.da.slrs.wgDept.dao.WgDeptDao.researchDatas"/>-->
<!--<association property="wgNetInfos" javaType="java.util.List" column="id"-->
<!--select="com.adc.da.slrs.wgNetInfo.dao.WgNetInfoDao.researchDatas"/>-->
<association property="wgMeetingInfos" javaType="java.util.List" column="id"
select="com.adc.da.slrs.wgMeetingInfo.dao.WgMeetingInfoDao.researchDatas"/>
<association property="children" javaType="java.util.List" column="id"
select="researchDownLevel"/>
<!--<association property="wgMeetingInfos" javaType="java.util.List" column="id"-->
<!--select="com.adc.da.slrs.wgMeetingInfo.dao.WgMeetingInfoDao.researchDatas"/>-->
<!--<association property="children" javaType="java.util.List" column="id"-->
<!--select="researchDownLevel"/>-->
</resultMap>
@@ -45,7 +45,7 @@
select * from wg_work_group where wg_work_group.pid = #{data} and wg_work_group.status = #{status}
</select>
<select id="researchAllData" resultType="com.adc.da.slrs.wgWorkGroup.entity.WgWorkGroupShowDTO">
<select id="researchAllData" resultMap="WgWorkGroups">
select * from wg_work_group where wg_work_group.type =#{type}
</select>