提交 35e47a1f authored 作者: 吕本才's avatar 吕本才

1、修改分组保存时,增加分类name,2、增加自定义报表,名称为空的问题

上级 41343864
package com.link.report.controller.core;
import com.link.report.pojo.request.CustomerReportAddVo;
import com.link.report.pojo.request.CustomerGroupAddVo;
import com.link.report.service.CustomerGroupService;
import com.sfa.common.core.domain.R;
import com.sfa.common.security.annotation.RequiresPermissions;
......@@ -21,15 +21,15 @@ public class CustomerGroupCoreController {
@RequiresPermissions("bi:supply:list")
@PostMapping("/group/insertOrUpdate")
public R save(@RequestBody CustomerReportAddVo customerReportAddVo) {
groupService.save(customerReportAddVo);
public R save(@RequestBody CustomerGroupAddVo customerGroupAddVo) {
groupService.save(customerGroupAddVo);
return R.ok();
}
@RequiresPermissions("bi:supply:list")
@DeleteMapping("/group/delete")
public R delete(CustomerReportAddVo customerReportAddVo) {
groupService.delete(customerReportAddVo);
public R delete(CustomerGroupAddVo customerGroupAddVo) {
groupService.delete(customerGroupAddVo);
return R.ok();
}
......
package com.link.report.domain.dao;
import com.link.report.domain.wq.CustomerGroupQueryWq;
import com.link.report.pojo.request.CustomerReportAddVo;
import com.link.report.pojo.request.CustomerGroupAddVo;
import com.link.report.pojo.response.CustomerGroupDto;
import java.util.List;
......@@ -9,9 +9,9 @@ import java.util.List;
public interface CustomerGroupDao {
List<CustomerGroupDto> queryList(CustomerGroupQueryWq wq);
void insert(CustomerReportAddVo customerReportAddVo);
void insert(CustomerGroupAddVo customerGroupAddVo);
void update(CustomerReportAddVo customerReportAddVo);
void update(CustomerGroupAddVo customerGroupAddVo);
void delete(String groupId);
}
package com.link.report.domain.dao;
import com.link.report.domain.wq.CustomerReportAddWq;
import com.link.report.domain.entity.CustomerReport;
import com.link.report.domain.wq.CustomerReportQueryWq;
import com.link.report.pojo.response.CustomerReportListDto;
import java.util.List;
public interface CustomerReportDao {
void insert(CustomerReportAddWq wq);
void insert(CustomerReport report);
void update(CustomerReportAddWq wq);
void update(CustomerReport report);
List<CustomerReportListDto> queryCustomerReportList(CustomerReportQueryWq wq);
}
......@@ -7,7 +7,7 @@ import com.link.report.domain.dao.CustomerGroupDao;
import com.link.report.domain.entity.CustomerGroup;
import com.link.report.domain.mapper.CustomerGroupMapper;
import com.link.report.domain.wq.CustomerGroupQueryWq;
import com.link.report.pojo.request.CustomerReportAddVo;
import com.link.report.pojo.request.CustomerGroupAddVo;
import com.link.report.pojo.response.CustomerGroupDto;
import com.sfa.common.core.utils.bean.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -45,20 +45,19 @@ public class CustomerGroupDaoImpl implements CustomerGroupDao {
}
@Override
public void insert(CustomerReportAddVo customerReportAddVo) {
CustomerGroup customerGroup = BeanUtils.transitionDto(customerReportAddVo, CustomerGroup.class);
customerGroup.setName(customerReportAddVo.getGroupName());
customerGroup.setCategoryName(customerReportAddVo.getCategoryName());
public void insert(CustomerGroupAddVo customerGroupAddVo) {
CustomerGroup customerGroup = BeanUtils.transitionDto(customerGroupAddVo, CustomerGroup.class);
customerGroup.setName(customerGroupAddVo.getGroupName());
customerGroup.setCategoryName(customerGroupAddVo.getCategoryName());
groupMapper.insert(customerGroup);
}
@Override
public void update(CustomerReportAddVo customerReportAddVo) {
CustomerGroup customerGroup = BeanUtils.transitionDto(customerReportAddVo, CustomerGroup.class);
customerGroup.setId(customerReportAddVo.getGroupId());
customerGroup.setName(customerReportAddVo.getGroupName());
customerGroup.setCategoryName(customerReportAddVo.getCategoryName());
public void update(CustomerGroupAddVo customerGroupAddVo) {
CustomerGroup customerGroup = BeanUtils.transitionDto(customerGroupAddVo, CustomerGroup.class);
customerGroup.setId(customerGroupAddVo.getGroupId());
customerGroup.setName(customerGroupAddVo.getGroupName());
customerGroup.setCategoryName(customerGroupAddVo.getCategoryName());
groupMapper.updateById(customerGroup);
}
......
......@@ -6,10 +6,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.link.report.domain.dao.CustomerReportDao;
import com.link.report.domain.entity.CustomerReport;
import com.link.report.domain.mapper.CustomerReportMapper;
import com.link.report.domain.wq.CustomerReportAddWq;
import com.link.report.domain.wq.CustomerReportQueryWq;
import com.link.report.pojo.response.CustomerReportListDto;
import com.sfa.common.core.utils.bean.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
......@@ -25,16 +23,13 @@ public class CustomerReportDaoImpl implements CustomerReportDao {
private CustomerReportMapper customerReportMapper;
@Override
public void insert(CustomerReportAddWq wq) {
CustomerReport entity = BeanUtils.transitionDto(wq, CustomerReport.class);
customerReportMapper.insert(entity);
public void insert(CustomerReport report) {
customerReportMapper.insert(report);
}
@Override
public void update(CustomerReportAddWq wq) {
CustomerReport entity = BeanUtils.transitionDto(wq, CustomerReport.class);
customerReportMapper.updateById(entity);
public void update(CustomerReport report) {
customerReportMapper.updateById(report);
}
@Override
......
......@@ -9,6 +9,7 @@ import java.util.Date;
public class CustomerReportGroup {
private String id;
private String reportId;
private String categoryName;
private Integer reportType;
private String groupId;
private String createBy;
......
......@@ -9,6 +9,14 @@ import lombok.Data;
*/
@Data
public class CustomerGroupAddVo {
private String id;
private String name;
private String groupId;
private String groupName;
private String previewUrl;
private String categoryName;
private Long createUserId;
private Long updateUserId;
private String createBy;
private String updateBy;
}
......@@ -9,8 +9,8 @@ import lombok.Data;
*/
@Data
public class CustomerReportAddVo {
private String groupId;
private String groupName;
private String id;
private String name;
private String previewUrl;
private String categoryName;
......
package com.link.report.service;
import com.link.report.pojo.request.CustomerReportAddVo;
import com.link.report.pojo.request.CustomerGroupAddVo;
public interface CustomerGroupService {
void save(CustomerReportAddVo customerReportAddVo);
void save(CustomerGroupAddVo customerGroupAddVo);
void delete(CustomerReportAddVo customerReportAddVo);
void delete(CustomerGroupAddVo customerGroupAddVo);
void convert();
}
......@@ -5,7 +5,7 @@ import com.link.report.domain.dao.CustomerGroupDao;
import com.link.report.domain.dao.CustomerReportGroupDao;
import com.link.report.domain.entity.CustomerReportGroup;
import com.link.report.domain.wq.CustomerGroupQueryWq;
import com.link.report.pojo.request.CustomerReportAddVo;
import com.link.report.pojo.request.CustomerGroupAddVo;
import com.link.report.pojo.response.CustomerGroupDto;
import com.link.report.service.CustomerGroupService;
import com.sfa.common.core.constant.SecurityConstants;
......@@ -34,7 +34,7 @@ public class CustomerGroupServiceImpl implements CustomerGroupService {
private RemoteUserService remoteUserService;
@Override
public void save(CustomerReportAddVo customerReportAddVo) {
public void save(CustomerGroupAddVo customerReportAddVo) {
Long userId = SecurityUtils.getUserId();
String userName = SecurityUtils.getUsername();
customerReportAddVo.setCreateBy(userName);
......@@ -49,7 +49,7 @@ public class CustomerGroupServiceImpl implements CustomerGroupService {
}
@Override
public void delete(CustomerReportAddVo customerReportAddVo) {
public void delete(CustomerGroupAddVo customerReportAddVo) {
groupDao.delete(customerReportAddVo.getGroupId());
}
......@@ -73,19 +73,19 @@ public class CustomerGroupServiceImpl implements CustomerGroupService {
CustomerGroupDto customerGroupDto = dtoMap.get(groupId);
if (ObjectUtil.isNotEmpty(customerGroupDto)) {
// 匹配到了
CustomerReportAddVo customerReportAddVo = new CustomerReportAddVo();
customerReportAddVo.setCategoryName(customerGroupDto.getCategoryName());
customerReportAddVo.setGroupName(customerGroupDto.getGroupName());
customerReportAddVo.setCreateBy(customerReportGroup.getCreateBy());
customerReportAddVo.setUpdateBy(customerReportGroup.getUpdateBy());
CustomerGroupAddVo groupAddVo = new CustomerGroupAddVo();
groupAddVo.setCategoryName(customerGroupDto.getCategoryName());
groupAddVo.setGroupName(customerGroupDto.getGroupName());
groupAddVo.setCreateBy(customerReportGroup.getCreateBy());
groupAddVo.setUpdateBy(customerReportGroup.getUpdateBy());
R<LoginUser> userResult =remoteUserService.getUserInfo(customerReportGroup.getCreateBy(), SecurityConstants.INNER) ;
Long userid = userResult.getData().getSysUser().getUserId();
customerReportAddVo.setCreateUserId(userid);
customerReportAddVo.setUpdateUserId(userid);
groupDao.insert(customerReportAddVo);
groupAddVo.setCreateUserId(userid);
groupAddVo.setUpdateUserId(userid);
groupDao.insert(groupAddVo);
// 修改数据
customerReportGroup.setGroupId(customerReportAddVo.getGroupId());
customerReportGroup.setGroupId(groupAddVo.getGroupId());
// 更新 分组id
reportGroupDao.update(customerReportGroup);
}
......
......@@ -36,7 +36,7 @@ public class CustomerReportGroupServiceImpl implements CustomerReportGroupServic
@Override
public List<CustomerReportGroupResDto> queryList(CustomerReportQueryListVo vo) {
CustomerGroupQueryWq wq = new CustomerGroupQueryWq();
// wq.setCategoryName(vo.getCategoryName());
wq.setCategoryName(vo.getCategoryName());
wq.setCreateUserId(SecurityUtils.getLoginUser().getUserid());
// 先查询分组
List<CustomerGroupDto> groupDtos = customerGroupDao.queryList(wq);
......
......@@ -2,7 +2,7 @@ package com.link.report.service.impl;
import cn.hutool.core.util.ObjectUtil;
import com.link.report.domain.dao.CustomerReportDao;
import com.link.report.domain.wq.CustomerReportAddWq;
import com.link.report.domain.entity.CustomerReport;
import com.link.report.domain.wq.CustomerReportQueryWq;
import com.link.report.pojo.request.CustomerReportAddVo;
import com.link.report.pojo.request.ReportShareListVo;
......@@ -26,19 +26,19 @@ public class CustomerReportServiceImpl implements CustomerReportService {
@Override
public void save(CustomerReportAddVo customerReportAddVo) {
CustomerReportAddWq wq = new CustomerReportAddWq();
BeanUtils.copyProperties(customerReportAddVo, wq);
wq.setName(customerReportAddVo.getGroupName());
wq.setPreviewUrl(customerReportAddVo.getPreviewUrl());
wq.setCreateBy(SecurityUtils.getUsername());
wq.setUpdateBy(SecurityUtils.getUsername());
wq.setCreateUserId(SecurityUtils.getUserId());
wq.setUpdateUserId(SecurityUtils.getUserId());
CustomerReport customerReport = new CustomerReport();
BeanUtils.copyProperties(customerReportAddVo, customerReport);
customerReport.setName(customerReportAddVo.getName());
customerReport.setPreviewUrl(customerReportAddVo.getPreviewUrl());
customerReport.setCreateBy(SecurityUtils.getUsername());
customerReport.setUpdateBy(SecurityUtils.getUsername());
customerReport.setCreateUserId(SecurityUtils.getUserId());
customerReport.setUpdateUserId(SecurityUtils.getUserId());
if (ObjectUtil.isNotEmpty(wq.getId())) {
customerReportDao.update(wq);
if (ObjectUtil.isNotEmpty(customerReport.getId())) {
customerReportDao.update(customerReport);
} else {
customerReportDao.insert(wq);
customerReportDao.insert(customerReport);
}
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论