From 179c4d64313c9b7572778da4aaaf6c6584fe457d Mon Sep 17 00:00:00 2001 From: mitao <2763622819@qq.com> Date: 星期二, 20 五月 2025 23:48:08 +0800 Subject: [PATCH] 修改文件上传类型限制 --- springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerMerchantServiceImpl.java | 96 ++++++++---------------------------------------- 1 files changed, 16 insertions(+), 80 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 0e32b08..37dc7af 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 @@ -12,6 +12,7 @@ import com.panzhihua.service_community.entity.VolunteerActivity; import com.panzhihua.service_community.entity.VolunteerMerchant; import com.panzhihua.service_community.entity.VolunteerType; +import com.panzhihua.service_community.service.VolunteerIntegralMerchantService; import com.panzhihua.service_community.service.VolunteerMerchantService; import com.panzhihua.service_community.service.VolunteerTypeService; import lombok.extern.slf4j.Slf4j; @@ -27,6 +28,10 @@ { @Resource private VolunteerMerchantService vmService; + + + @Resource + private VolunteerIntegralMerchantService vimService; @Override public R getById(String id) { @@ -146,84 +151,6 @@ { 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) { @@ -233,13 +160,22 @@ } @Override - public R deleteVolunteerMerchant(String id) { + public R deleteVolunteerMerchant(String id) + { + + int goodNum=vimService.getNum(id); + + if(goodNum>0) + { + return R.fail("请下架所有商铺商品"); + } + int num= baseMapper.delete(id); if(num>0) { return R.ok(); } - return R.fail("添加失败"); + return R.fail("失败"); } @Override -- Gitblit v1.7.1