Commit 6bf81332 authored by huyuchen's avatar huyuchen

薪资审核页面接口修改

parent 8765e70f
......@@ -66,9 +66,9 @@ public class TStatisticsDeclarer {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@Length(max = 20, message = "员工姓名不能超过20个字符")
@ExcelProperty("员工姓名")
@ExcelAttribute(name = "姓名", maxLength = 20)
@Length(max = 20, message = "姓名不能超过20个字符")
@ExcelProperty("姓名")
private String empName;
/**
* 身份证号
......@@ -87,14 +87,14 @@ public class TStatisticsDeclarer {
/**
* 人员状态
*/
@ExcelAttribute(name = "人员状态", maxLength = 2)
@ExcelAttribute(name = "人员状态", maxLength = 2,readConverterExp = "0=在职,1=离职")
@Length(max = 2, message = "人员状态不能超过2个字符")
@ExcelProperty("人员状态")
private String empStatus;
/**
* 任职受雇从业类型
*/
@ExcelAttribute(name = "任职受雇从业类型", maxLength = 2)
@ExcelAttribute(name = "任职受雇从业类型", maxLength = 2,readConverterExp = "0=雇员,1=其他")
@Length(max = 2, message = "任职受雇从业类型不能超过2个字符")
@ExcelProperty("任职受雇从业类型")
private String occupationType;
......@@ -108,9 +108,9 @@ public class TStatisticsDeclarer {
/**
* 本月是否申报 0 是 1 否
*/
@ExcelAttribute(name = "本月是否申报", maxLength = 1)
@Length(max = 1, message = "本是否申报不能超过1个字符")
@ExcelProperty("本是否申报")
@ExcelAttribute(name = "本期是否申报", maxLength = 1,readConverterExp = "0=是,1=否")
@Length(max = 1, message = "本是否申报不能超过1个字符")
@ExcelProperty("本是否申报")
private String isDeclare;
/**
* 不申报原因
......
......@@ -43,9 +43,9 @@ public class TStatisticsDeclarerVo extends RowIndex implements Serializable {
/**
* 员工姓名
*/
@ExcelAttribute(name = "员工姓名", maxLength = 20, isNotEmpty = true)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
@ExcelAttribute(name = "姓名", maxLength = 20, isNotEmpty = true)
@Schema(description = "姓名")
@ExcelProperty("姓名")
private String empName;
/**
* 身份证号
......@@ -57,9 +57,9 @@ public class TStatisticsDeclarerVo extends RowIndex implements Serializable {
/**
* 本月是否申报
*/
@ExcelAttribute(name = "本月是否申报", maxLength = 1, isNotEmpty = true,isDataId = true,readConverterExp = "0=是,1=否")
@Schema(description = "本是否申报")
@ExcelProperty("本是否申报")
@ExcelAttribute(name = "本期是否申报", maxLength = 1, isNotEmpty = true,readConverterExp = "0=是,1=否")
@Schema(description = "本是否申报")
@ExcelProperty("本是否申报")
private String isDeclare;
/**
* 不申报原因
......
......@@ -136,7 +136,7 @@ public class TStatisticsBonusController {
@SysLog("批量删除全年一次性奖金申报表")
@PostMapping("/batchDelete")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsbonus_del')")
public R batchDelete(@RequestBody String declareMonth){
public R batchDelete(@RequestParam String declareMonth){
return tStatisticsBonusService.batchDelete(declareMonth);
}
}
......@@ -79,7 +79,7 @@ public class TStatisticsDeclarerController {
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('salary_tstatisticsdeclarer_get')")
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}" )
public R<TStatisticsDeclarer> getById(@PathVariable("id" ) String id) {
return R.ok(tStatisticsDeclarerService.getById(id));
......@@ -147,7 +147,7 @@ public class TStatisticsDeclarerController {
**/
@Operation(description = "导出申报对象表 hasPermission('salary_tstatisticsdeclarer-export')")
@PostMapping("/export")
// @PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer-export')")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer-export')")
public void export(HttpServletResponse response, @RequestBody TStatisticsDeclarerSearchVo searchVo) {
tStatisticsDeclarerService.listExport(response,searchVo);
}
......
......@@ -99,4 +99,18 @@ public class TStatisticsLaborController {
public void export(HttpServletResponse response, @RequestBody TStatisticsLaborSearchVo searchVo) {
tStatisticsLaborService.listExport(response, searchVo);
}
/**
* 本期劳务费申报表 批量删除
*
* @author huyc
* @date 2022-08-14 21:31:15
**/
@Operation(description = "批量删除本期劳务费申报表 hasPermission('salary_tstatisticslabor_del')")
@SysLog("批量删除本期稿酬申报表")
@PostMapping("/batchDelete")
@PreAuthorize("@pms.hasPermission('salary_tstatisticslabor_del')")
public R batchDelete(@RequestBody String declareMonth){
return tStatisticsLaborService.batchDelete(declareMonth);
}
}
......@@ -47,7 +47,6 @@ public class TStatisticsRemunerationController {
private final TStatisticsRemunerationService tStatisticsRemunerationService;
/**
* 简单分页查询
*
......@@ -67,7 +66,7 @@ public class TStatisticsRemunerationController {
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询:hasPermission('salary_tstatisticsremuneration_get')")
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/{id}")
public R<TStatisticsRemuneration> getById(@PathVariable("id") String id) {
return R.ok(tStatisticsRemunerationService.getById(id));
......@@ -99,4 +98,18 @@ public class TStatisticsRemunerationController {
public void export(HttpServletResponse response, @RequestBody TStatisticsRemunerationSearchVo searchVo) {
tStatisticsRemunerationService.listExport(response, searchVo);
}
/**
* 本期稿酬申报表 批量删除
*
* @author huyc
* @date 2022-08-14 21:31:15
**/
@Operation(description = "批量删除本期稿酬申报表 hasPermission('salary_tstatisticsremuneration_del')")
@SysLog("批量删除本期稿酬申报表")
@PostMapping("/batchDelete")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsbonus_del')")
public R batchDelete(@RequestBody String declareMonth){
return tStatisticsRemunerationService.batchDelete(declareMonth);
}
}
......@@ -48,4 +48,11 @@ public interface TStatisticsLaborService extends IService<TStatisticsLabor> {
void listExport(HttpServletResponse response, TStatisticsLaborSearchVo searchVo);
List<TStatisticsLabor> noPageDiy(TStatisticsLaborSearchVo searchVo);
/**
* 批量删除本期稿酬申报表
* @param declareMonth 申报月份
* @return
*/
R batchDelete(String declareMonth);
}
......@@ -20,6 +20,7 @@ package com.yifu.cloud.plus.v1.yifu.salary.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.salary.entity.TStatisticsRemuneration;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TStatisticsRemunerationSearchVo;
......@@ -41,4 +42,11 @@ public interface TStatisticsRemunerationService extends IService<TStatisticsRemu
void listExport(HttpServletResponse response, TStatisticsRemunerationSearchVo searchVo);
/**
* 批量删除本期稿酬申报表
* @param declareMonth 申报月份
* @return
*/
R batchDelete(String declareMonth);
}
......@@ -46,6 +46,7 @@ import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 本期劳务费申报表
......@@ -74,7 +75,7 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
*/
@Override
public void listExport(HttpServletResponse response, TStatisticsLaborSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "本期劳务费导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TStatisticsLabor> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -85,7 +86,6 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsLabor.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
......@@ -156,6 +156,15 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
private LambdaQueryWrapper buildQueryWrapper(TStatisticsLaborSearchVo entity) {
LambdaQueryWrapper<TStatisticsLabor> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(entity.getDeclareMonth())) {
wrapper.eq(TStatisticsLabor::getDeclareMonth,entity.getDeclareMonth());
}
if (Common.isNotNull(entity.getEmpName())) {
wrapper.eq(TStatisticsLabor::getEmpName,entity.getEmpName());
}
if (Common.isNotNull(entity.getEmpIdcard())) {
wrapper.eq(TStatisticsLabor::getEmpIdcard,entity.getEmpIdcard());
}
return wrapper;
}
......@@ -217,6 +226,21 @@ public class TStatisticsLaborServiceImpl extends ServiceImpl<TStatisticsLaborMap
return R.ok(errorMessageList);
}
@Override
public R batchDelete(String declareMonth) {
if (Common.isNotNull(declareMonth)) {
List<TStatisticsLabor> deleteList = baseMapper.selectList(Wrappers.<TStatisticsLabor>query().lambda()
.eq(TStatisticsLabor::getDeclareMonth, declareMonth));
if (Common.isNotNull(deleteList)) {
List<String> idList = deleteList.stream().map(TStatisticsLabor::getId).collect(Collectors.toList());
baseMapper.deleteBatchIds(idList);
return R.ok();
}
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
return null;
}
private void importTStatisticsLabor(List<TStatisticsLaborVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
......
......@@ -28,6 +28,7 @@ import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
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.TStatisticsRemuneration;
import com.yifu.cloud.plus.v1.yifu.salary.mapper.TStatisticsRemunerationMapper;
import com.yifu.cloud.plus.v1.yifu.salary.service.TStatisticsRemunerationService;
......@@ -41,6 +42,7 @@ import java.io.IOException;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
/**
* 本期稿酬申报表
......@@ -69,7 +71,7 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
*/
@Override
public void listExport(HttpServletResponse response, TStatisticsRemunerationSearchVo searchVo) {
String fileName = "不良记录批量导出" + DateUtil.getThisTime() + ".xlsx";
String fileName = "本期稿酬申报表导出" + DateUtil.getThisTime() + ".xlsx";
//获取要导出的列表
List<TStatisticsRemuneration> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
......@@ -80,7 +82,6 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
response.setCharacterEncoding("utf-8");
response.setHeader("Content-Disposition", "attachment;filename=" + URLEncoder.encode(fileName, "UTF-8"));
// 这里 需要指定写用哪个class去写,然后写到第一个sheet,然后文件流会自动关闭
//EasyExcel.write(out, TEmpBadRecord.class).sheet("不良记录").doWrite(list);
ExcelWriter excelWriter = EasyExcel.write(out, TStatisticsRemuneration.class).build();
int index = 0;
if (count > CommonConstants.ZERO_INT) {
......@@ -127,6 +128,21 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
}
}
@Override
public R batchDelete(String declareMonth) {
if (Common.isNotNull(declareMonth)) {
List<TStatisticsRemuneration> deleteList = baseMapper.selectList(Wrappers.<TStatisticsRemuneration>query().lambda()
.eq(TStatisticsRemuneration::getDeclareMonth, declareMonth));
if (Common.isNotNull(deleteList)) {
List<String> idList = deleteList.stream().map(TStatisticsRemuneration::getId).collect(Collectors.toList());
baseMapper.deleteBatchIds(idList);
return R.ok();
}
return R.failed(CommonConstants.NO_DATA_TO_HANDLE);
}
return null;
}
private List<TStatisticsRemuneration> noPageDiy(TStatisticsRemunerationSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsRemuneration> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......@@ -150,6 +166,15 @@ public class TStatisticsRemunerationServiceImpl extends ServiceImpl<TStatisticsR
private LambdaQueryWrapper buildQueryWrapper(TStatisticsRemunerationSearchVo entity) {
LambdaQueryWrapper<TStatisticsRemuneration> wrapper = Wrappers.lambdaQuery();
if (Common.isNotNull(entity.getDeclareMonth())) {
wrapper.eq(TStatisticsRemuneration::getDeclareMonth,entity.getDeclareMonth());
}
if (Common.isNotNull(entity.getEmpName())) {
wrapper.eq(TStatisticsRemuneration::getEmpName,entity.getEmpName());
}
if (Common.isNotNull(entity.getEmpIdcard())) {
wrapper.eq(TStatisticsRemuneration::getEmpIdcard,entity.getEmpIdcard());
}
return wrapper;
}
......
......@@ -100,5 +100,6 @@
1=1
<include refid="tStatisticsBonus_where"/>
</where>
order by a.DECLARE_MONTH desc
</select>
</mapper>
......@@ -90,5 +90,7 @@
1=1
<include refid="tStatisticsLabor_where"/>
</where>
group by a.EMP_IDCARD,a.DECLARE_MONTH,a.EMP_NAME
order by a.DECLARE_MONTH desc
</select>
</mapper>
......@@ -85,5 +85,7 @@
1=1
<include refid="tStatisticsRemuneration_where"/>
</where>
group by a.EMP_IDCARD,a.DECLARE_MONTH,a.EMP_NAME
order by a.DECLARE_MONTH desc
</select>
</mapper>
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.yifu.cloud.plus.v1.yifu.archives.config.FddAutoConfigue
\ No newline at end of file
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