|
|
@ -1,20 +1,26 @@ |
|
|
|
package com.jwtech.quartz.task; |
|
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil; |
|
|
|
import cn.hutool.core.util.ObjectUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.kms.build.domain.BsSgcJsjdBuiContInfo; |
|
|
|
import com.kms.build.domain.BsSgcJsjdBuiLegalEvaluate; |
|
|
|
import com.kms.build.domain.BsSgcJsjdBuiSafeFilings; |
|
|
|
import com.kms.build.domain.BsSgcjsjdBuiProInfo; |
|
|
|
import com.kms.build.mapper.BsSgcJsjdBuiContInfoMapper; |
|
|
|
import com.kms.build.mapper.BsSgcJsjdBuiLegalEvaluateMapper; |
|
|
|
import com.kms.build.mapper.BsSgcJsjdBuiSafeFilingsMapper; |
|
|
|
import com.kms.build.mapper.BsSgcjsjdBuiProInfoMapper; |
|
|
|
import com.kms.build.domain.*; |
|
|
|
import com.kms.build.mapper.*; |
|
|
|
import com.kms.build.service.*; |
|
|
|
import com.kms.common.utils.BaseEntityUtils; |
|
|
|
import com.kms.warn.WarnOperate; |
|
|
|
import com.kms.warn.WarnType; |
|
|
|
import com.kms.warn.mapper.BsSgcJsjdWarnResultMapper; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.scheduling.annotation.Scheduled; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
|
|
|
|
import java.lang.reflect.Field; |
|
|
|
import java.math.BigDecimal; |
|
|
|
import java.text.SimpleDateFormat; |
|
|
|
import java.time.LocalDate; |
|
|
|
import java.time.ZoneId; |
|
|
|
import java.util.Arrays; |
|
|
|
import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.UUID; |
|
|
|
|
|
|
@ -24,16 +30,40 @@ public class evaluateTask { |
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiLegalEvaluateMapper bsSgcJsjdBuiLegalEvaluateMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiLegalEvaluateService bsSgcJsjdBuiLegalEvaluateService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiContInfoMapper bsSgcJsjdBuiContInfoMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcjsjdBuiProInfoMapper bsSgcjsjdBuiProInfoMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiConstrMeasService bsSgcJsjdBuiConstrMeasService; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiSafeFilingsMapper bsSgcJsjdBuiSafeFilingsMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiProgressPlanMapper bsSgcJsjdBuiProgressPlanMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
WarnOperate warnOperate; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiGzbzjMapper bsSgcJsjdBuiGzbzjMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcJsjdBuiComAccMapper bsSgcJsjdBuiComAccMapper; |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private BsSgcjsjdBuiProInfoService bsSgcjsjdBuiProInfoService; |
|
|
|
|
|
|
|
|
|
|
|
// @Scheduled(cron = "0 1 0 * * ?") //每天0点1分执行
|
|
|
|
// @Scheduled(cron="0/2 * * * * ?") //每个2秒执行一次
|
|
|
|
//@Scheduled(cron = "0 0/2 * * * ?")
|
|
|
|
public void evaluate() { |
|
|
|
LocalDate date = LocalDate.now(); |
|
|
|
// System.out.println("当前日期为:"+date);
|
|
|
@ -49,14 +79,16 @@ public class evaluateTask { |
|
|
|
List<BsSgcJsjdBuiContInfo> contInfoList = bsSgcJsjdBuiContInfoMapper.selectList(queryWrapper); |
|
|
|
for (BsSgcJsjdBuiContInfo bsSgcJsjdBuiContInfo : contInfoList) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setId(UUID.randomUUID().toString()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiContInfo.getId()+monthValue); |
|
|
|
legalEvaluate.setContractNumber(bsSgcJsjdBuiContInfo.getContractNumber()); |
|
|
|
legalEvaluate.setContractName(bsSgcJsjdBuiContInfo.getContractName()); |
|
|
|
legalEvaluate.setProNo(bsSgcJsjdBuiContInfo.getProNo()); |
|
|
|
legalEvaluate.setProCode(bsSgcJsjdBuiContInfo.getProCode()); |
|
|
|
legalEvaluate.setLegalPerson(bsSgcJsjdBuiContInfo.getConstructionUnit()); |
|
|
|
legalEvaluate.setCycle(dayOfYear+"-"+01+"至"+dayOfYear+"-"+03); |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
BaseEntityUtils.preInsert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateMapper.insert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -67,14 +99,14 @@ public class evaluateTask { |
|
|
|
List<BsSgcJsjdBuiContInfo> contInfoList = bsSgcJsjdBuiContInfoMapper.selectList(queryWrapper); |
|
|
|
for (BsSgcJsjdBuiContInfo bsSgcJsjdBuiContInfo : contInfoList) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setId(UUID.randomUUID().toString()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiContInfo.getId()+monthValue); |
|
|
|
legalEvaluate.setContractNumber(bsSgcJsjdBuiContInfo.getContractNumber()); |
|
|
|
legalEvaluate.setContractName(bsSgcJsjdBuiContInfo.getContractName()); |
|
|
|
legalEvaluate.setLegalPerson(bsSgcJsjdBuiContInfo.getConstructionUnit()); |
|
|
|
legalEvaluate.setCycle(dayOfYear+"-"+04+"至"+dayOfYear+"-"+06); |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
BaseEntityUtils.preInsert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateMapper.insert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} |
|
|
|
} else if (monthValue == 7 && dayOfMonth == 1) { |
|
|
|
QueryWrapper<BsSgcJsjdBuiContInfo> queryWrapper = new QueryWrapper<>(); |
|
|
@ -83,14 +115,14 @@ public class evaluateTask { |
|
|
|
List<BsSgcJsjdBuiContInfo> contInfoList = bsSgcJsjdBuiContInfoMapper.selectList(queryWrapper); |
|
|
|
for (BsSgcJsjdBuiContInfo bsSgcJsjdBuiContInfo : contInfoList) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setId(UUID.randomUUID().toString()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiContInfo.getId()+monthValue); |
|
|
|
legalEvaluate.setContractNumber(bsSgcJsjdBuiContInfo.getContractNumber()); |
|
|
|
legalEvaluate.setContractName(bsSgcJsjdBuiContInfo.getContractName()); |
|
|
|
legalEvaluate.setLegalPerson(bsSgcJsjdBuiContInfo.getConstructionUnit()); |
|
|
|
legalEvaluate.setCycle(dayOfYear+"-"+07+"至"+dayOfYear+"-"+9); |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
BaseEntityUtils.preInsert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateMapper.insert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} |
|
|
|
} else if (monthValue ==10 && dayOfMonth == 1){ |
|
|
|
QueryWrapper<BsSgcJsjdBuiContInfo> queryWrapper = new QueryWrapper<>(); |
|
|
@ -99,14 +131,14 @@ public class evaluateTask { |
|
|
|
List<BsSgcJsjdBuiContInfo> contInfoList = bsSgcJsjdBuiContInfoMapper.selectList(queryWrapper); |
|
|
|
for (BsSgcJsjdBuiContInfo bsSgcJsjdBuiContInfo : contInfoList) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setId(UUID.randomUUID().toString()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiContInfo.getId()+monthValue); |
|
|
|
legalEvaluate.setContractNumber(bsSgcJsjdBuiContInfo.getContractNumber()); |
|
|
|
legalEvaluate.setContractName(bsSgcJsjdBuiContInfo.getContractName()); |
|
|
|
legalEvaluate.setLegalPerson(bsSgcJsjdBuiContInfo.getConstructionUnit()); |
|
|
|
legalEvaluate.setCycle(dayOfYear+"-"+10+"至"+dayOfYear+"-"+12); |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
BaseEntityUtils.preInsert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateMapper.insert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} |
|
|
|
}else { |
|
|
|
QueryWrapper<BsSgcJsjdBuiContInfo> queryWrapper = new QueryWrapper<>(); |
|
|
@ -115,23 +147,405 @@ public class evaluateTask { |
|
|
|
List<BsSgcJsjdBuiContInfo> contInfoList = bsSgcJsjdBuiContInfoMapper.selectList(queryWrapper); |
|
|
|
for (BsSgcJsjdBuiContInfo bsSgcJsjdBuiContInfo : contInfoList) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setId(UUID.randomUUID().toString()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiContInfo.getId()+monthValue); |
|
|
|
legalEvaluate.setContractNumber(bsSgcJsjdBuiContInfo.getContractNumber()); |
|
|
|
legalEvaluate.setContractName(bsSgcJsjdBuiContInfo.getContractName()); |
|
|
|
legalEvaluate.setLegalPerson(bsSgcJsjdBuiContInfo.getConstructionUnit()); |
|
|
|
legalEvaluate.setCycle(dayOfYear+"-"+10+"至"+dayOfYear+"-"+12); |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
BaseEntityUtils.preInsert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateMapper.insert(legalEvaluate); |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//项目法人履职评价
|
|
|
|
@Scheduled(cron = "0 0/2 * * * ?") //每天0点1分执行
|
|
|
|
public void proEvaluate(){ |
|
|
|
List<BsSgcJsjdBuiConstrMeas> list = bsSgcJsjdBuiConstrMeasService.list(null); |
|
|
|
LocalDate date = LocalDate.now(); |
|
|
|
int dayOfYear = date.getYear(); |
|
|
|
int monthValue = date.getMonthValue(); |
|
|
|
Date date1 = Date.from(date.atStartOfDay(ZoneId.systemDefault()).toInstant()); |
|
|
|
|
|
|
|
for (BsSgcJsjdBuiConstrMeas bsSgcJsjdBuiConstrMeas:list){ |
|
|
|
BsSgcjsjdBuiProInfo one = bsSgcjsjdBuiProInfoService.getOne(new QueryWrapper<BsSgcjsjdBuiProInfo>() |
|
|
|
.eq("PRO_NO", bsSgcJsjdBuiConstrMeas.getProNo()) |
|
|
|
.eq("PRO_CODE", bsSgcJsjdBuiConstrMeas.getProCode())); |
|
|
|
LocalDate localDate =null; |
|
|
|
if (ObjectUtil.isNotEmpty(one.getPlannedCompletionDate())){ |
|
|
|
localDate = one.getPlannedCompletionDate().toInstant().atZone(ZoneId.systemDefault()).toLocalDate();} |
|
|
|
if (ObjectUtil.isNotEmpty(bsSgcJsjdBuiConstrMeas.getApprovalTime1())&&ObjectUtil.isNotEmpty(one.getPlannedCompletionDate())){ |
|
|
|
Date approvalTime1 = bsSgcJsjdBuiConstrMeas.getApprovalTime1(); |
|
|
|
long l = DateUtil.betweenYear(approvalTime1, date1, true)+1; |
|
|
|
LocalDate approvalTime = approvalTime1.toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); |
|
|
|
int month = approvalTime.getMonthValue(); |
|
|
|
int year = approvalTime.getYear(); |
|
|
|
for (int i=0;i<l;i++){ |
|
|
|
if (i==0){ |
|
|
|
if (month<=3) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+1); |
|
|
|
legalEvaluate.setLegalPerson(one.getProjectUnitLegal()); |
|
|
|
legalEvaluate.setProNo(one.getProNo()); |
|
|
|
legalEvaluate.setProCode(one.getProCode()); |
|
|
|
legalEvaluate.setCycle(year + "-" + 1 + "至" + year + "-" + 3); |
|
|
|
BsSgcjsjdBuiProInfo byId = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+2); |
|
|
|
legalEvaluate.setCycle(year + "-" + 4 + "至" + year + "-" + 6); |
|
|
|
BsSgcjsjdBuiProInfo byId1 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId1)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+3); |
|
|
|
legalEvaluate.setCycle(year + "-" + 7 + "至" + year + "-" + 9); |
|
|
|
BsSgcjsjdBuiProInfo byId2 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId2)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+4); |
|
|
|
legalEvaluate.setCycle(year + "-" + 9 + "至" + year + "-" + 12); |
|
|
|
BsSgcjsjdBuiProInfo byId3 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId3)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
|
|
|
|
} else if (month<=6&&month>4) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setLegalPerson(one.getProjectUnitLegal()); |
|
|
|
legalEvaluate.setProNo(one.getProNo()); |
|
|
|
legalEvaluate.setProCode(one.getProCode()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+2); |
|
|
|
legalEvaluate.setCycle(year + "-" + 4 + "至" + year + "-" + 6); |
|
|
|
BsSgcjsjdBuiProInfo byId1 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId1)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+3); |
|
|
|
legalEvaluate.setCycle(year + "-" + 7 + "至" + year + "-" + 9); |
|
|
|
BsSgcjsjdBuiProInfo byId2 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId2)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+4); |
|
|
|
legalEvaluate.setCycle(year + "-" + 10 + "至" + year + "-" + 12); |
|
|
|
BsSgcjsjdBuiProInfo byId3 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId3)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} else if (month<=9&&month>6) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setLegalPerson(one.getProjectUnitLegal()); |
|
|
|
legalEvaluate.setProNo(one.getProNo()); |
|
|
|
legalEvaluate.setProCode(one.getProCode()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+3); |
|
|
|
legalEvaluate.setCycle(year + "-" + 7 + "至" + year + "-" + 9); |
|
|
|
BsSgcjsjdBuiProInfo byId2 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId2)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+4); |
|
|
|
legalEvaluate.setCycle(year + "-" + 10 + "至" + year + "-" + 12); |
|
|
|
BsSgcjsjdBuiProInfo byId3 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId3)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
}else { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setLegalPerson(one.getProjectUnitLegal()); |
|
|
|
legalEvaluate.setProNo(one.getProNo()); |
|
|
|
legalEvaluate.setProCode(one.getProCode()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+4); |
|
|
|
legalEvaluate.setCycle(year + "-" + 10 + "至" + year + "-" + 12); |
|
|
|
BsSgcjsjdBuiProInfo byId3 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId3)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} |
|
|
|
} else if (i==l){ |
|
|
|
if (monthValue<=3) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+1); |
|
|
|
legalEvaluate.setLegalPerson(one.getProjectUnitLegal()); |
|
|
|
legalEvaluate.setProNo(one.getProNo()); |
|
|
|
legalEvaluate.setProCode(one.getProCode()); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 1 + "至" + dayOfYear + "-" + 3); |
|
|
|
BsSgcjsjdBuiProInfo byId = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+2); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 4 + "至" + dayOfYear + "-" + 6); |
|
|
|
BsSgcjsjdBuiProInfo byId1 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId1)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+3); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 7 + "至" + dayOfYear + "-" + 9); |
|
|
|
BsSgcjsjdBuiProInfo byId2 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId2)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+4); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 10 + "至" + dayOfYear + "-" + 12); |
|
|
|
BsSgcjsjdBuiProInfo byId3 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId3)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
|
|
|
|
} else if (monthValue<=6&&monthValue>4) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setLegalPerson(one.getProjectUnitLegal()); |
|
|
|
legalEvaluate.setProNo(one.getProNo()); |
|
|
|
legalEvaluate.setProCode(one.getProCode()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+2); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 4 + "至" + dayOfYear + "-" + 6); |
|
|
|
BsSgcjsjdBuiProInfo byId1 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId1)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+3); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 7 + "至" + dayOfYear + "-" + 9); |
|
|
|
BsSgcjsjdBuiProInfo byId2 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId2)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+4); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 9 + "至" + dayOfYear + "-" + 12); |
|
|
|
BsSgcjsjdBuiProInfo byId3 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId3)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} else if (monthValue<=9&&monthValue>6) { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setLegalPerson(one.getProjectUnitLegal()); |
|
|
|
legalEvaluate.setProNo(one.getProNo()); |
|
|
|
legalEvaluate.setProCode(one.getProCode()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+3); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 7 + "至" + dayOfYear + "-" + 9); |
|
|
|
BsSgcjsjdBuiProInfo byId2 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId2)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
|
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+4); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 10 + "至" + dayOfYear + "-" + 12); |
|
|
|
BsSgcjsjdBuiProInfo byId3 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId3)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
}else { |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setLegalPerson(one.getProjectUnitLegal()); |
|
|
|
legalEvaluate.setProNo(one.getProNo()); |
|
|
|
legalEvaluate.setProCode(one.getProCode()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId() + i+4); |
|
|
|
legalEvaluate.setCycle(dayOfYear + "-" + 10 + "至" + dayOfYear + "-" + 12); |
|
|
|
BsSgcjsjdBuiProInfo byId3 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId3)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} |
|
|
|
}else { |
|
|
|
for (int j=1;j<=10;j=j+3){ |
|
|
|
BsSgcJsjdBuiLegalEvaluate legalEvaluate = new BsSgcJsjdBuiLegalEvaluate(); |
|
|
|
legalEvaluate.setLegalPerson(one.getProjectUnitLegal()); |
|
|
|
legalEvaluate.setProNo(one.getProNo()); |
|
|
|
legalEvaluate.setProCode(one.getProCode()); |
|
|
|
legalEvaluate.setId(bsSgcJsjdBuiConstrMeas.getId()+i+j); |
|
|
|
legalEvaluate.setCycle((year+i) + "-" + j + "至" + (year+i)+ "-" + (j+2)); |
|
|
|
BsSgcjsjdBuiProInfo byId3 = bsSgcjsjdBuiProInfoService.getById(legalEvaluate.getId()); |
|
|
|
if (ObjectUtil.isEmpty(byId3)){ |
|
|
|
legalEvaluate.setEvaluateStatus("0"); |
|
|
|
} |
|
|
|
bsSgcJsjdBuiLegalEvaluateService.saveOrUpdate(legalEvaluate); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//年度度汛方案未备案
|
|
|
|
@Scheduled(cron="0 0 0 15 4 ?") //每年4月15日秒执行一次
|
|
|
|
public void floodPlan(){ |
|
|
|
List<BsSgcjsjdBuiProInfo> bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.selectList(null); |
|
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
|
String year = String.valueOf(currentDate.getYear()); |
|
|
|
bsSgcjsjdBuiProInfos.forEach((BsSgcjsjdBuiProInfo item)->{ |
|
|
|
QueryWrapper<BsSgcJsjdBuiSafeFilings>qw=new QueryWrapper<>(); |
|
|
|
List<BsSgcJsjdBuiSafeFilings> bsSgcJsjdBuiSafeFilings = bsSgcJsjdBuiSafeFilingsMapper |
|
|
|
.selectList(qw.eq("pro_no",item.getProNo()) |
|
|
|
.eq("pro_code",item.getProCode()).eq("type","2")); |
|
|
|
boolean flag=false; |
|
|
|
for (BsSgcJsjdBuiSafeFilings buiSafeFilings:bsSgcJsjdBuiSafeFilings){ |
|
|
|
if (buiSafeFilings.getYear().equals(year)){ |
|
|
|
flag=true; |
|
|
|
} |
|
|
|
} |
|
|
|
WarnType warnType=WarnType.FLOOD_CONTROL; |
|
|
|
if (!flag){ |
|
|
|
warnOperate.sendWarn(item.getProNo(),item.getProCode(), |
|
|
|
warnType,warnType.replaceString(warnType.getWarnResult(),year)); |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
//累计应付金额实际实付不足85%
|
|
|
|
@Scheduled(cron = "0 0/2 * * * ?") |
|
|
|
public void projectNotPaidFull(){ |
|
|
|
List<BsSgcjsjdBuiProInfo> bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.selectList(null); |
|
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
|
// 获取当前年份
|
|
|
|
String year = String.valueOf(currentDate.getYear()); |
|
|
|
int monthValue = currentDate.getMonthValue(); |
|
|
|
bsSgcjsjdBuiProInfos.forEach((BsSgcjsjdBuiProInfo item)->{ |
|
|
|
QueryWrapper<BsSgcJsjdBuiProgressPlan>qw=new QueryWrapper<>(); |
|
|
|
List<BsSgcJsjdBuiProgressPlan> bsSgcJsjdBuiProgressPlans = bsSgcJsjdBuiProgressPlanMapper.selectList(qw.eq("pro_no", item.getProNo()) |
|
|
|
.eq("pro_code", item.getProCode())); |
|
|
|
BigDecimal AccountPayable=BigDecimal.ZERO; |
|
|
|
BigDecimal ActualAmountPaid=BigDecimal.ZERO; |
|
|
|
for (BsSgcJsjdBuiProgressPlan bsSgcJsjdBuiProgressPlan:bsSgcJsjdBuiProgressPlans){ |
|
|
|
Field[] fields = bsSgcJsjdBuiProgressPlan.getClass().getDeclaredFields(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
|
|
|
String planYear = sdf.format(bsSgcJsjdBuiProgressPlan.getPlanYear()); |
|
|
|
if (planYear.equals(year)){ |
|
|
|
for (int num=1;num<monthValue;num++){ |
|
|
|
for (Field field : fields) { |
|
|
|
field.setAccessible(true); |
|
|
|
try { |
|
|
|
if (ObjectUtil.isNotEmpty(field.get(bsSgcJsjdBuiProgressPlan))&&field.getName().equals("p"+num)){ |
|
|
|
AccountPayable=AccountPayable.add((BigDecimal) field.get(bsSgcJsjdBuiProgressPlan)); |
|
|
|
} |
|
|
|
if (ObjectUtil.isNotEmpty(field.get(bsSgcJsjdBuiProgressPlan))&&field.getName().equals("v"+num)){ |
|
|
|
ActualAmountPaid=ActualAmountPaid.add((BigDecimal) field.get(bsSgcJsjdBuiProgressPlan)); |
|
|
|
} |
|
|
|
} catch (IllegalAccessException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (ActualAmountPaid.compareTo(AccountPayable.multiply(new BigDecimal("0.85")))<0){ |
|
|
|
WarnType warnType=WarnType.CUMULATIVE_ENGINEERING; |
|
|
|
warnOperate.sendWarn(item.getProNo(),item.getProCode(),warnType,warnType.getWarnResult()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}; |
|
|
|
|
|
|
|
//超额支付
|
|
|
|
@Scheduled(cron = "0 0/2 * * * ?") |
|
|
|
public void overpayment(){ |
|
|
|
List<BsSgcjsjdBuiProInfo> bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.selectList(null); |
|
|
|
LocalDate currentDate = LocalDate.now(); |
|
|
|
// 获取当前年份
|
|
|
|
String year = String.valueOf(currentDate.getYear()); |
|
|
|
int monthValue = currentDate.getMonthValue(); |
|
|
|
bsSgcjsjdBuiProInfos.forEach((BsSgcjsjdBuiProInfo item)->{ |
|
|
|
QueryWrapper<BsSgcJsjdBuiProgressPlan>qw=new QueryWrapper<>(); |
|
|
|
List<BsSgcJsjdBuiProgressPlan> bsSgcJsjdBuiProgressPlans = bsSgcJsjdBuiProgressPlanMapper.selectList(qw.eq("pro_no", item.getProNo()) |
|
|
|
.eq("pro_code", item.getProCode())); |
|
|
|
BigDecimal AccountPayable=BigDecimal.ZERO; |
|
|
|
BigDecimal ActualAmountPaid=BigDecimal.ZERO; |
|
|
|
for (BsSgcJsjdBuiProgressPlan bsSgcJsjdBuiProgressPlan:bsSgcJsjdBuiProgressPlans){ |
|
|
|
Field[] fields = bsSgcJsjdBuiProgressPlan.getClass().getDeclaredFields(); |
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy"); |
|
|
|
String planYear = sdf.format(bsSgcJsjdBuiProgressPlan.getPlanYear()); |
|
|
|
if (planYear.equals(year)){ |
|
|
|
for (int num=1;num<monthValue;num++){ |
|
|
|
for (Field field : fields) { |
|
|
|
field.setAccessible(true); |
|
|
|
try { |
|
|
|
if (ObjectUtil.isNotEmpty(field.get(bsSgcJsjdBuiProgressPlan))&&field.getName().equals("p"+num)){ |
|
|
|
AccountPayable=AccountPayable.add((BigDecimal) field.get(bsSgcJsjdBuiProgressPlan)); |
|
|
|
} |
|
|
|
if (ObjectUtil.isNotEmpty(field.get(bsSgcJsjdBuiProgressPlan))&&field.getName().equals("v"+num)){ |
|
|
|
ActualAmountPaid=ActualAmountPaid.add((BigDecimal) field.get(bsSgcJsjdBuiProgressPlan)); |
|
|
|
} |
|
|
|
} catch (IllegalAccessException e) { |
|
|
|
throw new RuntimeException(e); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
if (ActualAmountPaid.compareTo(AccountPayable)>0){ |
|
|
|
WarnType warnType=WarnType.AMOUNT_PAID; |
|
|
|
warnOperate.sendWarn(item.getProNo(),item.getProCode(),warnType,warnType.getWarnResult()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
//大于60天未创建农民工账号
|
|
|
|
@Scheduled(cron = "0 0/2 * * * ?") |
|
|
|
public void accountDistributionManagement(){ |
|
|
|
List<BsSgcjsjdBuiProInfo> bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.selectList(null); |
|
|
|
Date date=new Date(); |
|
|
|
bsSgcjsjdBuiProInfos.forEach((BsSgcjsjdBuiProInfo item)->{ |
|
|
|
if (ObjectUtil.isNotEmpty(item.getCommencementDate())){ |
|
|
|
int day = (int) DateUtil.betweenDay(date, item.getCommencementDate(), true); |
|
|
|
if (day>60){ |
|
|
|
QueryWrapper<BsSgcJsjdBuiGzbzj>qw=new QueryWrapper<>(); |
|
|
|
List<BsSgcJsjdBuiGzbzj> bsSgcJsjdBuiGzbzjs = bsSgcJsjdBuiGzbzjMapper.selectList(qw.eq("PRO_NO", item.getProNo())); |
|
|
|
if (ObjectUtil.isEmpty(bsSgcJsjdBuiGzbzjs)){ |
|
|
|
WarnType warnType=WarnType.PEASANT_WAGES_SIXTY_DAYS; |
|
|
|
warnOperate.sendWarn(item.getProNo(),item.getProCode(),warnType,warnType.getWarnResult()); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
// @Scheduled(cron = "0 0/2 * * * ?")
|
|
|
|
// public void stageAcceptanceLag(){
|
|
|
|
// List<BsSgcjsjdBuiProInfo> bsSgcjsjdBuiProInfos = bsSgcjsjdBuiProInfoMapper.selectList(null);
|
|
|
|
// bsSgcjsjdBuiProInfos.forEach((BsSgcjsjdBuiProInfo item)->{
|
|
|
|
// if (ObjectUtil.isNotEmpty(item.getPlannedCompletionDate())){
|
|
|
|
//
|
|
|
|
// }
|
|
|
|
//
|
|
|
|
// });
|
|
|
|
// }
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|