Commit ebd4565b authored by huyuchen's avatar huyuchen

手动推送优化

parent f2324292
...@@ -169,31 +169,66 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> { ...@@ -169,31 +169,66 @@ public interface TPaymentInfoMapper extends BaseMapper<TPaymentInfo> {
* @param searchVo 缴费库 * @param searchVo 缴费库
* @return * @return
*/ */
List<TPaymentInfo> getTPaymentSocialPushInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo); List<TPaymentInfo> getTPaymentSocialPushInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
/** /**
* 缴费库公积金推送查询 * 缴费库公积金推送查询
* @param searchVo 缴费库 * @param searchVo 缴费库
* @return * @return
*/ */
List<TPaymentInfo> getTPaymentFundPushInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo); List<TPaymentInfo> getTPaymentFundPushInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
/** /**
* 缴费库社保收入推送查询 * 缴费库社保收入推送查询
* @param searchVo 缴费库 * @param searchVo 缴费库
* @return * @return
*/ */
List<TPaymentInfo> getTPaymentSocialIncomeInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo); List<TPaymentInfo> getTPaymentSocialIncomeInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
/** /**
* 缴费库公积金收入推送查询 * 缴费库公积金收入推送查询
* @param searchVo 缴费库 * @param searchVo 缴费库
* @return * @return
*/ */
List<TPaymentInfo> getTPaymentFundIncomeInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo); List<TPaymentInfo> getTPaymentFundIncomeInfo(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
void updateBySocialPayment(@Param("id")String id); void updateBySocialPayment(@Param("id")String id);
void updateBySocialIncomePayment(@Param("id")String id); void updateBySocialIncomePayment(@Param("id")String id);
/**
* 缴费库社保推送查询
* @param searchVo 缴费库
* @return
*/
long getTPaymentSocialPushCount(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
/**
* 缴费库公积金推送查询
* @param searchVo 缴费库
* @return
*/
long getTPaymentFundPushCount(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
/**
* 缴费库社保收入推送查询
* @param searchVo 缴费库
* @return
*/
long getTPaymentSocialIncomeCount(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
/**
* 缴费库公积金收入推送查询
* @param searchVo 缴费库
* @return
*/
long getTPaymentFundIncomeCount(@Param("tPaymentInfo") TPaymentInfoSearchVo searchVo,
@Param("userId") String userId);
} }
...@@ -2611,50 +2611,78 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa ...@@ -2611,50 +2611,78 @@ public class TPaymentInfoServiceImpl extends ServiceImpl<TPaymentInfoMapper, TPa
public void createPaymentSocialInfoReal(YifuUser user,TPaymentInfoSearchVo searchVo) { public void createPaymentSocialInfoReal(YifuUser user,TPaymentInfoSearchVo searchVo) {
//获取所有未推送的社保实缴明细数据 //获取所有未推送的社保实缴明细数据
List<TPaymentInfo> unPushInfo = baseMapper.getTPaymentSocialPushInfo(searchVo); searchVo.setLockStatus(CommonConstants.ONE_STRING);
if (Common.isNotNull(unPushInfo)) { String userId = user.getId();
List<TPaymentInfo> list = unPushInfo.stream().filter(e -> findList(e, user)).collect(Collectors.toList()); long count = baseMapper.getTPaymentSocialPushCount(searchVo,userId);
unPushInfo.clear(); if (count > 0) {
if (Common.isNotNull(list)) { List<TPaymentInfo> unPushInfo;
//推送数据封装并推送 int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
initEkpPushSocialParam(list); for (int j = 0; j < i; j++) {
unPushInfo = baseMapper.getTPaymentSocialPushInfo(searchVo, userId);
synchronized (this) {
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
initEkpPushSocialParam(unPushInfo);
}
}
} }
} }
} }
public void createPaymentFundInfoReal(YifuUser user,TPaymentInfoSearchVo searchVo) { public void createPaymentFundInfoReal(YifuUser user,TPaymentInfoSearchVo searchVo) {
//获取所有未推送的公积金实缴明细数据 //获取所有未推送的公积金实缴明细数据
List<TPaymentInfo> unPushInfo = baseMapper.getTPaymentFundPushInfo(searchVo); searchVo.setLockStatus(CommonConstants.ONE_STRING);
if (Common.isNotNull(unPushInfo)) { String userId = user.getId();
List<TPaymentInfo> list = unPushInfo.stream().filter(e -> findList(e, user)).collect(Collectors.toList()); long count = baseMapper.getTPaymentFundPushCount(searchVo,userId);
unPushInfo.clear(); if (count > 0) {
if (Common.isNotNull(list)) { List<TPaymentInfo> unPushInfo;
//推送数据封装并推送 int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
initEkpPushFundParam(list); for (int j = 0; j < i; j++) {
unPushInfo = baseMapper.getTPaymentFundPushInfo(searchVo, userId);
synchronized (this) {
if (Common.isNotNull(unPushInfo)) {
//推送数据封装并推送
initEkpPushFundParam(unPushInfo);
}
}
} }
} }
} }
public void createPaymentInfoIncomeReal(YifuUser user,TPaymentInfoSearchVo searchVo) { public void createPaymentInfoIncomeReal(YifuUser user,TPaymentInfoSearchVo searchVo) {
List<TPaymentInfo> sumList = baseMapper.getTPaymentSocialIncomeInfo(searchVo); searchVo.setLockStatus(CommonConstants.ONE_STRING);
if (Common.isNotNull(sumList)) { String userId = user.getId();
List<TPaymentInfo> list = sumList.stream().filter(e -> findList(e, user)).collect(Collectors.toList()); long count = baseMapper.getTPaymentSocialIncomeCount(searchVo,userId);
sumList.clear(); if (count > 0) {
if (Common.isNotNull(list)) { List<TPaymentInfo> sumList;
//生成收入 int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
createIncomeInfo(list, CommonConstants.ONE_STRING); for (int j = 0; j < i; j++) {
sumList = baseMapper.getTPaymentSocialIncomeInfo(searchVo, userId);
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成收入
createIncomeInfo(sumList, CommonConstants.ONE_STRING);
}
}
} }
} }
} }
public void createPaymentFundIncomeReal(YifuUser user,TPaymentInfoSearchVo searchVo) { public void createPaymentFundIncomeReal(YifuUser user,TPaymentInfoSearchVo searchVo) {
List<TPaymentInfo> sumList = baseMapper.getTPaymentFundIncomeInfo(searchVo); searchVo.setLockStatus(CommonConstants.ONE_STRING);
if (Common.isNotNull(sumList)) { String userId = user.getId();
List<TPaymentInfo> list = sumList.stream().filter(e -> findList(e, user)).collect(Collectors.toList()); long count = baseMapper.getTPaymentFundIncomeCount(searchVo,userId);
sumList.clear(); if (count > 0) {
if (Common.isNotNull(list)) { List<TPaymentInfo> sumList;
//生成公积金收入 int i = (int) Math.ceil((double) count / CommonConstants.TEN_THOUSAND_INT);
createIncomeInfo(list, CommonConstants.TWO_STRING); for (int j = 0; j < i; j++) {
sumList = baseMapper.getTPaymentFundIncomeInfo(searchVo, userId);
synchronized (this) {
if (Common.isNotNull(sumList)) {
//生成公积金收入
createIncomeInfo(sumList, CommonConstants.TWO_STRING);
}
}
} }
} }
} }
......
...@@ -1242,7 +1242,7 @@ ...@@ -1242,7 +1242,7 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_payment_info a FROM t_payment_info a
<where> <where>
a.PUSH_STATUS = '1' AND a.SOCIAL_ID IS NOT NULL a.PUSH_STATUS = '1' AND a.SOCIAL_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/> <include refid="tPaymentInfo_export_where"/>
</where> </where>
</select> </select>
...@@ -1253,7 +1253,7 @@ ...@@ -1253,7 +1253,7 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_payment_info a FROM t_payment_info a
<where> <where>
a.PUSH_STATUS = '1' AND a.FUND_ID IS NOT NULL a.PUSH_STATUS = '1' AND a.FUND_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/> <include refid="tPaymentInfo_export_where"/>
</where> </where>
</select> </select>
...@@ -1264,7 +1264,7 @@ ...@@ -1264,7 +1264,7 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_payment_info a FROM t_payment_info a
<where> <where>
a.INCOME_STATUS = '1' AND a.SOCIAL_ID IS NOT NULL a.INCOME_STATUS = '1' AND a.SOCIAL_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/> <include refid="tPaymentInfo_export_where"/>
</where> </where>
</select> </select>
...@@ -1275,7 +1275,7 @@ ...@@ -1275,7 +1275,7 @@
<include refid="Base_Column_List"/> <include refid="Base_Column_List"/>
FROM t_payment_info a FROM t_payment_info a
<where> <where>
a.INCOME_STATUS = '1' AND a.FUND_ID IS NOT NULL a.INCOME_STATUS = '1' AND a.FUND_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/> <include refid="tPaymentInfo_export_where"/>
</where> </where>
</select> </select>
...@@ -1295,4 +1295,47 @@ ...@@ -1295,4 +1295,47 @@
where where
ID = #{id} ID = #{id}
</update> </update>
<select id="getTPaymentSocialPushCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_payment_info a
<where>
a.PUSH_STATUS = '1' AND a.SOCIAL_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/>
</where>
</select>
<!--tPaymentInfo公积金推送查询-->
<select id="getTPaymentFundPushCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_payment_info a
<where>
a.PUSH_STATUS = '1' AND a.FUND_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/>
</where>
</select>
<!--tPaymentInfo社保收入推送查询-->
<select id="getTPaymentSocialIncomeCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_payment_info a
<where>
a.INCOME_STATUS = '1' AND a.SOCIAL_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/>
</where>
</select>
<!--tPaymentInfo公积金收入推送查询-->
<select id="getTPaymentFundIncomeCount" resultType="java.lang.Long">
SELECT
count(1)
FROM t_payment_info a
<where>
a.INCOME_STATUS = '1' AND a.FUND_ID IS NOT NULL AND a.CREATE_BY = #{userId}
<include refid="tPaymentInfo_export_where"/>
</where>
</select>
</mapper> </mapper>
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