Commit c3d54feb authored by wujipeng's avatar wujipeng
Browse files

人与人关系弹框分页-优化

parent a6575947
...@@ -40,4 +40,6 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> { ...@@ -40,4 +40,6 @@ public interface ExcelDataMapper extends BaseMapper<ExcelDataEntity> {
List<ExcelDataEntity> queryListByPayeeNameAndPayUserName(@Param("payeeName") String payeeName, @Param("caseId") int caseId); List<ExcelDataEntity> queryListByPayeeNameAndPayUserName(@Param("payeeName") String payeeName, @Param("caseId") int caseId);
List<ExcelDataVO> queryListByGroupId(CaseDTO caseDTO); List<ExcelDataVO> queryListByGroupId(CaseDTO caseDTO);
List<ExcelDataVO> queryOtherAccountList(@Param("otherUserName") String otherUserName, @Param("caseId") int caseId);
} }
...@@ -73,4 +73,5 @@ public interface ExcelDataService extends IService<ExcelDataEntity> { ...@@ -73,4 +73,5 @@ public interface ExcelDataService extends IService<ExcelDataEntity> {
List<ExcelDataVO> queryListByGroupId(CaseDTO caseDTO); List<ExcelDataVO> queryListByGroupId(CaseDTO caseDTO);
List<ExcelDataEntity> queryListByCaseIdAndPayeeName(int caseId, String payUserName); List<ExcelDataEntity> queryListByCaseIdAndPayeeName(int caseId, String payUserName);
List<ExcelDataVO> queryOtherAccountList(String otherUserName, int caseId);
} }
...@@ -2,6 +2,7 @@ package com.platform.service; ...@@ -2,6 +2,7 @@ package com.platform.service;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.platform.model.entity.UserAccountEntity; import com.platform.model.entity.UserAccountEntity;
import com.platform.model.vo.ExcelDataVO;
import java.util.List; import java.util.List;
......
...@@ -145,4 +145,9 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData ...@@ -145,4 +145,9 @@ public class ExcelDataServiceImpl extends ServiceImpl<ExcelDataMapper, ExcelData
public List<ExcelDataEntity> accountCashFlow(UserDTO userDTO) { public List<ExcelDataEntity> accountCashFlow(UserDTO userDTO) {
return baseMapper.accountCashFlow(userDTO); return baseMapper.accountCashFlow(userDTO);
} }
@Override
public List<ExcelDataVO> queryOtherAccountList(String otherUserName, int caseId) {
return baseMapper.queryOtherAccountList(otherUserName,caseId);
}
} }
...@@ -241,16 +241,22 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -241,16 +241,22 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
public EveryoneVO relationPage(UserDTO userDTO) { public EveryoneVO relationPage(UserDTO userDTO) {
EveryoneVO everyoneVO = new EveryoneVO(); EveryoneVO everyoneVO = new EveryoneVO();
//标题 //标题
everyoneVO.setTitle(userDTO.getUserName() + "," + userDTO.getOtherName()); everyoneVO.setTitle(userDTO.getUserName() + "," + userDTO.getOtherUserName());
//查询关系 //查询关系
List<UserRelationEntity> userRelation = userRelationService.bothSides(userDTO.getUserName(), userDTO.getOtherName()); List<UserRelationEntity> userRelation = userRelationService.bothSides(userDTO.getUserName(), userDTO.getOtherUserName());
//指认关系 //指认关系
if (!ObjectUtils.isEmpty(userRelation)) { if (!ObjectUtils.isEmpty(userRelation)) {
everyoneVO.setRelation(userRelation); everyoneVO.setRelation(userRelation);
} }
//查询账户 //查询账户
List<String> oneselfAccountList = userAccountService.queryUserAccountList(userDTO.getUserName()); List<String> oneselfAccountList = userAccountService.queryUserAccountList(userDTO.getUserName());
List<String> otherAccountList = userAccountService.queryUserAccountList(userDTO.getOtherName()); List<ExcelDataVO> ExcelDataList = excelDataService.queryOtherAccountList(userDTO.getOtherUserName(), userDTO.getCaseId());
Set<String> otherAccountSet = new HashSet<>();
for (ExcelDataVO excelDataVO : ExcelDataList) {
otherAccountSet.add(excelDataVO.getPayAccount());
otherAccountSet.add(excelDataVO.getPaymentAccount());
}
List<String> otherAccountList = Lists.newArrayList(otherAccountSet);
PageHelper.startPage(userDTO.getPageNum(), userDTO.getPageSize()); PageHelper.startPage(userDTO.getPageNum(), userDTO.getPageSize());
...@@ -280,11 +286,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme ...@@ -280,11 +286,11 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, UserEntity> impleme
outTotal += detail.getAmount(); outTotal += detail.getAmount();
} }
} }
totalDescription.add(userDTO.getUserName() + "向" + userDTO.getOtherName() + "转账" + outCount + "次,合计" + outTotal + "元;"); totalDescription.add(userDTO.getUserName() + "向" + userDTO.getOtherUserName() + "转账" + outCount + "次,合计" + outTotal + "元;");
totalDescription.add(userDTO.getOtherName() + "向" + userDTO.getUserName() + "转账" + inCount + "次,合计" + inTotal + "元;"); totalDescription.add(userDTO.getOtherUserName() + "向" + userDTO.getUserName() + "转账" + inCount + "次,合计" + inTotal + "元;");
} else { } else {
totalDescription.add(userDTO.getUserName() + "向" + userDTO.getOtherName() + "转账0次,合计0元;"); totalDescription.add(userDTO.getUserName() + "向" + userDTO.getOtherUserName() + "转账0次,合计0元;");
totalDescription.add(userDTO.getOtherName() + "向" + userDTO.getUserName() + "转账0次,合计0元;"); totalDescription.add(userDTO.getOtherUserName() + "向" + userDTO.getUserName() + "转账0次,合计0元;");
} }
everyoneVO.setTotalDescription(totalDescription); everyoneVO.setTotalDescription(totalDescription);
return everyoneVO; return everyoneVO;
......
...@@ -167,7 +167,7 @@ ...@@ -167,7 +167,7 @@
</if> </if>
</select> </select>
<select id="relationPage" resultType="com.platform.model.entity.ExcelDataEntity"> <select id="relationPage" resultType="com.platform.model.entity.ExcelDataEntity">
SELECT amount, time, payee_account, payment_account SELECT distinct direction, amount, time, payee_account, payment_account
FROM excel_data FROM excel_data
WHERE WHERE
(payee_account IN (payee_account IN
...@@ -357,4 +357,15 @@ ...@@ -357,4 +357,15 @@
</if> </if>
group by ed.pay_user_name,ed.payee_name group by ed.pay_user_name,ed.payee_name
</select> </select>
<select id="queryOtherAccountList" resultType="com.platform.model.vo.ExcelDataVO">
SELECT
payee_account,
payment_account
from
excel_data
where
case_id = #{caseId}
and
payee_name = #{otherUserName}
</select>
</mapper> </mapper>
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