Commit daebb2fc authored by fangxinjiang's avatar fangxinjiang

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

parents 2d21b42e 0eb9d240
......@@ -52,4 +52,10 @@ public interface TRiskMonitorMapper extends BaseMapper<TRiskMonitor> {
* @return
*/
RiskMonitorPerVo getTRiskMonitorPer(@Param("tRiskMonitor") TRiskMonitorSearchVo tRiskMonitor);
/**
* 删除所有监控数据
* @return
*/
void deleteAllRiskMonitorInfo();
}
......@@ -4,7 +4,6 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TRiskMonitor;
......@@ -124,8 +123,7 @@ public class TRiskMonitorServiceImpl extends ServiceImpl<TRiskMonitorMapper, TRi
@Override
public void createRiskMonitor() {
//批量删除之前生成的管控统计
baseMapper.delete(Wrappers.<TRiskMonitor>query().lambda()
.eq(TRiskMonitor::getDeleteFlag, CommonConstants.ZERO_STRING));
baseMapper.deleteAllRiskMonitorInfo();
//批量生成统计数据
List<TRiskMonitor> list = baseMapper.selectRiskMonitorList();
if (!list.isEmpty()) {
......@@ -139,7 +137,6 @@ public class TRiskMonitorServiceImpl extends ServiceImpl<TRiskMonitorMapper, TRi
*/
@Override
public R selectCurrentRiskMonitor(TRiskMonitorSearchVo tRiskMonitor) {
YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId);
......
......@@ -219,6 +219,7 @@
<!--tRiskMonitor批量生成-->
<select id="selectRiskMonitorList" resultMap="tRiskMonitorMap">
select A.id as DEPT_ID,
a.STOP_FLAG,
a.DEPART_NAME,
a.DEPART_NO,
ifnull(a.SECOND_INDICATOR_BELONG,'') SECOND_INDICATOR_BELONG,
......@@ -269,16 +270,17 @@
from t_settle_domain a
left join (
select a.DEPT_NO,
count(a.EMP_IDCARD) as countContract
count(DISTINCT a.EMP_IDCARD) as countContract
from t_employee_contract_info a
where a.IN_USE = '0'
and a.DELETE_FLAG = 0
and CONTRACT_END >= CURDATE()
and length(ifnull(a.DEPT_NO, 0)) > 0
group by a.DEPT_NO
) ht on a.DEPART_NO = ht.DEPT_NO
left join (
select a.SETTLE_DOMAIN_CODE,
count(a.EMP_IDCARD) as countSocial
count(DISTINCT a.EMP_IDCARD) as countSocial
from mvp_social.t_social_fund_info a
where a.SOCIAL_STATUS in ('3', '4', '9', '12')
and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0
......@@ -286,7 +288,7 @@
) so on so.SETTLE_DOMAIN_CODE = a.DEPART_NO
left join (
select a.SETTLE_DOMAIN_CODE,
count(a.EMP_IDCARD) as countFund
count(DISTINCT a.EMP_IDCARD) as countFund
from mvp_social.t_social_fund_info a
where a.fund_STATUS in ('3', '8')
and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0
......@@ -294,19 +296,20 @@
) fu on fu.SETTLE_DOMAIN_CODE = a.DEPART_NO
left join (
select a.DEPT_NO,
count(a.EMP_IDCARD_NO) as countInsurance
count(DISTINCT a.EMP_IDCARD_NO) as countInsurance
from mvp_insurances.t_insurance_detail a
where a.IS_USE = 0
and IS_EFFECT = 0
and a.IS_OVERDUE = 0
and a.DELETE_FLAG = 0
and length(ifnull(a.DEPT_NO, 0)) > 0
group by a.DEPT_NO
) sx on a.DEPART_NO = sx.DEPT_NO
left join (
select count(acc.EMP_IDCARD) as countSalary, lll.CREATE_TIME, lll.DEPT_NO
select count(DISTINCT acc.EMP_IDCARD) as countSalary, lll.CREATE_TIME, lll.DEPT_NO
from mvp_salary.t_salary_standard lll
left join mvp_salary.t_salary_account acc on lll.id = acc.SALARY_FORM_ID
left join mvp_salary.t_salary_account acc on lll.id = acc.SALARY_FORM_ID and acc.DELETE_FLAG = 0
where lll.id in
(select b.id
from (
......@@ -326,80 +329,65 @@
(
select a.DEPT_NO,
a.EMP_IDCARD,
count(a.EMP_IDCARD) countPer
count(DISTINCT a.EMP_IDCARD) countPer
from t_employee_project a
where a.PROJECT_STATUS = 0
and a.DELETE_FLAG = '0'
group by a.DEPT_NO) pro on a.DEPART_NO = pro.DEPT_NO
left join (select a.DEPT_NO,
count(a.EMP_IDCARD) onContractNum
count(DISTINCT a.EMP_IDCARD) onContractNum
from t_employee_contract_info a
inner join t_employee_project jj on a.EMP_IDCARD = jj.EMP_IDCARD and a.DEPT_NO = jj.DEPT_NO and jj.PROJECT_STATUS = 0
and jj.DELETE_FLAG = '0'
where a.IN_USE = '0'
and CONTRACT_END >= CURDATE()
and a.DELETE_FLAG = 0
and length(ifnull(a.DEPT_NO, 0)) > 0
and EXISTS(
select 1
from t_employee_project a1
where a1.PROJECT_STATUS = 0
and a1.DELETE_FLAG = '0'
and a.EMP_IDCARD = a1.EMP_IDCARD
and a.DEPT_NO = a1.DEPT_NO)
group by a.DEPT_NO) q on a.DEPART_NO = q.DEPT_NO
left join
(
select a.SETTLE_DOMAIN_CODE,
count(a.EMP_IDCARD) onSocialNum
count(DISTINCT a.EMP_IDCARD) onSocialNum
from mvp_social.t_social_fund_info a
inner join t_employee_project jj on a.EMP_IDCARD = jj.EMP_IDCARD and a.SETTLE_DOMAIN_CODE = jj.DEPT_NO and jj.PROJECT_STATUS = 0
and jj.DELETE_FLAG = '0'
where a.SOCIAL_STATUS in ('3', '4', '9', '12')
and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0
and EXISTS(
select 1
from t_employee_project a1
where a1.PROJECT_STATUS = 0
and a1.DELETE_FLAG = '0'
and a.EMP_IDCARD = a1.EMP_IDCARD
and a.SETTLE_DOMAIN_CODE = a1.DEPT_NO)
group by a.SETTLE_DOMAIN_CODE
) w on a.DEPART_NO = w.SETTLE_DOMAIN_CODE
left join
(
select a.SETTLE_DOMAIN_CODE,
count(a.EMP_IDCARD) onFundNum
count(DISTINCT a.EMP_IDCARD) onFundNum
from mvp_social.t_social_fund_info a
inner join t_employee_project jj on a.EMP_IDCARD = jj.EMP_IDCARD and a.SETTLE_DOMAIN_CODE = jj.DEPT_NO and jj.PROJECT_STATUS = 0
and jj.DELETE_FLAG = '0'
where a.fund_STATUS in ('3', '8')
and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0
and EXISTS(
select 1
from t_employee_project a1
where a1.PROJECT_STATUS = 0
and a1.DELETE_FLAG = '0'
and a.EMP_IDCARD = a1.EMP_IDCARD
and a.SETTLE_DOMAIN_CODE = a1.DEPT_NO)
group by a.SETTLE_DOMAIN_CODE
) e on a.DEPART_NO = e.SETTLE_DOMAIN_CODE
left join
(
select a.DEPT_NO,
count(a.EMP_IDCARD_NO) onInsuranceNum
count(DISTINCT a.EMP_IDCARD_NO) onInsuranceNum
from mvp_insurances.t_insurance_detail a
inner join t_employee_project jj on a.EMP_IDCARD_NO = jj.EMP_IDCARD and a.DEPT_NO = jj.DEPT_NO and jj.PROJECT_STATUS = 0
and jj.DELETE_FLAG = '0'
where a.IS_USE = 0
and IS_EFFECT = 0
and a.IS_OVERDUE = 0
and a.DELETE_FLAG = 0
and length(ifnull(a.DEPT_NO, 0)) > 0
and EXISTS(
select 1
from t_employee_project a1
where a1.PROJECT_STATUS = 0
and a1.DELETE_FLAG = '0'
and a.EMP_IDCARD_NO = a1.EMP_IDCARD
and a.DEPT_NO = a1.DEPT_NO)
group by a.DEPT_NO
) r on a.DEPART_NO = r.DEPT_NO
left join
(
select count(acc.EMP_IDCARD) as onSalaryNum, lll.DEPT_NO
select count(DISTINCT acc.EMP_IDCARD) as onSalaryNum, lll.DEPT_NO
from mvp_salary.t_salary_standard lll
left join mvp_salary.t_salary_account acc on lll.id = acc.SALARY_FORM_ID
left join mvp_salary.t_salary_account acc on lll.id = acc.SALARY_FORM_ID and acc.DELETE_FLAG = 0
inner join t_employee_project jj on acc.EMP_IDCARD = jj.EMP_IDCARD and lll.DEPT_NO = jj.DEPT_NO and jj.PROJECT_STATUS = 0
and jj.DELETE_FLAG = '0'
where lll.id in
(select b.id
from (
......@@ -412,13 +400,7 @@
group by a.DEPT_NO) hh
INNER JOIN mvp_salary.t_salary_standard b
on hh.DEPT_NO = b.DEPT_NO and hh.CREATE_TIME = b.CREATE_TIME)
and EXISTS(
select 1
from t_employee_project a1
where a1.PROJECT_STATUS = 0
and a1.DELETE_FLAG = '0'
and acc.EMP_IDCARD = a1.EMP_IDCARD
and lll.DEPT_NO = a1.DEPT_NO)
group by lll.DEPT_NO, lll.id
) t on a.DEPART_NO = t.DEPT_NO
where a.DELETE_FLAG = '0'
......@@ -435,9 +417,14 @@
FROM
t_risk_monitor a
where
a.DELETE_FLAG = '0'
a.DELETE_FLAG = '0' and a.STOP_FLAG = '0'
<if test="tRiskMonitor.authSql != null and tRiskMonitor.authSql.trim() != ''">
${tRiskMonitor.authSql}
</if>
</select>
<!--删除所有监控数据-->
<update id="deleteAllRiskMonitorInfo">
TRUNCATE t_risk_monitor
</update>
</mapper>
......@@ -40,7 +40,7 @@ public interface EkpSocialInfoMapper extends BaseMapper<EkpSocialInfo> {
* @param
* @return
*/
List<String> getAllserioNo();
List<Map<String,String>> getAllserioNo();
/**
* 获取需要拉流水的银行账户
......
......@@ -60,6 +60,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
@Autowired
private EkpEntryProperties ekpEntryProperties;
@Override
public R getIcbcTransactionFlow() {
// //应用id 应用方私钥 网关公钥 应用方加密串
// String APP_ID = "11000000000000028685";
......@@ -122,8 +123,9 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
log.info("开始推当日新增网银到账明细条数");
String tranDate = DateUtil.getThisDay();
// todo 测试时改为查10天内的,上线改为查当天内的
String beginDate = DateUtil.addDay(-10).replace("-","");
// 测试时改为查10天内的,上线改为查当天内的
// String beginDate = DateUtil.addDay(-10).replace("-","");
String beginDate = tranDate;
String endDate = tranDate;
return getIcbcTransactionFlowCommon(tranDate,beginDate,endDate);
......@@ -166,8 +168,22 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
return R.ok();
}
// 查询当天的所有入账记录数据
List<String> serioList = baseMapper.getAllserioNo();
// 查询当天的所有入账记录数据, 查账号和流水号
List<Map<String,String>> serioList = baseMapper.getAllserioNo();
// 整理各个账户下的流水:账号为key,账户下流水号列表作为value
Map<String,List<String>> serioMapByAccount = new HashMap<>();
if (!serioList.isEmpty()) {
for(Map<String,String> serio: serioList) {
List<String> serioListByAccountOne = serioMapByAccount.get(serio.get("receiveBkNo"));
if(serioListByAccountOne == null || serioListByAccountOne.isEmpty()){
serioListByAccountOne = new ArrayList<>();
}
serioListByAccountOne.add(serio.get("onlySequence"));
serioMapByAccount.put(serio.get("receiveBkNo"),serioListByAccountOne);
}
}
// 账号为key,账户名称作为value
Map<String,String> accountInfoMap = new HashMap<>();
// 账号为key,账号下的流水作为value
......@@ -206,43 +222,55 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
// 重新过滤已存入【入账记录】的流水信息
for (String account : accountRecordListMap.keySet()) {
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> flowRecordList = accountRecordListMap.get(account);
// 获取成功后根据流水号去重和根据借贷标志02筛选出所有数据
if (!flowRecordList.isEmpty()) {
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> insertList =
flowRecordList.stream().filter(e-> e.getDrcrf().equals("2") && !serioList.contains(e.getOnlySequence())).collect(Collectors.toList());
if(!insertList.isEmpty()){
// 还有需要存的流水,重新存入账号流水Map里
if(accountRecordListMap.keySet().size()>0){
for (String account : accountRecordListMap.keySet()) {
// 获取当前账号下的流水
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> flowRecordList = accountRecordListMap.get(account);
// 获取成功后根据流水号去重和根据借贷标志02筛选出所有数据
if (!flowRecordList.isEmpty()) {
// 获取当前账户下的入账记录:账号为key,账户下入账记录列表作为value
List<String> serioListByAccount = serioMapByAccount.get(account);
if(serioListByAccount == null || serioListByAccount.isEmpty()){
serioListByAccount = new ArrayList<>();
}
// 过滤出需要新增流水的数据
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> insertList = new ArrayList<>();
for (MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 flowRecord : flowRecordList) {
if("2".equals(flowRecord.getDrcrf()) && !serioListByAccount.contains(flowRecord.getOnlySequence())){
insertList.add(flowRecord);
}
}
// 重新存入账号流水Map里
accountRecordListMap.put(account, insertList);
} else {
// 没有需要存的流水,账号流水Map重置值为空列表
accountRecordListMap.put(account, new ArrayList<>());
}
}
}
// 存入过滤后的流水信息到【入账记录】
for (String account : accountRecordListMap.keySet()) {
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> saveList = accountRecordListMap.get(account);
// 封装数据
if (!saveList.isEmpty()) {
String bankName = accountInfoMap.get(account);
log.info("到账明细条数:" + saveList.size());
try {
for (MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 entry : saveList) {
EKPEntryPushParam pushParam = new EKPEntryPushParam();
initValue(entry, pushParam, bankName, account);
String body = sendToEkp(pushParam);
// 重试一次
if (StringUtils.isBlank(body)) {
sendToEkp(pushParam);
// 存入过滤后的流水信息到【入账记录】
for (String account : accountRecordListMap.keySet()) {
List<MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1> saveList = accountRecordListMap.get(account);
// 封装数据
if (saveList != null && !saveList.isEmpty()) {
String bankName = accountInfoMap.get(account);
log.info("需要存的流水到账--银行名称:" + bankName);
log.info("需要存的流水到账--明细条数:" + saveList.size());
try {
for (MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 entry : saveList) {
EKPEntryPushParam pushParam = new EKPEntryPushParam();
initValue(entry, pushParam, bankName, account);
String body = sendToEkp(pushParam);
// 重试一次
if (StringUtils.isBlank(body)) {
sendToEkp(pushParam);
}
}
}catch (Exception e) {
log.error("到账明细数据推送失败",e);
}
}catch (Exception e) {
log.error("到账明细数据推送失败",e);
}
}
}
......@@ -251,7 +279,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
//推送数据
public String sendToEkp(EKPEntryPushParam pushParam){
private String sendToEkp(EKPEntryPushParam pushParam){
RestTemplate yourRestTemplate = new RestTemplate();
try{
String formValues = new ObjectMapper().writeValueAsString(pushParam);
......@@ -287,6 +315,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
}
@Override
public R querybankinfo() {
String privateKey = "4d931f6ad4331158fcc4dea23f0d71393328146e40b5f63f197b9f6ad3732f44";
......@@ -325,6 +354,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
return R.ok();
}
@Override
public R saveIcbcManagerCard() {
//应用id 应用方私钥 网关公钥 应用方加密串
String APP_ID = "11000000000000015602";
......@@ -437,7 +467,7 @@ public class IcbcTransactionFlowQueryServiceImpl extends ServiceImpl<EkpSocialIn
}
}
public void initValue(MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 entry,
private void initValue(MybankEnterpriseTradeQhisdResponseV1.MybankEnterpriseTradeQhisdResponseRdV1 entry,
EKPEntryPushParam pushParam,String bankName,String bankNo) throws ParseException {
pushParam.setFd_recipName(entry.getRecipName());
pushParam.setFd_recipAccountNo(entry.getRecipAccountNo());
......
......@@ -117,9 +117,9 @@
#{sql}
</update>
<!--查询社保明细信息-->
<select id="getAllserioNo" resultType="java.lang.String">
SELECT fd_3b573843db30ce from ekp_79c234bf64d412294f23
<!--查询当天的所有入账记录数据, 查账号和流水号-->
<select id="getAllserioNo" resultType="Map">
SELECT fd_3b573843db30ce as onlySequence,fd_3b62f3470beb30 as receiveBkNo from ekp_79c234bf64d412294f23
where DATE_FORMAT(fd_3aa4531d3b86e0, '%Y-%m-%d') between DATE_SUB(curdate(), INTERVAL 1 day) and DATE_ADD(now(), INTERVAL 1 day)
and fd_3b57f8de9df354 = '是'
</select>
......
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