Commit 2f48885b authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/MVP1.7.7' into MVP1.7.7

parents 429bdb03 7d0798c2
......@@ -116,6 +116,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
String fileName = "入离职登记表批量导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<EmployeeRegistrationExportVo> list = new ArrayList<>();
getDtpeAuth(searchVo);
long count = baseMapper.selectExportCount(searchVo);
try (ServletOutputStream out = response.getOutputStream()) {
response.setContentType(CommonConstants.MULTIPART_FORM_DATA);
......@@ -123,7 +124,6 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
response.setHeader(CommonConstants.CONTENT_DISPOSITION, CommonConstants.ATTACHMENT_FILENAME + URLEncoder.encode(fileName, CommonConstants.UTF8));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, EmployeeRegistrationExportVo.class).build();
getDtpeAuth(searchVo);
int index = 0;
if (count > CommonConstants.ZERO_INT) {
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
......@@ -275,6 +275,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
EmployeeRegistrationVo excel;
int inNum = 0;
int outNum = 0;
List<EmployeeRegistration> insertList = new ArrayList<>();
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
// 插入
......@@ -294,12 +295,14 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), RegistConstants.IMPORT_EXIT_CHECK, excel));
continue;
}
insert.setDeptNo(selectVo.getDepartNo());
String error = registCheck(insert);
if (null != error) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), error, excel));
continue;
}
initRegistInfo(insert,user, selectVo);
insertList.add(insert);
//新增记录,新增操作记录
baseMapper.insert(insert);
if (CommonConstants.ONE_STRING.equals(insert.getFeedbackType())) {
......@@ -310,15 +313,18 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
logService.saveLog(insert.getId(), CommonConstants.ZERO_STRING,RegistConstants.MESSAGE_REGIST, LocalDateTime.now(),
insert.getRegistorUsername(),null);
}
//发送企业微信待办
EmployeeRegistration msgRegistration = new EmployeeRegistration();
msgRegistration.setInNum(inNum);
msgRegistration.setOutNum(outNum);
msgRegistration.setCustomerUserLoginname(selectVo.getCsLoginName());
msgRegistration.setDeptName(selectVo.getDepartName());
msgRegistration.setDeptNo(selectVo.getDepartNo());
//企业微信消息提醒
sendMessageToWx(msgRegistration,CommonConstants.THREE_STRING);
if (!Common.isEmpty(insertList)) {
insertList.clear();
//发送企业微信待办
EmployeeRegistration msgRegistration = new EmployeeRegistration();
msgRegistration.setInNum(inNum);
msgRegistration.setOutNum(outNum);
msgRegistration.setCustomerUserLoginname(selectVo.getCsLoginName());
msgRegistration.setDeptName(selectVo.getDepartName());
msgRegistration.setDeptNo(selectVo.getDepartNo());
//企业微信消息提醒
sendMessageToWx(msgRegistration, CommonConstants.THREE_STRING);
}
}
......@@ -341,6 +347,7 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
}
public R confirmSubmit(EmployeeRegistration registration) {
YifuUser user = SecurityUtils.getUser();
EmployeeRegistration registrationNow = baseMapper.selectById(registration.getId());
if (Common.isEmpty(registrationNow) || !CommonConstants.ONE_STRING.equals(registrationNow.getProcessStatus())) {
return R.failed(RegistConstants.NO_DATA_TO_HANDLE);
......@@ -362,20 +369,21 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
registrationNow.setProcessStatus(CommonConstants.ZERO_STRING);
baseMapper.updateById(registrationNow);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
registrationNow.getRegistorUsername(),null);
user.getNickname(),null);
return R.ok();
}
public R updateRegist(EmployeeRegistration registration) {
YifuUser user = SecurityUtils.getUser();
EmployeeRegistration registrationNow = baseMapper.selectById(registration.getId());
if (Common.isEmpty(registrationNow) || !CommonConstants.ONE_STRING.equals(registrationNow.getProcessStatus())) {
return R.failed(RegistConstants.NO_DATA_TO_HANDLE);
}
registrationNow.setProcessStatus(CommonConstants.TWO_STRING);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.CONFIRM_SUBMIT, LocalDateTime.now(),
registrationNow.getRegistorUsername(),null);
user.getNickname(),null);
logService.saveLog(registration.getId(), CommonConstants.ZERO_STRING,RegistConstants.MESSAGE_FINISH, registration.getProjectCreateTime(),
registrationNow.getRegistorUsername(),CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())
user.getNickname(),CommonConstants.ONE_STRING.equals(registrationNow.getFeedbackType())
? RegistConstants.BEFORE_IN_PROJECT :RegistConstants.BEFORE_OUT_PROJECT);
baseMapper.updateById(registrationNow);
return R.ok();
......@@ -445,14 +453,13 @@ public class EmployeeRegistrationServiceImpl extends ServiceImpl<EmployeeRegistr
private void initRegistInfo(EmployeeRegistration insert,YifuUser user,TSettleDomainSelectVo selectVo) {
insert.setRegistorDeptname(user.getDeptName());
insert.setRegistorDeptid(user.getDeptId().toString());
insert.setRegistorUsername(user.getUsername());
insert.setRegistorUsername(user.getNickname());
insert.setRegistorPhone(user.getPhone());
insert.setEmpDeptid(user.getDeptId().toString());
insert.setEmpDeptname(user.getDeptName());
insert.setCustomerPhone(selectVo.getCsPhone());
insert.setCustomerUsername(selectVo.getCsName());
insert.setCustomerUserLoginname(selectVo.getCsLoginName());
insert.setDeptNo(selectVo.getDepartNo());
insert.setDeptName(selectVo.getDepartName());
insert.setDeptId(selectVo.getId());
}
......
......@@ -84,7 +84,7 @@
<select id="cspDeptUserList" resultType="com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysDeptVo">
select d.dept_id, d.name, d.parent_id,d.ancestors,sort_order,
(select count(*) from sys_user_dept_permission where dept_id = d.dept_id) as peoplenum
(select count(r.id) from sys_user_dept_permission r left join sys_user u on u.user_id = r.user_id where r.dept_id = d.dept_id and u.del_flag = '0') as peoplenum
from sys_dept d
where d.del_flag = '0'
<if test="dept.projectNo != null and dept.projectNo != ''">
......
......@@ -425,7 +425,7 @@
LEFT JOIN sys_user_dept_permission p on u.user_id=p.user_id
LEFT JOIN sys_dept d on d.dept_id=p.dept_id
where
1=1
1=1 and u.del_flag = '0'
<if test="nickName != null and nickName != ''">
and u.nickname LIKE CONCAT('%',#{nickName},'%')
</if>
......
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