Commit d6b94b5f authored by zhuxiang's avatar zhuxiang
Browse files

增加删除节点

parent 02465905
package com.platform.controller; package com.platform.controller;
import com.platform.model.dto.NodeDTO; import com.platform.model.dto.NodeDTO;
import com.platform.model.resp.Result;
import com.platform.page.TableDataInfo; import com.platform.page.TableDataInfo;
import com.platform.service.NodeService; import com.platform.service.NodeService;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource; import javax.annotation.Resource;
...@@ -22,4 +20,9 @@ public class NodeController extends BaseController { ...@@ -22,4 +20,9 @@ public class NodeController extends BaseController {
startPage(nodeDTO.getPageNum(), nodeDTO.getPageSize()); startPage(nodeDTO.getPageNum(), nodeDTO.getPageSize());
return getDataTable(nodeService.mchRelationUser(nodeDTO)); return getDataTable(nodeService.mchRelationUser(nodeDTO));
} }
@DeleteMapping("/delete")
public Result delete(@RequestParam String nodeName) {
return toAjax(nodeService.deleteNode(nodeName));
}
} }
...@@ -23,7 +23,7 @@ public class UserController extends BaseController { ...@@ -23,7 +23,7 @@ public class UserController extends BaseController {
@ApiOperation(value = "用户详情") @ApiOperation(value = "用户详情")
@GetMapping("/detail") @GetMapping("/detail")
public Result detail(@RequestParam String userName,@RequestParam String caseId) { public Result detail(@RequestParam String userName,@RequestParam int caseId) {
return Result.data(userService.getDetail(userName,caseId)); return Result.data(userService.getDetail(userName,caseId));
} }
......
...@@ -24,7 +24,7 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> { ...@@ -24,7 +24,7 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> {
List<ExcelDataEntity> queryList(CaseDTO caseDTO); List<ExcelDataEntity> queryList(CaseDTO caseDTO);
List<AssociationVO> selectFinancialTransactions(@Param("userName") String userName, @Param("caseId") String caseId); List<AssociationVO> selectFinancialTransactions(@Param("userName") String userName, @Param("caseId") int caseId);
List<ExcelDataVO> queryListByPayUserList(@Param("userList") List<String> userList, List<ExcelDataVO> queryListByPayUserList(@Param("userList") List<String> userList,
@Param("caseId") int caseId); @Param("caseId") int caseId);
...@@ -34,6 +34,6 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> { ...@@ -34,6 +34,6 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> {
List<ExcelDataEntity> relationPage(@Param("oneselfAccountList") List<String> oneselfAccountList, @Param("otherAccountList") List<String> otherAccountList); List<ExcelDataEntity> relationPage(@Param("oneselfAccountList") List<String> oneselfAccountList, @Param("otherAccountList") List<String> otherAccountList);
List<ExcelDataEntity> queryInfoList(CaseDTO caseDTO); List<ExcelDataEntity> queryInfoList(CaseDTO caseDTO);
List<AssociationVO> queryAccountTemporary(@Param("userName") String userName, @Param("caseId") String caseId); List<AssociationVO> queryAccountTemporary(@Param("userName") String userName, @Param("caseId") int caseId);
List<ExcelDataEntity> accountCashFlow(UserDTO userDTO); List<ExcelDataEntity> accountCashFlow(UserDTO userDTO);
} }
...@@ -49,7 +49,7 @@ public interface ExcelDataService extends IService<ExcelDataEntity> { ...@@ -49,7 +49,7 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List<ExcelDataVO> queryListByPayUserList(List<String> userList, int caseId); List<ExcelDataVO> queryListByPayUserList(List<String> userList, int caseId);
List<AssociationVO> selectFinancialTransactions(String userName, String caseId); List<AssociationVO> selectFinancialTransactions(String userName, int caseId);
List<ExcelDataEntity> cashFlow(UserDTO userDTO); List<ExcelDataEntity> cashFlow(UserDTO userDTO);
...@@ -59,9 +59,12 @@ public interface ExcelDataService extends IService<ExcelDataEntity> { ...@@ -59,9 +59,12 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List<ExcelDataEntity> queryListByPayUserName(ExcelDataDTO excelDataDTO); List<ExcelDataEntity> queryListByPayUserName(ExcelDataDTO excelDataDTO);
List<ExcelDataEntity> queryListByPayeeName(String oldName, String caseId); List<AssociationVO> queryAccountTemporary(String userName, int caseId);
List<AssociationVO> queryAccountTemporary(String userName, String caseId);
List<ExcelDataEntity> accountCashFlow(UserDTO userDTO); List<ExcelDataEntity> accountCashFlow(UserDTO userDTO);
List<ExcelDataEntity> queryListByPayeeName(String oldName, int caseId); List<ExcelDataEntity> queryListByPayeeName(String oldName, int caseId);
void deleteByPayUserName(String nodeName);
void deleteByPayeeName(String nodeName);
} }
...@@ -15,4 +15,6 @@ public interface NodeService extends IService<NodeEntity> { ...@@ -15,4 +15,6 @@ public interface NodeService extends IService<NodeEntity> {
List<NodeVO> queryByCaseId(Integer id); List<NodeVO> queryByCaseId(Integer id);
List<NodeVO> mchRelationUser(NodeDTO nodeDTO); List<NodeVO> mchRelationUser(NodeDTO nodeDTO);
boolean deleteNode(String nodeName);
} }
...@@ -12,7 +12,7 @@ import com.platform.model.vo.UserVO; ...@@ -12,7 +12,7 @@ import com.platform.model.vo.UserVO;
import java.util.List; import java.util.List;
public interface UserService extends IService<UserEntity> { public interface UserService extends IService<UserEntity> {
UserVO getDetail(String userName,String caseId); UserVO getDetail(String userName,int caseId);
boolean updateUser(UserDTO userDTO); boolean updateUser(UserDTO userDTO);
......
...@@ -74,7 +74,7 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData ...@@ -74,7 +74,7 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
} }
@Override @Override
public List<AssociationVO> selectFinancialTransactions(String userName, String caseId) { public List<AssociationVO> selectFinancialTransactions(String userName, int caseId) {
return baseMapper.selectFinancialTransactions(userName, caseId); return baseMapper.selectFinancialTransactions(userName, caseId);
} }
...@@ -108,8 +108,20 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData ...@@ -108,8 +108,20 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
} }
@Override @Override
public List<AssociationVO> queryAccountTemporary(String userName, String caseId) { public void deleteByPayUserName(String nodeName) {
return baseMapper.queryAccountTemporary(userName,caseId); baseMapper.delete(new LambdaQueryWrapper<ExcelDataEntity>()
.eq(ExcelDataEntity::getPayUserName, nodeName));
}
@Override
public void deleteByPayeeName(String nodeName) {
baseMapper.delete(new LambdaQueryWrapper<ExcelDataEntity>()
.eq(ExcelDataEntity::getPayeeName, nodeName));
}
@Override
public List<AssociationVO> queryAccountTemporary(String userName, int caseId) {
return baseMapper.queryAccountTemporary(userName, caseId);
} }
@Override @Override
......
...@@ -28,11 +28,9 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group ...@@ -28,11 +28,9 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group
@Override @Override
public List<GroupDetailEntity> queryList(GroupDetailDTO groupDetailDTO) { public List<GroupDetailEntity> queryList(GroupDetailDTO groupDetailDTO) {
List<GroupDetailEntity> groupDetailEntityList = baseMapper.selectList(new LambdaQueryWrapper<GroupDetailEntity>() return baseMapper.selectList(new LambdaQueryWrapper<GroupDetailEntity>()
.eq(GroupDetailEntity::getGroupId, groupDetailDTO.getGroupId())); .eq(GroupDetailEntity::getGroupId, groupDetailDTO.getGroupId())
// 安全移除元素 .notLike(GroupDetailEntity::getUserName,"商户"));
groupDetailEntityList.removeIf(groupDetailEntity -> groupDetailEntity.getUserName().contains("商户"));
return groupDetailEntityList;
} }
@Override @Override
......
...@@ -70,24 +70,21 @@ public class NodeServiceImpl extends ServiceImpl<NodeMapper, NodeEntity> impleme ...@@ -70,24 +70,21 @@ public class NodeServiceImpl extends ServiceImpl<NodeMapper, NodeEntity> impleme
} }
List<NodeVO> result = Lists.newArrayList(); List<NodeVO> result = Lists.newArrayList();
excelDataEntityListNew.forEach(excelDataVO -> { excelDataEntityListNew.forEach(excelDataVO -> {
NodeVO org = new NodeVO();
if (excelDataVO.getAccountType().equals("银联")) {
org.setNode(excelDataVO.getPayUserName());
org.setNodeNum(excelDataVO.getNodeNum());
org.setBankCode(excelDataVO.getPayeeBankCard());
org.setNodeType("银联");
result.add(org);
} else {
NodeVO person = new NodeVO(); NodeVO person = new NodeVO();
person.setNode(excelDataVO.getPayUserName()); person.setNode(excelDataVO.getPayUserName());
person.setNodeNum(excelDataVO.getNodeNum()); person.setNodeNum(excelDataVO.getNodeNum());
person.setLabel(excelDataVO.getLabel()); person.setLabel(excelDataVO.getLabel());
person.setNodeType("个人"); person.setNodeType("个人");
result.add(person); result.add(person);
}
}); });
return result; return result;
} }
@Override
public boolean deleteNode(String nodeName) {
excelDataService.deleteByPayUserName(nodeName);
excelDataService.deleteByPayeeName(nodeName);
return true;
}
} }
...@@ -5,6 +5,7 @@ import cn.hutool.core.map.MapUtil; ...@@ -5,6 +5,7 @@ import cn.hutool.core.map.MapUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.common.collect.Sets; import com.google.common.collect.Sets;
import com.platform.exception.BusinessException; import com.platform.exception.BusinessException;
...@@ -43,7 +44,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -43,7 +44,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
private ExcelDataService excelDataService; private ExcelDataService excelDataService;
@Override @Override
public UserVO getDetail(String userName, String caseId) { public UserVO getDetail(String userName, int caseId) {
UserEntity userEntity = baseMapper.selectOne(new LambdaQueryWrapper<UserEntity>() UserEntity userEntity = baseMapper.selectOne(new LambdaQueryWrapper<UserEntity>()
.eq(UserEntity::getUserName, userName).eq(UserEntity::getCaseId, caseId)); .eq(UserEntity::getUserName, userName).eq(UserEntity::getCaseId, caseId));
if (ObjectUtils.isEmpty(userEntity)) { if (ObjectUtils.isEmpty(userEntity)) {
...@@ -53,7 +54,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -53,7 +54,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
} }
} }
private UserVO account(String userName, String caseId) { private UserVO account(String userName, int caseId) {
UserVO userVO = new UserVO(); UserVO userVO = new UserVO();
userVO.setUserName(userName); userVO.setUserName(userName);
userVO.setCaseId(caseId); userVO.setCaseId(caseId);
...@@ -109,7 +110,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -109,7 +110,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
} }
@NotNull @NotNull
private UserVO personnel(String userName, String caseId, UserEntity userEntity) { private UserVO personnel(String userName, int caseId, UserEntity userEntity) {
UserVO userVO = DozerUtils.convertBean(userEntity, UserVO.class); UserVO userVO = DozerUtils.convertBean(userEntity, UserVO.class);
if (userVO != null) { if (userVO != null) {
//查看用户账户列表 //查看用户账户列表
...@@ -210,7 +211,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -210,7 +211,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
excelDataList = excelDataService.cashFlow(userDTO); excelDataList = excelDataService.cashFlow(userDTO);
} else if ("2".equals(userDTO.getIdentifier())) { } else if ("2".equals(userDTO.getIdentifier())) {
excelDataList = excelDataService.accountCashFlow(userDTO); excelDataList = excelDataService.accountCashFlow(userDTO);
}else { } else {
return null; return null;
} }
for (ExcelDataEntity excelDataEntity : excelDataList) { for (ExcelDataEntity excelDataEntity : excelDataList) {
...@@ -289,6 +290,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -289,6 +290,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override @Override
public List<ExcelDataVO> queryUserLabel(List<String> userNameList, Integer id) { public List<ExcelDataVO> queryUserLabel(List<String> userNameList, Integer id) {
if (CollUtil.isEmpty(userNameList)) {
return Lists.newArrayList();
}
return baseMapper.queryUserLabel(userNameList, id); return baseMapper.queryUserLabel(userNameList, id);
} }
} }
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment