From 3cc4a13ad3a240f80a57eb9bcc8897307cbe2ce2 Mon Sep 17 00:00:00 2001 From: WenShiJun Date: Wed, 19 Jun 2024 17:25:57 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A5=E5=8F=97=E4=BA=A4=E5=BA=95=E4=BA=BA?= =?UTF-8?q?=EF=BC=8C=E5=AE=8C=E5=B7=A5=E9=AA=8C=E6=94=B6=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=A4=9A=E5=BC=A0=E7=AD=BE=E5=AD=97=E5=9B=BE=E7=89=87=E9=80=BB?= =?UTF-8?q?=E8=BE=91=E4=BF=AE=E6=94=B9=EF=BC=8C=E6=96=B0=E5=A2=9EsaveFiles?= =?UTF-8?q?=E6=96=B9=E6=B3=95=20=E6=96=B0=E5=A2=9E=E5=8A=A8=E7=81=AB?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E4=BA=BA=E5=9B=BE=E7=89=87=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppElectricityController.java | 2 +- .../highriskwork/AppHotworkCfdController.java | 22 +++++++++++++++++++ .../impl/HotworkCfdServiceImpl.java | 4 +++- src/main/java/com/zcloud/util/Warden.java | 14 ++++++++++++ .../highriskwork/HotworkCfdMapper.xml | 10 ++++++++- 5 files changed, 49 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/zcloud/controller/app/highriskwork/AppElectricityController.java b/src/main/java/com/zcloud/controller/app/highriskwork/AppElectricityController.java index 4ce80844..3b6aaa03 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppElectricityController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppElectricityController.java @@ -38,7 +38,7 @@ import java.util.*; * 官网:www.zcloudchina.com */ @Controller -@RequestMapping("/app/electricity") +@RequestMapping("c") public class AppElectricityController extends BaseController { @Autowired diff --git a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java index ba9ab934..8185f65d 100644 --- a/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java +++ b/src/main/java/com/zcloud/controller/app/highriskwork/AppHotworkCfdController.java @@ -23,6 +23,7 @@ import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartRequest; import javax.annotation.Resource; +import java.io.File; import java.text.DecimalFormat; import java.text.ParseException; import java.text.SimpleDateFormat; @@ -1693,6 +1694,7 @@ public class AppHotworkCfdController extends BaseController { // created by liu jun 添加(交底人、项目主管部门负责人、安全措施确认人) hotworkCfdService.addInfo(pd); + //气体检测数据 map.put("gasList", hotworkGasCfdService.listAll(pd)); // imgList是接受交底人签字 List acceptConfessList = (List) pd.get("acceptConfessList"); @@ -1717,6 +1719,26 @@ public class AppHotworkCfdController extends BaseController { return map; } + /**删除动火操作人图片 + * @param + * @throws Exception + */ + @RequestMapping(value="/delImg") + @ResponseBody + @LogAnno(menuType= "手机",menuServer= "动火作业",instructionsOperate = "动火作业",instructionsType = "删除动火操作人图片") + public Object delImg() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = imgFilesService.findById(pd); //根据ID读取 + File file = new File(PathUtil.getProjectpath()+pd.getString("FILEPATH")); + file.delete(); + imgFilesService.delete(pd); + map.put("result", errInfo); //返回结果 + return map; + } + /**去修改页面获取数据 * @param * @throws Exception diff --git a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java index de302e57..6b385b51 100644 --- a/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java +++ b/src/main/java/com/zcloud/service/highriskwork/impl/HotworkCfdServiceImpl.java @@ -254,7 +254,9 @@ public class HotworkCfdServiceImpl implements HotworkCfdService { if (approvalInfos.size() > 1) throw new RuntimeException("审批信息异常,请联系管理员"); PageData entity = approvalInfos.get(0); entity.put("APPROVAL_STATUS", request.getString("APPROVAL_STATUS")); - entity.put("APPROVAL_SIGNATURE", Warden.saveFile(files,request.getString("CORPINFO_ID"))); +// entity.put("APPROVAL_SIGNATURE", Warden.saveFile(files,request.getString("CORPINFO_ID"))); + List filePaths = Warden.saveFiles(files, request.getString("CORPINFO_ID")); + entity.put("APPROVAL_SIGNATURE", String.join(";", filePaths)); entity.put("APPROVAL_SIGNATURE_TIME", DateUtil.getTime()); entity.put("APPROVAL_CONTENT",request.getString("APPROVAL_CONTENT")); busHotworkCfdExamineMapper.edit(entity); diff --git a/src/main/java/com/zcloud/util/Warden.java b/src/main/java/com/zcloud/util/Warden.java index 3de3e253..5eb5629a 100644 --- a/src/main/java/com/zcloud/util/Warden.java +++ b/src/main/java/com/zcloud/util/Warden.java @@ -381,6 +381,19 @@ public class Warden { return saveFile(files, CORPINFO_ID); } + //保存多图片 + public static List saveFiles(MultipartFile[] files, String number) throws Exception { + if (files.length == 0) throw new RuntimeException("文件为空"); + List filePaths = new ArrayList<>(); + for (MultipartFile file : files) { + String ffile = DateUtil.getDays(); + String fileName = get32UUID() + file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + Smb.sshSftp(file, fileName, Const.FILEPATHFILE + number + "/" + ffile); + filePaths.add(Const.FILEPATHFILE + number + "/" + ffile + "/" + fileName); + } + return filePaths; + } + /** * 压缩文件 */ @@ -479,5 +492,6 @@ public class Warden { } throw new IOException("压缩文件失败"); } + } diff --git a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml index dd95a7f4..7f0973a9 100644 --- a/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml +++ b/src/main/resources/mybatis/datasource/highriskwork/HotworkCfdMapper.xml @@ -606,7 +606,15 @@ bhe.HOTWORK_ID = f.HOTWORK_ID and bhe.TYPE = 1 and bhe.IS_DELETE = '0' - left join bus_hotwork_acceptuser_cfd bhac on bhac.HOTWORK_ID = f.HOTWORK_ID +-- left join bus_hotwork_acceptuser_cfd bhac on bhac.HOTWORK_ID = f.HOTWORK_ID + left join ( + select + HOTWORK_ID, + GROUP_CONCAT(ACCEPT_USER_SIGNER_PATH SEPARATOR ',') as ACCEPT_USER_SIGNER_PATH, + GROUP_CONCAT(ACCEPT_USER_SIGNER_TIME SEPARATOR ',') as ACCEPT_USER_SIGNER_TIME + from bus_hotwork_acceptuser_cfd + group by HOTWORK_ID + ) bhac on bhac.HOTWORK_ID = f.HOTWORK_ID where f.HOTWORK_ID = #{HOTWORK_ID}