Commit 105429f9 authored by huyuchen's avatar huyuchen

劳务费稿酬生成修改

parent 36cdd104
......@@ -128,4 +128,17 @@ public class TStatisticsLaborController {
public R doStatisticsLabor() {
return tStatisticsLaborService.doStatisticsLabor();
}
/**
* @param
* @Description: 手动刷新
* @Author: huyc
* @Date: 2022-08-31 18:17:48
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Operation(description = "手动刷新")
@PostMapping("/refreshStatisticsLabor")
public R refreshStatisticsLabor(@RequestParam String declareMonth) {
return tStatisticsLaborService.refreshStatisticsLabor(declareMonth);
}
}
......@@ -127,4 +127,17 @@ public class TStatisticsRemunerationController {
public R doStatisticsRemuneration() {
return tStatisticsRemunerationService.doStatisticsRemuneration();
}
/**
* @param
* @Description: 手动刷新
* @Author: huyc
* @Date: 2022-08-31 18:17:48
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Operation(description = "手动刷新")
@PostMapping("/refreshStatisticsRemuneration")
public R refreshStatisticsRemuneration(@RequestParam String declareMonth) {
return tStatisticsRemunerationService.refreshStatisticsRemuneration(declareMonth);
}
}
......@@ -61,4 +61,10 @@ public interface TStatisticsLaborService extends IService<TStatisticsLabor> {
* @return
**/
R doStatisticsLabor();
/** 手动刷新生成本期劳务费
* @param
* @return
**/
R refreshStatisticsLabor(String declareMonth);
}
......@@ -55,4 +55,10 @@ public interface TStatisticsRemunerationService extends IService<TStatisticsRemu
**/
R doStatisticsRemuneration();
/** 手动刷新生成本期稿酬
* @param
* @return
**/
R refreshStatisticsRemuneration(String declareMonth);
}
......@@ -37,6 +37,7 @@ 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.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
......@@ -262,6 +263,24 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
}
}
@Override
public R refreshStatisticsLabor(String declareMonth) {
TStatisticsLabor std = new TStatisticsLabor();
std.setDeclareMonth(declareMonth);
QueryWrapper<TStatisticsLabor> queryWrapperSs = new QueryWrapper<>();
queryWrapperSs.setEntity(std);
long num = this.count(queryWrapperSs);
if (num > 0) {
baseMapper.delete(Wrappers.<TStatisticsLabor>query().lambda().eq(TStatisticsLabor::getDeclareMonth,declareMonth));
}
String lastMonth = DateUtil.addMonthByYearMonth(-1,declareMonth); //上月
List<TStatisticsLabor> stdvoList = baseMapper.doStatisticsLabor(declareMonth,lastMonth);
for (TStatisticsLabor declarer : stdvoList) {
this.save(declarer);
}
return R.ok();
}
private void importTStatisticsLabor(List<TStatisticsLaborVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
......
......@@ -30,6 +30,7 @@ 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.TStatisticsLabor;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsRemuneration;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsRemunerationMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsRemunerationService;
......@@ -164,6 +165,24 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
}
}
@Override
public R refreshStatisticsRemuneration(String declareMonth) {
TStatisticsRemuneration std = new TStatisticsRemuneration();
std.setDeclareMonth(declareMonth);
QueryWrapper<TStatisticsRemuneration> queryWrapperSs = new QueryWrapper<>();
queryWrapperSs.setEntity(std);
long num = this.count(queryWrapperSs);
if (num > 0) {
baseMapper.delete(Wrappers.<TStatisticsRemuneration>query().lambda().eq(TStatisticsRemuneration::getDeclareMonth,declareMonth));
}
String lastMonth = DateUtil.addMonthByYearMonth(-1,declareMonth); //上月
List<TStatisticsRemuneration> stdvoList = baseMapper.doStatisticsRemuneration(declareMonth,lastMonth);
for (TStatisticsRemuneration remuneration : stdvoList) {
this.save(remuneration);
}
return R.ok();
}
private List<TStatisticsRemuneration> noPageDiy(TStatisticsRemunerationSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsRemuneration> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......
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