|
|
@ -2,46 +2,50 @@ package com.kms.warn; |
|
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.kms.build.domain.BsSgcJsjdBuiChange; |
|
|
|
import com.kms.build.domain.BsSgcJsjdBuiConstrMeas; |
|
|
|
import com.kms.build.domain.BsSgcJsjdBuiGzbzj; |
|
|
|
import com.kms.build.domain.BsSgcJsjdBuiSalaryEnsure; |
|
|
|
import com.kms.build.service.BsSgcJsjdBuiChangeService; |
|
|
|
import com.kms.build.service.BsSgcJsjdBuiConstrMeasService; |
|
|
|
import com.kms.build.service.BsSgcJsjdBuiSalaryEnsureService; |
|
|
|
import com.jianwei.common.utils.StringUtils; |
|
|
|
import com.kms.build.domain.*; |
|
|
|
import com.kms.build.service.*; |
|
|
|
import com.kms.warn.warnconfig.HolidayUtil; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.context.annotation.Configuration; |
|
|
|
import org.springframework.data.redis.core.RedisTemplate; |
|
|
|
import org.springframework.scheduling.annotation.Async; |
|
|
|
|
|
|
|
import java.lang.reflect.Array; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.nio.charset.StandardCharsets; |
|
|
|
import java.text.ParseException; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.util.ArrayList; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.time.Instant; |
|
|
|
import java.util.Calendar; |
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
@Async |
|
|
|
@Configuration |
|
|
|
public class WarningJudgment<T> { |
|
|
|
|
|
|
|
public static final String redisKey = "warn:queue"; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WarnOperate warnOperate; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
RedisTemplate redisTemplate; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
BsSgcJsjdBuiSalaryEnsureService bsSgcJsjdBuiSalaryEnsureService; |
|
|
|
@Autowired |
|
|
|
BsSgcJsjdBuiConstrMeasService bsSgcJsjdBuiConstrMeasService; |
|
|
|
@Autowired |
|
|
|
BsSgcJsjdBuiChangeService bsSgcJsjdBuiChangeService; |
|
|
|
@Autowired |
|
|
|
BsSgcJsjdBuiSubProjectQualityService bsSgcJsjdBuiSubProjectQualityService; |
|
|
|
@Autowired |
|
|
|
BsSgcJsjdBuiContInfoService bsSgcJsjdBuiContInfoService; |
|
|
|
|
|
|
|
/** |
|
|
|
* 农民工工资保证金预警 |
|
|
|
* @param |
|
|
|
* @param warnType |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public void salaryEnsureWarn(BsSgcJsjdBuiSalaryEnsure salaryEnsure, WarnType warnType){ |
|
|
|
public void salaryEnsureWarn(BsSgcJsjdBuiSalaryEnsure salaryEnsure){ |
|
|
|
WarnType warnType = WarnType.MARGIN_PAYMENT_TIME; |
|
|
|
String proCode = salaryEnsure.getProCode(); |
|
|
|
String proNo = salaryEnsure.getProNo(); |
|
|
|
BsSgcJsjdBuiConstrMeas one = bsSgcJsjdBuiConstrMeasService.getOne(Wrappers.lambdaQuery(BsSgcJsjdBuiConstrMeas.class) |
|
|
@ -63,9 +67,10 @@ public class WarningJudgment<T> { |
|
|
|
/** |
|
|
|
* 农名工工资保证金专用账户预警 |
|
|
|
* @param |
|
|
|
* @param warnType |
|
|
|
* @param |
|
|
|
*/ |
|
|
|
public void GzbzjWarn(BsSgcJsjdBuiGzbzj bsSgcJsjdBuiGzbzj, WarnType warnType){ |
|
|
|
public void GzbzjWarn(BsSgcJsjdBuiGzbzj bsSgcJsjdBuiGzbzj){ |
|
|
|
WarnType warnType = WarnType.MARGIN_PAYMENT_TIME; |
|
|
|
String proNo = bsSgcJsjdBuiGzbzj.getProNo(); |
|
|
|
String projectCode = bsSgcJsjdBuiGzbzj.getProjectCode(); |
|
|
|
String balance = bsSgcJsjdBuiGzbzj.getBalance(); |
|
|
@ -79,7 +84,8 @@ public class WarningJudgment<T> { |
|
|
|
/** |
|
|
|
* 标段变更预警 |
|
|
|
*/ |
|
|
|
public void ChangeWarn(BsSgcJsjdBuiChange bsSgcJsjdBuiChange,WarnType warnType){ |
|
|
|
public void ChangeWarn(BsSgcJsjdBuiChange bsSgcJsjdBuiChange){ |
|
|
|
WarnType warnType = WarnType.SECTION_CHANGES; |
|
|
|
String proCode = bsSgcJsjdBuiChange.getProCode(); |
|
|
|
String proNo = bsSgcJsjdBuiChange.getProNo(); |
|
|
|
QueryWrapper<BsSgcJsjdBuiChange> query = Wrappers.query(); |
|
|
@ -98,6 +104,40 @@ public class WarningJudgment<T> { |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* 检测结果合格率预警 |
|
|
|
*/ |
|
|
|
public void detectionWarn(BsSgcJsjdBuiSubProjectQuality bsSgcJsjdBuiSubProjectQuality){ |
|
|
|
WarnType warnType = WarnType.DETECTION_QUALIFICATION_RATE; |
|
|
|
String cellProjectRate = bsSgcJsjdBuiSubProjectQuality.getCellProjectRate(); |
|
|
|
String proNo = bsSgcJsjdBuiSubProjectQuality.getProNo(); |
|
|
|
String proCode = bsSgcJsjdBuiSubProjectQuality.getProCode(); |
|
|
|
if(StringUtils.isNotEmpty(cellProjectRate)){ |
|
|
|
Double aDouble = Double.valueOf(cellProjectRate); |
|
|
|
if(aDouble<90){ |
|
|
|
warnOperate.sendWarn(proNo,proCode,warnType, warnType.replaceString(warnType.getOtherResult(),cellProjectRate)); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* 合同超期预警 |
|
|
|
*/ |
|
|
|
public void exceedingWarn(BsSgcJsjdBuiContInfo bsSgcJsjdBuiContInfo){ |
|
|
|
WarnType exceedingContractPeriod = WarnType.EXCEEDING_CONTRACT_PERIOD; |
|
|
|
String contractDuration = bsSgcJsjdBuiContInfo.getContractDuration(); |
|
|
|
Integer integer = Integer.valueOf(contractDuration); //几月
|
|
|
|
|
|
|
|
Date commencementTime = bsSgcJsjdBuiContInfo.getCommencementTime(); |
|
|
|
Calendar instance = Calendar.getInstance(); |
|
|
|
instance.setTime(commencementTime); |
|
|
|
instance.add(Calendar.MONTH,integer); |
|
|
|
// redisTemplate.opsForZSet().add()
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|