|
|
@@ -263,9 +263,7 @@ public class WebClientRest {
|
|
|
result = false;
|
|
|
} else {
|
|
|
byte[] bytes = userSet.getPao(0).getBytes("password");
|
|
|
- System.out.println(new MessageDigestCust().Digest(P2Server.getP2Server().getP2Cipher().decData(bytes)));
|
|
|
- result = password
|
|
|
- .equals(new MessageDigestCust().Digest(P2Server.getP2Server().getP2Cipher().decData(bytes)));
|
|
|
+ result = password.equals(new MessageDigestCust().Digest(P2Server.getP2Server().getP2Cipher().decData(bytes)));
|
|
|
}
|
|
|
} catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
@@ -338,25 +336,25 @@ public class WebClientRest {
|
|
|
|
|
|
mobject.put(moduleid, rows_appid.toJsonArray("appid"));
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "ok");
|
|
|
object.put("token", token);
|
|
|
JSONObject dataobject = new JSONObject();
|
|
|
- if(fusertype.equals("服务人员")) {
|
|
|
- Rows rows_worker=connect.runSqlQuery(
|
|
|
+ if (fusertype.equals("服务人员")) {
|
|
|
+ Rows rows_worker = connect.runSqlQuery(
|
|
|
"select role from hyworker where fisused=1 and hyworkernum='"
|
|
|
- + username +"'");
|
|
|
- if(!rows_worker.isEmpty()) {
|
|
|
- if( rows_worker.get(0).getString("role")!=null && rows_worker.get(0).getString("role").length()>0 && rows_worker.get(0).getString("role").equals("服务主管")) {
|
|
|
- dataobject.put("fusertype_role", rows_worker.get(0).getString("role"));
|
|
|
- }else {
|
|
|
- dataobject.put("fusertype_role", "服务人员");
|
|
|
- }
|
|
|
-
|
|
|
- }else {
|
|
|
- dataobject.put("fusertype_role", "服务人员");
|
|
|
- }
|
|
|
+ + username + "'");
|
|
|
+ if (!rows_worker.isEmpty()) {
|
|
|
+ if (rows_worker.get(0).getString("role") != null && rows_worker.get(0).getString("role").length() > 0 && rows_worker.get(0).getString("role").equals("服务主管")) {
|
|
|
+ dataobject.put("fusertype_role", rows_worker.get(0).getString("role"));
|
|
|
+ } else {
|
|
|
+ dataobject.put("fusertype_role", "服务人员");
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ dataobject.put("fusertype_role", "服务人员");
|
|
|
+ }
|
|
|
}
|
|
|
dataobject.put("fusertype", fusertype);
|
|
|
dataobject.put("fisservice", fisservice);
|
|
|
@@ -391,7 +389,7 @@ public class WebClientRest {
|
|
|
/**
|
|
|
* 验证请求正文中是否包含必填的键值
|
|
|
*/
|
|
|
- String[] mustkeys = { "classname", "method", "content"};
|
|
|
+ String[] mustkeys = {"classname", "method", "content"};
|
|
|
for (String mustkey : mustkeys) {
|
|
|
if (!requestcontent.containsKey(mustkey)) {
|
|
|
return ErrModel.request_ContainsMustKey(mustkey).toString();
|
|
|
@@ -408,7 +406,6 @@ public class WebClientRest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
String result;
|
|
|
String className = requestcontent.getString("classname");
|
|
|
String methodName = requestcontent.getString("method");
|
|
|
@@ -599,7 +596,9 @@ public class WebClientRest {
|
|
|
object.put("data", dataobject);
|
|
|
return object.toString();
|
|
|
}
|
|
|
- public static boolean FISUPLOADFOROBS=true;
|
|
|
+
|
|
|
+ public static boolean FISUPLOADFOROBS = true;
|
|
|
+
|
|
|
@Path("uploaddoc")
|
|
|
@POST
|
|
|
@Consumes({"multipart/form-data"})
|
|
|
@@ -612,7 +611,7 @@ public class WebClientRest {
|
|
|
/**
|
|
|
* 验证正文中的token是否有效
|
|
|
*/
|
|
|
- try{
|
|
|
+ try {
|
|
|
/**
|
|
|
* 验证正文中的token是否有效
|
|
|
*/
|
|
|
@@ -622,18 +621,18 @@ public class WebClientRest {
|
|
|
return ErrModel.token_Validate().toString();
|
|
|
}
|
|
|
docManage docManage = new docManage();
|
|
|
- String result=null;
|
|
|
- Set set=new HashSet();
|
|
|
- set.addAll(Arrays.asList("ordernode","hyordernode","hyworkorder","afterserviceorder","hyconfirmationorder"));
|
|
|
- if(set.contains(ownertable.toLowerCase())&&FISUPLOADFOROBS){
|
|
|
- result = docManage.upLoadDocForOBS(uploadfileInputStream, uploadfile, ownertable, ownerid, hrid, description, "",type);
|
|
|
- }else{
|
|
|
+ String result = null;
|
|
|
+ Set set = new HashSet();
|
|
|
+ set.addAll(Arrays.asList("ordernode", "hyordernode", "hyworkorder", "afterserviceorder", "hyconfirmationorder"));
|
|
|
+ if (set.contains(ownertable.toLowerCase()) && FISUPLOADFOROBS) {
|
|
|
+ result = docManage.upLoadDocForOBS(uploadfileInputStream, uploadfile, ownertable, ownerid, hrid, description, "", type);
|
|
|
+ } else {
|
|
|
result = docManage.upLoadDoc(uploadfileInputStream, uploadfile, ownertable, ownerid, hrid, description, "");
|
|
|
}
|
|
|
|
|
|
return result;
|
|
|
- }catch (Exception e){
|
|
|
- JSONObject returnObject=new JSONObject();
|
|
|
+ } catch (Exception e) {
|
|
|
+ JSONObject returnObject = new JSONObject();
|
|
|
returnObject.put("msg", "失败");
|
|
|
returnObject.put("code", 0);
|
|
|
returnObject.put("errcode", 0);
|
|
|
@@ -716,8 +715,8 @@ public class WebClientRest {
|
|
|
// 请求来源
|
|
|
String from_account = requestcontent.getString("from_account");
|
|
|
//如果from_account为1 ,则是前端web登录
|
|
|
- String usertype=null;
|
|
|
- if(from_account.equals("1")){
|
|
|
+ String usertype = null;
|
|
|
+ if (from_account.equals("1")) {
|
|
|
boolean result = true;
|
|
|
PaoSetRemote userSet = null;
|
|
|
try {
|
|
|
@@ -733,7 +732,7 @@ public class WebClientRest {
|
|
|
return object.toString();
|
|
|
|
|
|
} else {
|
|
|
- usertype=userSet.getPao(0).getString("FUSERTYPE");
|
|
|
+ usertype = userSet.getPao(0).getString("FUSERTYPE");
|
|
|
byte[] bytes = userSet.getPao(0).getBytes("password");
|
|
|
result = password
|
|
|
.equals(P2Server.getP2Server().getP2Cipher().decData(bytes));
|
|
|
@@ -768,11 +767,11 @@ public class WebClientRest {
|
|
|
}
|
|
|
DBConnect connect = new DBConnect();
|
|
|
// System.out.println("usertype:"+usertype);
|
|
|
- if(usertype.equals("经销商主账号")){//如果类型是经销商主账号
|
|
|
+ if (usertype.equals("经销商主账号")) {//如果类型是经销商主账号
|
|
|
// DBConnect connect = new DBConnect("DRP");
|
|
|
Rows rows = connect.runSqlQuery(
|
|
|
"select t1.fagentnum,t.defsite as siteid,t.hrid,t1.FAGENTSHORTNAME,t1.fisservice from pp_users t join TAGENTs t1 on t.hrid=t1.fagentnum " +
|
|
|
- "where t.hrid='"+username+"' and t.status='ACTIVE' and t1.fisservice=1");
|
|
|
+ "where t.hrid='" + username + "' and t.status='ACTIVE' and t1.fisservice=1");
|
|
|
if (rows.isEmpty()) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "error");
|
|
|
@@ -780,14 +779,14 @@ public class WebClientRest {
|
|
|
object.put("msg", "该帐号无登录权限!");
|
|
|
return object.toString();
|
|
|
}
|
|
|
- String fagentnum=rows.get(0).getString("fagentnum");
|
|
|
- String siteid=rows.get(0).getString("siteid");
|
|
|
- String fagentshortname=rows.get(0).getString("FAGENTSHORTNAME");
|
|
|
- boolean fisservice=rows.get(0).getBoolean("fisservice");
|
|
|
- Rows staffauthority = connect.runSqlQuery("select authoritymodule,authorityname from staffauthority where siteid='"+siteid+"' order by frownum");
|
|
|
- List list=new ArrayList();
|
|
|
+ String fagentnum = rows.get(0).getString("fagentnum");
|
|
|
+ String siteid = rows.get(0).getString("siteid");
|
|
|
+ String fagentshortname = rows.get(0).getString("FAGENTSHORTNAME");
|
|
|
+ boolean fisservice = rows.get(0).getBoolean("fisservice");
|
|
|
+ Rows staffauthority = connect.runSqlQuery("select authoritymodule,authorityname from staffauthority where siteid='" + siteid + "' order by frownum");
|
|
|
+ List list = new ArrayList();
|
|
|
for (Row row : staffauthority) {
|
|
|
- list.add(row.getString("authoritymodule")+"_edit");
|
|
|
+ list.add(row.getString("authoritymodule") + "_edit");
|
|
|
}
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "ok");
|
|
|
@@ -802,44 +801,43 @@ public class WebClientRest {
|
|
|
dataobject.put("fisservice", fisservice);
|
|
|
object.put("data", dataobject);
|
|
|
return object.toString();
|
|
|
- }else if(usertype.equals("经销商员工账号")){//如果类型是经销商员工账号
|
|
|
+ } else if (usertype.equals("经销商员工账号")) {//如果类型是经销商员工账号
|
|
|
Rows rows = connect.runSqlQuery(
|
|
|
"select t1.fisused,t1.fagentnum,t.defsite as siteid,t.hrid,t1.staffid,t1.fname,'0' fisservice from pp_users t join staff t1 on t1.phone=t.hrid and t1.siteid=t.defsite " +
|
|
|
- "where t.hrid='"+username+"' and t.status='ACTIVE'");
|
|
|
+ "where t.hrid='" + username + "' and t.status='ACTIVE'");
|
|
|
if (rows.isEmpty()) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "error");
|
|
|
object.put("errcode", ErrCode.gettokenfail[0]);
|
|
|
object.put("msg", "该帐号无登录权限!");
|
|
|
return object.toString();
|
|
|
- }else {
|
|
|
- if(!rows.get(0).getBoolean("fisused")){
|
|
|
- JSONObject object = new JSONObject();
|
|
|
- object.put("status", "error");
|
|
|
- object.put("errcode", ErrCode.gettokenfail[0]);
|
|
|
- object.put("msg", "该帐号没有启用!");
|
|
|
- return object.toString();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- String fagentnum=rows.get(0).getString("fagentnum");
|
|
|
- String siteid=rows.get(0).getString("siteid");
|
|
|
- String fname=rows.get(0).getString("fname");
|
|
|
- boolean fisservice=rows.get(0).getBoolean("fisservice");
|
|
|
- int staffid=rows.get(0).getInteger("staffid");
|
|
|
+ } else {
|
|
|
+ if (!rows.get(0).getBoolean("fisused")) {
|
|
|
+ JSONObject object = new JSONObject();
|
|
|
+ object.put("status", "error");
|
|
|
+ object.put("errcode", ErrCode.gettokenfail[0]);
|
|
|
+ object.put("msg", "该帐号没有启用!");
|
|
|
+ return object.toString();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ String fagentnum = rows.get(0).getString("fagentnum");
|
|
|
+ String siteid = rows.get(0).getString("siteid");
|
|
|
+ String fname = rows.get(0).getString("fname");
|
|
|
+ boolean fisservice = rows.get(0).getBoolean("fisservice");
|
|
|
+ int staffid = rows.get(0).getInteger("staffid");
|
|
|
|
|
|
Rows staffauthority = connect.runSqlQuery("select t.authoritymodule,t.authorityname,t.fisedit,t.fisquery from\n" +
|
|
|
" staff_authority t\n" +
|
|
|
- " join staffauthority t1 on t.authoritymodule=t1.authoritymodule and t1.siteid='"+siteid+"'\n" +
|
|
|
- "where fparentid="+staffid+" order by t1.frownum");
|
|
|
+ " join staffauthority t1 on t.authoritymodule=t1.authoritymodule and t1.siteid='" + siteid + "'\n" +
|
|
|
+ "where fparentid=" + staffid + " order by t1.frownum");
|
|
|
|
|
|
|
|
|
- List list=new ArrayList();
|
|
|
+ List list = new ArrayList();
|
|
|
for (Row row : staffauthority) {
|
|
|
- if(row.getBoolean("fisedit")){
|
|
|
- list.add(row.getString("authoritymodule")+"_edit");
|
|
|
- }
|
|
|
- else if(row.getBoolean("fisquery")){
|
|
|
+ if (row.getBoolean("fisedit")) {
|
|
|
+ list.add(row.getString("authoritymodule") + "_edit");
|
|
|
+ } else if (row.getBoolean("fisquery")) {
|
|
|
list.add(row.getString("authoritymodule"));
|
|
|
}
|
|
|
}
|
|
|
@@ -857,20 +855,20 @@ public class WebClientRest {
|
|
|
dataobject.put("fisservice", fisservice);
|
|
|
object.put("data", dataobject);
|
|
|
return object.toString();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "error");
|
|
|
object.put("errcode", ErrCode.gettokenfail[0]);
|
|
|
object.put("msg", "该帐号无登录权限!");
|
|
|
return object.toString();
|
|
|
}
|
|
|
- }else if(from_account.equals("2")){//小程序登录
|
|
|
+ } else if (from_account.equals("2")) {//小程序登录
|
|
|
DBConnect connect = new DBConnect();
|
|
|
Rows rows = connect.runSqlQuery("select t.fagentnum,t.workphone,t.siteid,t.role,t.password from worker t " +
|
|
|
"where fisused=1 and workphone='" + username + "' and t.role in ('服务组长','验收组长')");
|
|
|
- if(!rows.isEmpty()){
|
|
|
+ if (!rows.isEmpty()) {
|
|
|
String realpassword = rows.get(0).getString("password");
|
|
|
- if(!realpassword.equals(password)){
|
|
|
+ if (!realpassword.equals(password)) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "error");
|
|
|
object.put("errcode", ErrCode.gettokenfail[0]);
|
|
|
@@ -888,9 +886,9 @@ public class WebClientRest {
|
|
|
parameter.tokenlist.add(token);
|
|
|
|
|
|
|
|
|
- String fagentnum=rows.get(0).getString("fagentnum");
|
|
|
- String siteid=rows.get(0).getString("siteid");
|
|
|
- String role=rows.get(0).getString("role");
|
|
|
+ String fagentnum = rows.get(0).getString("fagentnum");
|
|
|
+ String siteid = rows.get(0).getString("siteid");
|
|
|
+ String role = rows.get(0).getString("role");
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "ok");
|
|
|
object.put("token", token);
|
|
|
@@ -903,14 +901,14 @@ public class WebClientRest {
|
|
|
object.put("data", dataobject);
|
|
|
return object.toString();
|
|
|
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "error");
|
|
|
object.put("errcode", ErrCode.gettokenfail[0]);
|
|
|
object.put("msg", "该帐号无登录权限!");
|
|
|
return object.toString();
|
|
|
}
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "error");
|
|
|
object.put("errcode", ErrCode.gettokenfail[0]);
|
|
|
@@ -920,21 +918,22 @@ public class WebClientRest {
|
|
|
}
|
|
|
|
|
|
|
|
|
- public static final String FILE_PATH=P2Server.getP2Server().getConfig().getProperty("p2.attachment.defaultpath");
|
|
|
- public static final String FILE_URL="http://drp.idcgroup.com.cn:8082/samex/rest/webclientrest/download?docinfoid=";
|
|
|
+ public static final String FILE_PATH = P2Server.getP2Server().getConfig().getProperty("p2.attachment.defaultpath");
|
|
|
+ public static final String FILE_URL = "http://drp.idcgroup.com.cn:8082/samex/rest/webclientrest/download?docinfoid=";
|
|
|
+
|
|
|
@Path("download")
|
|
|
@GET
|
|
|
- public void download(@QueryParam("docinfoid") String docinfoid,@Context HttpServletResponse response){
|
|
|
+ public void download(@QueryParam("docinfoid") String docinfoid, @Context HttpServletResponse response) {
|
|
|
|
|
|
- int id=Integer.valueOf(docinfoid);
|
|
|
+ int id = Integer.valueOf(docinfoid);
|
|
|
response.reset();
|
|
|
|
|
|
- File file=null;
|
|
|
+ File file = null;
|
|
|
try {
|
|
|
PaoSetRemote docinfos = P2Server.getP2Server().getPaoSet("docinfo", P2Server.getP2Server().getSystemUserInfo());
|
|
|
- docinfos.setWhere("docinfoid="+Long.valueOf(id));
|
|
|
+ docinfos.setWhere("docinfoid=" + Long.valueOf(id));
|
|
|
docinfos.reset();
|
|
|
- if(!docinfos.isEmpty()){
|
|
|
+ if (!docinfos.isEmpty()) {
|
|
|
|
|
|
PaoRemote docinfo = docinfos.getPao(0);
|
|
|
String siteid = docinfo.getString("siteid");
|
|
|
@@ -942,22 +941,22 @@ public class WebClientRest {
|
|
|
String document = docinfo.getString("document");
|
|
|
String ownertables = docinfo.getString("ownertable");
|
|
|
String postfix = docinfo.getString("postfix");
|
|
|
- if(postfix.equalsIgnoreCase("pdf")){
|
|
|
+ if (postfix.equalsIgnoreCase("pdf")) {
|
|
|
response.setContentType("application/pdf");
|
|
|
- response.setHeader("Content-Disposition", "attachment;fileName="+ URLEncoder.encode(document,"UTF-8"));
|
|
|
- }else if(postfix.equalsIgnoreCase("jpg")||
|
|
|
- postfix.equalsIgnoreCase("png")||
|
|
|
+ response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(document, "UTF-8"));
|
|
|
+ } else if (postfix.equalsIgnoreCase("jpg") ||
|
|
|
+ postfix.equalsIgnoreCase("png") ||
|
|
|
postfix.equalsIgnoreCase("jpeg")
|
|
|
- ){
|
|
|
+ ) {
|
|
|
response.setContentType("image/png");
|
|
|
- }else if(postfix.equalsIgnoreCase("mp4")){
|
|
|
+ } else if (postfix.equalsIgnoreCase("mp4")) {
|
|
|
response.setContentType("video/mpeg4");
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
response.setContentType("multipart/form-data");
|
|
|
- response.setHeader("Content-Disposition", "attachment;fileName="+ URLEncoder.encode(document,"UTF-8"));
|
|
|
+ response.setHeader("Content-Disposition", "attachment;fileName=" + URLEncoder.encode(document, "UTF-8"));
|
|
|
}
|
|
|
|
|
|
- file = new File( FILE_PATH +"\\"+siteid+"\\"+ownertables+"\\"+serialnumber);
|
|
|
+ file = new File(FILE_PATH + "\\" + siteid + "\\" + ownertables + "\\" + serialnumber);
|
|
|
|
|
|
}
|
|
|
|
|
|
@@ -966,21 +965,21 @@ public class WebClientRest {
|
|
|
}
|
|
|
ServletOutputStream out;
|
|
|
try {
|
|
|
- if(file!=null){
|
|
|
+ if (file != null) {
|
|
|
FileInputStream inputStream = new FileInputStream(file);
|
|
|
//3.通过response获取ServletOutputStream对象(out)
|
|
|
out = response.getOutputStream();
|
|
|
int b = 0;
|
|
|
byte[] buffer = new byte[512];
|
|
|
- while (b != -1){
|
|
|
+ while (b != -1) {
|
|
|
b = inputStream.read(buffer);
|
|
|
//4.写到输出流(out)中
|
|
|
- out.write(buffer,0,b);
|
|
|
+ out.write(buffer, 0, b);
|
|
|
}
|
|
|
inputStream.close();
|
|
|
out.close();
|
|
|
out.flush();
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
out = response.getOutputStream();
|
|
|
out.write("null".getBytes());
|
|
|
out.close();
|
|
|
@@ -1004,17 +1003,17 @@ public class WebClientRest {
|
|
|
return ErrModel.request_BasicJsonFormat().toString();
|
|
|
}
|
|
|
String username = requestcontent.getString("username");
|
|
|
- DBConnect dbConnect=new DBConnect();
|
|
|
+ DBConnect dbConnect = new DBConnect();
|
|
|
Rows rows = dbConnect.runSqlQuery("select fusertype,defsite from pp_users where hrid='" + username + "' and status='ACTIVE'");
|
|
|
- if(!rows.isEmpty()){
|
|
|
+ if (!rows.isEmpty()) {
|
|
|
Row row_detail = rows.get(0);
|
|
|
String fusertype = row_detail.getString("fusertype");
|
|
|
String defsite = row_detail.getString("defsite");
|
|
|
- if(fusertype.equals("经销商主账号")){
|
|
|
- Rows staffauthority = dbConnect.runSqlQuery("select authoritymodule,authorityname from staffauthority where siteid='"+defsite+"' order by frownum");
|
|
|
- List list=new ArrayList();
|
|
|
+ if (fusertype.equals("经销商主账号")) {
|
|
|
+ Rows staffauthority = dbConnect.runSqlQuery("select authoritymodule,authorityname from staffauthority where siteid='" + defsite + "' order by frownum");
|
|
|
+ List list = new ArrayList();
|
|
|
for (Row row : staffauthority) {
|
|
|
- list.add(row.getString("authoritymodule")+"_edit");
|
|
|
+ list.add(row.getString("authoritymodule") + "_edit");
|
|
|
}
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "ok");
|
|
|
@@ -1023,10 +1022,10 @@ public class WebClientRest {
|
|
|
object.put("data", dataobject);
|
|
|
return object.toString();
|
|
|
|
|
|
- }else if(fusertype.equals("经销商员工账号")){
|
|
|
+ } else if (fusertype.equals("经销商员工账号")) {
|
|
|
Rows rows1 = dbConnect.runSqlQuery(
|
|
|
"select t1.fagentnum,t.defsite as siteid,t.hrid,t1.staffid,t1.fname,'0' fisservice from pp_users t join staff t1 on t1.phone=t.hrid " +
|
|
|
- "where t.hrid='"+username+"' and t.status='ACTIVE'");
|
|
|
+ "where t.hrid='" + username + "' and t.status='ACTIVE'");
|
|
|
if (rows1.isEmpty()) {
|
|
|
JSONObject object = new JSONObject();
|
|
|
object.put("status", "error");
|
|
|
@@ -1035,24 +1034,23 @@ public class WebClientRest {
|
|
|
return object.toString();
|
|
|
}
|
|
|
|
|
|
- String fagentnum=rows1.get(0).getString("fagentnum");
|
|
|
- String siteid=rows1.get(0).getString("siteid");
|
|
|
- String fname=rows1.get(0).getString("fname");
|
|
|
- boolean fisservice=rows1.get(0).getBoolean("fisservice");
|
|
|
- int staffid=rows1.get(0).getInteger("staffid");
|
|
|
+ String fagentnum = rows1.get(0).getString("fagentnum");
|
|
|
+ String siteid = rows1.get(0).getString("siteid");
|
|
|
+ String fname = rows1.get(0).getString("fname");
|
|
|
+ boolean fisservice = rows1.get(0).getBoolean("fisservice");
|
|
|
+ int staffid = rows1.get(0).getInteger("staffid");
|
|
|
|
|
|
Rows staffauthority = dbConnect.runSqlQuery("select t.authoritymodule,t.authorityname,t.fisedit,t.fisquery from\n" +
|
|
|
" staff_authority t\n" +
|
|
|
- " join staffauthority t1 on t.authoritymodule=t1.authoritymodule and t1.siteid='"+siteid+"'\n" +
|
|
|
- "where fparentid="+staffid+" order by t1.frownum");
|
|
|
+ " join staffauthority t1 on t.authoritymodule=t1.authoritymodule and t1.siteid='" + siteid + "'\n" +
|
|
|
+ "where fparentid=" + staffid + " order by t1.frownum");
|
|
|
|
|
|
|
|
|
- List list=new ArrayList();
|
|
|
+ List list = new ArrayList();
|
|
|
for (Row row : staffauthority) {
|
|
|
- if(row.getBoolean("fisedit")){
|
|
|
- list.add(row.getString("authoritymodule")+"_edit");
|
|
|
- }
|
|
|
- else if(row.getBoolean("fisquery")){
|
|
|
+ if (row.getBoolean("fisedit")) {
|
|
|
+ list.add(row.getString("authoritymodule") + "_edit");
|
|
|
+ } else if (row.getBoolean("fisquery")) {
|
|
|
list.add(row.getString("authoritymodule"));
|
|
|
}
|
|
|
}
|
|
|
@@ -1075,10 +1073,9 @@ public class WebClientRest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Path("imagetobase64")
|
|
|
@GET
|
|
|
- public void imagetobase64(@QueryParam("url") String imageurl,@QueryParam("filename") String filename,@Context HttpServletResponse response) throws IOException {
|
|
|
+ public void imagetobase64(@QueryParam("url") String imageurl, @QueryParam("filename") String filename, @Context HttpServletResponse response) throws IOException {
|
|
|
// 创建URL
|
|
|
// response.setContentType("image/jpeg");
|
|
|
final ByteArrayOutputStream data = new ByteArrayOutputStream();
|
|
|
@@ -1112,7 +1109,6 @@ public class WebClientRest {
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
ServletOutputStream out;
|
|
|
try {
|
|
|
//3.通过response获取ServletOutputStream对象(out)
|