111
k94314517
2025-07-18 9923d2fee1010fe3e0dd7167c38107da16a7b2f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
package com.doumee.service.business.impl;
 
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.config.wx.SendWxMessage;
import com.doumee.core.annotation.excel.ExcelColumn;
import com.doumee.core.constants.Constants;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.LoginUserInfo;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.IdentityInfoMapper;
import com.doumee.dao.business.MemberMapper;
import com.doumee.dao.business.model.IdentityInfo;
import com.doumee.dao.business.model.Member;
import com.doumee.dao.dto.AuditDTO;
import com.doumee.dao.system.model.SystemUser;
import com.doumee.service.business.IdentityInfoService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.github.yulichang.wrapper.MPJLambdaWrapper;
import io.swagger.annotations.ApiModelProperty;
import me.chanjar.weixin.common.error.WxErrorException;
import nonapi.io.github.classgraph.json.Id;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.CollectionUtils;
 
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Objects;
 
/**
 * 会员身份认证信息表Service实现
 * @author 江蹄蹄
 * @date 2025/07/09 12:00
 */
@Service
public class IdentityInfoServiceImpl implements IdentityInfoService {
 
    @Autowired
    private IdentityInfoMapper identityInfoMapper;
    @Autowired
    private MemberMapper memberMapper;
    @Autowired
    private SystemDictDataBiz systemDictDataBiz;
 
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public Integer create(IdentityInfo identityInfo) {
        if(Objects.isNull(identityInfo)
            || Objects.isNull(identityInfo.getType())
            || Objects.isNull(identityInfo.getMemberId())
            || Objects.isNull(identityInfo.getAuthType())
                || StringUtils.isEmpty(identityInfo.getLinkName())
                || StringUtils.isEmpty(identityInfo.getTelephone())
                || StringUtils.isEmpty(identityInfo.getLocation())
                || StringUtils.isEmpty(identityInfo.getImg1())
                || Objects.isNull(identityInfo.getLat())
                || Objects.isNull(identityInfo.getLgt())
                || (Constants.equalsInteger(identityInfo.getAuthType(),Constants.ONE) && StringUtils.isEmpty(identityInfo.getCompanyName()))
                || (Constants.equalsInteger(identityInfo.getAuthType(),Constants.ZERO) && StringUtils.isEmpty(identityInfo.getImg2()))
                || (Constants.equalsInteger(identityInfo.getAuthType(),Constants.ONE) && Constants.equalsInteger(identityInfo.getType(),Constants.ONE) && StringUtils.isEmpty(identityInfo.getImg2()))
                || (Constants.equalsInteger(identityInfo.getAuthType(),Constants.ONE) && Constants.equalsInteger(identityInfo.getType(),Constants.TWO) && (StringUtils.isEmpty(identityInfo.getImg2())||StringUtils.isEmpty(identityInfo.getImg3())))
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        if(Objects.nonNull(identityInfo.getId())){
            this.updateById(identityInfo);
        }else{
            //查询用户是否已存在当前身份
            if(identityInfoMapper.selectCount(new QueryWrapper<IdentityInfo>().lambda()
                    .eq(IdentityInfo::getDeleted,Constants.ZERO)
                    .eq(IdentityInfo::getMemberId,identityInfo.getMemberId())
                    .eq(IdentityInfo::getType,identityInfo.getType()))>Constants.ZERO){
                throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已存在该身份请刷新查看!");
            };
            identityInfo.setDeleted(Constants.ZERO);
            identityInfo.setCreateTime(new Date());
            identityInfo.setUpdateTime(identityInfo.getCreateTime());
            identityInfo.setAuditStatus(Constants.ONE);
            identityInfoMapper.insert(identityInfo);
 
            memberMapper.update(new UpdateWrapper<Member>().lambda()
                    .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity,Constants.ONE)
                    .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity,Constants.ONE)
                    .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity,Constants.ONE)
                    .eq(Member::getId,identityInfo.getMemberId()));
        }
        return identityInfo.getId();
    }
 
    @Override
    public void deleteById(Integer id) {
        identityInfoMapper.deleteById(id);
    }
 
    @Override
    public void delete(IdentityInfo identityInfo) {
        UpdateWrapper<IdentityInfo> deleteWrapper = new UpdateWrapper<>(identityInfo);
        identityInfoMapper.delete(deleteWrapper);
    }
 
    @Override
    public void deleteByIdInBatch(List<Integer> ids) {
        if (CollectionUtils.isEmpty(ids)) {
            return;
        }
        identityInfoMapper.deleteBatchIds(ids);
    }
 
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public void updateById(IdentityInfo identityInfo) {
        if(Objects.isNull(identityInfo)
                || Objects.isNull(identityInfo.getId())
                || Objects.isNull(identityInfo.getType())
                || Objects.isNull(identityInfo.getMemberId())
                || Objects.isNull(identityInfo.getAuthType())
                || StringUtils.isEmpty(identityInfo.getLinkName())
                || StringUtils.isEmpty(identityInfo.getTelephone())
                || StringUtils.isEmpty(identityInfo.getLocation())
                || StringUtils.isEmpty(identityInfo.getImg1())
                || Objects.isNull(identityInfo.getLat())
                || Objects.isNull(identityInfo.getLgt())
                || (Constants.equalsInteger(identityInfo.getAuthType(),Constants.ONE) && StringUtils.isEmpty(identityInfo.getCompanyName()))
                || (Constants.equalsInteger(identityInfo.getAuthType(),Constants.ZERO) && StringUtils.isEmpty(identityInfo.getImg2()))
                || (Constants.equalsInteger(identityInfo.getAuthType(),Constants.ONE) && Constants.equalsInteger(identityInfo.getType(),Constants.ONE) && StringUtils.isEmpty(identityInfo.getImg2()))
                || (Constants.equalsInteger(identityInfo.getAuthType(),Constants.ONE) && Constants.equalsInteger(identityInfo.getType(),Constants.TWO) && (StringUtils.isEmpty(identityInfo.getImg2())||StringUtils.isEmpty(identityInfo.getImg3())))
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        IdentityInfo model = identityInfoMapper.selectById(identityInfo.getId());
        if (Objects.isNull(model)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!Constants.equalsInteger(model.getMemberId(),identityInfo.getMemberId())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非您的数据无法进行该操作");
        }
        if(!Constants.equalsInteger(model.getAuditStatus(),Constants.THREE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前状态无法进行该操作");
        }
        identityInfo.setUpdateTime(new Date());
        identityInfo.setAuditStatus(Constants.ONE);
        identityInfoMapper.updateById(identityInfo);
        memberMapper.update(new UpdateWrapper<Member>().lambda()
                .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity,Constants.ONE)
                .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity,Constants.ONE)
                .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity,Constants.ONE)
                .eq(Member::getId,identityInfo.getMemberId()));
    }
 
 
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public void updateLocation(IdentityInfo identityInfo) {
        if(Objects.isNull(identityInfo)
                || Objects.isNull(identityInfo.getId())
                || Objects.isNull(identityInfo.getMemberId())
                || StringUtils.isEmpty(identityInfo.getLocation())
                || Objects.isNull(identityInfo.getLat())
                || Objects.isNull(identityInfo.getLgt())
        ){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        IdentityInfo model = identityInfoMapper.selectById(identityInfo.getId());
        if (Objects.isNull(model)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!Constants.equalsInteger(model.getMemberId(),identityInfo.getMemberId())){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"非您的数据无法进行该操作");
        }
        if(!Constants.equalsInteger(model.getAuditStatus(),Constants.TWO)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"当前状态无法进行该操作");
        }
        model.setLocation(identityInfo.getLocation());
        model.setLat(identityInfo.getLat());
        model.setLgt(identityInfo.getLgt());
        model.setUpdateTime(new Date());
        identityInfoMapper.updateById(model);
    }
 
    @Override
    public void updateByIdInBatch(List<IdentityInfo> identityInfos) {
        if (CollectionUtils.isEmpty(identityInfos)) {
            return;
        }
        for (IdentityInfo identityInfo: identityInfos) {
            this.updateById(identityInfo);
        }
    }
 
    @Override
    public IdentityInfo findById(Integer id) {
        IdentityInfo model = identityInfoMapper.selectById(id);
        String path  = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
                +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INENTITY_FILES).getCode();
        model.setImgList(new ArrayList<>());
        if(StringUtils.isNotBlank(model.getImg1())){
            model.getImgList().add(path + model.getImg1());
        }
        if(StringUtils.isNotBlank(model.getImg2())){
            model.getImgList().add(path + model.getImg2());
        }
        if(StringUtils.isNotBlank(model.getImg3())) {
            model.getImgList().add(path + model.getImg3());
        }
        if(StringUtils.isNotBlank(model.getImg4())){
            model.getImgList().add(path + model.getImg4());
        }
        return model;
    }
 
 
    @Override
    public IdentityInfo findByMemberType(Integer type,Integer memberId){
        IdentityInfo model = identityInfoMapper.selectOne(new QueryWrapper<IdentityInfo>().lambda()
                .eq(IdentityInfo::getMemberId,memberId).eq(IdentityInfo::getType,type));
        if(Objects.nonNull(model)){
            String path  = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
                    +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INENTITY_FILES).getCode();
            model.setImgList(new ArrayList<>());
            if(StringUtils.isNotBlank(model.getImg1())){
                model.getImgList().add(path + model.getImg1());
            }
            if(StringUtils.isNotBlank(model.getImg2())){
                model.getImgList().add(path + model.getImg2());
            }
            if(StringUtils.isNotBlank(model.getImg3())) {
                model.getImgList().add(path + model.getImg3());
            }
            if(StringUtils.isNotBlank(model.getImg4())){
                model.getImgList().add(path + model.getImg4());
            }
        }else{
            model = new IdentityInfo();
        }
        return model;
    }
 
 
 
    @Override
    public IdentityInfo findOne(IdentityInfo identityInfo) {
        QueryWrapper<IdentityInfo> wrapper = new QueryWrapper<>(identityInfo);
        return identityInfoMapper.selectOne(wrapper);
    }
 
    @Override
    public List<IdentityInfo> findList(IdentityInfo identityInfo) {
        QueryWrapper<IdentityInfo> wrapper = new QueryWrapper<>(identityInfo);
        return identityInfoMapper.selectList(wrapper);
    }
  
    @Override
    public List<IdentityInfo> findMemberList(IdentityInfo identityInfo) {
        if(identityInfo.getMemberId() == null){
            return  new ArrayList<>();
        }
        Member member = memberMapper.selectById(identityInfo.getMemberId());
        if(identityInfo == null || Constants.equalsInteger(member.getDeleted(),Constants.ONE)){
            return  new ArrayList<>();
        }
        List<IdentityInfo> list = new ArrayList<>();
 
        String path  = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
                +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INENTITY_FILES).getCode();
        //类型:0=用工身份;1=货运身份;2=供餐身份;
        if(!Constants.equalsInteger(member.getWorkerIdentity(),Constants.ZERO)){//用工身份
            addMemberModelByType(member.getId(),Constants.ZERO,list,path);
        }
        if(!Constants.equalsInteger(member.getDriverIdentity(),Constants.ZERO)){//货运身份
            addMemberModelByType(member.getId(),Constants.ONE,list,path);
        }
        if(!Constants.equalsInteger(member.getChefIdentity(),Constants.ZERO)){//供餐很粉
            addMemberModelByType(member.getId(),Constants.TWO,list,path);
        }
 
        return list;
    }
 
    private void addMemberModelByType(Integer id,Integer type, List<IdentityInfo> list,String path) {
        MPJLambdaWrapper<IdentityInfo> wrapper = new MPJLambdaWrapper<IdentityInfo>()
                .selectAll(IdentityInfo.class)
                .selectAs(SystemUser::getUsername,IdentityInfo::getEditorName)
                .leftJoin(SystemUser.class,SystemUser::getId,IdentityInfo::getUpdateUser)
                .orderByDesc(IdentityInfo::getCreateTime )//取最新一条
                .eq(IdentityInfo::getMemberId,id)
                .eq(IdentityInfo::getType,type)
                .eq(IdentityInfo::getDeleted,Constants.ZERO)
                .last("limit 1");
         IdentityInfo model = identityInfoMapper.selectJoinOne(IdentityInfo.class,wrapper);
         if(model !=null){
            initModelImage(model,path);
             list.add(model);
         }
    }
 
    @Override
    public PageData<IdentityInfo> findPage(PageWrap<IdentityInfo> pageWrap) {
        IPage<IdentityInfo> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity());
        MPJLambdaWrapper<IdentityInfo> queryWrapper = new MPJLambdaWrapper<>();
        Utils.MP.blankToNull(pageWrap.getModel());
        pageWrap.getModel().setDeleted(Constants.ZERO);
        queryWrapper.selectAll(IdentityInfo.class)
                .selectAs(Member::getNickName,IdentityInfo::getMemberName)
                .selectAs(Member::getOpenid,IdentityInfo::getOpenid)
                .selectAs(SystemUser::getUsername,IdentityInfo::getEditorName)
                .leftJoin(Member.class,Member::getId,IdentityInfo::getMemberId)
                .leftJoin(SystemUser.class,SystemUser::getId,IdentityInfo::getUpdateUser);
        if (pageWrap.getModel().getId() != null) {
            queryWrapper.eq(IdentityInfo::getId, pageWrap.getModel().getId());
        }
        if (pageWrap.getModel().getDeleted() != null) {
            queryWrapper.eq(IdentityInfo::getDeleted, pageWrap.getModel().getDeleted());
        }
        if (pageWrap.getModel().getCreateUser() != null) {
            queryWrapper.eq(IdentityInfo::getCreateUser, pageWrap.getModel().getCreateUser());
        }
        if (pageWrap.getModel().getCreateTime() != null) {
            queryWrapper.ge(IdentityInfo::getCreateTime, Utils.Date.getStart(pageWrap.getModel().getCreateTime()));
            queryWrapper.le(IdentityInfo::getCreateTime, Utils.Date.getEnd(pageWrap.getModel().getCreateTime()));
        }
        if (pageWrap.getModel().getUpdateUser() != null) {
            queryWrapper.eq(IdentityInfo::getUpdateUser, pageWrap.getModel().getUpdateUser());
        }
        if (pageWrap.getModel().getUpdateTime() != null) {
            queryWrapper.ge(IdentityInfo::getUpdateTime, Utils.Date.getStart(pageWrap.getModel().getUpdateTime()));
            queryWrapper.le(IdentityInfo::getUpdateTime, Utils.Date.getEnd(pageWrap.getModel().getUpdateTime()));
        }
        if (pageWrap.getModel().getRemark() != null) {
            queryWrapper.like(IdentityInfo::getRemark, pageWrap.getModel().getRemark());
        }
        if (pageWrap.getModel().getType() != null) {
            queryWrapper.eq(IdentityInfo::getType, pageWrap.getModel().getType());
        }
        if (pageWrap.getModel().getMemberId() != null) {
            queryWrapper.eq(IdentityInfo::getMemberId, pageWrap.getModel().getMemberId());
        }
        if (pageWrap.getModel().getAuthType() != null) {
            queryWrapper.eq(IdentityInfo::getAuthType, pageWrap.getModel().getAuthType());
        }
        if (pageWrap.getModel().getLinkName() != null) {
            queryWrapper.like(IdentityInfo::getLinkName, pageWrap.getModel().getLinkName());
        }
        if (pageWrap.getModel().getTelephone() != null) {
            queryWrapper.like(IdentityInfo::getTelephone, pageWrap.getModel().getTelephone());
        }
        if (pageWrap.getModel().getLocation() != null) {
            queryWrapper.like(IdentityInfo::getLocation, pageWrap.getModel().getLocation());
        }
        if (pageWrap.getModel().getCompanyName() != null) {
            queryWrapper.like(IdentityInfo::getCompanyName, pageWrap.getModel().getCompanyName());
        }
        if (pageWrap.getModel().getLat() != null) {
            queryWrapper.eq(IdentityInfo::getLat, pageWrap.getModel().getLat());
        }
        if (pageWrap.getModel().getLgt() != null) {
            queryWrapper.eq(IdentityInfo::getLgt, pageWrap.getModel().getLgt());
        }
        if (pageWrap.getModel().getAuditStatus() != null) {
            queryWrapper.eq(IdentityInfo::getAuditStatus, pageWrap.getModel().getAuditStatus());
        }
        if (pageWrap.getModel().getAuditTime() != null) {
            queryWrapper.ge(IdentityInfo::getAuditTime, Utils.Date.getStart(pageWrap.getModel().getAuditTime()));
            queryWrapper.le(IdentityInfo::getAuditTime, Utils.Date.getEnd(pageWrap.getModel().getAuditTime()));
        }
        if (pageWrap.getModel().getAuditRemark() != null) {
            queryWrapper.like(IdentityInfo::getAuditRemark, pageWrap.getModel().getAuditRemark());
        }
        queryWrapper.orderByAsc(IdentityInfo::getAuditStatus );
        queryWrapper.orderByDesc(IdentityInfo::getCreateTime );
        PageData<IdentityInfo> result = PageData.from(identityInfoMapper.selectJoinPage(page,IdentityInfo.class, queryWrapper));
        if(result!=null && result.getRecords()!=null){
            String path  = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode()
                    +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.INENTITY_FILES).getCode();
            for (IdentityInfo model :result.getRecords()){
                initModelImage(model,path);
            }
        }
 
        return result;
 
    }
 
    private void initModelImage(IdentityInfo model, String path) {
        model.setImgList(new ArrayList<>());
        if(StringUtils.isNotBlank(model.getImg1())){
            model.setImg1(path+model.getImg1());
            model.getImgList().add(model.getImg1());
        }
        if(StringUtils.isNotBlank(model.getImg2())){
            model.setImg2(path+model.getImg2());
            model.getImgList().add(model.getImg2());
        }
        if(StringUtils.isNotBlank(model.getImg3())) {
            model.setImg3(path + model.getImg3());
            model.getImgList().add(model.getImg3());
        }
        if(StringUtils.isNotBlank(model.getImg4())){
            model.setImg4(path+model.getImg4());
            model.getImgList().add(model.getImg4());
        }
    }
 
    @Override
    public long count(IdentityInfo identityInfo) {
        QueryWrapper<IdentityInfo> wrapper = new QueryWrapper<>(identityInfo);
        return identityInfoMapper.selectCount(wrapper);
    }
 
 
    @Autowired
    private SendWxMessage sendWxMessage;
 
    @Override
    @Transactional(rollbackFor = {BusinessException.class,Exception.class})
    public void audit(AuditDTO auditDTO){
        if(Objects.isNull(auditDTO)
            || Objects.isNull(auditDTO.getId())
            || Objects.isNull(auditDTO.getAuditStatus())
            ||  auditDTO.getAuditStatus()<2
            ||  auditDTO.getAuditStatus()>3){
            throw new BusinessException(ResponseStatus.BAD_REQUEST);
        }
        LoginUserInfo user = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal();
        IdentityInfo identityInfo = identityInfoMapper.selectById(auditDTO.getId());
        if(Objects.isNull(identityInfo)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        if(!Constants.equalsInteger(identityInfo.getAuditStatus(),Constants.ONE)){
            throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"已审批,请勿重复操作");
        }
        Member member = memberMapper.selectById(identityInfo.getMemberId());
        if(Objects.isNull(member)){
            throw new BusinessException(ResponseStatus.DATA_EMPTY);
        }
        identityInfo.setAuditStatus(auditDTO.getAuditStatus());
        identityInfo.setAuditRemark(auditDTO.getAuditRemark());
        identityInfo.setAuditTime(new Date());
        Date date = new Date();
        identityInfoMapper.update(new UpdateWrapper<IdentityInfo>().lambda()
                .set(IdentityInfo::getAuditStatus, auditDTO.getAuditStatus() )
                .set(StringUtils.isNotBlank(auditDTO.getAuditRemark()),IdentityInfo::getAuditRemark,auditDTO.getAuditRemark())
                .set(IdentityInfo::getAuditTime,date)
                .set(IdentityInfo::getUpdateUser,user.getId())
                .set(IdentityInfo::getUpdateTime,date)
                .eq(IdentityInfo::getId,identityInfo.getId())
        );
 
        memberMapper.update(new UpdateWrapper<Member>().lambda()
                .set(Member::getUpdateUser,user.getId())
                .set(Member::getUpdateTime,date)
                .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity, auditDTO.getAuditStatus() )
                .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity , auditDTO.getAuditStatus() )
                .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity , auditDTO.getAuditStatus() )
                .eq(Member::getId,identityInfo.getMemberId())
        );
 
        try{
            //发送微信通知
            if(StringUtils.isNotBlank(member.getOpenid())){
                sendWxMessage.identityInfoMessage(member.getOpenid(),identityInfo);
            }
        }catch (WxErrorException wxErrorException){
 
        }
 
 
 
    }
}