Commit b412129b authored by huyuchen's avatar huyuchen

huych-风险管控提交

parent 061d8c98
...@@ -52,4 +52,10 @@ public interface TRiskMonitorMapper extends BaseMapper<TRiskMonitor> { ...@@ -52,4 +52,10 @@ public interface TRiskMonitorMapper extends BaseMapper<TRiskMonitor> {
* @return * @return
*/ */
RiskMonitorPerVo getTRiskMonitorPer(@Param("tRiskMonitor") TRiskMonitorSearchVo tRiskMonitor); RiskMonitorPerVo getTRiskMonitorPer(@Param("tRiskMonitor") TRiskMonitorSearchVo tRiskMonitor);
/**
* 删除所有监控数据
* @return
*/
void deleteAllRiskMonitorInfo();
} }
...@@ -4,7 +4,6 @@ import com.alibaba.excel.EasyExcel; ...@@ -4,7 +4,6 @@ import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter; import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.baomidou.mybatisplus.core.metadata.IPage; 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.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.archives.entity.TRiskMonitor; import com.yifu.cloud.plus.v1.yifu.archives.entity.TRiskMonitor;
...@@ -68,6 +67,8 @@ public class TRiskMonitorServiceImpl extends ServiceImpl<TRiskMonitorMapper, TRi ...@@ -68,6 +67,8 @@ public class TRiskMonitorServiceImpl extends ServiceImpl<TRiskMonitorMapper, TRi
*/ */
@Override @Override
public void listExport(HttpServletResponse response, TRiskMonitorSearchVo searchVo) { public void listExport(HttpServletResponse response, TRiskMonitorSearchVo searchVo) {
String menuInfo = "1838411182001954817";
searchVo.setMenuInfo(menuInfo);
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L; long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId); boolean isSsc = this.haveRole(user, roleId);
...@@ -124,8 +125,7 @@ public class TRiskMonitorServiceImpl extends ServiceImpl<TRiskMonitorMapper, TRi ...@@ -124,8 +125,7 @@ public class TRiskMonitorServiceImpl extends ServiceImpl<TRiskMonitorMapper, TRi
@Override @Override
public void createRiskMonitor() { public void createRiskMonitor() {
//批量删除之前生成的管控统计 //批量删除之前生成的管控统计
baseMapper.delete(Wrappers.<TRiskMonitor>query().lambda() baseMapper.deleteAllRiskMonitorInfo();
.eq(TRiskMonitor::getDeleteFlag, CommonConstants.ZERO_STRING));
//批量生成统计数据 //批量生成统计数据
List<TRiskMonitor> list = baseMapper.selectRiskMonitorList(); List<TRiskMonitor> list = baseMapper.selectRiskMonitorList();
if (!list.isEmpty()) { if (!list.isEmpty()) {
...@@ -139,7 +139,8 @@ public class TRiskMonitorServiceImpl extends ServiceImpl<TRiskMonitorMapper, TRi ...@@ -139,7 +139,8 @@ public class TRiskMonitorServiceImpl extends ServiceImpl<TRiskMonitorMapper, TRi
*/ */
@Override @Override
public R selectCurrentRiskMonitor(TRiskMonitorSearchVo tRiskMonitor) { public R selectCurrentRiskMonitor(TRiskMonitorSearchVo tRiskMonitor) {
String menuInfo = "1838411182001954817";
tRiskMonitor.setMenuInfo(menuInfo);
YifuUser user = SecurityUtils.getUser(); YifuUser user = SecurityUtils.getUser();
long roleId = 1839501715787390978L; long roleId = 1839501715787390978L;
boolean isSsc = this.haveRole(user, roleId); boolean isSsc = this.haveRole(user, roleId);
......
...@@ -269,16 +269,17 @@ ...@@ -269,16 +269,17 @@
from t_settle_domain a from t_settle_domain a
left join ( left join (
select a.DEPT_NO, select a.DEPT_NO,
count(a.EMP_IDCARD) as countContract count(DISTINCT a.EMP_IDCARD) as countContract
from t_employee_contract_info a from t_employee_contract_info a
where a.IN_USE = '0' where a.IN_USE = '0'
and a.DELETE_FLAG = 0
and CONTRACT_END >= CURDATE() and CONTRACT_END >= CURDATE()
and length(ifnull(a.DEPT_NO, 0)) > 0 and length(ifnull(a.DEPT_NO, 0)) > 0
group by a.DEPT_NO group by a.DEPT_NO
) ht on a.DEPART_NO = ht.DEPT_NO ) ht on a.DEPART_NO = ht.DEPT_NO
left join ( left join (
select a.SETTLE_DOMAIN_CODE, 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 from mvp_social.t_social_fund_info a
where a.SOCIAL_STATUS in ('3', '4', '9', '12') where a.SOCIAL_STATUS in ('3', '4', '9', '12')
and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0 and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0
...@@ -286,7 +287,7 @@ ...@@ -286,7 +287,7 @@
) so on so.SETTLE_DOMAIN_CODE = a.DEPART_NO ) so on so.SETTLE_DOMAIN_CODE = a.DEPART_NO
left join ( left join (
select a.SETTLE_DOMAIN_CODE, 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 from mvp_social.t_social_fund_info a
where a.fund_STATUS in ('3', '8') where a.fund_STATUS in ('3', '8')
and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0 and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0
...@@ -294,19 +295,20 @@ ...@@ -294,19 +295,20 @@
) fu on fu.SETTLE_DOMAIN_CODE = a.DEPART_NO ) fu on fu.SETTLE_DOMAIN_CODE = a.DEPART_NO
left join ( left join (
select a.DEPT_NO, 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 from mvp_insurances.t_insurance_detail a
where a.IS_USE = 0 where a.IS_USE = 0
and IS_EFFECT = 0 and IS_EFFECT = 0
and a.IS_OVERDUE = 0 and a.IS_OVERDUE = 0
and a.DELETE_FLAG = 0
and length(ifnull(a.DEPT_NO, 0)) > 0 and length(ifnull(a.DEPT_NO, 0)) > 0
group by a.DEPT_NO group by a.DEPT_NO
) sx on a.DEPART_NO = sx.DEPT_NO ) sx on a.DEPART_NO = sx.DEPT_NO
left join ( 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 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 where lll.id in
(select b.id (select b.id
from ( from (
...@@ -326,16 +328,18 @@ ...@@ -326,16 +328,18 @@
( (
select a.DEPT_NO, select a.DEPT_NO,
a.EMP_IDCARD, a.EMP_IDCARD,
count(a.EMP_IDCARD) countPer count(DISTINCT a.EMP_IDCARD) countPer
from t_employee_project a from t_employee_project a
where a.PROJECT_STATUS = 0 where a.PROJECT_STATUS = 0
and a.DELETE_FLAG = '0'
group by a.DEPT_NO) pro on a.DEPART_NO = pro.DEPT_NO group by a.DEPT_NO) pro on a.DEPART_NO = pro.DEPT_NO
left join (select a.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 from t_employee_contract_info a
where a.IN_USE = '0' where a.IN_USE = '0'
and CONTRACT_END >= CURDATE() and CONTRACT_END >= CURDATE()
and a.DELETE_FLAG = 0
and length(ifnull(a.DEPT_NO, 0)) > 0 and length(ifnull(a.DEPT_NO, 0)) > 0
and EXISTS( and EXISTS(
select 1 select 1
...@@ -348,7 +352,7 @@ ...@@ -348,7 +352,7 @@
left join left join
( (
select a.SETTLE_DOMAIN_CODE, select a.SETTLE_DOMAIN_CODE,
count(a.EMP_IDCARD) onSocialNum count(DISTINCT a.EMP_IDCARD) onSocialNum
from mvp_social.t_social_fund_info a from mvp_social.t_social_fund_info a
where a.SOCIAL_STATUS in ('3', '4', '9', '12') where a.SOCIAL_STATUS in ('3', '4', '9', '12')
and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0 and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0
...@@ -364,7 +368,7 @@ ...@@ -364,7 +368,7 @@
left join left join
( (
select a.SETTLE_DOMAIN_CODE, select a.SETTLE_DOMAIN_CODE,
count(a.EMP_IDCARD) onFundNum count(DISTINCT a.EMP_IDCARD) onFundNum
from mvp_social.t_social_fund_info a from mvp_social.t_social_fund_info a
where a.fund_STATUS in ('3', '8') where a.fund_STATUS in ('3', '8')
and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0 and length(ifnull(a.SETTLE_DOMAIN_CODE, 0)) > 0
...@@ -380,11 +384,12 @@ ...@@ -380,11 +384,12 @@
left join left join
( (
select a.DEPT_NO, select a.DEPT_NO,
count(a.EMP_IDCARD_NO) onInsuranceNum count(DISTINCT a.EMP_IDCARD_NO) onInsuranceNum
from mvp_insurances.t_insurance_detail a from mvp_insurances.t_insurance_detail a
where a.IS_USE = 0 where a.IS_USE = 0
and IS_EFFECT = 0 and IS_EFFECT = 0
and a.IS_OVERDUE = 0 and a.IS_OVERDUE = 0
and a.DELETE_FLAG = 0
and length(ifnull(a.DEPT_NO, 0)) > 0 and length(ifnull(a.DEPT_NO, 0)) > 0
and EXISTS( and EXISTS(
select 1 select 1
...@@ -397,9 +402,9 @@ ...@@ -397,9 +402,9 @@
) r on a.DEPART_NO = r.DEPT_NO ) r on a.DEPART_NO = r.DEPT_NO
left join 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 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 where lll.id in
(select b.id (select b.id
from ( from (
...@@ -440,4 +445,9 @@ ...@@ -440,4 +445,9 @@
${tRiskMonitor.authSql} ${tRiskMonitor.authSql}
</if> </if>
</select> </select>
<!--删除所有监控数据-->
<update id="deleteAllRiskMonitorInfo">
TRUNCATE t_risk_monitor
</update>
</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