Commit 319bb65c by liulei

APP文件上传

parent e2d5601a
......@@ -44,21 +44,23 @@ public class ServiceHPMT001 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmOverview(EiInfo inInfo) {
String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
Map sqlMap = new HashMap();
sqlMap.put("queryMonth", queryMonth);
sqlMap.put("companyCode", companyCode);
List<Map> row1 = this.dao.query("HPMT001.pmOverview1", sqlMap);//目标
List<Map> row2 = this.dao.query("HPMT001.pmOverview2", sqlMap);//实际
List<Map> rows = new ArrayList<>();
public Map pmOverview(EiInfo inInfo) {
Map resultMap = new HashMap();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
try {
String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
Map sqlMap = new HashMap();
sqlMap.put("queryMonth", queryMonth);
sqlMap.put("companyCode", companyCode);
List<Map> row1 = this.dao.query("HPMT001.pmOverview1", sqlMap);//目标
List<Map> row2 = this.dao.query("HPMT001.pmOverview2", sqlMap);//实际
List<Map> rows = new ArrayList<>();
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM");
Date parse = sdf.parse(queryMonth);
Calendar instance = Calendar.getInstance();
instance.setTime(parse);
......@@ -132,15 +134,13 @@ public class ServiceHPMT001 extends ServiceBase {
resultMap.put("actualWt_h_yoy", actualWt.subtract(actualWt2).divide(actualWt2,BigDecimal.ROUND_UP).
multiply(new BigDecimal(100)).doubleValue());
}
rows.add(resultMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
return outInfo;
} catch (ParseException e) {
e.printStackTrace();
return inInfo;
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
......@@ -151,24 +151,31 @@ public class ServiceHPMT001 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmBenchmarking(EiInfo inInfo) {
public Map pmBenchmarking(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
Map sqlMap = new HashMap();
sqlMap.put("queryMonth", queryMonth);
sqlMap.put("companyCode", companyCode);
List<Map> rows = this.dao.query("HPMT001.pmBenchmarking", sqlMap);
List<Map> rows2 = this.dao.query("HPMT001.pmBenchmarking2", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
outInfo.set("cout",rows2);
return outInfo;
resultMap.put("result",rows);
resultMap.put("result2",rows2);
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
}
......@@ -65,14 +65,18 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmProject(EiInfo inInfo) {
public Map pmProject(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String projName = inInfo.getString("projName");
int offset = inInfo.getInt("offset");//当前页
int pageSize = inInfo.getInt("pageSize");//每页条数
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
if (StrUtil.isEmpty(companyCode)) {
resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("projName", projName);
......@@ -87,12 +91,16 @@ public class ServiceHPMT002 extends ServiceBase {
maps.add(row);
}
}
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(maps);
outInfo.setBlock(eiBlock);
outInfo.set("count",count.get(0));
return outInfo;
resultMap.put("result",maps);
resultMap.put("count",count.get(0));
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
/**
......@@ -101,18 +109,29 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmProjectCount(EiInfo inInfo) {
public Map pmProjectCount(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String projName = inInfo.getString("projName");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("projName", projName);
int count = this.dao.count("HPMT002.pmProjectCount", sqlMap);
inInfo.set("count", count);
return inInfo;
resultMap.put("count",count);
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
/**
......@@ -121,21 +140,29 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmQuality(EiInfo inInfo) {
public Map pmQuality(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String queryMonth = inInfo.getString("queryMonth");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("queryMonth", queryMonth);
List<Map> rows = this.dao.query("HPMT002.pmQuality", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
return outInfo;
resultMap.put("result",rows);
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
/**
......@@ -144,15 +171,19 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmQualityList(EiInfo inInfo) {
public Map pmQualityList(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String status = inInfo.getString("status");
String projName = inInfo.getString("projName");
int offset = inInfo.getInt("offset");//当前页
int pageSize = inInfo.getInt("pageSize");//每页条数
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
if (StrUtil.isEmpty(companyCode)) {
resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("projName", projName);
......@@ -162,12 +193,16 @@ public class ServiceHPMT002 extends ServiceBase {
sqlMap.put("offset", offset);
sqlMap.put("pageSize", pageSize);
List<Map> rows = this.dao.query("HPMT002.pmQualityList", sqlMap);
EiInfo outInfo = new EiInfo();
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
outInfo.set("count", count.get(0));
return outInfo;
resultMap.put("result",rows);
resultMap.put("count",count.get(0));
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
......@@ -177,13 +212,15 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmQualityDetail(EiInfo inInfo) {
EiInfo outInfo = new EiInfo();
public Map pmQualityDetail(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String id = inInfo.getString("id");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
outInfo.setMsg("账号异常");
resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
String ROOT_PATH= "";
Map hashMap = new HashMap();
......@@ -231,13 +268,17 @@ public class ServiceHPMT002 extends ServiceBase {
List<Map> rows = this.dao.query("HPMT002.pmQualityDetail", sqlMap);
EiBlock eiBlock = new EiBlock(EiConstant.resultBlock);
eiBlock.setRows(rows);
outInfo.setBlock(eiBlock);
outInfo.set("img",imgList);
outInfo.set("img2",imgList2);
} catch (Exception e){
outInfo.setMsg("账号异常");
resultMap.put("result",rows);
resultMap.put("img",imgList);
resultMap.put("img2",imgList2);
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
return outInfo;
}
/**
......@@ -246,16 +287,20 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmQualityXl(EiInfo inInfo) {
public Map pmQualityXl(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String factoryId= inInfo.getString("factoryId");//工厂id
String prodCode = inInfo.getString("projCode");//项目id
String orgNo = inInfo.getString("orgNo");//生产组id
String inventCode = inInfo.getString("inventCode");//部件id
String subInventCode = inInfo.getString("subInventCode");//零件id
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
if (StrUtil.isEmpty(companyCode)) {
resultMap.put("status", 403);
resultMap.put("message","票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
Map sqlMap = new HashMap();
sqlMap.put("companyCode", companyCode);
sqlMap.put("factoryCode", factoryId);
......@@ -265,16 +310,30 @@ public class ServiceHPMT002 extends ServiceBase {
sqlMap.put("subInventCode", subInventCode);
EiInfo outInfo = new EiInfo();
TEDCM01 tedcm01 = new TEDCM01();
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_FACTORY), null, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PROJCODE), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PRDTCODE), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_ORG_NO), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PARTCODE), sqlMap, false);
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.POOR_TYPE_BLOCK_ID), null, false);
List<Map> queryFactory = this.dao.query("HPMT002.queryFactory", sqlMap);
List<Map> queryProjCode = this.dao.query("HPMT002.queryProjCode", sqlMap);
List<Map> queryPrdtCode = this.dao.query("HPMT002.queryPrdtCode", sqlMap);
List<Map> queryOrgNo = this.dao.query("HPMT002.queryOrgNo", sqlMap);
List<Map> queryPartCode = this.dao.query("HPMT002.queryPartCode", sqlMap);
List<Map> queryTedcm01 = this.dao.query("HPXSOrg.queryTedcm01",tedcm01);
if(subInventCode!=null&&!subInventCode.equals("")){
CommonMethod.initBlock(outInfo, Arrays.asList(DdynamicEnum.APP_MAP_BLOCK_PRODTASKNO), sqlMap, false);
List<Map> queryProdTaskNo = this.dao.query("HPMT002.queryProdTaskNo");
resultMap.put("ProdTaskNo",queryProdTaskNo);
}
return outInfo;
resultMap.put("Factory",queryFactory);
resultMap.put("ProjCode",queryProjCode);
resultMap.put("PrdtCode",queryPrdtCode);
resultMap.put("OrgNo",queryOrgNo);
resultMap.put("PartCode",queryPartCode);
resultMap.put("Tedcm01",queryTedcm01);
resultMap.put("status",EiConstant.STATUS_SUCCESS);
resultMap.put("message","SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message",LogUtils.getMsg(e));
return resultMap;
}
}
/**
......@@ -283,56 +342,62 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmInsertQuality(EiInfo inInfo) {
String docId = inInfo.getString("docId");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
public Map pmInsertQuality(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
HPZL001 fZl001 = new HPZL001();
Map attr = inInfo.getAttr();
fZl001.fromMap(attr);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
fZl001.setCreatedTime(sdf.format(new Date()));
fZl001.setReceiptDate(DateUtils.shortDate());
fZl001.setCompanyCode(companyCode);
User user = UserSessionUtils.getUser();
fZl001.setCheckUser(user.getUserName());
fZl001.setCheckNo(user.getUserId());
// 生成单据号
fZl001.setCheckNo(SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPZL001_NUMBER));
fZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
fZl001.setStatus(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPZL001.INSERT, fZl001);
//处理文件
if(!docId.equals("")) {
Map fZl0012 = new HashMap();
fZl0012.put("checkNo", fZl001.getCheckNo());
List<HPZL001> HPZL001 =dao.query("HPZL001.query", fZl0012);
//绑定文件
String[] docIds = docId.split(",");
int num = 0;
while (num < docIds.length) {
HPZL001A HPZL001A = new HPZL001A();
HPZL001A.setDeptCode(CommonConstant.YesNo.YES);
HPZL001A.setDocType(CommonConstant.YesNo.YES_1);
HPZL001A.setBizType("XJ_WC");
HPZL001A.setDocId(docIds[num]);
HPZL001A.setCheckId(HPZL001.get(0).getId());
HPZL001A.setCompanyCode(companyCode);
DaoUtils.insert(HPZL001A.INSERT, HPZL001A);
num++;
String docId = inInfo.getString("docId");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
resultMap.put("status", 403);
resultMap.put("message", "票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
HPZL001 fZl001 = new HPZL001();
Map attr = inInfo.getAttr();
fZl001.fromMap(attr);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
fZl001.setCreatedTime(sdf.format(new Date()));
fZl001.setReceiptDate(DateUtils.shortDate());
fZl001.setCompanyCode(companyCode);
User user = UserSessionUtils.getUser();
fZl001.setCheckUser(user.getUserName());
fZl001.setCheckNo(user.getUserId());
// 生成单据号
fZl001.setCheckNo(SequenceGenerator.getNextSequence(
HPConstant.SequenceId.HPZL001_NUMBER));
fZl001.setDeleteFlag(CommonConstant.YesNo.NO_0);
fZl001.setStatus(CommonConstant.YesNo.NO_0);
DaoUtils.insert(HPZL001.INSERT, fZl001);
//处理文件
if (!docId.equals("")) {
Map fZl0012 = new HashMap();
fZl0012.put("checkNo", fZl001.getCheckNo());
List<HPZL001> HPZL001 = dao.query("HPZL001.query", fZl0012);
//绑定文件
String[] docIds = docId.split(",");
int num = 0;
while (num < docIds.length) {
HPZL001A HPZL001A = new HPZL001A();
HPZL001A.setDeptCode(CommonConstant.YesNo.YES);
HPZL001A.setDocType(CommonConstant.YesNo.YES_1);
HPZL001A.setBizType("XJ_WC");
HPZL001A.setDocId(docIds[num]);
HPZL001A.setCheckId(HPZL001.get(0).getId());
HPZL001A.setCompanyCode(companyCode);
DaoUtils.insert(HPZL001A.INSERT, HPZL001A);
num++;
}
}
resultMap.put("status", EiConstant.STATUS_SUCCESS);
resultMap.put("message", "SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message", LogUtils.getMsg(e));
return resultMap;
}
}
inInfo.setStatus(EiConstant.STATUS_SUCCESS);
inInfo.setMsg("新增成功!");
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "新增失败");
}
return inInfo;
}
/**
......@@ -341,13 +406,16 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmModifyQuality(EiInfo inInfo) {
public Map pmModifyQuality(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String docId = inInfo.getString("docId");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
try {
if (StrUtil.isEmpty(companyCode)) {
resultMap.put("status", 403);
resultMap.put("message", "票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
HPZL001 fZl001 = new HPZL001();
Map attr = inInfo.getAttr();
fZl001.fromMap(attr);
......@@ -375,11 +443,14 @@ public class ServiceHPMT002 extends ServiceBase {
num++;
}
}
inInfo.setMsg("处理成功!");
resultMap.put("status", EiConstant.STATUS_SUCCESS);
resultMap.put("message", "SUCCESS");
return resultMap;
} catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "处理失败");
resultMap.put("status", 500);
resultMap.put("message", LogUtils.getMsg(e));
return resultMap;
}
return inInfo;
}
......@@ -389,24 +460,28 @@ public class ServiceHPMT002 extends ServiceBase {
* @param inInfo
* @return
*/
public EiInfo pmUploadFile(EiInfo inInfo) {
public Map pmUploadFile(EiInfo inInfo) {
Map resultMap = new HashMap();
try {
String files = inInfo.getString("files");
String companyCode = UserSessionUtils.getCompanyCode();
if (StrUtil.isEmpty(companyCode)) {
inInfo.setMsg("账号异常");
}
try {
if (StrUtil.isEmpty(companyCode)) {
resultMap.put("status", 403);
resultMap.put("message", "票据过期或请求不合法,请重新登录或获取合法权限!");
return resultMap;
}
CommonsMultipartFile multipartFile = Base64ToMultipartFile.base64toMultipartFile(files);
System.out.println("--------------------------------转换Base64成功");
JSONObject upload = UploadUtils.upload(multipartFile);
inInfo.set("id",upload.getString("docId"));
inInfo.setMsg("上传成功!");
}
catch (Exception e) {
LogUtils.setDetailMsg(inInfo, e, "上传失败");
resultMap.put("id",upload.getString("docId"));
resultMap.put("status", EiConstant.STATUS_SUCCESS);
resultMap.put("message", "SUCCESS");
return resultMap;
} catch (Exception e) {
resultMap.put("status", 500);
resultMap.put("message", LogUtils.getMsg(e));
return resultMap;
}
return inInfo;
}
}
......@@ -14,53 +14,44 @@ import com.baosight.iplat4j.eu.dm.util.FileProcessUtils;
import com.baosight.iplat4j.eu.dm.util.IFileUploader;
import net.sf.json.JSONObject;
import org.apache.commons.codec.binary.Base64;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.multipart.commons.CommonsMultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartResolver;
import javax.imageio.ImageIO;
import javax.servlet.http.HttpServletRequest;
import java.awt.image.BufferedImage;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.*;
public class UploadUtils2 {
private static Dao dao = (Dao)PlatApplicationContext.getApplicationContext().getBean("dao");
public static JSONObject upload(CommonsMultipartFile multipartFile ) throws Exception {
JSONObject documentJSON = new JSONObject();
String docName = multipartFile.getOriginalFilename();
Long docSize = multipartFile.getSize();
HashMap<String, String> inMap = new HashMap();
String configPathDefine=null;
Map hashMap = new HashMap();
hashMap.put("fkey","docRootDir");
List<Map> query = DaoBase.getInstance().query("EDCC03.query",hashMap);
if (query.get(0).get("fvalue")!=null) {
configPathDefine= (String) query.get(0).get("fvalue");
}
inMap.put("configPathDefine", configPathDefine);
Map<String, String> returnMap = PlatFileUploadUtils.uploadFile(multipartFile, inMap);
String docId = (String)returnMap.get("docId");
String docUrl = (String)returnMap.get("docUrl");
docId = docId == null ? "" : docId;
documentJSON.put("docId", docId);
if (StringUtils.isNotEmpty(docUrl)) {
documentJSON.put("docUrl", docUrl);
} else {
documentJSON.remove("docUrl");
}
documentJSON.put("groupId", returnMap.get("groupId") == null ? "" : returnMap.get("groupId"));
documentJSON.put("docName", docName);
documentJSON.put("docSize", docSize);
documentJSON.put("docType", docName.substring(docName.lastIndexOf(46)));
JSONObject documentJSON = new JSONObject();
String docName = multipartFile.getOriginalFilename();
Long docSize = multipartFile.getSize();
HashMap<String, String> inMap = new HashMap();
inMap.put("groupId", "hk_file11");
inMap.put("configPathDefine", "A");
Map<String, String> returnMap = PlatFileUploadUtils.uploadFile(multipartFile, inMap);
String docId = (String)returnMap.get("docId");
String docUrl = (String)returnMap.get("docUrl");
docId = docId == null ? "" : docId;
documentJSON.put("docId", docId);
if (StringUtils.isNotEmpty(docUrl)) {
documentJSON.put("docUrl", docUrl);
} else {
documentJSON.remove("docUrl");
}
documentJSON.put("groupId", returnMap.get("groupId") == null ? "" : returnMap.get("groupId"));
documentJSON.put("docName", docName);
documentJSON.put("docSize", docSize);
documentJSON.put("docType", docName.substring(docName.lastIndexOf(46)));
return documentJSON;
}
}
}
......@@ -176,7 +176,7 @@
</select>
<!-- 查询组织信息 -->
<select id="queryTedcm01" resultClass="com.baosight.iplat4j.common.ed.domain.TEDCM01">
<select id="queryTedcm01" resultClass="java.util.HashMap">
SELECT
ITEM_CODE AS "itemCode",
ITEM_CNAME AS "itemCname"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment