From 8b8abaaa6f3fb35772d84e873f65d242d2dcc570 Mon Sep 17 00:00:00 2001 From: ky <592468495@qq.com> Date: Wed, 6 May 2020 14:37:50 +0800 Subject: [PATCH] p --- src/main/java/com/gszc/entity/Custom.java | 5 ++++- .../com/gszc/service/impl/CustomServiceImpl.java | 13 +++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gszc/entity/Custom.java b/src/main/java/com/gszc/entity/Custom.java index e1fbe95..370aa34 100644 --- a/src/main/java/com/gszc/entity/Custom.java +++ b/src/main/java/com/gszc/entity/Custom.java @@ -1,5 +1,6 @@ package com.gszc.entity; +import com.baomidou.mybatisplus.annotations.TableField; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.Data; @@ -126,7 +127,9 @@ logout 已注销 */ @ApiModelProperty(value = "跟单员id") private String copycatId; - + @ApiModelProperty(hidden = true) + @TableField(exist = false) + private String copycatName; /** * 社会信用代码 */ diff --git a/src/main/java/com/gszc/service/impl/CustomServiceImpl.java b/src/main/java/com/gszc/service/impl/CustomServiceImpl.java index 6b76c76..c04a867 100644 --- a/src/main/java/com/gszc/service/impl/CustomServiceImpl.java +++ b/src/main/java/com/gszc/service/impl/CustomServiceImpl.java @@ -55,6 +55,9 @@ public class CustomServiceImpl extends ServiceImpl impleme @Autowired InvoiceHeaderMapper invoiceHeaderMapper; + @Autowired + PcUserServiceImpl pcUserService; + public void customRegister(Custom custom,List customSupports){ String id = Uuid8Utils.generateShortUUID(); custom.setId(id); @@ -135,6 +138,11 @@ public class CustomServiceImpl extends ServiceImpl impleme Integer count = customMapper.selectCount(new EntityWrapper().eq("status_code", "disable")); List customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "disable")); + for(Custom custom:customs){ + String copycatId = custom.getCopycatId(); + PcUser pcUser = pcUserService.pcUserDetail(copycatId); + custom.setCopycatName(pcUser.getName()); + } JSONObject jsonObject = new JSONObject(); jsonObject.put("count",count); jsonObject.put("customs",customs); @@ -151,6 +159,11 @@ public class CustomServiceImpl extends ServiceImpl impleme Integer count = customMapper.selectCount(new EntityWrapper().eq("status_code", "enable")); List customs = customMapper.selectPage(new RowBounds((pageNum-1)*pageSize,pageSize),new EntityWrapper().eq("status_code", "enable")); + for(Custom custom:customs){ + String copycatId = custom.getCopycatId(); + PcUser pcUser = pcUserService.pcUserDetail(copycatId); + custom.setCopycatName(pcUser.getName()); + } JSONObject jsonObject = new JSONObject(); jsonObject.put("count",count); jsonObject.put("customs",customs);