工作组导入
This commit is contained in:
+106
-101
@@ -1,101 +1,106 @@
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdCgfy;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdCgfyDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdCgfyService;
|
||||
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.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采购费用信息统计 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdCgfyServiceImpl extends ServiceImpl<WgdCgfyDao, WgdCgfy> implements IWgdCgfyService {
|
||||
|
||||
@Autowired
|
||||
WgdCgfyDao wgdCgfyDao;
|
||||
|
||||
@Autowired
|
||||
IWgdCgfyService iWgdCgfyService;
|
||||
@Override
|
||||
public List<WgdCgfy> getAllWgdCgfys() {
|
||||
return wgdCgfyDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdCgfy> queryAllWgdCgfys(WgdCgfy wgdCgfy) {
|
||||
Integer count = wgdCgfyDao.getQueryTotal(wgdCgfy);
|
||||
wgdCgfy.getPager().setRowCount(count);
|
||||
return wgdCgfyDao.queryAll(wgdCgfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdCgfy getWgdCgfyById(String id) {
|
||||
return wgdCgfyDao.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdCgfy(WgdCgfy wgdCgfy) {
|
||||
return wgdCgfyDao.updateOne(wgdCgfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdCgfy(WgdCgfy wgdCgfy) {
|
||||
wgdCgfy.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdCgfyDao.insertOne(wgdCgfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdCgfy(String id) {
|
||||
return wgdCgfyDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdCgfys(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdCgfyDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdCgfy> importCgfy(MultipartFile file, StringBuilder stringBuilder) {
|
||||
|
||||
List<WgdCgfy> res= ExcelImportUtilByWk.readExcelpublic(WgdCgfy.class,file);
|
||||
|
||||
QueryWrapper<WgdCgfy> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdCgfy.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdCgfy> wgdCgfy=iWgdCgfyService.list(queryWrapper);
|
||||
List<WgdCgfy> remove=new ArrayList<>();
|
||||
wgdCgfy.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 && iWgdCgfyService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdCgfy;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdCgfyDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdCgfyService;
|
||||
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.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* 采购费用信息统计 服务实现类
|
||||
* </p>
|
||||
*
|
||||
* @author super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdCgfyServiceImpl extends ServiceImpl<WgdCgfyDao, WgdCgfy> implements IWgdCgfyService {
|
||||
|
||||
@Autowired
|
||||
WgdCgfyDao wgdCgfyDao;
|
||||
|
||||
@Autowired
|
||||
IWgdCgfyService iWgdCgfyService;
|
||||
@Override
|
||||
public List<WgdCgfy> getAllWgdCgfys() {
|
||||
return wgdCgfyDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdCgfy> queryAllWgdCgfys(WgdCgfy wgdCgfy) {
|
||||
Integer count = wgdCgfyDao.getQueryTotal(wgdCgfy);
|
||||
wgdCgfy.getPager().setRowCount(count);
|
||||
return wgdCgfyDao.queryAll(wgdCgfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdCgfy getWgdCgfyById(String id) {
|
||||
return wgdCgfyDao.selectById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdCgfy(WgdCgfy wgdCgfy) {
|
||||
return wgdCgfyDao.updateOne(wgdCgfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdCgfy(WgdCgfy wgdCgfy) {
|
||||
wgdCgfy.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdCgfyDao.insertOne(wgdCgfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdCgfy(String id) {
|
||||
return wgdCgfyDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdCgfys(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdCgfyDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdCgfy> importCgfy(MultipartFile file, StringBuilder stringBuilder) {
|
||||
|
||||
List<WgdCgfy> res= ExcelImportUtilByWk.readExcelpublic(WgdCgfy.class,file);
|
||||
if (res != null){
|
||||
QueryWrapper<WgdCgfy> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdCgfy.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdCgfy> wgdCgfy=iWgdCgfyService.list(queryWrapper);
|
||||
List<WgdCgfy> remove=new ArrayList<>();
|
||||
wgdCgfy.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 && iWgdCgfyService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+105
-101
@@ -1,101 +1,105 @@
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdFyfyDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdFyfy;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdFyfyService;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdFyfyServiceImpl extends ServiceImpl<WgdFyfyDao, WgdFyfy> implements IWgdFyfyService {
|
||||
|
||||
@Autowired
|
||||
WgdFyfyDao wgdFyfyDao;
|
||||
|
||||
@Autowired
|
||||
IWgdFyfyService iWgdFyfyService;
|
||||
|
||||
@Override
|
||||
public List<WgdFyfy> getAllWgdFyfys() {
|
||||
return wgdFyfyDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdFyfy> queryAllWgdFyfys(WgdFyfy wgdFyfy) {
|
||||
Integer count = wgdFyfyDao.getQueryTotal(wgdFyfy);
|
||||
wgdFyfy.getPager().setRowCount(count);
|
||||
return wgdFyfyDao.queryAll(wgdFyfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdFyfy getWgdFyfyById(String id) {
|
||||
return wgdFyfyDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdFyfy(WgdFyfy wgdFyfy) {
|
||||
return wgdFyfyDao.updateOne(wgdFyfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdFyfy(WgdFyfy wgdFyfy) {
|
||||
wgdFyfy.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdFyfyDao.insertOne(wgdFyfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdFyfy(String id) {
|
||||
return wgdFyfyDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdFyfys(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdFyfyDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdFyfy> importFyfy(MultipartFile file, StringBuilder stringBuilder) {
|
||||
List<WgdFyfy> res= ExcelImportUtilByWk.readExcelpublic(WgdFyfy.class,file);
|
||||
|
||||
QueryWrapper<WgdFyfy> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdFyfy.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdFyfy> wgdFyfy=iWgdFyfyService.list(queryWrapper);
|
||||
List<WgdFyfy> remove=new ArrayList<>();
|
||||
wgdFyfy.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 && iWgdFyfyService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdFyfyDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdFyfy;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdFyfyService;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdFyfyServiceImpl extends ServiceImpl<WgdFyfyDao, WgdFyfy> implements IWgdFyfyService {
|
||||
|
||||
@Autowired
|
||||
WgdFyfyDao wgdFyfyDao;
|
||||
|
||||
@Autowired
|
||||
IWgdFyfyService iWgdFyfyService;
|
||||
|
||||
@Override
|
||||
public List<WgdFyfy> getAllWgdFyfys() {
|
||||
return wgdFyfyDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdFyfy> queryAllWgdFyfys(WgdFyfy wgdFyfy) {
|
||||
Integer count = wgdFyfyDao.getQueryTotal(wgdFyfy);
|
||||
wgdFyfy.getPager().setRowCount(count);
|
||||
return wgdFyfyDao.queryAll(wgdFyfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdFyfy getWgdFyfyById(String id) {
|
||||
return wgdFyfyDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdFyfy(WgdFyfy wgdFyfy) {
|
||||
return wgdFyfyDao.updateOne(wgdFyfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdFyfy(WgdFyfy wgdFyfy) {
|
||||
wgdFyfy.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdFyfyDao.insertOne(wgdFyfy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdFyfy(String id) {
|
||||
return wgdFyfyDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdFyfys(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdFyfyDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdFyfy> importFyfy(MultipartFile file, StringBuilder stringBuilder) {
|
||||
List<WgdFyfy> res= ExcelImportUtilByWk.readExcelpublic(WgdFyfy.class,file);
|
||||
if (res != null){
|
||||
QueryWrapper<WgdFyfy> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdFyfy.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdFyfy> wgdFyfy=iWgdFyfyService.list(queryWrapper);
|
||||
List<WgdFyfy> remove=new ArrayList<>();
|
||||
wgdFyfy.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 && iWgdFyfyService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+122
-117
@@ -1,117 +1,122 @@
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdSrbDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdSrb;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdSrbService;
|
||||
import com.adc.da.slrs.wgdCensusZ.entity.WgdMeetCost;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdSrbServiceImpl extends ServiceImpl<WgdSrbDao, WgdSrb> implements IWgdSrbService {
|
||||
|
||||
@Autowired
|
||||
WgdSrbDao wgdSrbDao;
|
||||
|
||||
@Autowired
|
||||
IWgdSrbService iWgdSrbService;
|
||||
|
||||
@Override
|
||||
public List<WgdSrb> getAllWgdSrbs() {
|
||||
return wgdSrbDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdSrb> queryAllWgdSrbs(WgdSrb wgdSrb) {
|
||||
Integer count = wgdSrbDao.getQueryTotal(wgdSrb);
|
||||
wgdSrb.getPager().setRowCount(count);
|
||||
return wgdSrbDao.queryAll(wgdSrb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdSrb getWgdSrbById(String id) {
|
||||
return wgdSrbDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdSrb(WgdSrb wgdSrb) {
|
||||
return wgdSrbDao.updateOne(wgdSrb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdSrb(WgdSrb wgdSrb) {
|
||||
wgdSrb.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdSrbDao.insertOne(wgdSrb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdSrb(String id) {
|
||||
return wgdSrbDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdSrbs(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdSrbDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdSrb> importSrb(MultipartFile file, StringBuilder stringBuilder) {
|
||||
|
||||
List<WgdSrb> res= ExcelImportUtilByWk.readExcelpublic(WgdSrb.class,file);
|
||||
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
||||
int i=1;
|
||||
for (WgdSrb wgdSrb: res) {
|
||||
try {
|
||||
if (null!=wgdSrb.getTime() && !"".equals(wgdSrb.getTime())) {
|
||||
wgdSrb.setTime(wgdSrb.getTime());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第5列入账时间填写不符合格式要求请检查;");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
QueryWrapper<WgdSrb> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdSrb.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdSrb> wgdSrb=iWgdSrbService.list(queryWrapper);
|
||||
List<WgdSrb> remove=new ArrayList<>();
|
||||
wgdSrb.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 && iWgdSrbService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdSrbDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdSrb;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdSrbService;
|
||||
import com.adc.da.slrs.wgdCensusZ.entity.WgdMeetCost;
|
||||
import com.adc.da.util.UUIDUtils;
|
||||
import com.adc.da.util.utils.StringUtils;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdSrbServiceImpl extends ServiceImpl<WgdSrbDao, WgdSrb> implements IWgdSrbService {
|
||||
|
||||
@Autowired
|
||||
WgdSrbDao wgdSrbDao;
|
||||
|
||||
@Autowired
|
||||
IWgdSrbService iWgdSrbService;
|
||||
|
||||
@Override
|
||||
public List<WgdSrb> getAllWgdSrbs() {
|
||||
return wgdSrbDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdSrb> queryAllWgdSrbs(WgdSrb wgdSrb) {
|
||||
Integer count = wgdSrbDao.getQueryTotal(wgdSrb);
|
||||
wgdSrb.getPager().setRowCount(count);
|
||||
return wgdSrbDao.queryAll(wgdSrb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdSrb getWgdSrbById(String id) {
|
||||
return wgdSrbDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdSrb(WgdSrb wgdSrb) {
|
||||
return wgdSrbDao.updateOne(wgdSrb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdSrb(WgdSrb wgdSrb) {
|
||||
wgdSrb.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdSrbDao.insertOne(wgdSrb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdSrb(String id) {
|
||||
return wgdSrbDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdSrbs(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdSrbDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdSrb> importSrb(MultipartFile file, StringBuilder stringBuilder) {
|
||||
|
||||
List<WgdSrb> res= ExcelImportUtilByWk.readExcelpublic(WgdSrb.class,file);
|
||||
if (res != null){
|
||||
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
||||
int i=1;
|
||||
for (WgdSrb wgdSrb: res) {
|
||||
try {
|
||||
if (null!=wgdSrb.getTime() && !"".equals(wgdSrb.getTime())) {
|
||||
wgdSrb.setTime(wgdSrb.getTime());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第5列入账时间填写不符合格式要求请检查;");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
QueryWrapper<WgdSrb> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdSrb.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdSrb> wgdSrb=iWgdSrbService.list(queryWrapper);
|
||||
List<WgdSrb> remove=new ArrayList<>();
|
||||
wgdSrb.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 && iWgdSrbService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+175
-170
@@ -1,170 +1,175 @@
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdWbtjDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdWbtj;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdWbtjService;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdWbtjServiceImpl extends ServiceImpl<WgdWbtjDao, WgdWbtj> implements IWgdWbtjService {
|
||||
|
||||
@Autowired
|
||||
WgdWbtjDao wgdWbtjDao;
|
||||
|
||||
@Autowired
|
||||
IWgdWbtjService iWgdWbtjService;
|
||||
|
||||
@Override
|
||||
public List<WgdWbtj> getAllWgdWbtjs() {
|
||||
return wgdWbtjDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdWbtj> queryAllWgdWbtjs(WgdWbtj wgdWbtj) {
|
||||
Integer count = wgdWbtjDao.getQueryTotal(wgdWbtj);
|
||||
wgdWbtj.getPager().setRowCount(count);
|
||||
return wgdWbtjDao.queryAll(wgdWbtj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdWbtj getWgdWbtjById(String id) {
|
||||
return wgdWbtjDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdWbtj(WgdWbtj wgdWbtj) {
|
||||
return wgdWbtjDao.updateOne(wgdWbtj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdWbtj(WgdWbtj wgdWbtj) {
|
||||
wgdWbtj.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdWbtjDao.insertOne(wgdWbtj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdWbtj(String id) {
|
||||
return wgdWbtjDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdWbtjs(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdWbtjDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdWbtj> importWbtj(MultipartFile file, StringBuilder stringBuilder) {
|
||||
List<WgdWbtj> res= ExcelImportUtilByWk.readExcelpublic(WgdWbtj.class,file);
|
||||
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
||||
int i=1;
|
||||
for (WgdWbtj wgdWbtj: res) {
|
||||
if (null == wgdWbtj.getHost() || "".equals(wgdWbtj.getHost())){
|
||||
stringBuilder.append("第" + i + "行第1列主办单位填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getMeeting() || "".equals(wgdWbtj.getMeeting())){
|
||||
stringBuilder.append("第" + i + "行第2列会议名称填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getPlace() || "".equals(wgdWbtj.getPlace())){
|
||||
stringBuilder.append("第" + i + "行第4列会议地点填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getContributions() || "".equals(wgdWbtj.getContributions())){
|
||||
stringBuilder.append("第" + i + "行第5列会费标准填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getExpenses() || "".equals(wgdWbtj.getExpenses())){
|
||||
stringBuilder.append("第" + i + "行第7列费用列支填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getUser() || "".equals(wgdWbtj.getUser())){
|
||||
stringBuilder.append("第" + i + "行第8列参会人员填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getLeadership() || "".equals(wgdWbtj.getLeadership())){
|
||||
stringBuilder.append("第" + i + "行第9列主管领导填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getParticipants() || "".equals(wgdWbtj.getParticipants())){
|
||||
stringBuilder.append("第" + i + "行第10列参会单位填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getIssues() || "".equals(wgdWbtj.getIssues())){
|
||||
stringBuilder.append("第" + i + "行第13列主要议题填写不符合格式要求请检查;");
|
||||
}
|
||||
try {
|
||||
if (null!=wgdWbtj.getTime() && !"".equals(wgdWbtj.getTime())) {
|
||||
wgdWbtj.setTime(wgdWbtj.getTime());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第3列会议时间填写不符合格式要求请检查;");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
QueryWrapper<WgdWbtj> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdWbtj.class,tableFieldInfo -> !tableFieldInfo.getColumn().equals("id"));
|
||||
List<WgdWbtj> WgdWbtjs=iWgdWbtjService.list(queryWrapper);
|
||||
List<WgdWbtj> remove=new ArrayList<>();
|
||||
WgdWbtjs.forEach(WgbWbtj -> {
|
||||
WgbWbtj.setId(null);
|
||||
if (res.contains(WgbWbtj)){
|
||||
remove.add(WgbWbtj);
|
||||
}
|
||||
res.forEach(resWbtj->{
|
||||
if (null == resWbtj.getHost() || "".equals(resWbtj.getHost())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getMeeting() || "".equals(resWbtj.getMeeting())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getPlace() || "".equals(resWbtj.getPlace())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getContributions() || "".equals(resWbtj.getContributions())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getExpenses() || "".equals(resWbtj.getExpenses())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getUser() || "".equals(resWbtj.getUser())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getLeadership() || "".equals(resWbtj.getLeadership())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getParticipants() || "".equals(resWbtj.getParticipants())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getIssues() || "".equals(resWbtj.getIssues())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
res.removeAll(remove);
|
||||
res.forEach(WgbWbtj -> {
|
||||
WgbWbtj.setId(String.valueOf(UUID.randomUUID()));
|
||||
});
|
||||
if (res.size()>0 && iWgdWbtjService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdWbtjDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdWbtj;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdWbtjService;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdWbtjServiceImpl extends ServiceImpl<WgdWbtjDao, WgdWbtj> implements IWgdWbtjService {
|
||||
|
||||
@Autowired
|
||||
WgdWbtjDao wgdWbtjDao;
|
||||
|
||||
@Autowired
|
||||
IWgdWbtjService iWgdWbtjService;
|
||||
|
||||
@Override
|
||||
public List<WgdWbtj> getAllWgdWbtjs() {
|
||||
return wgdWbtjDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdWbtj> queryAllWgdWbtjs(WgdWbtj wgdWbtj) {
|
||||
Integer count = wgdWbtjDao.getQueryTotal(wgdWbtj);
|
||||
wgdWbtj.getPager().setRowCount(count);
|
||||
return wgdWbtjDao.queryAll(wgdWbtj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdWbtj getWgdWbtjById(String id) {
|
||||
return wgdWbtjDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdWbtj(WgdWbtj wgdWbtj) {
|
||||
return wgdWbtjDao.updateOne(wgdWbtj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdWbtj(WgdWbtj wgdWbtj) {
|
||||
wgdWbtj.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdWbtjDao.insertOne(wgdWbtj);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdWbtj(String id) {
|
||||
return wgdWbtjDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdWbtjs(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdWbtjDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdWbtj> importWbtj(MultipartFile file, StringBuilder stringBuilder) {
|
||||
List<WgdWbtj> res= ExcelImportUtilByWk.readExcelpublic(WgdWbtj.class,file);
|
||||
if (res != null){
|
||||
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
||||
int i=1;
|
||||
for (WgdWbtj wgdWbtj: res) {
|
||||
if (null == wgdWbtj.getHost() || "".equals(wgdWbtj.getHost())){
|
||||
stringBuilder.append("第" + i + "行第1列主办单位填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getMeeting() || "".equals(wgdWbtj.getMeeting())){
|
||||
stringBuilder.append("第" + i + "行第2列会议名称填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getPlace() || "".equals(wgdWbtj.getPlace())){
|
||||
stringBuilder.append("第" + i + "行第4列会议地点填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getContributions() || "".equals(wgdWbtj.getContributions())){
|
||||
stringBuilder.append("第" + i + "行第5列会费标准填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getExpenses() || "".equals(wgdWbtj.getExpenses())){
|
||||
stringBuilder.append("第" + i + "行第7列费用列支填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getUser() || "".equals(wgdWbtj.getUser())){
|
||||
stringBuilder.append("第" + i + "行第8列参会人员填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getLeadership() || "".equals(wgdWbtj.getLeadership())){
|
||||
stringBuilder.append("第" + i + "行第9列主管领导填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getParticipants() || "".equals(wgdWbtj.getParticipants())){
|
||||
stringBuilder.append("第" + i + "行第10列参会单位填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbtj.getIssues() || "".equals(wgdWbtj.getIssues())){
|
||||
stringBuilder.append("第" + i + "行第13列主要议题填写不符合格式要求请检查;");
|
||||
}
|
||||
try {
|
||||
if (null!=wgdWbtj.getTime() && !"".equals(wgdWbtj.getTime())) {
|
||||
wgdWbtj.setTime(wgdWbtj.getTime());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第3列会议时间填写不符合格式要求请检查;");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
QueryWrapper<WgdWbtj> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdWbtj.class,tableFieldInfo -> !tableFieldInfo.getColumn().equals("id"));
|
||||
List<WgdWbtj> WgdWbtjs=iWgdWbtjService.list(queryWrapper);
|
||||
List<WgdWbtj> remove=new ArrayList<>();
|
||||
WgdWbtjs.forEach(WgbWbtj -> {
|
||||
WgbWbtj.setId(null);
|
||||
if (res.contains(WgbWbtj)){
|
||||
remove.add(WgbWbtj);
|
||||
}
|
||||
res.forEach(resWbtj->{
|
||||
if (null == resWbtj.getHost() || "".equals(resWbtj.getHost())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getMeeting() || "".equals(resWbtj.getMeeting())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getPlace() || "".equals(resWbtj.getPlace())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getContributions() || "".equals(resWbtj.getContributions())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getExpenses() || "".equals(resWbtj.getExpenses())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getUser() || "".equals(resWbtj.getUser())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getLeadership() || "".equals(resWbtj.getLeadership())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getParticipants() || "".equals(resWbtj.getParticipants())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
if (null == resWbtj.getIssues() || "".equals(resWbtj.getIssues())){
|
||||
remove.add(resWbtj);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
res.removeAll(remove);
|
||||
res.forEach(WgbWbtj -> {
|
||||
WgbWbtj.setId(String.valueOf(UUID.randomUUID()));
|
||||
});
|
||||
if (res.size()>0 && iWgdWbtjService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+161
-156
@@ -1,156 +1,161 @@
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdWbxdDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdWbxd;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdWbxdService;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdWbxdServiceImpl extends ServiceImpl<WgdWbxdDao, WgdWbxd> implements IWgdWbxdService {
|
||||
|
||||
@Autowired
|
||||
WgdWbxdDao wgdWbxdDao;
|
||||
|
||||
@Autowired
|
||||
IWgdWbxdService iWgdWbxdService;
|
||||
|
||||
@Override
|
||||
public List<WgdWbxd> getAllWgdWbxds() {
|
||||
return wgdWbxdDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdWbxd> queryAllWgdWbxds(WgdWbxd wgdWbxd) {
|
||||
Integer count = wgdWbxdDao.getQueryTotal(wgdWbxd);
|
||||
wgdWbxd.getPager().setRowCount(count);
|
||||
return wgdWbxdDao.queryAll(wgdWbxd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdWbxd getWgdWbxdById(String id) {
|
||||
return wgdWbxdDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdWbxd(WgdWbxd wgdWbxd) {
|
||||
return wgdWbxdDao.updateOne(wgdWbxd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdWbxd(WgdWbxd wgdWbxd) {
|
||||
wgdWbxd.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdWbxdDao.insertOne(wgdWbxd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdWbxd(String id) {
|
||||
return wgdWbxdDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdWbxds(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdWbxdDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdWbxd> importWbxd(MultipartFile file, StringBuilder stringBuilder) {
|
||||
|
||||
|
||||
List<WgdWbxd> res= ExcelImportUtilByWk.readExcelpublic(WgdWbxd.class,file);
|
||||
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
||||
int i=1;
|
||||
for (WgdWbxd wgdWbxd: res) {
|
||||
if (null == wgdWbxd.getName() || "".equals(wgdWbxd.getName())){
|
||||
stringBuilder.append("第" + i + "行第3列标准名称填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbxd.getType() || "".equals(wgdWbxd.getType())){
|
||||
stringBuilder.append("第" + i + "行第6列标类型填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbxd.getPreside() || "".equals(wgdWbxd.getPreside())){
|
||||
stringBuilder.append("第" + i + "行第7列主持或参与填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbxd.getParticipants() || "".equals(wgdWbxd.getParticipants())){
|
||||
stringBuilder.append("第" + i + "行第14列参与人填写不符合格式要求请检查;");
|
||||
}
|
||||
try {
|
||||
if (null!=wgdWbxd.getDataStart() && !"".equals(wgdWbxd.getDataStart())) {
|
||||
wgdWbxd.setDataStart(wgdWbxd.getDataStart());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第8列发布日期填写不符合格式要求请检查;");
|
||||
}
|
||||
try {
|
||||
if (null!=wgdWbxd.getDataImplement() && !"".equals(wgdWbxd.getDataImplement())) {
|
||||
wgdWbxd.setDataImplement(wgdWbxd.getDataImplement());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第9列实施日期填写不符合格式要求请检查;");
|
||||
}
|
||||
try {
|
||||
if (null!=wgdWbxd.getDataRecord() && !"".equals(wgdWbxd.getDataRecord())) {
|
||||
wgdWbxd.setDataRecord(wgdWbxd.getDataRecord());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第12列备案时间填写不符合格式要求请检查;");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
QueryWrapper<WgdWbxd> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdWbxd.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdWbxd> wgdAssocInfos=iWgdWbxdService.list(queryWrapper);
|
||||
List<WgdWbxd> remove=new ArrayList<>();
|
||||
wgdAssocInfos.forEach(WgbWbtj -> {
|
||||
WgbWbtj.setId(null);
|
||||
if (res.contains(WgbWbtj)){
|
||||
remove.add(WgbWbtj);
|
||||
}
|
||||
res.forEach(resWBxd->{
|
||||
if (null == resWBxd.getName() || "".equals(resWBxd.getName())){
|
||||
remove.add(resWBxd);
|
||||
}
|
||||
if (null == resWBxd.getType() || "".equals(resWBxd.getType())){
|
||||
remove.add(resWBxd);
|
||||
}
|
||||
if (null == resWBxd.getPreside() || "".equals(resWBxd.getPreside())){
|
||||
remove.add(resWBxd);
|
||||
}
|
||||
if (null == resWBxd.getParticipants() || "".equals(resWBxd.getParticipants())){
|
||||
remove.add(resWBxd);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
res.removeAll(remove);
|
||||
res.forEach(wgdAssocInfo -> {
|
||||
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
|
||||
});
|
||||
if (res.size()>0 && iWgdWbxdService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdWbxdDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdWbxd;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdWbxdService;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdWbxdServiceImpl extends ServiceImpl<WgdWbxdDao, WgdWbxd> implements IWgdWbxdService {
|
||||
|
||||
@Autowired
|
||||
WgdWbxdDao wgdWbxdDao;
|
||||
|
||||
@Autowired
|
||||
IWgdWbxdService iWgdWbxdService;
|
||||
|
||||
@Override
|
||||
public List<WgdWbxd> getAllWgdWbxds() {
|
||||
return wgdWbxdDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdWbxd> queryAllWgdWbxds(WgdWbxd wgdWbxd) {
|
||||
Integer count = wgdWbxdDao.getQueryTotal(wgdWbxd);
|
||||
wgdWbxd.getPager().setRowCount(count);
|
||||
return wgdWbxdDao.queryAll(wgdWbxd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdWbxd getWgdWbxdById(String id) {
|
||||
return wgdWbxdDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdWbxd(WgdWbxd wgdWbxd) {
|
||||
return wgdWbxdDao.updateOne(wgdWbxd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdWbxd(WgdWbxd wgdWbxd) {
|
||||
wgdWbxd.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdWbxdDao.insertOne(wgdWbxd);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdWbxd(String id) {
|
||||
return wgdWbxdDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdWbxds(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdWbxdDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdWbxd> importWbxd(MultipartFile file, StringBuilder stringBuilder) {
|
||||
|
||||
|
||||
List<WgdWbxd> res= ExcelImportUtilByWk.readExcelpublic(WgdWbxd.class,file);
|
||||
if (res != null){
|
||||
DateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
||||
int i=1;
|
||||
for (WgdWbxd wgdWbxd: res) {
|
||||
if (null == wgdWbxd.getName() || "".equals(wgdWbxd.getName())){
|
||||
stringBuilder.append("第" + i + "行第3列标准名称填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbxd.getType() || "".equals(wgdWbxd.getType())){
|
||||
stringBuilder.append("第" + i + "行第6列标类型填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbxd.getPreside() || "".equals(wgdWbxd.getPreside())){
|
||||
stringBuilder.append("第" + i + "行第7列主持或参与填写不符合格式要求请检查;");
|
||||
}
|
||||
if (null == wgdWbxd.getParticipants() || "".equals(wgdWbxd.getParticipants())){
|
||||
stringBuilder.append("第" + i + "行第14列参与人填写不符合格式要求请检查;");
|
||||
}
|
||||
try {
|
||||
if (null!=wgdWbxd.getDataStart() && !"".equals(wgdWbxd.getDataStart())) {
|
||||
wgdWbxd.setDataStart(wgdWbxd.getDataStart());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第8列发布日期填写不符合格式要求请检查;");
|
||||
}
|
||||
try {
|
||||
if (null!=wgdWbxd.getDataImplement() && !"".equals(wgdWbxd.getDataImplement())) {
|
||||
wgdWbxd.setDataImplement(wgdWbxd.getDataImplement());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第9列实施日期填写不符合格式要求请检查;");
|
||||
}
|
||||
try {
|
||||
if (null!=wgdWbxd.getDataRecord() && !"".equals(wgdWbxd.getDataRecord())) {
|
||||
wgdWbxd.setDataRecord(wgdWbxd.getDataRecord());
|
||||
}
|
||||
}catch (Exception e){
|
||||
stringBuilder.append("第"+i+"行第12列备案时间填写不符合格式要求请检查;");
|
||||
}
|
||||
i++;
|
||||
}
|
||||
QueryWrapper<WgdWbxd> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdWbxd.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdWbxd> wgdAssocInfos=iWgdWbxdService.list(queryWrapper);
|
||||
List<WgdWbxd> remove=new ArrayList<>();
|
||||
wgdAssocInfos.forEach(WgbWbtj -> {
|
||||
WgbWbtj.setId(null);
|
||||
if (res.contains(WgbWbtj)){
|
||||
remove.add(WgbWbtj);
|
||||
}
|
||||
res.forEach(resWBxd->{
|
||||
if (null == resWBxd.getName() || "".equals(resWBxd.getName())){
|
||||
remove.add(resWBxd);
|
||||
}
|
||||
if (null == resWBxd.getType() || "".equals(resWBxd.getType())){
|
||||
remove.add(resWBxd);
|
||||
}
|
||||
if (null == resWBxd.getPreside() || "".equals(resWBxd.getPreside())){
|
||||
remove.add(resWBxd);
|
||||
}
|
||||
if (null == resWBxd.getParticipants() || "".equals(resWBxd.getParticipants())){
|
||||
remove.add(resWBxd);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
res.removeAll(remove);
|
||||
res.forEach(wgdAssocInfo -> {
|
||||
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
|
||||
});
|
||||
if (res.size()>0 && iWgdWbxdService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+110
-106
@@ -1,106 +1,110 @@
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdZcbDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdZcb;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdZcbService;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdZcbServiceImpl extends ServiceImpl<WgdZcbDao, WgdZcb> implements IWgdZcbService {
|
||||
|
||||
@Autowired
|
||||
WgdZcbDao wgdZcbDao;
|
||||
|
||||
@Autowired
|
||||
IWgdZcbService iWgdZcbService;
|
||||
@Override
|
||||
public List<WgdZcb> getAllWgdZcbs() {
|
||||
return wgdZcbDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdZcb> queryAllWgdZcbs(WgdZcb wgdZcb) {
|
||||
Integer count = wgdZcbDao.getQueryTotal(wgdZcb);
|
||||
wgdZcb.getPager().setRowCount(count);
|
||||
return wgdZcbDao.queryAll(wgdZcb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdZcb getWgdZcbById(String id) {
|
||||
return wgdZcbDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdZcb(WgdZcb wgdZcb) {
|
||||
return wgdZcbDao.updateOne(wgdZcb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdZcb(WgdZcb wgdZcb) {
|
||||
wgdZcb.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdZcbDao.insertOne(wgdZcb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdZcb(String id) {
|
||||
return wgdZcbDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdZcbs(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdZcbDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdZcb> importZcb(MultipartFile file, StringBuilder stringBuilder) {
|
||||
|
||||
List<WgdZcb> res= ExcelImportUtilByWk.readExcelpublic(WgdZcb.class,file);
|
||||
|
||||
QueryWrapper<WgdZcb> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdZcb.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdZcb> wgdZcb=iWgdZcbService.list(queryWrapper);
|
||||
List<WgdZcb> remove=new ArrayList<>();
|
||||
wgdZcb.forEach(WgbWbtj -> {
|
||||
WgbWbtj.setId(null);
|
||||
if (res.contains(WgbWbtj)){
|
||||
remove.add(WgbWbtj);
|
||||
}
|
||||
res.forEach(resZcb->{
|
||||
if (null!=resZcb.getAnnexs() && !"".equals(resZcb.getAnnexs())) {
|
||||
resZcb.setAnnexs(null);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
res.removeAll(remove);
|
||||
res.forEach(wgdAssocInfo -> {
|
||||
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
|
||||
});
|
||||
if (res.size()>0 && iWgdZcbService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}
|
||||
}
|
||||
package com.adc.da.slrs.wgdCensusLeo.service.impl;
|
||||
|
||||
import com.adc.da.http.Result;
|
||||
import com.adc.da.slrs.processModel.utils.ExcelImportUtilByWk;
|
||||
import com.adc.da.slrs.wgdCensusLeo.dao.WgdZcbDao;
|
||||
import com.adc.da.slrs.wgdCensusLeo.entity.WgdZcb;
|
||||
import com.adc.da.slrs.wgdCensusLeo.service.IWgdZcbService;
|
||||
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 super_liu
|
||||
* @since 2021-11-12
|
||||
*/
|
||||
@Service
|
||||
public class WgdZcbServiceImpl extends ServiceImpl<WgdZcbDao, WgdZcb> implements IWgdZcbService {
|
||||
|
||||
@Autowired
|
||||
WgdZcbDao wgdZcbDao;
|
||||
|
||||
@Autowired
|
||||
IWgdZcbService iWgdZcbService;
|
||||
@Override
|
||||
public List<WgdZcb> getAllWgdZcbs() {
|
||||
return wgdZcbDao.selectAll();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdZcb> queryAllWgdZcbs(WgdZcb wgdZcb) {
|
||||
Integer count = wgdZcbDao.getQueryTotal(wgdZcb);
|
||||
wgdZcb.getPager().setRowCount(count);
|
||||
return wgdZcbDao.queryAll(wgdZcb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WgdZcb getWgdZcbById(String id) {
|
||||
return wgdZcbDao.selectOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int updateWgdZcb(WgdZcb wgdZcb) {
|
||||
return wgdZcbDao.updateOne(wgdZcb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int insertWgdZcb(WgdZcb wgdZcb) {
|
||||
wgdZcb.setId(UUIDUtils.randomUUID(32));
|
||||
return wgdZcbDao.insertOne(wgdZcb);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdZcb(String id) {
|
||||
return wgdZcbDao.deleteOne(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int deleteWgdZcbs(String ids) {
|
||||
String[] str = ids.split(",");
|
||||
return wgdZcbDao.deleteBatch(str);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<WgdZcb> importZcb(MultipartFile file, StringBuilder stringBuilder) {
|
||||
|
||||
List<WgdZcb> res= ExcelImportUtilByWk.readExcelpublic(WgdZcb.class,file);
|
||||
if (res != null){
|
||||
QueryWrapper<WgdZcb> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select(WgdZcb.class, info -> !info.getColumn().equals("id"));
|
||||
List<WgdZcb> wgdZcb=iWgdZcbService.list(queryWrapper);
|
||||
List<WgdZcb> remove=new ArrayList<>();
|
||||
wgdZcb.forEach(WgbWbtj -> {
|
||||
WgbWbtj.setId(null);
|
||||
if (res.contains(WgbWbtj)){
|
||||
remove.add(WgbWbtj);
|
||||
}
|
||||
res.forEach(resZcb->{
|
||||
if (null!=resZcb.getAnnexs() && !"".equals(resZcb.getAnnexs())) {
|
||||
resZcb.setAnnexs(null);
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
res.removeAll(remove);
|
||||
res.forEach(wgdAssocInfo -> {
|
||||
wgdAssocInfo.setId(String.valueOf(UUID.randomUUID()));
|
||||
});
|
||||
if (res.size()>0 && iWgdZcbService.saveOrUpdateBatch(res)) {
|
||||
return res;
|
||||
}else {
|
||||
stringBuilder.append("表格数据全部重复");
|
||||
}
|
||||
return res;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+151
-146
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+167
-162
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+160
-155
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+106
-102
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
+120
-115
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user