|
|
@@ -17,6 +17,7 @@ import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.logging.log4j.LogManager;
|
|
|
import org.apache.logging.log4j.Logger;
|
|
|
import com.google.gson.Gson;
|
|
|
+import com.google.gson.reflect.TypeToken;
|
|
|
|
|
|
import biz.kq.KqC;
|
|
|
import biz.rc.RcC;
|
|
|
@@ -25,6 +26,8 @@ import biz.ry.RyC;
|
|
|
import base.po.BjdmPo;
|
|
|
import base.po.KqjlPo;
|
|
|
import base.po.KcbPo;
|
|
|
+import base.po.KtjlPo;
|
|
|
+import base.po.KtjlmxPo;
|
|
|
import base.po.ZwbPo;
|
|
|
|
|
|
import ss.AppB;
|
|
|
@@ -872,6 +875,453 @@ public class RjkcbHomepServ extends Serv {
|
|
|
super.wrJsonByResp(result);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 加载结构化课堂考核。
|
|
|
+ *
|
|
|
+ * 原有 JXRZ 课堂日志接口继续保留;本接口供新版小程序和星级班使用。
|
|
|
+ */
|
|
|
+ @SuppressWarnings("unused")
|
|
|
+ public void loadMpKtjlByA() {
|
|
|
+ HttpServletRequest request = super.req;
|
|
|
+ Map<String, Object> result = new LinkedHashMap<>();
|
|
|
+ Long userId = UserU.rdUserIdByReq(request);
|
|
|
+ String kcbidStr = request.getParameter("kcbid");
|
|
|
+ if (userId == null) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", "登录状态已失效,请重新登录");
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(kcbidStr)) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", "缺少课程ID");
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ try (Db gdba = Db.makeConn()) {
|
|
|
+ long kcbid = Long.parseLong(kcbidStr);
|
|
|
+ Map<String, Object> course = selMpJxrzCourse(gdba, kcbid, userId);
|
|
|
+ if (course == null) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", "无权访问该课程或课程不存在");
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ KcbPo kcb = rdKcbPo(gdba, kcbid);
|
|
|
+ long savedKcbid = rdKtjlSavedKcbid(course, kcbid);
|
|
|
+ long bjid = Long.parseLong(String.valueOf(course.get("bjid")));
|
|
|
+ course.put("classList", rdKtjlClassList(
|
|
|
+ gdba, rdKtjlClassIds(gdba, kcb)));
|
|
|
+ Map<String, Object> record = rdKtjlRecord(gdba, savedKcbid, bjid);
|
|
|
+ List<Map<String, Object>> items = rdKtjlItems(gdba);
|
|
|
+ Map<Integer, Integer> itemScores = rdKtjlItemScores(gdba,
|
|
|
+ record == null ? 0L : rdLongValue(record.get("ktjlid")));
|
|
|
+ for (Map<String, Object> item : items) {
|
|
|
+ int code = rdIntValue(item.get("ktjlxmm"), 0);
|
|
|
+ int fs = itemScores.containsKey(code)
|
|
|
+ ? itemScores.get(code)
|
|
|
+ : rdIntValue(item.get("mfz"), 0);
|
|
|
+ item.put("fs", fs);
|
|
|
+ }
|
|
|
+
|
|
|
+ boolean editable = isKtjlEditable(kcb, record != null);
|
|
|
+ result.put("ok", true);
|
|
|
+ result.put("course", course);
|
|
|
+ result.put("items", items);
|
|
|
+ result.put("record", record == null ? Map.of("exists", false)
|
|
|
+ : withKtjlExists(record));
|
|
|
+ result.put("editable", editable);
|
|
|
+ result.put("maxLength", 80);
|
|
|
+ } catch (Exception e) {
|
|
|
+ log4j.error("RjkcbHomepServ.loadMpKtjlByA() 异常", e);
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", "课堂考核加载失败");
|
|
|
+ }
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 保存结构化课堂考核。
|
|
|
+ *
|
|
|
+ * 合班课程按班级分别写一条 KTJL;连堂课程复用同一套记录。
|
|
|
+ * KTJL 保存成功后同步维护 JXRZ,兼容旧课堂日志查询。
|
|
|
+ */
|
|
|
+ @SuppressWarnings("unused")
|
|
|
+ public void saveMpKtjlByA() {
|
|
|
+ HttpServletRequest request = super.req;
|
|
|
+ Map<String, Object> result = new LinkedHashMap<>();
|
|
|
+ UserRunB user = UserU.rdUserByReq(request);
|
|
|
+ String kcbidStr = request.getParameter("kcbid");
|
|
|
+ String content = StringUtils.trimToEmpty(request.getParameter("mswj"));
|
|
|
+ String remark = StringUtils.trimToEmpty(request.getParameter("ms"));
|
|
|
+ Long fjid = rdNullableLong(request.getParameter("fjid"));
|
|
|
+
|
|
|
+ if (user == null) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", "登录状态已失效,请重新登录");
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(kcbidStr)) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", "缺少课程ID");
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (StringUtils.isBlank(content)) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", "请填写课堂日志");
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if (content.getBytes(StandardCharsets.UTF_8).length > 255) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", "课堂日志不能超过80个中文");
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ try (Db gdba = Db.makeConn()) {
|
|
|
+ long kcbid = Long.parseLong(kcbidStr);
|
|
|
+ Map<String, Object> course = selMpJxrzCourse(gdba, kcbid, user.ryid);
|
|
|
+ if (course == null) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", "无权保存该课程课堂考核或课程不存在");
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ KcbPo kcb = rdKcbPo(gdba, kcbid);
|
|
|
+ long savedKcbid = rdKtjlSavedKcbid(course, kcbid);
|
|
|
+ long selectedBjid = Long.parseLong(String.valueOf(course.get("bjid")));
|
|
|
+ Map<String, Object> existing = rdKtjlRecord(
|
|
|
+ gdba, savedKcbid, selectedBjid);
|
|
|
+ if (!isKtjlEditable(kcb, existing != null)) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", kcb.getKssj() != null
|
|
|
+ && kcb.getKssj().after(new Timestamp(
|
|
|
+ System.currentTimeMillis() + 600000L))
|
|
|
+ ? "课程尚未开始,不能录入课堂考核"
|
|
|
+ : "课程已结束,课堂考核只能查看");
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ List<Map<String, Object>> configs = rdKtjlItems(gdba);
|
|
|
+ if (configs.isEmpty())
|
|
|
+ throw new IllegalStateException("课堂记录项目尚未配置");
|
|
|
+
|
|
|
+ List<Map<String, String>> inputItems = new Gson().fromJson(
|
|
|
+ request.getParameter("items"),
|
|
|
+ new TypeToken<List<Map<String, String>>>() { }.getType());
|
|
|
+ Map<Integer, Integer> itemScores = rdAndCheckKtjlItemScores(
|
|
|
+ configs, inputItems);
|
|
|
+ int totalScore = 0;
|
|
|
+ for (int score : itemScores.values())
|
|
|
+ totalScore += score;
|
|
|
+ if (totalScore < 0 || totalScore > 100)
|
|
|
+ throw new IllegalArgumentException("课堂考核总分必须在0到100之间");
|
|
|
+
|
|
|
+ Set<Long> classIds = rdKtjlClassIds(gdba, kcb);
|
|
|
+ if (classIds.isEmpty())
|
|
|
+ throw new IllegalStateException("课程未关联有效班级");
|
|
|
+
|
|
|
+ long firstKtjlid = 0L;
|
|
|
+ for (long bjid : classIds) {
|
|
|
+ long ktjlid = saveKtjlRecord(gdba, savedKcbid, bjid,
|
|
|
+ totalScore, remark, content, fjid, user);
|
|
|
+ if (firstKtjlid == 0L)
|
|
|
+ firstKtjlid = ktjlid;
|
|
|
+ saveKtjlItems(gdba, ktjlid, itemScores, user);
|
|
|
+ }
|
|
|
+
|
|
|
+ upsertJxrz(gdba, savedKcbid, user.ryid, content);
|
|
|
+ gdba.commit();
|
|
|
+
|
|
|
+ result.put("ok", true);
|
|
|
+ result.put("msg", "保存成功");
|
|
|
+ result.put("ktjlid", firstKtjlid);
|
|
|
+ result.put("fs", totalScore);
|
|
|
+ result.put("bjidCount", classIds.size());
|
|
|
+ } catch (IllegalArgumentException e) {
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", e.getMessage());
|
|
|
+ } catch (Exception e) {
|
|
|
+ log4j.error("RjkcbHomepServ.saveMpKtjlByA() 异常", e);
|
|
|
+ result.put("ok", false);
|
|
|
+ result.put("msg", StringUtils.defaultIfBlank(
|
|
|
+ e.getMessage(), "课堂考核保存失败"));
|
|
|
+ }
|
|
|
+ super.wrJsonByResp(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ private KcbPo rdKcbPo(Db gdba, long kcbid) throws SQLException {
|
|
|
+ KcbPo kcb = new KcbPo();
|
|
|
+ kcb.setKcbid(kcbid);
|
|
|
+ gdba.doSelPoByPo(kcb, Set.of(
|
|
|
+ "kcbid", "sjkcbid", "bjid", "fzryid", "kssj", "jssj",
|
|
|
+ "sfhb", "ltjs", "jlztm"));
|
|
|
+ if (gdba.rowNum != 1)
|
|
|
+ throw new IllegalArgumentException("课程不存在");
|
|
|
+ return kcb;
|
|
|
+ }
|
|
|
+
|
|
|
+ private long rdKtjlSavedKcbid(Map<String, Object> course, long fallback) {
|
|
|
+ Object saved = course.get("sjkcbids");
|
|
|
+ return saved == null || StringUtils.isBlank(String.valueOf(saved))
|
|
|
+ ? fallback : Long.parseLong(String.valueOf(saved));
|
|
|
+ }
|
|
|
+
|
|
|
+ private boolean isKtjlEditable(KcbPo kcb, boolean hasRecord) {
|
|
|
+ if (kcb.getKssj() == null || kcb.getJssj() == null)
|
|
|
+ return false;
|
|
|
+ long now = System.currentTimeMillis();
|
|
|
+ if (kcb.getKssj().getTime() > now + 600000L)
|
|
|
+ return false;
|
|
|
+ if (hasRecord && kcb.getJssj().getTime() < now - 600000L)
|
|
|
+ return false;
|
|
|
+ return true;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<Map<String, Object>> rdKtjlItems(Db gdba)
|
|
|
+ throws SQLException {
|
|
|
+ SqlCmd cmd = new SqlCmd(
|
|
|
+ "select KTJLXMM,MC,MFZ,ZXZ from KTJLXM order by KTJLXMM");
|
|
|
+ List<Map<String, Object>> rows = gdba.doSelMapListByC(cmd);
|
|
|
+ return rows == null ? new ArrayList<>() : rows;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, Object> rdKtjlRecord(
|
|
|
+ Db gdba, long kcbid, long bjid) throws SQLException {
|
|
|
+ SqlCmd cmd = new SqlCmd(
|
|
|
+ "select * from ("
|
|
|
+ + " select KTJLID,FS,MS,MSWJ,FJID,JLSJ,JLZTM"
|
|
|
+ + " from KTJL where KCBID=:kcbid and BJID=:bjid"
|
|
|
+ + " and JLZTM=51 order by KTJLID desc"
|
|
|
+ + ") where rownum=1");
|
|
|
+ cmd.wrLongParm("kcbid", kcbid);
|
|
|
+ cmd.wrLongParm("bjid", bjid);
|
|
|
+ List<Map<String, Object>> rows = gdba.doSelMapListByC(cmd);
|
|
|
+ return rows == null || rows.isEmpty() ? null : rows.get(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<Integer, Integer> rdKtjlItemScores(
|
|
|
+ Db gdba, long ktjlid) throws SQLException {
|
|
|
+ Map<Integer, Integer> result = new HashMap<>();
|
|
|
+ if (ktjlid <= 0L)
|
|
|
+ return result;
|
|
|
+ SqlCmd cmd = new SqlCmd(
|
|
|
+ "select KTJLXMM,FS from KTJLMX"
|
|
|
+ + " where KTJLID=:ktjlid and JLZTM=51");
|
|
|
+ cmd.wrLongParm("ktjlid", ktjlid);
|
|
|
+ List<Map<String, Object>> rows = gdba.doSelMapListByC(cmd);
|
|
|
+ if (rows != null) {
|
|
|
+ for (Map<String, Object> row : rows)
|
|
|
+ result.put(rdIntValue(row.get("ktjlxmm"), 0),
|
|
|
+ rdIntValue(row.get("fs"), 0));
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<String, Object> withKtjlExists(Map<String, Object> record) {
|
|
|
+ Map<String, Object> result = new LinkedHashMap<>(record);
|
|
|
+ result.put("exists", true);
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Map<Integer, Integer> rdAndCheckKtjlItemScores(
|
|
|
+ List<Map<String, Object>> configs,
|
|
|
+ List<Map<String, String>> inputItems) {
|
|
|
+ if (inputItems == null || inputItems.isEmpty())
|
|
|
+ throw new IllegalArgumentException("请填写课堂考核项目");
|
|
|
+
|
|
|
+ Map<Integer, Integer> submitted = new HashMap<>();
|
|
|
+ for (Map<String, String> item : inputItems) {
|
|
|
+ int code = Integer.parseInt(item.get("ktjlxmm"));
|
|
|
+ if (submitted.containsKey(code))
|
|
|
+ throw new IllegalArgumentException("课堂考核项目重复");
|
|
|
+ submitted.put(code, Integer.parseInt(item.get("fs")));
|
|
|
+ }
|
|
|
+
|
|
|
+ Map<Integer, Integer> result = new LinkedHashMap<>();
|
|
|
+ for (Map<String, Object> config : configs) {
|
|
|
+ int code = rdIntValue(config.get("ktjlxmm"), 0);
|
|
|
+ if (!submitted.containsKey(code))
|
|
|
+ throw new IllegalArgumentException("课堂考核项目未填写完整");
|
|
|
+ int score = submitted.remove(code);
|
|
|
+ int min = rdIntValue(config.get("zxz"), 0);
|
|
|
+ int max = rdIntValue(config.get("mfz"), 0);
|
|
|
+ if (score < min || score > max)
|
|
|
+ throw new IllegalArgumentException("课堂考核项目超出分值范围:" + code);
|
|
|
+ result.put(code, score);
|
|
|
+ }
|
|
|
+ if (!submitted.isEmpty())
|
|
|
+ throw new IllegalArgumentException("存在无效课堂考核项目");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ private Set<Long> rdKtjlClassIds(Db gdba, KcbPo kcb)
|
|
|
+ throws SQLException {
|
|
|
+ if (kcb.getSfhb() != AppC.IF_true)
|
|
|
+ return Set.of(kcb.getBjid());
|
|
|
+
|
|
|
+ SqlCmd cmd = new SqlCmd(
|
|
|
+ "select distinct BJID from KCB"
|
|
|
+ + " where KSSJ=:kssj and JSSJ=:jssj and FZRYID=:fzryid"
|
|
|
+ + " and " + ObjC.JLZT_useStr);
|
|
|
+ cmd.wrTimeParm("kssj", kcb.getKssj());
|
|
|
+ cmd.wrTimeParm("jssj", kcb.getJssj());
|
|
|
+ cmd.wrLongParm("fzryid", kcb.getFzryid());
|
|
|
+ List<Object> rows = gdba.doSelListByC(cmd);
|
|
|
+ Set<Long> result = new HashSet<>();
|
|
|
+ if (rows != null) {
|
|
|
+ for (Object value : rows)
|
|
|
+ result.add(Long.parseLong(String.valueOf(value)));
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ private List<Map<String, Object>> rdKtjlClassList(
|
|
|
+ Db gdba, Set<Long> classIds) throws SQLException {
|
|
|
+ List<Map<String, Object>> result = new ArrayList<>();
|
|
|
+ for (long bjid : classIds) {
|
|
|
+ SqlCmd cmd = new SqlCmd(
|
|
|
+ "select BJID,MC from BJ where BJID=:bjid");
|
|
|
+ cmd.wrLongParm("bjid", bjid);
|
|
|
+ List<Map<String, Object>> rows = gdba.doSelMapListByC(cmd);
|
|
|
+ if (rows != null && !rows.isEmpty()) {
|
|
|
+ Map<String, Object> item = new LinkedHashMap<>();
|
|
|
+ item.put("bjid", rows.get(0).get("bjid"));
|
|
|
+ item.put("bjmc", rows.get(0).get("mc"));
|
|
|
+ result.add(item);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ result.sort((left, right) -> String.valueOf(left.get("bjmc"))
|
|
|
+ .compareTo(String.valueOf(right.get("bjmc"))));
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ private long saveKtjlRecord(Db gdba, long kcbid, long bjid,
|
|
|
+ int totalScore, String remark, String content,
|
|
|
+ Long fjid, UserRunB user) throws Exception {
|
|
|
+ SqlCmd find = new SqlCmd(
|
|
|
+ "select * from ("
|
|
|
+ + " select KTJLID from KTJL where KCBID=:kcbid and BJID=:bjid"
|
|
|
+ + " and JLZTM=51 order by KTJLID desc"
|
|
|
+ + ") where rownum=1");
|
|
|
+ find.wrLongParm("kcbid", kcbid);
|
|
|
+ find.wrLongParm("bjid", bjid);
|
|
|
+ List<Map<String, Object>> existingRows =
|
|
|
+ gdba.doSelMapListByC(find);
|
|
|
+ Long ktjlid = existingRows == null || existingRows.isEmpty()
|
|
|
+ ? null : rdLongValue(existingRows.get(0).get("ktjlid"));
|
|
|
+
|
|
|
+ if (ktjlid == null || ktjlid == 0L) {
|
|
|
+ KtjlPo po = new KtjlPo();
|
|
|
+ po.setKtjlid(gdba.rdNextSeqVal("KTJLID"));
|
|
|
+ po.setKcbid(kcbid);
|
|
|
+ po.setBjid(bjid);
|
|
|
+ po.setFs(totalScore);
|
|
|
+ po.setMs(remark);
|
|
|
+ po.setMswj(content);
|
|
|
+ po.setFjid(fjid);
|
|
|
+ po.setJlsj(new Timestamp(System.currentTimeMillis()));
|
|
|
+ po.setJlryid(user.ryid);
|
|
|
+ po.setCjryid(user.ryid);
|
|
|
+ po.setGlryid(user.ryid);
|
|
|
+ po.setGlbmid(user.bmid);
|
|
|
+ po.setJlztm(ObjC.JLZT_inUse);
|
|
|
+ return gdba.doInsPo(po, Set.of(
|
|
|
+ "ktjlid", "kcbid", "bjid", "fs", "ms", "mswj", "fjid",
|
|
|
+ "jlsj", "jlryid", "jlztm", "cjryid", "glryid", "glbmid"));
|
|
|
+ }
|
|
|
+
|
|
|
+ SqlCmd update = new SqlCmd(
|
|
|
+ "update KTJL set FS=:fs,MS=:ms,MSWJ=:mswj,FJID=:fjid,"
|
|
|
+ + "JLSJ=:jlsj,GLRYID=:glryid where KTJLID=:ktjlid"
|
|
|
+ + " and JLZTM=51");
|
|
|
+ update.wrIntParm("fs", totalScore);
|
|
|
+ update.wrStrParm("ms", remark);
|
|
|
+ update.wrStrParm("mswj", content);
|
|
|
+ update.wrLongParm("fjid", fjid);
|
|
|
+ update.wrTimeParm("jlsj", new Timestamp(System.currentTimeMillis()));
|
|
|
+ update.wrLongParm("glryid", user.ryid);
|
|
|
+ update.wrLongParm("ktjlid", ktjlid);
|
|
|
+ if (gdba.doModByC(update) != 1)
|
|
|
+ throw new IllegalStateException("课堂考核更新失败");
|
|
|
+ return ktjlid;
|
|
|
+ }
|
|
|
+
|
|
|
+ private void saveKtjlItems(Db gdba, long ktjlid,
|
|
|
+ Map<Integer, Integer> scores,
|
|
|
+ UserRunB user) throws Exception {
|
|
|
+ SqlCmd delete = new SqlCmd(
|
|
|
+ "delete from KTJLMX where KTJLID=:ktjlid");
|
|
|
+ delete.wrLongParm("ktjlid", ktjlid);
|
|
|
+ gdba.doModByC(delete);
|
|
|
+
|
|
|
+ for (Map.Entry<Integer, Integer> entry : scores.entrySet()) {
|
|
|
+ KtjlmxPo po = new KtjlmxPo();
|
|
|
+ po.setKtjlmxid(gdba.rdNextSeqVal("KTJLMXID"));
|
|
|
+ po.setKtjlid(ktjlid);
|
|
|
+ po.setKtjlxmm(entry.getKey());
|
|
|
+ po.setFs(entry.getValue());
|
|
|
+ po.setJlztm(ObjC.JLZT_inUse);
|
|
|
+ po.setCjryid(user.ryid);
|
|
|
+ po.setGlryid(user.ryid);
|
|
|
+ po.setGlbmid(user.bmid);
|
|
|
+ gdba.doInsPo(po, Set.of(
|
|
|
+ "ktjlmxid", "ktjlid", "ktjlxmm", "fs", "jlztm",
|
|
|
+ "cjryid", "glryid", "glbmid"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ private void upsertJxrz(Db gdba, long kcbid, long ryid,
|
|
|
+ String content) throws SQLException {
|
|
|
+ SqlCmd update = new SqlCmd(
|
|
|
+ "update JXRZ set MSWJ=:mswj,GLRYID=:glryid"
|
|
|
+ + " where RYID=:ryid and " + ObjC.JLZT_useStr
|
|
|
+ + " and KCBID=:kcbid");
|
|
|
+ update.wrStrParm("mswj", content);
|
|
|
+ update.wrLongParm("glryid", ryid);
|
|
|
+ update.wrLongParm("ryid", ryid);
|
|
|
+ update.wrLongParm("kcbid", kcbid);
|
|
|
+ if (gdba.doModByC(update) > 0)
|
|
|
+ return;
|
|
|
+
|
|
|
+ SqlCmd insert = new SqlCmd(
|
|
|
+ "insert into JXRZ"
|
|
|
+ + "(KCBID,RYID,MSWJ,JLZTM,CJRYID,GLRYID)"
|
|
|
+ + " values(:kcbid,:ryid,:mswj,:jlztm,:cjryid,:glryid)");
|
|
|
+ insert.wrLongParm("kcbid", kcbid);
|
|
|
+ insert.wrLongParm("ryid", ryid);
|
|
|
+ insert.wrStrParm("mswj", content);
|
|
|
+ insert.wrIntParm("jlztm", ObjC.JLZT_inUse);
|
|
|
+ insert.wrLongParm("cjryid", ryid);
|
|
|
+ insert.wrLongParm("glryid", ryid);
|
|
|
+ gdba.doModByC(insert);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Long rdNullableLong(Object value) {
|
|
|
+ if (value == null || StringUtils.isBlank(String.valueOf(value)))
|
|
|
+ return null;
|
|
|
+ return Long.parseLong(String.valueOf(value));
|
|
|
+ }
|
|
|
+
|
|
|
+ private int rdIntValue(Object value, int defaultValue) {
|
|
|
+ if (value == null || StringUtils.isBlank(String.valueOf(value)))
|
|
|
+ return defaultValue;
|
|
|
+ return Integer.parseInt(String.valueOf(value));
|
|
|
+ }
|
|
|
+
|
|
|
+ private long rdLongValue(Object value) {
|
|
|
+ if (value == null || StringUtils.isBlank(String.valueOf(value)))
|
|
|
+ return 0L;
|
|
|
+ return Long.parseLong(String.valueOf(value));
|
|
|
+ }
|
|
|
+
|
|
|
private Map<String, Object> selMpJxrzCourse(
|
|
|
Db gdba, long kcbid, long userId) throws SQLException {
|
|
|
SqlCmd cmd = new SqlCmd(
|