diff --git a/admin-hanhai-vue/.env.development b/admin-hanhai-vue/.env.development index 5f60918..e1503c0 100644 --- a/admin-hanhai-vue/.env.development +++ b/admin-hanhai-vue/.env.development @@ -1,5 +1,6 @@ NODE_ENV=development -VUE_APP_API_BASE_URL=http://localhost:8000/community-admin/ +VUE_APP_API_BASE_URL=https://mulinyouni.augcl.com/community-admin/ +//VUE_APP_API_BASE_URL=http://localhost:8000/community-admin/ VUE_APP_CAS_BASE_URL=http://cas.example.org:8443/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview diff --git a/admin-hanhai-vue/.env.production b/admin-hanhai-vue/.env.production index 7ac871b..c8a0d3e 100644 --- a/admin-hanhai-vue/.env.production +++ b/admin-hanhai-vue/.env.production @@ -1,4 +1,5 @@ NODE_ENV=production -VUE_APP_API_BASE_URL=http://localhost:8000/community-admin/ +VUE_APP_API_BASE_URL=https://mulinyouni.augcl.com/community-admin/ +//VUE_APP_API_BASE_URL=http://localhost:8000/community-admin/ VUE_APP_CAS_BASE_URL=http://localhost:8888/cas VUE_APP_ONLINE_BASE_URL=http://fileview.jeecg.com/onlinePreview \ No newline at end of file diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/entity/CommunityActivityApply.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/entity/CommunityActivityApply.java index 4ff845f..f8b77db 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/entity/CommunityActivityApply.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityApply/entity/CommunityActivityApply.java @@ -5,10 +5,12 @@ import java.io.UnsupportedEncodingException; import java.util.Date; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; +import org.jeecg.modules.communityActivity.entity.CommunityActivity; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecg.common.aspect.annotation.Dict; @@ -78,4 +80,8 @@ public class CommunityActivityApply implements Serializable { @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") @ApiModelProperty(value = "关联用户") private java.lang.String userId; + + //活动信息 + @TableField(exist = false) + CommunityActivity communityActivity; } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityCollection/entity/CommunityActivityCollection.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityCollection/entity/CommunityActivityCollection.java index d0e0a41..eb7eba5 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityCollection/entity/CommunityActivityCollection.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityActivityCollection/entity/CommunityActivityCollection.java @@ -5,10 +5,12 @@ import java.io.UnsupportedEncodingException; import java.util.Date; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; +import org.jeecg.modules.communityActivity.entity.CommunityActivity; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecg.common.aspect.annotation.Dict; @@ -55,4 +57,9 @@ public class CommunityActivityCollection implements Serializable { @Excel(name = "关联用户", width = 15) @ApiModelProperty(value = "关联用户") private java.lang.String userId; + + //活动信息 + @TableField(exist = false) + CommunityActivity communityActivity; + } diff --git a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityGoodsCollection/entity/CommunityGoodsCollection.java b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityGoodsCollection/entity/CommunityGoodsCollection.java index be4b608..976b9db 100644 --- a/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityGoodsCollection/entity/CommunityGoodsCollection.java +++ b/jeecg-boot-base/jeecg-boot-base-core/src/main/java/org/jeecg/modules/communityGoodsCollection/entity/CommunityGoodsCollection.java @@ -5,10 +5,12 @@ import java.io.UnsupportedEncodingException; import java.util.Date; import java.math.BigDecimal; import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; import com.baomidou.mybatisplus.annotation.TableName; import lombok.Data; import com.fasterxml.jackson.annotation.JsonFormat; +import org.jeecg.modules.communityGoods.entity.CommunityGoods; import org.springframework.format.annotation.DateTimeFormat; import org.jeecgframework.poi.excel.annotation.Excel; import org.jeecg.common.aspect.annotation.Dict; @@ -57,4 +59,8 @@ public class CommunityGoodsCollection implements Serializable { @Dict(dictTable = "han_hai_member", dicText = "nick_name", dicCode = "id") @ApiModelProperty(value = "关联用户") private java.lang.String userId; + + //商品信息 + @TableField(exist = false) + CommunityGoods communityGoods; } diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/ActivityController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/ActivityController.java index 45ae969..c76ed91 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/ActivityController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/ActivityController.java @@ -31,13 +31,19 @@ public class ActivityController { private ActivityService activityService; /******************************************************************************************************************/ - //获取活动列表/详情 - @ApiOperation(value="活动-获取活动列表/详情", notes="活动-获取活动列表/详情") + //获取活动列表 + @ApiOperation(value="活动-获取活动列表", notes="活动-获取活动列表") @RequestMapping(value = "/queryActivityList", method = {RequestMethod.GET}) public Result queryActivityList(CommunityActivity communityActivity, PageBean pageBean){ return activityService.queryActivityList(communityActivity, pageBean); } + //获取活动详情 + @ApiOperation(value="活动-获取活动详情", notes="活动-获取活动详情") + @RequestMapping(value = "/queryActivityById", method = {RequestMethod.GET}) + public Result queryActivityById(String activityId){ + return activityService.queryActivityById(activityId); + } //收藏活动 @ApiOperation(value="活动-收藏活动", notes="活动-收藏活动") @@ -53,8 +59,8 @@ public class ActivityController { return activityService.applyActivity(token, communityActivityApply); } - //获取我收藏的活动列表/详情 - @ApiOperation(value="活动收藏-获取我收藏的活动列表/详情", notes="活动收藏-获取我收藏的活动列表/详情") + //获取我收藏的活动列表 + @ApiOperation(value="活动收藏-获取我收藏的活动列表", notes="活动收藏-获取我收藏的活动列表") @RequestMapping(value = "/queryActivityCollectionList", method = {RequestMethod.POST}) public Result queryActivityCollectionList(@RequestHeader("X-Access-Token") String token, PageBean pageBean){ return activityService.queryActivityCollectionList(token, pageBean); diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/GoodsController.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/GoodsController.java index 1c0b4dc..3cb501b 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/GoodsController.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/communityController/GoodsController.java @@ -28,15 +28,22 @@ public class GoodsController { private GoodsService goodsService; /******************************************************************************************************************/ - //获取商品列表/详情 - @ApiOperation(value="首页-获取商品列表/详情", notes="首页-获取商品列表/详情") + //获取商品列表 + @ApiOperation(value="首页-获取商品列表", notes="首页-获取商品列表") @RequestMapping(value = "/queryGoodsList", method = {RequestMethod.GET}) public Result queryGoodsList(CommunityGoods communityGoods, PageBean pageBean){ return goodsService.queryGoodsList(communityGoods, pageBean); } - //商品收藏-获取我收藏的商品列表/详情 - @ApiOperation(value="商品收藏-获取我收藏的商品列表/详情", notes="商品收藏-获取我收藏的商品列表/详情") + //获取商品详情 + @ApiOperation(value="首页-获取商品详情", notes="首页-获取商品详情") + @RequestMapping(value = "/queryGoodsById", method = {RequestMethod.GET}) + public Result queryGoodsById(String goodsId){ + return goodsService.queryGoodsById(goodsId); + } + + //商品收藏-获取我收藏的商品列表 + @ApiOperation(value="商品收藏-获取我收藏的商品列表", notes="商品收藏-获取我收藏的商品列表") @RequestMapping(value = "/queryGoodsCollectionList", method = {RequestMethod.POST}) public Result queryGoodsCollectionList(@RequestHeader("X-Access-Token") String token, PageBean pageBean){ return goodsService.queryGoodsCollectionList(token, pageBean); diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ActivityService.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ActivityService.java index 3408a8e..b8d4a3b 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ActivityService.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/ActivityService.java @@ -15,7 +15,10 @@ public interface ActivityService { //获取活动列表/详情 public Result queryActivityList(CommunityActivity communityActivity, PageBean pageBean); - //获取我收藏的活动列表/详情 + //获取活动详情 + public Result queryActivityById(String activityId); + + //获取我收藏的活动列表 public Result queryActivityCollectionList(String token, PageBean pageBean); //获取我报名的活动列表 diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/GoodsService.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/GoodsService.java index 543fe0e..0099efd 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/GoodsService.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/GoodsService.java @@ -12,9 +12,12 @@ import org.springframework.web.bind.annotation.RequestMethod; public interface GoodsService { - //获取商品列表/详情 + //获取商品列表 public Result queryGoodsList(CommunityGoods communityGoods, PageBean pageBean); + //获取商品详情 + public Result queryGoodsById(String goodsId); + //商品收藏-获取我收藏的商品列表/详情 public Result queryGoodsCollectionList(String token, PageBean pageBean); diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ActivityServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ActivityServiceImpl.java index b93db60..dd26636 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ActivityServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/ActivityServiceImpl.java @@ -48,7 +48,7 @@ public class ActivityServiceImpl implements ActivityService { private IHanHaiMemberService hanHaiMemberService; /******************************************************************************************************************/ - //获取活动列表/详情 + //获取活动列表 @Override public Result queryActivityList(CommunityActivity communityActivity, PageBean pageBean) { log.info("开始查询活动信息"); @@ -104,6 +104,32 @@ public class ActivityServiceImpl implements ActivityService { } } + //获取活动信息详情 + @Override + public Result queryActivityById(String activityId) { + log.info("开始查询活动信息详情"); + //返回信息 + String massege = ""; + + try{ + CommunityActivity one = communityActivityService + .lambdaQuery() + .eq(CommunityActivity::getId, activityId) + .one(); + if(null == one){ + log.info("活动信息不存在,请检查活动id:{}", activityId); + return Result.OK("活动信息不存在,请检查活动id:"+activityId, one); + } + + log.info("活动信息详情查询结束"); + return Result.OK("活动信息详情", one); + }catch (Exception e){ + log.info("活动信息详情查询失败"); + e.printStackTrace(); + return Result.error("活动信息详情查询失败"); + } + } + //获取我收藏的活动列表 @Override public Result queryActivityCollectionList(String token, PageBean pageBean) { @@ -121,6 +147,7 @@ public class ActivityServiceImpl implements ActivityService { Page pageList = null; try{ + //1、获取活动列表 //分页 page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); query = communityActivityCollectionService @@ -135,6 +162,15 @@ public class ActivityServiceImpl implements ActivityService { //获取活动信息 pageList = query.page(page); + //2、添加活动信息至收藏内 + for (CommunityActivityCollection record : pageList.getRecords()) { + CommunityActivity one = communityActivityService + .lambdaQuery() + .eq(CommunityActivity::getId, record.getActivityId()) + .one(); + record.setCommunityActivity(one); + } + log.info("活动信息查询结束"); return Result.OK("活动列表", pageList); }catch (Exception e){ @@ -161,6 +197,7 @@ public class ActivityServiceImpl implements ActivityService { Page pageList = null; try{ + //1、获取活动列表 //分页 page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); query = communityActivityApplyService @@ -179,6 +216,15 @@ public class ActivityServiceImpl implements ActivityService { //获取活动信息 pageList = query.page(page); + //2、添加活动信息至报名活动列表内 + for (CommunityActivityApply record : pageList.getRecords()) { + CommunityActivity one = communityActivityService + .lambdaQuery() + .eq(CommunityActivity::getId, record.getActivityId()) + .one(); + record.setCommunityActivity(one); + } + log.info("活动信息查询结束"); return Result.OK("活动列表", pageList); }catch (Exception e){ @@ -285,20 +331,31 @@ public class ActivityServiceImpl implements ActivityService { log.info("用户已报名过该活动,请勿重复报名"); return Result.OK("用户已报名过该活动,请勿重复报名"); }else { - //添加报名信息 + //3、添加报名信息 + log.info("添加报名信息"); communityActivityApply.setUserId(hanHaiMember.getId()); - boolean result = communityActivityApplyService.save(communityActivityApply); + boolean result1 = communityActivityApplyService.save(communityActivityApply); + + //4、活动添加报名人数 + log.info("活动添加报名人数"); + int oldnum = activity.getNumActivity(); + int newnum = oldnum + 1; + activity.setNumActivity(newnum); + boolean result2 = communityActivityService.updateById(activity); + //判断是否新增成功 - if(result){ + if(result1 && result2){ + log.info("活动报名成功"); return Result.OK("活动报名成功"); }else { + log.info("活动报名失败"); return Result.error("活动报名失败"); } } }catch (Exception e){ log.error("活动报名失败"); e.printStackTrace(); - return Result.error("报名失败"); + return Result.error("活动报名失败"); } } diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/GoodsServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/GoodsServiceImpl.java index 76e4e96..c0c1d63 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/GoodsServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/GoodsServiceImpl.java @@ -8,6 +8,7 @@ import org.jeecg.common.api.vo.Result; import org.jeecg.config.shiro.ShiroRealm; import org.jeecg.modules.api.bean.PageBean; import org.jeecg.modules.api.service.GoodsService; +import org.jeecg.modules.communityActivity.entity.CommunityActivity; import org.jeecg.modules.communityGoods.entity.CommunityGoods; import org.jeecg.modules.communityGoods.service.ICommunityGoodsService; import org.jeecg.modules.communityGoodsCollection.entity.CommunityGoodsCollection; @@ -47,7 +48,7 @@ public class GoodsServiceImpl implements GoodsService { private IHanHaiMemberService hanHaiMemberService; /******************************************************************************************************************/ - //获取商品列表/详情 + //获取商品列表 @Override public Result queryGoodsList(CommunityGoods communityGoods, PageBean pageBean) { log.info("开始查询商品信息"); @@ -119,13 +120,39 @@ public class GoodsServiceImpl implements GoodsService { } } + //获取商品列表 + @Override + public Result queryGoodsById(String goodsId) { + log.info("开始查询商品信息详情"); + //返回信息 + String massege = ""; + + try{ + CommunityGoods one = communityGoodsService + .lambdaQuery() + .eq(CommunityGoods::getId, goodsId) + .one(); + if(null == one){ + log.info("商品信息不存在,请检查商品id:{}", goodsId); + return Result.OK("商品信息不存在,请检查商品id:"+goodsId, one); + } + + log.info("商品信息详情查询结束"); + return Result.OK("商品信息详情", one); + }catch (Exception e){ + log.info("商品信息详情查询失败"); + e.printStackTrace(); + return Result.error("商品信息详情查询失败"); + } + } + //商品收藏-获取我收藏的商品列表/详情 @Override public Result queryGoodsCollectionList(String token, PageBean pageBean) { log.info("开始查询商品信息"); //权限验证 - HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); - //HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); + //HanHaiMember hanHaiMember = shiroRealm.checkUserTokenIsEffectHanHaiOpenId(token); + HanHaiMember hanHaiMember = hanHaiMemberService.getById(token); //返回信息 String massege = ""; //分页信息 @@ -136,6 +163,7 @@ public class GoodsServiceImpl implements GoodsService { Page pageList = null; try{ + //1、获取收藏商品列表 //分页 page = new Page(pageBean.getPageNo(), pageBean.getPageSize()); query = communityGoodsCollectionService @@ -150,6 +178,15 @@ public class GoodsServiceImpl implements GoodsService { //获取商品信息 pageList = query.page(page); + //2、将商品信息添加到收藏列表中 + for (CommunityGoodsCollection record : pageList.getRecords()) { + CommunityGoods one = communityGoodsService + .lambdaQuery() + .eq(CommunityGoods::getId, record.getGoodsId()) + .one(); + record.setCommunityGoods(one); + } + log.info("商品信息查询结束"); return Result.OK("商品列表", pageList); }catch (Exception e){ diff --git a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java index 49934af..50d4b53 100644 --- a/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java +++ b/jeecg-boot-module-system/src/main/java/org/jeecg/modules/api/service/impl/IndexServiceImpl.java @@ -140,15 +140,15 @@ public class IndexServiceImpl implements IndexService { try{ //1、查询公告详情 - CommunityNotice notice = communityNoticeService.getById(noticeId); - if(null == notice){ + CommunityNotice one = communityNoticeService.getById(noticeId); + if(null == one){ log.info("公告信息不存在,请检查公告id:{}", noticeId); - return Result.OK("公告信息不存在,请检查公告id:{}", noticeId); + return Result.OK("公告信息不存在,请检查公告id:"+noticeId, one); } //2、返回公告信息 log.info("公告信息查询结束"); - return Result.OK("公告信息", notice); + return Result.OK("公告信息", one); }catch (Exception e){ log.info("公告信息查询失败"); e.printStackTrace();