Commit ec9b1ab2 authored by wuqinghua's avatar wuqinghua

2022-3-9 吴卿华

parent c21f497e
package com.zehong.web.controller.supervise; package com.zehong.web.controller.supervise;
import java.io.File;
import java.text.ParseException; import java.text.ParseException;
import java.util.List; import java.util.List;
import com.zehong.common.config.GassafetyProgressConfig;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
...@@ -85,6 +88,20 @@ public class TEmployedPeopleInfoController extends BaseController ...@@ -85,6 +88,20 @@ public class TEmployedPeopleInfoController extends BaseController
//根据企业id查询企业名称 //根据企业id查询企业名称
String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId()); String EnterpriseName = tEmployedPeopleInfoService.selectEnterpriseName(tEmployedPeopleInfo.getBeyondEnterpriseId());
tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName); tEmployedPeopleInfo.setBeyondEnterpriseName(EnterpriseName);
//查询修改之前图片存储路径
TEmployedPeopleInfo tEmployedPeopleInfos = tEmployedPeopleInfoService.selectTEmployedPeopleInfoById(tEmployedPeopleInfo.getEmployedPeopleId());
//文件删除
if (tEmployedPeopleInfos.getAvatarAddress()!=null){
// 上传文件路径
String filePath = GassafetyProgressConfig.getUploadPath();
String[] strs = tEmployedPeopleInfos.getAvatarAddress().split("upload");
//删除图片
File file = new File(filePath+strs[1].toString());
// 上传文件路径
if(file.isFile()){
file.delete();
}
}
return toAjax(tEmployedPeopleInfoService.updateTEmployedPeopleInfo(tEmployedPeopleInfo)); return toAjax(tEmployedPeopleInfoService.updateTEmployedPeopleInfo(tEmployedPeopleInfo));
} }
......
...@@ -4,6 +4,8 @@ import java.io.File; ...@@ -4,6 +4,8 @@ import java.io.File;
import java.util.List; import java.util.List;
import com.zehong.common.config.GassafetyProgressConfig; import com.zehong.common.config.GassafetyProgressConfig;
import com.zehong.common.utils.file.FileUploadUtils;
import com.zehong.framework.config.ServerConfig;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
...@@ -38,7 +40,8 @@ public class TEnterpriseInfoController extends BaseController ...@@ -38,7 +40,8 @@ public class TEnterpriseInfoController extends BaseController
{ {
@Autowired @Autowired
private ITEnterpriseInfoService tEnterpriseInfoService; private ITEnterpriseInfoService tEnterpriseInfoService;
@Autowired
private ServerConfig serverConfig;
/** /**
* 查询企业信息列表 * 查询企业信息列表
*/ */
...@@ -118,13 +121,18 @@ public class TEnterpriseInfoController extends BaseController ...@@ -118,13 +121,18 @@ public class TEnterpriseInfoController extends BaseController
{ {
//查询修改之前图片地址 //查询修改之前图片地址
TEnterpriseInfo tEnterpriseInfo1 = tEnterpriseInfoService.selectTEnterpriseInfoById(tEnterpriseInfo.getEnterpriseId()); TEnterpriseInfo tEnterpriseInfo1 = tEnterpriseInfoService.selectTEnterpriseInfoById(tEnterpriseInfo.getEnterpriseId());
// //删除图片 //文件删除
// File file = new File(tEnterpriseInfo1.getDoDusiness()); if (tEnterpriseInfo1.getDoDusiness()!=null){
// // 上传文件路径 // 上传文件路径
// String filePath = GassafetyProgressConfig.getUploadPath(); String filePath = GassafetyProgressConfig.getUploadPath();
// if(file.isFile()){ String[] strs = tEnterpriseInfo1.getDoDusiness().split("upload");
// file.delete(); //删除图片
// } File file = new File(filePath+strs[1].toString());
// 上传文件路径
if(file.isFile()){
file.delete();
}
}
return toAjax(tEnterpriseInfoService.updateTEnterpriseInfo(tEnterpriseInfo)); return toAjax(tEnterpriseInfoService.updateTEnterpriseInfo(tEnterpriseInfo));
} }
......
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