Commit 3a81dd3b authored by huyuchen's avatar huyuchen

劳务费稿酬生成修改

parent 6097c0b7
......@@ -32,12 +32,15 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsLabor;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsDeclarerMapper;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsLaborMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsLaborService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsLaborSearchVo;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsLaborVo;
import com.yifu.cloud.plus.v1.yifu.social.entity.TPreDispatchInfo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......@@ -58,7 +61,11 @@ import java.util.stream.Collectors;
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMapper, TStatisticsLabor> implements TStatisticsLaborService {
private final TStatisticsDeclarerMapper declarerMapper;
/**
* 本期劳务费申报表简单分页查询
*
......@@ -275,8 +282,15 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
}
String lastMonth = DateUtil.addMonthByYearMonth(-1,declareMonth); //上月
List<TStatisticsLabor> stdvoList = baseMapper.doStatisticsLabor(declareMonth,lastMonth);
for (TStatisticsLabor declarer : stdvoList) {
this.save(declarer);
for (TStatisticsLabor labor : stdvoList) {
TStatisticsDeclarer declarer = declarerMapper.selectOne(Wrappers.<TStatisticsDeclarer>query().lambda()
.eq(TStatisticsDeclarer::getDeclareMonth,declareMonth)
.eq(TStatisticsDeclarer::getEmpIdcard,labor.getEmpIdcard())
.eq(TStatisticsDeclarer::getDeclareUnit,labor.getDeclareUnit())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(declarer) && CommonConstants.ZERO_STRING.equals(declarer.getIsDeclare())) {
this.save(labor);
}
}
return R.ok();
}
......
......@@ -30,11 +30,14 @@ import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import com.yifu.cloud.plus.v1.yifu.common.core.util.DateUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ExcelUtil;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsLabor;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsRemuneration;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsDeclarerMapper;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsRemunerationMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsRemunerationService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsRemunerationSearchVo;
import lombok.RequiredArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......@@ -54,7 +57,11 @@ import java.util.stream.Collectors;
*/
@Log4j2
@Service
@RequiredArgsConstructor
public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsRemunerationMapper, TStatisticsRemuneration> implements TStatisticsRemunerationService {
private final TStatisticsDeclarerMapper declarerMapper;
/**
* 本期稿酬申报表简单分页查询
*
......@@ -178,7 +185,14 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
String lastMonth = DateUtil.addMonthByYearMonth(-1,declareMonth); //上月
List<TStatisticsRemuneration> stdvoList = baseMapper.doStatisticsRemuneration(declareMonth,lastMonth);
for (TStatisticsRemuneration remuneration : stdvoList) {
this.save(remuneration);
TStatisticsDeclarer declarer = declarerMapper.selectOne(Wrappers.<TStatisticsDeclarer>query().lambda()
.eq(TStatisticsDeclarer::getDeclareMonth,declareMonth)
.eq(TStatisticsDeclarer::getEmpIdcard,remuneration.getEmpIdcard())
.eq(TStatisticsDeclarer::getDeclareUnit,remuneration.getDeclareUnit())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(declarer) && CommonConstants.ZERO_STRING.equals(declarer.getIsDeclare())) {
this.save(remuneration);
}
}
return R.ok();
}
......
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