Commit 9fb36c4b authored by fangxinjiang's avatar fangxinjiang

Merge remote-tracking branch 'origin/MVP1.6.6' into MVP1.6.6

parents 1dcc7af4 e605149b
......@@ -249,7 +249,8 @@ public class TEmployeeContractInfo extends BaseEntity {
private String settleDomain;
/**
* 员工类型
* 员工类型_
* 其实是:合同类型。hgw 2024-7-9 11:45:59 验证
*/
@ExcelAttribute(name = "员工类型", errorInfo = "员工类型不能为空", maxLength = 32, isDataId = true, dataType = ExcelAttributeConstants.PERSONNEL_TYPE)
@TableField(exist = false)
......
......@@ -13,6 +13,7 @@ import lombok.Data;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.io.Serializable;
import java.time.LocalDate;
/**
* @Author fxj
......@@ -203,4 +204,10 @@ public class EmpProjectDispatchVo implements Serializable {
*/
@Schema(description ="是否更新岗位信息")
private Boolean postUpdate;
/**
* 入职日期
*/
@Schema(description ="入职日期")
private LocalDate enjoinDate;
}
......@@ -37,8 +37,6 @@ public class TCompleteMonitorFlagVo implements Serializable {
public Integer fileProvince;
public Integer fileCity;
public Integer isCollege;
public String hignEducation;
......
......@@ -79,8 +79,8 @@ public class FileUploadController {
"\t\t\t@ApiImplicitParam(name = \"domain\", value = \"实体id(传入就插入对应关系,用于编辑)\", required = false, paramType = \"form\")\n" +
"\t")
@PostMapping(value = "/uploadFileReturnAtta")
public R<TAttaInfo> uploadFileReturnAtta(@RequestBody MultipartFile file, String filePath, Integer type, String domain) throws IOException {
return fileUploadService.uploadFileReturnAtta(file,filePath,type,domain);
public R<TAttaInfo> uploadFileReturnAtta(@RequestBody MultipartFile file, String filePath, Integer type, String domainId) throws IOException {
return fileUploadService.uploadFileReturnAtta(file,filePath,type,domainId);
}
/**
......
......@@ -47,10 +47,10 @@ public class TCompleteMonitorController {
@Operation(description = "导出档案完整度监控管理-全量 权限:archves_tcompletemonitor_export_all")
@PostMapping("/exportAll")
//@PreAuthorize("@pms.hasPermission('archves_tcompletemonitor_export_all')")
public R<String> exportAll(HttpServletResponse response, @RequestBody TCompleteMonitorSearchVo searchVo) {
public void exportAll(HttpServletResponse response, @RequestBody TCompleteMonitorSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
return tCompleteMonitorService.exportAll(response, searchVo);
tCompleteMonitorService.exportAll(response, searchVo);
}
/**
......@@ -119,13 +119,13 @@ public class TCompleteMonitorController {
/**
* 通过id查询-主表
*
* @param infoId infoId
* @param id id
* @return R
*/
@Operation(summary = "通过id查询", description = "通过id查询")
@GetMapping("/infoId/{id}")
public R<EmpMainDetailVo> getInfoById(@PathVariable("id") String infoId) {
return tCompleteMonitorService.getInfoById(infoId);
@GetMapping("/infoId")
public R<EmpMainDetailVo> getInfoById(String id, String deptId) {
return tCompleteMonitorService.getInfoById(id, deptId);
}
/**
......
......@@ -242,10 +242,10 @@ public class TPreEmpMainController {
@Operation(summary = "导出预入职-全量", description = "导出预入职-全量 hasPermission('archives_tpreempmain-export-all')")
@PostMapping("/exportAll")
//@PreAuthorize("@pms.hasPermission('archives_tpreempmain-export-all')")
public R<String> exportAll(HttpServletResponse response, @RequestBody TPreEmpMainSearchVo searchVo) {
public void exportAll(HttpServletResponse response, @RequestBody TPreEmpMainSearchVo searchVo) {
YifuUser user = SecurityUtils.getUser();
menuUtil.setAuthSql(user, searchVo);
return tPreEmpMainService.exportAll(response, searchVo);
tPreEmpMainService.exportAll(response, searchVo);
}
}
......@@ -37,5 +37,5 @@ public interface TPreEmpMainLogMapper extends BaseMapper<TPreEmpMainLog> {
*
* @return
*/
List<TPreEmpMainLog> getTPreEmpMainLogList(@Param("mainIid") String mainIid);
List<TPreEmpMainLog> getTPreEmpMainLogList(@Param("mainId") String mainId);
}
......@@ -17,7 +17,7 @@ public interface FileUploadService {
R<FileVo> uploadImg(MultipartFile file, String filePath, Integer type, String domain) throws IOException;
R<TAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domain) throws IOException;
R<TAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domainId) throws IOException;
R<FileVo> createQrCode(String domainId, String url, String name);
}
......@@ -32,7 +32,7 @@ public interface TCompleteMonitorService extends IService<TCompleteMonitor> {
* @Date: 2024/6/28 11:41
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<com.yifu.cloud.plus.v1.yifu.archives.entity.TPreEmpMain>
**/
R<EmpMainDetailVo> getInfoById(String id);
R<EmpMainDetailVo> getInfoById(String id,String deptId);
/**
* 档案完整度监控导出
......@@ -61,6 +61,6 @@ public interface TCompleteMonitorService extends IService<TCompleteMonitor> {
IPage<TCompleteMonitorInfoVo> getMonitorEmpInfoListPage(Page<TCompleteMonitorInfoVo> page, String deptNo);
// 导出全量
R<String> exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo);
void exportAll(HttpServletResponse response, TCompleteMonitorSearchVo searchVo);
}
......@@ -75,7 +75,7 @@ public interface TPreEmpMainService extends IService<TPreEmpMain> {
// 导出
void listExport(HttpServletResponse response, TPreEmpMainSearchVo searchVo);
// 导出全量
R<String> exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo);
void exportAll(HttpServletResponse response, TPreEmpMainSearchVo searchVo);
List<TPreEmpMain> noPageDiy(TPreEmpMainSearchVo searchVo);
......
......@@ -40,7 +40,7 @@ public class FileUploadServiceImpl implements FileUploadService {
private final QrCodeUtil codeUtil;
@Override
public R<TAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domain) throws IOException {
public R<TAttaInfo> uploadFileReturnAtta(MultipartFile file, String filePath, Integer type, String domainId) throws IOException {
if (null == file) {
return R.failed("文件删除异常,请重新上传!");
}
......@@ -70,7 +70,7 @@ public class FileUploadServiceImpl implements FileUploadService {
attaInfo = initUnitAttaForInsert(fileName, key, file.getSize());
attaInfo.setRelationType(String.valueOf(type));
try {
attaInfo.setDomainId(domain);
attaInfo.setDomainId(domainId);
Set<String> dbAuthsSet = new HashSet<>();
Collection<? extends GrantedAuthority> authorities = AuthorityUtils
......
......@@ -69,6 +69,7 @@ import java.lang.reflect.Field;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
/**
......@@ -739,8 +740,26 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.eq(TEmployeeProject::getProjectStatus, CommonConstants.ZERO_INT)
.eq(TEmployeeProject::getDeleteFlag, CommonConstants.STATUS_NORMAL)
.last(CommonConstants.LAST_ONE_SQL));
// 渲染字典值
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type");
String tempStr = null;
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getValue()) && entry.getValue().equals(contractInfo.getContractName())){
tempStr = entry.getKey();
break;
}
}
if (tEmployeeProject != null) {
tEmployeeProject.setContractStatus(CommonConstants.ONE_INT);
//签订类型正常签订的时候更新项目档案信息
if (EmployeeConstants.SITUATION_ONE.equals(contractInfo.getSituation())) {
tEmployeeProject.setContractType(null == tempStr? "":tempStr);
tEmployeeProject.setWorkingHours(contractInfo.getWorkingHours());
tEmployeeProject.setPost(contractInfo.getPost());
tEmployeeProject.setEnjoinDate(contractInfo.getContractStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
tEmployeeProject.setTryPeriod(contractInfo.getTryPeriod());
}
tEmployeeProjectService.updateById(tEmployeeProject);
}
// 更新档案、项目合同状态为(1在用)
......@@ -760,7 +779,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TPreEmployeeProject preEmployeeProject = preEmployeeProjectMapper.selectOne(Wrappers.<TPreEmployeeProject>query()
.lambda().eq(TPreEmployeeProject::getPreMainId, empMain.getId()));
if (Optional.ofNullable(preEmployeeProject).isPresent()) {
preEmployeeProject.setContractType(contractInfo.getContractType());
preEmployeeProject.setContractType(null == tempStr? "":tempStr);
preEmployeeProject.setWorkingHours(contractInfo.getWorkingHours());
preEmployeeProject.setPost(contractInfo.getPost());
preEmployeeProject.setEnjoinDate(contractInfo.getContractStart());
......@@ -1597,6 +1616,11 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
List<TEmployeeContractInfo> contractInfoList;
List<TEmployeeContractInfo> contractInfoListZt;
TWorkHandlerInfo handlerInfo;
// 渲染字典值
Map<String,String> dicObj = (Map<String, String>) RedisUtil.redis.opsForValue().get(
CacheConstants.DICT_DETAILS + CommonConstants.COLON_STRING + "personnel_type");
for (TEmployeeContractInfo contract : contractInfos) {
i++;
if (contract.getAuditStatus() != CommonConstants.ONE_INT) {
......@@ -1621,6 +1645,13 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
tEmployeeContractInfo.setAuditTimeLast(LocalDateTime.now());
tEmployeeContractInfo.setInUse(CommonConstants.ZERO_STRING);
// 更新档案、项目合同状态为(1可用)
String tempStr = null;
for (Map.Entry<String,String> entry:dicObj.entrySet()){
if (Common.isNotNull(entry.getValue()) && entry.getValue().equals(contract.getContractName())){
tempStr = entry.getKey();
break;
}
}
tEmployeeProject = tEmployeeProjectService.getOne(Wrappers.<TEmployeeProject>query()
.lambda().eq(TEmployeeProject::getEmpId, contract.getEmpId())
.eq(TEmployeeProject::getDeptId, contract.getSettleDomain())
......@@ -1629,6 +1660,14 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
.last(CommonConstants.LAST_ONE_SQL));
if (tEmployeeProject != null) {
tEmployeeProject.setContractStatus(CommonConstants.ONE_INT);
//签订类型正常签订的时候更新项目档案信息
if (EmployeeConstants.SITUATION_ONE.equals(contract.getSituation())) {
tEmployeeProject.setContractType(null == tempStr? "":tempStr);
tEmployeeProject.setWorkingHours(contract.getWorkingHours());
tEmployeeProject.setPost(contract.getPost());
tEmployeeProject.setEnjoinDate(contract.getContractStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate());
tEmployeeProject.setTryPeriod(contract.getTryPeriod());
}
tEmployeeProjectService.updateById(tEmployeeProject);
}
// 更新档案、项目合同状态为(1在用)
......@@ -1648,7 +1687,7 @@ public class TEmployeeContractInfoServiceImpl extends ServiceImpl<TEmployeeContr
TPreEmployeeProject preEmployeeProject = preEmployeeProjectMapper.selectOne(Wrappers.<TPreEmployeeProject>query()
.lambda().eq(TPreEmployeeProject::getPreMainId, empMain.getId()));
if (Optional.ofNullable(preEmployeeProject).isPresent()) {
preEmployeeProject.setContractType(contract.getContractType());
preEmployeeProject.setContractType(null == tempStr? "":tempStr);
preEmployeeProject.setWorkingHours(contract.getWorkingHours());
preEmployeeProject.setPost(contract.getPost());
preEmployeeProject.setEnjoinDate(contract.getContractStart());
......
......@@ -150,7 +150,7 @@
from
t_employee_project a
left join t_employee_info b on a.EMP_ID = b.id
where a.DELETE_FLAG = '0' and a.dept_no = #{deptNo}
where a.DELETE_FLAG = '0' and a.project_status = 0 and a.dept_no = #{deptNo} order by a.CREATE_TIME desc
</select>
<!--生成数据封装-->
......@@ -205,7 +205,6 @@
e.EMP_PHONE empPhone,
e.EMP_REGIS_TYPE empRegisType,
e.FILE_PROVINCE fileProvince,
e.FILE_CITY fileCity,
e.IS_COLLEGE isCollege,
e.HIGN_EDUCATION hignEducation,
e.SCHOOL,
......@@ -229,7 +228,7 @@
d.id as contactInfoId,
if(ifnull(f.OCCUPATIONAL_DISEASE_FLAG,1) != 1 and ifnull(f.INFECTIOUS_DISEASE_FLAG,1) != 1 and ifnull(f.DISABILITY_FLAG,1) != 1 and ifnull(f.OTHER_FLAG,1) != 1,'1',null) as disabilityFlag,
if(ifnull(f.OCCUPATIONAL_DISEASE_FLAG,'6') != '6' and ifnull(f.INFECTIOUS_DISEASE_FLAG,'6') != '6' and ifnull(f.DISABILITY_FLAG,'6') != '6' and ifnull(f.OTHER_FLAG,'6') != '6','1',null) as disabilityFlag,
if(ifnull(b.REMARK,1) != 1,'1',null) as badRecordFlag,
......@@ -252,7 +251,6 @@
ee.EMP_PHONE,
ee.EMP_REGIS_TYPE,
ee.FILE_PROVINCE,
ee.FILE_CITY,
ee.IS_COLLEGE,
ee.HIGN_EDUCATION,
ee.SCHOOL,
......@@ -272,8 +270,8 @@
left join t_emp_bad_record b on a.EMP_IDCARD = b.EMP_IDCARD
left join (select EMP_ID,sum(if(ifnull(HIGH_IDENTIFICATION,-1) != -1 and ifnull(SCHOOL,-1) != -1 and ifnull(MAJOR,-1) != -1 and ifnull(ENTRY_DATE,-1) != -1 and ifnull(GRADUTION_DATE,-1) != -1,1,0)) as count from t_emp_education a left join t_atta_info b on a.id = b.domain_id where a.DELETE_FLAG = '0' and b.RELATION_TYPE = '0' group by a.EMP_ID) c on a.EMP_ID = c.EMP_ID
left join t_emp_contact_info d on a.EMP_IDCARD = d.EMP_IDCARD
left join t_emp_disability_info f on a.EMP_ID = f.EMP_ID and f.DELETE_FLAG = '1'
left join (select EMP_ID,sum(if(ifnull(RELATIONSHIP_SELF,-1) != -1 and ifnull(FAMILY_NAME,-1) != -1 and ifnull(CONTRACT_TEL,-1) != -1,1,0)) as count from t_emp_family where DELETE_FLAG = '1' group by EMP_ID) g on a.EMP_ID = g.EMP_ID
left join t_emp_disability_info f on a.EMP_ID = f.EMP_ID and f.DELETE_FLAG = '0'
left join (select EMP_ID,sum(if(ifnull(RELATIONSHIP_SELF,-1) != -1 and ifnull(FAMILY_NAME,-1) != -1 and ifnull(CONTRACT_TEL,-1) != -1,1,0)) as count from t_emp_family where DELETE_FLAG = '0' group by EMP_ID) g on a.EMP_ID = g.EMP_ID
where a.DELETE_FLAG = '0' and a.PROJECT_STATUS = 0
<if test="deptNo != null and deptNo.trim() != ''">
and a.DEPT_NO = #{deptNo}
......@@ -308,11 +306,11 @@
<!--导出统计list-->
<select id="getTEmpMainAllList" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT
if(a.IS_COMPLETE=0,'是','否') field1
if(p.IS_COMPLETE=0,'是','否') field1
,DATE_FORMAT(p.create_time,'%Y-%m-%d') field2,e.EMP_CODE field3,emp_natrue.label field4,e.emp_name field5,e.emp_idcard field6
,if(e.EMP_SEX='2','女',if(e.EMP_SEX='1','男','-')) field7
,if(e.VALIDITY_END is null,'-',if(e.VALIDITY_END > '2999-12-30 00:00:00','长期','固定')) field8 ,e.VALIDITY_END field9
,e.VALIDITY_END field10,e.EMP_BIRTHDAY field11,e.EMP_AGE field12 ,emp_married.label field13,nation.label field14
,if(e.VALIDITY_END is null,'-',if(e.VALIDITY_END > '2999-12-30','长期','固定')) field8 ,e.VALIDITY_START field9
,if(e.VALIDITY_END > '2999-12-30','长期',e.VALIDITY_END) field10,e.EMP_BIRTHDAY field11,e.EMP_AGE field12 ,emp_married.label field13,nation.label field14
,politicalStatus.label field15,e.EMP_PHONE field16,e.EMP_EMAIL field17
,concat(ifnull(pi.AREA_NAME,''),ifnull(ci.AREA_NAME,''),ifnull(ti.AREA_NAME,'')) field18 ,registype.label field19
,concat(ifnull(pf.AREA_NAME,''),ifnull(cf.AREA_NAME,''),ifnull(tf.AREA_NAME,'')) field20 ,if(e.status=0,'草稿','已审核') field21
......@@ -325,12 +323,12 @@
,educationEmp.label field40 ,ee.ENTRY_DATE field41,ee.GRADUTION_DATE field42
,if(e.FIRST_WORK_FLAG is null,'',if(e.FIRST_WORK_FLAG=0,'是','否')) field43,ew.WORK_UNIT field44,ew.WORK_JOB field45,ew.START_DATE field46,ew.END_DATE field47
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
,ef.FAMILY_NAME field48,family_relation.label field49,ef.CONTRACT_TEL field50
,if(e.HAVE_QUALIFICATION is null,'',if(e.HAVE_QUALIFICATION=0,'是','否')) field51,ep.DECLARE_YEAR field52,qualification_type.label field53
,if(ed.INJURY_IDENTIFICATION=0,'是','否') field54,if(ed.OCCUPATIONAL_DISEASE_FLAG=0,'是','否') field55 ,ed.OCCUPATIONAL_DISEASE field56
,if(ed.INFECTIOUS_DISEASE_FLAG=0,'是','否') field57 ,ed.INFECTIOUS_NAME field58 ,if(ed.DISABILITY_FLAG=0,'是','否') field59
,ed.DISABILITY_NAME field60,ed.DISABILITY_LEVEL field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63
,ed.DISABILITY_NAME field60,disability_grade.label field61,if(ed.OTHER_FLAG=0,'是','否') field62,eb.REMARK field63
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join (
......@@ -362,6 +360,7 @@
left join t_emp_education ee on e.id=ee.EMP_ID and ee.DELETE_FLAG = '0'
left join view_sys_dict_item education on education.value=ee.EDUCATION_NAME and education.type='education'
left join t_emp_disability_info ed on e.id=ed.EMP_ID and ed.DELETE_FLAG = '0'
left join view_sys_dict_item disability_grade on disability_grade.value=ed.DISABILITY_LEVEL and disability_grade.type='disability_grade'
left join t_emp_bad_record eb on e.id=eb.EMP_ID
left join (
select
......@@ -382,6 +381,7 @@
from t_emp_family ee
GROUP BY ee.EMP_ID
) ef on e.id=ef.EMP_ID
left join view_sys_dict_item family_relation on family_relation.value=ef.RELATIONSHIP_SELF and family_relation.type='family_relation'
left join (
select
SUBSTRING_INDEX(GROUP_CONCAT(ee.EMP_ID ORDER BY ee.create_time desc),',',1) EMP_ID
......@@ -405,17 +405,22 @@
<!-- 数量 -->
<select id="getTEmpMainAllCountOneWork" resultType="java.lang.Integer">
SELECT
count(1)
count(1) from (
SELECT
1
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_work_recording ew on e.id=ew.EMP_ID
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ew.id is not null and ew.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ew.emp_id
select 1 from (select a.emp_id from t_emp_work_recording a GROUP BY a.EMP_ID HAVING count(1)>1) ea where
ea.emp_id=ew.emp_id
)
<include refid="tCompleteMonitor_where"/>
</where>
group by ew.id
) a
</select>
<!--导出统计list1主要工作经历-->
......@@ -433,6 +438,7 @@
)
<include refid="tCompleteMonitor_where"/>
</where>
group by ew.id ORDER BY e.emp_idcard DESC
<if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
......@@ -443,7 +449,9 @@
<!-- 数量 -->
<select id="getTEmpMainAllCountTwoFamily" resultType="java.lang.Integer">
SELECT
count(1)
count(1) from (
SELECT
1
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
......@@ -454,22 +462,25 @@
)
<include refid="tCompleteMonitor_where"/>
</where>
group by ef.id ) a
</select>
<!--导出统计list2主要家庭成员信息-->
<select id="getTEmpMainAllListTwoFamily" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
SELECT
e.emp_idcard field6
,ef.FAMILY_NAME field48,ef.RELATIONSHIP_SELF field49,ef.CONTRACT_TEL field50
,ef.FAMILY_NAME field48,family_relation.label field49,ef.CONTRACT_TEL field50
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
left join t_emp_family ef on e.id=ef.EMP_ID
left join view_sys_dict_item family_relation on family_relation.value=ef.RELATIONSHIP_SELF and family_relation.type='family_relation'
<where>
p.DELETE_FLAG = '0' and p.PROJECT_STATUS = 0 and ef.id is not null and ef.DELETE_FLAG = '0' and EXISTS (
select 1 from (select a.emp_id from t_emp_family a GROUP BY a.EMP_ID HAVING count(1)>1) ea where ea.emp_id=ef.emp_id
)
<include refid="tCompleteMonitor_where"/>
</where>
group by ef.id ORDER BY e.emp_idcard DESC
<if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
......@@ -480,7 +491,9 @@
<!-- 数量 -->
<select id="getTEmpMainAllCountThreeProfessional" resultType="java.lang.Integer">
SELECT
count(1)
count(1) from (
SELECT
1
FROM t_complete_monitor a
left join t_employee_project p on a.DEPT_NO=p.DEPT_NO
left join t_employee_info e on p.EMP_ID=e.id
......@@ -491,6 +504,7 @@
)
<include refid="tCompleteMonitor_where"/>
</where>
group by ep.id ) a
</select>
<!--导出统计list3职业资格信息-->
<select id="getTEmpMainAllListThreeProfessional" resultType="com.yifu.cloud.plus.v1.yifu.archives.vo.TMainExportAllVO">
......@@ -508,6 +522,7 @@
)
<include refid="tCompleteMonitor_where"/>
</where>
group by ep.id ORDER BY e.emp_idcard DESC
<if test="tCompleteMonitor != null">
<if test="tCompleteMonitor.limitStart != null">
limit #{tCompleteMonitor.limitStart},#{tCompleteMonitor.limitEnd}
......
......@@ -48,6 +48,6 @@
</resultMap>
<delete id="deleteWorkRecordByEmpId">
delete from t_pre_emp_work_recording where EMP_ID = #{empId}
delete from t_emp_work_recording where EMP_ID = #{empId}
</delete>
</mapper>
......@@ -71,6 +71,6 @@
SELECT
<include refid="Base_Column_List"/>
FROM t_pre_emp_main_log a
where main_id = #{mainIid}
where main_id = #{mainId}
</select>
</mapper>
spring.ldap.urls=ldap://192.168.1.65:389
spring.ldap.urls=ldap://192.168.0.240:389
spring.ldap.username=cn=admin,dc=worfu,dc=com
spring.ldap.password=yifu123456!
spring.ldap.password=Yifu123ABC!
spring.ldap.base=dc=worfu,dc=com
\ No newline at end of file
package com.yifu.cloud.plus.v1.ekp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.RowIndex;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
/**
* 款项认领差额费导入
*
* @author huyc
* @date 2024-07-04 14:54:40
*/
@Data
@ColumnWidth(30)
public class ClaimInfotVO extends RowIndex implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 项目编码
*/
@NotNull(message = "项目编码不能为空")
@ExcelAttribute(name = "项目编码",isNotEmpty = true, errorInfo = "项目编码不能为空")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目编码")
private String deptNo;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目名称")
private String deptName;
/**
* 调整金额
*/
@NotNull(message = "调整金额不能为空")
@ExcelAttribute(name = "调整金额",isNotEmpty = true, errorInfo = "调整金额不能为空", isFloat = true,max = "999999999.99")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="调整金额")
private BigDecimal money;
}
package com.yifu.cloud.plus.v1.ekp.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ColumnWidth;
import com.alibaba.excel.annotation.write.style.HeadFontStyle;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;
/**
* 款项认领差额费导入
*
* @author huyc
* @date 2024-07-04 14:54:40
*/
@Data
@ColumnWidth(30)
public class ClaimRebackInfotVO implements Serializable {
private static final long serialVersionUID = 1L;
/**
* 款项认领明细单号
*/
@ExcelAttribute(name = "款项认领明细单号")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="款项认领明细单号")
private String claimNo;
@ExcelAttribute(name = "项目编码")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目编码")
private String deptNo;
/**
* 项目名称
*/
@ExcelAttribute(name = "项目名称")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="项目名称")
private String deptName;
/**
* 认领金额
*/
@ExcelAttribute(name = "认领金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="认领金额")
private BigDecimal claimMoney;
/**
* 核销金额
*/
@ExcelAttribute(name = "核销金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="核销金额")
private BigDecimal cancelMoney;
/**
* 剩余金额
*/
@NotNull(message = "剩余金额")
@ExcelAttribute(name = "剩余金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="剩余金额")
private BigDecimal surMoney;
/**
* 调整金额
*/
@NotNull(message = "调整金额")
@ExcelAttribute(name = "调整金额")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="调整金额")
private BigDecimal adjustMoney;
/**
* 剩余金额调整为
*/
@NotNull(message = "剩余金额调整为")
@ExcelAttribute(name = "剩余金额调整为")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="剩余金额调整为")
private BigDecimal afterAdjustMoney;
/**
* 入账日期
*/
@NotNull(message = "入账日期")
@ExcelAttribute(name = "入账日期")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="入账日期")
private Date claimTime;
/**
* 异常说明
*/
@NotNull(message = "异常说明")
@ExcelAttribute(name = "异常说明")
@HeadFontStyle(fontHeightInPoints = 11)
@ExcelProperty(value ="异常说明")
private String errorInfo;
}
package com.yifu.cloud.plus.v1.ekp.controller;
import com.yifu.cloud.plus.v1.ekp.service.EkpSalaryInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialPushInfoVo;
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.ErrorMessage;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
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.common.security.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.SneakyThrows;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import java.util.List;
......@@ -39,4 +48,22 @@ public class TEkpSalaryInfoController {
public Boolean pushSalaryInfoToEkp(@RequestBody List<EkpSalaryParam> unPushList) {
return salaryInfoService.pushSalaryInfoToEkp(unPushList);
}
/**
* 差额费导入
*
* @author huyc
* @date 2024-7-4
**/
@SneakyThrows
@Operation(description = "差额费导入")
@SysLog("差额费导入")
@PostMapping("/importClaimInfo")
public R<List<ErrorMessage>> importClaimInfo(@RequestBody MultipartFile file) {
YifuUser user = SecurityUtils.getUser();
if (Common.isEmpty(user)){
return R.failed(CommonConstants.USER_FAIL);
}
return salaryInfoService.importClaimInfo(file.getInputStream());
}
}
......@@ -2,6 +2,7 @@ package com.yifu.cloud.plus.v1.ekp.mapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo;
import com.yifu.cloud.plus.v1.ekp.vo.ClaimRebackInfotVO;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.ekp.vo.EkpSocialSumInfoVo;
import org.apache.ibatis.annotations.Mapper;
......@@ -31,4 +32,19 @@ public interface EkpSalaryInfoMapper extends BaseMapper<EkpSalaryInfo> {
* @return
*/
EkpSocialSumInfoVo getCostSumInfo(@Param("card") String empIdCard, @Param("month") String createMonth);
/**
* 根据项目编码查询款项认领明细
* @param
* @return
*/
ClaimRebackInfotVO getClaimInfoByDeptNo(@Param("deptNo") String deptNo,@Param("flag") String flag);
/**
* 根据项目编码查询款项认领明细
* @param
* @return
*/
List<ClaimRebackInfotVO> getClaimBigInfoByDeptNoAndUser(@Param("deptNo") String deptNo);
}
......@@ -2,9 +2,12 @@ package com.yifu.cloud.plus.v1.ekp.service;
import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo;
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.ekp.vo.EkpSalaryParam;
import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.util.List;
/**
......@@ -18,4 +21,6 @@ public interface EkpSalaryInfoService extends IService<EkpSalaryInfo> {
@Transactional
// @ShardingTransactionType(TransactionType.BASE)
Boolean pushSalaryInfoToEkp(List<EkpSalaryParam> unPushList);
R<List<ErrorMessage>> importClaimInfo(InputStream inputStream);
}
package com.yifu.cloud.plus.v1.ekp.service.impl;
import com.alibaba.excel.EasyExcel;
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.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.ekp.entity.EkpSalaryInfo;
import com.yifu.cloud.plus.v1.ekp.mapper.EkpSalaryInfoMapper;
import com.yifu.cloud.plus.v1.ekp.service.EkpSalaryInfoService;
import com.yifu.cloud.plus.v1.ekp.vo.ClaimInfotVO;
import com.yifu.cloud.plus.v1.ekp.vo.ClaimRebackInfotVO;
import com.yifu.cloud.plus.v1.ekp.vo.EkpDeptInfoVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.BigDecimalUtils;
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.LocalDateTimeUtils;
import com.yifu.cloud.plus.v1.yifu.common.core.util.*;
import com.yifu.cloud.plus.v1.yifu.ekp.vo.EkpSalaryParam;
import lombok.extern.log4j.Log4j2;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.io.InputStream;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.*;
......@@ -248,6 +254,128 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
+ "_" + salaryInfo.getFd_3b10afe8c70742());
}
@Override
public R<List<ErrorMessage>> importClaimInfo(InputStream inputStream) {
List<ErrorMessage> errorMessageList = new ArrayList<>();
ExcelUtil<ClaimInfotVO> util1 = new ExcelUtil<>(ClaimInfotVO.class);
// 写法2:
// 匿名内部类 不用额外写一个DemoDataListener
// 这里 需要指定读用哪个class去读,然后读取第一个sheet 文件流会自动关闭
try {
EasyExcel.read(inputStream, ClaimInfotVO.class, new ReadListener<ClaimInfotVO>() {
/**
* 单次缓存的数据量
*/
public static final int BATCH_COUNT = CommonConstants.BATCH_COUNT1;
/**
*临时存储
*/
private List<ClaimInfotVO> cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
@Override
public void invoke(ClaimInfotVO data, AnalysisContext context) {
ReadRowHolder readRowHolder = context.readRowHolder();
Integer rowIndex = readRowHolder.getRowIndex();
data.setRowIndex(rowIndex + 1);
ErrorMessage errorMessage = util1.checkEntity(data, data.getRowIndex());
if (Common.isNotNull(errorMessage)) {
errorMessageList.add(errorMessage);
} else {
cachedDataList.add(data);
}
if (cachedDataList.size() >= BATCH_COUNT) {
saveData();
// 存储完成清理 list
cachedDataList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
}
}
@Override
public void doAfterAllAnalysed(AnalysisContext context) {
saveData();
}
/**
* 加上存储数据库
*/
private void saveData() {
log.info("{}条数据,开始存储数据库!", cachedDataList.size());
importListAdd(cachedDataList, errorMessageList);
log.info("存储数据库成功!");
}
}).sheet().doRead();
} catch (Exception e) {
log.error(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR, e);
return R.failed(CommonConstants.IMPORT_DATA_ANALYSIS_ERROR);
}
return R.ok(errorMessageList);
}
/**
* 差额费导入
* @param excelVOList
* @param errorMessageList
* @author huyc
* @date 2024-07-04 14:52:16
*/
@Transactional
public void importListAdd(List<ClaimInfotVO> excelVOList, List<ErrorMessage> errorMessageList) {
ClaimInfotVO excel;
String deptNo;
String deptName;
BigDecimal money;
ClaimRebackInfotVO info;
// 执行数据插入操作 组装 PostDto
for (int i = 0; i < excelVOList.size(); i++) {
excel = excelVOList.get(i);
deptNo = excel.getDeptNo();
money = excel.getMoney();
deptName = excel.getDeptName();
ClaimRebackInfotVO backInfo = new ClaimRebackInfotVO();
//先找到彭超创建的款项认领明细
info = baseMapper.getClaimInfoByDeptNo(deptNo,"1");
//
if (money.compareTo(BigDecimal.ZERO) > 0) {
//调整金额大于零的先找到彭超创建的款项认领明细直接加
if (Optional.ofNullable(info).isPresent()) {
info.setAdjustMoney(money);
info.setAfterAdjustMoney(BigDecimalUtils.safeAdd(info.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getErrorInfo(),info));
} else {
//找到除了彭超之外的最早的一条款项认领明细
info = baseMapper.getClaimInfoByDeptNo(deptNo,"2");
if (Optional.ofNullable(info).isPresent()) {
info.setAdjustMoney(money);
info.setAfterAdjustMoney(BigDecimalUtils.safeAdd(info.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getErrorInfo(),info));
} else {
backInfo.setDeptName(deptName);
backInfo.setDeptNo(deptNo);
backInfo.setAdjustMoney(money);
backInfo.setErrorInfo("未找到该项目对应的款项认领明细");
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), backInfo.getErrorInfo(),backInfo));
}
}
} else {
//调整金额小于零的先找到剩余金额大于零的彭超创建的款项认领明细去扣减
info = baseMapper.getClaimInfoByDeptNo(deptNo,"3");
if (Optional.ofNullable(info).isPresent()) {
if (BigDecimalUtils.safeAdd(info.getSurMoney(),money).compareTo(BigDecimal.ZERO) >=0) {
info.setAdjustMoney(money);
info.setAfterAdjustMoney(BigDecimalUtils.safeAdd(info.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), info.getErrorInfo(),info));
} else {
this.subSwitch(deptNo,backInfo,errorMessageList,money,deptName,excel);
}
} else {
this.subSwitch(deptNo,backInfo,errorMessageList,money,deptName,excel);
}
}
}
}
/**
* @Description: 推送ekp时更改日期格式
* @Author: huyc
......@@ -258,4 +386,31 @@ public class EkpSalaryInfoServiceImpl extends ServiceImpl<EkpSalaryInfoMapper, E
return sb.toString();
}
public void subSwitch(String deptNo,ClaimRebackInfotVO backInfo,List<ErrorMessage>errorMessageList,
BigDecimal money,String deptName,ClaimInfotVO excel) {
List<ClaimRebackInfotVO> infoList = baseMapper.getClaimBigInfoByDeptNoAndUser(deptNo);
if (Optional.ofNullable(infoList).isPresent()) {
for (ClaimRebackInfotVO subInfo : infoList) {
//分批去减去金额
if (BigDecimalUtils.safeAdd(subInfo.getSurMoney(),money).compareTo(BigDecimal.ZERO) >=0) {
subInfo.setAdjustMoney(money);
subInfo.setAfterAdjustMoney(BigDecimalUtils.safeSubtract(subInfo.getSurMoney(),money));
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), subInfo.getErrorInfo(),subInfo));
break;
} else {
subInfo.setAdjustMoney(subInfo.getSurMoney());
subInfo.setAfterAdjustMoney(BigDecimal.ZERO);
money = BigDecimalUtils.safeAdd(subInfo.getSurMoney(),money);
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), subInfo.getErrorInfo(),subInfo));
}
}
}
if (BigDecimal.ZERO.compareTo(money) > 0 ) {
backInfo.setDeptNo(deptNo);
backInfo.setDeptName(deptName);
backInfo.setAdjustMoney(money);
backInfo.setErrorInfo("项目编码及剩余仍需扣除金额:" + money.toString());
errorMessageList.add(new ErrorMessage(excel.getRowIndex(), backInfo.getErrorInfo(),backInfo));
}
}
}
......@@ -150,4 +150,48 @@
where fd_3adfe8c7e4cf7a = #{card} and fd_3adfe8cb96c41e = #{month}
</select>
<!--根据项目编码和申请人查询款项认领明细-->
<select id="getClaimInfoByDeptNo" resultType="com.yifu.cloud.plus.v1.ekp.vo.ClaimRebackInfotVO">
select
fd_3afb4689209aa2 deptNo,
fd_3afb468b23b0e2 deptName,
fd_3afb4c634ebd08 claimNo,
fd_3afb46ab98d9a8 claimMoney,
fd_3afb46ac507904 cancelMoney,
fd_3afb46d05d19ec surMoney,
DATE_FORMAT(fd_3b5f41db9fb154,'%Y-%m-%d') claimTime
from
ekp_94b6cd1535e4b34865c8
where
fd_3afb4689209aa2 = #{deptNo}
<if test="flag != null and flag == 3">
and fd_3afb46d05d19ec > 0
</if>
<if test="flag != null and (flag == 1 or flag == 3)">
and fd_3b2a70e26f520a = '1817fbe83899f5f34c1ee9b463bbf9c1'
</if>
order by fd_3b5f41db9fb154 asc
<if test="flag != null">
limit 1
</if>
</select>
<!--根据项目编码和申请人查询款项认领明细-->
<select id="getClaimBigInfoByDeptNoAndUser" resultType="com.yifu.cloud.plus.v1.ekp.vo.ClaimRebackInfotVO">
select
fd_3afb4689209aa2 deptNo,
fd_3afb468b23b0e2 deptName,
fd_3afb4c634ebd08 claimNo,
fd_3afb46ab98d9a8 claimMoney,
fd_3afb46ac507904 cancelMoney,
fd_3afb46d05d19ec surMoney,
DATE_FORMAT(fd_3b5f41db9fb154,'%Y-%m-%d') claimTime
from
ekp_94b6cd1535e4b34865c8
where
fd_3afb4689209aa2 = #{deptNo}
and fd_3afb46d05d19ec > 0
order by fd_3b5f41db9fb154 asc
</select>
</mapper>
......@@ -135,4 +135,6 @@ public class SocialSoldierYsdAddVo implements Serializable {
private String isAdd;
@ExcelProperty("是否只续保【医保增员】")
private String isXu;
@ExcelProperty("提示已缴费是否继续申报【医保增员】")
private String isShen;
}
......@@ -86,6 +86,7 @@ import java.io.InputStream;
import java.math.BigDecimal;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.util.*;
import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Collectors;
......@@ -2119,6 +2120,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
project.setPost(excel.getPost());
project.setWorkingHours(excel.getWorkingHours());
project.setTryPeriod(excel.getTryPeriod());
project.setEnjoinDate(null != excel.getContractStart() ? excel.getContractStart().toInstant().atZone(ZoneId.systemDefault()).toLocalDate() : null);
if (Common.isNotNull(socialSet)){
project.setSocialProvince(socialSet.getProvince());
project.setSocialCity(socialSet.getCity());
......
......@@ -156,7 +156,7 @@
<!-- 社保士兵医生大增加模板-->
<select id="getSocialSoldierYsdAddVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAddVo">
<include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'' isAutoMonth,'' isAdd,'' isXu
,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen
<include refid="getSocialSoldierBaseTwo"/>
and a.type = '0' and s.YSD_HANDLE_STATUS in ('0','1','2','3')
and (
......@@ -171,7 +171,7 @@
<!-- 社保士兵医生大减少模板-->
<select id="getSocialSoldierYsdReduceVoList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierYsdAddVo">
<include refid="getSocialSoldierBaseOne"/>
,'' isBatch,'' isAutoMonth,'' isAdd,'' isXu
,'' isBatch,'是' isAutoMonth,'' isAdd,'' isXu,'是' isShen
<include refid="getSocialSoldierBaseTwo"/>
and a.type = '1' and s.YSD_HANDLE_STATUS in ('0','1','2','3')
and (
......
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