Commit 49c71ff0 authored by fangxinjiang's avatar fangxinjiang

优化-fxj

parent 26bc4bf2
...@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil; ...@@ -4,6 +4,8 @@ import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel; import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
...@@ -15,6 +17,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig; ...@@ -15,6 +17,8 @@ import com.yifu.cloud.plus.v1.yifu.archives.config.WxConfig;
import com.yifu.cloud.plus.v1.yifu.archives.entity.*; import com.yifu.cloud.plus.v1.yifu.archives.entity.*;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreHistoryMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreHistoryMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper; import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeeContractPreMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeePreLogDetailMapper;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TEmployeePreLogMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.*; import com.yifu.cloud.plus.v1.yifu.archives.service.*;
import com.yifu.cloud.plus.v1.yifu.archives.vo.*; import com.yifu.cloud.plus.v1.yifu.archives.vo.*;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.ClientNameConstants;
...@@ -45,6 +49,8 @@ import java.util.*; ...@@ -45,6 +49,8 @@ import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream; import java.util.stream.Stream;
import static com.alibaba.fastjson.serializer.SerializerFeature.*;
/** /**
* 合同待签订任务记录表 * 合同待签订任务记录表
* *
...@@ -80,6 +86,10 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -80,6 +86,10 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
@Autowired @Autowired
private SocialDaprUtils socialDaprUtils; private SocialDaprUtils socialDaprUtils;
private final TEmployeePreLogMapper empPreLogMapper;
private final TEmployeePreLogDetailMapper empPreLogDetailMapper;
/** /**
* 合同待签订任务记录表简单分页查询 * 合同待签订任务记录表简单分页查询
* @param tEmployeeContractPre 合同待签订任务记录表 * @param tEmployeeContractPre 合同待签订任务记录表
...@@ -634,6 +644,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -634,6 +644,7 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
TEmployeeContractPre pre; TEmployeeContractPre pre;
TEmployeeContractInfo contractInfo; TEmployeeContractInfo contractInfo;
R<String> result; R<String> result;
YifuUser user = SecurityUtils.getUser();
for (TEmployeeAutoRegistRevokeVo registRevokeVo : registRevokeVoList) { for (TEmployeeAutoRegistRevokeVo registRevokeVo : registRevokeVoList) {
pre = baseMapper.selectById(registRevokeVo.getId()); pre = baseMapper.selectById(registRevokeVo.getId());
if (pre != null) { if (pre != null) {
...@@ -665,6 +676,29 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -665,6 +676,29 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
audit.setRemark(registRevokeVo.getReason()); audit.setRemark(registRevokeVo.getReason());
tEmployeeContractAuditService.save(audit); tEmployeeContractAuditService.save(audit);
} }
TEmployeePreLogDetail detailCanceLog = new TEmployeePreLogDetail();
detailCanceLog.setModelType(CommonConstants.TWO_STRING);
detailCanceLog.setType(CommonConstants.THREE_STRING);
Map<String,Object> old = new HashMap<>();
old.put("contractCancleFlag", "");
Map<String,Object> simNew = new HashMap<>();
simNew.put("contractCancleFlag", "客服撤销签署(合同从待办列表消失)");
String logId= String.valueOf(UUID.randomUUID()).replaceAll("-", "");
String empPreId = pre.getRegisterId();
this.setLogBaseInfo(empPreId, old, simNew,user , "contractCancleFlag",logId , detailCanceLog);
TEmployeePreLog empPreLog = new TEmployeePreLog();
empPreLog.setId(logId);
empPreLog.setPreId(empPreId);
empPreLog.setDiffTitle("客服撤销签署(合同从待办列表消失)");
empPreLog.setCreateTime(LocalDateTime.now());
if (Common.isNotNull(user)) {
empPreLog.setCreateBy(user.getId());
empPreLog.setCreateName(user.getNickname());
}
empPreLogMapper.insert(empPreLog);
if (null != detailCanceLog) {
empPreLogDetailMapper.insert(detailCanceLog);
}
pre.setProcessStatus(CommonConstants.TEN_STRING); pre.setProcessStatus(CommonConstants.TEN_STRING);
pre.setSignFlag(CommonConstants.ZERO_STRING); pre.setSignFlag(CommonConstants.ZERO_STRING);
pre.setRevokeReason(registRevokeVo.getReason()); pre.setRevokeReason(registRevokeVo.getReason());
...@@ -687,7 +721,27 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra ...@@ -687,7 +721,27 @@ public class TEmployeeContractPreServiceImpl extends ServiceImpl<TEmployeeContra
} }
return R.ok(); return R.ok();
} }
private static final SerializerFeature[] features = new SerializerFeature[]{
WriteMapNullValue, WriteNullNumberAsZero, WriteNullListAsEmpty,
WriteNullStringAsEmpty, WriteDateUseDateFormat
};
private void setLogBaseInfo(String empPreId, Object oldInfo, Object newInfo
, YifuUser user, String differenceKey, String logId, TEmployeePreLogDetail detailEmpLog) {
detailEmpLog.setPreId(empPreId);
detailEmpLog.setPreLogId(logId);
detailEmpLog.setDifferenceInfo(differenceKey);
detailEmpLog.setCreateTime(LocalDateTime.now());
if (Common.isNotNull(user)) {
detailEmpLog.setCreateBy(user.getId());
detailEmpLog.setCreateName(user.getNickname());
}
if (Common.isNotNull(oldInfo)) {
detailEmpLog.setOldInfo(JSON.toJSONString(oldInfo, features));
}
if (Common.isNotNull(newInfo)) {
detailEmpLog.setNewInfo(JSON.toJSONString(newInfo, features));
}
}
/** /**
* @Description: 获取前端客服的所有项目权限 * @Description: 获取前端客服的所有项目权限
* @Author: huych * @Author: huych
......
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