|
|
@ -1,10 +1,12 @@ |
|
|
|
package com.zc.business.service.impl; |
|
|
|
|
|
|
|
import com.ruoyi.common.utils.DateUtils; |
|
|
|
import com.ruoyi.common.utils.StringUtils; |
|
|
|
import com.zc.business.domain.DcEmployees; |
|
|
|
import com.zc.business.enums.UniversalEnum; |
|
|
|
import com.zc.business.mapper.DcEmployeesMapper; |
|
|
|
import com.zc.business.service.IDcEmployeesService; |
|
|
|
import com.zc.business.utils.QYWXUtil; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
@ -24,6 +26,8 @@ import java.util.stream.Collectors; |
|
|
|
public class DcEmployeesServiceImpl implements IDcEmployeesService { |
|
|
|
@Autowired |
|
|
|
private DcEmployeesMapper dcEmployeesMapper; |
|
|
|
@Autowired |
|
|
|
private QYWXUtil qywxUtil; |
|
|
|
|
|
|
|
/** |
|
|
|
* 查询值班人员信息 |
|
|
@ -56,6 +60,15 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService { |
|
|
|
@Override |
|
|
|
public int insertDcEmployees(DcEmployees dcEmployees) { |
|
|
|
dcEmployees.setCreateTime(DateUtils.getNowDate()); |
|
|
|
|
|
|
|
//获取企业微信用户id
|
|
|
|
if (StringUtils.isNotEmpty(dcEmployees.getContactNumber())){ |
|
|
|
String wxUserId = qywxUtil.getUserIdByMobile(dcEmployees.getContactNumber()); |
|
|
|
if (StringUtils.isNotEmpty(wxUserId)){ |
|
|
|
dcEmployees.setWxUserId(wxUserId); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return dcEmployeesMapper.insertDcEmployees(dcEmployees); |
|
|
|
} |
|
|
|
|
|
|
@ -68,6 +81,14 @@ public class DcEmployeesServiceImpl implements IDcEmployeesService { |
|
|
|
@Override |
|
|
|
public int updateDcEmployees(DcEmployees dcEmployees) { |
|
|
|
dcEmployees.setUpdateTime(DateUtils.getNowDate()); |
|
|
|
|
|
|
|
//获取企业微信用户id
|
|
|
|
if (StringUtils.isNotEmpty(dcEmployees.getContactNumber())){ |
|
|
|
String wxUserId = qywxUtil.getUserIdByMobile(dcEmployees.getContactNumber()); |
|
|
|
if (StringUtils.isNotEmpty(wxUserId)){ |
|
|
|
dcEmployees.setWxUserId(wxUserId); |
|
|
|
} |
|
|
|
} |
|
|
|
return dcEmployeesMapper.updateDcEmployees(dcEmployees); |
|
|
|
} |
|
|
|
|
|
|
|