Commit b5b7c907 authored by fangxinjiang's avatar fangxinjiang

社保办理失败推送微信-fxj

parent 3fa2ab1c
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
*/ */
package com.yifu.cloud.plus.v1.yifu.social.vo; package com.yifu.cloud.plus.v1.yifu.social.vo;
import com.alibaba.excel.annotation.ExcelProperty;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.ExcelAttribute;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAlertInfo; import com.yifu.cloud.plus.v1.yifu.social.entity.TSocialAlertInfo;
import lombok.Data; import lombok.Data;
...@@ -53,4 +55,11 @@ public class TSocialAlertInfoSearchVo extends TSocialAlertInfo { ...@@ -53,4 +55,11 @@ public class TSocialAlertInfoSearchVo extends TSocialAlertInfo {
@Schema(description = "查询limit 数据条数") @Schema(description = "查询limit 数据条数")
private int limitEnd; private int limitEnd;
/**
* 消息时间
*/
@ExcelAttribute(name = "消息时间", maxLength = 32)
@ExcelProperty("消息时间" )
private String infoDate;
} }
...@@ -20,6 +20,8 @@ package com.yifu.cloud.plus.v1.yifu.social.controller; ...@@ -20,6 +20,8 @@ package com.yifu.cloud.plus.v1.yifu.social.controller;
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;
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.ErrorMessage; 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.util.R;
import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser; import com.yifu.cloud.plus.v1.yifu.common.core.vo.YifuUser;
...@@ -39,6 +41,7 @@ import org.springframework.web.bind.annotation.*; ...@@ -39,6 +41,7 @@ import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.util.Date;
import java.util.List; import java.util.List;
...@@ -71,6 +74,10 @@ public class TSocialAlertInfoController { ...@@ -71,6 +74,10 @@ public class TSocialAlertInfoController {
return R.failed(CommonConstants.USER_FAIL); return R.failed(CommonConstants.USER_FAIL);
} }
tSocialAlertInfo.setReceiveUser(user.getId()); tSocialAlertInfo.setReceiveUser(user.getId());
if (Common.isEmpty(tSocialAlertInfo.getInfoDate())){
tSocialAlertInfo.setInfoDate(DateUtil.dateToString(new Date(),DateUtil.ISO_DATE_FORMAT));
}
return new R<>(tSocialAlertInfoService.getTSocialAlertInfoPage(page, tSocialAlertInfo)); return new R<>(tSocialAlertInfoService.getTSocialAlertInfoPage(page, tSocialAlertInfo));
} }
......
...@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUsersVo; ...@@ -30,6 +30,7 @@ import com.yifu.cloud.plus.v1.yifu.admin.api.vo.SysUsersVo;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants; 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.constant.SecurityConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.Common; 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.ErrorMessage; 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.util.R;
import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils; import com.yifu.cloud.plus.v1.yifu.common.dapr.util.UpmsDaprUtils;
...@@ -152,10 +153,10 @@ public class TSocialAlertInfoServiceImpl extends ServiceImpl<TSocialAlertInfoMap ...@@ -152,10 +153,10 @@ public class TSocialAlertInfoServiceImpl extends ServiceImpl<TSocialAlertInfoMap
//backList3中找出Type为0的数据,然后按用户分类统计出对应的数量 //backList3中找出Type为0的数据,然后按用户分类统计出对应的数量
Map<String, Long> socialCountMap = backList3.stream() Map<String, Long> socialCountMap = backList3.stream()
.filter(item -> CommonConstants.ZERO_STRING.equals(item.getType())) .filter(item -> item.getSocialProvince() != null)
.collect(Collectors.groupingBy(TSocialAlertInfo::getReceiveUser, Collectors.counting())); .collect(Collectors.groupingBy(TSocialAlertInfo::getReceiveUser, Collectors.counting()));
Map<String, Long> fundCountMap = backList3.stream() Map<String, Long> fundCountMap = backList3.stream()
.filter(item -> CommonConstants.ONE_STRING.equals(item.getType())) .filter(item -> item.getFundProvince() != null)
.collect(Collectors.groupingBy(TSocialAlertInfo::getReceiveUser, Collectors.counting())); .collect(Collectors.groupingBy(TSocialAlertInfo::getReceiveUser, Collectors.counting()));
//将socialCountMap和fundCountMap 按key 整合到一起,value为 value1 +':'+ value2; 需要考虑 socialCountMap 有fundCountMap中没有的或fundCountMap有socialCountMap中没有的情况 //将socialCountMap和fundCountMap 按key 整合到一起,value为 value1 +':'+ value2; 需要考虑 socialCountMap 有fundCountMap中没有的或fundCountMap有socialCountMap中没有的情况
Map<String, StringBuilder> countMap = new HashMap<>(); Map<String, StringBuilder> countMap = new HashMap<>();
...@@ -289,7 +290,7 @@ public class TSocialAlertInfoServiceImpl extends ServiceImpl<TSocialAlertInfoMap ...@@ -289,7 +290,7 @@ public class TSocialAlertInfoServiceImpl extends ServiceImpl<TSocialAlertInfoMap
Map<String, Object> requestMap = new HashMap<>(); Map<String, Object> requestMap = new HashMap<>();
Map<String, Object> textcard = new HashMap<>(); Map<String, Object> textcard = new HashMap<>();
textcard.put("title", "派单办理失败提醒"); textcard.put("title", "派单办理失败提醒");
textcard.put("url", String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", number )); textcard.put("url", String.format(SecurityConstants.WX_GET_MESSAGE_AUTH_URL, wxConfig.getCorpid(), wxConfig.getDomainName() + "/auth/oauth/wxLogin", number+DateUtils.format(new Date(), DateUtil.ISO_DATE_FORMAT) ));
textcard.put("description", content.toString()); textcard.put("description", content.toString());
requestMap.put("touser", sendUser); requestMap.put("touser", sendUser);
requestMap.put("agentid", wxConfig.getAgentid()); requestMap.put("agentid", wxConfig.getAgentid());
......
...@@ -116,11 +116,15 @@ ...@@ -116,11 +116,15 @@
<if test="tSocialAlertInfo.createTime != null"> <if test="tSocialAlertInfo.createTime != null">
AND a.CREATE_TIME = #{tSocialAlertInfo.createTime} AND a.CREATE_TIME = #{tSocialAlertInfo.createTime}
</if> </if>
<if test="tSocialAlertInfo.infoDate != null">
AND DATE_FORMAT(a.CREATE_TIME,'%Y%m%d') = #{tSocialAlertInfo.infoDate}
</if>
</if> </if>
</sql> </sql>
<!--tSocialAlertInfo简单分页查询--> <!--tSocialAlertInfo简单分页查询-->
<select id="getTSocialAlertInfoPage" resultMap="tSocialAlertInfoMap"> <!--<select id="getTSocialAlertInfoPage" resultMap="tSocialAlertInfoMap">
SELECT SELECT
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_social_alert_info a FROM t_social_alert_info a
...@@ -128,14 +132,33 @@ ...@@ -128,14 +132,33 @@
1=1 1=1
<include refid="tSocialAlertInfo_where"/> <include refid="tSocialAlertInfo_where"/>
</where> </where>
</select> </select>-->
<!--tSocialAlertInfo简单分页查询-->
<select id="getTSocialAlertInfoPage" resultMap="tSocialAlertInfoMap">
select
a.DEPT_NAME,
GROUP_CONCAT(
CASE WHEN a.TYPE=0 THEN '社保'
WHEN a.TYPE=1 THEN '公积金'
ELSE NULL END
) as type,
a.EMP_NAME,
GROUP_CONCAT(a.REASON) as REASON
FROM t_social_alert_info a
<where>
1=1
<include refid="tSocialAlertInfo_where"/>
</where>
GROUP BY a.DISPATCH_ID
</select>
<!--tSocialAlertInfo数据获取--> <!--tSocialAlertInfo数据获取-->
<select id="getTSocialAlertInfoList" resultMap="tSocialAlertInfoMap"> <select id="getTSocialAlertInfoList" resultMap="tSocialAlertInfoMap">
SELECT SELECT
di.SETTLE_DOMAIN_CODE as DEPT_NO, di.SETTLE_DOMAIN_CODE as DEPT_NO,
di.SETTLE_DOMAIN_NAME as DEPT_NAME, di.SETTLE_DOMAIN_NAME as DEPT_NAME,
di.TYPE AS TYPE, '0' AS TYPE,
di.EMP_NAME AS EMP_NAME, di.EMP_NAME AS EMP_NAME,
di.EMP_IDCARD AS EMP_IDCARD, di.EMP_IDCARD AS EMP_IDCARD,
di.CREATE_NAME AS APPLY_NAME, di.CREATE_NAME AS APPLY_NAME,
...@@ -172,14 +195,14 @@ ...@@ -172,14 +195,14 @@
) AS si ON di.SOCIAL_ID = si.ID ) AS si ON di.SOCIAL_ID = si.ID
WHERE WHERE
( (
(si.HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 100 DAY) (si.HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
AND si.HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00')) AND si.HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00'))
OR OR
(si.REDUCE_HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 100 DAY) (si.REDUCE_HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
AND si.REDUCE_HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00')) AND si.REDUCE_HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00'))
) )
AND di.SOCIAL_HANDLE_STATUS IN ('2', '3') AND di.SOCIAL_HANDLE_STATUS IN ('2', '3')
AND di.DELETE_FLAG = '0' AND di.TYPE=0 AND di.DELETE_FLAG = '0' AND di.social_id is not null
</select> </select>
<!--tSocialAlertInfo数据获取--> <!--tSocialAlertInfo数据获取-->
...@@ -187,7 +210,7 @@ ...@@ -187,7 +210,7 @@
SELECT SELECT
di.SETTLE_DOMAIN_CODE as DEPT_NO, di.SETTLE_DOMAIN_CODE as DEPT_NO,
di.SETTLE_DOMAIN_NAME as DEPT_NAME, di.SETTLE_DOMAIN_NAME as DEPT_NAME,
di.TYPE AS TYPE, '1' AS TYPE,
di.EMP_NAME AS EMP_NAME, di.EMP_NAME AS EMP_NAME,
di.EMP_IDCARD AS EMP_IDCARD, di.EMP_IDCARD AS EMP_IDCARD,
di.CREATE_NAME AS APPLY_NAME, di.CREATE_NAME AS APPLY_NAME,
...@@ -224,15 +247,15 @@ ...@@ -224,15 +247,15 @@
) AS pf ON di.FUND_ID = pf.ID ) AS pf ON di.FUND_ID = pf.ID
WHERE WHERE
( (
(pf.HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 100 DAY) (pf.HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
AND pf.HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00')) AND pf.HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00'))
OR OR
(pf.REDUCE_HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 100 DAY) (pf.REDUCE_HANDLE_TIME >= DATE_SUB(CURDATE(), INTERVAL 1 DAY)
AND pf.REDUCE_HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00')) AND pf.REDUCE_HANDLE_TIME <![CDATA[ <= ]]> CONCAT(CURDATE(), ' 10:00:00'))
) )
AND di.FUND_HANDLE_STATUS = '2' AND di.FUND_HANDLE_STATUS = '2'
AND di.DELETE_FLAG = '0' AND di.TYPE=1 AND di.DELETE_FLAG = '0' AND di.fund_id is not null
</select> </select>
<delete id="deleteCUrrentDayData"> <delete id="deleteCUrrentDayData">
delete from t_social_alert_info where CREATE_TIME >= CONCAT(CURDATE(), ' 10:00:00') delete from t_social_alert_info where CREATE_TIME >= CONCAT(CURDATE(), ' 10:00:00')
......
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