Commit 60e8242b authored by huyuchen's avatar huyuchen

huych-入职登记提交

parent 61769b5c
......@@ -389,9 +389,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
RegistParamVo paramVo = new RegistParamVo();
List<RegistParamVo> params = new ArrayList<>();
List<String> phones = new ArrayList<>();
EmployeeRegistrationPre updatePre;
AliSmsResult res;
if (CommonConstants.ONE_STRING.equals(type)) {
for(SendMessageUpdateVo updateVo:voList) {
EmployeeRegistrationPre updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query()
updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query()
.lambda().eq(EmployeeRegistrationPre::getId, updateVo.getId())
.in(EmployeeRegistrationPre::getProcessStatus, CommonConstants.processStatus));
if (Common.isNotNull(updatePre)) {
......@@ -413,7 +415,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
employeeService.save(smsEmployee);
paramVo.setLink(smsEmployee.getId().toString());
params.add(paramVo);
AliSmsResult res = sendMessage(phones, params);
res = sendMessage(phones, params);
if (null != res && null != res.getBizId()) {
smsEmployee.setBizId(res.getBizId());
smsEmployee.setMessage(res.getMessage());
......@@ -428,19 +430,20 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
}
}
} else {
TEmployeeInfo info;
for(SendMessageUpdateVo updateVo:voList) {
TEmployeeInfo info = employeeInfoMapper.selectById(updateVo.getId());
info = employeeInfoMapper.selectById(updateVo.getId());
if (Common.isNotNull(info)) {
paramVo.setName(info.getEmpName());
phones.add(info.getEmpPhone());
//如果有入职待建档数据同步更新
EmployeeRegistrationPre registrationPre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda()
updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query().lambda()
.eq(EmployeeRegistrationPre::getEmpIdcard, info.getEmpIdcard())
.eq(EmployeeRegistrationPre::getDeptId, updateVo.getDeptId())
.eq(EmployeeRegistrationPre::getProcessStatus, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(registrationPre)) {
registrationPre.setProcessStatus(CommonConstants.ONE_STRING);
if (Common.isNotNull(updatePre)) {
updatePre.setProcessStatus(CommonConstants.ONE_STRING);
}
//生成短信发送的记录
TRegisteWarningEmployee smsEmployee = new TRegisteWarningEmployee();
......@@ -455,12 +458,12 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
employeeService.save(smsEmployee);
paramVo.setLink(smsEmployee.getId().toString());
params.add(paramVo);
AliSmsResult res = sendMessage(phones, params);
res = sendMessage(phones, params);
if (null != res && null != res.getBizId()) {
smsEmployee.setBizId(res.getBizId());
smsEmployee.setMessage(res.getMessage());
employeeService.updateById(smsEmployee);
this.updateById(registrationPre);
this.updateById(updatePre);
return R.ok();
} else {
smsEmployee.setMessage("短信发送失败");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment