Commit b8aa4f23 authored by wangzb's avatar wangzb

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

# Conflicts:
#	yifu-social/yifu-social-api/src/main/java/com/yifu/cloud/plus/v1/yifu/social/constants/DispatchConstants.java
parents 7b331afc 16050da3
...@@ -26,7 +26,7 @@ mybatis-plus: ...@@ -26,7 +26,7 @@ mybatis-plus:
logic-not-delete-value: 0 logic-not-delete-value: 0
configuration: configuration:
map-underscore-to-camel-case: true map-underscore-to-camel-case: true
#log-impl: org.apache.ibatis.logging.stdout.StdOutImpl log-impl: org.apache.ibatis.logging.stdout.StdOutImpl
# spring security 配置 # spring security 配置
security: security:
......
...@@ -163,4 +163,6 @@ public interface CacheConstants { ...@@ -163,4 +163,6 @@ public interface CacheConstants {
String EMP_ADD_LOCK ="emp_add_lock"; String EMP_ADD_LOCK ="emp_add_lock";
String FUND_IMPORT_HANDLE_LOCK = "fund_import_handle_handle_lock"; String FUND_IMPORT_HANDLE_LOCK = "fund_import_handle_handle_lock";
public static final String WX_ACCOSS_TOKEN = "WX_ACCOSS_TOKEN";
} }
...@@ -124,4 +124,21 @@ public interface SecurityConstants { ...@@ -124,4 +124,21 @@ public interface SecurityConstants {
*/ */
String CLIENT_ID = "clientId"; String CLIENT_ID = "clientId";
/**
* @Author: huyc
* @Date: 2023/7/28
* @Description: 企业微信获取access_token
* @return:
**/
String WX_GET_ACCOSS_TOKEN="https://qyapi.weixin.qq.com/cgi-bin/gettoken?corpid=%s&corpsecret=%s";
/**
* @Author: huyc
* @Date: 2023/7/28
* @Description: 企业微信发送消息
* @return:
**/
String WX_SEND_MESSAGE = "https://qyapi.weixin.qq.com/cgi-bin/message/send?access_token=%s";
} }
...@@ -80,6 +80,13 @@ public class TMessageInfo { ...@@ -80,6 +80,13 @@ public class TMessageInfo {
@ExcelProperty("处理人-当前提醒人") @ExcelProperty("处理人-当前提醒人")
@Schema(description = "处理人-当前提醒人") @Schema(description = "处理人-当前提醒人")
private String alertUser; private String alertUser;
/**
* 是否通知企业微信用户 0 是 1 否
*/
@ExcelAttribute(name = "是否通知企业微信用户", maxLength = 1)
@ExcelProperty("是否通知企业微信用户")
@Schema(description = "是否通知企业微信用户 0 是 1 否")
private String wxFlag;
/** /**
* listUrl * listUrl
*/ */
......
package com.yifu.cloud.plus.v1.msg.config;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.google.gson.Gson;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CacheConstants;
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.exception.CheckedException;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.security.authentication.AuthenticationServiceException;
import org.springframework.web.client.RestTemplate;
import java.util.Map;
import java.util.concurrent.TimeUnit;
/**
* @Author: huyc
* @Date: 2023/7/28
* @Description:
* @return: 企业微信配置
**/
@Configuration
@Data
@Slf4j
public class WxConfig {
@Value("${wx.corpid}")
private String corpid;
@Value("${wx.corpsecret}")
private String corpsecret;
@Value("${wx.agentid}")
private String agentid;
@Autowired
private RedisTemplate redisTemplate;
//未授权
private String accossTokenInvliad = "40014";
/**
* @param
* @Author: huyc
* @Date: 2023/7/28
* @Description: 获取微信accos_token
* @return: java.lang.String
**/
public String getAccessToken(RestTemplate restTemplate) {
if (Common.isNotNull(agentid)) {
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN.concat(agentid), corpsecret);
}
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN, corpsecret);
}
public String getAccessToken(RestTemplate restTemplate,String corpsecret)throws AuthenticationServiceException {
if(Common.isEmpty(corpsecret)){
throw new AuthenticationServiceException("未找到对应的corpsecret请联系管理员配置");
}
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN.concat(agentid), corpsecret);
}
/**
* @param restTemplate
* @param tokenKey
* @param corpsecretKey
* @Description: 获取token
* @Author: huyc
* @Date: 2023/7/28 14:46
* @return: java.lang.String
**/
public String getToken(RestTemplate restTemplate,String tokenKey, String corpsecretKey) {
Object wxToken = redisTemplate.opsForValue().get(tokenKey);
if (null != wxToken) {
return String.valueOf(wxToken);
}
String requestTokenUrl = String.format(SecurityConstants.WX_GET_ACCOSS_TOKEN, corpid, corpsecretKey);
String result = restTemplate.getForObject(requestTokenUrl, String.class);
if (Common.isEmpty(result)) {
throw new CheckedException("微信授权失败");
}
String token = JSON.parseObject(result).getString("access_token");
if (Common.isEmpty(token)) {
log.info(result);
throw new CheckedException("获取微信token失败");
}
redisTemplate.opsForValue().set(tokenKey, token);
redisTemplate.expire(tokenKey, 3600, TimeUnit.SECONDS);
return token;
}
/**
* @param
* @Author: huyc
* @Date: 2023/7/28 14:43
* @Description: 移除微信accossToken
* @return: java.lang.String
**/
public void removeAccessToken() {
redisTemplate.delete(CacheConstants.WX_ACCOSS_TOKEN);
}
/**
* @param restTemplate
* @param requestMap 请求内容
* @Author: huyc
* @Date: 2023/7/28 14:48
* @Description: 发送卡片消息
* @return: java.lang.String
**/
public boolean sendTextCard(RestTemplate restTemplate, Map<String, Object> requestMap) {
// 必须加上header说明
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Gson gson = new Gson();
log.info(gson.toJson(requestMap));
HttpEntity<String> requestEntity = new HttpEntity<>(gson.toJson(requestMap), headers);
String accessToken = getAccessToken(restTemplate);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(String.format(SecurityConstants.WX_SEND_MESSAGE, accessToken), requestEntity, String.class);
log.info(JSON.toJSONString(responseEntity));
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(responseEntity));
JSONObject jsonBody = jsonObject.getJSONObject("body");
if (jsonBody != null) {
String errcode = jsonBody.getString("errcode");
if (accossTokenInvliad.equals(errcode)) {
//删除accossToken缓存
removeAccessToken();
return false;
}
if (!CommonConstants.ZERO_STRING.equals(errcode)) { //非正常,则打印错误日志
log.info(jsonObject.toJSONString());
}
} else {
log.info(jsonObject.toJSONString());
}
return true;
}
/**
* @param restTemplate
* @param requestMap 请求内容
* @Author: huyc
* @Date: 2023/7/28 14:50
* @Description: 发送卡片消息
* @return: java.lang.String
**/
public boolean sendAppTextCard(RestTemplate restTemplate, Map<String, Object> requestMap) {
// 必须加上header说明
HttpHeaders headers = new HttpHeaders();
headers.setContentType(MediaType.APPLICATION_JSON_UTF8);
Gson gson = new Gson();
log.info("发企业微信===请求:{}", gson.toJson(requestMap));
HttpEntity<String> requestEntity = new HttpEntity<>(gson.toJson(requestMap), headers);
String accessToken = getAppAccessToken(restTemplate);
ResponseEntity<String> responseEntity = restTemplate.postForEntity(String.format(SecurityConstants.WX_SEND_MESSAGE, accessToken), requestEntity, String.class);
log.info("发企业微信===返回:{}",JSON.toJSONString(responseEntity));
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(responseEntity));
JSONObject jsonBody = jsonObject.getJSONObject("body");
if (jsonBody != null) {
String errcode = jsonBody.getString("errcode");
if (accossTokenInvliad.equals(errcode)) {
//删除accossToken缓存
removeAccessToken();
return false;
}
if (!CommonConstants.ZERO_STRING.equals(errcode)) { //非正常,则打印错误日志
log.info(jsonObject.toJSONString());
}
} else {
log.info(jsonObject.toJSONString());
}
return true;
}
/**
* 功能描述: 获取微信accos_token
* @Author: huyc
* @Date: 2023/7/28 14:50
* @return: java.lang.String
*/
public String getAppAccessToken(RestTemplate restTemplate) {
return this.getToken(restTemplate, CacheConstants.WX_ACCOSS_TOKEN, corpsecret);
}
}
...@@ -79,7 +79,7 @@ public class TMessageInfoController { ...@@ -79,7 +79,7 @@ public class TMessageInfoController {
@PostMapping @PostMapping
@PreAuthorize("@pms.hasPermission('demo_tmessageinfo_add')" ) @PreAuthorize("@pms.hasPermission('demo_tmessageinfo_add')" )
public R<Boolean> save(@RequestBody TMessageInfo tMessageInfo) { public R<Boolean> save(@RequestBody TMessageInfo tMessageInfo) {
return R.ok(tMessageInfoService.save(tMessageInfo)); return R.ok(tMessageInfoService.saveMessage(tMessageInfo));
} }
/** /**
......
...@@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage; ...@@ -21,7 +21,6 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService; import com.baomidou.mybatisplus.extension.service.IService;
import com.yifu.cloud.plus.v1.msg.entity.TMessageInfo; import com.yifu.cloud.plus.v1.msg.entity.TMessageInfo;
import org.springframework.web.bind.annotation.RequestBody;
/** /**
* 消息提醒 * 消息提醒
...@@ -37,7 +36,9 @@ public interface TMessageInfoService extends IService<TMessageInfo> { ...@@ -37,7 +36,9 @@ public interface TMessageInfoService extends IService<TMessageInfo> {
*/ */
IPage<TMessageInfo> getTMessageInfoPage(Page<TMessageInfo> page, TMessageInfo tMessageInfo); IPage<TMessageInfo> getTMessageInfoPage(Page<TMessageInfo> page, TMessageInfo tMessageInfo);
void updateMessageInfo(@RequestBody TMessageInfo tMessageInfo); boolean saveMessage(TMessageInfo tMessageInfo);
long selectMessageCount(@RequestBody TMessageInfo tMessageInfo); void updateMessageInfo(TMessageInfo tMessageInfo);
long selectMessageCount(TMessageInfo tMessageInfo);
} }
...@@ -47,6 +47,12 @@ public class TMessageInfoServiceImpl extends ServiceImpl<TMessageInfoMapper, TMe ...@@ -47,6 +47,12 @@ public class TMessageInfoServiceImpl extends ServiceImpl<TMessageInfoMapper, TMe
return baseMapper.getTMessageInfoPage(page,tMessageInfo); return baseMapper.getTMessageInfoPage(page,tMessageInfo);
} }
@Override
public boolean saveMessage(TMessageInfo tMessageInfo) {
return false;
}
@Override @Override
public void updateMessageInfo(TMessageInfo tMessageInfo) { public void updateMessageInfo(TMessageInfo tMessageInfo) {
if (Common.isNotNull(tMessageInfo) && Common.isNotNull(tMessageInfo.getAlertUser())) { if (Common.isNotNull(tMessageInfo) && Common.isNotNull(tMessageInfo.getAlertUser())) {
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
<result property="alertType" column="ALERT_TYPE"/> <result property="alertType" column="ALERT_TYPE"/>
<result property="handlerStatus" column="HANDLER_STATUS"/> <result property="handlerStatus" column="HANDLER_STATUS"/>
<result property="alertUser" column="ALERT_USER"/> <result property="alertUser" column="ALERT_USER"/>
<result property="wxFlag" column="WX_FLAG"/>
<result property="listUrl" column="LIST_URL"/> <result property="listUrl" column="LIST_URL"/>
<result property="infoUrl" column="INFO_URL"/> <result property="infoUrl" column="INFO_URL"/>
<result property="modelType" column="MODEL_TYPE"/> <result property="modelType" column="MODEL_TYPE"/>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
package com.yifu.cloud.plus.v1.yifu.salary.controller; package com.yifu.cloud.plus.v1.yifu.salary.controller;
import com.alibaba.fastjson.JSON;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
...@@ -38,6 +39,7 @@ import lombok.RequiredArgsConstructor; ...@@ -38,6 +39,7 @@ import lombok.RequiredArgsConstructor;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.json.Json;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
......
...@@ -34,10 +34,8 @@ public class DispatchConstants { ...@@ -34,10 +34,8 @@ public class DispatchConstants {
public static final String DISPATCH_SOCIAL_REDUCE = "社保派减"; public static final String DISPATCH_SOCIAL_REDUCE = "社保派减";
public static final String SOCIAL_RECORD_ROSTER_EXPORT = "社保花名册导出"; public static final String SOCIAL_RECORD_ROSTER_EXPORT = "社保花名册导出";
public static final String SOCIAL_RECORD_EXPORT = "公积金变更清册导出"; public static final String SOCIAL_RECORD_EXPORT = "公积金变更清册导出";
public static final String SOCIAL_MEDICAL_EXPORT = "合肥医保花名册"; public static final String SOCIAL_MEDICAL_EXPORT = "社保-医疗";
public static final String SOCIAL_PERSION_EXPORT = "合肥社保花名册"; public static final String SOCIAL_PERSION_EXPORT = "社保-养老三险";
public static final String FUND_RECORD_EXPORT = "合肥公积金变更清册";
public static final String FUND_SUPPLEMENTARY_EXPORT = "合肥公积金补缴清册";
public static final String DISPATCH_PENSION = "养老、"; public static final String DISPATCH_PENSION = "养老、";
public static final String DISPATCH_MEDICAL = "医疗、"; public static final String DISPATCH_MEDICAL = "医疗、";
public static final String DISPATCH_BIRTH = "生育、"; public static final String DISPATCH_BIRTH = "生育、";
......
...@@ -132,6 +132,13 @@ public class TDispatchSocialPersionReduceExportVo implements Serializable { ...@@ -132,6 +132,13 @@ public class TDispatchSocialPersionReduceExportVo implements Serializable {
@ExcelAttribute(name = "停薪留职" ) @ExcelAttribute(name = "停薪留职" )
@ExcelProperty("停薪留职") @ExcelProperty("停薪留职")
private String typeH; private String typeH;
/**
* 合同期满
*/
@Schema(description = "合同期满" )
@ExcelAttribute(name = "合同期满" )
@ExcelProperty("合同期满")
private String typeZ;
/** /**
* 解除合同 * 解除合同
*/ */
......
...@@ -25,12 +25,12 @@ public class CustomCellWriteWidthConfig extends AbstractColumnWidthStyleStrategy ...@@ -25,12 +25,12 @@ public class CustomCellWriteWidthConfig extends AbstractColumnWidthStyleStrategy
//要求将当前列的列宽设置为33英寸,理论值应该是33×256=8448, //要求将当前列的列宽设置为33英寸,理论值应该是33×256=8448,
//但是这里的设值是8648,具体原因请看下面的计算逻辑 //但是这里的设值是8648,具体原因请看下面的计算逻辑
sheet.setColumnWidth(0, 1000); sheet.setColumnWidth(0, 1000);
sheet.setColumnWidth(3, 5000); sheet.setColumnWidth(3, 5500);
sheet.setColumnWidth(6, 1500); sheet.setColumnWidth(6, 1500);
sheet.setColumnWidth(7, 1500); sheet.setColumnWidth(7, 1500);
sheet.setColumnWidth(8, 1500); sheet.setColumnWidth(8, 1500);
sheet.setColumnWidth(9, 1500); sheet.setColumnWidth(9, 1500);
sheet.setColumnWidth(10, 3000); sheet.setColumnWidth(10, 3500);
sheet.setColumnWidth(12, 3000); sheet.setColumnWidth(12, 3000);
} }
} }
......
...@@ -36,7 +36,7 @@ public class CustomCellWriteWidthOneConfig extends AbstractColumnWidthStyleStrat ...@@ -36,7 +36,7 @@ public class CustomCellWriteWidthOneConfig extends AbstractColumnWidthStyleStrat
sheet.setColumnWidth(11, 1000); sheet.setColumnWidth(11, 1000);
sheet.setColumnWidth(12, 1000); sheet.setColumnWidth(12, 1000);
sheet.setColumnWidth(13, 1000); sheet.setColumnWidth(13, 1000);
sheet.setColumnWidth(14, 1500); sheet.setColumnWidth(14, 1800);
sheet.setColumnWidth(15, 5000); sheet.setColumnWidth(15, 5000);
sheet.setColumnWidth(16, 3200); sheet.setColumnWidth(16, 3200);
sheet.setColumnWidth(17, 3000); sheet.setColumnWidth(17, 3000);
......
...@@ -26,7 +26,7 @@ public class CustomCellWriteWidthTwoConfig extends AbstractColumnWidthStyleStrat ...@@ -26,7 +26,7 @@ public class CustomCellWriteWidthTwoConfig extends AbstractColumnWidthStyleStrat
//要求将当前列的列宽设置为33英寸,理论值应该是33×256=8448, //要求将当前列的列宽设置为33英寸,理论值应该是33×256=8448,
//但是这里的设值是8648,具体原因请看下面的计算逻辑 //但是这里的设值是8648,具体原因请看下面的计算逻辑
sheet.setColumnWidth(0, 1000); sheet.setColumnWidth(0, 1000);
sheet.setColumnWidth(1, 4000); sheet.setColumnWidth(1, 3000);
sheet.setColumnWidth(3, 5000); sheet.setColumnWidth(3, 5000);
sheet.setColumnWidth(5, 1000); sheet.setColumnWidth(5, 1000);
sheet.setColumnWidth(6, 1000); sheet.setColumnWidth(6, 1000);
...@@ -40,13 +40,14 @@ public class CustomCellWriteWidthTwoConfig extends AbstractColumnWidthStyleStrat ...@@ -40,13 +40,14 @@ public class CustomCellWriteWidthTwoConfig extends AbstractColumnWidthStyleStrat
sheet.setColumnWidth(14, 1500); sheet.setColumnWidth(14, 1500);
sheet.setColumnWidth(15, 1500); sheet.setColumnWidth(15, 1500);
sheet.setColumnWidth(16, 1500); sheet.setColumnWidth(16, 1500);
sheet.setColumnWidth(17, 1000); sheet.setColumnWidth(17, 1500);
sheet.setColumnWidth(18, 1000); sheet.setColumnWidth(18, 1000);
sheet.setColumnWidth(19, 1500); sheet.setColumnWidth(19, 1000);
sheet.setColumnWidth(20, 1500); sheet.setColumnWidth(20, 1500);
sheet.setColumnWidth(21, 1000); sheet.setColumnWidth(21, 1500);
sheet.setColumnWidth(22, 1000); sheet.setColumnWidth(22, 1000);
sheet.setColumnWidth(23, 4000); sheet.setColumnWidth(23, 1000);
sheet.setColumnWidth(24, 3500);
} }
} }
} }
......
...@@ -174,6 +174,15 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> { ...@@ -174,6 +174,15 @@ public interface TDispatchInfoMapper extends BaseMapper<TDispatchInfo> {
**/ **/
List<TDispatchSocialExportVo> getSocialDisRecord(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo); List<TDispatchSocialExportVo> getSocialDisRecord(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
/**
* @Author huyc
* @Description 社保派单医保模版
* @Date 15:47 2023/7/18
* @Param
* @return
**/
List<TDispatchSocialExportVo> getSocialReduceDisRecord(@Param("tDispatchInfo") SocialHandleSearchVo dispatchInfo);
/** /**
* @Author huyc * @Author huyc
* @Description 社保派单养老模版count * @Description 社保派单养老模版count
......
...@@ -5097,7 +5097,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5097,7 +5097,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
**/ **/
@Override @Override
public void doexportSocialRecordNew(HttpServletResponse response,SocialHandleSearchVo searchVo) { public void doexportSocialRecordNew(HttpServletResponse response,SocialHandleSearchVo searchVo) {
String fileName = DispatchConstants.SOCIAL_MEDICAL_EXPORT + DateUtil.getThisTime() + CommonConstants.XLSX; String fileName = DispatchConstants.SOCIAL_MEDICAL_EXPORT + searchVo.getSocialHouseholdName() + "_" + searchVo.getDisMonth() + CommonConstants.XLSX;
//获取要导出的列表 //获取要导出的列表
List<TDispatchSocialExportVo> list = new ArrayList<>(); List<TDispatchSocialExportVo> list = new ArrayList<>();
try (ServletOutputStream out = response.getOutputStream()){ try (ServletOutputStream out = response.getOutputStream()){
...@@ -5125,7 +5125,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5125,7 +5125,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
registerWriteHandler(new SimpleRowHeightStyleStrategy((short)40,(short)20)). registerWriteHandler(new SimpleRowHeightStyleStrategy((short)40,(short)20)).
build(); build();
writeTable1 = EasyExcel.writerTable(1). writeTable1 = EasyExcel.writerTable(1).
head(headTwo(searchVo.getSocialHouseholdName(),searchVo.getCustomerNo())). head(headTwo(searchVo.getSocialHouseholdName(),searchVo.getUnitCreditCode())).
registerWriteHandler(customCellStyleStrategyOne). registerWriteHandler(customCellStyleStrategyOne).
registerWriteHandler(new SimpleRowHeightStyleStrategy((short)25,(short)20)). registerWriteHandler(new SimpleRowHeightStyleStrategy((short)25,(short)20)).
build(); build();
...@@ -5176,7 +5176,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5176,7 +5176,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
excelWriter.write(new ArrayList<>(), writeSheet, writeTable0); excelWriter.write(new ArrayList<>(), writeSheet, writeTable0);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1); excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
// 第二次写如也会创建头,然后在第一次的后面写入数据 // 第二次写如也会创建头,然后在第一次的后面写入数据
excelWriter.write(new ArrayList<>(), writeSheet, writeTable2); int num = 1;
for (int i =1;i<= 10;i++) {
vo = new TDispatchSocialExportVo();
vo.setNum(num);
num ++;
list.add(vo);
}
excelWriter.write(list, writeSheet, writeTable2);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable3); excelWriter.write(new ArrayList<>(), writeSheet, writeTable3);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable4); excelWriter.write(new ArrayList<>(), writeSheet, writeTable4);
} }
...@@ -5184,7 +5191,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5184,7 +5191,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
searchVo.setType(CommonConstants.ONE_STRING); searchVo.setType(CommonConstants.ONE_STRING);
long count1 = getSocialDisRecordCount(searchVo); long count1 = getSocialDisRecordCount(searchVo);
if (count1 > CommonConstants.ZERO_INT){ if (count1 > CommonConstants.ZERO_INT){
list = getSocialDisRecord(searchVo); list = baseMapper.getSocialReduceDisRecord(searchVo);
if (Common.isNotNull(list)) { if (Common.isNotNull(list)) {
//判断list的大小是否大于10 //判断list的大小是否大于10
if (list.size() < 10) { if (list.size() < 10) {
...@@ -5211,7 +5218,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5211,7 +5218,15 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
excelWriter.write(new ArrayList<>(), writeSheet, writeTable0); excelWriter.write(new ArrayList<>(), writeSheet, writeTable0);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1); excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
// 第二次写如也会创建头,然后在第一次的后面写入数据 // 第二次写如也会创建头,然后在第一次的后面写入数据
excelWriter.write(new ArrayList<>(), writeSheet, writeTable2); int num = 1;
list = new ArrayList<>();
for (int i =1;i<= 10;i++) {
vo = new TDispatchSocialExportVo();
vo.setNum(num);
num ++;
list.add(vo);
}
excelWriter.write(list, writeSheet, writeTable2);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable3); excelWriter.write(new ArrayList<>(), writeSheet, writeTable3);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable4); excelWriter.write(new ArrayList<>(), writeSheet, writeTable4);
} }
...@@ -5232,7 +5247,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5232,7 +5247,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
**/ **/
@Override @Override
public void doexportSocialPensionRecord(HttpServletResponse response,SocialHandleSearchVo searchVo) { public void doexportSocialPensionRecord(HttpServletResponse response,SocialHandleSearchVo searchVo) {
String fileName = DispatchConstants.SOCIAL_PERSION_EXPORT + DateUtil.getThisTime() + CommonConstants.XLSX; String fileName = DispatchConstants.SOCIAL_PERSION_EXPORT + searchVo.getSocialHouseholdName() + "_" + searchVo.getDisMonth() + CommonConstants.XLSX;
//获取要导出的列表 //获取要导出的列表
List<TDispatchSocialPersionExportVo> list = new ArrayList<>(); List<TDispatchSocialPersionExportVo> list = new ArrayList<>();
try (ServletOutputStream out = response.getOutputStream()){ try (ServletOutputStream out = response.getOutputStream()){
...@@ -5310,7 +5325,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5310,7 +5325,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
writeSheet = EasyExcel.writerSheet("2023").build(); writeSheet = EasyExcel.writerSheet("2023").build();
excelWriter.write(new ArrayList<>(), writeSheet, writeTable0); excelWriter.write(new ArrayList<>(), writeSheet, writeTable0);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1); excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable2); int num = 1;
for (int i =1;i<= 10;i++) {
vo = new TDispatchSocialPersionExportVo();
vo.setNum(num);
num ++;
list.add(vo);
}
excelWriter.write(list, writeSheet, writeTable2);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable3); excelWriter.write(new ArrayList<>(), writeSheet, writeTable3);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable4); excelWriter.write(new ArrayList<>(), writeSheet, writeTable4);
} }
...@@ -5320,7 +5342,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5320,7 +5342,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//获取要导出的列表 //获取要导出的列表
List<TDispatchSocialPersionReduceExportVo> listReduce = new ArrayList<>(); List<TDispatchSocialPersionReduceExportVo> listReduce = new ArrayList<>();
List<Integer> columnIndex = Arrays.asList(0,23); List<Integer> columnIndex = Arrays.asList(0,24);
CustomCellStyleStrategy customCellStyleStrategy1 = new CustomCellStyleStrategy(columnIndex); CustomCellStyleStrategy customCellStyleStrategy1 = new CustomCellStyleStrategy(columnIndex);
CustomCellStyleOneStrategy customCellStyleStrategy2 = new CustomCellStyleOneStrategy(columnIndex); CustomCellStyleOneStrategy customCellStyleStrategy2 = new CustomCellStyleOneStrategy(columnIndex);
CustomCellStyleTwoStrategy customCellStyleStrategy3 = new CustomCellStyleTwoStrategy(columnIndex); CustomCellStyleTwoStrategy customCellStyleStrategy3 = new CustomCellStyleTwoStrategy(columnIndex);
...@@ -5373,7 +5395,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -5373,7 +5395,14 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
writeSheet = EasyExcel.writerSheet("减员").build(); writeSheet = EasyExcel.writerSheet("减员").build();
excelWriter.write(new ArrayList<>(), writeSheet, writeTable0); excelWriter.write(new ArrayList<>(), writeSheet, writeTable0);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable1); excelWriter.write(new ArrayList<>(), writeSheet, writeTable1);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable2); int num = 1;
for (int i =1;i<= 10;i++) {
reduceVo = new TDispatchSocialPersionReduceExportVo();
reduceVo.setNum(num);
num ++;
listReduce.add(reduceVo);
}
excelWriter.write(listReduce, writeSheet, writeTable2);
excelWriter.write(new ArrayList<>(), writeSheet, writeTable3); excelWriter.write(new ArrayList<>(), writeSheet, writeTable3);
} }
if (excelWriter!= null) { if (excelWriter!= null) {
...@@ -6310,7 +6339,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6310,7 +6339,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
public List<List<String>> headTwo(String houseName,String cusNo) { public List<List<String>> headTwo(String houseName,String cusNo) {
List<List<String>> list = new ArrayList<>(); List<List<String>> list = new ArrayList<>();
//表头数据 //表头数据
String b = "单位名称(盖章): " + houseName + " 单位统一信用代码:" + cusNo; String b = "单位名称(盖章): " + houseName + " 单位统一信用代码:" + (null == cusNo ? " " : cusNo);
String c = "人员类型: □√单位职工 □灵活就业人员"; String c = "人员类型: □√单位职工 □灵活就业人员";
for (int i =1;i<= 13;i++) { for (int i =1;i<= 13;i++) {
list.add(Lists.newArrayList(b,c)); list.add(Lists.newArrayList(b,c));
...@@ -6350,7 +6379,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6350,7 +6379,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//第十二列 //第十二列
list.add( Lists.newArrayList("学历","学历")); list.add( Lists.newArrayList("学历","学历"));
//第十三列 //第十三列
list.add( Lists.newArrayList(" 备注"," 备注")); list.add( Lists.newArrayList("备注","备注"));
return list; return list;
} }
...@@ -6365,7 +6394,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6365,7 +6394,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//表头数据 //表头数据
String a = "备注: 1.身份证类型填写:身份证、护照、港澳台通行证等; \n" + String a = "备注: 1.身份证类型填写:身份证、护照、港澳台通行证等; \n" +
" 2.增加人员勾选新增或续保,减少人员勾选中断或终止,按相应类型进行勾选;\n" + " 2.增加人员勾选新增或续保,减少人员勾选中断或终止,按相应类型进行勾选;\n" +
" 3.联系电话务必填写准确的手机号码;\n"; " 3.联系电话务必填写准确的手机号码;";
//第一列-第十三列 //第一列-第十三列
for (int i =1;i<= 13;i++) { for (int i =1;i<= 13;i++) {
list.add(Lists.newArrayList(a)); list.add(Lists.newArrayList(a));
...@@ -6418,7 +6447,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6418,7 +6447,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
public List<List<String>> persionHeadTwo(String houseName,String cusNo) { public List<List<String>> persionHeadTwo(String houseName,String cusNo) {
List<List<String>> list = new ArrayList<>(); List<List<String>> list = new ArrayList<>();
//表头数据 //表头数据
String a="单位名称(签章): " + houseName + " 单位编码:" + cusNo; String a="单位名称(签章): " + houseName + " 单位编码:" + (null == cusNo ? " " : cusNo);
//第一列-第十八列 //第一列-第十八列
for (int i =1;i<= 18;i++) { for (int i =1;i<= 18;i++) {
list.add(Lists.newArrayList(a)); list.add(Lists.newArrayList(a));
...@@ -6443,7 +6472,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6443,7 +6472,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//第三列 //第三列
list.add( Lists.newArrayList("职工编码","职工编码")); list.add( Lists.newArrayList("职工编码","职工编码"));
//第四列 //第四列
list.add( Lists.newArrayList("社会保障号码(身份证号码)","社会保障号码(身份证号码)")); list.add( Lists.newArrayList("社会保障号码 (身份证号码)","社会保障号码 (身份证号码)"));
//第五列 //第五列
list.add( Lists.newArrayList("性别","性别")); list.add( Lists.newArrayList("性别","性别"));
//第六列 //第六列
...@@ -6504,7 +6533,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6504,7 +6533,7 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
public List<List<String>> persionHead1() { public List<List<String>> persionHead1() {
List<List<String>> list = new ArrayList<>(); List<List<String>> list = new ArrayList<>();
//表头数据 //表头数据
String b="填报人: 单位联系电话: 社保经办机构审核人: " + "填报日期: " + DateUtil.getYear(DateUtil.getCurrentDateTime())+ " 年" + " " + DateUtil.getMonth(DateUtil.getCurrentDateTime()) +" 月" + " " + DateUtil.getDay(DateUtil.getCurrentDateTime()) + " 日"; String b="填表人: 单位联系电话: 社保经办机构审核人: " + "填报日期: " + DateUtil.getYear(DateUtil.getCurrentDateTime())+ " 年" + " " + DateUtil.getMonth(DateUtil.getCurrentDateTime()) +" 月" + " " + DateUtil.getDay(DateUtil.getCurrentDateTime()) + " 日";
//第一列-第十八列 //第一列-第十八列
for (int i =1;i<= 18;i++) { for (int i =1;i<= 18;i++) {
list.add(Lists.newArrayList(b)); list.add(Lists.newArrayList(b));
...@@ -6521,9 +6550,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6521,9 +6550,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
public List<List<String>> persionReduceHeadOne() { public List<List<String>> persionReduceHeadOne() {
List<List<String>> list = new ArrayList<>(); List<List<String>> list = new ArrayList<>();
//表头数据 //表头数据
String a=" 社 会 保 险 缴 费 单 位 人 员 减 少 花 名 册"; String a="社 会 保 险 缴 费 单 位 人 员 减 少 花 名 册";
//第一列-第二十五列 //第一列-第二十五列
for (int i =1;i<= 24;i++) { for (int i =1;i<= 25;i++) {
list.add(Lists.newArrayList(a)); list.add(Lists.newArrayList(a));
} }
return list; return list;
...@@ -6538,9 +6567,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6538,9 +6567,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
public List<List<String>> persionReduceHeadTwo(String houseName,String cusNo) { public List<List<String>> persionReduceHeadTwo(String houseName,String cusNo) {
List<List<String>> list = new ArrayList<>(); List<List<String>> list = new ArrayList<>();
//表头数据 //表头数据
String a="单位名称(签章): " + houseName + " 单位编码:" + cusNo; String a="单位名称(签章): " + houseName + " 单位编码:" + (null == cusNo ? " " : cusNo);
//第一列-第二十五列 //第一列-第二十五列cusNo
for (int i =1;i<= 24;i++) { for (int i =1;i<= 25;i++) {
list.add(Lists.newArrayList(a)); list.add(Lists.newArrayList(a));
} }
return list; return list;
...@@ -6563,11 +6592,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6563,11 +6592,11 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//第三列 //第三列
list.add( Lists.newArrayList("姓名","姓名")); list.add( Lists.newArrayList("姓名","姓名"));
//第四列 //第四列
list.add( Lists.newArrayList("社会保障号码(身份证号码)","社会保障号码(身份证号码)")); list.add( Lists.newArrayList("社会保障号码 (身份证号码)","社会保障号码 (身份证号码)"));
//第五列 //第五列
list.add( Lists.newArrayList("停止缴费时间","停止缴费时间")); list.add( Lists.newArrayList("停止缴费时间","停止缴费时间"));
//减少原因 //减少原因
List<String> orderSpeaces = Lists.newArrayList("辞职","辞退","参军","上学","劳改","劳教","除名","人员失踪","停薪留职","解除合同","统筹内调出","调出统筹范围","退休","死亡","出国定居","港澳台定居","退保","其他"); List<String> orderSpeaces = Lists.newArrayList("辞职","辞退","参军","上学","劳改","劳教","除名","人员失踪","停薪留职","合同期满","解除合同","统筹内调出","调出统筹范围","退休","死亡","出国定居","港澳台定居","退保","其他");
orderSpeaces.forEach(e->{ orderSpeaces.forEach(e->{
list.add( Lists.newArrayList(c,e) ); list.add( Lists.newArrayList(c,e) );
}); });
...@@ -6586,9 +6615,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T ...@@ -6586,9 +6615,9 @@ public class TDispatchInfoServiceImpl extends ServiceImpl<TDispatchInfoMapper, T
//表头数据 //表头数据
String a = "说明1、“减少原因”栏可对应选项打“√”; \n" + String a = "说明1、“减少原因”栏可对应选项打“√”; \n" +
"2、本表需填制一式二份,经办机构审核盖章后方可有效,一份单位自存,一份报市社会保险经办机构。"; "2、本表需填制一式二份,经办机构审核盖章后方可有效,一份单位自存,一份报市社会保险经办机构。";
String b="填报人: 单位联系电话: 社保经办机构审核人: " + "填报日期: " + DateUtil.getYear(DateUtil.getCurrentDateTime())+ " 年" + " " + DateUtil.getMonth(DateUtil.getCurrentDateTime()) +" 月" + " " + DateUtil.getDay(DateUtil.getCurrentDateTime()) + " 日"; String b="填表人: 单位联系电话: 社保经办机构审核人: " + "填报日期: " + DateUtil.getYear(DateUtil.getCurrentDateTime())+ " 年" + " " + DateUtil.getMonth(DateUtil.getCurrentDateTime()) +" 月" + " " + DateUtil.getDay(DateUtil.getCurrentDateTime()) + " 日";
//第一列-第十八列 //第一列-第十八列
for (int i =1;i<= 24;i++) { for (int i =1;i<= 25;i++) {
list.add(Lists.newArrayList(a,b)); list.add(Lists.newArrayList(a,b));
} }
return list; return list;
......
...@@ -279,6 +279,7 @@ ...@@ -279,6 +279,7 @@
<result property="typeO" column="typeO"/> <result property="typeO" column="typeO"/>
<result property="typeP" column="typeP"/> <result property="typeP" column="typeP"/>
<result property="typeQ" column="typeQ"/> <result property="typeQ" column="typeQ"/>
<result property="typeZ" column="typeZ"/>
<result property="remark" column="REMARK"/> <result property="remark" column="REMARK"/>
</resultMap> </resultMap>
...@@ -752,14 +753,11 @@ ...@@ -752,14 +753,11 @@
when a.TYPE = 1 then "派减" when a.TYPE = 1 then "派减"
else null end as "TYPE" , else null end as "TYPE" ,
a.SOCIAL_HOUSEHOLD_NAME, a.SOCIAL_HOUSEHOLD_NAME,
case when s.HANDLE_STATUS = 0 then "派增待办理" case when a.SOCIAL_HANDLE_STATUS = 0 then "待办理"
when s.HANDLE_STATUS = 1 then "派增办理成功" when a.SOCIAL_HANDLE_STATUS = 1 then "办理成功"
when s.HANDLE_STATUS = 2 then "派增办理失败" when a.SOCIAL_HANDLE_STATUS = 2 then "办理失败"
when s.HANDLE_STATUS = 3 then "已派减" when a.SOCIAL_HANDLE_STATUS = 3 then "部分办理失败"
when s.HANDLE_STATUS = 4 then "派增办理中" when a.SOCIAL_HANDLE_STATUS = 4 then "办理中"
when s.HANDLE_STATUS = 5 then "派增部分办理失败"
when s.HANDLE_STATUS = 6 then "派减办理中"
when s.HANDLE_STATUS = 7 then "派减部分办理失败"
else null end as "SOCIAL_HANDLE_STATUS", else null end as "SOCIAL_HANDLE_STATUS",
IF(a.TYPE='0', IF(a.TYPE='0',
case when s.PENSION_HANDLE = 0 then "派增待办理" case when s.PENSION_HANDLE = 0 then "派增待办理"
...@@ -1258,12 +1256,13 @@ ...@@ -1258,12 +1256,13 @@
<!--tDispatchInfo 社保花名册派单数据count--> <!--tDispatchInfo 社保花名册派单数据count-->
<select id="getSocialDisRecordCount" resultType="java.lang.Integer"> <select id="getSocialDisRecordCount" resultType="java.lang.Integer">
SELECT SELECT count(1) from (
count(1) SELECT 1
FROM t_dispatch_info a FROM t_dispatch_info a
<where> <where>
<include refid="where_getSocialDisRecord"/> <include refid="where_getSocialDisRecord"/>
</where> </where>
group by a.EMP_IDCARD) h
</select> </select>
...@@ -1271,6 +1270,20 @@ ...@@ -1271,6 +1270,20 @@
<select id="getSocialDisRecord" resultMap="socialDisExportMap"> <select id="getSocialDisRecord" resultMap="socialDisExportMap">
SELECT SELECT
(@i :=@i+1) as NUM, (@i :=@i+1) as NUM,
h.EMP_NAME,
h.IDCARD_TYPE,
h.EMP_IDCARD,
h.DIS_MONTH,
h.MEDICAL_CARDINAL,
h.CHANGE_TYPE_ONE,
h.CHANGE_TYPE_TWO,
h.CHANGE_TYPE_THREE,
h.CHANGE_TYPE_FOUR,
h.EMP_MOBILE,
h.EDUCATION_NAME,
h.REMARK
from (
select
a.EMP_NAME, a.EMP_NAME,
'身份证' as IDCARD_TYPE, '身份证' as IDCARD_TYPE,
a.EMP_IDCARD, a.EMP_IDCARD,
...@@ -1282,34 +1295,95 @@ ...@@ -1282,34 +1295,95 @@
'' as CHANGE_TYPE_FOUR, '' as CHANGE_TYPE_FOUR,
a.EMP_MOBILE, a.EMP_MOBILE,
a.EDUCATION_NAME, a.EDUCATION_NAME,
a.EMP_MOBILE as REMARK '' as REMARK
FROM t_dispatch_info a FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID left join t_social_info s on s.id=a.SOCIAL_ID
,(select @i:=0) as itable
<where> <where>
<include refid="where_getSocialDisRecord"/> <include refid="where_getSocialDisRecord"/>
</where> </where>
group by a.EMP_IDCARD) h,(select @i:=0) as itable
</select>
<!--tDispatchInfo 社保医疗花名册派单数据-->
<select id="getSocialReduceDisRecord" resultMap="socialDisExportMap">
SELECT
(@i :=@i+1) as NUM,
h.EMP_NAME,
h.IDCARD_TYPE,
h.EMP_IDCARD,
h.DIS_MONTH,
h.MEDICAL_CARDINAL,
h.CHANGE_TYPE_ONE,
h.CHANGE_TYPE_TWO,
h.CHANGE_TYPE_THREE,
h.CHANGE_TYPE_FOUR,
h.EMP_MOBILE,
h.EDUCATION_NAME,
h.REMARK
from (
select
a.EMP_NAME,
'身份证' as IDCARD_TYPE,
a.EMP_IDCARD,
replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') as DIS_MONTH,
s.UNIT_MEDICAL_CARDINAL as MEDICAL_CARDINAL,
'' as CHANGE_TYPE_ONE,
'' as CHANGE_TYPE_TWO,
'√' as CHANGE_TYPE_THREE,
'' as CHANGE_TYPE_FOUR,
'' as EMP_MOBILE,
'' as EDUCATION_NAME,
'' as REMARK
FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID
<where>
<include refid="where_getSocialDisRecord"/>
</where>
group by a.EMP_IDCARD) h,(select @i:=0) as itable
</select> </select>
<!--tDispatchInfo 社保养老花名册派单数据--> <!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionDisCount" resultType="java.lang.Integer"> <select id="getSocialPersionDisCount" resultType="java.lang.Integer">
SELECT count(1) SELECT count(1) from (
select 1
FROM t_dispatch_info a FROM t_dispatch_info a
<where> <where>
<include refid="where_getSocialPersionDisRecord"/> <include refid="where_getSocialPersionDisRecord"/>
</where> </where>
group by a.EMP_IDCARD) h
</select> </select>
<!--tDispatchInfo 社保养老花名册派单数据--> <!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionDisRecord" resultMap="socialPersionDisExportMap"> <select id="getSocialPersionDisRecord" resultMap="socialPersionDisExportMap">
SELECT SELECT
(@i :=@i+1) as num, (@i :=@i+1) as num,
h.EMP_NAME,
h.EMP_NO,
h.EMP_IDCARD,
h.sex,
h.EMP_NATIONAL,
h.WORK_DATE,
h.type,
h.SIGNLE_TYPE,
h.INSURANCE_TYPE_ONE,
h.INSURANCE_TYPE_TWO,
h.INSURANCE_TYPE_THREE,
h.INSURANCE_TYPE_FOUR,
h.INSURANCE_TYPE_FIVE,
h.PERSION_CARDINAL,
h.MEDICAL_CARDINAL,
h.DATE_ONE,
h.CONTRACT_ADRESS,
h.REMARK
FROM (
SELECT
a.EMP_NAME, a.EMP_NAME,
a.EMP_NO, '' as EMP_NO,
a.EMP_IDCARD, a.EMP_IDCARD,
CASE (SUBSTR(a.EMP_IDCARD,17,1)%2) CASE (SUBSTR(a.EMP_IDCARD,17,1)%2)
WHEN 1 THEN '男' WHEN 1 THEN '男'
WHEN 0 THEN '女' WHEN 0 THEN '女'
else '男'
END sex, END sex,
case when a.EMP_NATIONAL = 1 then "汉族" case when a.EMP_NATIONAL = 1 then "汉族"
when a.EMP_NATIONAL = 2 then "傣族" when a.EMP_NATIONAL = 2 then "傣族"
...@@ -1335,31 +1409,58 @@ ...@@ -1335,31 +1409,58 @@
'' as INSURANCE_TYPE_FIVE, '' as INSURANCE_TYPE_FIVE,
s.RECORD_BASE as PERSION_CARDINAL, s.RECORD_BASE as PERSION_CARDINAL,
s.UNIT_MEDICAL_CARDINAL as MEDICAL_CARDINAL, s.UNIT_MEDICAL_CARDINAL as MEDICAL_CARDINAL,
concat(ifnull(DATE_FORMAT(a.CONTRACT_START,"%Y%m%d"),''),'-',ifnull(DATE_FORMAT(a.CONTRACT_END,"%Y%m%d"),'')) as DATE_ONE, concat(ifnull(DATE_FORMAT(a.CONTRACT_START,"%Y%m"),''),'-',ifnull(DATE_FORMAT(a.CONTRACT_END,"%Y%m"),'')) as DATE_ONE,
'安徽省合肥市' as CONTRACT_ADRESS, '安徽省合肥市' as CONTRACT_ADRESS,
a.EMP_MOBILE as REMARK a.EMP_MOBILE as REMARK
FROM t_dispatch_info a FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID left join t_social_info s on s.id=a.SOCIAL_ID
,(select @i:=0) as itable
<where> <where>
<include refid="where_getSocialPersionDisRecord"/> <include refid="where_getSocialPersionDisRecord"/>
</where> </where>
group by a.EMP_IDCARD)h,(select @i:=0) as itable
</select> </select>
<!--tDispatchInfo 社保养老花名册派单数据--> <!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionReduceDisCount" resultType="java.lang.Integer"> <select id="getSocialPersionReduceDisCount" resultType="java.lang.Integer">
SELECT count(1) SELECT count(1) from (
SELECT 1
FROM t_dispatch_info a FROM t_dispatch_info a
<where> <where>
<include refid="where_getSocialPersionDisRecord"/> <include refid="where_getSocialPersionDisRecord"/>
</where> </where>
group by a.EMP_IDCARD) h
</select> </select>
<!--tDispatchInfo 社保养老花名册派单数据--> <!--tDispatchInfo 社保养老花名册派单数据-->
<select id="getSocialPersionReduceDisRecord" resultMap="socialPersionReduceDisExportMap"> <select id="getSocialPersionReduceDisRecord" resultMap="socialPersionReduceDisExportMap">
SELECT SELECT
(@i :=@i+1) as num, (@i :=@i+1) as num,
a.EMP_NO, h.EMP_NO,
h.EMP_NAME,
h.EMP_IDCARD,
h.WORK_DATE,
h.typeA,
h.typeB,
h.typeC,
h.typeD,
h.typeE,
h.typeW,
h.typeF,
h.typeG,
h.typeH,
h.typeZ,
h.typeJ,
h.typeK,
h.typeL,
h.typeM,
h.typeN,
h.typeO,
h.typeP,
h.typeQ,
h.REMARK
FROM (
SELECT
'' as EMP_NO,
a.EMP_NAME, a.EMP_NAME,
a.EMP_IDCARD, a.EMP_IDCARD,
DATE_FORMAT(a.CREATE_TIME,"%Y%m") as WORK_DATE, DATE_FORMAT(a.CREATE_TIME,"%Y%m") as WORK_DATE,
...@@ -1372,6 +1473,7 @@ ...@@ -1372,6 +1473,7 @@
'' as typeF, '' as typeF,
'' as typeG, '' as typeG,
'' as typeH, '' as typeH,
'' as typeZ,
'' as typeJ, '' as typeJ,
'' as typeK, '' as typeK,
'' as typeL, '' as typeL,
...@@ -1383,10 +1485,10 @@ ...@@ -1383,10 +1485,10 @@
a.EMP_MOBILE as REMARK a.EMP_MOBILE as REMARK
FROM t_dispatch_info a FROM t_dispatch_info a
left join t_social_info s on s.id=a.SOCIAL_ID left join t_social_info s on s.id=a.SOCIAL_ID
,(select @i:=0) as itable
<where> <where>
<include refid="where_getSocialPersionDisRecord"/> <include refid="where_getSocialPersionDisRecord"/>
</where> </where>
group by a.EMP_IDCARD) h,(select @i:=0) as itable
</select> </select>
<!--tDispatchInfo 公积金变更清册查询--> <!--tDispatchInfo 公积金变更清册查询-->
...@@ -1805,7 +1907,7 @@ ...@@ -1805,7 +1907,7 @@
<sql id="where_getSocialDisRecord"> <sql id="where_getSocialDisRecord">
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
AND a.social_id is not null AND a.social_id is not null
AND a.STATUS = "2" AND a.STATUS in ('2','4')
AND a.DISPATCH_ITEM like concat('%','医疗','%') AND a.DISPATCH_ITEM like concat('%','医疗','%')
<if test="tDispatchInfo != null"> <if test="tDispatchInfo != null">
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''"> <if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
...@@ -1817,9 +1919,12 @@ ...@@ -1817,9 +1919,12 @@
<if test="tDispatchInfo.disMonth != null and tDispatchInfo.disMonth.trim() != ''"> <if test="tDispatchInfo.disMonth != null and tDispatchInfo.disMonth.trim() != ''">
AND replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') = #{tDispatchInfo.disMonth} AND replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') = #{tDispatchInfo.disMonth}
</if> </if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != ''"> <if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != '' and tDispatchInfo.socialHandleStatus != 1">
AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus} AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus}
</if> </if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != '' and tDispatchInfo.socialHandleStatus == 1">
AND a.SOCIAL_HANDLE_STATUS in ('1','3')
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''"> <if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql} ${tDispatchInfo.authSql}
</if> </if>
...@@ -1854,8 +1959,8 @@ ...@@ -1854,8 +1959,8 @@
<sql id="where_getSocialPersionDisRecord"> <sql id="where_getSocialPersionDisRecord">
a.DELETE_FLAG = 0 a.DELETE_FLAG = 0
AND a.social_id is not null AND a.social_id is not null
AND a.STATUS = "2" AND a.STATUS in ('2','4')
AND (a.DISPATCH_ITEM like concat('%','工伤','%') or a.DISPATCH_ITEM like concat('%','养老','%')) AND (a.DISPATCH_ITEM like concat('%','工伤','%') or a.DISPATCH_ITEM like concat('%','养老','%') or a.DISPATCH_ITEM like concat('%','失业','%'))
<if test="tDispatchInfo != null"> <if test="tDispatchInfo != null">
<if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''"> <if test="tDispatchInfo.socialHouseholdName != null and tDispatchInfo.socialHouseholdName.trim() != ''">
AND a.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName} AND a.SOCIAL_HOUSEHOLD_NAME = #{tDispatchInfo.socialHouseholdName}
...@@ -1866,9 +1971,12 @@ ...@@ -1866,9 +1971,12 @@
<if test="tDispatchInfo.disMonth != null and tDispatchInfo.disMonth.trim() != ''"> <if test="tDispatchInfo.disMonth != null and tDispatchInfo.disMonth.trim() != ''">
AND replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') = #{tDispatchInfo.disMonth} AND replace(DATE_FORMAT(a.CREATE_TIME,"%Y-%m"),'-','') = #{tDispatchInfo.disMonth}
</if> </if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != ''"> <if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != '' and tDispatchInfo.socialHandleStatus != 1">
AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus} AND a.SOCIAL_HANDLE_STATUS = #{tDispatchInfo.socialHandleStatus}
</if> </if>
<if test="tDispatchInfo.socialHandleStatus != null and tDispatchInfo.socialHandleStatus.trim() != '' and tDispatchInfo.socialHandleStatus == 1">
AND a.SOCIAL_HANDLE_STATUS in ('1','3')
</if>
<if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''"> <if test="tDispatchInfo.authSql != null and tDispatchInfo.authSql.trim() != ''">
${tDispatchInfo.authSql} ${tDispatchInfo.authSql}
</if> </if>
......
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