From a1ba84efcddcef8f19de26b5f34f9fa2df2c0582 Mon Sep 17 00:00:00 2001 From: lidongdong <1459917685@qq.com> Date: 星期三, 30 八月 2023 15:46:18 +0800 Subject: [PATCH] 新增小程序商家商品列表 商品详情接口 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerMerchantServiceImpl.java | 231 +++++++++++++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 214 insertions(+), 17 deletions(-) diff --git a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerMerchantServiceImpl.java b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerMerchantServiceImpl.java index addcff6..9d0b9bc 100644 --- a/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerMerchantServiceImpl.java +++ b/springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerMerchantServiceImpl.java @@ -3,9 +3,12 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.panzhihua.common.model.vos.R; +import com.panzhihua.common.model.vos.community.VolunteerMerchantVO; import com.panzhihua.common.model.vos.community.VolunteerTypeVO; +import com.panzhihua.common.utlis.StringUtils; import com.panzhihua.service_community.dao.VolunteerMerchantDao; import com.panzhihua.service_community.dao.VolunteerTypeDao; +import com.panzhihua.service_community.entity.SysUser; import com.panzhihua.service_community.entity.VolunteerActivity; import com.panzhihua.service_community.entity.VolunteerMerchant; import com.panzhihua.service_community.entity.VolunteerType; @@ -18,35 +21,229 @@ @Slf4j @Service public class VolunteerMerchantServiceImpl extends ServiceImpl<VolunteerMerchantDao, - VolunteerMerchant> implements VolunteerMerchantService { + VolunteerMerchant> implements VolunteerMerchantService +{ + + + @Override - public R volunteerMerchantGetList(int pageNum, int pageSize, String type) { - return null; + public R getById(String id) { + return R.ok(baseMapper.getById(id)); } @Override - public R insertVolunteerMerchant(VolunteerTypeVO volunteerTypeVO) { - return null; + public R volunteerMerchantGetList(int pageNum, int pageSize, String merchantState, + String merchantType, String name, String communityId) { + Page page=new Page<VolunteerMerchant>(pageNum,pageSize); + return R.ok(baseMapper.getList(page, merchantState,merchantType,name,communityId)); } @Override - public R updateVolunteerMerchant(VolunteerTypeVO volunteerTypeVO) { - return null; + public R insertVolunteerMerchant(VolunteerMerchantVO vtvo) + { + if(vtvo==null) + { + return R.fail("参数不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getName())) + { + return R.fail("商家姓名不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getBusinessType())) + { + return R.fail("商家类型不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getLogoUrl())) + { + return R.fail("商家logo封面不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getAddress())) + { + return R.fail("商家地址不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getLat())) + { + return R.fail("商家经纬度不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getUserId())) + { + return R.fail("管理员不能为空"); + } + + + if(vtvo.getBusinessStartTime()==null || vtvo.getBusinessEndTime()==null ) + { + return R.fail("营业时间不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getMerchantType())) + { + return R.fail("营业状态不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getServiceCall())) + { + return R.fail("对外服务电话不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getMerchantContent())) + { + return R.fail("商家简介不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getMerchantUrl())) + { + return R.fail("商家图片不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getLegalPersonName())) + { + return R.fail("法人代表不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getLegalPersonPhone())) + { + return R.fail("法人联系电话不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getLegalPersonIdCard())) + { + return R.fail("法人身份证不能为空"); + } + + int num= baseMapper.insertData(vtvo); + if(num>0) + { + return R.ok(); + } + return R.fail("添加失败"); + } + + @Override + public R updateVolunteerMerchant(VolunteerMerchantVO vtvo) + { + if(vtvo==null) + { + return R.fail("参数不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getName())) + { + return R.fail("商家姓名不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getBusinessType())) + { + return R.fail("商家类型不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getLogoUrl())) + { + return R.fail("商家logo封面不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getAddress())) + { + return R.fail("商家地址不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getLat())) + { + return R.fail("商家经纬度不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getUserId())) + { + return R.fail("管理员不能为空"); + } + + + if(vtvo.getBusinessStartTime()==null || vtvo.getBusinessEndTime()==null ) + { + return R.fail("营业时间不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getMerchantType())) + { + return R.fail("营业状态不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getServiceCall())) + { + return R.fail("对外服务电话不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getMerchantContent())) + { + return R.fail("商家简介不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getMerchantUrl())) + { + return R.fail("商家图片不能为空"); + } + + + if(StringUtils.isEmpty(vtvo.getLegalPersonName())) + { + return R.fail("法人代表不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getLegalPersonPhone())) + { + return R.fail("法人联系电话不能为空"); + } + + if(StringUtils.isEmpty(vtvo.getLegalPersonIdCard())) + { + return R.fail("法人身份证不能为空"); + } + + + int num= baseMapper.Update(vtvo); + if(num>0) + { + return R.ok(); + } + return R.fail("添加失败"); } @Override public R deleteVolunteerMerchant(String id) { - return null; + int num= baseMapper.delete(id); + if(num>0) + { + return R.ok(); + } + return R.fail("添加失败"); + } + + @Override + public R isMerchant(String userId) { + return R.ok(baseMapper.isMerchant(userId)); + } + + @Override + public R getUser(String communityId, String userName, String userPhone) + { + return R.ok(baseMapper.getUser(communityId,userName,userPhone)); } -// @Override -// public R volunteerTypeDelete(String id) { -// int num= baseMapper.volunteerTypeDelete(id); -// if(num>0) -// { -// return R.ok(); -// } -// return R.fail("添加失败"); -// } } -- Gitblit v1.7.1