Merge remote-tracking branch 'origin/dev' into dev

pull/4/head
chenxinying 2024-02-20 16:36:42 +08:00
commit 0d81a7688d
8 changed files with 216 additions and 12 deletions

View File

@ -99,7 +99,9 @@ public class SafetyMeetingController extends BaseController {
PageData pageData = getPageData(); PageData pageData = getPageData();
return ReturnMap.ok().put("pd", safetyMeetingService.findById(pageData)) return ReturnMap.ok().put("pd", safetyMeetingService.findById(pageData))
.put("people", safetyMeetingService.saftPersonList(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: * @Description:

View File

@ -1,10 +1,26 @@
package com.zcloud.controller.safetyMeeting.app; package com.zcloud.controller.safetyMeeting.app;
import com.zcloud.controller.base.BaseController; 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.stereotype.Controller;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping; 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.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 * TODO
@ -12,13 +28,101 @@ import org.springframework.web.bind.annotation.ResponseBody;
* www.zcloudchina.com * www.zcloudchina.com
*/ */
@Controller @Controller
@RequestMapping("app/safetyMeeting") @RequestMapping("/app/safetyMeeting")
public class AppSafetyMeetingController extends BaseController { public class AppSafetyMeetingController extends BaseController {
@Resource
private SafetyMeetingService safetyMeetingService;
@Resource
private ImgFilesService imgFilesService;
@Autowired
private Smb smb;
@RequestMapping(value = "/list") @RequestMapping(value = "/list")
// @RequiresPermissions("safetyMeeting:list") // @RequiresPermissions("safetyMeeting:list")
@ResponseBody @ResponseBody
public Object list() throws Exception { public Object list(Page page) throws Exception {
return ReturnMap.ok(); 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);
} }
} }

View File

@ -22,4 +22,12 @@ public interface SafetyMeetingMapper {
void edit(PageData pageData); void edit(PageData pageData);
List<PageData> saftPersonList(PageData pageData); List<PageData> saftPersonList(PageData pageData);
List<PageData> appdatalistPage(Page page);
void confirmMeetingPeople(PageData pageData);
PageData findMeetPeopleByUId(PageData pageData);
List<PageData> getfeedbackList(PageData pageData);
} }

View File

@ -22,4 +22,12 @@ public interface SafetyMeetingService {
void edit(PageData pageData); void edit(PageData pageData);
List<PageData> saftPersonList(PageData pageData); List<PageData> saftPersonList(PageData pageData);
List<PageData> appDataList(Page page);
void confirmMeetingPeople(PageData pageData);
PageData findMeetPeopleByUId(PageData pageData);
List<PageData> getfeedbackList(PageData pageData);
} }

View File

@ -110,4 +110,24 @@ public class SafetyMeetingServiceImpl implements SafetyMeetingService {
public List<PageData> saftPersonList(PageData pageData) { public List<PageData> saftPersonList(PageData pageData) {
return safetyMeetingMapper.saftPersonList(pageData); return safetyMeetingMapper.saftPersonList(pageData);
} }
@Override
public List<PageData> 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<PageData> getfeedbackList(PageData pageData) {
return safetyMeetingMapper.getfeedbackList(pageData);
}
} }

View File

@ -84,5 +84,6 @@ public interface ImgFilesService{
* @throws Exception * @throws Exception
*/ */
public List<PageData> getListByKeyAndType (Object key ,String type) throws Exception; public List<PageData> getListByKeyAndType (Object key ,String type) throws Exception;
} }

View File

