|
@@ -5,7 +5,6 @@ import com.ygj.yuemum.component.Constant;
|
|
|
import com.ygj.yuemum.domain.admin.Photo;
|
|
|
import com.ygj.yuemum.domain.admin.Resume;
|
|
|
import com.ygj.yuemum.domain.maternitymatron.JlServiceUser;
|
|
|
-import com.ygj.yuemum.domain.maternitymatron.MmInfoPhoto;
|
|
|
import com.ygj.yuemum.domain.pay.CustomerPayVoucher;
|
|
|
import com.ygj.yuemum.service.admin.PhotoService;
|
|
|
import com.ygj.yuemum.service.admin.ResumeService;
|
|
@@ -61,7 +60,7 @@ public class ImageUploadController {
|
|
|
// 删除display
|
|
|
if (type == 1) {
|
|
|
List<Photo> photos = photoService.queryDisplays(id);
|
|
|
- for(Photo photo:photos) {
|
|
|
+ for (Photo photo : photos) {
|
|
|
photoService.deletePhoto(photo);
|
|
|
}
|
|
|
}
|
|
@@ -82,7 +81,7 @@ public class ImageUploadController {
|
|
|
photo.setServant_code(id);
|
|
|
photo.setPhoto_type(type);
|
|
|
photo.setPhoto_name(getpathtype(type) + id + type + sdf.format(date) + newName);
|
|
|
- photo.setPhoto_path(httpRoot+ getpathtype(type) + "Img/"+dest.getName());
|
|
|
+ photo.setPhoto_path(httpRoot + getpathtype(type) + "Img/" + dest.getName());
|
|
|
photoService.addPhoto(photo);
|
|
|
return 1;
|
|
|
} catch (IllegalStateException e) {
|
|
@@ -99,21 +98,22 @@ public class ImageUploadController {
|
|
|
@PostMapping("/deletePhoto")
|
|
|
public int deletePhoto(@ModelAttribute Photo photo) throws ParseException {
|
|
|
try {
|
|
|
- String path = ROOT+ getpathtype(photo.getPhoto_type()) +"Img/"+ photo.getPhoto_name();
|
|
|
+ String path = ROOT + getpathtype(photo.getPhoto_type()) + "Img/" + photo.getPhoto_name();
|
|
|
File dest = new File(path);
|
|
|
dest.delete();
|
|
|
return photoService.deletePhoto(photo);
|
|
|
- } catch (Exception ex){
|
|
|
+ } catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
return 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@PostMapping("/queryPhoto")
|
|
|
public String queryPhoto(@ModelAttribute Photo photo) throws ParseException {
|
|
|
- List<Photo> photos= photoService.queryPhoto(photo);
|
|
|
+ List<Photo> photos = photoService.queryPhoto(photo);
|
|
|
String jso = JSONObject.toJSONString(photos);
|
|
|
- jso = jso.replaceAll("photo_path","url");
|
|
|
- jso = jso.replaceAll("servant_code","name");
|
|
|
+ jso = jso.replaceAll("photo_path", "url");
|
|
|
+ jso = jso.replaceAll("servant_code", "name");
|
|
|
return jso;
|
|
|
}
|
|
|
|
|
@@ -122,67 +122,67 @@ public class ImageUploadController {
|
|
|
public String createResume(@ModelAttribute Photo photo) {
|
|
|
String urlName = "";
|
|
|
try {
|
|
|
- JlServiceUser jlServiceUser = jlServiceUserService.getResume(photo.getServant_code());
|
|
|
+ JlServiceUser jlServiceUser = jlServiceUserService.getResume(photo.getServant_code());
|
|
|
urlName = String.valueOf(jlServiceUser.getId());
|
|
|
File file = ResourceUtils.getFile(modulePath);
|
|
|
BufferedReader br = new BufferedReader(new FileReader(file));
|
|
|
- Resume resume =new Resume();
|
|
|
+ Resume resume = new Resume();
|
|
|
Resume resumeold = new Resume();
|
|
|
StringBuilder stringHtml = new StringBuilder();
|
|
|
String str = "";
|
|
|
- String photoDisplay ="";
|
|
|
- String certificate ="";
|
|
|
- String certificatehref ="";
|
|
|
- String service ="";
|
|
|
- String servicehref ="";
|
|
|
+ String photoDisplay = "";
|
|
|
+ String certificate = "";
|
|
|
+ String certificatehref = "";
|
|
|
+ String service = "";
|
|
|
+ String servicehref = "";
|
|
|
String meal = "";
|
|
|
String mealhref = "";
|
|
|
- String comment ="";
|
|
|
+ String comment = "";
|
|
|
String littcomm = "";
|
|
|
- if(photo.getComment() == null){
|
|
|
+ if (photo.getComment() == null) {
|
|
|
photo.setComment(" ");
|
|
|
}
|
|
|
List<Photo> photos = photoService.queryPhoto(photo);
|
|
|
- if(photos.size() > 0 ) {
|
|
|
+ if (photos.size() > 0) {
|
|
|
int stepcertificate = 0;
|
|
|
int stepservice = 0;
|
|
|
int stepmeal = 0;
|
|
|
- String certificatestart = "<div class=\"resume-certificate-image\">"+ "\r\n"
|
|
|
- +"<span class=\"resume-item-title\">相关证件</span>"+ "\r\n"
|
|
|
- +"<div class=\"lb_gl_certificate\">"+ "\r\n"
|
|
|
- +"<div class=\"container\">"+ "\r\n"
|
|
|
- +"<div class=\"pictureSlider-certificate poster-main \">"+ "\r\n"
|
|
|
- +"<div class=\"left-modal modal-certificate\"></div>"+ "\r\n"
|
|
|
- +"<ul id=\"zturn-certificate\" class=\"poster-list\">"+ "\r\n"
|
|
|
- +"<div class=\"poster-btn poster-certificate-prev-btn certificate\"></div>"+ "\r\n";
|
|
|
- String certificateend = "<div class=\"poster-btn poster-certificate-next-btn\"></div>"+ "\r\n"
|
|
|
- +"</ul>"+ "\r\n"
|
|
|
- +"<div class=\"right-modal modal-certificate\"></div>"+ "\r\n"
|
|
|
- +"<div class=\"indicator-list indicator-list-cer\">"+ "\r\n"
|
|
|
- +"$cfstyle"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n";
|
|
|
- String mealstart = "<div class=\"resume-service-image\">"+ "\r\n"
|
|
|
- +"<span class=\"resume-item-title\">月子餐照片</span>"+ "\r\n"
|
|
|
- +"<div class=\"lb_gl\">"+ "\r\n"
|
|
|
- +"<div class=\"container\">"+ "\r\n"
|
|
|
- +"<div class=\"pictureSlider poster-main poster-main-yzfood\">"+ "\r\n"
|
|
|
- +"<div class=\"left-modal\"></div>"+ "\r\n"
|
|
|
- +"<ul id=\"yzfood\" class=\"poster-list\">"+ "\r\n"
|
|
|
- +"<div class=\"poster-btn poster-prev-btn poster-prev-btn-yzfood\"></div>"+ "\r\n";
|
|
|
- String mealend = "<div class=\"poster-btn poster-next-btn poster-next-btn-yzfood\"></div>"+ "\r\n"
|
|
|
- +"</ul>"+ "\r\n"
|
|
|
- +"<div class=\"right-modal\"></div>"+ "\r\n"
|
|
|
- +"<div class=\"indicator-list indicator-list-service\">"+ "\r\n"
|
|
|
- +"$smstyle"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n";
|
|
|
+ String certificatestart = "<div class=\"resume-certificate-image\">" + "\r\n"
|
|
|
+ + "<span class=\"resume-item-title\">相关证件</span>" + "\r\n"
|
|
|
+ + "<div class=\"lb_gl_certificate\">" + "\r\n"
|
|
|
+ + "<div class=\"container\">" + "\r\n"
|
|
|
+ + "<div class=\"pictureSlider-certificate poster-main \">" + "\r\n"
|
|
|
+ + "<div class=\"left-modal modal-certificate\"></div>" + "\r\n"
|
|
|
+ + "<ul id=\"zturn-certificate\" class=\"poster-list\">" + "\r\n"
|
|
|
+ + "<div class=\"poster-btn poster-certificate-prev-btn certificate\"></div>" + "\r\n";
|
|
|
+ String certificateend = "<div class=\"poster-btn poster-certificate-next-btn\"></div>" + "\r\n"
|
|
|
+ + "</ul>" + "\r\n"
|
|
|
+ + "<div class=\"right-modal modal-certificate\"></div>" + "\r\n"
|
|
|
+ + "<div class=\"indicator-list indicator-list-cer\">" + "\r\n"
|
|
|
+ + "$cfstyle" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n";
|
|
|
+ String mealstart = "<div class=\"resume-service-image\">" + "\r\n"
|
|
|
+ + "<span class=\"resume-item-title\">月子餐照片</span>" + "\r\n"
|
|
|
+ + "<div class=\"lb_gl\">" + "\r\n"
|
|
|
+ + "<div class=\"container\">" + "\r\n"
|
|
|
+ + "<div class=\"pictureSlider poster-main poster-main-yzfood\">" + "\r\n"
|
|
|
+ + "<div class=\"left-modal\"></div>" + "\r\n"
|
|
|
+ + "<ul id=\"yzfood\" class=\"poster-list\">" + "\r\n"
|
|
|
+ + "<div class=\"poster-btn poster-prev-btn poster-prev-btn-yzfood\"></div>" + "\r\n";
|
|
|
+ String mealend = "<div class=\"poster-btn poster-next-btn poster-next-btn-yzfood\"></div>" + "\r\n"
|
|
|
+ + "</ul>" + "\r\n"
|
|
|
+ + "<div class=\"right-modal\"></div>" + "\r\n"
|
|
|
+ + "<div class=\"indicator-list indicator-list-service\">" + "\r\n"
|
|
|
+ + "$smstyle" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n";
|
|
|
String commentstart = "<div class=\"resume-comments\">" + "\r\n"
|
|
|
+ "<span class=\"resume-item-title\">最新评论</span>" + "\r\n"
|
|
|
+ "<div class=\"resume-comments-div\" id=\"resume-comments\">" + "\r\n"
|
|
@@ -193,24 +193,24 @@ public class ImageUploadController {
|
|
|
String commentend = "</div>"
|
|
|
+ "<div class=\"ul_box\" id=\"ul_box2\"></div>"
|
|
|
+ "</div>" + "\r\n" + "</div>" + "\r\n" + "</div>" + "\r\n" + "</div>" + "\r\n" + "</div>";
|
|
|
- String servicestart = "<div class=\"resume-service-image\">"+ "\r\n"
|
|
|
- +"<span class=\"resume-item-title\">服务照片</span>"+ "\r\n"
|
|
|
- +"<div class=\"left-modal\" id=\"left-modal-service\"></div>"+ "\r\n"
|
|
|
- +"<div class=\"lb_gl\">"+ "\r\n"
|
|
|
- +"<div class=\"container\">"+ "\r\n"
|
|
|
- +"<div class=\"pictureSlider poster-main poster-main-services\">"+ "\r\n"
|
|
|
- +"<ul id=\"zturn\" class=\"poster-list\">"+ "\r\n"
|
|
|
- +"<div class=\"poster-btn poster-prev-btn poster-prev-btn-service\"></div>"+ "\r\n";
|
|
|
- String serviceend = "<div class=\"poster-btn poster-next-btn poster-next-btn-service\"></div>"+ "\r\n"
|
|
|
- +"</ul>"+ "\r\n"
|
|
|
- +"<div class=\"right-modal\"></div>"+ "\r\n"
|
|
|
- +"<div class=\"indicator-list indicator-list-service\">"+ "\r\n"
|
|
|
- +"$scstyle"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n"
|
|
|
- +"</div>"+ "\r\n";
|
|
|
+ String servicestart = "<div class=\"resume-service-image\">" + "\r\n"
|
|
|
+ + "<span class=\"resume-item-title\">服务照片</span>" + "\r\n"
|
|
|
+ + "<div class=\"left-modal\" id=\"left-modal-service\"></div>" + "\r\n"
|
|
|
+ + "<div class=\"lb_gl\">" + "\r\n"
|
|
|
+ + "<div class=\"container\">" + "\r\n"
|
|
|
+ + "<div class=\"pictureSlider poster-main poster-main-services\">" + "\r\n"
|
|
|
+ + "<ul id=\"zturn\" class=\"poster-list\">" + "\r\n"
|
|
|
+ + "<div class=\"poster-btn poster-prev-btn poster-prev-btn-service\"></div>" + "\r\n";
|
|
|
+ String serviceend = "<div class=\"poster-btn poster-next-btn poster-next-btn-service\"></div>" + "\r\n"
|
|
|
+ + "</ul>" + "\r\n"
|
|
|
+ + "<div class=\"right-modal\"></div>" + "\r\n"
|
|
|
+ + "<div class=\"indicator-list indicator-list-service\">" + "\r\n"
|
|
|
+ + "$scstyle" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n"
|
|
|
+ + "</div>" + "\r\n";
|
|
|
|
|
|
for (Photo onePhoto : photos) {
|
|
|
if (onePhoto.getPhoto_type() == 1) {
|
|
@@ -275,37 +275,37 @@ public class ImageUploadController {
|
|
|
certificate = certificatestart + certificate + certificateend;
|
|
|
}
|
|
|
}
|
|
|
- while((str = br.readLine())!=null){
|
|
|
- str = str.replace("$name",jlServiceUser.getTruename());
|
|
|
- str = str.replace("$np",jlServiceUser.getNp());
|
|
|
- str = str.replace("$age",jlServiceUser.getAge()+"岁");
|
|
|
- str = str.replace("$ethnicgroup",jlServiceUser.getEthnicgroup());
|
|
|
- str = str.replace("$constellation",jlServiceUser.getConstellation());
|
|
|
- str = str.replace("$seniority",jlServiceUser.getSeniority());
|
|
|
- str = str.replace("$babynumber",jlServiceUser.getBabynumber());
|
|
|
- str = str.replace("$education",jlServiceUser.getEducation());
|
|
|
- str = str.replace("$weight",jlServiceUser.getWeight());
|
|
|
- str = str.replace("$marriage",jlServiceUser.getMarriage());
|
|
|
- str = str.replace("$highlight",jlServiceUser.getHighlight());
|
|
|
- str = str.replace("$resumecomment",photo.getComment());
|
|
|
- str = str.replace("$zodiac","属"+jlServiceUser.getZodiac());
|
|
|
- str = str.replace("$height",jlServiceUser.getHeight());
|
|
|
- str = str.replace("$starts",String.valueOf(jlServiceUser.getGender()));
|
|
|
- str = str.replace("$display",photoDisplay);
|
|
|
- str = str.replace("$credentials",certificate);
|
|
|
- str = str.replace("$cfstyle",certificatehref);
|
|
|
- str = str.replace("$service",service);
|
|
|
- str = str.replace("$scstyle",servicehref);
|
|
|
- str = str.replace("$meal",meal);
|
|
|
- str = str.replace("$smstyle",mealhref);
|
|
|
- str = str.replace("$comment",comment);
|
|
|
- str = str.replace("$littcomm",littcomm);
|
|
|
- str = str.replace("$ystitle","悦所-月嫂简历:"+jlServiceUser.getTruename());
|
|
|
- str = str.replace("$yuesaohref",httphtmlRoot+ urlName + ".html");
|
|
|
- stringHtml.append(str+"\r\n");
|
|
|
+ while ((str = br.readLine()) != null) {
|
|
|
+ str = str.replace("$name", jlServiceUser.getTruename());
|
|
|
+ str = str.replace("$np", jlServiceUser.getNp());
|
|
|
+ str = str.replace("$age", jlServiceUser.getAge() + "岁");
|
|
|
+ str = str.replace("$ethnicgroup", jlServiceUser.getEthnicgroup());
|
|
|
+ str = str.replace("$constellation", jlServiceUser.getConstellation());
|
|
|
+ str = str.replace("$seniority", jlServiceUser.getSeniority());
|
|
|
+ str = str.replace("$babynumber", jlServiceUser.getBabynumber());
|
|
|
+ str = str.replace("$education", jlServiceUser.getEducation());
|
|
|
+ str = str.replace("$weight", jlServiceUser.getWeight());
|
|
|
+ str = str.replace("$marriage", jlServiceUser.getMarriage());
|
|
|
+ str = str.replace("$highlight", jlServiceUser.getHighlight());
|
|
|
+ str = str.replace("$resumecomment", photo.getComment());
|
|
|
+ str = str.replace("$zodiac", "属" + jlServiceUser.getZodiac());
|
|
|
+ str = str.replace("$height", jlServiceUser.getHeight());
|
|
|
+ str = str.replace("$starts", String.valueOf(jlServiceUser.getGender()));
|
|
|
+ str = str.replace("$display", photoDisplay);
|
|
|
+ str = str.replace("$credentials", certificate);
|
|
|
+ str = str.replace("$cfstyle", certificatehref);
|
|
|
+ str = str.replace("$service", service);
|
|
|
+ str = str.replace("$scstyle", servicehref);
|
|
|
+ str = str.replace("$meal", meal);
|
|
|
+ str = str.replace("$smstyle", mealhref);
|
|
|
+ str = str.replace("$comment", comment);
|
|
|
+ str = str.replace("$littcomm", littcomm);
|
|
|
+ str = str.replace("$ystitle", "悦所-月嫂简历:" + jlServiceUser.getTruename());
|
|
|
+ str = str.replace("$yuesaohref", httphtmlRoot + urlName + ".html");
|
|
|
+ stringHtml.append(str + "\r\n");
|
|
|
}
|
|
|
resumeold = resumeService.getResume(photo.getServant_code());
|
|
|
- if(resumeold != null) {
|
|
|
+ if (resumeold != null) {
|
|
|
resumeService.deleteResume(resumeold.getId());
|
|
|
File fileDel = new File(resumeold.getRqcode_path());
|
|
|
if (file.exists()) {
|
|
@@ -314,27 +314,28 @@ public class ImageUploadController {
|
|
|
}
|
|
|
resume.setServant_code(photo.getServant_code());
|
|
|
resume.setResume_comment(photo.getComment());
|
|
|
- resume.setResume_path(httphtmlRoot+ urlName + ".html");
|
|
|
- resume.setRqcode_path(ResumeFile+urlName + ".html");
|
|
|
+ resume.setResume_path(httphtmlRoot + urlName + ".html");
|
|
|
+ resume.setRqcode_path(ResumeFile + urlName + ".html");
|
|
|
resumeService.addResume(resume);
|
|
|
File newResume = new File(ResumeFile + urlName + ".html");
|
|
|
FileWriter fileWriter = new FileWriter(newResume);
|
|
|
fileWriter.write(stringHtml.toString());
|
|
|
fileWriter.close();
|
|
|
- } catch (Exception ex){
|
|
|
+ } catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
return "error";
|
|
|
}
|
|
|
- return httphtmlRoot+urlName+".html";
|
|
|
+ return httphtmlRoot + urlName + ".html";
|
|
|
}
|
|
|
- public String getpathtype(int type){
|
|
|
+
|
|
|
+ public String getpathtype(int type) {
|
|
|
switch (type) {
|
|
|
case 1:
|
|
|
- return "display";
|
|
|
+ return "display";
|
|
|
case 2:
|
|
|
return "certificate";
|
|
|
case 3:
|
|
|
- return "comment";
|
|
|
+ return "comment";
|
|
|
case 4:
|
|
|
return "service";
|
|
|
case 5:
|
|
@@ -342,6 +343,7 @@ public class ImageUploadController {
|
|
|
}
|
|
|
return "error";
|
|
|
}
|
|
|
+
|
|
|
@GetMapping("/reBulidResume")
|
|
|
public int reBulidResume(@RequestParam("servant_code") String servant_code) {
|
|
|
return photoService.reBuildResume(servant_code);
|
|
@@ -354,20 +356,20 @@ public class ImageUploadController {
|
|
|
@RequestParam(value = "cv_orderstaus") Integer cv_orderstaus) {
|
|
|
int dot = file.getOriginalFilename().lastIndexOf('.');
|
|
|
String newName = file.getOriginalFilename().substring(dot);
|
|
|
- CustomerPayVoucher customerPayVoucher = new CustomerPayVoucher();
|
|
|
+ CustomerPayVoucher customerPayVoucher = new CustomerPayVoucher();
|
|
|
if (file.isEmpty()) {
|
|
|
return 0;
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
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);
|
|
|
// 删除
|
|
|
try {
|
|
|
file.transferTo(dest); //保存文件
|
|
|
customerPayVoucher.setEh_code(eh_code);
|
|
|
- customerPayVoucher.setCv_filename(eh_code + sdf.format(date) +newName);
|
|
|
+ customerPayVoucher.setCv_filename(eh_code + sdf.format(date) + newName);
|
|
|
customerPayVoucher.setCv_orderstaus(cv_orderstaus);
|
|
|
- customerPayVoucher.setCv_filepath(httppayvoucher + "/"+ eh_code + sdf.format(date) +newName);
|
|
|
+ customerPayVoucher.setCv_filepath(httppayvoucher + "/" + eh_code + sdf.format(date) + newName);
|
|
|
customerPayVoucherService.insertCustomerPayVoucher(customerPayVoucher);
|
|
|
return 1;
|
|
|
} catch (IllegalStateException e) {
|
|
@@ -380,14 +382,15 @@ public class ImageUploadController {
|
|
|
return 0;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@GetMapping("/deletePayPhoto")
|
|
|
public int deletePayPhoto(@RequestParam("cv_filename") String cv_filename) throws ParseException {
|
|
|
try {
|
|
|
- String path = payvoucher + "/"+ cv_filename;
|
|
|
+ String path = payvoucher + "/" + cv_filename;
|
|
|
File dest = new File(path);
|
|
|
dest.delete();
|
|
|
return customerPayVoucherService.deleteCustomerPayVoucher(cv_filename);
|
|
|
- } catch (Exception ex){
|
|
|
+ } catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
return 0;
|
|
|
}
|
|
@@ -396,49 +399,49 @@ public class ImageUploadController {
|
|
|
@GetMapping("/deleteCustomerPayVoucherAll")
|
|
|
public int deleteCustomerPayVoucherAll(@RequestParam("eh_code") String eh_code) throws ParseException {
|
|
|
try {
|
|
|
- List<CustomerPayVoucher> customerPays= customerPayVoucherService.selectCustomerPayVoucher(eh_code);
|
|
|
- for(CustomerPayVoucher cpv:customerPays){
|
|
|
- String path = payvoucher + "/"+ cpv.getCv_filename();
|
|
|
+ List<CustomerPayVoucher> customerPays = customerPayVoucherService.selectCustomerPayVoucher(eh_code);
|
|
|
+ for (CustomerPayVoucher cpv : customerPays) {
|
|
|
+ String path = payvoucher + "/" + cpv.getCv_filename();
|
|
|
File dest = new File(path);
|
|
|
dest.delete();
|
|
|
}
|
|
|
return customerPayVoucherService.deleteCustomerPayVoucherAll(eh_code);
|
|
|
- } catch (Exception ex){
|
|
|
+ } catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
return 0;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @GetMapping ("/queryPayPhoto")
|
|
|
+ @GetMapping("/queryPayPhoto")
|
|
|
public String queryPayPhoto(@RequestParam("eh_code") String eh_code) throws ParseException {
|
|
|
- List<CustomerPayVoucher> customerPays= customerPayVoucherService.selectCustomerPayVoucher(eh_code);
|
|
|
+ List<CustomerPayVoucher> customerPays = customerPayVoucherService.selectCustomerPayVoucher(eh_code);
|
|
|
String jso = JSONObject.toJSONString(customerPays);
|
|
|
- jso = jso.replaceAll("cv_filepath","url");
|
|
|
- jso = jso.replaceAll("cv_filename","name");
|
|
|
+ jso = jso.replaceAll("cv_filepath", "url");
|
|
|
+ jso = jso.replaceAll("cv_filename", "name");
|
|
|
return jso;
|
|
|
}
|
|
|
|
|
|
|
|
|
- @PostMapping ("/queryOrderPayPhoto")
|
|
|
+ @PostMapping("/queryOrderPayPhoto")
|
|
|
public String queryOrderPayPhoto(@ModelAttribute CustomerPayVoucher customerPayVoucher) throws ParseException {
|
|
|
- List<CustomerPayVoucher> customerPays= customerPayVoucherService.queryOrderPayPhoto(customerPayVoucher);
|
|
|
+ List<CustomerPayVoucher> customerPays = customerPayVoucherService.queryOrderPayPhoto(customerPayVoucher);
|
|
|
String jso = JSONObject.toJSONString(customerPays);
|
|
|
- jso = jso.replaceAll("cv_filepath","url");
|
|
|
- jso = jso.replaceAll("cv_filename","name");
|
|
|
+ jso = jso.replaceAll("cv_filepath", "url");
|
|
|
+ jso = jso.replaceAll("cv_filename", "name");
|
|
|
return jso;
|
|
|
}
|
|
|
|
|
|
@PostMapping("/deleteOrderPayPhoto")
|
|
|
public int deleteOrderPayPhoto(@ModelAttribute CustomerPayVoucher customerPayVoucher) throws ParseException {
|
|
|
try {
|
|
|
- List<CustomerPayVoucher> customerPays= customerPayVoucherService.queryOrderPayPhoto(customerPayVoucher);
|
|
|
- for(CustomerPayVoucher cpv:customerPays){
|
|
|
- String path = payvoucher + "/"+ cpv.getCv_filename();
|
|
|
+ List<CustomerPayVoucher> customerPays = customerPayVoucherService.queryOrderPayPhoto(customerPayVoucher);
|
|
|
+ for (CustomerPayVoucher cpv : customerPays) {
|
|
|
+ String path = payvoucher + "/" + cpv.getCv_filename();
|
|
|
File dest = new File(path);
|
|
|
dest.delete();
|
|
|
}
|
|
|
return customerPayVoucherService.deleteOrderPayPhoto(customerPayVoucher);
|
|
|
- } catch (Exception ex){
|
|
|
+ } catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
return 0;
|
|
|
}
|
|
@@ -454,8 +457,8 @@ public class ImageUploadController {
|
|
|
}
|
|
|
Date date = new Date();
|
|
|
DateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
|
|
|
- String fileUrl = promotionvoucher + "/" + sdf.format(date) +newName;
|
|
|
- String httpfileUrl = httppromotionvoucher + "/" + sdf.format(date) +newName;
|
|
|
+ String fileUrl = promotionvoucher + "/" + sdf.format(date) + newName;
|
|
|
+ String httpfileUrl = httppromotionvoucher + "/" + sdf.format(date) + newName;
|
|
|
File dest = new File(fileUrl);
|
|
|
// 删除
|
|
|
try {
|
|
@@ -466,14 +469,15 @@ public class ImageUploadController {
|
|
|
return "";
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
@GetMapping("/deletePromotionImg")
|
|
|
public int deletePromotionImg(@RequestParam("cv_filename") String cv_filename) throws ParseException {
|
|
|
try {
|
|
|
- String path = promotionvoucher + "/"+ cv_filename;
|
|
|
+ String path = promotionvoucher + "/" + cv_filename;
|
|
|
File dest = new File(path);
|
|
|
dest.delete();
|
|
|
- return 1 ;
|
|
|
- } catch (Exception ex){
|
|
|
+ return 1;
|
|
|
+ } catch (Exception ex) {
|
|
|
ex.printStackTrace();
|
|
|
return 0;
|
|
|
}
|