Commit 5053f8f4 authored by fangxinjiang's avatar fangxinjiang

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

parents 5b53fb09 84abc81b
......@@ -24,9 +24,12 @@ 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.util.SecurityUtils;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialInfoService;
import com.yifu.cloud.plus.v1.yifu.social.service.TSocialSoldierService;
import com.yifu.cloud.plus.v1.yifu.social.vo.TSocialInfoSearchVo;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
......@@ -54,6 +57,8 @@ public class TSocialInfoController {
private final TSocialInfoService tSocialInfoService;
private final TSocialSoldierService tSocialSoldierService;
/**
* 简单分页查询
......@@ -181,4 +186,55 @@ public class TSocialInfoController {
}
return R.ok(socialInfo);
}
/**
* @param id
* @param isSocial 1 社保 2 医保
* @Description:
* @Author: hgw
* @Date: 2024/8/1 18:12
* @return: com.yifu.cloud.plus.v1.yifu.common.core.util.R<java.lang.String>
**/
@Operation(summary = "转人工", description = "转人工")
@GetMapping("/doRenGong" )
public R<String> doRenGong(@RequestParam String id, @RequestParam String isSocial) {
YifuUser user = SecurityUtils.getUser();
if (user == null || Common.isEmpty(user.getId())) {
return R.failed("请登录!");
}
TSocialInfo socialInfo = tSocialInfoService.getById(id);
if (socialInfo == null || Common.isEmpty(socialInfo.getId())) {
return R.failed("未找到社保");
}
String handleRemark;
if (CommonConstants.ZERO_STRING.equals(socialInfo.getDispatchType())) {
handleRemark = "派增";
} else {
handleRemark = "派减";
}
if (CommonConstants.ONE_STRING.equals(isSocial) && Common.isNotNull(socialInfo.getYgsHandleStatus())) {
if (CommonConstants.ZERO_STRING.equals(socialInfo.getYgsHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getYgsHandleStatus())
|| CommonConstants.FIVE_STRING.equals(socialInfo.getYgsHandleStatus())
|| CommonConstants.SIX_STRING.equals(socialInfo.getYgsHandleStatus())) {
return R.failed("当前养老工伤失业-办理状态不可以转人工!");
}
socialInfo.setYgsHandleStatus(CommonConstants.FIVE_STRING);
tSocialInfoService.updateById(socialInfo);
handleRemark += "养老、工伤、失业手动转人工";
} else if (CommonConstants.TWO_STRING.equals(isSocial) && Common.isNotNull(socialInfo.getYsdHandleStatus())) {
if (CommonConstants.ZERO_STRING.equals(socialInfo.getYsdHandleStatus())
|| CommonConstants.FOUR_STRING.equals(socialInfo.getYsdHandleStatus())
|| CommonConstants.FIVE_STRING.equals(socialInfo.getYsdHandleStatus())
|| CommonConstants.SIX_STRING.equals(socialInfo.getYsdHandleStatus())) {
return R.failed("当前医疗生育大病-办理状态不可以转人工!");
}
socialInfo.setYsdHandleStatus(CommonConstants.FIVE_STRING);
tSocialInfoService.updateById(socialInfo);
handleRemark += "医疗、生育、大病手动转人工";
}
// 加记录
tSocialSoldierService.doSocialTAuditInfo(socialInfo, handleRemark, handleRemark, handleRemark, user);
return R.ok("成功!");
}
}
......@@ -19,6 +19,7 @@ package com.yifu.cloud.plus.v1.yifu.social.service;
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.common.core.vo.YifuUser;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialInfo;
import org.springframework.web.multipart.MultipartFile;
......@@ -65,5 +66,12 @@ public interface TSocialSoldierService extends IService<TSocialInfo> {
R<String> getZip(MultipartFile zipFile);
/**
* @Description: 加办理记录
* @Author: hgw
* @Date: 2024/8/2 9:40
* @return: void
**/
void doSocialTAuditInfo(TSocialInfo social, String title, String handleRemark, String remark, YifuUser user);
}
......@@ -5106,16 +5106,22 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
if (count > CommonConstants.ZERO_INT){
WriteSheet writeSheet;
ExcelUtil<SocialSoldierExportVo> util;
for (int i = 0; i <= count; i += CommonConstants.EXCEL_EXPORT_LIMIT) {
for (int i = 0; i <= count; ) {
// 获取实际记录
searchVo.setLimitStart(i);
searchVo.setLimitEnd(CommonConstants.EXCEL_EXPORT_LIMIT);
list = getSocialSoldierList(searchVo,idStr);
if (Common.isNotNull(list)){
util = new ExcelUtil<>(SocialSoldierExportVo.class);
for (SocialSoldierExportVo vo:list){
util.convertEntity(vo,null,null,null);
}
}
if (Common.isNotNull(list)){
writeSheet = EasyExcelFactory.writerSheet(DispatchConstants.SOCIAL_SOLDIER_EXPORT+index).build();
excelWriter.write(list,writeSheet);
index++;
i += CommonConstants.EXCEL_EXPORT_LIMIT;
}
if (Common.isNotNull(list)){
list.clear();
......
......@@ -2295,6 +2295,7 @@ public class TSocialSoldierServiceImpl extends ServiceImpl<TSocialSoldierMapper,
* @Author hgw
* @Date 2024-5-16 11:43:33
**/
@Override
public void doSocialTAuditInfo(TSocialInfo social, String title, String handleRemark, String remark, YifuUser user) {
TAuditInfo auditInfo = new TAuditInfo();
auditInfo.setType(CommonConstants.ONE_STRING);
......
......@@ -1077,6 +1077,62 @@
</where>
</select>
<resultMap id="socialSoldierExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierExportVo">
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
<result property="empType" column="EMP_TYPE"/>
<result property="empMobile" column="EMP_MOBILE"/>
<result property="idCardAddress" column="ID_CARD_ADDRESS"/>
<result property="empNational" column="EMP_NATIONAL"/>
<result property="type" column="TYPE"/>
<result property="settleDomain" column="SETTLE_DOMAIN_NAME"/>
<result property="reduceReason" column="REDUCE_REASON"/>
<result property="belongUnit" column="BELONG_UNIT_NAME"/>
<result property="contractStart" column="CONTRACT_START"/>
<result property="contractEnd" column="CONTRACT_END"/>
<result property="contractTerm" column="CONTRACT_TERM"/>
<result property="empRegisType" column="EMP_REGIS_TYPE"/>
<result property="post" column="POST"/>
<result property="socialHandleStatus" column="SOCIAL_HANDLE_STATUS"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="workingHours" column="WORKING_HOURS"/>
<result property="educationName" column="EDUCATION_NAME"/>
<result property="createUserName" column="CREATE_NAME"/>
<result property="socialHouseholdName" column="SOCIAL_HOUSEHOLD_NAME"/>
<result property="socialProvince" column="SOCIAL_PROVINCE"/>
<result property="socialCity" column="SOCIAL_CITY"/>
<result property="socialTown" column="SOCIAL_TOWN"/>
<result property="unitPensionCardinal" column="UNIT_PENSION_CARDINAL"/>
<result property="unitMedicalCardinal" column="UNIT_MEDICAL_CARDINAL"/>
<result property="unitUnemploymentCardinal" column="UNIT_UNEMPLOYMENT_CARDINAL"/>
<result property="unitWorkInjuryCardinal" column="UNIT_WORK_INJURY_CARDINAL"/>
<result property="unitBirthCardinal" column="UNIT_BIRTH_CARDINAL"/>
<result property="personalBigailmentMoney" column="PERSONAL_BIGAILMENT_MONEY"/>
<result property="unitBigailmentMoney" column="UNIT_BIGAILMENT_MONEY"/>
<result property="unitBigailmentCardinal" column="UNIT_BIGAILMENT_CARDINAL"/>
<result property="socailTrustRemark" column="TRUST_REMARK"/>
<result property="pensionStart" column="PENSION_START"/>
<result property="medicalStart" column="MEDICAL_START"/>
<result property="unemployStart" column="UNEMPLOY_START"/>
<result property="workInjuryStart" column="WORK_INJURY_START"/>
<result property="birthStart" column="BIRTH_START"/>
<result property="bigailmentStart" column="BIGAILMENT_START"/>
<result property="exportSocialFlag" column="EXPORT_SOCIAL_FLAG"/>
<result property="schoolName" column="SCHOOL_NAME"/>
<result property="major" column="MAJOR"/>
<result property="firstPayTime" column="FIRST_PAY_TIME"/>
<result property="graduationTime" column="GRADUATION_TIME"/>
<result property="ygsHandleStatus" column="ygs_Handle_Status"/>
<result property="ysdHandleStatus" column="ysd_Handle_Status"/>
<result property="ygsRemark" column="YGS_REMARK"/>
<result property="ysdRemark" column="YSD_REMARK"/>
</resultMap>
<resultMap id="socialHandleExportMap" type="com.yifu.cloud.plus.v1.yifu.social.vo.SocialHandleExportVo">
<result property="empName" column="EMP_NAME"/>
<result property="empIdcard" column="EMP_IDCARD"/>
......@@ -1224,42 +1280,68 @@
<include refid="where_getSocialRecordRoster"/>
</select>
<!--tDispatchInfo 社保花名册数据查询-->
<select id="getSocialSoldierList" resultType="com.yifu.cloud.plus.v1.yifu.social.vo.SocialSoldierExportVo">
<!--tDispatchInfo 社保士兵数据查询-->
<select id="getSocialSoldierList" resultMap="socialSoldierExportMap">
SELECT
if(a.TYPE='0','派增','派减') TYPE,
case SUBSTRING_INDEX(GROUP_CONCAT(a.SOCIAL_HANDLE_STATUS ORDER BY a.CREATE_TIME desc),',',1) when '0' then '未办理' when '1' then '全部办理成功' when '2' then '全部办理失败' when '3' then '部分办理成功' when '4' then '办理中' else '-' end socialHandleStatus,
case s.ygs_Handle_Status when '0' then '无' when '1' then '待办理' when '2' then '自动办理中' when '3' then '继续办理' when '4' then '中止办理' when '5' then '人工处理' when '6' then '成功' when '7' then '提交成功' else '-' end ygsHandleStatus,
case s.ysd_Handle_Status when '0' then '无' when '1' then '待办理' when '2' then '自动办理中' when '3' then '继续办理' when '4' then '中止办理' when '5' then '人工处理' when '6' then '成功' when '7' then '提交成功' else '-' end ysdHandleStatus,
s.YGS_REMARK ygsRemark,s.YSD_REMARK ysdRemark,
SUBSTRING_INDEX(GROUP_CONCAT(a.APPLY_NO ORDER BY a.CREATE_TIME desc),',',1) dispatchCode,
a.EMP_NAME empName,
a.EMP_IDCARD empIdcard,
emp_natrue.label empType,
a.BELONG_UNIT_NAME belongUnit,
a.SETTLE_DOMAIN_NAME settleDomain,
a.SETTLE_DOMAIN_CODE settleDomainCode,
a.SOCIAL_HOUSEHOLD_NAME socialHouseholdName,
concat(if(ifnull(h.id,0) != '0',sp1.AREA_NAME,sp2.AREA_NAME),
ifnull(if(ifnull(h.id,0) != '0',sc1.AREA_NAME,sc2.AREA_NAME),''),
ifnull(if(ifnull(h.id,0) != '0',st1.AREA_NAME,st2.AREA_NAME),'')) socialProvince,
DATE_FORMAT(a.LEAVE_DATE,'%Y-%m-%d') leaveDate,
a.DISPATCH_ITEM dispatchItem,
a.CREATE_NAME createUserName,
a.ORGAN_NAME organName,
a.CREATE_TIME createTime,
a.AUDIT_USER_NAME auditUserName,
a.AUDIT_TIME auditTime
a.TYPE,
a.SOCIAL_HANDLE_STATUS,
if(ifnull(h.id,0) != '0',h.PENSION_HANDLE,s.PENSION_HANDLE) PENSION_HANDLE,
if(ifnull(h.id,0) != '0',h.MEDICAL_HANDLE,s.MEDICAL_HANDLE) MEDICAL_HANDLE,
if(ifnull(h.id,0) != '0',h.UNEMPLOY_HANDLE,s.UNEMPLOY_HANDLE) UNEMPLOY_HANDLE,
if(ifnull(h.id,0) != '0',h.WORK_INJURY_HANDLE,s.WORK_INJURY_HANDLE) WORK_INJURY_HANDLE,
if(ifnull(h.id,0) != '0',h.BIRTH_HANDLE,s.BIRTH_HANDLE) BIRTH_HANDLE,
if(ifnull(h.id,0) != '0',h.BIGAILMENT_HANDLE,s.BIGAILMENT_HANDLE) BIGAILMENT_HANDLE,
a.EMP_NAME,
a.EMP_IDCARD,
a.EDUCATION_NAME,
a.BELONG_UNIT_NAME,
a.SETTLE_DOMAIN_NAME,
a.EMP_TYPE,
a.POST,
a.EMP_MOBILE,
a.ID_CARD_ADDRESS,
a.EMP_REGIS_TYPE,
a.EMP_NATIONAL,
a.WORKING_HOURS,
a.CONTRACT_TERM,
a.CONTRACT_START,
a.CONTRACT_END,
a.CREATE_NAME,
a.CONTACT_ADDRESS,
s.RECORD_BASE,
s.PAYMENT_TYPE,
a.SOCIAL_HOUSEHOLD_NAME,
if(ifnull(h.id,0) != '0',h.SOCIAL_PROVINCE,s.SOCIAL_PROVINCE) SOCIAL_PROVINCE,
if(ifnull(h.id,0) != '0',h.SOCIAL_CITY,s.SOCIAL_CITY) SOCIAL_CITY,
if(ifnull(h.id,0) != '0',h.SOCIAL_TOWN,s.SOCIAL_TOWN) SOCIAL_TOWN,
if(ifnull(h.id,0) != '0',h.PENSION_START,s.PENSION_START) PENSION_START,
if(ifnull(h.id,0) != '0',h.UNIT_PENSION_CARDINAL,s.UNIT_PENSION_CARDINAL) UNIT_PENSION_CARDINAL,
if(ifnull(h.id,0) != '0',h.MEDICAL_START,s.MEDICAL_START) MEDICAL_START,
if(ifnull(h.id,0) != '0',h.UNIT_MEDICAL_CARDINAL,s.UNIT_MEDICAL_CARDINAL) UNIT_MEDICAL_CARDINAL,
if(ifnull(h.id,0) != '0',h.UNEMPLOY_START,s.UNEMPLOY_START) UNEMPLOY_START,
if(ifnull(h.id,0) != '0',h.UNIT_UNEMPLOYMENT_CARDINAL,s.UNIT_UNEMPLOYMENT_CARDINAL) UNIT_UNEMPLOYMENT_CARDINAL,
if(ifnull(h.id,0) != '0',h.WORK_INJURY_START,s.WORK_INJURY_START) WORK_INJURY_START,
if(ifnull(h.id,0) != '0',h.UNIT_WORK_INJURY_CARDINAL,s.UNIT_WORK_INJURY_CARDINAL) UNIT_WORK_INJURY_CARDINAL,
if(ifnull(h.id,0) != '0',h.BIRTH_START,s.BIRTH_START) BIRTH_START,
if(ifnull(h.id,0) != '0',h.UNIT_BIRTH_CARDINAL,s.UNIT_BIRTH_CARDINAL) UNIT_BIRTH_CARDINAL,
if(ifnull(h.id,0) != '0',h.BIGAILMENT_START,s.BIGAILMENT_START) BIGAILMENT_START,
if(ifnull(h.id,0) != '0',h.UNIT_BIGAILMENT_CARDINAL,s.UNIT_BIGAILMENT_CARDINAL) UNIT_BIGAILMENT_CARDINAL,
if(ifnull(h.id,0) != '0',h.UNIT_BIGAILMENT_MONEY,s.UNIT_BIGAILMENT_MONEY) UNIT_BIGAILMENT_MONEY,
if(ifnull(h.id,0) != '0',h.PERSONAL_BIGAILMENT_MONEY,s.PERSONAL_BIGAILMENT_MONEY) PERSONAL_BIGAILMENT_MONEY,
a.TRUST_REMARK,
a.REDUCE_REASON,
'1' as EXPORT_SOCIAL_FLAG,
a.SCHOOL_NAME,
a.MAJOR,
a.FIRST_PAY_TIME,
a.GRADUATION_TIME
,s.ygs_Handle_Status
,s.ysd_Handle_Status
,s.YGS_REMARK
,s.YSD_REMARK
FROM t_dispatch_info a
left join t_social_info s on a.SOCIAL_ID = s.id
left join t_dispatch_social_fund_info h on a.id = h.REDUCE_SOCIAL_FUND_ID
left join sys_area sp1 on sp1.id = h.SOCIAL_PROVINCE
left join sys_area sp2 on sp2.id = s.SOCIAL_PROVINCE
left join sys_area sc1 on sc1.id = h.SOCIAL_CITY
left join sys_area sc2 on sc2.id = s.SOCIAL_CITY
left join sys_area st1 on st1.id = h.SOCIAL_TOWN
left join sys_area st2 on st2.id = s.SOCIAL_TOWN
left join view_sys_dict_item emp_natrue on emp_natrue.value=a.EMP_TYPE and emp_natrue.type='emp_natrue'
<include refid="where_getSocialSoldier"/>
group by s.id
order by a.AUDIT_TIME desc
......
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