Commit 82334943 authored by wangzb's avatar wangzb

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

parents 71837951 0fd3f163
......@@ -1439,7 +1439,7 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
if ((tEmployeeProject.getSocialStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getSocialStatus() == CommonConstants.FOUR_INT) &&
(tEmployeeProject.getFundStatus() == CommonConstants.ZERO_INT
|| tEmployeeProject.getFundStatus() == CommonConstants.FOUR_INT)) {
|| tEmployeeProject.getFundStatus() == CommonConstants.THREE_INT)) {
tEmployeeProject.setProjectStatus(CommonConstants.ONE_INT);
tEmployeeProject.setLeaveRemark("终止合同联动减项");
tEmployeeProject.setLeaveTime(LocalDateTime.now());
......@@ -1452,21 +1452,36 @@ public class TEmployeeProjectServiceImpl extends ServiceImpl<TEmployeeProjectMap
baseMapper.updateById(tEmployeeProject);
//如果项目档案已减项,如果人员存在多个项目不处理,反之则减档
TEmployeeInfo tEmployeeInfo = tEmployeeInfoMapper.selectById(tEmployeeProject.getEmpId());
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT && Common.isNotNull(tEmployeeInfo)) {
if (Common.isNotNull(tEmployeeInfo)) {
TEmployeeInfo tEmployeeInfoOld = tEmployeeInfoMapper.selectById(tEmployeeInfo.getId());
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(vo.getUserId());
tEmployeeInfo.setLeaveUserName(vo.getUserName());
workInfo.append("减档成功,");
// 判断人员有无审核通过的其他合同
TEmployeeContractInfo contractInfoInUse = contractInfoMapper.selectOne(Wrappers.<TEmployeeContractInfo>query()
.lambda().eq(TEmployeeContractInfo::getEmpIdcard, vo.getEmpIdCard())
.and(obj -> obj.ge(TEmployeeContractInfo::getContractEnd, DateUtil.getThisDayByPatten("yyyy-MM-dd"))
.or().isNull(TEmployeeContractInfo::getContractEnd))
.eq(TEmployeeContractInfo::getInUse, CommonConstants.ZERO_INT)
.eq(TEmployeeContractInfo::getDeleteFlag, CommonConstants.ZERO_INT)
.last(CommonConstants.LAST_ONE_SQL));
if (contractInfoInUse != null) {
tEmployeeInfo.setContractStatus(CommonConstants.ONE_INT);
} else {
failueInfo.append("存在其他项目,无法减档");
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
}
if (tEmployeeProject.getProjectStatus() == CommonConstants.ONE_INT) {
tEmployeeInfo.setProjectNum(tEmployeeInfo.getProjectNum() - CommonConstants.ONE_INT);
tEmployeeInfo.setContractStatus(CommonConstants.TWO_INT);
//减项成功把人员档案现存项目数减一
if (tEmployeeInfo.getProjectNum() == CommonConstants.ZERO_INT) {
//减档
tEmployeeInfo.setFileStatus(CommonConstants.dingleDigitIntArray[1]);
tEmployeeInfo.setLeaveRemark(tEmployeeProject.getLeaveRemark());
tEmployeeInfo.setLeaveTime(DateUtil.getCurrentDateTime());
tEmployeeInfo.setLeaveUser(vo.getUserId());
tEmployeeInfo.setLeaveUserName(vo.getUserName());
workInfo.append("减档成功,");
} else {
failueInfo.append("存在其他项目,无法减档");
}
}
tEmployeeLogService.saveModificationRecord(CommonConstants.dingleDigitIntArray[0], tEmployeeInfo.getId(),
"", tEmployeeInfoOld, tEmployeeInfo);
......
......@@ -52,7 +52,7 @@ public class EkpOrderController {
@Schema(description = "接收处理ekp订单")
@PostMapping(value = "/receiveOrder")
public R receiveOrder(OrderAddVO vo) throws IOException {
return tOrderService.receiveOrder(vo);
return tOrderService.receiveOrder(vo,ekpOrderFileTask);
}
......
......@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.order.entity.TOrder;
import com.yifu.cloud.plus.v1.yifu.order.util.EkpOrderFileTask;
import com.yifu.cloud.plus.v1.yifu.order.vo.*;
import org.springframework.web.multipart.MultipartFile;
......@@ -95,10 +96,11 @@ public interface TOrderService extends IService<TOrder> {
*
* @author licancan
* @param vo
* @param ekpOrderFileTask
* @return {@link R}
* @throws IOException
*/
R receiveOrder(OrderAddVO vo) throws IOException;
R receiveOrder(OrderAddVO vo, EkpOrderFileTask ekpOrderFileTask) throws IOException;
/**
* 接收处理ekp订单回复
......@@ -118,6 +120,8 @@ public interface TOrderService extends IService<TOrder> {
*/
void receiveOrderNew(InputStream inputStream, String file1, String orderNo, String fileName, String originalFileName) throws IOException;
void receiveOrderFileAsc(InputStream inputStream, String orderNo, String fileName, String originalFileName);
/**
* 订单作废
*
......
......@@ -31,6 +31,7 @@ import com.yifu.cloud.plus.v1.yifu.order.service.TOrderEnclosureService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderHandlerService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderReplyService;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.util.EkpOrderFileTask;
import com.yifu.cloud.plus.v1.yifu.order.util.ValidityUtil;
import com.yifu.cloud.plus.v1.yifu.order.vo.*;
import lombok.extern.slf4j.Slf4j;
......@@ -466,12 +467,13 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
*
* @author licancan
* @param vo
* @param ekpOrderFileTask
* @return {@link R}
* @throws IOException
*/
@Override
@Transactional(rollbackFor = Exception.class)
public R receiveOrder(OrderAddVO vo) throws IOException{
public R receiveOrder(OrderAddVO vo, EkpOrderFileTask ekpOrderFileTask) throws IOException{
if (Common.isEmpty(vo.getOrderNo())){
return R.failed(OrderConstants.ORDER_NO_IS_EMPTY);
......@@ -558,12 +560,10 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
fileName = System.currentTimeMillis() + "_" + multipartFile.getOriginalFilename();
//filePath不传默认存储空间的根目录
//支持的附件格式
getObjectR(multipartFile.getInputStream(),vo.getOrderNo(),fileName,multipartFile.getOriginalFilename(),CommonConstants.ZERO_INT);
ekpOrderFileTask.receiveOrderFileAsc(multipartFile.getInputStream(),vo.getOrderNo(),fileName,multipartFile.getOriginalFilename());
}
}
return R.ok(OrderConstants.OPERATE_SUCCESS);
}
......@@ -657,14 +657,15 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
}
/**
* @Author fxj
* @Description 附件上传
* @Date 9:38 2023/6/26
* @Param
* @return
**/
* 接收处理ekp订单回复
*
* @author licancan
* @return {@link R}
* @throws IOException
*/
@Override
public void receiveOrderNew(InputStream inputStream, String file1, String orderNo, String fileName, String originalFileName){
R<Object> e;
if (file1.equals("fileOne")) {
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.TWO_INTEGER);
}
......@@ -695,6 +696,18 @@ public class TOrderServiceImpl extends ServiceImpl<TOrderMapper, TOrder> impleme
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.ELEVEN_INTEGER);
}
}
/**
* 接收处理ekp订单回复
*
* @author licancan
* @return {@link R}
* @throws IOException
*/
@Override
public void receiveOrderFileAsc(InputStream inputStream, String orderNo, String fileName, String originalFileName){
getObjectR(inputStream, orderNo, fileName, originalFileName,CommonConstants.ZERO_INT);
}
private R<Object> getObjectR(InputStream inputStream, String orderNo, String fileName, String originalFileName,Integer enclosureflag) {
//filePath不传默认存储空间的根目录
......
package com.yifu.cloud.plus.v1.yifu.order.util;
import com.yifu.cloud.plus.v1.yifu.order.service.TOrderService;
import com.yifu.cloud.plus.v1.yifu.order.vo.OrderAttVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Async;
......@@ -38,4 +37,9 @@ public class EkpOrderFileTask {
}
}
}
@Async
public void receiveOrderFileAsc(InputStream inputStream,String orderNo, String fileName, String originalFileName){
orderService.receiveOrderFileAsc(inputStream,orderNo,fileName,originalFileName);
}
}
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