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

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

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