diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java b/hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java index 098e668d..a7cd3704 100644 --- a/hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java +++ b/hai-bweb/src/main/java/com/bweb/controller/HighCouponAgentController.java @@ -9,6 +9,7 @@ import com.hai.common.exception.ErrorHelp; import com.hai.common.exception.SysCode; import com.hai.common.security.SessionObject; import com.hai.common.security.UserCenter; +import com.hai.common.utils.DateUtil; import com.hai.common.utils.ResponseMsgUtil; import com.hai.entity.*; import com.hai.model.HighAgentModel; @@ -27,10 +28,8 @@ import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; -import java.util.Date; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; +import java.util.stream.Collectors; /** * @Auther: 胡锐 @@ -65,7 +64,7 @@ public class HighCouponAgentController { @RequestMapping(value = "/getAgentCount", method = RequestMethod.GET) @ResponseBody - @ApiOperation(value = "根据销售码查询详情") + @ApiOperation(value = "代理商统计") public ResponseData getAgentCount(HttpServletRequest request) { try { SessionObject sessionObject = userCenter.getSessionObject(request); @@ -84,6 +83,42 @@ public class HighCouponAgentController { } } + @RequestMapping(value = "/getAgentSalesCodeList", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "查询今天 代理商已销售的卡券") + public ResponseData getAgentSalesCodeList(HttpServletRequest request, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + SessionObject sessionObject = userCenter.getSessionObject(request); + UserInfoModel userInfoModel = (UserInfoModel) sessionObject.getObject(); + + if (userInfoModel.getHighAgent() == null) { + log.error("HighCouponAgentController -> assignCouponAgent() error!","该主角色没有权限"); + throw ErrorHelp.genException(SysCode.System, ErrorCode.MENU_TREE_HAS_NOT_ERROR, ""); + } + // 计算使用有效期 + Calendar consumeTimeS = Calendar.getInstance(); + consumeTimeS.setTime(new Date()); + consumeTimeS.set(Calendar.HOUR_OF_DAY, 00); + consumeTimeS.set(Calendar.MINUTE, 00); + consumeTimeS.set(Calendar.SECOND, 00); + + Calendar consumeTimeE = Calendar.getInstance(); + consumeTimeE.setTime(new Date()); + consumeTimeE.set(Calendar.HOUR_OF_DAY, 23); + consumeTimeE.set(Calendar.MINUTE, 59); + consumeTimeE.set(Calendar.SECOND, 59); + + PageHelper.startPage(pageNum, pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highCouponAgentService.getAgentSalesCodeList(userInfoModel.getHighAgent().getId(), DateUtil.date2String(consumeTimeS.getTime(), "yyyy-MM-dd HH:mm:ss"), DateUtil.date2String(consumeTimeE.getTime(), "yyyy-MM-dd HH:mm:ss")))); + + } catch (Exception e) { + log.error("HighCouponAgentController --> getAgentSalesCodeList() error!", e); + return ResponseMsgUtil.exception(e); + } + } + @RequestMapping(value = "/assignCouponAgent", method = RequestMethod.POST) @ResponseBody @ApiOperation(value = "分配卡券给代理商") @@ -197,12 +232,13 @@ public class HighCouponAgentController { } } - @RequestMapping(value = "/getCodeListByAgentCoupon", method = RequestMethod.GET) @ResponseBody @ApiOperation(value = "根据代理商和卡券 查询分配的销售码") public ResponseData getCodeListByAgentCoupon(@RequestParam(name = "couponId", required = true) Long couponId, @RequestParam(name = "status", required = false) String status, + @RequestParam(name = "createTimeS", required = false) Long createTimeS, + @RequestParam(name = "createTimeE", required = false) Long createTimeE, @RequestParam(name = "pageNum", required = true) Integer pageNum, @RequestParam(name = "pageSize", required = true) Integer pageSize, HttpServletRequest request) { @@ -219,6 +255,8 @@ public class HighCouponAgentController { map.put("agentId", userInfoModel.getHighAgent().getId()); map.put("couponId", couponId); map.put("status", status); + map.put("createTimeS", createTimeS); + map.put("createTimeE", createTimeE); PageHelper.startPage(pageNum,pageSize); PageInfo pageInfo = new PageInfo<>(highCouponAgentService.getCouponCodeList(map)); @@ -327,4 +365,44 @@ public class HighCouponAgentController { } } + @RequestMapping(value = "/getRecordByCouponAgentId", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据卡券与代理商关系 查询分发记录") + public ResponseData getRecordByCouponAgentId(@RequestParam(name = "couponAgentId", required = true) Long couponAgentId, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize, + HttpServletRequest request) { + try { + Map map = new HashMap<>(); + map.put("couponAgentId", couponAgentId); + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highCouponAgentService.getRecordList(map))); + + } catch (Exception e) { + log.error("HighCouponAgentController --> getRecordByCouponAgentId() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + + @RequestMapping(value = "/getCouponByRecord", method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "根据分发记录 查询卡券") + public ResponseData getCouponByRecord(@RequestParam(name = "recordId", required = true) Long recordId, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map map = new HashMap<>(); + map.put("recordId", recordId); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highCouponAgentService.getCouponAgentCodeList(map))); + + } catch (Exception e) { + log.error("HighCouponAgentController --> getCouponByRecord() error!", e); + return ResponseMsgUtil.exception(e); + } + } + + } diff --git a/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java b/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java new file mode 100644 index 00000000..2babc8a4 --- /dev/null +++ b/hai-bweb/src/main/java/com/bweb/controller/HighGoldRecController.java @@ -0,0 +1,64 @@ +package com.bweb.controller; + +import com.github.pagehelper.PageHelper; +import com.github.pagehelper.PageInfo; +import com.hai.common.security.SessionObject; +import com.hai.common.security.UserCenter; +import com.hai.common.utils.ResponseMsgUtil; +import com.hai.model.HighUserModel; +import com.hai.model.ResponseData; +import com.hai.service.HighGoldRecService; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RequestParam; +import org.springframework.web.bind.annotation.ResponseBody; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.HashMap; +import java.util.Map; + +/** + * @Auther: 胡锐 + * @Description: + * @Date: 2021/3/28 23:54 + */ +@Controller +@RequestMapping(value = "/highGoldRec") +@Api(value = "金币接口") +public class HighGoldRecController { + + private static Logger log = LoggerFactory.getLogger(HighGoldRecController.class); + + @Autowired + private UserCenter userCenter; + + @Resource + private HighGoldRecService highGoldRecService; + + @RequestMapping(value="/getUserGoldRecList",method = RequestMethod.GET) + @ResponseBody + @ApiOperation(value = "获取用户金币使用情况") + public ResponseData getUserGoldRecList(@RequestParam(name = "goldType", required = false) Integer goldType, + @RequestParam(name = "pageNum", required = true) Integer pageNum, + @RequestParam(name = "pageSize", required = true) Integer pageSize) { + try { + Map map = new HashMap<>(); + map.put("goldType", goldType); + + PageHelper.startPage(pageNum,pageSize); + return ResponseMsgUtil.success(new PageInfo<>(highGoldRecService.getGoldRec(map))); + + } catch (Exception e) { + log.error("HighCouponController -> getCouponList() error!",e); + return ResponseMsgUtil.exception(e); + } + } + +} diff --git a/hai-cweb/src/main/java/com/cweb/controller/HighGoldRecController.java b/hai-cweb/src/main/java/com/cweb/controller/HighGoldRecController.java index 96172d8f..e63858f6 100644 --- a/hai-cweb/src/main/java/com/cweb/controller/HighGoldRecController.java +++ b/hai-cweb/src/main/java/com/cweb/controller/HighGoldRecController.java @@ -31,7 +31,7 @@ import java.util.Map; */ @Controller @RequestMapping(value = "/highGoldRec") -@Api(value = "卡卷接口") +@Api(value = "金币接口") public class HighGoldRecController { private static Logger log = LoggerFactory.getLogger(HighGoldRecController.class); diff --git a/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java b/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java index 83d53beb..eb5fa565 100644 --- a/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java +++ b/hai-service/src/main/java/com/hai/dao/HighCouponAgentRelMapperExt.java @@ -1,8 +1,14 @@ package com.hai.dao; +import com.hai.entity.HighCouponAgentCode; import com.hai.model.AgentSalesModel; import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Result; +import org.apache.ibatis.annotations.Results; import org.apache.ibatis.annotations.Select; +import org.apache.ibatis.type.JdbcType; + +import java.util.List; /** @@ -18,6 +24,29 @@ public interface HighCouponAgentRelMapperExt { " and a.status = 3 and a.coupon_code_id = b.id and b.consume_time >= #{consumeTimeS} and b.consume_time <= #{consumeTimeE}") AgentSalesModel getAgentSales(@Param("agentId") Long agentId, @Param("consumeTimeS")String consumeTimeS, @Param("consumeTimeE")String consumeTimeE); + @Select(" select a.* from high_coupon_agent_code a,high_coupon_code b,high_coupon_agent_rel c " + + " where c.id = a.coupon_agent_id and c.agent_id = 8 and a.status = 3 and a.coupon_code_id = b.id " + + " and b.consume_time >= #{consumeTimeS} and b.consume_time <= #{consumeTimeE} ORDER BY b.consume_time desc") + @Results({ + @Result(column="id", property="id", jdbcType= JdbcType.BIGINT, id=true), + @Result(column="coupon_agent_id", property="couponAgentId", jdbcType=JdbcType.BIGINT), + @Result(column="coupon_id", property="couponId", jdbcType=JdbcType.BIGINT), + @Result(column="agent_id", property="agentId", jdbcType=JdbcType.BIGINT), + @Result(column="coupon_code_id", property="couponCodeId", jdbcType=JdbcType.BIGINT), + @Result(column="coupon_agent_record_id", property="couponAgentRecordId", jdbcType=JdbcType.BIGINT), + @Result(column="coupon_code", property="couponCode", jdbcType=JdbcType.VARCHAR), + @Result(column="qr_code", property="qrCode", jdbcType=JdbcType.VARCHAR), + @Result(column="status", property="status", jdbcType=JdbcType.INTEGER), + @Result(column="remark", property="remark", jdbcType=JdbcType.VARCHAR), + @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP), + @Result(column="operator_id", property="operatorId", jdbcType=JdbcType.BIGINT), + @Result(column="operator_name", property="operatorName", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_1", property="ext1", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_2", property="ext2", jdbcType=JdbcType.VARCHAR), + @Result(column="ext_3", property="ext3", jdbcType=JdbcType.VARCHAR) + }) + List getAgentSalesCodeList(@Param("agentId") Long agentId, @Param("consumeTimeS")String consumeTimeS, @Param("consumeTimeE")String consumeTimeE); + @Select(" select count(1) from high_coupon_agent_code a where a.agent_id = #{agentId} and a.`status` in (#{status}) ") Integer getAgentCodeCount(@Param("agentId") Long agentId,@Param("status") String status); } diff --git a/hai-service/src/main/java/com/hai/entity/HighGoldRec.java b/hai-service/src/main/java/com/hai/entity/HighGoldRec.java index 49a6c6ba..47f3de68 100644 --- a/hai-service/src/main/java/com/hai/entity/HighGoldRec.java +++ b/hai-service/src/main/java/com/hai/entity/HighGoldRec.java @@ -1,5 +1,7 @@ package com.hai.entity; +import com.hai.model.HighGoldRecModel; + import java.io.Serializable; import java.util.Date; @@ -12,7 +14,7 @@ import java.util.Date; * 代码由工具生成 * **/ -public class HighGoldRec implements Serializable { +public class HighGoldRec extends HighGoldRecModel implements Serializable { /** * 编号 */ diff --git a/hai-service/src/main/java/com/hai/model/HighGoldRecModel.java b/hai-service/src/main/java/com/hai/model/HighGoldRecModel.java new file mode 100644 index 00000000..8dc82c06 --- /dev/null +++ b/hai-service/src/main/java/com/hai/model/HighGoldRecModel.java @@ -0,0 +1,16 @@ +package com.hai.model; + +import com.hai.entity.HighUser; + +public class HighGoldRecModel { + + private HighUser highUser; + + public HighUser getHighUser() { + return highUser; + } + + public void setHighUser(HighUser highUser) { + this.highUser = highUser; + } +} diff --git a/hai-service/src/main/java/com/hai/service/HighCouponAgentService.java b/hai-service/src/main/java/com/hai/service/HighCouponAgentService.java index b385692c..60f1f27b 100644 --- a/hai-service/src/main/java/com/hai/service/HighCouponAgentService.java +++ b/hai-service/src/main/java/com/hai/service/HighCouponAgentService.java @@ -1,7 +1,9 @@ package com.hai.service; import com.hai.entity.HighCouponAgentCode; +import com.hai.entity.HighCouponAgentRecord; import com.hai.entity.HighCouponAgentRel; +import org.apache.ibatis.annotations.Param; import java.security.PrivateKey; import java.util.List; @@ -77,4 +79,29 @@ public interface HighCouponAgentService { * @Date 2021/4/22 22:26 **/ Map getSalesCountByAgent(Long agentId) throws Exception; + + /** + * + * @param map + * @return 查询分发记录 + * @throws Exception + */ + List getRecordList(Map map); + + /** + * 查询代理商的卡券 + * @param map + * @return + */ + List getCouponAgentCodeList(Map map); + + /** + * 根据时间查询 代理商已销售的卡券 + * @param agentId + * @param consumeTimeS + * @param consumeTimeE + * @return + */ + List getAgentSalesCodeList(Long agentId,String consumeTimeS,String consumeTimeE); + } diff --git a/hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java b/hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java index 1bfd4138..a3c60cee 100644 --- a/hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java +++ b/hai-service/src/main/java/com/hai/service/HighDiscountAgentCodeService.java @@ -46,4 +46,19 @@ public interface HighDiscountAgentCodeService { * @Date 2021/4/14 23:38 **/ HighDiscountAgentCode getCodeById(Long id); + + /** + * 查询已分配的优惠券总数 + * @param discountAgentId + * @return + */ + Integer getTotalDiscount(Long discountAgentId); + + /** + * 查询已领取的优惠券总数 + * @param discountAgentId + * @return + */ + Integer getSalesDiscount(Long discountAgentId); + } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java index 325653f2..6eceb63a 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighCouponAgentServiceImpl.java @@ -11,10 +11,7 @@ import com.hai.dao.HighCouponAgentRecordMapper; import com.hai.dao.HighCouponAgentRelMapper; import com.hai.entity.*; import com.hai.model.AgentSalesModel; -import com.hai.service.HighAgentService; -import com.hai.service.HighCouponAgentService; -import com.hai.service.HighCouponCodeService; -import com.hai.service.HighCouponService; +import com.hai.service.*; import org.apache.commons.collections4.MapUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -38,6 +35,9 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { @Resource private HighCouponAgentRelMapper highCouponAgentRelMapper; + @Resource + private HighMerchantService highMerchantService; + @Resource private HighCouponAgentCodeMapper highCouponAgentCodeMapper; @@ -161,6 +161,14 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { criteria.andAgentIdEqualTo(MapUtils.getLong(map, "agentId")); } + if (MapUtils.getLong(map, "createTimeS") != null) { + criteria.andCreateTimeGreaterThanOrEqualTo(new Date(MapUtils.getLong(map, "createTimeS"))); + } + + if (MapUtils.getLong(map, "createTimeE") != null) { + criteria.andCreateTimeLessThanOrEqualTo(new Date(MapUtils.getLong(map, "createTimeE"))); + } + if (StringUtils.isNotBlank(MapUtils.getString(map, "status"))) { String[] strings = MapUtils.getString(map, "status").split(","); List statusList = new ArrayList<>(); @@ -229,7 +237,7 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { Map listMap = new HashMap<>(); listMap.put("agentId", agentId); - List list = getCouponAgentList(listMap); + List list = getCouponAgentList(listMap).stream().sorted(Comparator.comparing(HighCouponAgentRel::getSalesPrice)).collect(Collectors.toList()); for (HighCouponAgentRel highCouponAgentRel : list) { BigDecimal surplusPrice = new BigDecimal(highCouponAgentRel.getStockCount()).multiply((highCouponAgentRel.getSalesPrice())); surplusCountPrice = surplusCountPrice.add(surplusPrice); @@ -265,4 +273,49 @@ public class HighCouponAgentServiceImpl implements HighCouponAgentService { returnMap.put("list", list); return returnMap; } + + @Override + public List getRecordList(Map map) { + HighCouponAgentRecordExample example = new HighCouponAgentRecordExample(); + HighCouponAgentRecordExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(map, "couponAgentId") != null) { + criteria.andCouponAgentIdEqualTo(MapUtils.getLong(map, "couponAgentId")); + } + + example.setOrderByClause("create_time desc"); + return highCouponAgentRecordMapper.selectByExample(example); + } + + @Override + public List getCouponAgentCodeList(Map map) { + HighCouponAgentCodeExample example = new HighCouponAgentCodeExample(); + HighCouponAgentCodeExample.Criteria criteria = example.createCriteria(); + + if (MapUtils.getLong(map, "recordId") != null) { + criteria.andCouponAgentRecordIdEqualTo(MapUtils.getLong(map, "recordId")); + } + + example.setOrderByClause("create_time desc"); + return highCouponAgentCodeMapper.selectByExample(example); + } + + @Override + public List getAgentSalesCodeList(Long agentId, String consumeTimeS, String consumeTimeE) { + List list = highCouponAgentRelMapper.getAgentSalesCodeList(agentId, consumeTimeS, consumeTimeE); + if (list != null && list.size() > 0) { + for (HighCouponAgentCode code : list) { + HighCoupon highCoupon = highCouponService.getCouponById(code.getCouponId()); + if (highCoupon != null) { + HighMerchant merchant = highMerchantService.getMerchantById(highCoupon.getMerchantId()); + code.setMerchantLogo(merchant.getMerchantLogo()); + code.setMerchantName(merchant.getMerchantName()); + } + code.setHighCoupon(highCoupon); + code.setHighCouponCode(highCouponCodeService.getCouponCodeById(code.getCouponCodeId())); + } + return list; + } + return new ArrayList<>(); + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java index 4f8377e1..86f74d37 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentCodeServiceImpl.java @@ -77,4 +77,18 @@ public class HighDiscountAgentCodeServiceImpl implements HighDiscountAgentCodeSe public HighDiscountAgentCode getCodeById(Long id) { return highDiscountAgentCodeMapper.selectByPrimaryKey(id); } + + @Override + public Integer getTotalDiscount(Long discountAgentId) { + HighDiscountAgentCodeExample example = new HighDiscountAgentCodeExample(); + example.createCriteria().andDiscountAgentIdEqualTo(discountAgentId); + return highDiscountAgentCodeMapper.selectByExample(example).size(); + } + + @Override + public Integer getSalesDiscount(Long discountAgentId) { + HighDiscountAgentCodeExample example = new HighDiscountAgentCodeExample(); + example.createCriteria().andDiscountAgentIdEqualTo(discountAgentId).andStatusNotEqualTo(1); + return highDiscountAgentCodeMapper.selectByExample(example).size(); + } } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java index 413e17c5..4c3c09a1 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighDiscountAgentRelServiceImpl.java @@ -125,6 +125,8 @@ public class HighDiscountAgentRelServiceImpl implements HighDiscountAgentRelServ for (HighDiscountAgentRel rel : list) { rel.setHighDiscount(highDiscountService.getDiscountById(rel.getDiscountId())); rel.setHighAgent(highAgentService.findByAgentMsgId(rel.getAgentId())); + // rel.setTotalCount(highDiscountAgentCodeService.getTotalDiscount(rel.getId())); + // rel.setSalesCount(highDiscountAgentCodeService.getSalesDiscount(rel.getId())); } return list; } diff --git a/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java b/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java index 5dd86b07..418c1fcd 100644 --- a/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java +++ b/hai-service/src/main/java/com/hai/service/impl/HighGoldRecServiceImpl.java @@ -4,6 +4,7 @@ import com.hai.dao.HighGoldRecMapper; import com.hai.entity.HighGoldRec; import com.hai.entity.HighGoldRecExample; import com.hai.service.HighGoldRecService; +import com.hai.service.HighUserService; import org.apache.commons.collections4.MapUtils; import org.springframework.stereotype.Service; @@ -22,6 +23,9 @@ public class HighGoldRecServiceImpl implements HighGoldRecService { @Resource private HighGoldRecMapper highGoldRecMapper; + @Resource + private HighUserService highUserService; + @Override public void insertGoldRec(HighGoldRec highGoldRec) { highGoldRecMapper.insert(highGoldRec); @@ -41,6 +45,10 @@ public class HighGoldRecServiceImpl implements HighGoldRecService { } example.setOrderByClause("create_time desc"); - return highGoldRecMapper.selectByExample(example); + List list = highGoldRecMapper.selectByExample(example); + for (HighGoldRec highGoldRec : list) { + highGoldRec.setHighUser(highUserService.findByUserId(highGoldRec.getUserId())); + } + return list; } }