MechanicServiceImpl.java
1.81 KB
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
/*
* Copyright (c) 2018, 2028, glsx and/or its affiliates. All rights reserved.
* GLSX PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package com.glsx.usercenter.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.glsx.usercenter.constants.Constants;
import com.glsx.usercenter.mapper.DictionaryTypeMapper;
import com.glsx.usercenter.mapper.SysMechanicMapper;
import com.glsx.usercenter.mapper.SysUserServicesMapper;
import com.glsx.usercenter.pojo.user.SysMechanicEntity;
import com.glsx.usercenter.pojo.user.SysUserServices;
import com.glsx.usercenter.service.IMechanicService;
/**
* @ClassName: IMechanicServiceImpl
* @Description: TODO(这里用一句话描述这个类的作用)
* @author Zheng Xiajun
* @date 2019年10月17日
*
*/
@Service
public class MechanicServiceImpl implements IMechanicService {
@Autowired
private SysMechanicMapper sysMechanicMapper;
@Autowired
private SysUserServicesMapper sysUserServicesMapper;
/**
* 技工认证
*/
@Override
public void verify(SysMechanicEntity sysMechanicEntity) {
// 修改状态,插入资料
sysMechanicEntity.setMechanicStatus(Constants.SYS_USER_STATUS_CHECKING);
sysMechanicMapper.updateByPrimaryKeySelective(sysMechanicEntity);
String[] items = sysMechanicEntity.getServiceItemsKey();
for (int i = 0; i < items.length; i++) {
SysUserServices record = new SysUserServices();
record.setServiceKey(items[i]);
record.setUserId(sysMechanicEntity.getUserId());
sysUserServicesMapper.deleteByUserIdAndServiceId(sysMechanicEntity.getUserId(), items[i]);
sysUserServicesMapper.insertSelective(record);
}
}
}