|
@@ -437,6 +437,66 @@ public class TableServiceCmdService {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ * 功能描述: 获取单表单所有数据
|
|
|
+ *
|
|
|
+ * @param dto condition
|
|
|
+ * @return com.boman.domain.dto.AjaxResult
|
|
|
+ */
|
|
|
+ public AjaxResult getBusinessCandidators(FormDataDto dto) {
|
|
|
+ String tableName = dto.getTableName();
|
|
|
+ GenTable genTable = getTableFromRedisByTableName(RedisKey.TABLE_INFO, tableName);
|
|
|
+ List<GenTableColumn> columns = genTable.getColumns();
|
|
|
+
|
|
|
+ JSONObject jsonObject = selectService.selectById(tableName, IdUtils.getPkName(genTable.getColumns()), dto.getId(), dto.getOther());
|
|
|
+ String candidator = "";
|
|
|
+ String candidatorDepart = "";
|
|
|
+ for (GenTableColumn column : columns) {
|
|
|
+ String columnName = column.getColumnName();
|
|
|
+ if(columnName.equals("check_user_id")) {
|
|
|
+ candidator = jsonObject.getString(column.getColumnName());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if(columnName.equals("check_group_id")) {
|
|
|
+ candidatorDepart = jsonObject.getString(column.getColumnName());
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ if(StringUtils.isEmpty(candidator) && StringUtils.isEmpty(candidatorDepart)) {
|
|
|
+ return AjaxResult.error(-1, "没有候选人或者组!");
|
|
|
+ }
|
|
|
+ int type = 0;
|
|
|
+ List<Long> ids = new ArrayList<>();
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(candidator)) {
|
|
|
+ type = 1;
|
|
|
+ String[] idArrs = candidator.split(",");
|
|
|
+ for(String idArr : idArrs) {
|
|
|
+ ids.add(Long.valueOf(idArr));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if(StringUtils.isNotEmpty(candidatorDepart)) {
|
|
|
+ type = 2;
|
|
|
+ String[] idArrs = candidatorDepart.split(",");
|
|
|
+ for(String idArr : idArrs) {
|
|
|
+ ids.add(Long.valueOf(idArr));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ List<JSONObject> jsonObjects = null;
|
|
|
+ if(type == 1) {
|
|
|
+ jsonObjects = selectService.selectCandidatorsById("sys_user", IdUtils.getPkName(genTable.getColumns()), ids, type);
|
|
|
+ }
|
|
|
+ JSONObject result = new JSONObject();
|
|
|
+ if( jsonObjects == null) {
|
|
|
+ return AjaxResult.error(-1, "没有候选人或组!");
|
|
|
+ }
|
|
|
+ result.put("approvers", jsonObjects);
|
|
|
+ return new AjaxResult(1, 0, "", result);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
|
|
|
* 判断hr字段里面是否有值
|
|
|
*
|