生成合同
This commit is contained in:
parent
90f6140c7b
commit
c591aa3200
@ -25,6 +25,7 @@ import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.scheduling.annotation.Scheduled;
|
||||
import org.springframework.stereotype.Component;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDate;
|
||||
@ -63,12 +64,16 @@ public class CalSalaryBatch {
|
||||
/**
|
||||
* 每月1日凌晨1点执行
|
||||
*/
|
||||
@Scheduled(cron = "0 0 1 1 * ?")
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
@Scheduled(cron = "30 40 23 * * ?")
|
||||
public void execute(){
|
||||
log.info("员工提成批处理开始");
|
||||
LocalDate now = this.now == null ? LocalDate.now(): this.now;
|
||||
LocalDate lastDayOfLastMonth = now.with(TemporalAdjusters.firstDayOfMonth());//这个月第一天0分0秒
|
||||
LocalDate firstDayOfLastMonth = lastDayOfLastMonth.minusMonths(1);//上个月第一天0分0秒
|
||||
// LocalDate lastDayOfLastMonth = now.with(TemporalAdjusters.firstDayOfMonth());//这个月第一天0分0秒
|
||||
// LocalDate firstDayOfLastMonth = lastDayOfLastMonth.minusMonths(1);//上个月第一天0分0秒
|
||||
LocalDate firstDayOfLastMonth = now.with(TemporalAdjusters.firstDayOfMonth());//这个月第一天0分0秒
|
||||
LocalDate lastDayOfLastMonth = firstDayOfLastMonth.plusMonths(1);//下个月第一天0分0秒
|
||||
|
||||
//删除该月历史数据
|
||||
psSalaryMapper.delete(Wrappers.<PsSalary>lambdaQuery().eq(PsSalary::getSalaryMonth,DateUtils.toString(firstDayOfLastMonth,"yyyy-MM")));
|
||||
log.info("查询所有员工");
|
||||
@ -154,8 +159,8 @@ public class CalSalaryBatch {
|
||||
unfinCode = unfinistMap.get(userId).stream().map(PsContractInfo::getContractCode).toList();
|
||||
psSalary.setUnfinishContractCode(finistMap.get(userId).stream().map(PsContractInfo::getContractCode).collect(Collectors.joining(",")));
|
||||
}
|
||||
psSalary.setFinishContractCode(String.join(",",finCode));
|
||||
psSalary.setUnfinishContractCode(String.join(",",unfinCode));
|
||||
// psSalary.setFinishContractCode(String.join(",",finCode));
|
||||
// psSalary.setUnfinishContractCode(String.join(",",unfinCode));
|
||||
psSalaryMapper.insert(psSalary);
|
||||
List<PsSalaryContract> lis = new ArrayList<>();
|
||||
if(CollectionUtils.isNotEmpty(finCode)) {
|
||||
@ -172,6 +177,10 @@ public class CalSalaryBatch {
|
||||
lis.addAll(unfin);
|
||||
}
|
||||
}
|
||||
lis.forEach(item->{
|
||||
item.setUserId(user.getUserId());
|
||||
item.setSalaryRatioDate(DateUtils.toDate(firstDayOfLastMonth));
|
||||
});
|
||||
salaryContractMapper.insertBatch(lis);
|
||||
}
|
||||
|
||||
|
@ -16,7 +16,7 @@ import java.util.Map;
|
||||
@ExcelIgnoreUnannotated
|
||||
public class TaskPlanVo {
|
||||
/**
|
||||
* 任务状态
|
||||
* 主任务状态
|
||||
*/
|
||||
private String state;
|
||||
|
||||
|
@ -96,7 +96,7 @@ public abstract class ApproverAbstractServiceImpl implements ApproverService {
|
||||
.like(StringUtils.isNotBlank(bo.getCustomName()),"cus.custom_name",bo.getCustomName())
|
||||
.like(StringUtils.isNotBlank(bo.getCompanyName()),"com.company_name",bo.getCompanyName())
|
||||
//销售经理姓名
|
||||
.exists(StringUtils.isNotBlank(bo.getCustomManagerName()),"select 1 from sys_user su where su.user_id = cus.custom_manager and su.nick_name like %"+bo.getCustomManagerName()+"%")
|
||||
.exists(StringUtils.isNotBlank(bo.getCustomManagerName()),"select 1 from sys_user su where su.user_id = cus.custom_manager and su.nick_name like '%"+bo.getCustomManagerName()+"%'")
|
||||
.orderByAsc("app.approver_status").orderByDesc("app.apply_date");
|
||||
Page<PsApproverRecordVo> res = recordMapper.selectPageApproverList(pageQuery.build(), lqw);
|
||||
if(CollectionUtils.isNotEmpty(res.getRecords())){
|
||||
|
@ -154,6 +154,7 @@ public class PsTaskServiceImpl implements IPsTaskService {
|
||||
planVo.setSecState(item.getAppointStatus());
|
||||
}
|
||||
});
|
||||
planVo.setState(baseMapper.selectById(id).getTaskStatus());
|
||||
return planVo;
|
||||
}
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user