Commit d6c8e9aa authored by fangxinjiang's avatar fangxinjiang

合同续签-fxj

parent ae367b0e
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.archives.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.EmployeeRegistrationPreVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.log.annotation.SysLog;
......@@ -137,21 +138,6 @@ public class TEmployeeContractPreNewController {
return R.ok(tEmployeeContractPreNewService.removeById(id));
}
/**
* 合同续签预派单信息 批量导入
*
* @author fxj
* @date 2026-02-05 15:45:40
**/
@SneakyThrows
@Operation(description = "批量新增合同续签预派单信息 hasPermission('archives_temployeecontractprenew-batch-import')")
@SysLog("批量新增合同续签预派单信息")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('archives_temployeecontractprenew-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) {
return tEmployeeContractPreNewService.importDiy(file.getInputStream());
}
/**
* 合同续签预派单信息 批量导出
*
......@@ -164,4 +150,29 @@ public class TEmployeeContractPreNewController {
public void export(HttpServletResponse response, @RequestBody TEmployeeContractPreNewSearchVo searchVo) {
tEmployeeContractPreNewService.listExport(response, searchVo);
}
/**
* @Author fxj
* @Description 合同待续签单个确认
* @Date 10:30 2026/2/9
* @Param
* @return
**/
@Operation(description = "合同待续签单个确认")
@PostMapping("/confirmRenewalContract")
public R confirmReceive(@RequestBody TEmployeeContractPreNewVo preVo) {
return tEmployeeContractPreNewService.confirmRenewalContract(preVo);
}
/**
* 入职待确认表 批量确认接收
*
* @author huych
* @date 2025-03-13 16:55:32
**/
@Operation(description = "合同待续签批量确认")
@PostMapping("/batchCconfirmRenewalContract")
public R batchConfirmReceive(@RequestBody TEmployeeContractPreNewVo preVo) {
return tEmployeeContractPreNewService.batchCconfirmRenewalContract(preVo);
}
}
......@@ -21,6 +21,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TEmployeeContractPreNew;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewVo;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TEmployeeContractPreNewSearchVo;
......@@ -44,9 +45,11 @@ public interface TEmployeeContractPreNewService extends IService<TEmployeeContra
*/
IPage<TEmployeeContractPreNew> getTEmployeeContractPreNewPage(Page<TEmployeeContractPreNew> page, TEmployeeContractPreNewSearchVo tEmployeeContractPreNew);
R<List<ErrorMessage>> importDiy(InputStream inputStream);
void listExport(HttpServletResponse response, TEmployeeContractPreNewSearchVo searchVo);
List<TEmployeeContractPreNew> noPageDiy(TEmployeeContractPreNewSearchVo searchVo);
R confirmRenewalContract(TEmployeeContractPreNewVo preVo);
R batchCconfirmRenewalContract(TEmployeeContractPreNewVo preVo);
}
......@@ -520,6 +520,7 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
alert.setFirstAlertTime(new Date());
}
//获取项目信息,合同配置信息,初始化前端客服、续签状态、自动化标识
alert.setProcessStatus(CommonConstants.ZERO_INT);
if (null != project){
alert.setCsName(project.getCsName());
......@@ -1090,13 +1091,8 @@ public class TEmpContractAlertServiceImpl extends ServiceImpl<TEmpContractAlertM
searchVo.setAuthSql(null);
return;
}
//获取项目信息
List<String> deptNos = tSettleDomainService.getAllDeptByCustomerLoginName(user.getUsername());
if (null != deptNos && !deptNos.isEmpty()) {
searchVo.setDeptNoList(deptNos);
} else {
searchVo.setId(CommonConstants.ONE_STRING_NEGATE);
}
//非管理员及SSC 走前端客服查询逻辑
searchVo.setCsLoginName(user.getUsername());
}
public boolean haveRole(YifuUser user, long roleId) {
List<Long> roleList = user.getClientRoleMap().get(ClientNameConstants.CLIENT_MVP);
......
......@@ -178,85 +178,26 @@ public class TEmployeeContractPreNewServiceImpl extends ServiceImpl<TEmployeeCon
}
return wrapper;
}
@Override
public R<List<ErrorMessage>> importDiy(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<TEmployeeContractPreNewVo> util1 = new ExcelUtil<>(TEmployeeContractPreNewVo.class);
;
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, TEmployeeContractPreNewVo.class, new ReadListener<TEmployeeContractPreNewVo>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT;
/**
*临时存储
*/
private List<TEmployeeContractPreNewVo> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(TEmployeeContractPreNewVo data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
* @Author fxj
* @Description 合同待续签单个确认
* @Date 10:41 2026/2/9
* @Param
* @return
**/
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
public R confirmRenewalContract(TEmployeeContractPreNewVo preVo) {
return null;
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importTEmployeeContractPreNew(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
private void importTEmployeeContractPreNew(List<TEmployeeContractPreNewVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TEmployeeContractPreNewVo excel = excelVOList.get(i);
// 数据合法情况 TODO
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TEmployeeContractPreNewVo excel) {
TEmployeeContractPreNew insert = new TEmployeeContractPreNew();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
* @Author fxj
* @Description 入职待确认表 批量确认接收
* @Date 10:40 2026/2/9
* @Param
* @return
**/
@Override
public R batchCconfirmRenewalContract(TEmployeeContractPreNewVo preVo) {
return null;
}
}
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