|
@@ -404,34 +404,38 @@ public class TableServiceCmdService {
|
|
|
if (!SubmitConstant.NOT_SUBMIT.equals(dbStatus)) {
|
|
|
commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.NOT_ALLOWED);
|
|
|
} else {
|
|
|
- commitDatum.put(SubmitConstant.SUBMIT_USERID, 123);
|
|
|
- commitDatum.put(SubmitConstant.SUBMIT_TIME, new Timestamp(System.currentTimeMillis()));
|
|
|
- int effective = submitService.handlerSubmit(tableName, pkName, commitDatum, commitDatum.getLong(FormDataConstant.ID));
|
|
|
- if (effective > 0) {
|
|
|
- commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.SUCCESS);
|
|
|
- } else {
|
|
|
- commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.FAIL);
|
|
|
- }
|
|
|
+ handlerSubmit(tableName, pkName, commitDatum);
|
|
|
}
|
|
|
} else {
|
|
|
// 只有在已提交的情况下才能反提交, 下面是不允许
|
|
|
if (!SubmitConstant.SUBMITTED.equals(dbStatus)) {
|
|
|
commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.NOT_ALLOWED);
|
|
|
} else {
|
|
|
- commitDatum.put(SubmitConstant.SUBMIT_USERID, 123);
|
|
|
- commitDatum.put(SubmitConstant.SUBMIT_TIME, new Timestamp(System.currentTimeMillis()));
|
|
|
- int effective = submitService.handlerSubmit(tableName, pkName, commitDatum, commitDatum.getLong(FormDataConstant.ID));
|
|
|
- if (effective > 0) {
|
|
|
- commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.SUCCESS);
|
|
|
- } else {
|
|
|
- commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.FAIL);
|
|
|
- }
|
|
|
+ handlerSubmit(tableName, pkName, commitDatum);
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
return AjaxResult.success(commitData);
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 功能描述: 处理提交和反提交
|
|
|
+ *
|
|
|
+ * @param tableName tableName
|
|
|
+ * @param pkName pkName
|
|
|
+ * @param commitDatum 返回给前台的数据
|
|
|
+ */
|
|
|
+ private void handlerSubmit(String tableName, String pkName, JSONObject commitDatum) {
|
|
|
+ commitDatum.put(SubmitConstant.SUBMIT_USERID, 123);
|
|
|
+ commitDatum.put(SubmitConstant.SUBMIT_TIME, new Timestamp(System.currentTimeMillis()));
|
|
|
+ int effective = submitService.handlerSubmit(tableName, pkName, commitDatum, commitDatum.getLong(FormDataConstant.ID));
|
|
|
+ if (effective > 0) {
|
|
|
+ commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.SUCCESS);
|
|
|
+ } else {
|
|
|
+ commitDatum.put(SubmitConstant.SUBMIT_RESULT, SubmitConstant.FAIL);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private String getStatusFromFormData(JSONObject next, List<JSONObject> commitData) {
|
|
|
for (JSONObject jsonObject : commitData) {
|
|
|
if (jsonObject.getLong(FormDataConstant.ID).equals(next.getLong(FormDataConstant.ID))) {
|