联系人管理功能模块开发
This commit is contained in:
-20
@@ -1,20 +0,0 @@
|
||||
package com.jero.modules.company.common;
|
||||
|
||||
public class PayCompanyManagementCommon {
|
||||
/**
|
||||
* (1:管理端,2:报名)
|
||||
*/
|
||||
public final static Integer DATA_SOURCE1 = 1;
|
||||
/**
|
||||
* (1:管理端,2:报名)
|
||||
*/
|
||||
public final static Integer DATA_SOURCE2 = 2;
|
||||
/**
|
||||
* 报名新增(1:是,0:否)
|
||||
*/
|
||||
public final static Integer SIGNING_UP1 = 1;
|
||||
/**
|
||||
* 报名新增(1:是,0:否)
|
||||
*/
|
||||
public final static Integer SIGNING_UP0 = 0;
|
||||
}
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
package com.jero.modules.company.common;
|
||||
|
||||
public class PayContactsManagementCommon {
|
||||
/**
|
||||
* (1:管理端,2:报名)
|
||||
*/
|
||||
public final static Integer DATA_SOURCE1 = 1;
|
||||
/**
|
||||
* (1:管理端,2:报名)
|
||||
*/
|
||||
public final static Integer DATA_SOURCE2 = 2;
|
||||
/**
|
||||
* 报名新增(1:是,0:否)
|
||||
*/
|
||||
public final static Integer SIGNING_UP1 = 1;
|
||||
/**
|
||||
* 报名新增(1:是,0:否)
|
||||
*/
|
||||
public final static Integer SIGNING_UP0 = 0;
|
||||
}
|
||||
-308
@@ -1,308 +0,0 @@
|
||||
package com.jero.modules.company.controller;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.ValidUtil;
|
||||
import com.jero.modules.company.common.PayCompanyManagementCommon;
|
||||
import com.jero.modules.company.entity.PayCompanyManagement;
|
||||
import com.jero.modules.company.service.IPayCompanyManagementService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.jeecgframework.poi.excel.ExcelImportCheckUtil;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: 企业管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="企业管理")
|
||||
@RestController
|
||||
@RequestMapping("/company/payCompanyManagement")
|
||||
@Slf4j
|
||||
public class PayCompanyManagementController extends JeroController<PayCompanyManagement, IPayCompanyManagementService> {
|
||||
@Autowired
|
||||
private IPayCompanyManagementService payCompanyManagementService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param payCompanyManagement
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="企业管理-分页列表查询", notes="企业管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(PayCompanyManagement payCompanyManagement,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
if(!StringUtils.isBlank(payCompanyManagement.getCompanyName()) && payCompanyManagement.getCompanyName().length() > 50){
|
||||
return Result.error("企业名称长度应小于50个字符!");
|
||||
}
|
||||
QueryWrapper<PayCompanyManagement> queryWrapper = QueryGenerator.initQueryWrapper(payCompanyManagement, req.getParameterMap());
|
||||
Page<PayCompanyManagement> page = new Page<PayCompanyManagement>(pageNo, pageSize);
|
||||
IPage<PayCompanyManagement> pageList = payCompanyManagementService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param payCompanyManagement
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="企业管理-添加", notes="企业管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayCompanyManagement payCompanyManagement) {
|
||||
ValidUtil.validate(payCompanyManagement);
|
||||
// 新增企业前在次校验企业名称是否存在
|
||||
LambdaQueryWrapper<PayCompanyManagement> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PayCompanyManagement::getCompanyName,payCompanyManagement.getCompanyName());
|
||||
PayCompanyManagement payCompanyManagementNew = payCompanyManagementService.getOne(queryWrapper);
|
||||
// 存在数据
|
||||
if(!Objects.isNull(payCompanyManagementNew)){
|
||||
// 如果是管理新增 && 已存在数据来源是报名,更新数据,变更来源为管理端
|
||||
if(!Objects.equals(payCompanyManagement.getDataSource(),PayCompanyManagementCommon.DATA_SOURCE1)
|
||||
&& !Objects.equals(payCompanyManagementNew.getDataSource(),PayCompanyManagementCommon.DATA_SOURCE2)){
|
||||
payCompanyManagement.setId(payCompanyManagementNew.getId());
|
||||
payCompanyManagement.setDataSource(PayCompanyManagementCommon.DATA_SOURCE1);
|
||||
payCompanyManagementService.updateById(payCompanyManagement);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
return Result.error("该企业名称已存在!");
|
||||
}
|
||||
payCompanyManagementService.save(payCompanyManagement);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param payCompanyManagement
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="企业管理-编辑", notes="企业管理-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PayCompanyManagement payCompanyManagement) {
|
||||
ValidUtil.validate(payCompanyManagement);
|
||||
// 编辑保存企业前再次校验企业名称是否存在
|
||||
LambdaQueryWrapper<PayCompanyManagement> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PayCompanyManagement::getCompanyName,payCompanyManagement.getCompanyName());
|
||||
PayCompanyManagement payCompanyManagementNew = payCompanyManagementService.getOne(queryWrapper);
|
||||
// 企业名称存在,并且编辑id与查询不同,则校验不通过
|
||||
if(!Objects.isNull(payCompanyManagementNew) && !Objects.equals(payCompanyManagementNew.getId(),payCompanyManagement.getId())) {
|
||||
return Result.error("企业名称已存在!");
|
||||
}
|
||||
payCompanyManagementService.updateById(payCompanyManagement);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="企业管理-通过id删除", notes="企业管理-通过id删除")
|
||||
@GetMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Result.error("id不能为空!");
|
||||
}
|
||||
payCompanyManagementService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="企业管理-批量删除", notes="企业管理-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Result.error("id不能为空!");
|
||||
}
|
||||
String[] s = ids.split(",");
|
||||
for (String s1 : s) {
|
||||
if(StringUtils.isBlank(s1)){
|
||||
return Result.error("id不能为空!");
|
||||
}
|
||||
}
|
||||
this.payCompanyManagementService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过企业名称查询
|
||||
*
|
||||
* @param companyName 企业名称
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="企业管理-通过企业名称查询", notes="企业管理-通过企业名称查询")
|
||||
@GetMapping(value = "/queryByCompanyName")
|
||||
public Result<?> queryByCompanyName(@RequestParam(name="companyName",required=true) String companyName) {
|
||||
if(StringUtils.isBlank(companyName)){
|
||||
return Result.error("企业名称不能为空!");
|
||||
}else{
|
||||
if(companyName.length() > 50){
|
||||
return Result.error("企业名称长度应小于50!");
|
||||
}
|
||||
}
|
||||
LambdaQueryWrapper<PayCompanyManagement> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PayCompanyManagement::getCompanyName,companyName);
|
||||
PayCompanyManagement payCompanyManagement = payCompanyManagementService.getOne(queryWrapper);
|
||||
if(Objects.isNull(payCompanyManagement)) {
|
||||
return Result.OK("没有该企业名称!");
|
||||
}
|
||||
return Result.error("该企业名称已存在!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="企业管理-通过id查询", notes="企业管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
PayCompanyManagement payCompanyManagement = payCompanyManagementService.getById(id);
|
||||
if(payCompanyManagement==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(payCompanyManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param payCompanyManagement
|
||||
*/
|
||||
@ApiOperation(value="企业管理-导出excel", notes="企业管理-导出excel")
|
||||
@GetMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, PayCompanyManagement payCompanyManagement) {
|
||||
return super.exportXls(request, payCompanyManagement, PayCompanyManagement.class, "企业信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板下载
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="企业管理-模板下载", notes="企业管理-模板下载")
|
||||
@GetMapping(value = "/downloadExcelModel")
|
||||
public ModelAndView downloadExcelModel() {
|
||||
return super.exportTemplate(PayCompanyManagement.class,"企业信息导入模板");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="企业管理-excel导入数据", notes="企业管理-excel导入数据")
|
||||
@PostMapping(value = "/importExcel")
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(1);
|
||||
params.setHeadRows(1);
|
||||
try {
|
||||
//导入Excel格式校验,看匹配的字段文本概率
|
||||
Boolean t = ExcelImportCheckUtil.check(file.getInputStream(), PayCompanyManagement.class, params);
|
||||
if(!t){
|
||||
throw new RuntimeException("导入Excel校验失败 !");
|
||||
}
|
||||
List<PayCompanyManagement> list = ExcelImportUtil.importExcel(file.getInputStream(), PayCompanyManagement.class, params);
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
List<PayCompanyManagement> listSigning = new ArrayList<>();
|
||||
List<PayCompanyManagement> listRemove = new ArrayList<>();
|
||||
List<PayCompanyManagement> listAll = payCompanyManagementService.list();
|
||||
List<String> listCompany = new ArrayList<>();
|
||||
StringBuilder msg = new StringBuilder();
|
||||
list.forEach(p->{
|
||||
int count = list.indexOf(p);
|
||||
// 校验 表中是否存在企业名称
|
||||
if(!CollectionUtils.isEmpty(listAll)){
|
||||
List<PayCompanyManagement> listCompanyEquals = listAll.stream().filter(p1->Objects.equals(p1.getCompanyName(),p.getCompanyName())).collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(listCompanyEquals)){
|
||||
// 已存在数据来源是报名,变更来源为管理端,替换掉数据
|
||||
if(!Objects.equals(listCompanyEquals.get(0).getDataSource(),PayCompanyManagementCommon.DATA_SOURCE2)){
|
||||
PayCompanyManagement payCompanyManagement = p;
|
||||
payCompanyManagement.setId(listCompanyEquals.get(0).getId());
|
||||
payCompanyManagement.setDataSource(PayCompanyManagementCommon.DATA_SOURCE1);
|
||||
listSigning.add(payCompanyManagement);
|
||||
listRemove.add(p);
|
||||
}
|
||||
msg.append("第").append(count + 3).append("行:企业名称已经存在,请修改。</br>");
|
||||
}
|
||||
}
|
||||
// 校验excel表中是否存在重复企业名称
|
||||
if(listCompany.contains(p.getCompanyName())){
|
||||
msg.append("第 ").append(count + 3).append(" 行:企业名称在excel中重复,请修改。</br>");
|
||||
}
|
||||
listCompany.add(p.getCompanyName());
|
||||
p.setDataSource(PayCompanyManagementCommon.DATA_SOURCE1);
|
||||
p.setSigningUp(PayCompanyManagementCommon.SIGNING_UP0);
|
||||
// 校验字段值
|
||||
StringBuilder s = ValidUtil.validateExcel(p,(count+3));
|
||||
if(!StringUtils.isBlank(s)){
|
||||
msg.append(s);
|
||||
}
|
||||
});
|
||||
if(!StringUtils.isBlank(msg)){
|
||||
return Result.error(msg.toString());
|
||||
}
|
||||
// 去掉变更来源的数据
|
||||
if(CollectionUtils.isEmpty(list) && !CollectionUtils.isEmpty(listRemove)){
|
||||
list.removeAll(listRemove);
|
||||
}
|
||||
// 更新数据
|
||||
payCompanyManagementService.updateCompanyData(listSigning,list);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error("文件导入失败!");
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.OK("文件导入成功!");
|
||||
}
|
||||
}
|
||||
-325
@@ -1,325 +0,0 @@
|
||||
package com.jero.modules.company.controller;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
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.jero.common.api.vo.Result;
|
||||
import com.jero.common.system.base.controller.JeroController;
|
||||
import com.jero.common.system.query.QueryGenerator;
|
||||
import com.jero.common.util.ValidUtil;
|
||||
import com.jero.modules.company.common.PayCompanyManagementCommon;
|
||||
import com.jero.modules.company.common.PayContactsManagementCommon;
|
||||
import com.jero.modules.company.entity.PayContactsManagement;
|
||||
import com.jero.modules.company.service.IPayContactsManagementService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.jeecgframework.poi.excel.ExcelImportCheckUtil;
|
||||
import org.jeecgframework.poi.excel.ExcelImportUtil;
|
||||
import org.jeecgframework.poi.excel.entity.ImportParams;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||
import org.springframework.web.servlet.ModelAndView;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
|
||||
/**
|
||||
* @Description: 联系人管理
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Api(tags="联系人管理")
|
||||
@RestController
|
||||
@RequestMapping("/company/payContactsManagement")
|
||||
@Slf4j
|
||||
public class PayContactsManagementController extends JeroController<PayContactsManagement, IPayContactsManagementService> {
|
||||
@Autowired
|
||||
private IPayContactsManagementService payContactsManagementService;
|
||||
|
||||
/**
|
||||
* 分页列表查询
|
||||
*
|
||||
* @param payContactsManagement
|
||||
* @param pageNo
|
||||
* @param pageSize
|
||||
* @param req
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-分页列表查询", notes="联系人管理-分页列表查询")
|
||||
@GetMapping(value = "/list")
|
||||
public Result<?> queryPageList(PayContactsManagement payContactsManagement,
|
||||
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
|
||||
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
|
||||
HttpServletRequest req) {
|
||||
if(!StringUtils.isBlank(payContactsManagement.getName()) && payContactsManagement.getName().length() > 20){
|
||||
return Result.error("姓名长度应小于20个字符!");
|
||||
}
|
||||
if(!StringUtils.isBlank(payContactsManagement.getCompanyName()) && payContactsManagement.getCompanyName().length() > 50){
|
||||
return Result.error("企业名称长度应小于50个字符!");
|
||||
}
|
||||
if(!StringUtils.isBlank(payContactsManagement.getPhone())){
|
||||
Pattern pattern = Pattern.compile("^1(3|4|5|7|8)\\d{9}$");
|
||||
Matcher matcher = pattern.matcher(payContactsManagement.getPhone());
|
||||
if(!matcher.matches()){
|
||||
return Result.error("手机号输入错误!");
|
||||
}
|
||||
}
|
||||
QueryWrapper<PayContactsManagement> queryWrapper = QueryGenerator.initQueryWrapper(payContactsManagement, req.getParameterMap());
|
||||
Page<PayContactsManagement> page = new Page<PayContactsManagement>(pageNo, pageSize);
|
||||
IPage<PayContactsManagement> pageList = payContactsManagementService.page(page, queryWrapper);
|
||||
return Result.OK(pageList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 添加
|
||||
*
|
||||
* @param payContactsManagement
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-添加", notes="联系人管理-添加")
|
||||
@PostMapping(value = "/add")
|
||||
public Result<?> add(@RequestBody PayContactsManagement payContactsManagement) {
|
||||
ValidUtil.validate(payContactsManagement);
|
||||
// 新增企业前在次校验企业名称是否存在
|
||||
LambdaQueryWrapper<PayContactsManagement> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PayContactsManagement::getPhone,payContactsManagement.getPhone());
|
||||
PayContactsManagement payContactsManagementNew = payContactsManagementService.getOne(queryWrapper);
|
||||
// 存在数据
|
||||
if(!Objects.isNull(payContactsManagementNew)){
|
||||
// 如果是管理新增 && 已存在数据来源是报名,更新数据,变更来源为管理端
|
||||
if(!Objects.equals(payContactsManagement.getDataSource(), PayContactsManagementCommon.DATA_SOURCE1)
|
||||
&& !Objects.equals(payContactsManagementNew.getDataSource(),PayContactsManagementCommon.DATA_SOURCE2)){
|
||||
payContactsManagement.setId(payContactsManagementNew.getId());
|
||||
payContactsManagement.setDataSource(PayCompanyManagementCommon.DATA_SOURCE1);
|
||||
payContactsManagementService.updateById(payContactsManagement);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
return Result.error("手机号已存在!");
|
||||
}
|
||||
payContactsManagementService.save(payContactsManagement);
|
||||
return Result.OK("添加成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
*
|
||||
* @param payContactsManagement
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-编辑", notes="联系人管理-编辑")
|
||||
@PostMapping(value = "/edit")
|
||||
public Result<?> edit(@RequestBody PayContactsManagement payContactsManagement) {
|
||||
ValidUtil.validate(payContactsManagement);
|
||||
// 编辑保存企业前再次校验企业名称是否存在
|
||||
LambdaQueryWrapper<PayContactsManagement> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PayContactsManagement::getPhone,payContactsManagement.getPhone());
|
||||
PayContactsManagement payContactsManagementNew = payContactsManagementService.getOne(queryWrapper);
|
||||
// 企业名称存在,并且编辑id与查询不同,则校验不通过
|
||||
if(!Objects.isNull(payContactsManagementNew) && !Objects.equals(payContactsManagementNew.getId(),payContactsManagement.getId())) {
|
||||
return Result.error("手机号已存在!");
|
||||
}
|
||||
payContactsManagementService.updateById(payContactsManagement);
|
||||
return Result.OK("编辑成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id删除
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-通过id删除", notes="联系人管理-通过id删除")
|
||||
@GetMapping(value = "/delete")
|
||||
public Result<?> delete(@RequestParam(name="id",required=true) String id) {
|
||||
if(StringUtils.isBlank(id)){
|
||||
return Result.error("id不能为空!");
|
||||
}
|
||||
payContactsManagementService.removeById(id);
|
||||
return Result.OK("删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除
|
||||
*
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-批量删除", notes="联系人管理-批量删除")
|
||||
@GetMapping(value = "/deleteBatch")
|
||||
public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
|
||||
if(StringUtils.isBlank(ids)){
|
||||
return Result.error("id不能为空!");
|
||||
}
|
||||
String[] s = ids.split(",");
|
||||
for (String s1 : s) {
|
||||
if(StringUtils.isBlank(s1)){
|
||||
return Result.error("id不能为空!");
|
||||
}
|
||||
}
|
||||
this.payContactsManagementService.removeByIds(Arrays.asList(ids.split(",")));
|
||||
return Result.OK("批量删除成功!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过手机号查询
|
||||
*
|
||||
* @param phone 手机号
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-通过手机号查询", notes="联系人管理-通过手机号查询")
|
||||
@GetMapping(value = "/queryByCompanyName")
|
||||
public Result<?> queryByCompanyName(@RequestParam(name="phone",required=true) String phone) {
|
||||
if(StringUtils.isBlank(phone)){
|
||||
return Result.error("企业名称不能为空!");
|
||||
}else{
|
||||
Pattern pattern = Pattern.compile("^1(3|4|5|7|8)\\d{9}$");
|
||||
Matcher matcher = pattern.matcher(phone);
|
||||
if(!matcher.matches()){
|
||||
return Result.error("手机号输入错误!");
|
||||
}
|
||||
}
|
||||
LambdaQueryWrapper<PayContactsManagement> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.eq(PayContactsManagement::getPhone,phone);
|
||||
PayContactsManagement payContactsManagement = payContactsManagementService.getOne(queryWrapper);
|
||||
if(Objects.isNull(payContactsManagement)) {
|
||||
return Result.OK("没有该手机号!");
|
||||
}
|
||||
return Result.error("该机号已存在!");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过id查询
|
||||
*
|
||||
* @param id
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-通过id查询", notes="联系人管理-通过id查询")
|
||||
@GetMapping(value = "/queryById")
|
||||
public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
|
||||
PayContactsManagement payContactsManagement = payContactsManagementService.getById(id);
|
||||
if(payContactsManagement==null) {
|
||||
return Result.error("未找到对应数据");
|
||||
}
|
||||
return Result.OK(payContactsManagement);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出excel
|
||||
*
|
||||
* @param request
|
||||
* @param payContactsManagement
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-导出excel", notes="联系人管理-导出excel")
|
||||
@GetMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, PayContactsManagement payContactsManagement) {
|
||||
return super.exportXls(request, payContactsManagement, PayContactsManagement.class, "联系人信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板下载
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-模板下载", notes="联系人管理-模板下载")
|
||||
@GetMapping(value = "/downloadExcelModel")
|
||||
public ModelAndView downloadExcelModel() {
|
||||
return super.exportTemplate(PayContactsManagement.class,"联系人信息导入模板");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
* @param request
|
||||
* @param response
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-excel导入数据", notes="联系人管理-excel导入数据")
|
||||
@PostMapping(value = "/importExcel")
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
|
||||
for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
|
||||
MultipartFile file = entity.getValue();// 获取上传文件对象
|
||||
ImportParams params = new ImportParams();
|
||||
params.setTitleRows(1);
|
||||
params.setHeadRows(1);
|
||||
try {
|
||||
//导入Excel格式校验,看匹配的字段文本概率
|
||||
Boolean t = ExcelImportCheckUtil.check(file.getInputStream(), PayContactsManagement.class, params);
|
||||
if(!t){
|
||||
throw new RuntimeException("导入Excel校验失败 !");
|
||||
}
|
||||
List<PayContactsManagement> list = ExcelImportUtil.importExcel(file.getInputStream(), PayContactsManagement.class, params);
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
List<PayContactsManagement> listSigning = new ArrayList<>();
|
||||
List<PayContactsManagement> listRemove = new ArrayList<>();
|
||||
List<PayContactsManagement> listAll = payContactsManagementService.list();
|
||||
List<String> listContacts = new ArrayList<>();
|
||||
StringBuilder msg = new StringBuilder();
|
||||
list.forEach(p->{
|
||||
int count = list.indexOf(p);
|
||||
// 校验 表中是否存在企业名称
|
||||
if(!CollectionUtils.isEmpty(listAll)){
|
||||
List<PayContactsManagement> listCompanyEquals = listAll.stream().filter(p1->Objects.equals(p1.getPhone(),p.getPhone())).collect(Collectors.toList());
|
||||
if(!CollectionUtils.isEmpty(listCompanyEquals)){
|
||||
// 已存在数据来源是报名,变更来源为管理端,替换掉数据
|
||||
if(!Objects.equals(listCompanyEquals.get(0).getDataSource(),PayContactsManagementCommon.DATA_SOURCE2)){
|
||||
PayContactsManagement payContactsManagement = p;
|
||||
payContactsManagement.setId(listCompanyEquals.get(0).getId());
|
||||
payContactsManagement.setDataSource(PayContactsManagementCommon.DATA_SOURCE1);
|
||||
listSigning.add(payContactsManagement);
|
||||
listRemove.add(p);
|
||||
}
|
||||
msg.append("第").append(count + 3).append("行:企业名称已经存在,请修改。</br>");
|
||||
}
|
||||
}
|
||||
// 校验excel表中是否存在重复企业名称
|
||||
if(listContacts.contains(p.getCompanyName())){
|
||||
msg.append("第 ").append(count + 3).append(" 行:企业名称在excel中重复,请修改。</br>");
|
||||
}
|
||||
listContacts.add(p.getCompanyName());
|
||||
p.setDataSource(PayContactsManagementCommon.DATA_SOURCE1);
|
||||
p.setSigningUp(PayContactsManagementCommon.SIGNING_UP0);
|
||||
// 校验字段值
|
||||
StringBuilder s = ValidUtil.validateExcel(p,(count+3));
|
||||
if(!StringUtils.isBlank(s)){
|
||||
msg.append(s);
|
||||
}
|
||||
});
|
||||
if(!StringUtils.isBlank(msg)){
|
||||
return Result.error(msg.toString());
|
||||
}
|
||||
// 去掉变更来源的数据
|
||||
if(CollectionUtils.isEmpty(list) && !CollectionUtils.isEmpty(listRemove)){
|
||||
list.removeAll(listRemove);
|
||||
}
|
||||
// 更新数据
|
||||
payContactsManagementService.updateContactsData(listSigning,list);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
return Result.error("文件导入失败!");
|
||||
} finally {
|
||||
try {
|
||||
file.getInputStream().close();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
return Result.OK("文件导入成功!");
|
||||
}
|
||||
|
||||
}
|
||||
-112
@@ -1,112 +0,0 @@
|
||||
package com.jero.modules.company.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jero.modules.system.volid.group.Group;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* @Description: pay_company_management
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("pay_company_management")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="pay_company_management对象", description="pay_company_management")
|
||||
public class PayCompanyManagement implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
/**企业名称*/
|
||||
@Excel(name = "企业名称", width = 15)
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
@NotEmpty(message = "企业名称不能为空!")
|
||||
private String companyName;
|
||||
/**公司地址*/
|
||||
@Excel(name = "公司地址", width = 15)
|
||||
@ApiModelProperty(value = "公司地址")
|
||||
@Size(max = 200, message = "公司地址长度应小于200个字符")
|
||||
private String companyAddress;
|
||||
/**公司电话*/
|
||||
@Excel(name = "公司电话", width = 15)
|
||||
@ApiModelProperty(value = "公司电话")
|
||||
@Size(max = 15, message = "公司电话长度应小于15个字符")
|
||||
@Pattern(regexp = "^((0\\d{2,3})-)?(\\d{7,8})(-(\\d{3,}))?$|(0\\d{10})$",message = "公司电话格式错误")
|
||||
private String companyPhone;
|
||||
/**邮编*/
|
||||
@Excel(name = "邮编", width = 15)
|
||||
@ApiModelProperty(value = "邮编")
|
||||
@Size(min=6,max = 6,message = "邮编长度必须为6个字符")
|
||||
@Pattern(regexp = "^[0-9]{6}$",message = "邮编格式错误")
|
||||
private String postalCode;
|
||||
/**银行户名*/
|
||||
@Excel(name = "银行户名", width = 15)
|
||||
@ApiModelProperty(value = "银行户名")
|
||||
@Size(max = 50,message = "银行户名长度应小于50个字符")
|
||||
private String bankAccountName;
|
||||
/**开户行*/
|
||||
@Excel(name = "开户行", width = 15)
|
||||
@ApiModelProperty(value = "开户行")
|
||||
@Size(max = 50, message = "开户行长度应小于50个字符")
|
||||
private String openingBank;
|
||||
/**银行账号*/
|
||||
@Excel(name = "银行账号", width = 15)
|
||||
@ApiModelProperty(value = "银行账号")
|
||||
@Size(max = 50, message = "银行账号长度应小于50个字符")
|
||||
@Pattern(regexp = "^[0-9]*$",message = "银行账号格式错误")
|
||||
private String bankAccount;
|
||||
/**税号*/
|
||||
@Excel(name = "税号", width = 15)
|
||||
@ApiModelProperty(value = "税号")
|
||||
@Size(max = 50, message = "税号长度应小于50个字符")
|
||||
private String dutyCode;
|
||||
/**数据来源(1:管理端,2:报名)*/
|
||||
@ApiModelProperty(value = "数据来源(1:管理端,2:报名)")
|
||||
@Max(2)
|
||||
@Min(1)
|
||||
private Integer dataSource;
|
||||
/**报名新增(1:是,0:否)*/
|
||||
@ApiModelProperty(value = "报名新增(1:是,0:否)")
|
||||
@Max(1)
|
||||
@Min(0)
|
||||
private Integer signingUp;
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Size(max = 200, message = "备注长度应小于200个字符")
|
||||
private String remarks;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**更新时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
-123
@@ -1,123 +0,0 @@
|
||||
package com.jero.modules.company.entity;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.Date;
|
||||
import com.baomidou.mybatisplus.annotation.IdType;
|
||||
import com.baomidou.mybatisplus.annotation.TableId;
|
||||
import com.baomidou.mybatisplus.annotation.TableName;
|
||||
import com.jero.modules.system.volid.group.GroupA;
|
||||
import lombok.Data;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
import org.jeecgframework.poi.excel.annotation.Excel;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* @Description: pay_contacts_management
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Data
|
||||
@TableName("pay_contacts_management")
|
||||
@Accessors(chain = true)
|
||||
@EqualsAndHashCode(callSuper = false)
|
||||
@ApiModel(value="pay_contacts_management对象", description="pay_contacts_management")
|
||||
public class PayContactsManagement implements Serializable {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**主键*/
|
||||
@TableId(type = IdType.ASSIGN_UUID)
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
/**企业id*/
|
||||
@ApiModelProperty(value = "企业id")
|
||||
@NotEmpty(message = "企业id不能为空!")
|
||||
@Max(32)
|
||||
@Min(32)
|
||||
private String companyId;
|
||||
/**企业名称*/
|
||||
@Excel(name = "企业名称", width = 15)
|
||||
@ApiModelProperty(value = "企业名称")
|
||||
@NotEmpty(message = "企业名称不能为空!")
|
||||
@Size(max = 200, message = "公司地址长度应小于200个字符")
|
||||
private String companyName;
|
||||
/**姓名*/
|
||||
@Excel(name = "姓名", width = 15)
|
||||
@ApiModelProperty(value = "姓名")
|
||||
@NotEmpty(message = "姓名不能为空!")
|
||||
@Size(max = 20, message = "姓名长度应小于20个字符")
|
||||
private String name;
|
||||
/**性别(1:男,2:女)*/
|
||||
@Excel(name = "性别", width = 15)
|
||||
@ApiModelProperty(value = "性别")
|
||||
@Max(2)
|
||||
@Min(1)
|
||||
private Integer gender;
|
||||
/**职务*/
|
||||
@Excel(name = "职务", width = 15)
|
||||
@ApiModelProperty(value = "职务")
|
||||
@Size(max = 20, message = "职务长度应小于20个字符")
|
||||
private String post;
|
||||
/**手机号*/
|
||||
@Excel(name = "手机号", width = 15)
|
||||
@ApiModelProperty(value = "手机号")
|
||||
@NotEmpty(message = "手机号不能为空!")
|
||||
@Pattern(regexp = "^1(3|4|5|7|8)\\d{9}$",message = "手机号码格式错误")
|
||||
private String phone;
|
||||
/**邮箱*/
|
||||
@Excel(name = "邮箱", width = 15)
|
||||
@ApiModelProperty(value = "邮箱")
|
||||
@Email(message = "邮箱格式有误")
|
||||
@NotEmpty(message = "邮箱不能为空!")
|
||||
private String email;
|
||||
/**通讯地址*/
|
||||
@Excel(name = "通讯地址", width = 15)
|
||||
@ApiModelProperty(value = "通讯地址")
|
||||
@Size(max = 50, message = "通讯地址长度应小于50个字符")
|
||||
@NotEmpty(message = "通讯地址不能为空!")
|
||||
private String contactAddress;
|
||||
/**邮政编码*/
|
||||
@Excel(name = "邮政编码", width = 15)
|
||||
@Size(min=6,max = 6,message = "邮政编码长度必须为6个字符")
|
||||
@ApiModelProperty(value = "邮政编码")
|
||||
@Pattern(regexp = "^[0-9]{6}$",message = "邮编格式错误")
|
||||
@NotEmpty(message = "邮政编码不能为空!")
|
||||
private String postalCode;
|
||||
/**数据来源(1:管理端,2:报名)*/
|
||||
@ApiModelProperty(value = "数据来源(1:管理端,2:报名)")
|
||||
@Max(2)
|
||||
@Min(1)
|
||||
private Integer dataSource;
|
||||
/**报名新增(1:是,0:否)*/
|
||||
@ApiModelProperty(value = "报名新增(1:是,0:否)")
|
||||
@Max(1)
|
||||
@Min(0)
|
||||
private Integer signingUp;
|
||||
/**备注*/
|
||||
@Excel(name = "备注", width = 15)
|
||||
@ApiModelProperty(value = "备注")
|
||||
@Size(max = 200, message = "备注长度应小于200个字符")
|
||||
private String remarks;
|
||||
/**创建人*/
|
||||
@ApiModelProperty(value = "创建人")
|
||||
private String createBy;
|
||||
/**创建时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Date createTime;
|
||||
/**更新人*/
|
||||
@ApiModelProperty(value = "更新人")
|
||||
private String updateBy;
|
||||
/**更新时间*/
|
||||
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
|
||||
@DateTimeFormat(pattern="yyyy-MM-dd")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Date updateTime;
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.jero.modules.company.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.company.entity.PayCompanyManagement;
|
||||
|
||||
/**
|
||||
* @Description: pay_company_management
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface PayCompanyManagementMapper extends BaseMapper<PayCompanyManagement> {
|
||||
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
package com.jero.modules.company.mapper;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import com.jero.modules.company.entity.PayContactsManagement;
|
||||
|
||||
/**
|
||||
* @Description: pay_contacts_management
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface PayContactsManagementMapper extends BaseMapper<PayContactsManagement> {
|
||||
|
||||
}
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.company.mapper.PayCompanyManagementMapper">
|
||||
|
||||
</mapper>
|
||||
-5
@@ -1,5 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="org.jeecg.modules.demo.company.mapper.PayContactsManagementMapper">
|
||||
|
||||
</mapper>
|
||||
-26
@@ -1,26 +0,0 @@
|
||||
package com.jero.modules.company.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.company.entity.PayCompanyManagement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: pay_company_management
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IPayCompanyManagementService extends IService<PayCompanyManagement> {
|
||||
/**
|
||||
* @Description 更新数据
|
||||
* @Author lqt
|
||||
* @Date 2021/8/26
|
||||
* @Param listSigning 已存在数据,更新
|
||||
* @Param list 不能存在数据,插入
|
||||
* @Return
|
||||
* @Exception
|
||||
*/
|
||||
void updateCompanyData(List<PayCompanyManagement> listSigning,List<PayCompanyManagement> list);
|
||||
}
|
||||
-28
@@ -1,28 +0,0 @@
|
||||
package com.jero.modules.company.service;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.IService;
|
||||
import com.jero.modules.company.entity.PayCompanyManagement;
|
||||
import com.jero.modules.company.entity.PayContactsManagement;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: pay_contacts_management
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
public interface IPayContactsManagementService extends IService<PayContactsManagement> {
|
||||
/**
|
||||
* @Description 更新数据
|
||||
* @Author lqt
|
||||
* @Date 2021/8/26
|
||||
* @Param listSigning 已存在数据,更新
|
||||
* @Param list 不能存在数据,插入
|
||||
* @Return
|
||||
* @Exception
|
||||
*/
|
||||
void updateContactsData(List<PayContactsManagement> listSigning,List<PayContactsManagement> list);
|
||||
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package com.jero.modules.company.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.company.entity.PayCompanyManagement;
|
||||
import com.jero.modules.company.mapper.PayCompanyManagementMapper;
|
||||
import com.jero.modules.company.service.IPayCompanyManagementService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: pay_company_management
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class PayCompanyManagementServiceImpl extends ServiceImpl<PayCompanyManagementMapper, PayCompanyManagement> implements IPayCompanyManagementService {
|
||||
|
||||
@Autowired
|
||||
IPayCompanyManagementService iPayCompanyManagementService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateCompanyData(List<PayCompanyManagement> listSigning, List<PayCompanyManagement> list) {
|
||||
// 已存在企业名称,变更数据来源
|
||||
if(!CollectionUtils.isEmpty(listSigning)){
|
||||
iPayCompanyManagementService.updateBatchById(listSigning);
|
||||
}
|
||||
// 更新excel数据
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
iPayCompanyManagementService.saveBatch(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
-38
@@ -1,38 +0,0 @@
|
||||
package com.jero.modules.company.service.impl;
|
||||
|
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.jero.modules.company.entity.PayContactsManagement;
|
||||
import com.jero.modules.company.mapper.PayContactsManagementMapper;
|
||||
import com.jero.modules.company.service.IPayContactsManagementService;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Description: pay_contacts_management
|
||||
* @Author: jeecg-boot
|
||||
* @Date: 2021-08-25
|
||||
* @Version: V1.0
|
||||
*/
|
||||
@Service
|
||||
public class PayContactsManagementServiceImpl extends ServiceImpl<PayContactsManagementMapper, PayContactsManagement> implements IPayContactsManagementService {
|
||||
@Autowired
|
||||
IPayContactsManagementService iPayContactsManagementService;
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateContactsData(List<PayContactsManagement> listSigning, List<PayContactsManagement> list) {
|
||||
// 已存在企业名称,变更数据来源
|
||||
if(!CollectionUtils.isEmpty(listSigning)){
|
||||
iPayContactsManagementService.updateBatchById(listSigning);
|
||||
}
|
||||
// 更新excel数据
|
||||
if(!CollectionUtils.isEmpty(list)){
|
||||
iPayContactsManagementService.saveBatch(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user