岗位:操作时间,机构:委员会编辑,项目合规:查询
This commit is contained in:
@@ -1,26 +1,29 @@
|
||||
package com.adc.da.slrs.wgCommittee.dao;
|
||||
|
||||
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准委员会 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-10
|
||||
*/
|
||||
public interface WgCommitteeDao extends BaseMapper<WgCommittee> {
|
||||
|
||||
List<WgCommitteeDTO> getData(WgCommittee wgCommittee);
|
||||
Integer getDataCount(WgCommittee wgCommittee);
|
||||
|
||||
List<WgCommitteeDTO> getDataWk(WgCommittee wgCommittee);
|
||||
Integer getDataCountWk(WgCommittee wgCommittee);
|
||||
|
||||
}
|
||||
package com.adc.da.slrs.wgCommittee.dao;
|
||||
|
||||
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准委员会 Mapper 接口
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-10
|
||||
*/
|
||||
public interface WgCommitteeDao extends BaseMapper<WgCommittee> {
|
||||
|
||||
List<WgCommitteeDTO> getData(WgCommittee wgCommittee);
|
||||
Integer getDataCount(WgCommittee wgCommittee);
|
||||
|
||||
List<WgCommitteeDTO> getDataWk(WgCommittee wgCommittee);
|
||||
Integer getDataCountWk(WgCommittee wgCommittee);
|
||||
|
||||
String selectCommittor(@Param("str") List<String> str);
|
||||
|
||||
}
|
||||
|
||||
+100
-93
@@ -1,93 +1,100 @@
|
||||
package com.adc.da.slrs.wgCommittee.service.impl;
|
||||
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||
import com.adc.da.slrs.wgCommittee.dao.WgCommitteeDao;
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||
import com.adc.da.slrs.wgCommittee.service.IWgCommitteeService;
|
||||
import com.adc.da.slrs.wgCommitteeUser.entity.WgCommitteeUser;
|
||||
import com.adc.da.slrs.wgCommitteeUser.service.IWgCommitteeUserService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准委员会 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-10
|
||||
*/
|
||||
@Service
|
||||
public class WgCommitteeServiceImpl extends ServiceImpl<WgCommitteeDao, WgCommittee> implements IWgCommitteeService {
|
||||
|
||||
@Autowired
|
||||
IWgCommitteeUserService iWgCommitteeUserService;
|
||||
@Autowired
|
||||
IWgCommitteeService iWgCommitteeService;
|
||||
@Autowired
|
||||
WgCommitteeDao wgCommitteeDao;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean add(WgCommittee wgCommittee) {
|
||||
wgCommittee.setId(String.valueOf(UUID.randomUUID()));
|
||||
String id=String.valueOf(UUID.randomUUID());
|
||||
wgCommittee.setCommitteer(id);
|
||||
List<WgCommitteeUser> list=new ArrayList<>();
|
||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()) {
|
||||
List<String> res=new ArrayList<>(Arrays.asList(wgCommittee.getCommitteeIds().split(",")));
|
||||
res.stream().forEach(s -> list.add(new WgCommitteeUser().setCommitterId(s).setId(wgCommittee.getCommitteer())));
|
||||
iWgCommitteeUserService.saveOrUpdateBatch(list);
|
||||
}
|
||||
if (iWgCommitteeService.saveOrUpdate(wgCommittee)) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean update(WgCommittee wgCommittee) {
|
||||
iWgCommitteeService.updateById(wgCommittee);
|
||||
List<WgCommitteeUser> save=new ArrayList<>();
|
||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()){
|
||||
List<String> res=new ArrayList<>(Arrays.asList(wgCommittee.getCommitteeIds().split(",")));
|
||||
res.forEach(s -> save.add(new WgCommitteeUser().setId(wgCommittee.getCommitteer()).setCommitterId(s)));
|
||||
}
|
||||
if (iWgCommitteeUserService.updateBatchById(save)) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WgCommitteeDTO> getWgCommittee(WgCommittee wgCommittee) {
|
||||
Page page=new Page();
|
||||
page.setRecords(wgCommitteeDao.getData(wgCommittee));
|
||||
page.setCurrent(wgCommittee.getPage());
|
||||
page.setSize(wgCommittee.getPageSize());
|
||||
page.setTotal(wgCommitteeDao.getDataCount(wgCommittee));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WgCommitteeDTO> getWgCommitteeWk(WgCommittee wgCommittee) {
|
||||
Page page=new Page();
|
||||
page.setRecords(wgCommitteeDao.getDataWk(wgCommittee));
|
||||
page.setCurrent(wgCommittee.getPage());
|
||||
page.setSize(wgCommittee.getPageSize());
|
||||
page.setTotal(wgCommitteeDao.getDataCountWk(wgCommittee));
|
||||
return page;
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.wgCommittee.service.impl;
|
||||
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommittee;
|
||||
import com.adc.da.slrs.wgCommittee.dao.WgCommitteeDao;
|
||||
import com.adc.da.slrs.wgCommittee.entity.WgCommitteeDTO;
|
||||
import com.adc.da.slrs.wgCommittee.service.IWgCommitteeService;
|
||||
import com.adc.da.slrs.wgCommitteeUser.entity.WgCommitteeUser;
|
||||
import com.adc.da.slrs.wgCommitteeUser.service.IWgCommitteeUserService;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 标准委员会 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author yzh
|
||||
* @since 2022-03-10
|
||||
*/
|
||||
@Service
|
||||
public class WgCommitteeServiceImpl extends ServiceImpl<WgCommitteeDao, WgCommittee> implements IWgCommitteeService {
|
||||
|
||||
@Autowired
|
||||
IWgCommitteeUserService iWgCommitteeUserService;
|
||||
@Autowired
|
||||
IWgCommitteeService iWgCommitteeService;
|
||||
@Autowired
|
||||
WgCommitteeDao wgCommitteeDao;
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean add(WgCommittee wgCommittee) {
|
||||
wgCommittee.setId(String.valueOf(UUID.randomUUID()));
|
||||
String id=String.valueOf(UUID.randomUUID());
|
||||
wgCommittee.setCommitteer(id);
|
||||
List<WgCommitteeUser> list=new ArrayList<>();
|
||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()) {
|
||||
List<String> res=new ArrayList<>(Arrays.asList(wgCommittee.getCommitteeIds().split(",")));
|
||||
res.stream().forEach(s -> list.add(new WgCommitteeUser().setCommitterId(s).setId(wgCommittee.getCommitteer())));
|
||||
iWgCommitteeUserService.saveOrUpdateBatch(list);
|
||||
}
|
||||
if (iWgCommitteeService.saveOrUpdate(wgCommittee)) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public boolean update(WgCommittee wgCommittee) {
|
||||
iWgCommitteeService.updateById(wgCommittee);
|
||||
List<WgCommitteeUser> save=new ArrayList<>();
|
||||
if (null!=wgCommittee.getCommitteeIds() && !wgCommittee.getCommitteeIds().isEmpty()){
|
||||
List<String> res=new ArrayList<>(Arrays.asList(wgCommittee.getCommitteeIds()));
|
||||
res.forEach(s ->
|
||||
save.add(new WgCommitteeUser().setId(wgCommittee.getCommitteer()).setCommitterId(s))
|
||||
);
|
||||
}
|
||||
if (iWgCommitteeUserService.updateBatchById(save)) {
|
||||
return true;
|
||||
}else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WgCommitteeDTO> getWgCommittee(WgCommittee wgCommittee) {
|
||||
Page page=new Page();
|
||||
List<WgCommitteeDTO> list = wgCommitteeDao.getData(wgCommittee);
|
||||
for (WgCommitteeDTO wgCommitteeDTO : list){
|
||||
List<String> str = Arrays.asList(wgCommitteeDTO.getCommittorId().split(","));
|
||||
wgCommitteeDTO.setCommittor(wgCommitteeDao.selectCommittor(str));
|
||||
}
|
||||
page.setRecords(list);
|
||||
page.setCurrent(wgCommittee.getPage());
|
||||
page.setSize(wgCommittee.getPageSize());
|
||||
page.setTotal(wgCommitteeDao.getDataCount(wgCommittee));
|
||||
return page;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPage<WgCommitteeDTO> getWgCommitteeWk(WgCommittee wgCommittee) {
|
||||
Page page=new Page();
|
||||
page.setRecords(wgCommitteeDao.getDataWk(wgCommittee));
|
||||
page.setCurrent(wgCommittee.getPage());
|
||||
page.setSize(wgCommittee.getPageSize());
|
||||
page.setTotal(wgCommitteeDao.getDataCountWk(wgCommittee));
|
||||
return page;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user