|
|
@@ -64,6 +64,12 @@ public class XjbJfServ extends Serv {
|
|
|
return Math.min(TOTAL_BONUS_CAP, safeOtherBonus + safeTeamBonus);
|
|
|
}
|
|
|
|
|
|
+ public static String schoolYearCode(YearMonth month) {
|
|
|
+ int startYear = month.getMonthValue() >= 9
|
|
|
+ ? month.getYear() : month.getYear() - 1;
|
|
|
+ return startYear + "-" + (startYear + 1);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 为当前班主任的指定班级重建一个月的事件账本。
|
|
|
*/
|
|
|
@@ -274,6 +280,9 @@ public class XjbJfServ extends Serv {
|
|
|
private int insertOrdinaryTeamMembers(Db db, long bjid, YearMonth month,
|
|
|
UserRunB user, Timestamp syncTime)
|
|
|
throws Exception {
|
|
|
+ Timestamp start = Timestamp.valueOf(month.atDay(1).atStartOfDay());
|
|
|
+ Timestamp end = Timestamp.valueOf(month.plusMonths(1).atDay(1)
|
|
|
+ .atStartOfDay());
|
|
|
SqlCmd sqlc = new SqlCmd(
|
|
|
"select c.TTCYID ID,c.RYID,wc.TTWCYLBM LYLB,wc.MC LBMC,"
|
|
|
+ "wc.BJJF JFZ,t.MC TTMC,r.XM RYXM"
|
|
|
@@ -288,12 +297,24 @@ public class XjbJfServ extends Serv {
|
|
|
+ " where bc.BJID=:bjid and bc." + ObjC.JLZT_useStr
|
|
|
+ " and nvl(bc.SFBY,0)=0 and c." + ObjC.JLZT_useStr
|
|
|
+ " and t." + ObjC.JLZT_useStr
|
|
|
+ + " and (c.KSRQ is null or c.KSRQ<:cEnd)"
|
|
|
+ + " and (c.JSRQ is null or c.JSRQ>=:cStart)"
|
|
|
+ + " and (t.KSRQ is null or t.KSRQ<:tEnd)"
|
|
|
+ + " and (t.JSRQ is null or t.JSRQ>=:tStart)"
|
|
|
+ + " and (c.XNDM is null or c.XNDM=:cXndm)"
|
|
|
+ + " and (t.XNDM is null or t.XNDM=:tXndm)"
|
|
|
+ " and nvl(wc.BJJF,0)>0"
|
|
|
+ " and not exists (select 1 from TTWCY w"
|
|
|
+ " where w.TTID=c.TTID and w.RYID=c.RYID"
|
|
|
+ " and w." + ObjC.JLZT_useStr + ")"
|
|
|
+ " order by c.TTCYID");
|
|
|
sqlc.wrLongParm("bjid", bjid);
|
|
|
+ sqlc.wrTimeParm("cStart", start);
|
|
|
+ sqlc.wrTimeParm("cEnd", end);
|
|
|
+ sqlc.wrStrParm("cXndm", schoolYearCode(month));
|
|
|
+ sqlc.wrTimeParm("tStart", start);
|
|
|
+ sqlc.wrTimeParm("tEnd", end);
|
|
|
+ sqlc.wrStrParm("tXndm", schoolYearCode(month));
|
|
|
List<Map<String, Object>> rows = db.doSelMapListByC(sqlc);
|
|
|
int count = 0;
|
|
|
for (Map<String, Object> row : rows) {
|
|
|
@@ -354,6 +375,9 @@ public class XjbJfServ extends Serv {
|
|
|
|
|
|
private int insertTeamRoles(Db db, long bjid, YearMonth month,
|
|
|
UserRunB user) throws Exception {
|
|
|
+ Timestamp start = Timestamp.valueOf(month.atDay(1).atStartOfDay());
|
|
|
+ Timestamp end = Timestamp.valueOf(month.plusMonths(1).atDay(1)
|
|
|
+ .atStartOfDay());
|
|
|
SqlCmd sqlc = new SqlCmd(
|
|
|
"select w.TTWCYID ID,w.RYID,w.TTWCYLBM LYLB,"
|
|
|
+ "wc.MC LBMC,wc.BJJF JFZ,t.MC TTMC,r.XM RYXM"
|
|
|
@@ -364,10 +388,22 @@ public class XjbJfServ extends Serv {
|
|
|
+ " where bc.BJID=:bjid and bc." + ObjC.JLZT_useStr
|
|
|
+ " and nvl(bc.SFBY,0)=0 and w." + ObjC.JLZT_useStr
|
|
|
+ " and t." + ObjC.JLZT_useStr
|
|
|
+ + " and (w.KSRQ is null or w.KSRQ<:wEnd)"
|
|
|
+ + " and (w.JSRQ is null or w.JSRQ>=:wStart)"
|
|
|
+ + " and (t.KSRQ is null or t.KSRQ<:tEnd)"
|
|
|
+ + " and (t.JSRQ is null or t.JSRQ>=:tStart)"
|
|
|
+ + " and (w.XNDM is null or w.XNDM=:wXndm)"
|
|
|
+ + " and (t.XNDM is null or t.XNDM=:tXndm)"
|
|
|
+ " and nvl(wc.BJJF,0)>0"
|
|
|
+ " and wc.MC not like '%退休%'"
|
|
|
+ " order by w.TTWCYID");
|
|
|
sqlc.wrLongParm("bjid", bjid);
|
|
|
+ sqlc.wrTimeParm("wStart", start);
|
|
|
+ sqlc.wrTimeParm("wEnd", end);
|
|
|
+ sqlc.wrStrParm("wXndm", schoolYearCode(month));
|
|
|
+ sqlc.wrTimeParm("tStart", start);
|
|
|
+ sqlc.wrTimeParm("tEnd", end);
|
|
|
+ sqlc.wrStrParm("tXndm", schoolYearCode(month));
|
|
|
List<Map<String, Object>> rows = db.doSelMapListByC(sqlc);
|
|
|
Timestamp syncTime = Timestamp.valueOf(
|
|
|
LocalDate.now(CN_ZONE).atStartOfDay());
|