Commit d6b94b5f authored by zhuxiang's avatar zhuxiang
Browse files

增加删除节点

parent 02465905
package com.platform.controller;
import com.platform.model.dto.NodeDTO;
import com.platform.model.resp.Result;
import com.platform.page.TableDataInfo;
import com.platform.service.NodeService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
......@@ -22,4 +20,9 @@ public class NodeController extends BaseController {
startPage(nodeDTO.getPageNum(), nodeDTO.getPageSize());
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 {
@ApiOperation(value = "用户详情")
@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));
}
......
......@@ -24,7 +24,7 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> {
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,
@Param("caseId") int caseId);
......@@ -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> 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);
}
......@@ -49,7 +49,7 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
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);
......@@ -59,9 +59,12 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List<ExcelDataEntity> queryListByPayUserName(ExcelDataDTO excelDataDTO);
List<ExcelDataEntity> queryListByPayeeName(String oldName, String caseId);
List<AssociationVO> queryAccountTemporary(String userName, String caseId);
List<AssociationVO> queryAccountTemporary(String userName, int caseId);
List<ExcelDataEntity> accountCashFlow(UserDTO userDTO);
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> {
List<NodeVO> queryByCaseId(Integer id);
List<NodeVO> mchRelationUser(NodeDTO nodeDTO);
boolean deleteNode(String nodeName);
}
......@@ -12,7 +12,7 @@ import com.platform.model.vo.UserVO;
import java.util.List;
public interface UserService extends IService<UserEntity> {
UserVO getDetail(String userName,String caseId);
UserVO getDetail(String userName,int caseId);
boolean updateUser(UserDTO userDTO);
......
......@@ -74,7 +74,7 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
}
@Override
public List<AssociationVO> selectFinancialTransactions(String userName, String caseId) {
public List<AssociationVO> selectFinancialTransactions(String userName, int caseId) {
return baseMapper.selectFinancialTransactions(userName, caseId);
}
......@@ -108,8 +108,20 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
}
@Override
public List<AssociationVO> queryAccountTemporary(String userName, String caseId) {
return baseMapper.queryAccountTemporary(userName,caseId);
public void deleteByPayUserName(String nodeName) {
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
......
......@@ -28,11 +28,9 @@ public class GroupDetailServiceImpl extends ServiceImpl<GroupDetailMapper, Group
@Override
public List<GroupDetailEntity> queryList(GroupDetailDTO groupDetailDTO) {
List<GroupDetailEntity> groupDetailEntityList = baseMapper.selectList(new LambdaQueryWrapper<GroupDetailEntity>()
.eq(GroupDetailEntity::getGroupId, groupDetailDTO.getGroupId()));
// 安全移除元素
groupDetailEntityList.removeIf(groupDetailEntity -> groupDetailEntity.getUserName().contains("商户"));
return groupDetailEntityList;
return baseMapper.selectList(new LambdaQueryWrapper<GroupDetailEntity>()
.eq(GroupDetailEntity::getGroupId, groupDetailDTO.getGroupId())
.notLike(GroupDetailEntity::getUserName,"商户"));
}
@Override
......
......@@ -70,24 +70,21 @@ public class NodeServiceImpl extends ServiceImpl<NodeMapper, NodeEntity> impleme
}
List<NodeVO> result = Lists.newArrayList();
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();
person.setNode(excelDataVO.getPayUserName());
person.setNodeNum(excelDataVO.getNodeNum());
person.setLabel(excelDataVO.getLabel());
person.setNodeType("个人");
result.add(person);
}
NodeVO person = new NodeVO();
person.setNode(excelDataVO.getPayUserName());
person.setNodeNum(excelDataVO.getNodeNum());
person.setLabel(excelDataVO.getLabel());
person.setNodeType("个人");
result.add(person);
});
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;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.google.common.collect.Sets;
import com.platform.exception.BusinessException;
......@@ -43,7 +44,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
private ExcelDataService excelDataService;
@Override
public UserVO getDetail(String userName, String caseId) {
public UserVO getDetail(String userName, int caseId) {
UserEntity userEntity = baseMapper.selectOne(new LambdaQueryWrapper<UserEntity>()
.eq(UserEntity::getUserName, userName).eq(UserEntity::getCaseId, caseId));
if (ObjectUtils.isEmpty(userEntity)) {
......@@ -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.setUserName(userName);
userVO.setCaseId(caseId);
......@@ -109,7 +110,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
}
@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);
if (userVO != null) {
//查看用户账户列表
......@@ -210,7 +211,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
excelDataList = excelDataService.cashFlow(userDTO);
} else if ("2".equals(userDTO.getIdentifier())) {
excelDataList = excelDataService.accountCashFlow(userDTO);
}else {
} else {
return null;
}
for (ExcelDataEntity excelDataEntity : excelDataList) {
......@@ -289,6 +290,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
@Override
public List<ExcelDataVO> queryUserLabel(List<String> userNameList, Integer id) {
if (CollUtil.isEmpty(userNameList)) {
return Lists.newArrayList();
}
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