Commit f5b2ee30 authored by fangxinjiang's avatar fangxinjiang

人员花名册

parent 99d54cd5
......@@ -86,7 +86,7 @@ public class TPersonnelRoster extends BaseEntity {
@Length(max = 50, message = "二级分类不能超过50个字符")
@ExcelProperty("二级分类")
@Schema(description = "二级分类")
private String businessSeconed;
private String businessSecond;
/**
* 三级分类
*/
......@@ -239,13 +239,30 @@ public class TPersonnelRoster extends BaseEntity {
@Schema(description = "档案地-县")
private String empTown;
/**
* 社保缴纳地
* 社保缴纳地-省
*/
@ExcelAttribute(name = "社保缴纳地", maxLength = 50)
@Length(max = 50, message = "社保缴纳地不能超过50个字符")
@ExcelProperty("社保缴纳地")
@Schema(description = "社保缴纳地")
private String socialAddress;
private String socialProvince;
/**
* 社保缴纳地-市
*/
@ExcelAttribute(name = "社保缴纳地-市", maxLength = 50)
@Length(max = 50, message = "社保缴纳地-市不能超过50个字符")
@ExcelProperty("社保缴纳地-市")
@Schema(description = "社保缴纳地-市")
private String socialCity;
/**
* 社保缴纳地-县
*/
@ExcelAttribute(name = "社保缴纳地-县", maxLength = 50)
@Length(max = 50, message = "社保缴纳地-县不能超过50个字符")
@ExcelProperty("社保缴纳地-县")
@Schema(description = "社保缴纳地-县")
private String socialTown;
/**
* 合同申请编号
*/
......
......@@ -24,6 +24,7 @@ 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.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 io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
......@@ -133,4 +134,18 @@ public class TPersonnelRosterController {
public void export(HttpServletResponse response, @RequestBody TPersonnelRosterSearchVo searchVo) {
tPersonnelRosterService.listExport(response,searchVo);
}
/**
* @Author fxj
* @Description 每月26号更新人员花名册
* @Date 10:57 2023/6/19
* @Param
* @return
**/
@Operation(summary = "每月26号更新人员花名册", description = "每月26号更新人员花名册")
@Inner
@PostMapping("/inner/everyMonthUpdateRoster")
public void everyMonthUpdateRoster() {
tPersonnelRosterService.everyMonthUpdateRoster();
}
}
......@@ -21,9 +21,12 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TPersonnelRoster;
import com.yifu.cloud.plus.v1.yifu.archives.vo.TPersonnelRosterSearchVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List;
/**
*
*
......@@ -37,5 +40,15 @@ public interface TPersonnelRosterMapper extends BaseMapper<TPersonnelRoster> {
* @param tPersonnelRoster
* @return
*/
IPage<TPersonnelRoster> getTPersonnelRosterPage(Page<TPersonnelRoster> page, @Param("tPersonnelRoster") TPersonnelRoster tPersonnelRoster);
IPage<TPersonnelRoster> getTPersonnelRosterPage(Page<TPersonnelRoster> page, @Param("tPersonnelRoster") TPersonnelRosterSearchVo tPersonnelRoster);
/**
* @Author fxj
* @Description 获取待生成人员花名册数据
* @Date 11:41 2023/6/19
* @Param
* @return
**/
List<TPersonnelRoster> getTPersonnelRoster(@Param("tPersonnelRoster") TPersonnelRoster tPersonnelRoster);
Integer getTPersonnelRosterCount(@Param("tPersonnelRoster") TPersonnelRoster tPersonnelRoster);
}
......@@ -46,4 +46,6 @@ public interface TPersonnelRosterService extends IService<TPersonnelRoster> {
void listExport(HttpServletResponse response, TPersonnelRosterSearchVo searchVo);
List<TPersonnelRoster> noPageDiy(TPersonnelRosterSearchVo searchVo);
void everyMonthUpdateRoster();
}
......@@ -30,15 +30,24 @@ 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.dapr.config.DaprArchivesProperties;
import com.yifu.cloud.plus.v1.yifu.common.dapr.config.DaprSocialProperties;
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.TSalaryEmpRosterVo;
import lombok.AllArgsConstructor;
import lombok.extern.log4j.Log4j2;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.stereotype.Service;
import javax.servlet.ServletOutputStream;
......@@ -47,7 +56,11 @@ import java.io.IOException;
import java.io.InputStream;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
/**
*
*
......@@ -55,8 +68,11 @@ import java.util.List;
* @date 2023-06-13 15:42:17
*/
@Log4j2
@AllArgsConstructor
@EnableConfigurationProperties({DaprArchivesProperties.class})
@Service
public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMapper, TPersonnelRoster> implements TPersonnelRosterService {
private final DaprArchivesProperties daprArchivesProperties;
/**
* 简单分页查询
* @param tPersonnelRoster
......@@ -146,6 +162,57 @@ public class TPersonnelRosterServiceImpl extends ServiceImpl<TPersonnelRosterMap
return baseMapper.selectList(wrapper);
}
@Override
public void everyMonthUpdateRoster() {
TPersonnelRosterSearchVo searchVo = new TPersonnelRosterSearchVo();
long count = baseMapper.getTPersonnelRosterCount(searchVo);
List<TPersonnelRoster> list;
if (count > CommonConstants.ZERO_INT){
R<List<TSalaryEmpRosterVo>> res;
Map<String,TSalaryEmpRosterVo> voMap = new HashMap<>();
TSalaryEmpRosterVo rosterVo;
for (int i = 0; i <= count; ) {
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.BATCH_COUNT);
list = baseMapper.getTPersonnelRoster(searchVo);
if (Common.isNotNull(list)){
// 处理薪资信息
res = HttpDaprUtil.invokeMethodPost(daprArchivesProperties.getAppUrl(), daprArchivesProperties.getAppId(),
"/tsalaryemployee/inner/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()){
voMap.put(vo.getEmpIdcard(),vo);
}
}
if (Common.isNotNull(list) && Common.isNotNull(voMap)){
for (TPersonnelRoster r:list){
rosterVo = voMap.get(r.getEmpIdcard());
if (Common.isNotNull(rosterVo)){
r.setBankNo(rosterVo.getBankNo());
r.setBankCity(rosterVo.getBankCity());
r.setBankName(rosterVo.getBankName());
r.setBankNameSub(rosterVo.getBankSubName());
r.setBankProvince(rosterVo.getBankProvince());
}
}
this.saveBatch(list);
}
}
i = i + CommonConstants.BATCH_COUNT;
if (Common.isNotNull(list)){
list.clear();
}
if (Common.isNotNull(voMap)){
voMap.clear();
}
}
}
}
private Long noPageCountDiy(TPersonnelRosterSearchVo searchVo) {
LambdaQueryWrapper<TPersonnelRoster> wrapper = buildQueryWrapper(searchVo);
List<String> idList = Common.getList(searchVo.getIds());
......
......@@ -29,7 +29,7 @@
<result property="departName" column="DEPART_NAME"/>
<result property="departNo" column="DEPART_NO"/>
<result property="businessPrimary" column="BUSINESS_PRIMARY"/>
<result property="businessSeconed" column="BUSINESS_SECONED"/>
<result property="businessSecond" column="BUSINESS_SECOND"/>
<result property="businessThird" column="BUSINESS_THIRD"/>
<result property="label" column="LABEL"/>
<result property="businessType" column="BUSINESS_TYPE"/>
......@@ -49,7 +49,9 @@
<result property="empProvince" column="EMP_PROVINCE"/>
<result property="empCity" column="EMP_CITY"/>
<result property="empTown" column="EMP_TOWN"/>
<result property="socialAddress" column="SOCIAL_ADDRESS"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="contractApplyNo" column="CONTRACT_APPLY_NO"/>
<result property="contractStart" column="CONTRACT_START"/>
<result property="contractEnd" column="CONTRACT_END"/>
......@@ -72,7 +74,7 @@
a.DEPART_NAME,
a.DEPART_NO,
a.BUSINESS_PRIMARY,
a.BUSINESS_SECONED,
a.BUSINESS_SECOND,
a.BUSINESS_THIRD,
a.LABEL,
a.BUSINESS_TYPE,
......@@ -92,7 +94,9 @@
a.EMP_PROVINCE,
a.EMP_CITY,
a.EMP_TOWN,
a.SOCIAL_ADDRESS,
a.SOCIAL_PROVINCE,
a.SOCIAL_CITY,
a.SOCIAL_TOWN,
a.CONTRACT_APPLY_NO,
a.CONTRACT_START,
a.CONTRACT_END,
......@@ -115,19 +119,19 @@
AND a.ID = #{tPersonnelRoster.id}
</if>
<if test="tPersonnelRoster.customerName != null and tPersonnelRoster.customerName.trim() != ''">
AND a.CUSTOMER_NAME = #{tPersonnelRoster.customerName}
AND a.CUSTOMER_NAME like CONCAT(#{tPersonnelRoster.customerName},'%')
</if>
<if test="tPersonnelRoster.departName != null and tPersonnelRoster.departName.trim() != ''">
AND a.DEPART_NAME = #{tPersonnelRoster.departName}
</if>
<if test="tPersonnelRoster.departNo != null and tPersonnelRoster.departNo.trim() != ''">
AND a.DEPART_NO = #{tPersonnelRoster.departNo}
AND a.DEPART_NO like CONCAT(#{tPersonnelRoster.departNo},'%')
</if>
<if test="tPersonnelRoster.businessPrimary != null and tPersonnelRoster.businessPrimary.trim() != ''">
AND a.BUSINESS_PRIMARY = #{tPersonnelRoster.businessPrimary}
</if>
<if test="tPersonnelRoster.businessSeconed != null and tPersonnelRoster.businessSeconed.trim() != ''">
AND a.BUSINESS_SECONED = #{tPersonnelRoster.businessSeconed}
<if test="tPersonnelRoster.businessSecond != null and tPersonnelRoster.businessSecond.trim() != ''">
AND a.BUSINESS_SECOND = #{tPersonnelRoster.businessSecond}
</if>
<if test="tPersonnelRoster.businessThird != null and tPersonnelRoster.businessThird.trim() != ''">
AND a.BUSINESS_THIRD = #{tPersonnelRoster.businessThird}
......@@ -145,7 +149,7 @@
AND a.EMP_TYPE = #{tPersonnelRoster.empType}
</if>
<if test="tPersonnelRoster.empName != null and tPersonnelRoster.empName.trim() != ''">
AND a.EMP_NAME = #{tPersonnelRoster.empName}
AND a.EMP_NAME like CONCAT(#{tPersonnelRoster.empName},'%')
</if>
<if test="tPersonnelRoster.empSex != null and tPersonnelRoster.empSex.trim() != ''">
AND a.EMP_SEX = #{tPersonnelRoster.empSex}
......@@ -157,7 +161,7 @@
AND a.EMP_AGE = #{tPersonnelRoster.empAge}
</if>
<if test="tPersonnelRoster.empIdcard != null and tPersonnelRoster.empIdcard.trim() != ''">
AND a.EMP_IDCARD = #{tPersonnelRoster.empIdcard}
AND a.EMP_IDCARD like CONCAT(#{tPersonnelRoster.empIdcard},'%')
</if>
<if test="tPersonnelRoster.bankNo != null and tPersonnelRoster.bankNo.trim() != ''">
AND a.BANK_NO = #{tPersonnelRoster.bankNo}
......@@ -186,8 +190,14 @@
<if test="tPersonnelRoster.empTown != null and tPersonnelRoster.empTown.trim() != ''">
AND a.EMP_TOWN = #{tPersonnelRoster.empTown}
</if>
<if test="tPersonnelRoster.socialAddress != null and tPersonnelRoster.socialAddress.trim() != ''">
AND a.SOCIAL_ADDRESS = #{tPersonnelRoster.socialAddress}
<if test="tPersonnelRoster.socialProvince != null and tPersonnelRoster.socialProvince.trim() != ''">
AND a.SOCIAL_PROVINCE = #{tPersonnelRoster.empProvince}
</if>
<if test="tPersonnelRoster.socialCity != null and tPersonnelRoster.socialCity.trim() != ''">
AND a.SOCIAL_CITY = #{tPersonnelRoster.socialCity}
</if>
<if test="tPersonnelRoster.socialTown != null and tPersonnelRoster.socialTown.trim() != ''">
AND a.SOCIAL_TOWN = #{tPersonnelRoster.socialTown}
</if>
<if test="tPersonnelRoster.contractApplyNo != null and tPersonnelRoster.contractApplyNo.trim() != ''">
AND a.CONTRACT_APPLY_NO = #{tPersonnelRoster.contractApplyNo}
......@@ -246,4 +256,38 @@
<include refid="tPersonnelRoster_where"/>
</where>
</select>
<select id="getTPersonnelRoster" resultMap="tPersonnelRosterMap">
select p.UNIT_NAME as 'CUSTOMER_NAME',p.DEPT_NAME as 'DEPART_NAME',p.DEPT_NO as 'DEPART_NO',
d.BUSINESS_PRIMARY_TYPE as 'BUSINESS_PRIMARY',d.BUSINESS_SECOND_TYPE as 'BUSINESS_SECOND',d.BUSINESS_THIRD_TYPE as 'BUSINESS_THIRD',
p.EMP_LABEL as 'LABEL',d.LINE_TYPE as 'BUSINESS_TYPE',d.BU_BELONG as 'BU_BELONG',c1.EMP_NATRUE as 'EMP_TYPE',
e.EMP_NAME as 'EMP_NAME',e.EMP_SEX as 'EMP_SEX',e.EMP_BIRTHDAY as 'EMP_BIRTH_DATE',e.EMP_AGE as 'EMP_AGE',e.EMP_IDCARD as 'EMP_IDCARD',
e.EMP_PHONE as 'EMP_PHONE',c1.FILE_PROVINCE as 'EMP_PROVINCE',c1.FILE_CITY as 'EMP_CITY',c1.FILE_TOWN as 'EMP_TOWN',
p.SOCIAL_PROVINCE as 'SOCIAL_PROVINCE',p.SOCIAL_CITY as 'SOCIAL_CITY',p.SOCIAL_TOWN as 'SOCIAL_TOWN',c1.APPLY_NO as 'CONTRACT_APPLY_NO',
c1.CONTRACT_START as 'CONTRACT_START',c1.CONTRACT_END as 'CONTRACT_END',c1.CONTRACT_NAME as 'CONTRACT_TYPE',c1.CONTRACT_SUB_NAME as 'BUSINESS_DETAIL',
c1.SITUATION as 'SIGN_TERM',c1.CONTRACT_TYPE as 'SIGN_TYPE',
c1.CONTRACT_PARTY as 'CONTRACT_PARTY_A',c1.POST as 'CONTRACT_POST',c1.WORKING_HOURS as 'CONTRACT_TASK_TIME',
c1.CONTRACT_NO as 'CONTRACT_CODE',c1.CREATE_NAME as 'CONTRACT_CREATER',c1.CREATE_TIME as 'CONTRACT_CREATE_TIME'
from
(select MAX(c.CREATE_TIME),c.id,c.EMP_IDCARD,c.DEPT_NO from t_employee_contract_info c WHERE c.IN_USE = 0 and c.DELETE_FLAG='0' and c.IS_OBSOLETE='0'
GROUP BY c.DEPT_NO,c.EMP_IDCARD) t
INNER JOIN t_employee_info e on e.EMP_IDCARD=t.EMP_IDCARD
INNER JOIN t_employee_project p on p.EMP_IDCARD=t.EMP_IDCARD and p.DEPT_NO=t.DEPT_NO
INNER JOIN t_settle_domain d on d.DEPART_NO=t.DEPT_NO
INNER JOIN t_employee_contract_info c1 on c1.id=t.id
<if test="tPersonnelRoster != null">
<if test="tPersonnelRoster.limitStart != null">
limit #{tPersonnelRoster.limitStart},#{tPersonnelRoster.limitEnd}
</if>
</if>
</select>
<select id="getTPersonnelRosterCount" resultType="java.lang.Integer">
select count(1)
from
(select MAX(c.CREATE_TIME),c.id,c.EMP_IDCARD,c.DEPT_NO from t_employee_contract_info c WHERE c.IN_USE = 0 and c.DELETE_FLAG='0' and c.IS_OBSOLETE='0'
GROUP BY c.DEPT_NO,c.EMP_IDCARD) t
INNER JOIN t_employee_info e on e.EMP_IDCARD=t.EMP_IDCARD
INNER JOIN t_employee_project p on p.EMP_IDCARD=t.EMP_IDCARD and p.DEPT_NO=t.DEPT_NO
INNER JOIN t_settle_domain d on d.DEPART_NO=t.DEPT_NO
INNER JOIN t_employee_contract_info c1 on c1.id=t.id
</select>
</mapper>
......@@ -165,6 +165,11 @@ public interface CommonConstants {
*/
int TEN_THOUSAND_INT = 10000;
/**
* number 1000
*/
int ONE_THOUSAND_INT = 1000;
/**
* number 1
*/
......
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