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
......
...@@ -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