|
|
|
@ -1,16 +1,14 @@ |
|
|
|
package com.hxgk.lowcode.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.fastjson.JSONArray; |
|
|
|
import com.alibaba.fastjson.JSONObject; |
|
|
|
import com.fasterxml.jackson.core.JsonProcessingException; |
|
|
|
import com.fasterxml.jackson.core.type.TypeReference; |
|
|
|
import com.fasterxml.jackson.databind.JsonNode; |
|
|
|
import com.fasterxml.jackson.databind.ObjectMapper; |
|
|
|
import com.fasterxml.jackson.databind.node.ArrayNode; |
|
|
|
import com.fasterxml.jackson.databind.node.ObjectNode; |
|
|
|
import com.hxgk.lowcode.mapper.CustomerFormMapper; |
|
|
|
import com.hxgk.lowcode.mapper.CustomerFormViewMapper; |
|
|
|
import com.hxgk.lowcode.mapper.FieldRecordMapper; |
|
|
|
import com.hxgk.lowcode.model.entity.*; |
|
|
|
import com.hxgk.lowcode.service.CustomerFormService; |
|
|
|
import com.hxgk.lowcode.service.SystemRoleService; |
|
|
|
@ -38,6 +36,9 @@ public class CustomerFormServiceImpl implements CustomerFormService { |
|
|
|
private SystemRoleService systemRoleService; |
|
|
|
@Autowired |
|
|
|
private CustomerFormViewMapper customerFormViewMapper; |
|
|
|
@Autowired |
|
|
|
private FieldRecordMapper fieldRecordMapper; |
|
|
|
|
|
|
|
@Override |
|
|
|
//根据用户权限查询表单列表
|
|
|
|
public Tree getCustomerFormList(String key, String token) { |
|
|
|
@ -51,7 +52,9 @@ public class CustomerFormServiceImpl implements CustomerFormService { |
|
|
|
keytokenmap.put("userkey",key); |
|
|
|
keytokenmap.put("usertoken",token); |
|
|
|
UserDetail userDetail = userService.getUserDetailFromRedis(keytokenmap); |
|
|
|
|
|
|
|
if(userDetail==null){ |
|
|
|
return null; |
|
|
|
}else{ |
|
|
|
//得到所有启用的系统角色(state=1的)
|
|
|
|
ArrayList<SystemRole> roleList = systemRoleService.getAllRole(); |
|
|
|
|
|
|
|
@ -159,7 +162,22 @@ public class CustomerFormServiceImpl implements CustomerFormService { |
|
|
|
|
|
|
|
Tree tree1 = new Tree(); |
|
|
|
if(item.getClassify()==3){//app
|
|
|
|
/*String signCode = item.getSignCode(); |
|
|
|
//调用GO接口获取App结构,过滤掉非表单和目录的数据
|
|
|
|
//上线修改
|
|
|
|
String url = "http://172.20.2.87:7777/app/gainAppEditPsge";//本地+内网
|
|
|
|
//String url = "http://36.133.126.182:39250/app/gainAppEditPsge";//外网
|
|
|
|
|
|
|
|
JSONObject param = new JSONObject(); |
|
|
|
param.put("id", signCode); |
|
|
|
String post = null; |
|
|
|
|
|
|
|
try { |
|
|
|
post = HttpUtils.send(url, param, HTTP.UTF_8, key, token); |
|
|
|
System.out.println("post:"+post.toString()); |
|
|
|
} catch (IOException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
}*/ |
|
|
|
|
|
|
|
tree1.setId(item.getCfid()); |
|
|
|
tree1.setParentId(tree.getId()); |
|
|
|
@ -254,6 +272,8 @@ public class CustomerFormServiceImpl implements CustomerFormService { |
|
|
|
} |
|
|
|
tree.setChildren(treeArrayList1); |
|
|
|
return tree; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -490,7 +510,7 @@ public class CustomerFormServiceImpl implements CustomerFormService { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
@ -519,5 +539,30 @@ public class CustomerFormServiceImpl implements CustomerFormService { |
|
|
|
return tree; |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public ArrayList<CustomerFormTableSingleFieldValue> getFieldRecord(String key, String token, String[] optionsValue3FieldArray) {//CustomerFormTableSingleFieldValueList
|
|
|
|
ArrayList<CustomerFormTableSingleFieldValue> stringArrayList = new ArrayList<>(); |
|
|
|
if(!StringUtils.isBlank(key)&&!StringUtils.isBlank(token)){ |
|
|
|
if(optionsValue3FieldArray.length==3){//formField:102:input1717743396622",不涉及子表
|
|
|
|
String formId = optionsValue3FieldArray[1]; |
|
|
|
//根据formId(cfid)查询表名
|
|
|
|
String formName = customerFormViewMapper.getTableNameByCfid(formId).getTablekey(); |
|
|
|
|
|
|
|
String fieldKey = optionsValue3FieldArray[2]; |
|
|
|
stringArrayList = fieldRecordMapper.getFieldRecord(formName,fieldKey); |
|
|
|
}else if(optionsValue3FieldArray.length==4){//formField:5:table1718585442447:zhi2wu4",涉及到子表
|
|
|
|
String formId = optionsValue3FieldArray[1]; |
|
|
|
String tableKey = optionsValue3FieldArray[2]; |
|
|
|
String fieldKey = optionsValue3FieldArray[3]; |
|
|
|
stringArrayList = fieldRecordMapper.getFieldRecord(tableKey,fieldKey); |
|
|
|
} |
|
|
|
|
|
|
|
return stringArrayList; |
|
|
|
}else{ |
|
|
|
System.out.println("非法请求!请先登录!"); |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|