Commit 4ac57c25 authored by fangxinjiang's avatar fangxinjiang

人员花名册

parent 894bc732
......@@ -16,34 +16,26 @@
*/
package com.yifu.cloud.plus.v1.yifu.archives.service.impl;
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;
import com.alibaba.excel.read.listener.ReadListener;
import com.alibaba.excel.read.metadata.holder.ReadRowHolder;
import com.alibaba.excel.util.ListUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
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.archives.entity.FddSealPersonAuth;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TDepartSettlementInfo;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPersonnelRoster;
import com.yifu.cloud.plus.v1.yifu.archives.mapper.TPersonnelRosterMapper;
import com.yifu.cloud.plus.v1.yifu.archives.service.TPersonnelRosterService;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterSearchVo;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
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.common.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSalaryProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.HttpDaprUtil;
import com.yifu.cloud.plus.v1.yifu.common.mybatis.base.BaseEntity;
import com.yifu.cloud.plus.v1.yifu.salary.vo.SalaryEmpRosterRes;
import com.yifu.cloud.plus.v1.yifu.salary.vo.TSalaryEmpRosterVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
......@@ -53,7 +45,6 @@ import org.springframework.stereotype.Service;
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.HashMap;
......@@ -69,10 +60,11 @@ import java.util.stream.Collectors;
*/
@Log4j2
@AllArgsConstructor
@EnableConfigurationProperties({DaprArchivesProperties.class})
@EnableConfigurationProperties({DaprSalaryProperties.class})
@Service
public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMapper, TPersonnelRoster> implements TPersonnelRosterService {
private final DaprArchivesProperties daprArchivesProperties;
private final DaprSalaryProperties daprSalaryProperties;
/**
* 简单分页查询
* @param tPersonnelRoster
......@@ -159,7 +151,7 @@ public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMap
long count = baseMapper.getTPersonnelRosterCount(searchVo);
List<TPersonnelRoster> list;
if (count > CommonConstants.ZERO_INT){
R<List<TSalaryEmpRosterVo>> res;
R<SalaryEmpRosterRes> res;
Map<String,TSalaryEmpRosterVo> voMap = new HashMap<>();
TSalaryEmpRosterVo rosterVo;
for (int i = 0; i <= count; ) {
......@@ -168,14 +160,16 @@ public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMap
list = baseMapper.getTPersonnelRoster(searchVo);
if (Common.isNotNull(list)){
// 处理薪资信息
res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/tsalaryemployee/inner/getSalaryEmpRoster", list.stream()
res = HttpDaprUtil.invokeMethodPost(daprSalaryProperties.getAppUrl(), daprSalaryProperties.getAppId(),
"/tsalaryemployee/getSalaryEmpRoster", list.stream()
.map(TPersonnelRoster::getEmpIdcard).collect(Collectors.toList()),
TSalaryEmpRosterVo.class, SecurityConstants.FROM_IN);
if (Common.isNotNull(res) && Common.isNotNull(res.getData()) && res.getData().size() > 0){
for (TSalaryEmpRosterVo vo :res.getData()){
SalaryEmpRosterRes.class, SecurityConstants.FROM_IN);
if (Common.isNotNull(res) && Common.isNotNull(res.getData()) && Common.isNotEmpty(res.getData().getRosterVos())){
for (TSalaryEmpRosterVo vo :res.getData().getRosterVos()){
voMap.put(vo.getEmpIdcard(),vo);
}
}else {
return;
}
if (Common.isNotNull(list) && Common.isNotNull(voMap)){
for (TPersonnelRoster r:list){
......
dapr.upms.appUrl=http://yifu-upms.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.upms.appUrl=http://localhost:3500/v1.0/invoke/
dapr.upms.appId=yifu-upms
#\u6D4B\u8BD5\u73AF\u5883
#dapr.check.appUrl=http://yifu-check.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
#\u672C\u5730
dapr.check.appUrl=http://yifu-check.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.check.appUrl=http://localhost:3507/v1.0/invoke/
dapr.check.appId=yifu-check
#\u672C\u5730
dapr.archives.appUrl=http://yifu-archives.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.archives.appUrl=http://localhost:3508/v1.0/invoke/
dapr.archives.appId=yifu-archives
#\u672C\u5730
dapr.salary.appUrl=http://localhost:3520/v1.0/invoke/
dapr.salary.appId=yifu-salary
dapr.social.appUrl=http://yifu-social.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.social.appUrl=http://localhost:3510/v1.0/invoke/
dapr.social.appId=yifu-social
#\u6D4B\u8BD5\u73AF\u5883-B\u7AEF\u670D\u52A1
......@@ -22,5 +26,5 @@ dapr.business.appUrl=http://yifu-business.qas-mvp.svc.cluster.local:3500/v1.0/in
dapr.business.appId=yifu-business
#\u6D4B\u8BD5\u73AF\u5883-\u6D88\u606F\u63D0\u9192\u670D\u52A1
dapr.msg.appUrl=http://yifu-msg.qas-mvp.svc.cluster.local:3500/v1.0/invoke/
dapr.msg.appUrl=http://localhost:3535/v1.0/invoke/
dapr.msg.appId=yifu-msg
\ No newline at end of file
......@@ -60,4 +60,12 @@ public class ArchiveTask {
SecurityConstants.FROM_IN);
log.info("-------------每日凌晨1点人员退休提醒-定时任务开始------------");
}
public void everyMonthUpdateRoster() {
log.info("-------------每月26号更新人员花名册-定时任务开始------------");
HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/tpersonnelroster/inner/everyMonthUpdateRoster", "", Object.class,
SecurityConstants.FROM_IN);
log.info("-------------每月26号更新人员花名册-定时任务开始------------");
}
}
\ No newline at end of file
package com.yifu.cloud.plus.v1.yifu.salary.vo;
import lombok.Data;
import java.io.Serializable;
import java.util.List;
/**
* @Author fxj
* @Date 2023/6/26
* @Description
* @Version 1.0
*/
@Data
public class SalaryEmpRosterRes implements Serializable {
private List<TSalaryEmpRosterVo> rosterVos;
}
......@@ -8,6 +8,7 @@ import lombok.Data;
import org.hibernate.validator.constraints.Length;
import javax.validation.constraints.NotBlank;
import java.io.Serializable;
/**
* @Author fxj
......@@ -17,54 +18,32 @@ import javax.validation.constraints.NotBlank;
* @return
**/
@Data
public class TSalaryEmpRosterVo {
public class TSalaryEmpRosterVo implements Serializable {
/**
* 身份证号
*/
@ExcelAttribute(name = "身份证号", isNotEmpty = true, errorInfo = "身份证号不能为空", maxLength = 32)
@NotBlank(message = "身份证号不能为空")
@Length(max = 32, message = "身份证号不能超过32个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("身份证号")
private String empIdcard;
/**
* 开户行总行
*/
@ExcelAttribute(name = "开户行总行", maxLength = 50)
@Length(max = 50, message = "开户行总行不能超过50个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("开户行总行")
private String bankName;
/**
* 开户行省
*/
@ExcelAttribute(name = "开户行省",isArea = true)
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("开户行省")
private String bankProvince;
/**
* 开户行市
*/
@ExcelAttribute(name = "开户行市",isArea = true,parentField = "bankProvince")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("开户行市")
private String bankCity;
/**
* 开户行支行
*/
@ExcelAttribute(name = "开户行支行", maxLength = 50)
@Length(max = 50, message = "开户行支行不能超过50个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("开户行支行")
private String bankSubName;
/**
* 银行卡号
*/
@ExcelAttribute(name = "银行卡号", maxLength = 50)
@Length(max = 50, message = "银行卡号不能超过50个字符")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty("银行卡号")
private String bankNo;
}
......@@ -217,8 +217,10 @@ public class TSalaryEmployeeController {
**/
@Operation(summary = "获取员工花名册信息信息", description = "获取员工花名册信息信息")
@Inner
@PostMapping("/inner/getSalaryEmpRoster")
public List<TSalaryEmpRosterVo> getSalaryEmpRoster(@RequestBody List<String> idCardList) {
return tSalaryEmployeeService.getSalaryEmpRoster(idCardList);
@PostMapping("/getSalaryEmpRoster")
public R<SalaryEmpRosterRes> getSalaryEmpRoster(@RequestBody List<String> idCardList) {
SalaryEmpRosterRes res = new SalaryEmpRosterRes();
res.setRosterVos(tSalaryEmployeeService.getSalaryEmpRoster(idCardList));
return new R<>(res);
}
}
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