lidongdong
2023-09-04 b2fce0dc7dc4ea5dec9792a2bc3ceb9d33d6e07b
springcloud_k8s_panzhihuazhihuishequ/service_community/src/main/java/com/panzhihua/service_community/service/impl/VolunteerMerchantServiceImpl.java
@@ -17,11 +17,22 @@
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
@Slf4j
@Service
public class VolunteerMerchantServiceImpl extends ServiceImpl<VolunteerMerchantDao,
        VolunteerMerchant> implements VolunteerMerchantService {
        VolunteerMerchant> implements VolunteerMerchantService
{
    @Resource
    private VolunteerMerchantService vmService;
    @Override
    public R getById(String id) {
        return R.ok(baseMapper.getById(id));
    }
    @Override
    public R volunteerMerchantGetList(int pageNum, int pageSize, String merchantState,
                                      String merchantType, String name, String communityId) {
@@ -108,10 +119,16 @@
            return R.fail("法人联系电话不能为空");
        }
        if(StringUtils.isEmpty(vtvo.getLegalPersonIdCard()))
        {
            return R.fail("法人身份证不能为空");
        }
        R<String> isM=vmService.isMerchant(vtvo.getUserId());
        if(!StringUtils.isEmpty(isM.getData()))
        {
            return R.fail("已有商家!不能重复添加");
        }
        int num= baseMapper.insertData(vtvo);
@@ -129,84 +146,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)
        {
@@ -226,6 +165,11 @@
    }
    @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));