Commit 60e8242b authored by huyuchen's avatar huyuchen

huych-入职登记提交

parent 61769b5c
...@@ -389,9 +389,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -389,9 +389,11 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
RegistParamVo paramVo = new RegistParamVo(); RegistParamVo paramVo = new RegistParamVo();
List<RegistParamVo> params = new ArrayList<>(); List<RegistParamVo> params = new ArrayList<>();
List<String> phones = new ArrayList<>(); List<String> phones = new ArrayList<>();
EmployeeRegistrationPre updatePre;
AliSmsResult res;
if (CommonConstants.ONE_STRING.equals(type)) { if (CommonConstants.ONE_STRING.equals(type)) {
for(SendMessageUpdateVo updateVo:voList) { for(SendMessageUpdateVo updateVo:voList) {
EmployeeRegistrationPre updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query() updatePre = baseMapper.selectOne(Wrappers.<EmployeeRegistrationPre>query()
.lambda().eq(EmployeeRegistrationPre::getId, updateVo.getId()) .lambda().eq(EmployeeRegistrationPre::getId, updateVo.getId())
.in(EmployeeRegistrationPre::getProcessStatus, CommonConstants.processStatus)); .in(EmployeeRegistrationPre::getProcessStatus, CommonConstants.processStatus));
if (Common.isNotNull(updatePre)) { if (Common.isNotNull(updatePre)) {
...@@ -413,7 +415,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -413,7 +415,7 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
employeeService.save(smsEmployee); employeeService.save(smsEmployee);
paramVo.setLink(smsEmployee.getId().toString()); paramVo.setLink(smsEmployee.getId().toString());
params.add(paramVo); params.add(paramVo);
AliSmsResult res = sendMessage(phones, params); res = sendMessage(phones, params);
if (null != res && null != res.getBizId()) { if (null != res && null != res.getBizId()) {
smsEmployee.setBizId(res.getBizId()); smsEmployee.setBizId(res.getBizId());
smsEmployee.setMessage(res.getMessage()); smsEmployee.setMessage(res.getMessage());
...@@ -428,19 +430,20 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -428,19 +430,20 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
} }
} }
} else { } else {
TEmployeeInfo info;
for(SendMessageUpdateVo updateVo:voList) { for(SendMessageUpdateVo updateVo:voList) {
TEmployeeInfo info = employeeInfoMapper.selectById(updateVo.getId()); info = employeeInfoMapper.selectById(updateVo.getId());
if (Common.isNotNull(info)) { if (Common.isNotNull(info)) {
paramVo.setName(info.getEmpName()); paramVo.setName(info.getEmpName());
phones.add(info.getEmpPhone()); 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::getEmpIdcard, info.getEmpIdcard())
.eq(EmployeeRegistrationPre::getDeptId, updateVo.getDeptId()) .eq(EmployeeRegistrationPre::getDeptId, updateVo.getDeptId())
.eq(EmployeeRegistrationPre::getProcessStatus, CommonConstants.ZERO_STRING) .eq(EmployeeRegistrationPre::getProcessStatus, CommonConstants.ZERO_STRING)
.last(CommonConstants.LAST_ONE_SQL)); .last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(registrationPre)) { if (Common.isNotNull(updatePre)) {
registrationPre.setProcessStatus(CommonConstants.ONE_STRING); updatePre.setProcessStatus(CommonConstants.ONE_STRING);
} }
//生成短信发送的记录 //生成短信发送的记录
TRegisteWarningEmployee smsEmployee = new TRegisteWarningEmployee(); TRegisteWarningEmployee smsEmployee = new TRegisteWarningEmployee();
...@@ -455,12 +458,12 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi ...@@ -455,12 +458,12 @@ public class EmployeeRegistrationPreServiceImpl extends ServiceImpl<EmployeeRegi
employeeService.save(smsEmployee); employeeService.save(smsEmployee);
paramVo.setLink(smsEmployee.getId().toString()); paramVo.setLink(smsEmployee.getId().toString());
params.add(paramVo); params.add(paramVo);
AliSmsResult res = sendMessage(phones, params); res = sendMessage(phones, params);
if (null != res && null != res.getBizId()) { if (null != res && null != res.getBizId()) {
smsEmployee.setBizId(res.getBizId()); smsEmployee.setBizId(res.getBizId());
smsEmployee.setMessage(res.getMessage()); smsEmployee.setMessage(res.getMessage());
employeeService.updateById(smsEmployee); employeeService.updateById(smsEmployee);
this.updateById(registrationPre); this.updateById(updatePre);
return R.ok(); return R.ok();
} else { } else {
smsEmployee.setMessage("短信发送失败"); 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