@ -1555,13 +1555,13 @@
AND f.CREATOR = #{loginUserId} AND f.CREATOR = #{loginUserId}
AND ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) IS NOT NULL AND ifnull(bo.OUTSOURCED_ID,boai.OUTSOURCED_ID) IS NOT NULL
) t)CF_COUNT ) t)CF_COUNT
from `qa-gwj-regulatory`.bus_aiwarning f from bus_aiwarning f
where f.ISDELETE = '0' where f.ISDELETE = '0'
and f.STATUS = 0 and f.STATUS = 0
and VIDEOMANAGER_ID in ( and VIDEOMANAGER_ID in (
select vi.VIDEOMANAGER_ID select vi.VIDEOMANAGER_ID
from `qa-gwj-regulatory`.bus_aiwarning_people aip from bus_aiwarning_people aip
left join `qa-gwj-regulatory`. bus_videomanager vi on vi.OUTSOURCED_ID = aip.OUTSOURCED_ID left join bus_videomanager vi on vi.OUTSOURCED_ID = aip.OUTSOURCED_ID
where aip.AIWARNING_PEOPLE = #{loginUserId} where aip.AIWARNING_PEOPLE = #{loginUserId}
and aip.ISDELETE = 0 and aip.ISDELETE = 0
) )

View File

@ -74,12 +74,23 @@
where where
SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} SAFETY_MEETING_ID = #{SAFETY_MEETING_ID}
</update> </update>
<update id="confirmMeetingPeople">
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}
</update>
<select id="datalistPage" resultType="com.zcloud.entity.PageData"> <select id="datalistPage" resultType="com.zcloud.entity.PageData">
SELECT SELECT
t.*, t.*,
COUNT(p.SAFETY_MEETING_ID) ALL_SIGNATURES, COUNT(distinct p.SAFETY_MEETING_ID) ALL_SIGNATURES,
COUNT(p.FEED_BACK) SIGNATURES, COUNT(distinct p.FEED_BACK) SIGNATURES,
GROUP_CONCAT( i.FILEPATH ) imgs GROUP_CONCAT( distinct i.FILEPATH ) imgs
FROM FROM
`safety_meeting` t `safety_meeting` t
LEFT JOIN bus_imgfiles i ON t.SAFETY_MEETING_ID = i.FOREIGN_KEY LEFT JOIN bus_imgfiles i ON t.SAFETY_MEETING_ID = i.FOREIGN_KEY
@ -97,7 +108,57 @@
and SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} and SAFETY_MEETING_ID = #{SAFETY_MEETING_ID}
</select> </select>
<select id="saftPersonList" resultType="com.zcloud.entity.PageData"> <select id="saftPersonList" resultType="com.zcloud.entity.PageData">
SELECT * FROM `safety_meeting_people` where SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} and ISDELETE = 0 SELECT
s.*,
p.`NAME` POST_NAME,
d.`NAME` DEPARTMENT_NAME,
u.`NAME` NAME
FROM
`safety_meeting_people` s
LEFT JOIN sys_post p ON s.post_id = p.POST_ID
LEFT JOIN oa_department d ON s.DEPARTMENT_ID = d.DEPARTMENT_ID
LEFT JOIN sys_user u ON s.USER_ID = u.USER_ID
WHERE
SAFETY_MEETING_ID = #{SAFETY_MEETING_ID}
AND s.ISDELETE = 0
</select>
<select id="appdatalistPage" resultType="com.zcloud.entity.PageData">
SELECT
s.*,
u.`NAME`
FROM
safety_meeting s
LEFT JOIN sys_user u on s.CREATOR = u.USER_ID
WHERE
s.SAFETY_MEETING_ID IN (
SELECT
SAFETY_MEETING_ID
FROM
safety_meeting_people p
WHERE
p.USER_ID = #{pd.USER_ID}
AND p.ISDELETE = 0
and p.FEED_BACK is
<if test="pd.selectType == '1'.toString()">
not
</if>
null
) and s.ISDELETE = 0
</select>
<select id="findMeetPeopleByUId" resultType="com.zcloud.entity.PageData">
select * from safety_meeting_people where USER_ID = #{USER_ID} and SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} and ISDELETE = 0
</select>
<select id="getfeedbackList" resultType="com.zcloud.entity.PageData">
SELECT
p.*,
i.FILEPATH,
u.NAME
FROM
safety_meeting_people p
LEFT JOIN bus_imgfiles i on p.SAFETY_MEETING_PEOPLE_ID = i.FOREIGN_KEY
LEFT JOIN sys_user u on u.USER_ID = p.USER_ID
where SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} and p.ISDELETE = 0
</select> </select>