From 19021b899959ee974e63b84aaf9388c6e122a631 Mon Sep 17 00:00:00 2001 From: dearlin <1261008090@qq.com> Date: Tue, 20 Feb 2024 16:10:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=89=E5=85=A8=E4=BE=8B=E4=BC=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SafetyMeetingController.java | 4 +- .../app/AppSafetyMeetingController.java | 112 +++++++++++++++++- .../safetyMeeting/SafetyMeetingMapper.java | 8 ++ .../safetyMeeting/SafetyMeetingService.java | 8 ++ .../impl/SafetyMeetingServiceImpl.java | 20 ++++ .../service/system/ImgFilesService.java | 1 + .../safetyMeeting/SafetyMeetingMapper.xml | 69 ++++++++++- 7 files changed, 213 insertions(+), 9 deletions(-) diff --git a/src/main/java/com/zcloud/controller/safetyMeeting/SafetyMeetingController.java b/src/main/java/com/zcloud/controller/safetyMeeting/SafetyMeetingController.java index c0a3445..bbfab29 100644 --- a/src/main/java/com/zcloud/controller/safetyMeeting/SafetyMeetingController.java +++ b/src/main/java/com/zcloud/controller/safetyMeeting/SafetyMeetingController.java @@ -99,7 +99,9 @@ public class SafetyMeetingController extends BaseController { PageData pageData = getPageData(); return ReturnMap.ok().put("pd", safetyMeetingService.findById(pageData)) .put("people", safetyMeetingService.saftPersonList(pageData)) - .put("imgs", imgFilesService.getListByKeyAndType(pageData.getString("SAFETY_MEETING_ID"), "105")); + .put("imgs", imgFilesService.getListByKeyAndType(pageData.getString("SAFETY_MEETING_ID"), "105")) + .put("feedbackList", safetyMeetingService.getfeedbackList(pageData)) + ; } /** * @Description: 安全例会 修改 diff --git a/src/main/java/com/zcloud/controller/safetyMeeting/app/AppSafetyMeetingController.java b/src/main/java/com/zcloud/controller/safetyMeeting/app/AppSafetyMeetingController.java index 262f66a..713013a 100644 --- a/src/main/java/com/zcloud/controller/safetyMeeting/app/AppSafetyMeetingController.java +++ b/src/main/java/com/zcloud/controller/safetyMeeting/app/AppSafetyMeetingController.java @@ -1,10 +1,26 @@ package com.zcloud.controller.safetyMeeting.app; import com.zcloud.controller.base.BaseController; -import com.zcloud.util.ReturnMap; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.safetyMeeting.SafetyMeetingService; +import com.zcloud.service.system.ImgFilesService; +import com.zcloud.util.*; +import org.apache.commons.io.FileUtils; +import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.ResponseBody; +import org.springframework.web.multipart.MultipartFile; + +import javax.annotation.Resource; +import java.io.File; +import java.util.ArrayList; +import java.util.Date; +import java.util.HashMap; +import java.util.Map; /** * 说明:TODO @@ -12,13 +28,101 @@ import org.springframework.web.bind.annotation.ResponseBody; * 官网:www.zcloudchina.com */ @Controller -@RequestMapping("app/safetyMeeting") +@RequestMapping("/app/safetyMeeting") public class AppSafetyMeetingController extends BaseController { + @Resource + private SafetyMeetingService safetyMeetingService; + @Resource + private ImgFilesService imgFilesService; + @Autowired + private Smb smb; @RequestMapping(value = "/list") // @RequiresPermissions("safetyMeeting:list") @ResponseBody - public Object list() throws Exception { - return ReturnMap.ok(); + public Object list(Page page) throws Exception { + PageData pageData = this.getPageData(); + page.setPd(pageData); + return ReturnMap.ok().put("page",page).put("varList",safetyMeetingService.appDataList(page)); + } + /** + * @Description: 安全例会详情 + * @Author: dearLin + * @Date: 2024/2/6/006 14:10 + * @Param: [] [] + * @Return: java.lang.Object + */ + @RequestMapping(value = "/goEdit") + // @RequiresPermissions("safetyMeeting:list") + @ResponseBody + public Object goEdit() throws Exception { + PageData pageData = getPageData(); + PageData meetPeopleByUId = safetyMeetingService.findMeetPeopleByUId(pageData); + meetPeopleByUId.putAll(safetyMeetingService.findById(pageData)); + return ReturnMap.ok().put("pd", meetPeopleByUId) + .put("people", safetyMeetingService.saftPersonList(pageData)) + .put("imgs", imgFilesService.getListByKeyAndType(pageData.getString("SAFETY_MEETING_ID"), "105")) + .put("singImgs", imgFilesService.getListByKeyAndType(meetPeopleByUId.getString("SAFETY_MEETING_PEOPLE_ID"), "106")) + ; + } + + /** + * @Description: 手机签字确认 + * @Author: dearLin + * @Date: 2024/2/6/006 14:10 + * @Param: [] [] + * @Return: java.lang.Object + */ + @RequestMapping(value = "/confirm") + // @RequiresPermissions("safetyMeeting:list") + @ResponseBody + public Object confirm() throws Exception { + PageData pageData = getPageData(); + pageData.put("OPERATOR", pageData.getString("USER_ID") ); + pageData.put("OPERATTIME", DateUtil.date2Str(new Date())); + safetyMeetingService.confirmMeetingPeople(pageData); + return ReturnMap.ok().put("pd", safetyMeetingService.findMeetPeopleByUId(pageData)); + } + /**完成 + * @param + * @throws Exception + */ + @RequestMapping(value="/upload", headers = "content-type=multipart/form-data") + @ResponseBody + @Transactional + public Object finish( + @RequestParam(value="FFILE",required=false) MultipartFile[] files + ) throws Exception{ + PageData pageData = this.getPageData(); + String FOREIGN_KEY = pageData.getString("FOREIGN_KEY"); + String TYPE = pageData.getString("TYPE"); + String errInfo = "success"; + String uploadPath = ""; + if (files != null && files.length > 0) { + for (int i = 0; i < files.length; i++) { + MultipartFile file = files[i]; +// 保存文件 + File tempFile = new File(file.getOriginalFilename()); + FileUtils.copyInputStreamToFile(file.getInputStream(), tempFile); + tempFile.delete(); + PageData pd = new PageData(); + pd = this.getPageData(); + + String ffile = DateUtil.getDays(); +// String filePath = PathUtil.getProjectpath() + Const.FILEPATHFILE + ffile; //文件上传路径 +// String fileName = FileUpload.fileUp(file, filePath, this.get32UUID()); //执行上传 + String fileName = this.get32UUID()+file.getOriginalFilename().substring(file.getOriginalFilename().lastIndexOf(".")); + smb.sshSftp(file, fileName, Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile); + + pd.put("IMGFILES_ID", this.get32UUID()); + pd.put("FILEPATH", Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName); + pd.put("TYPE", TYPE); + pd.put("FOREIGN_KEY", FOREIGN_KEY); + imgFilesService.save(pd); + + uploadPath += Const.FILEPATHFILE + pd.getString("CORPINFO_ID") + "/" + ffile + "/" + fileName; + } + } + return ReturnMap.ok().put("imgPath",uploadPath); } } diff --git a/src/main/java/com/zcloud/mapper/datasource/safetyMeeting/SafetyMeetingMapper.java b/src/main/java/com/zcloud/mapper/datasource/safetyMeeting/SafetyMeetingMapper.java index 4f348eb..295f51b 100644 --- a/src/main/java/com/zcloud/mapper/datasource/safetyMeeting/SafetyMeetingMapper.java +++ b/src/main/java/com/zcloud/mapper/datasource/safetyMeeting/SafetyMeetingMapper.java @@ -22,4 +22,12 @@ public interface SafetyMeetingMapper { void edit(PageData pageData); List saftPersonList(PageData pageData); + + List appdatalistPage(Page page); + + void confirmMeetingPeople(PageData pageData); + + PageData findMeetPeopleByUId(PageData pageData); + + List getfeedbackList(PageData pageData); } diff --git a/src/main/java/com/zcloud/service/safetyMeeting/SafetyMeetingService.java b/src/main/java/com/zcloud/service/safetyMeeting/SafetyMeetingService.java index a388692..d3b7a8c 100644 --- a/src/main/java/com/zcloud/service/safetyMeeting/SafetyMeetingService.java +++ b/src/main/java/com/zcloud/service/safetyMeeting/SafetyMeetingService.java @@ -22,4 +22,12 @@ public interface SafetyMeetingService { void edit(PageData pageData); List saftPersonList(PageData pageData); + + List appDataList(Page page); + + void confirmMeetingPeople(PageData pageData); + + PageData findMeetPeopleByUId(PageData pageData); + + List getfeedbackList(PageData pageData); } diff --git a/src/main/java/com/zcloud/service/safetyMeeting/impl/SafetyMeetingServiceImpl.java b/src/main/java/com/zcloud/service/safetyMeeting/impl/SafetyMeetingServiceImpl.java index 829f1b2..2bed888 100644 --- a/src/main/java/com/zcloud/service/safetyMeeting/impl/SafetyMeetingServiceImpl.java +++ b/src/main/java/com/zcloud/service/safetyMeeting/impl/SafetyMeetingServiceImpl.java @@ -110,4 +110,24 @@ public class SafetyMeetingServiceImpl implements SafetyMeetingService { public List saftPersonList(PageData pageData) { return safetyMeetingMapper.saftPersonList(pageData); } + + @Override + public List appDataList(Page page) { + return safetyMeetingMapper.appdatalistPage(page); + } + + @Override + public void confirmMeetingPeople(PageData pageData) { + safetyMeetingMapper.confirmMeetingPeople(pageData); + } + + @Override + public PageData findMeetPeopleByUId(PageData pageData) { + return safetyMeetingMapper.findMeetPeopleByUId(pageData); + } + + @Override + public List getfeedbackList(PageData pageData) { + return safetyMeetingMapper.getfeedbackList(pageData); + } } diff --git a/src/main/java/com/zcloud/service/system/ImgFilesService.java b/src/main/java/com/zcloud/service/system/ImgFilesService.java index b998674..b481ee9 100644 --- a/src/main/java/com/zcloud/service/system/ImgFilesService.java +++ b/src/main/java/com/zcloud/service/system/ImgFilesService.java @@ -84,5 +84,6 @@ public interface ImgFilesService{ * @throws Exception */ public List getListByKeyAndType (Object key ,String type) throws Exception; + } diff --git a/src/main/resources/mybatis/datasource/safetyMeeting/SafetyMeetingMapper.xml b/src/main/resources/mybatis/datasource/safetyMeeting/SafetyMeetingMapper.xml index 86456a2..974f354 100644 --- a/src/main/resources/mybatis/datasource/safetyMeeting/SafetyMeetingMapper.xml +++ b/src/main/resources/mybatis/datasource/safetyMeeting/SafetyMeetingMapper.xml @@ -74,12 +74,23 @@ where SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} + + update + safety_meeting_people + set + FEED_BACK = #{FEED_BACK}, + OPERATOR=#{OPERATOR}, + OPERATTIME=#{OPERATTIME} + where + SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} and + USER_ID = #{USER_ID} + + + +