艾志优化,定时任务空则跳过

This commit is contained in:
Harryxzy 2024-01-03 09:52:29 +08:00
parent 41ef617c28
commit 3b2fb9bf4b
2 changed files with 22 additions and 20 deletions

View File

@ -122,7 +122,7 @@ public class AutoUpdateSchemeJob extends BaseCronJob {
paramList.add(InsuranceSchemeDetailUpdateParam.builder().primaryId(Long.valueOf(sbdqfa)).insuranceId(Long.valueOf(dbylId)).isPayment(1)
.paymentScope(jndx).fixedCost(String.valueOf(dbyly)).build());
}
sbzxIds.add(String.valueOf(sbdqfa));
sbzxIds.add(String.valueOf(id));
}
}
}

View File

@ -8,6 +8,7 @@ import com.engine.salary.util.SalaryDateUtil;
import com.engine.salary.util.SalaryEntityUtil;
import com.google.common.collect.Lists;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import weaver.conn.RecordSet;
@ -125,27 +126,28 @@ public class DepartureAnnualLeaveJob extends BaseCronJob {
Integer fieldValue = Integer.valueOf( baseBean.getPropValue("azgySalary", "lznjzsts_module_id"));
StringBuilder sqlSb = new StringBuilder(" insert into uf_lznjzsts (xzszy, ry, sjnjjs, sjyxnj, sjsynj, ynjjs, " +
"formmodeid, modedatacreater, modedatacreatertype, modedatacreatedate, modedatacreatetime) values");
for (BalanceOfLeaveDTO balanceOfLeave : balanceOfLeaveDTOMap.values()) {
sqlSb.append(" ('" + balanceOfLeave.getXzszy() + "'," + balanceOfLeave.getResourceId() + "," + balanceOfLeave.getBaseAmount() + "," +balanceOfLeave.getUsedAmount() + ","
+ (balanceOfLeave.getBaseAmount() - balanceOfLeave.getUsedAmount()) + "," + balanceOfLeave.getYnjjs() +
"," + fieldValue + ",1,0,'"+ currDate + "','" + currTime + "') ,");
}
sql = StringUtils.removeEnd(sqlSb.toString(), ",");
recordSet.execute(sql);
if (CollectionUtils.isNotEmpty(balanceOfLeaveDTOMap.values())) {
for (BalanceOfLeaveDTO balanceOfLeave : balanceOfLeaveDTOMap.values()) {
sqlSb.append(" ('" + balanceOfLeave.getXzszy() + "'," + balanceOfLeave.getResourceId() + "," + balanceOfLeave.getBaseAmount() + "," +balanceOfLeave.getUsedAmount() + ","
+ (balanceOfLeave.getBaseAmount() - balanceOfLeave.getUsedAmount()) + "," + balanceOfLeave.getYnjjs() +
"," + fieldValue + ",1,0,'"+ currDate + "','" + currTime + "') ,");
}
sql = StringUtils.removeEnd(sqlSb.toString(), ",");
recordSet.execute(sql);
// 权限重构
sql = "select max(id) as id from uf_lznjzsts";
recordSet.execute(sql);
int maxId = 0;
while (recordSet.next()) {
maxId = recordSet.getInt("id");
// 权限重构
sql = "select max(id) as id from uf_lznjzsts";
recordSet.execute(sql);
int maxId = 0;
while (recordSet.next()) {
maxId = recordSet.getInt("id");
}
for (int mainId = minId; mainId <= maxId; mainId++) {
ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true);
ModeRightInfo.editModeDataShare(1, fieldValue,mainId);
}
}
for (int mainId = minId; mainId <= maxId; mainId++) {
ModeRightInfo ModeRightInfo = new ModeRightInfo();
ModeRightInfo.setNewRight(true);
ModeRightInfo.editModeDataShare(1, fieldValue,mainId);
}
}
}