Commit 97d37ac5 authored by huyuchen's avatar huyuchen

划转和减项判断社保公积金状态修改

parent 325f1f86
......@@ -39,9 +39,9 @@ import java.math.BigDecimal;
*/
@Data
@TableName("t_statistics_bonus")
@EqualsAndHashCode(callSuper = true)
@EqualsAndHashCode()
@Schema(description = "全年一次性奖金申报表")
public class TStatisticsBonus extends BaseEntity {
public class TStatisticsBonus {
/**
* ID
......
......@@ -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.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsDeclarerService;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerSearchVo;
......@@ -140,6 +141,20 @@ public class TStatisticsDeclarerController {
return tStatisticsDeclarerService.importDiy(file.getInputStream());
}
/**
* @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/doStatisticsTaxDeclarer")
public R doStatisticsTaxDeclarer() {
return tStatisticsDeclarerService.doStatisticsTaxDeclarer();
}
/**
* 申报对象表 批量导出
* @author huyc
......
......@@ -110,7 +110,7 @@ public class TStatisticsLaborController {
@SysLog("批量删除本期稿酬申报表")
@PostMapping("/batchDelete")
@PreAuthorize("@pms.hasPermission('salary_tstatisticslabor_del')")
public R batchDelete(@RequestBody String declareMonth){
public R batchDelete(@RequestParam String declareMonth){
return tStatisticsLaborService.batchDelete(declareMonth);
}
}
......@@ -109,7 +109,7 @@ public class TStatisticsRemunerationController {
@SysLog("批量删除本期稿酬申报表")
@PostMapping("/batchDelete")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsbonus_del')")
public R batchDelete(@RequestBody String declareMonth){
public R batchDelete(@RequestParam String declareMonth){
return tStatisticsRemunerationService.batchDelete(declareMonth);
}
}
......@@ -24,6 +24,8 @@ import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
* 申报对象表
*
......@@ -38,4 +40,11 @@ public interface TStatisticsDeclarerMapper extends BaseMapper<TStatisticsDeclare
* @return
*/
IPage<TStatisticsDeclarer> getTStatisticsDeclarerPage(Page<TStatisticsDeclarer> page, @Param("tStatisticsDeclarer") TStatisticsDeclarer tStatisticsDeclarer);
/**
* @param
* @Description: 统计
* @return:
**/
List<TStatisticsDeclarer> doStatisticsTaxDeclarer(@Param("nowMonth") String nowMonth, @Param("lastYear") String lastYear);
}
......@@ -58,4 +58,11 @@ public interface TStatisticsDeclarerService extends IService<TStatisticsDeclarer
* @return
*/
R updateFlagById(String id, String isDeclare, String undeclareReason);
/**
* @param
* @Description: 生成申报人员
* @return
**/
R doStatisticsTaxDeclarer();
}
......@@ -152,7 +152,6 @@ public class TStatisticsBonusServiceImpl extends ServiceImpl<TStatisticsBonusMap
if (searchVo.getLimitStart() >= 0 && searchVo.getLimitEnd() > 0){
wrapper.last(" limit "+ searchVo.getLimitStart() +","+ searchVo.getLimitEnd());
}
wrapper.orderByDesc(BaseEntity::getCreateTime);
return baseMapper.selectList(wrapper);
}
......
......@@ -16,14 +16,13 @@
*/
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.archives.entity.TEmployeeProject;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsDeclarer;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerVo;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsDeclarerMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsDeclarerService;
import lombok.extern.log4j.Log4j2;
import org.checkerframework.checker.units.qual.C;
import org.springframework.stereotype.Service;
import com.yifu.cloud.plus.v1.yifu.common.core.util.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
......@@ -31,7 +30,6 @@ import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsDeclarerSearchVo;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
import cn.hutool.core.bean.BeanUtil;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.context.AnalysisContext;
......@@ -90,7 +88,7 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName , "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsDeclarer.class).build();
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsDeclarer.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT){
for (int i = 0; i <= count; ) {
......@@ -164,6 +162,27 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
@Override
public R doStatisticsTaxDeclarer() {
String nowMonth = DateUtil.addMonth(0); //本月
TStatisticsDeclarer std = new TStatisticsDeclarer();
std.setDeclareMonth(nowMonth);
QueryWrapper<TStatisticsDeclarer> 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<TStatisticsDeclarer> stdvoList = baseMapper.doStatisticsTaxDeclarer(nowMonth,lastYear);
for (TStatisticsDeclarer declarer : stdvoList) {
this.save(declarer);
}
return R.ok();
}
}
private Long noPageCountDiy(TStatisticsDeclarerSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsDeclarer> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......
......@@ -97,4 +97,15 @@
</where>
order by a.DECLARE_MONTH desc
</select>
<!--统计-->
<select id="doStatisticsTaxDeclarer" resultMap="tStatisticsDeclarerMap">
select
#{nowMonth} DECLARE_MONTH,a.EMP_NAME,a.EMP_IDCARD,a.EMP_PHONE,b.FILE_STATUS EMP_STATUS,
b.UNIT_NAME DECLARE_UNIT,'雇员' OCCUPATION_TYPE
from t_salary_account a
left join t_salary_employee b on b.id = a.EMP_ID
where a.DELETE_FLAG = 0 and a.SETTLEMENT_MONTH like '${lastYear}%'
GROUP BY a.EMP_IDCARD
</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