联系人管理功能模块开发
This commit is contained in:
+20
@@ -0,0 +1,20 @@
|
||||
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;
|
||||
}
|
||||
+3
-3
@@ -208,7 +208,7 @@ public class PayCompanyManagementController extends JeroController<PayCompanyMan
|
||||
@ApiOperation(value="企业管理-导出excel", notes="企业管理-导出excel")
|
||||
@GetMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, PayCompanyManagement payCompanyManagement) {
|
||||
return super.exportXls(request, payCompanyManagement, PayCompanyManagement.class, "企业管理");
|
||||
return super.exportXls(request, payCompanyManagement, PayCompanyManagement.class, "企业信息");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -219,7 +219,7 @@ public class PayCompanyManagementController extends JeroController<PayCompanyMan
|
||||
@ApiOperation(value="企业管理-模板下载", notes="企业管理-模板下载")
|
||||
@GetMapping(value = "/downloadExcelModel")
|
||||
public ModelAndView downloadExcelModel() {
|
||||
return super.exportTemplate(PayCompanyManagement.class,"企业管理导入模板");
|
||||
return super.exportTemplate(PayCompanyManagement.class,"企业信息导入模板");
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -290,7 +290,7 @@ public class PayCompanyManagementController extends JeroController<PayCompanyMan
|
||||
list.removeAll(listRemove);
|
||||
}
|
||||
// 更新数据
|
||||
payCompanyManagementService.updateDate(listSigning,list);
|
||||
payCompanyManagementService.updateCompanyData(listSigning,list);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.getMessage(),e);
|
||||
|
||||
+181
-7
@@ -1,21 +1,35 @@
|
||||
package com.jero.modules.company.controller;
|
||||
|
||||
import java.util.Arrays;
|
||||
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;
|
||||
@@ -49,6 +63,19 @@ public class PayContactsManagementController extends JeroController<PayContactsM
|
||||
@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);
|
||||
@@ -64,6 +91,23 @@ public class PayContactsManagementController extends JeroController<PayContactsM
|
||||
@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("添加成功!");
|
||||
}
|
||||
@@ -75,8 +119,17 @@ public class PayContactsManagementController extends JeroController<PayContactsM
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-编辑", notes="联系人管理-编辑")
|
||||
@PutMapping(value = "/edit")
|
||||
@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("编辑成功!");
|
||||
}
|
||||
@@ -88,8 +141,11 @@ public class PayContactsManagementController extends JeroController<PayContactsM
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-通过id删除", notes="联系人管理-通过id删除")
|
||||
@DeleteMapping(value = "/delete")
|
||||
@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("删除成功!");
|
||||
}
|
||||
@@ -101,11 +157,47 @@ public class PayContactsManagementController extends JeroController<PayContactsM
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-批量删除", notes="联系人管理-批量删除")
|
||||
@DeleteMapping(value = "/deleteBatch")
|
||||
@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查询
|
||||
@@ -132,9 +224,20 @@ public class PayContactsManagementController extends JeroController<PayContactsM
|
||||
@ApiOperation(value="联系人管理-导出excel", notes="联系人管理-导出excel")
|
||||
@GetMapping(value = "/exportXls")
|
||||
public ModelAndView exportXls(HttpServletRequest request, PayContactsManagement payContactsManagement) {
|
||||
return super.exportXls(request, payContactsManagement, PayContactsManagement.class, "pay_contacts_management");
|
||||
return super.exportXls(request, payContactsManagement, PayContactsManagement.class, "联系人信息");
|
||||
}
|
||||
|
||||
/**
|
||||
* 模板下载
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-模板下载", notes="联系人管理-模板下载")
|
||||
@GetMapping(value = "/downloadExcelModel")
|
||||
public ModelAndView downloadExcelModel() {
|
||||
return super.exportTemplate(PayContactsManagement.class,"联系人信息导入模板");
|
||||
}
|
||||
|
||||
/**
|
||||
* 通过excel导入数据
|
||||
*
|
||||
@@ -143,9 +246,80 @@ public class PayContactsManagementController extends JeroController<PayContactsM
|
||||
* @return
|
||||
*/
|
||||
@ApiOperation(value="联系人管理-excel导入数据", notes="联系人管理-excel导入数据")
|
||||
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
|
||||
@PostMapping(value = "/importExcel")
|
||||
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
|
||||
return super.importExcel(request, response, PayContactsManagement.class);
|
||||
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("文件导入成功!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
+32
-7
@@ -5,6 +5,7 @@ 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;
|
||||
@@ -14,9 +15,7 @@ import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import javax.validation.constraints.Email;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Pattern;
|
||||
import javax.validation.constraints.*;
|
||||
|
||||
/**
|
||||
* @Description: pay_contacts_management
|
||||
@@ -37,47 +36,73 @@ public class PayContactsManagement implements Serializable {
|
||||
@ApiModelProperty(value = "主键")
|
||||
private String id;
|
||||
/**企业id*/
|
||||
@Excel(name = "企业id", width = 15)
|
||||
@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 = "性别(1为男,2为女)", width = 15)
|
||||
/**性别(1:男,2:女)*/
|
||||
@Excel(name = "性别", width = 15)
|
||||
@ApiModelProperty(value = "性别")
|
||||
@NotNull(message = "年龄不能为空")
|
||||
@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 = "创建人")
|
||||
|
||||
+3
-2
@@ -17,9 +17,10 @@ public interface IPayCompanyManagementService extends IService<PayCompanyManagem
|
||||
* @Description 更新数据
|
||||
* @Author lqt
|
||||
* @Date 2021/8/26
|
||||
* @Param
|
||||
* @Param listSigning 已存在数据,更新
|
||||
* @Param list 不能存在数据,插入
|
||||
* @Return
|
||||
* @Exception
|
||||
*/
|
||||
void updateDate(List<PayCompanyManagement> listSigning,List<PayCompanyManagement> list);
|
||||
void updateCompanyData(List<PayCompanyManagement> listSigning,List<PayCompanyManagement> list);
|
||||
}
|
||||
|
||||
+13
@@ -2,8 +2,11 @@ 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
|
||||
@@ -11,5 +14,15 @@ import com.jero.modules.company.entity.PayContactsManagement;
|
||||
* @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);
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -25,7 +25,7 @@ public class PayCompanyManagementServiceImpl extends ServiceImpl<PayCompanyManag
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public void updateDate(List<PayCompanyManagement> listSigning, List<PayCompanyManagement> list) {
|
||||
public void updateCompanyData(List<PayCompanyManagement> listSigning, List<PayCompanyManagement> list) {
|
||||
// 已存在企业名称,变更数据来源
|
||||
if(!CollectionUtils.isEmpty(listSigning)){
|
||||
iPayCompanyManagementService.updateBatchById(listSigning);
|
||||
|
||||
+19
@@ -5,7 +5,12 @@ 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
|
||||
@@ -15,5 +20,19 @@ import org.springframework.stereotype.Service;
|
||||
*/
|
||||
@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