Commit 829737d6 authored by hongguangwu's avatar hongguangwu

Merge remote-tracking branch 'origin/develop' into develop

parents 52feaec1 085b76db
......@@ -134,7 +134,7 @@ public class TEmployeeProjectController {
@DeleteMapping("/{id}" )
@PreAuthorize("@pms.hasPermission('archives_temployeeproject_del')" )
public R removeById(@PathVariable String id) {
return R.ok(tEmployeeProjectService.removeProjectInfo(id));
return tEmployeeProjectService.removeProjectInfo(id);
}
/**
......
......@@ -37,93 +37,37 @@ import java.io.Serializable;
@Data
public class TStatisticsDeclarerVo extends RowIndex implements Serializable {
/**
* ID
*/
@TableId(type = IdType.ASSIGN_ID)
@NotBlank(message = "ID 不能为空")
@Length(max = 32, message = "ID 不能超过32 个字符")
@ExcelAttribute(name = "ID", isNotEmpty = true, errorInfo = "ID 不能为空", maxLength = 32)
@Schema(description = "ID")
@ExcelProperty("ID")
private String id;
/**
* 申报单位
*/
@Length(max = 50, message = "申报单位 不能超过50 个字符")
@ExcelAttribute(name = "申报单位", maxLength = 50)
@Schema(description = "申报单位")
@ExcelProperty("申报单位")
private String declareUnit;
/**
* 申报月份
*/
@NotBlank(message = "申报月份 不能为空")
@Length(max = 6, message = "申报月份 不能超过6 个字符")
@ExcelAttribute(name = "申报月份", isNotEmpty = true, errorInfo = "申报月份 不能为空", maxLength = 6)
@ExcelAttribute(name = "申报月份", isNotEmpty = true, errorInfo = "申报月份 不能为空", maxLength = 6,min = 6)
@Schema(description = "申报月份")
@ExcelProperty("申报月份")
private String declareMonth;
/**
* 员工姓名
*/
@Length(max = 20, message = "员工姓名 不能超过20 个字符")
@ExcelAttribute(name = "员工姓名", maxLength = 20)
@ExcelAttribute(name = "员工姓名", maxLength = 20, isNotEmpty = true)
@Schema(description = "员工姓名")
@ExcelProperty("员工姓名")
private String empName;
/**
* 身份证号
*/
@Length(max = 20, message = "身份证号 不能超过20 个字符")
@ExcelAttribute(name = "身份证号", maxLength = 20)
@ExcelAttribute(name = "身份证号", maxLength = 20, isNotEmpty = true)
@Schema(description = "身份证号")
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 手机号码
*/
@Length(max = 11, message = "手机号码 不能超过11 个字符")
@ExcelAttribute(name = "手机号码", maxLength = 11)
@Schema(description = "手机号码")
@ExcelProperty("手机号码")
private String empPhone;
/**
* 人员状态
*/
@Length(max = 2, message = "人员状态 不能超过2 个字符")
@ExcelAttribute(name = "人员状态", maxLength = 2)
@Schema(description = "人员状态")
@ExcelProperty("人员状态")
private String empStatus;
/**
* 任职受雇从业类型
*/
@Length(max = 2, message = "任职受雇从业类型 不能超过2 个字符")
@ExcelAttribute(name = "任职受雇从业类型", maxLength = 2)
@Schema(description = "任职受雇从业类型")
@ExcelProperty("任职受雇从业类型")
private String occupationType;
/**
* 任职受雇从业日期
*/
@Length(max = 20, message = "任职受雇从业日期 不能超过20 个字符")
@ExcelAttribute(name = "任职受雇从业日期", maxLength = 20)
@Schema(description = "任职受雇从业日期")
@ExcelProperty("任职受雇从业日期")
private String occupationMonth;
/**
* 本月是否申报
*/
@Length(max = 1, message = "本月是否申报 不能超过1 个字符")
@ExcelAttribute(name = "本月是否申报", maxLength = 1)
@ExcelAttribute(name = "本月是否申报", maxLength = 1, isNotEmpty = true,isDataId = true,readConverterExp = "0=是,1=否")
@Schema(description = "本月是否申报")
@ExcelProperty("本月是否申报")
private String isDeclare;
/**
* 不申报原因
*/
@Length(max = 200, message = "不申报原因 不能超过200 个字符")
@ExcelAttribute(name = "不申报原因", maxLength = 200)
@Schema(description = "不申报原因")
@ExcelProperty("不申报原因")
......
......@@ -118,24 +118,25 @@ public class TStatisticsDeclarerController {
*/
@Operation(summary = "通过id删除申报对象表", description = "通过id删除申报对象表:hasPermission('salary_tstatisticsdeclarer_del')")
@SysLog("通过id删除申报对象表" )
@DeleteMapping("/{id}" )
@PostMapping("/updateFlagById" )
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer_del')" )
public R<Boolean> removeById(@PathVariable String id) {
return R.ok(tStatisticsDeclarerService.removeById(id));
public R updateFlagById(@RequestParam String id, @RequestParam String isDeclare,
@RequestParam(required = false) String undeclareReason) {
return tStatisticsDeclarerService.updateFlagById(id,isDeclare,undeclareReason);
}
/**
* 申报对象表 批量导入
* 批量删除本期申报人员
*
* @author huyc
* @date 2022-08-11 10:56:10
**/
@SneakyThrows
@Operation(description = "批量新增申报对象表 hasPermission('salary_tstatisticsdeclarer-batch-import')")
@SysLog("批量新增申报对象表")
@PostMapping("/importListAdd")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer-batch-import')")
public R<List<ErrorMessage>> importListAdd(@RequestBody MultipartFile file) throws IOException {
@Operation(description = "批量删除本期申报人员 hasPermission('salary_tstatisticsdeclarer-batch-delete')")
@SysLog("批量删除本期申报人员")
@PostMapping("/importListDelete")
@PreAuthorize("@pms.hasPermission('salary_tstatisticsdeclarer-batch-delete')")
public R<List<ErrorMessage>> importListDelete(@RequestBody MultipartFile file) throws IOException {
return tStatisticsDeclarerService.importDiy(file.getInputStream());
}
......
......@@ -24,6 +24,8 @@ 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.salary.vo.TStatisticsDeclarerSearchVo;
import org.springframework.web.bind.annotation.RequestParam;
import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.util.List;
......@@ -47,4 +49,13 @@ public interface TStatisticsDeclarerService extends IService<TStatisticsDeclarer
void listExport(HttpServletResponse response, TStatisticsDeclarerSearchVo searchVo);
List<TStatisticsDeclarer> noPageDiy(TStatisticsDeclarerSearchVo searchVo);
/**
* 不申报标识标记
* @param id
* @param isDeclare 是否申报
* @param undeclareReason 不申报原因
* @return
*/
R updateFlagById(String id, String isDeclare, String undeclareReason);
}
......@@ -17,11 +17,13 @@
package com.yifu.cloud.plus.v1.yifu.salary.service.impl;
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;
......@@ -79,6 +81,9 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
List<TStatisticsDeclarer> list = new ArrayList<>();
long count = noPageCountDiy(searchVo);
ServletOutputStream out = null;
if (list == null || list.isEmpty()) {
list = new ArrayList<>();
}
try {
out = response.getOutputStream();
response.setContentType("multipart/form-data");
......@@ -145,7 +150,21 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
return baseMapper.selectList(wrapper);
}
private Long noPageCountDiy(TStatisticsDeclarerSearchVo searchVo) {
@Override
public R updateFlagById(String id, String isDeclare, String undeclareReason) {
TStatisticsDeclarer tStatisticsDeclarer = baseMapper.selectById(id);
if (Common.isNotNull(tStatisticsDeclarer)) {
tStatisticsDeclarer.setIsDeclare(isDeclare);
if (Common.isNotNull(undeclareReason)) {
tStatisticsDeclarer.setUndeclareReason(undeclareReason);
}
baseMapper.updateById(tStatisticsDeclarer);
return R.ok();
}
return R.failed(CommonConstants.PARAM_IS_NOT_ERROR);
}
private Long noPageCountDiy(TStatisticsDeclarerSearchVo searchVo) {
LambdaQueryWrapper<TStatisticsDeclarer> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
if (Common.isNotNull(idList)){
......@@ -227,24 +246,39 @@ public class TStatisticsDeclarerServiceImpl extends ServiceImpl<TStatisticsDecla
return R.ok(errorMessageList);
}
private void importTStatisticsDeclarer(List<TStatisticsDeclarerVo> excelVOList, List<ErrorMessage> errorMessageList) {
// 个性化校验逻辑
ErrorMessage errorMsg;
int successInt = 0;
int failuerInt = 0;
List<TStatisticsDeclarerVo> updateList = new ArrayList<>();
// 执行数据插入操作 组装
for (int i = 0; i < excelVOList.size(); i++) {
TStatisticsDeclarerVo excel = excelVOList.get(i);
// 数据合法情况
// 插入
insertExcel(excel);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(),CommonConstants.SAVE_SUCCESS));
}
}
/**
* 插入excel bad record
*/
private void insertExcel(TStatisticsDeclarerVo excel) {
TStatisticsDeclarer insert = new TStatisticsDeclarer();
BeanUtil.copyProperties(excel, insert);
this.save(insert);
}
if (CommonConstants.ONE_STRING.equals(excel.getIsDeclare()) && Common.isEmpty(excel.getUndeclareReason())) {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "本期是否申报为否时,不申报原因不可为空"));
failuerInt++;
continue;
}
//根据身份证号和申报月份查找申报人员
TStatisticsDeclarer tStatisticsDeclarer = baseMapper.selectOne(Wrappers.<TStatisticsDeclarer>query().lambda()
.eq(TStatisticsDeclarer::getEmpIdcard, excel.getEmpIdcard())
.eq(TStatisticsDeclarer::getDeclareMonth, excel.getDeclareMonth())
.last(CommonConstants.LAST_ONE_SQL));
if (Common.isNotNull(tStatisticsDeclarer)) {
tStatisticsDeclarer.setIsDeclare(excel.getIsDeclare());
if (Common.isNotNull(excel.getUndeclareReason())) {
tStatisticsDeclarer.setUndeclareReason(excel.getUndeclareReason());
}
baseMapper.updateById(tStatisticsDeclarer);
successInt++;
}else {
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), "未找到身份证和申报月份对应的申报人员信息"));
failuerInt++;
continue;
}
}
errorMessageList.add(new ErrorMessage(-1, "成功操作" + successInt +"条数据," + "失败"
+ failuerInt + "条数据"));
}
}
......@@ -414,7 +414,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "reduce_project_reason");
+ "social_reduce_reason");
if (Common.isNotNull(dicObj)) {
for (Map.Entry<String, String> entry : dicObj.entrySet()) {
String key = entry.getKey();
......@@ -609,7 +609,7 @@ public class TPreDispatchInfoServiceImpl extends ServiceImpl<TPreDispatchInfoMap
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue()
.get(CacheConstants.DICT_DETAILS
+ CommonConstants.COLON_STRING
+ "reduce_project_reason");
+ "social_reduce_reason");
if (Common.isNotNull(dicObj)) {
for (Map.Entry<String, String> entry : dicObj.entrySet()) {
String key = entry.getKey();
......
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