合并分支 'dev_third_stage' 到 'master'

Dev third stage

查看合并请求 laws-nio/laws-weilai!86
This commit is contained in:
肖文钰
2022-07-14 20:15:04 +08:00
25 changed files with 893 additions and 130 deletions
@@ -15,8 +15,8 @@ public class PPEmployee {
private String data_difference; //数据来源[WORKDAY,XPT,NIOCAPITAL]
private String employee_difference; // 员工来源[CN, EU_US,EU]
private String employee_id; // 员工编号(员工唯一标识) ----workNo
private String worker_user_id; //WD帐号创建SSO账号 / AD账户 ----thirdId
private String user_name; // WD同步到people的域帐号 ----username
private String worker_user_id; //WD帐号创建SSO账号 / AD账户 ----thirdId, username
private String user_name; // WD同步到people的域帐号
// private String foreign_employee_id; // 兼职公司对应的员工编号
private String name; // 全名
private String formatted_name; // 全名-拼音及中文 ----realname
@@ -149,4 +149,6 @@ public interface SysUserMapper extends BaseMapper<SysUser> {
* @return
*/
List<SysUser> queryByDepIds(@Param("departIds")List<String> departIds,@Param("username") String username);
List<SysUser> getPPEmployeeList(@Param("thirdType") String thirdType);
}
@@ -195,4 +195,9 @@
and username != #{username}
</if>
</select>
<select id="getPPEmployeeList" resultType="com.jero.modules.system.entity.SysUser">
select * from sys_user where third_type = #{thirdType}
</select>
</mapper>
@@ -1,7 +1,6 @@
package com.jero.modules.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import cn.hutool.core.util.ObjectUtil;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.jero.common.constant.CommonConstant;
@@ -25,7 +24,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.io.IOException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
@@ -202,25 +200,25 @@ public class SyncDataServiceImpl implements ISyncDataService{
List<SysUser> sysUserList = sysUserService.getPPEmployeeList();
// log.info("查询到的用户信息结果集为:"+JSONObject.toJSONString(userEOList));
for(SysUser user:sysUserList){
localUserMap.put(user.getId(),user);
localUserMap.put(user.getThirdId(),user);
}
// log.info("将用户信息集合转换为的用户MAP为:"+JSONObject.toJSONString(localUserMap));
log.info("开始更新数据库信息");
for(PPEmployee ppEmployee:ppEmployeeList){
try {
PPEmployeeMap.put(ppEmployee.getId(), ppEmployee);
PPEmployeeMap.put(ppEmployee.getWorker_user_id(), ppEmployee);
//1.判断当前账号是否已添加到用户中
if (!localUserMap.containsKey(ppEmployee.getId())) {
if (!localUserMap.containsKey(ppEmployee.getWorker_user_id())) {
//删除数据库中与该账户相同的数据
if(StringUtils.isNotBlank(ppEmployee.getId())) {
if(StringUtils.isNotBlank(ppEmployee.getWorker_user_id())) {
// sysUserService.removeById(ppEmployee.getId()); // 这个为什么是逻辑删除
log.info("需要新增的用户信息为:" + JSONObject.toJSONString(ppEmployee));
SysUser newUser = sysUserService.addPPUserInfo(ppEmployee);
localUserMap.put(ppEmployee.getId(), newUser);
localUserMap.put(ppEmployee.getWorker_user_id(), newUser);
}
} else {
SysUser userEO = localUserMap.get(ppEmployee.getId());
SysUser userEO = localUserMap.get(ppEmployee.getWorker_user_id());
log.info("需要更新的用户信息为:" + JSONObject.toJSONString(userEO) + " " + JSONObject.toJSONString(ppEmployee));
if(userEO != null) {
sysUserService.updatePPUserInfo(userEO, ppEmployee);
@@ -1,6 +1,5 @@
package com.jero.modules.system.service.impl;
import cn.hutool.core.collection.CollectionUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
@@ -19,7 +18,6 @@ import com.jero.modules.base.service.BaseCommonService;
import com.jero.modules.system.entity.*;
import com.jero.modules.system.enums.PPSyncEnum;
import com.jero.modules.system.mapper.*;
import com.jero.modules.system.model.DepartIdModel;
import com.jero.modules.system.model.SysUserSysDepartModel;
import com.jero.modules.system.service.ISysUserService;
import com.jero.modules.system.vo.SysUserDepVo;
@@ -480,9 +478,7 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
@Override
public List<SysUser> getPPEmployeeList() {
QueryWrapper<SysUser> sysUserQueryWrapper = new QueryWrapper<>();
sysUserQueryWrapper.lambda().eq(SysUser::getThirdType, PPSyncEnum.PP.getValue());
return list(sysUserQueryWrapper);
return this.baseMapper.getPPEmployeeList(PPSyncEnum.PP.getValue());
}
@Override
@@ -491,11 +487,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
SysUser sysUser = new SysUser();
// 基本信息
sysUser.setId(ppEmployee.getId());
sysUser.setUsername(ppEmployee.getUser_name());
sysUser.setUsername(ppEmployee.getWorker_user_id());
sysUser.setRealname(ppEmployee.getFormatted_name());
sysUser.setStatus("Active".equals(ppEmployee.getEmployee_status())? CommonConstant.USER_UNFREEZE : CommonConstant.USER_FREEZE);
sysUser.setDelFlag("1".equals(ppEmployee.getDelete_flag())? CommonConstant.DEL_FLAG_0 : CommonConstant.DEL_FLAG_1);
sysUser.setThirdId(ppEmployee.getUser_name());
sysUser.setThirdId(ppEmployee.getWorker_user_id());
sysUser.setActivitiSync(CommonConstant.ACT_SYNC_1);
sysUser.setWorkNo(ppEmployee.getEmployee_id());
sysUser.setWorkerType("Employee".equals(ppEmployee.getWorker_type())? CommonConstant.WORKER_TYPE_1 : CommonConstant.WORKER_TYPE_2);
@@ -535,11 +531,11 @@ public class SysUserServiceImpl extends ServiceImpl<SysUserMapper, SysUser> impl
public void updatePPUserInfo(SysUser sysUser, PPEmployee ppEmployee) {
// 基本信息
sysUser.setUsername(ppEmployee.getUser_name());
sysUser.setUsername(ppEmployee.getWorker_user_id());
sysUser.setRealname(ppEmployee.getFormatted_name());
sysUser.setStatus("Active".equals(ppEmployee.getEmployee_status())? CommonConstant.USER_UNFREEZE : CommonConstant.USER_FREEZE);
sysUser.setDelFlag("1".equals(ppEmployee.getDelete_flag())? CommonConstant.DEL_FLAG_0 : CommonConstant.DEL_FLAG_1);
sysUser.setThirdId(ppEmployee.getUser_name());
sysUser.setThirdId(ppEmployee.getWorker_user_id());
sysUser.setWorkNo(ppEmployee.getEmployee_id());
sysUser.setWorkerType("Employee".equals(ppEmployee.getWorker_type())? CommonConstant.WORKER_TYPE_1 : CommonConstant.WORKER_TYPE_2);
sysUser.setCreateTime(ppEmployee.getCreation_time());
@@ -11,7 +11,7 @@ import com.jero.modules.lawsOpinionGather.enums.LawsOpinionGatherNodeEnum;
import com.jero.modules.lawsOpinionGather.enums.OperatorRoleCodeEnum;
import com.jero.modules.lawsOpinionGather.mapper.LawsProcessHistoryEOMapper;
import com.jero.modules.lawsOpinionGather.service.ILawsProcessHistoryEOService;
import com.jero.modules.lawsTechnologyEvaluation.job.LawsTechnologyEvaluationNodeEnum;
import com.jero.modules.lawsTechnologyEvaluation.enums.LawsTechnologyEvaluationNodeEnum;
import com.jero.modules.project.enums.OperatorTypeEnum;
import com.jero.modules.project.enums.RequestSourceEnum;
import com.jero.modules.system.entity.SysUser;
@@ -1,4 +1,4 @@
package com.jero.modules.lawsTechnologyEvaluation.job;
package com.jero.modules.lawsTechnologyEvaluation.enums;
import com.alibaba.druid.util.StringUtils;
import com.jero.common.constant.enums.CutEnum;
@@ -63,7 +63,7 @@ public class LawsTechnologyEvaluationJob implements Job {
if(CollectionUtils.isNotEmpty(lawsTechnologyEvaluationFlowDetailEOList)){
String actiProcInstIds = lawsTechnologyEvaluationFlowDetailEOList.stream().map(LawsTechnologyEvaluationFlowDetailEO::getActiProcInstId).distinct().collect(Collectors.joining(","));
Result<String> result = this.workFlowFeignClient.completeTaskByPids(actiProcInstIds);
Result<String> result = this.workFlowFeignClient.completeLawsTechnologyEvaluationTaskByPids(actiProcInstIds);
if(result.getCode().equals(CommonConstant.SC_OK_200)){
updateLawsTechnologyEvaluationEOList.forEach(lawsTechnologyEvaluationEO -> {
lawsTechnologyEvaluationEO.setFlowStatus(GatherResultEnum.COMPLETED.getValue());
@@ -137,7 +137,7 @@ public class LawsTechnologyEvaluationComplianceResultEOServiceImpl extends Servi
List<LawsTechnologyEvaluationComplianceResultEO> complianceResultEOList = this.baseMapper.selectList(queryWrapper);
if(CollectionUtils.isNotEmpty(complianceResultEOList)){
this.disposeData(complianceResultEOList,cut);
List<String> complianceResultIdList = complianceResultEOList.stream().map(LawsTechnologyEvaluationComplianceResultEO::getId).distinct().collect(Collectors.toList());
QueryWrapper<LawsTechnologyEvaluationResultEO> evaluationResultEOQueryWrapper = new QueryWrapper<>();
evaluationResultEOQueryWrapper.lambda().in(LawsTechnologyEvaluationResultEO::getComplianceResultId,complianceResultIdList);
@@ -179,14 +179,17 @@ public class LawsTechnologyEvaluationComplianceResultEOServiceImpl extends Servi
String title = "";
String bottomTitle = "";
String fileName = "";
String sheetName = "";
if(org.apache.commons.lang3.StringUtils.equals(cut, CutEnum.CN.getValue())){
title = "相关章节,问题说明,附件";
bottomTitle = "符合性结果:";
fileName = "评估结果 " + ".xlsx";
sheetName = "反馈结果";
}else if(org.apache.commons.lang3.StringUtils.equals(cut,CutEnum.EN.getValue())){
title = "Related section,Problem description,Accessory";
bottomTitle = "Compliance results:";
fileName = "Evaluation results " + ".xlsx";
sheetName = "Feedback result";
}
OutputStream os = null;
@@ -201,10 +204,12 @@ public class LawsTechnologyEvaluationComplianceResultEOServiceImpl extends Servi
//设置导出数据
if(CollectionUtils.isNotEmpty(exportData)) {
int size = exportData.size();
//创建表头
String[] titleArr = title.split(",");
for (int i = 0; i < exportData.size(); i++){
//使用评估人的名字命名sheet页
HSSFSheet sheet = workbook.createSheet(exportData.get(i).getCreateBy());
HSSFSheet sheet = workbook.createSheet(exportData.get(i).getCreateBy() + " " + sheetName);
CellStyle titleCellStyle = workbook.createCellStyle();
titleCellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
@@ -212,11 +217,8 @@ public class LawsTechnologyEvaluationComplianceResultEOServiceImpl extends Servi
titleCellStyle.setWrapText(true);//自动换行
Row firstRow = sheet.createRow(0);
//创建表头
String[] titleArr = title.split(",");
for (int j=0; j<=3; j++){
sheet.setColumnWidth(j,4000);
for (int j=0; j<3; j++){
sheet.setColumnWidth(j,10000);
Cell cell = firstRow.createCell(j);
cell.setCellStyle(titleCellStyle);
cell.setCellValue(titleArr[j]);
@@ -236,18 +238,12 @@ public class LawsTechnologyEvaluationComplianceResultEOServiceImpl extends Servi
//把符合性结果设置进excel表格中。
Row bottomRow = sheet.createRow(evaluationResultListSize + 1);
Cell bottomRowFirstCell = bottomRow.getCell(0);
Cell bottomRowFirstCell = bottomRow.createCell(0);
bottomRowFirstCell.setCellStyle(titleCellStyle);
bottomRowFirstCell.setCellValue(bottomTitle);
Cell bottomRowSecondCell = bottomRow.getCell(1);
bottomRowSecondCell.setCellValue(exportData.get(i).getComplianceResultName());
bottomRowFirstCell.setCellValue(bottomTitle + " " + exportData.get(i).getComplianceResultName());
}
}
File fileTemp = new File(path);
if (fileTemp.exists()) {
fileTemp.delete();
@@ -291,7 +287,6 @@ public class LawsTechnologyEvaluationComplianceResultEOServiceImpl extends Servi
}
}
}
}
ZipUtil.zip(path, path + ".zip");
//文件
@@ -327,33 +327,22 @@ public class LawsTechnologyEvaluationEOServiceImpl extends ServiceImpl<LawsTechn
nowFile.mkdirs();
HSSFSheet sheet = workbook.createSheet("sheet1");
sheet.setDefaultColumnWidth(16);//列宽
HSSFCellStyle cellStyle = workbook.createCellStyle();
cellStyle.setWrapText(true);//自动换行
cellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
cellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
HSSFCellStyle cellStyleTemp = workbook.createCellStyle();
cellStyleTemp.setWrapText(true);//自动换行
String explainInfo = null;
HSSFRichTextString explain = new HSSFRichTextString(explainInfo);
CellStyle titleCellStyle = workbook.createCellStyle();
titleCellStyle.setAlignment(HorizontalAlignment.CENTER);//垂直居中
titleCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);//水平居中
titleCellStyle.setWrapText(true);//自动换行
//表头
Row row = sheet.createRow(0);//开始创建标题行
String[] headerArr = title.split(",");
for (int m = 0; m < headerArr.length; m++) {
row.createCell(m).setCellValue(headerArr[m]);
sheet.setColumnWidth(m,10000);
Cell cell = row.createCell(m);
cell.setCellStyle(titleCellStyle);
cell.setCellValue(headerArr[m]);
}
/*Row rowExplain = sheet.createRow(1);
short height = (short) (7 * 200);
rowExplain.setHeight((short) height);
Cell cell = rowExplain.createCell(0);
cell.setCellValue(explain);
cell.setCellStyle(cellStyleTemp);*/
response.setHeader("Content-Disposition",
"attachment; filename=\"" + fileOriName + ".xls");
response.setContentType("application/force-download");
@@ -145,4 +145,7 @@ public interface WorkFlowFeignClient {
*/
@RequestMapping(value = "/bat-wkflow/startLawsTechnologyEvaluationProcess",method = RequestMethod.POST,headers = {"content-type=application/json"})
Result<String> startLawsTechnologyEvaluationProcess(String jsonObject);
@RequestMapping(value = "/bat-wkflow/task/completeLawsTechnologyEvaluationTaskByPids",method = RequestMethod.GET)
Result<String> completeLawsTechnologyEvaluationTaskByPids(@RequestParam("actiProcInstIds") String actiProcInstIds);
}