工作组导入

This commit is contained in:
11528
2022-03-24 09:47:06 +08:00
parent 9b2b957335
commit 3669a6e888
11 changed files with 1483 additions and 1431 deletions
@@ -1,146 +1,151 @@
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdAssocCost;
import com.adc.da.slrs.wgdCensusZ.dao.WgdAssocCostDao;
import com.adc.da.slrs.wgdCensusZ.entity.WgdCommiInfo;
import com.adc.da.slrs.wgdCensusZ.service.IWgdAssocCostService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.web.multipart.MultipartFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 协会费用信息统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdAssocCostServiceImpl extends ServiceImpl<WgdAssocCostDao, WgdAssocCost> implements IWgdAssocCostService {
@Autowired
WgdAssocCostDao wgdAssocCostDao;
@Autowired
IWgdAssocCostService iWgdAssocCostService;
@Override
public List<WgdAssocCost> selectAllAssocCosts() {
return wgdAssocCostDao.selectAllAssocCosts();
}
@Override
public List<WgdAssocCost> getAllWgdAssocCosts(WgdAssocCost page) {
Integer count = wgdAssocCostDao.getTotal();
page.getPager().setRowCount(count);
List<WgdAssocCost> wgdAssocCosts = wgdAssocCostDao.selectAll(page);
return wgdAssocCosts;
}
@Override
public List<WgdAssocCost> queryAllWgdAssocCosts(WgdAssocCost wgdAssocCost) {
Integer count = wgdAssocCostDao.getQueryTotal(wgdAssocCost);
wgdAssocCost.getPager().setRowCount(count);
List<WgdAssocCost> wgdAssocCosts = wgdAssocCostDao.queryAll(wgdAssocCost);
return wgdAssocCosts;
}
@Override
public WgdAssocCost getWgdAssocCostById(String id) {
return wgdAssocCostDao.selectOne(id);
}
@Override
public int updateWgdAssocCost(WgdAssocCost wgdAssocCost) {
return wgdAssocCostDao.updateOne(wgdAssocCost);
}
@Override
public int insertWgdAssocCost(WgdAssocCost wgdAssocCost) {
wgdAssocCost.setId(UUIDUtils.randomUUID(32));
return wgdAssocCostDao.insertOne(wgdAssocCost);
}
@Override
public int deleteWgdAssocCost(String id) {
return wgdAssocCostDao.deleteOne(id);
}
@Override
public int deleteWgdAssocCosts(String ids) {
String[] str = ids.split(",");
return wgdAssocCostDao.deleteBatch(str);
}
@Override
public List<WgdAssocCost> importAssocCosts(MultipartFile file, StringBuilder stringBuilder) {
List<WgdAssocCost> res= ExcelImportUtilByWk.readExcelpublic(WgdAssocCost.class,file);
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
int i=1;
for (WgdAssocCost wgdAssocCost: res) {
if (null == wgdAssocCost.getScName() || "".equals(wgdAssocCost.getScName())){
stringBuilder.append("第" + i + "行第1列协会名称-标委会填写不符合格式要求请检查;");
}
if (null == wgdAssocCost.getWgName() || "".equals(wgdAssocCost.getWgName())){
stringBuilder.append("第" + i + "行第3列协会名称-工作组填写不符合格式要求请检查;");
}
if (null == wgdAssocCost.getCostOutlay() || "".equals(wgdAssocCost.getCostOutlay())){
stringBuilder.append("第" + i + "行第6列费用列支填写不符合格式要求请检查;");
}
if (null == wgdAssocCost.getAnnualPayment() || "".equals(wgdAssocCost.getAnnualPayment())){
stringBuilder.append("第" + i + "行第7列每年缴费情况填写不符合格式要求请检查;");
}
i++;
}
QueryWrapper<WgdAssocCost> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdAssocCost.class, info -> !info.getColumn().equals("id"));
List<WgdAssocCost> wgdAssocCost=iWgdAssocCostService.list(queryWrapper);
List<WgdAssocCost> remove=new ArrayList<>();
wgdAssocCost.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
res.forEach(resAssoc->{
if (null == resAssoc.getScName() || "".equals(resAssoc.getScName())){
remove.add(resAssoc);
}
if (null == resAssoc.getWgName() || "".equals(resAssoc.getWgName())){
remove.add(resAssoc);
}
if (null == resAssoc.getCostOutlay() || "".equals(resAssoc.getCostOutlay())){
remove.add(resAssoc);
}
if (null == resAssoc.getAnnualPayment() || "".equals(resAssoc.getAnnualPayment())){
remove.add(resAssoc);
}
});
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdAssocCostService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}
}
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdAssocCost;
import com.adc.da.slrs.wgdCensusZ.dao.WgdAssocCostDao;
import com.adc.da.slrs.wgdCensusZ.entity.WgdCommiInfo;
import com.adc.da.slrs.wgdCensusZ.service.IWgdAssocCostService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
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.web.multipart.MultipartFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 协会费用信息统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdAssocCostServiceImpl extends ServiceImpl<WgdAssocCostDao, WgdAssocCost> implements IWgdAssocCostService {
@Autowired
WgdAssocCostDao wgdAssocCostDao;
@Autowired
IWgdAssocCostService iWgdAssocCostService;
@Override
public List<WgdAssocCost> selectAllAssocCosts() {
return wgdAssocCostDao.selectAllAssocCosts();
}
@Override
public List<WgdAssocCost> getAllWgdAssocCosts(WgdAssocCost page) {
Integer count = wgdAssocCostDao.getTotal();
page.getPager().setRowCount(count);
List<WgdAssocCost> wgdAssocCosts = wgdAssocCostDao.selectAll(page);
return wgdAssocCosts;
}
@Override
public List<WgdAssocCost> queryAllWgdAssocCosts(WgdAssocCost wgdAssocCost) {
Integer count = wgdAssocCostDao.getQueryTotal(wgdAssocCost);
wgdAssocCost.getPager().setRowCount(count);
List<WgdAssocCost> wgdAssocCosts = wgdAssocCostDao.queryAll(wgdAssocCost);
return wgdAssocCosts;
}
@Override
public WgdAssocCost getWgdAssocCostById(String id) {
return wgdAssocCostDao.selectOne(id);
}
@Override
public int updateWgdAssocCost(WgdAssocCost wgdAssocCost) {
return wgdAssocCostDao.updateOne(wgdAssocCost);
}
@Override
public int insertWgdAssocCost(WgdAssocCost wgdAssocCost) {
wgdAssocCost.setId(UUIDUtils.randomUUID(32));
return wgdAssocCostDao.insertOne(wgdAssocCost);
}
@Override
public int deleteWgdAssocCost(String id) {
return wgdAssocCostDao.deleteOne(id);
}
@Override
public int deleteWgdAssocCosts(String ids) {
String[] str = ids.split(",");
return wgdAssocCostDao.deleteBatch(str);
}
@Override
public List<WgdAssocCost> importAssocCosts(MultipartFile file, StringBuilder stringBuilder) {
List<WgdAssocCost> res= ExcelImportUtilByWk.readExcelpublic(WgdAssocCost.class,file);
if (res != null){
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
int i=1;
for (WgdAssocCost wgdAssocCost: res) {
if (null == wgdAssocCost.getScName() || "".equals(wgdAssocCost.getScName())){
stringBuilder.append("第" + i + "行第1列协会名称-标委会填写不符合格式要求请检查;");
}
if (null == wgdAssocCost.getWgName() || "".equals(wgdAssocCost.getWgName())){
stringBuilder.append("第" + i + "行第3列协会名称-工作组填写不符合格式要求请检查;");
}
if (null == wgdAssocCost.getCostOutlay() || "".equals(wgdAssocCost.getCostOutlay())){
stringBuilder.append("第" + i + "行第6列费用列支填写不符合格式要求请检查;");
}
if (null == wgdAssocCost.getAnnualPayment() || "".equals(wgdAssocCost.getAnnualPayment())){
stringBuilder.append("第" + i + "行第7列每年缴费情况填写不符合格式要求请检查;");
}
i++;
}
QueryWrapper<WgdAssocCost> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdAssocCost.class, info -> !info.getColumn().equals("id"));
List<WgdAssocCost> wgdAssocCost=iWgdAssocCostService.list(queryWrapper);
List<WgdAssocCost> remove=new ArrayList<>();
wgdAssocCost.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
res.forEach(resAssoc->{
if (null == resAssoc.getScName() || "".equals(resAssoc.getScName())){
remove.add(resAssoc);
}
if (null == resAssoc.getWgName() || "".equals(resAssoc.getWgName())){
remove.add(resAssoc);
}
if (null == resAssoc.getCostOutlay() || "".equals(resAssoc.getCostOutlay())){
remove.add(resAssoc);
}
if (null == resAssoc.getAnnualPayment() || "".equals(resAssoc.getAnnualPayment())){
remove.add(resAssoc);
}
});
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdAssocCostService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}else {
return null;
}
}
}
@@ -1,162 +1,167 @@
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.entity.importExcelDTO;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdAssocInfo;
import com.adc.da.slrs.wgdCensusZ.dao.WgdAssocInfoDao;
import com.adc.da.slrs.wgdCensusZ.service.IWgdAssocInfoService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 协会信息数据统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdAssocInfoServiceImpl extends ServiceImpl<WgdAssocInfoDao, WgdAssocInfo> implements IWgdAssocInfoService {
@Autowired
WgdAssocInfoDao wgdAssocInfoDao;
@Autowired
IWgdAssocInfoService iWgdAssocInfoService;
@Override
public List<WgdAssocInfo> getAllWgdAssocInfos() {
return wgdAssocInfoDao.selectAll();
}
@Override
public List<WgdAssocInfo> queryAllWgdAssocInfos(WgdAssocInfo wgdAssocInfo) {
Integer count = wgdAssocInfoDao.getQueryTotal(wgdAssocInfo);
wgdAssocInfo.getPager().setRowCount(count);
return wgdAssocInfoDao.queryAll(wgdAssocInfo);
}
@Override
public WgdAssocInfo getWgdAssocInfoById(String id) {
return wgdAssocInfoDao.selectById(id);
}
@Override
public int updateWgdAssocInfo(WgdAssocInfo wgdAssocInfo) {
return wgdAssocInfoDao.updateOne(wgdAssocInfo);
}
@Override
public int insertWgdAssocInfo(WgdAssocInfo wgdAssocInfo) {
wgdAssocInfo.setId(UUIDUtils.randomUUID(32));
return wgdAssocInfoDao.insertOne(wgdAssocInfo);
}
@Override
public int deleteWgdAssocInfo(String id) {
return wgdAssocInfoDao.deleteOne(id);
}
@Override
public int deleteWgdAssocInfos(String ids) {
String[] str = ids.split(",");
return wgdAssocInfoDao.deleteBatch(str);
}
@Override
public List<WgdAssocInfo> delWithWkData(MultipartFile file, StringBuilder stringBuilder) {
List<WgdAssocInfo> res= ExcelImportUtilByWk.readExcelpublic(WgdAssocInfo.class,file);
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
int i=1;
for (WgdAssocInfo importExcelDTO: res) {
if (null == importExcelDTO.getScName() || "".equals(importExcelDTO.getScName())){
stringBuilder.append("第" + i + "行第1列协会名称-标委会填写不符合格式要求请检查;");
}
if (null == importExcelDTO.getSscName() || "".equals(importExcelDTO.getSscName())){
stringBuilder.append("第" + i + "行第2列协会名称-分标委填写不符合格式要求请检查;");
}
if (null == importExcelDTO.getWgName() || "".equals(importExcelDTO.getWgName())){
stringBuilder.append("第" + i + "行第3列协会名称-工作组填写不符合格式要求请检查;");
}
if (null == importExcelDTO.getRole() || "".equals(importExcelDTO.getRole())){
stringBuilder.append("第" + i + "行第4列会员角色填写不符合格式要求请检查;");
}
if (null == importExcelDTO.getAttend() || "".equals(importExcelDTO.getAttend())){
stringBuilder.append("第" + i + "行第5列参与人填写不符合格式要求请检查;");
}
try {
if (null!=importExcelDTO.getIniTime() && !"".equals(importExcelDTO.getIniTime())) {
importExcelDTO.setIniTime(importExcelDTO.getIniTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第9列初始入会时间填写不符合格式要求请检查;");
}
try {
if (null!=importExcelDTO.getCurTime() && !"".equals(importExcelDTO.getCurTime())) {
importExcelDTO.setCurTime(importExcelDTO.getCurTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第10列本届入会时间填写不符合格式要求请检查;");
}
try {
if (null!=importExcelDTO.getLastPayTime() && !"".equals(importExcelDTO.getLastPayTime())) {
importExcelDTO.setLastPayTime(importExcelDTO.getLastPayTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第13列上次缴纳时间填写不符合格式要求请检查;");
}
i++;
}
QueryWrapper<WgdAssocInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdAssocInfo.class, info -> !info.getColumn().equals("id"));
List<WgdAssocInfo> wgdAssocInfos=iWgdAssocInfoService.list(queryWrapper);
List<WgdAssocInfo> remove=new ArrayList<>();
wgdAssocInfos.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
res.forEach(resOne->{
if (null == resOne.getScName() || "".equals(resOne.getScName())){
remove.add(resOne);
}
if (null == resOne.getSscName() || "".equals(resOne.getSscName())){
remove.add(resOne);
}
if (null == resOne.getWgName() || "".equals(resOne.getWgName())){
remove.add(resOne);
}
if (null == resOne.getRole() || "".equals(resOne.getRole())){
remove.add(resOne);
}
if (null == resOne.getAttend() || "".equals(resOne.getAttend())){
remove.add(resOne);
}
});
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdAssocInfoService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}
}
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.entity.importExcelDTO;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdAssocInfo;
import com.adc.da.slrs.wgdCensusZ.dao.WgdAssocInfoDao;
import com.adc.da.slrs.wgdCensusZ.service.IWgdAssocInfoService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 协会信息数据统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdAssocInfoServiceImpl extends ServiceImpl<WgdAssocInfoDao, WgdAssocInfo> implements IWgdAssocInfoService {
@Autowired
WgdAssocInfoDao wgdAssocInfoDao;
@Autowired
IWgdAssocInfoService iWgdAssocInfoService;
@Override
public List<WgdAssocInfo> getAllWgdAssocInfos() {
return wgdAssocInfoDao.selectAll();
}
@Override
public List<WgdAssocInfo> queryAllWgdAssocInfos(WgdAssocInfo wgdAssocInfo) {
Integer count = wgdAssocInfoDao.getQueryTotal(wgdAssocInfo);
wgdAssocInfo.getPager().setRowCount(count);
return wgdAssocInfoDao.queryAll(wgdAssocInfo);
}
@Override
public WgdAssocInfo getWgdAssocInfoById(String id) {
return wgdAssocInfoDao.selectById(id);
}
@Override
public int updateWgdAssocInfo(WgdAssocInfo wgdAssocInfo) {
return wgdAssocInfoDao.updateOne(wgdAssocInfo);
}
@Override
public int insertWgdAssocInfo(WgdAssocInfo wgdAssocInfo) {
wgdAssocInfo.setId(UUIDUtils.randomUUID(32));
return wgdAssocInfoDao.insertOne(wgdAssocInfo);
}
@Override
public int deleteWgdAssocInfo(String id) {
return wgdAssocInfoDao.deleteOne(id);
}
@Override
public int deleteWgdAssocInfos(String ids) {
String[] str = ids.split(",");
return wgdAssocInfoDao.deleteBatch(str);
}
@Override
public List<WgdAssocInfo> delWithWkData(MultipartFile file, StringBuilder stringBuilder) {
List<WgdAssocInfo> res= ExcelImportUtilByWk.readExcelpublic(WgdAssocInfo.class,file);
if (res != null){
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
int i=1;
for (WgdAssocInfo importExcelDTO: res) {
if (null == importExcelDTO.getScName() || "".equals(importExcelDTO.getScName())){
stringBuilder.append("第" + i + "行第1列协会名称-标委会填写不符合格式要求请检查;");
}
if (null == importExcelDTO.getSscName() || "".equals(importExcelDTO.getSscName())){
stringBuilder.append("第" + i + "行第2列协会名称-分标委填写不符合格式要求请检查;");
}
if (null == importExcelDTO.getWgName() || "".equals(importExcelDTO.getWgName())){
stringBuilder.append("第" + i + "行第3列协会名称-工作组填写不符合格式要求请检查;");
}
if (null == importExcelDTO.getRole() || "".equals(importExcelDTO.getRole())){
stringBuilder.append("第" + i + "行第4列会员角色填写不符合格式要求请检查;");
}
if (null == importExcelDTO.getAttend() || "".equals(importExcelDTO.getAttend())){
stringBuilder.append("第" + i + "行第5列参与人填写不符合格式要求请检查;");
}
try {
if (null!=importExcelDTO.getIniTime() && !"".equals(importExcelDTO.getIniTime())) {
importExcelDTO.setIniTime(importExcelDTO.getIniTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第9列初始入会时间填写不符合格式要求请检查;");
}
try {
if (null!=importExcelDTO.getCurTime() && !"".equals(importExcelDTO.getCurTime())) {
importExcelDTO.setCurTime(importExcelDTO.getCurTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第10列本届入会时间填写不符合格式要求请检查;");
}
try {
if (null!=importExcelDTO.getLastPayTime() && !"".equals(importExcelDTO.getLastPayTime())) {
importExcelDTO.setLastPayTime(importExcelDTO.getLastPayTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第13列上次缴纳时间填写不符合格式要求请检查;");
}
i++;
}
QueryWrapper<WgdAssocInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdAssocInfo.class, info -> !info.getColumn().equals("id"));
List<WgdAssocInfo> wgdAssocInfos=iWgdAssocInfoService.list(queryWrapper);
List<WgdAssocInfo> remove=new ArrayList<>();
wgdAssocInfos.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
res.forEach(resOne->{
if (null == resOne.getScName() || "".equals(resOne.getScName())){
remove.add(resOne);
}
if (null == resOne.getSscName() || "".equals(resOne.getSscName())){
remove.add(resOne);
}
if (null == resOne.getWgName() || "".equals(resOne.getWgName())){
remove.add(resOne);
}
if (null == resOne.getRole() || "".equals(resOne.getRole())){
remove.add(resOne);
}
if (null == resOne.getAttend() || "".equals(resOne.getAttend())){
remove.add(resOne);
}
});
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdAssocInfoService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}else {
return null;
}
}
}
@@ -1,155 +1,160 @@
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdAssocInfo;
import com.adc.da.slrs.wgdCensusZ.entity.WgdCommiInfo;
import com.adc.da.slrs.wgdCensusZ.dao.WgdCommiInfoDao;
import com.adc.da.slrs.wgdCensusZ.service.IWgdCommiInfoService;
import com.adc.da.util.MD5Util;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 委员信息数据统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdCommiInfoServiceImpl extends ServiceImpl<WgdCommiInfoDao, WgdCommiInfo> implements IWgdCommiInfoService {
@Autowired
WgdCommiInfoDao wgdCommiInfoDao;
@Autowired
IWgdCommiInfoService iWgdCommiInfoService;
@Override
public List<WgdCommiInfo> getAllWgdCommiInfos() {
return wgdCommiInfoDao.selectAll();
}
@Override
public List<WgdCommiInfo> queryAllWgdCommiInfos(WgdCommiInfo wgdCommiInfo) {
Integer count = wgdCommiInfoDao.getQueryTotal(wgdCommiInfo);
wgdCommiInfo.getPager().setRowCount(count);
return wgdCommiInfoDao.queryAll(wgdCommiInfo);
}
@Override
public WgdCommiInfo getWgdCommiInfoById(String id) {
return wgdCommiInfoDao.selectById(id);
}
@Override
public int updateWgdCommiInfo(WgdCommiInfo wgdCommiInfo) {
wgdCommiInfo.setPassword(MD5Util.convertMD5(wgdCommiInfo.getPassword()));
return wgdCommiInfoDao.updateOne(wgdCommiInfo);
}
@Override
public int insertWgdCommiInfo(WgdCommiInfo wgdCommiInfo) {
wgdCommiInfo.setId(UUIDUtils.randomUUID(32));
wgdCommiInfo.setPassword(MD5Util.convertMD5(wgdCommiInfo.getPassword()));
return wgdCommiInfoDao.insertOne(wgdCommiInfo);
}
@Override
public int deleteWgdCommiInfo(String id) {
return wgdCommiInfoDao.deleteOne(id);
}
@Override
public int deleteWgdCommiInfos(String ids) {
String[] str = ids.split(",");
return wgdCommiInfoDao.deleteBatch(str);
}
@Override
public List<WgdCommiInfo> importCommiInfo(MultipartFile file, StringBuilder stringBuilder) {
List<WgdCommiInfo> res= ExcelImportUtilByWk.readExcelpublic(WgdCommiInfo.class,file);
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
int i=1;
for (WgdCommiInfo wgdCommiInfo: res) {
if (null == wgdCommiInfo.getScName() || "".equals(wgdCommiInfo.getScName())){
stringBuilder.append("第" + i + "行第2列协会名称-标委会填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getSscName() || "".equals(wgdCommiInfo.getSscName())){
stringBuilder.append("第" + i + "行第3列协会名称-分标委填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getWgName() || "".equals(wgdCommiInfo.getWgName())){
stringBuilder.append("第" + i + "行第4列协会名称-工作组填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getRole() || "".equals(wgdCommiInfo.getRole())){
stringBuilder.append("第" + i + "行第6列会员角色填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getAttend() || "".equals(wgdCommiInfo.getAttend())){
stringBuilder.append("第" + i + "行第7列参与人填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getTel() || "".equals(wgdCommiInfo.getTel())){
stringBuilder.append("第" + i + "行第10列参与人填写不符合格式要求请检查;");
}
try {
if (null!=wgdCommiInfo.getCurTime() && !"".equals(wgdCommiInfo.getCurTime())) {
wgdCommiInfo.setCurTime(wgdCommiInfo.getCurTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第5列本届入会时间填写不符合格式要求请检查;");
}
i++;
}
QueryWrapper<WgdCommiInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdCommiInfo.class, info -> !info.getColumn().equals("id"));
List<WgdCommiInfo> wgdCommiInfo=iWgdCommiInfoService.list(queryWrapper);
List<WgdCommiInfo> remove=new ArrayList<>();
wgdCommiInfo.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
res.forEach(resCommiInfo->{
if (null == resCommiInfo.getScName() || "".equals(resCommiInfo.getScName())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getSscName() || "".equals(resCommiInfo.getSscName())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getWgName() || "".equals(resCommiInfo.getWgName())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getRole() || "".equals(resCommiInfo.getRole())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getAttend() || "".equals(resCommiInfo.getAttend())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getTel() || "".equals(resCommiInfo.getTel())){
remove.add(resCommiInfo);
}
});
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdCommiInfoService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}
}
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdAssocInfo;
import com.adc.da.slrs.wgdCensusZ.entity.WgdCommiInfo;
import com.adc.da.slrs.wgdCensusZ.dao.WgdCommiInfoDao;
import com.adc.da.slrs.wgdCensusZ.service.IWgdCommiInfoService;
import com.adc.da.util.MD5Util;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 委员信息数据统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdCommiInfoServiceImpl extends ServiceImpl<WgdCommiInfoDao, WgdCommiInfo> implements IWgdCommiInfoService {
@Autowired
WgdCommiInfoDao wgdCommiInfoDao;
@Autowired
IWgdCommiInfoService iWgdCommiInfoService;
@Override
public List<WgdCommiInfo> getAllWgdCommiInfos() {
return wgdCommiInfoDao.selectAll();
}
@Override
public List<WgdCommiInfo> queryAllWgdCommiInfos(WgdCommiInfo wgdCommiInfo) {
Integer count = wgdCommiInfoDao.getQueryTotal(wgdCommiInfo);
wgdCommiInfo.getPager().setRowCount(count);
return wgdCommiInfoDao.queryAll(wgdCommiInfo);
}
@Override
public WgdCommiInfo getWgdCommiInfoById(String id) {
return wgdCommiInfoDao.selectById(id);
}
@Override
public int updateWgdCommiInfo(WgdCommiInfo wgdCommiInfo) {
wgdCommiInfo.setPassword(MD5Util.convertMD5(wgdCommiInfo.getPassword()));
return wgdCommiInfoDao.updateOne(wgdCommiInfo);
}
@Override
public int insertWgdCommiInfo(WgdCommiInfo wgdCommiInfo) {
wgdCommiInfo.setId(UUIDUtils.randomUUID(32));
wgdCommiInfo.setPassword(MD5Util.convertMD5(wgdCommiInfo.getPassword()));
return wgdCommiInfoDao.insertOne(wgdCommiInfo);
}
@Override
public int deleteWgdCommiInfo(String id) {
return wgdCommiInfoDao.deleteOne(id);
}
@Override
public int deleteWgdCommiInfos(String ids) {
String[] str = ids.split(",");
return wgdCommiInfoDao.deleteBatch(str);
}
@Override
public List<WgdCommiInfo> importCommiInfo(MultipartFile file, StringBuilder stringBuilder) {
List<WgdCommiInfo> res= ExcelImportUtilByWk.readExcelpublic(WgdCommiInfo.class,file);
if (res != null){
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
int i=1;
for (WgdCommiInfo wgdCommiInfo: res) {
if (null == wgdCommiInfo.getScName() || "".equals(wgdCommiInfo.getScName())){
stringBuilder.append("第" + i + "行第2列协会名称-标委会填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getSscName() || "".equals(wgdCommiInfo.getSscName())){
stringBuilder.append("第" + i + "行第3列协会名称-分标委填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getWgName() || "".equals(wgdCommiInfo.getWgName())){
stringBuilder.append("第" + i + "行第4列协会名称-工作组填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getRole() || "".equals(wgdCommiInfo.getRole())){
stringBuilder.append("第" + i + "行第6列会员角色填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getAttend() || "".equals(wgdCommiInfo.getAttend())){
stringBuilder.append("第" + i + "行第7列参与人填写不符合格式要求请检查;");
}
if (null == wgdCommiInfo.getTel() || "".equals(wgdCommiInfo.getTel())){
stringBuilder.append("第" + i + "行第10列参与人填写不符合格式要求请检查;");
}
try {
if (null!=wgdCommiInfo.getCurTime() && !"".equals(wgdCommiInfo.getCurTime())) {
wgdCommiInfo.setCurTime(wgdCommiInfo.getCurTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第5列本届入会时间填写不符合格式要求请检查;");
}
i++;
}
QueryWrapper<WgdCommiInfo> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdCommiInfo.class, info -> !info.getColumn().equals("id"));
List<WgdCommiInfo> wgdCommiInfo=iWgdCommiInfoService.list(queryWrapper);
List<WgdCommiInfo> remove=new ArrayList<>();
wgdCommiInfo.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
res.forEach(resCommiInfo->{
if (null == resCommiInfo.getScName() || "".equals(resCommiInfo.getScName())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getSscName() || "".equals(resCommiInfo.getSscName())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getWgName() || "".equals(resCommiInfo.getWgName())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getRole() || "".equals(resCommiInfo.getRole())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getAttend() || "".equals(resCommiInfo.getAttend())){
remove.add(resCommiInfo);
}
if (null == resCommiInfo.getTel() || "".equals(resCommiInfo.getTel())){
remove.add(resCommiInfo);
}
});
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdCommiInfoService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}else {
return null;
}
}
}
@@ -1,102 +1,106 @@
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdCommiInfo;
import com.adc.da.slrs.wgdCensusZ.entity.WgdExReviseCost;
import com.adc.da.slrs.wgdCensusZ.dao.WgdExReviseCostDao;
import com.adc.da.slrs.wgdCensusZ.service.IWgdExReviseCostService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 参与外部标准制修订费用统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdExReviseCostServiceImpl extends ServiceImpl<WgdExReviseCostDao, WgdExReviseCost> implements IWgdExReviseCostService {
@Autowired
WgdExReviseCostDao wgdExReviseCostDao;
@Autowired
IWgdExReviseCostService iWgdExReviseCostService;
@Override
public List<WgdExReviseCost> getAllWgdExReviseCosts() {
return wgdExReviseCostDao.selectAll();
}
@Override
public List<WgdExReviseCost> queryAllWgdExReviseCosts(WgdExReviseCost wgdExReviseCost) {
Integer count = wgdExReviseCostDao.getQueryTotal(wgdExReviseCost);
wgdExReviseCost.getPager().setRowCount(count);
return wgdExReviseCostDao.queryAll(wgdExReviseCost);
}
@Override
public WgdExReviseCost getWgdExReviseCostById(String id) {
return wgdExReviseCostDao.selectById(id);
}
@Override
public int updateWgdExReviseCost(WgdExReviseCost wgdExReviseCost) {
return wgdExReviseCostDao.updateOne(wgdExReviseCost);
}
@Override
public int insertWgdExReviseCost(WgdExReviseCost wgdExReviseCost) {
wgdExReviseCost.setId(UUIDUtils.randomUUID(32));
return wgdExReviseCostDao.insertOne(wgdExReviseCost);
}
@Override
public int deleteWgdExReviseCost(String id) {
return wgdExReviseCostDao.deleteOne(id);
}
@Override
public int deleteWgdExReviseCosts(String ids) {
String[] str = ids.split(",");
return wgdExReviseCostDao.deleteBatch(str);
}
@Override
public List<WgdExReviseCost> importExReviseCost(MultipartFile file, StringBuilder stringBuilder) {
List<WgdExReviseCost> res= ExcelImportUtilByWk.readExcelpublic(WgdExReviseCost.class,file);
QueryWrapper<WgdExReviseCost> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdExReviseCost.class, info -> !info.getColumn().equals("id"));
List<WgdExReviseCost> wgdExReviseCost=iWgdExReviseCostService.list(queryWrapper);
List<WgdExReviseCost> remove=new ArrayList<>();
wgdExReviseCost.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdExReviseCostService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}
}
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdCommiInfo;
import com.adc.da.slrs.wgdCensusZ.entity.WgdExReviseCost;
import com.adc.da.slrs.wgdCensusZ.dao.WgdExReviseCostDao;
import com.adc.da.slrs.wgdCensusZ.service.IWgdExReviseCostService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 参与外部标准制修订费用统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdExReviseCostServiceImpl extends ServiceImpl<WgdExReviseCostDao, WgdExReviseCost> implements IWgdExReviseCostService {
@Autowired
WgdExReviseCostDao wgdExReviseCostDao;
@Autowired
IWgdExReviseCostService iWgdExReviseCostService;
@Override
public List<WgdExReviseCost> getAllWgdExReviseCosts() {
return wgdExReviseCostDao.selectAll();
}
@Override
public List<WgdExReviseCost> queryAllWgdExReviseCosts(WgdExReviseCost wgdExReviseCost) {
Integer count = wgdExReviseCostDao.getQueryTotal(wgdExReviseCost);
wgdExReviseCost.getPager().setRowCount(count);
return wgdExReviseCostDao.queryAll(wgdExReviseCost);
}
@Override
public WgdExReviseCost getWgdExReviseCostById(String id) {
return wgdExReviseCostDao.selectById(id);
}
@Override
public int updateWgdExReviseCost(WgdExReviseCost wgdExReviseCost) {
return wgdExReviseCostDao.updateOne(wgdExReviseCost);
}
@Override
public int insertWgdExReviseCost(WgdExReviseCost wgdExReviseCost) {
wgdExReviseCost.setId(UUIDUtils.randomUUID(32));
return wgdExReviseCostDao.insertOne(wgdExReviseCost);
}
@Override
public int deleteWgdExReviseCost(String id) {
return wgdExReviseCostDao.deleteOne(id);
}
@Override
public int deleteWgdExReviseCosts(String ids) {
String[] str = ids.split(",");
return wgdExReviseCostDao.deleteBatch(str);
}
@Override
public List<WgdExReviseCost> importExReviseCost(MultipartFile file, StringBuilder stringBuilder) {
List<WgdExReviseCost> res= ExcelImportUtilByWk.readExcelpublic(WgdExReviseCost.class,file);
if (res != null){
QueryWrapper<WgdExReviseCost> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdExReviseCost.class, info -> !info.getColumn().equals("id"));
List<WgdExReviseCost> wgdExReviseCost=iWgdExReviseCostService.list(queryWrapper);
List<WgdExReviseCost> remove=new ArrayList<>();
wgdExReviseCost.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdExReviseCostService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}else {
return null;
}
}
}
@@ -1,115 +1,120 @@
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdCommiInfo;
import com.adc.da.slrs.wgdCensusZ.entity.WgdMeetCost;
import com.adc.da.slrs.wgdCensusZ.dao.WgdMeetCostDao;
import com.adc.da.slrs.wgdCensusZ.service.IWgdMeetCostService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 参会费用信息统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdMeetCostServiceImpl extends ServiceImpl<WgdMeetCostDao, WgdMeetCost> implements IWgdMeetCostService {
@Autowired
WgdMeetCostDao wgdMeetCostDao;
@Autowired
IWgdMeetCostService iWgdMeetCostService;
@Override
public List<WgdMeetCost> getAllWgdMeetCosts() {
return wgdMeetCostDao.selectAll();
}
@Override
public List<WgdMeetCost> queryAllWgdMeetCosts(WgdMeetCost wgdMeetCost) {
Integer count = wgdMeetCostDao.getQueryTotal(wgdMeetCost);
wgdMeetCost.getPager().setRowCount(count);
return wgdMeetCostDao.queryAll(wgdMeetCost);
}
@Override
public WgdMeetCost getWgdMeetCostById(String id) {
return wgdMeetCostDao.selectById(id);
}
@Override
public int updateWgdMeetCost(WgdMeetCost wgdMeetCost) {
return wgdMeetCostDao.updateOne(wgdMeetCost);
}
@Override
public int insertWgdMeetCost(WgdMeetCost wgdMeetCost) {
wgdMeetCost.setId(UUIDUtils.randomUUID(32));
return wgdMeetCostDao.insertOne(wgdMeetCost);
}
@Override
public int deleteWgdMeetCost(String id) {
return wgdMeetCostDao.deleteOne(id);
}
@Override
public int deleteWgdMeetCosts(String ids) {
String[] str = ids.split(",");
return wgdMeetCostDao.deleteBatch(str);
}
@Override
public List<WgdMeetCost> importMeetCost(MultipartFile file, StringBuilder stringBuilder) {
List<WgdMeetCost> res= ExcelImportUtilByWk.readExcelpublic(WgdMeetCost.class,file);
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
int i=1;
for (WgdMeetCost wgdCommiInfo: res) {
try {
if (null!=wgdCommiInfo.getMeetTime() && !"".equals(wgdCommiInfo.getMeetTime())) {
wgdCommiInfo.setMeetTime(wgdCommiInfo.getMeetTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第3列本届会议时间填写不符合格式要求请检查;");
}
i++;
}
QueryWrapper<WgdMeetCost> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdMeetCost.class, info -> !info.getColumn().equals("id"));
List<WgdMeetCost> wgdMeetCost=iWgdMeetCostService.list(queryWrapper);
List<WgdMeetCost> remove=new ArrayList<>();
wgdMeetCost.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdMeetCostService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}
}
package com.adc.da.slrs.wgdCensusZ.service.impl;
import com.adc.da.http.Result;
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
import com.adc.da.slrs.wgdCensusZ.entity.WgdCommiInfo;
import com.adc.da.slrs.wgdCensusZ.entity.WgdMeetCost;
import com.adc.da.slrs.wgdCensusZ.dao.WgdMeetCostDao;
import com.adc.da.slrs.wgdCensusZ.service.IWgdMeetCostService;
import com.adc.da.util.UUIDUtils;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
* <p>
* 参会费用信息统计 服务实现类
* </p>
*
* @author zcr
* @since 2021-11-12
*/
@Service
public class WgdMeetCostServiceImpl extends ServiceImpl<WgdMeetCostDao, WgdMeetCost> implements IWgdMeetCostService {
@Autowired
WgdMeetCostDao wgdMeetCostDao;
@Autowired
IWgdMeetCostService iWgdMeetCostService;
@Override
public List<WgdMeetCost> getAllWgdMeetCosts() {
return wgdMeetCostDao.selectAll();
}
@Override
public List<WgdMeetCost> queryAllWgdMeetCosts(WgdMeetCost wgdMeetCost) {
Integer count = wgdMeetCostDao.getQueryTotal(wgdMeetCost);
wgdMeetCost.getPager().setRowCount(count);
return wgdMeetCostDao.queryAll(wgdMeetCost);
}
@Override
public WgdMeetCost getWgdMeetCostById(String id) {
return wgdMeetCostDao.selectById(id);
}
@Override
public int updateWgdMeetCost(WgdMeetCost wgdMeetCost) {
return wgdMeetCostDao.updateOne(wgdMeetCost);
}
@Override
public int insertWgdMeetCost(WgdMeetCost wgdMeetCost) {
wgdMeetCost.setId(UUIDUtils.randomUUID(32));
return wgdMeetCostDao.insertOne(wgdMeetCost);
}
@Override
public int deleteWgdMeetCost(String id) {
return wgdMeetCostDao.deleteOne(id);
}
@Override
public int deleteWgdMeetCosts(String ids) {
String[] str = ids.split(",");
return wgdMeetCostDao.deleteBatch(str);
}
@Override
public List<WgdMeetCost> importMeetCost(MultipartFile file, StringBuilder stringBuilder) {
List<WgdMeetCost> res= ExcelImportUtilByWk.readExcelpublic(WgdMeetCost.class,file);
if (res != null){
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
int i=1;
for (WgdMeetCost wgdCommiInfo: res) {
try {
if (null!=wgdCommiInfo.getMeetTime() && !"".equals(wgdCommiInfo.getMeetTime())) {
wgdCommiInfo.setMeetTime(wgdCommiInfo.getMeetTime());
}
}catch (Exception e){
stringBuilder.append("第"+i+"行第3列本届会议时间填写不符合格式要求请检查;");
}
i++;
}
QueryWrapper<WgdMeetCost> queryWrapper = new QueryWrapper<>();
queryWrapper.select(WgdMeetCost.class, info -> !info.getColumn().equals("id"));
List<WgdMeetCost> wgdMeetCost=iWgdMeetCostService.list(queryWrapper);
List<WgdMeetCost> remove=new ArrayList<>();
wgdMeetCost.forEach(WgbWbtj -> {
WgbWbtj.setId(null);
if (res.contains(WgbWbtj)){
remove.add(WgbWbtj);
}
});
res.removeAll(remove);
res.forEach(wgdAssocInfo -> {
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
});
if (res.size()>0 && iWgdMeetCostService.saveOrUpdateBatch(res)) {
return res;
}else {
stringBuilder.append("表格数据全部重复");
}
return res;
}else {
return null;
}
}
}