|
|
@@ -368,9 +368,14 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
|
|
|
@Override
|
|
|
@Transactional
|
|
|
- public int saveFilePath(String accessKey, String requestId,String path, int size, String filename) {
|
|
|
+ public int saveFilePath(String accessKey, String requestId,String path, int size, String filename,String data) throws Exception {
|
|
|
String AE_MASTER = checkAccessKey(accessKey, requestId);
|
|
|
SpObserver.putSp(AE_MASTER);
|
|
|
+ Map<Object, Object> map = BaseUtil.parseFormStoreToMap(data);
|
|
|
+ String result = StringUtil.nvl(map.get("result"), "");
|
|
|
+ if ("".equals(result)){
|
|
|
+ throw new Exception("返回结果不能为空!");
|
|
|
+ }
|
|
|
int id = baseDao.getSeqId("filepath_seq");
|
|
|
/**
|
|
|
* 文件名含单引号无法下载*/
|
|
|
@@ -378,17 +383,17 @@ public class MESDataServiceImpl implements MESDataService {
|
|
|
baseDao.execute("INSERT INTO filepath(fp_id,fp_path,fp_size,fp_man,fp_date,fp_name) values(" + id + ",'" + path + "'," + size
|
|
|
+ ",'" + accessKey+ "'," + DateUtil.parseDateToOracleString(Constant.YMD_HMS, new Date()) + ",'" + filename
|
|
|
+ "')");
|
|
|
- baseDao.execute("insert into DCRFILEDATA (DF_ID ,DF_DATE,DF_INMAN,DF_ATTACH,DF_FILENAME)" +
|
|
|
- " select DCRFILEDATA_seq.nextval,sysdate,?,?,? from dual ",accessKey,id,filename);
|
|
|
+ baseDao.execute("insert into DCRFILEDATA (DF_ID ,DF_DATE,DF_INMAN,DF_ATTACH,DF_FILENAME,DF_RESULT)" +
|
|
|
+ " select DCRFILEDATA_seq.nextval,sysdate,?,?,?,? from dual ",accessKey,id,filename,result);
|
|
|
return id;
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- public ApiResult<String> uploadDCRFile(String accessKey, String requestId, MultipartFile file) throws IOException {
|
|
|
+ public ApiResult<String> uploadDCRFile(String accessKey, String requestId, MultipartFile file,String data) throws IOException {
|
|
|
try {
|
|
|
String filename = file.getOriginalFilename();
|
|
|
String path = saveFile(file);
|
|
|
- int id = saveFilePath(accessKey, requestId,path, (int) file.getSize(), filename);
|
|
|
+ int id = saveFilePath(accessKey, requestId,path, (int) file.getSize(), filename,data);
|
|
|
return ApiResponse.successRsp("0", "Success", requestId, "");
|
|
|
}catch (Exception e) {
|
|
|
e.printStackTrace();
|