Commit 76ab6527 authored by huyuchen's avatar huyuchen

申报,稿酬,劳务费接口修改

parent c0900d0c
......@@ -4,6 +4,7 @@ package com.yifu.cloud.plus.v1.job.compont;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalarylProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsBonus;
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;
......@@ -65,10 +66,25 @@ public class salaryTask {
* @Param
**/
public void doStatisticsRemuneration() throws Exception {
log.info("-------------生成本期劳务费-定时任务开始------------");
log.info("-------------生成本期稿酬-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprSalarylProperties.getAppUrl(), daprSalarylProperties.getAppId(),
"/tstatisticsremuneration/inner/doStatisticsRemuneration", "",
TStatisticsRemuneration.class, SecurityConstants.FROM_IN);
log.info("-------------生成本期劳务费-定时任务结束------------");
log.info("-------------生成本期稿酬-定时任务结束------------");
}
/**
* @return
* @Author huyc
* @Description
* @Date 10:48 2022/8/17
* @Param
**/
public void doStatisticsBonus() throws Exception {
log.info("-------------生成全年一次性奖金-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprSalarylProperties.getAppUrl(), daprSalarylProperties.getAppId(),
"/tstatisticsbonus/inner/doStatisticsBonus", "",
TStatisticsBonus.class, SecurityConstants.FROM_IN);
log.info("-------------生成全年一次性奖金-定时任务结束------------");
}
}
......@@ -22,6 +22,7 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
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;
import com.yifu.cloud.plus.v1.yifu.common.security.annotation.Inner;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsBonus;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsBonusService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsBonusSearchVo;
......@@ -139,4 +140,18 @@ public class TStatisticsBonusController {
public R batchDelete(@RequestParam String declareMonth){
return tStatisticsBonusService.batchDelete(declareMonth);
}
/**
* @param
* @Description: 生成全年一次性奖金
* @Author: huyc
* @Date: 2022-08-17 18:17:48
* @return: com.yifu.cloud.v1.common.core.util.R
**/
@Inner
@Operation(description = "生成全年一次性奖金")
@PostMapping("/inner/doStatisticsBonus")
public R doStatisticsBonus() {
return tStatisticsBonusService.doStatisticsBonus();
}
}
......@@ -24,6 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsBonus;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 全年一次性奖金申报表
*
......@@ -38,4 +40,11 @@ public interface TStatisticsBonusMapper extends BaseMapper<TStatisticsBonus> {
* @return
*/
IPage<TStatisticsBonus> getTStatisticsBonusPage(Page<TStatisticsBonus> page, @Param("tStatisticsBonus") TStatisticsBonus tStatisticsBonus);
/**
* @param
* @Description: 统计
* @return:
**/
List<TStatisticsBonus> doStatisticsBonus(@Param("nowMonth") String nowMonth, @Param("lastYear") String lastYear);
}
......@@ -54,4 +54,10 @@ public interface TStatisticsBonusService extends IService<TStatisticsBonus> {
* @return
*/
R batchDelete(String declareMonth);
/** 生成全年一次性奖金
* @param
* @return
**/
R doStatisticsBonus();
}
......@@ -16,10 +16,9 @@
*/
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceDetail;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsBonus;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsBonusVo;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsBonusMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsBonusService;
......@@ -33,7 +32,6 @@ import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.util.ArrayUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
......@@ -45,17 +43,12 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
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.common.mybatis.base.BaseEntity;
import javax.servlet.ServletOutputStream;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
......@@ -170,6 +163,27 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
return null;
}
@Override
public R doStatisticsBonus() {
String nowMonth = DateUtil.addMonth(0); //本月
TStatisticsBonus std = new TStatisticsBonus();
std.setDeclareMonth(nowMonth);
QueryWrapper<TStatisticsBonus> queryWrapperSs = new QueryWrapper<>();
queryWrapperSs.setEntity(std);
long num = this.count(queryWrapperSs);
if (num > 0) {
return R.failed("上月数据已生成,不可重复生成!");
} else {
String lastMonth = DateUtil.addMonth(-1); //上月
String lastYear = lastMonth.substring(0,4);
List<TStatisticsBonus> stdvoList = baseMapper.doStatisticsBonus(nowMonth,lastYear);
for (TStatisticsBonus bonus : stdvoList) {
this.save(bonus);
}
return R.ok();
}
}
private Long noPageCountDiy(TStatisticsBonusSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsBonus> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......
......@@ -102,4 +102,17 @@
</where>
order by a.DECLARE_MONTH desc
</select>
<!--统计-->
<select id="doStatisticsBonus" resultMap="tStatisticsBonusMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,b.UNIT_NAME DECLARE_UNIT,
sum(annualbonus.SALARY_MONEY) ANNUAL_BONUS,sum(tax.SALARY_MONEY) BONUS_TAX
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
left join t_salary_account_item annualbonus on annualbonus.SALARY_ACCOUNT_ID = a.id and annualbonus.CN_NAME='年终奖'
left join t_salary_account_item tax on tax.SALARY_ACCOUNT_ID = a.id and tax.CN_NAME='年终奖单独扣税'
where a.DELETE_FLAG = '1' and a.SETTLEMENT_MONTH like '${lastYear}%' and annualbonus.SALARY_MONEY > 0 and tax.SALARY_MONEY > 0
GROUP BY a.EMP_IDCARD,a.EMP_NAME
</select>
</mapper>
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