|
@@ -22,7 +22,9 @@ import java.text.DateFormat;
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
+import java.util.HashMap;
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
@Api(tags = "图片、简历相关接口")
|
|
@Api(tags = "图片、简历相关接口")
|
|
@RestController
|
|
@RestController
|
|
@@ -352,35 +354,41 @@ import java.util.List;
|
|
|
|
|
|
@RequestMapping(value = "/uploadPayImg", method = RequestMethod.POST)
|
|
@RequestMapping(value = "/uploadPayImg", method = RequestMethod.POST)
|
|
@ResponseBody
|
|
@ResponseBody
|
|
- public int uploadPayImg(@RequestParam("file") MultipartFile file,
|
|
|
|
- @RequestParam(value = "eh_code") String eh_code,
|
|
|
|
- @RequestParam(value = "cv_orderstaus") Integer cv_orderstaus) {
|
|
|
|
|
|
+ public Map<String, String> uploadPayImg(@RequestParam("file") MultipartFile file,
|
|
|
|
+ @RequestParam(value = "eh_code") String eh_code,
|
|
|
|
+ @RequestParam(value = "out_trade_no") String out_trade_no,
|
|
|
|
+ @RequestParam(value = "cv_orderstaus") Integer cv_orderstaus) {
|
|
int dot = file.getOriginalFilename().lastIndexOf('.');
|
|
int dot = file.getOriginalFilename().lastIndexOf('.');
|
|
String newName = file.getOriginalFilename().substring(dot);
|
|
String newName = file.getOriginalFilename().substring(dot);
|
|
CustomerPayVoucher customerPayVoucher = new CustomerPayVoucher();
|
|
CustomerPayVoucher customerPayVoucher = new CustomerPayVoucher();
|
|
if (file.isEmpty()) {
|
|
if (file.isEmpty()) {
|
|
- return 0;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
Date date = new Date();
|
|
Date date = new Date();
|
|
DateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
DateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
File dest = new File(payvoucher + "/" + eh_code + sdf.format(date) + newName);
|
|
File dest = new File(payvoucher + "/" + eh_code + sdf.format(date) + newName);
|
|
|
|
+ Map<String, String> tableData = new HashMap<>();
|
|
|
|
+ tableData.put("url",httppayvoucher + "/" + eh_code + sdf.format(date) + newName);
|
|
|
|
+ tableData.put("filename",eh_code + sdf.format(date) + newName);
|
|
// 删除
|
|
// 删除
|
|
try {
|
|
try {
|
|
file.transferTo(dest); //保存文件
|
|
file.transferTo(dest); //保存文件
|
|
- customerPayVoucher.setEh_code(eh_code);
|
|
|
|
- customerPayVoucher.setCv_filename(eh_code + sdf.format(date) + newName);
|
|
|
|
- customerPayVoucher.setCv_orderstaus(cv_orderstaus);
|
|
|
|
- customerPayVoucher.setCv_filepath(httppayvoucher + "/" + eh_code + sdf.format(date) + newName);
|
|
|
|
- customerPayVoucherService.insertCustomerPayVoucher(customerPayVoucher);
|
|
|
|
- return 1;
|
|
|
|
|
|
+ //先不保存凭证呢
|
|
|
|
+// customerPayVoucher.setEh_code(eh_code);
|
|
|
|
+// customerPayVoucher.setCv_filename(eh_code + sdf.format(date) + newName);
|
|
|
|
+// customerPayVoucher.setCv_orderstaus(cv_orderstaus);
|
|
|
|
+// customerPayVoucher.setOut_trade_no(out_trade_no);
|
|
|
|
+// customerPayVoucher.setCv_filepath(httppayvoucher + "/" + eh_code + sdf.format(date) + newName);
|
|
|
|
+// customerPayVoucherService.insertCustomerPayVoucher(customerPayVoucher);
|
|
|
|
+ return tableData;
|
|
} catch (IllegalStateException e) {
|
|
} catch (IllegalStateException e) {
|
|
// TODO Auto-generated catch block
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- return 0;
|
|
|
|
|
|
+ return null;
|
|
} catch (IOException e) {
|
|
} catch (IOException e) {
|
|
// TODO Auto-generated catch block
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
- return 0;
|
|
|
|
|
|
+ return null;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -390,7 +398,7 @@ import java.util.List;
|
|
String path = payvoucher + "/" + cv_filename;
|
|
String path = payvoucher + "/" + cv_filename;
|
|
File dest = new File(path);
|
|
File dest = new File(path);
|
|
dest.delete();
|
|
dest.delete();
|
|
- return customerPayVoucherService.deleteCustomerPayVoucher(cv_filename);
|
|
|
|
|
|
+ return 1;
|
|
} catch (Exception ex) {
|
|
} catch (Exception ex) {
|
|
ex.printStackTrace();
|
|
ex.printStackTrace();
|
|
return 0;
|
|
return 0;
|