|
@@ -61,6 +61,7 @@ import org.jeecg.modules.splt.service.ISyPackingListTailoringService;
|
|
|
import org.jeecg.modules.splt.service.ISyPackingListTailoringItemService;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.servlet.ModelAndView;
|
|
|
import org.springframework.web.multipart.MultipartFile;
|
|
@@ -1352,6 +1353,59 @@ public class SyPackingListTailoringController {
|
|
|
return result;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ @Value(value = "${jeecg.path.upload}")
|
|
|
+ private String uploadpath;
|
|
|
+
|
|
|
+ @AutoLog(value = "附件删除")
|
|
|
+ @ApiOperation(value="附件删除", notes="附件删除")
|
|
|
+ @RequestMapping(value = "/deleteFile")
|
|
|
+ public Result deleteFile(String fileName,String id){
|
|
|
+ Result result=new Result();
|
|
|
+ if(oConvertUtils.isEmpty(id)){
|
|
|
+ result.setMessage("id为空");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ if(oConvertUtils.isEmpty(fileName)){
|
|
|
+ result.setMessage("附件名为空");
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+ SyPackingListTailoring syPackingListTailoring=syPackingListTailoringService.getById(id);
|
|
|
+ if(syPackingListTailoring!=null){//当成衣不为空
|
|
|
+ if(syPackingListTailoring.getAccessory()!=null){//
|
|
|
+ List<String> accessorys=new ArrayList<>(Arrays.asList(syPackingListTailoring.getAccessory().split(",")));
|
|
|
+ accessorys.remove(fileName);
|
|
|
+
|
|
|
+ if(accessorys.size()>0){
|
|
|
+ String accessory="";
|
|
|
+ for (String acc : accessorys){
|
|
|
+ accessory+=acc+",";
|
|
|
+ }
|
|
|
+ syPackingListTailoring.setAccessory(accessory.substring(0,accessory.length()-1));
|
|
|
+ }else{
|
|
|
+ syPackingListTailoring.setAccessory(null);
|
|
|
+ }
|
|
|
+ syPackingListTailoringService.updateById(syPackingListTailoring);
|
|
|
+
|
|
|
+ System.out.println("文件地址\n"+uploadpath+"/"+fileName);
|
|
|
+ File file=new File(uploadpath+"/"+fileName);
|
|
|
+ if (file.exists()) {
|
|
|
+ if (file.delete()) {
|
|
|
+ result.setMessage("已删除该文件!");
|
|
|
+ }else{
|
|
|
+ result.setMessage("文件删除失败!");
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ result.setMessage("文件不存在!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else{
|
|
|
+ result.setMessage("数据库未找到该数据");
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@AutoLog(value = "调试接口-采购发票")
|
|
|
@ApiOperation(value="调试接口-采购发票", notes="调试接口-采购发票")
|
|
|
@RequestMapping(value = "/pushJson", method = {RequestMethod.POST})
|