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

pull/4/head
fangjiakai 2024-02-20 14:17:32 +08:00
commit 98103d92f3
9 changed files with 125 additions and 33 deletions

View File

@ -5,6 +5,7 @@ import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page; import com.zcloud.entity.Page;
import com.zcloud.entity.PageData; import com.zcloud.entity.PageData;
import com.zcloud.service.safetyMeeting.SafetyMeetingService; import com.zcloud.service.safetyMeeting.SafetyMeetingService;
import com.zcloud.service.system.ImgFilesService;
import com.zcloud.util.InitPageDataUtil; import com.zcloud.util.InitPageDataUtil;
import com.zcloud.util.Jurisdiction; import com.zcloud.util.Jurisdiction;
import com.zcloud.util.ReturnMap; import com.zcloud.util.ReturnMap;
@ -27,6 +28,8 @@ public class SafetyMeetingController extends BaseController {
@Resource @Resource
private SafetyMeetingService safetyMeetingService; private SafetyMeetingService safetyMeetingService;
@Resource @Resource
private ImgFilesService imgFilesService;
@Resource
private InitPageDataUtil initPageDataUtil; private InitPageDataUtil initPageDataUtil;
/** /**
@ -45,7 +48,7 @@ public class SafetyMeetingController extends BaseController {
initPageDataUtil.initSave(pageData,"SAFETY_MEETING_ID"); initPageDataUtil.initSave(pageData,"SAFETY_MEETING_ID");
safetyMeetingService.save(pageData); safetyMeetingService.save(pageData);
return ReturnMap.ok(); return ReturnMap.ok().put("SAFETY_MEETING_ID", pageData.getString("SAFETY_MEETING_ID"));
} }
/** /**
@ -94,7 +97,9 @@ public class SafetyMeetingController extends BaseController {
@ResponseBody @ResponseBody
public Object goEdit() throws Exception { public Object goEdit() throws Exception {
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("imgs", imgFilesService.getListByKeyAndType(pageData.getString("SAFETY_MEETING_ID"), "105"));
} }
/** /**
* @Description: * @Description:
@ -109,6 +114,6 @@ public class SafetyMeetingController extends BaseController {
public Object edit() throws Exception { public Object edit() throws Exception {
PageData pageData = getPageData(); PageData pageData = getPageData();
safetyMeetingService.edit(pageData); safetyMeetingService.edit(pageData);
return ReturnMap.ok(); return ReturnMap.ok().put("SAFETY_MEETING_ID", pageData.getString("SAFETY_MEETING_ID"));
} }
} }

View File

@ -316,6 +316,11 @@ public class DepartmentController extends BaseController {
dept=this.departmentService.findByCorpId(dept); dept=this.departmentService.findByCorpId(dept);
Department depar = new Department(); Department depar = new Department();
if(pd.get("rootDisabled")!= null && pd.get("rootDisabled").toString().equals("Y")){
depar.setDISABLED(true);
}else {
depar.setDISABLED(false);
}
depar.setDEPARTMENT_ID(dept.getString("DEPARTMENT_ID")); depar.setDEPARTMENT_ID(dept.getString("DEPARTMENT_ID"));
depar.setPARENT_ID(dept.getString("PARENT_ID")); depar.setPARENT_ID(dept.getString("PARENT_ID"));
depar.setNAME(dept.getString("NAME")); depar.setNAME(dept.getString("NAME"));

View File

@ -20,4 +20,6 @@ public interface SafetyMeetingMapper {
PageData findById(PageData pageData); PageData findById(PageData pageData);
void edit(PageData pageData); void edit(PageData pageData);
List<PageData> saftPersonList(PageData pageData);
} }

View File

@ -11,4 +11,10 @@ import java.util.List;
*/ */
public interface SafetyMeetingPeopleMapper { public interface SafetyMeetingPeopleMapper {
void saveBatch(List<PageData> safetyMeetingPeopledataList); void saveBatch(List<PageData> safetyMeetingPeopledataList);
void removeBySafetMeetingId(PageData pageData);
void saveOrUpdateBatch(List<PageData> safetyMeetingPeopledataList);
void removeBySafetMeetingUserFeedback(PageData pageData);
} }

View File

@ -20,4 +20,6 @@ public interface SafetyMeetingService {
PageData findById(PageData pageData); PageData findById(PageData pageData);
void edit(PageData pageData); void edit(PageData pageData);
List<PageData> saftPersonList(PageData pageData);
} }

View File

@ -14,6 +14,7 @@ import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/** /**
* TODO * TODO
@ -35,18 +36,24 @@ public class SafetyMeetingServiceImpl implements SafetyMeetingService {
public void save(PageData pageData) { public void save(PageData pageData) {
List<PageData> dataList = JSON.parseArray(pageData.getString("people"), PageData.class); List<PageData> dataList = JSON.parseArray(pageData.getString("people"), PageData.class);
List<PageData> safetyMeetingPeopledataList = new ArrayList<>(); List<PageData> safetyMeetingPeopledataList = new ArrayList<>();
AtomicInteger peopleCount = new AtomicInteger();
dataList.forEach(item ->{ dataList.forEach(item ->{
String[] userIds = item.getString("USER_ID").split(","); String DEPARTMENT_ID = item.getString("DEPARTMENT_ID");
String POST_ID = item.getString("POST_ID");
List<String> userIds = JSON.parseArray(item.getString("USER_ID"),String.class);
peopleCount.addAndGet(userIds.size());
for (String userId : userIds) { for (String userId : userIds) {
PageData safetyMeetingPeopledata = new PageData(); PageData safetyMeetingPeopledata = new PageData();
safetyMeetingPeopledata.put("SAFETY_MEETING_ID",pageData.getString("SAFETY_MEETING_ID")); safetyMeetingPeopledata.put("SAFETY_MEETING_ID",pageData.getString("SAFETY_MEETING_ID"));
safetyMeetingPeopledata.put("SIGNATORY",userId); safetyMeetingPeopledata.put("USER_ID",userId);
safetyMeetingPeopledata.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID()); safetyMeetingPeopledata.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
safetyMeetingPeopledata.put("POST_ID", POST_ID);
safetyMeetingPeopledata.put("DEPARTMENT_ID", DEPARTMENT_ID);
initPageDataUtil.initSave(safetyMeetingPeopledata,"SAFETY_MEETING_PEOPLE_ID"); initPageDataUtil.initSave(safetyMeetingPeopledata,"SAFETY_MEETING_PEOPLE_ID");
safetyMeetingPeopledataList.add(safetyMeetingPeopledata); safetyMeetingPeopledataList.add(safetyMeetingPeopledata);
} }
}); });
pageData.put("ALL_SIGNATURES",dataList.size()); pageData.put("ALL_SIGNATURES",peopleCount.get());
pageData.put("SIGNATURES",0); pageData.put("SIGNATURES",0);
safetyMeetingMapper.save(pageData); safetyMeetingMapper.save(pageData);
safetyMeetingPeopleMapper.saveBatch(safetyMeetingPeopledataList); safetyMeetingPeopleMapper.saveBatch(safetyMeetingPeopledataList);
@ -69,6 +76,38 @@ public class SafetyMeetingServiceImpl implements SafetyMeetingService {
@Override @Override
public void edit(PageData pageData) { public void edit(PageData pageData) {
// 首先把 涉及人删掉
safetyMeetingPeopleMapper.removeBySafetMeetingId(pageData);
initPageDataUtil.initEdit(pageData);
List<PageData> dataList = JSON.parseArray(pageData.getString("people"), PageData.class);
List<PageData> safetyMeetingPeopledataList = new ArrayList<>();
AtomicInteger peopleCount = new AtomicInteger();
dataList.forEach(item ->{
String DEPARTMENT_ID = item.getString("DEPARTMENT_ID");
String POST_ID = item.getString("POST_ID");
List<String> userIds = JSON.parseArray(item.getString("USER_ID"),String.class);
peopleCount.addAndGet(userIds.size());
for (String userId : userIds) {
PageData safetyMeetingPeopledata = new PageData();
safetyMeetingPeopledata.put("SAFETY_MEETING_ID", pageData.getString("SAFETY_MEETING_ID"));
safetyMeetingPeopledata.put("USER_ID", userId);
safetyMeetingPeopledata.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
safetyMeetingPeopledata.put("POST_ID", POST_ID);
safetyMeetingPeopledata.put("DEPARTMENT_ID", DEPARTMENT_ID);
initPageDataUtil.initSave(safetyMeetingPeopledata, "SAFETY_MEETING_PEOPLE_ID");
safetyMeetingPeopledataList.add(safetyMeetingPeopledata);
}
});
safetyMeetingMapper.edit(pageData); safetyMeetingMapper.edit(pageData);
// 把删除的人重新激活
safetyMeetingPeopleMapper.saveOrUpdateBatch(safetyMeetingPeopledataList);
// 清理掉被删除人的反馈
safetyMeetingPeopleMapper.removeBySafetMeetingUserFeedback(pageData);
}
@Override
public List<PageData> saftPersonList(PageData pageData) {
return safetyMeetingMapper.saftPersonList(pageData);
} }
} }

View File

@ -280,8 +280,8 @@
left join BUS_LIMITSPACE sp on sp.LIMITSPACE_ID=f.LIMITSPACE_ID left join BUS_LIMITSPACE sp on sp.LIMITSPACE_ID=f.LIMITSPACE_ID
left join oa_department as woro on f.APPLY_DEPARTMENT_ID = woro.DEPARTMENT_ID left join oa_department as woro on f.WORK_DEPARTMENT_ID = woro.DEPARTMENT_ID
left join sys_user as woru on f.APPLY_USER_ID = woru.USER_ID left join sys_user as woru on f.WORK_USER_ID = woru.USER_ID
left join oa_department as appo on f.APPLY_DEPARTMENT_ID = appo.DEPARTMENT_ID left join oa_department as appo on f.APPLY_DEPARTMENT_ID = appo.DEPARTMENT_ID
left join sys_user as appu on f.APPLY_USER_ID = appu.USER_ID left join sys_user as appu on f.APPLY_USER_ID = appu.USER_ID

View File

@ -8,14 +8,9 @@
</sql> </sql>
<!-- 字段 --> <!-- 字段 -->
<sql id="Field"> <sql id="Field">
f f.SAFETY_MEETING_ID,
.
SAFETY_MEETING_ID
,
f.SAFETY_MEETING_TITLE, f.SAFETY_MEETING_TITLE,
f.SAFETY_MEETING_CONTENT, f.SAFETY_MEETING_CONTENT,
f.SIGNATURES,
f.ALL_SIGNATURES,
f.CORPINFO_ID, f.CORPINFO_ID,
f.CREATOR, f.CREATOR,
f.CREATTIME, f.CREATTIME,
@ -25,12 +20,9 @@
</sql> </sql>
<!-- 字段用于新增 --> <!-- 字段用于新增 -->
<sql id="Field2"> <sql id="Field2">
SAFETY_MEETING_ID SAFETY_MEETING_ID,
,
SAFETY_MEETING_TITLE, SAFETY_MEETING_TITLE,
SAFETY_MEETING_CONTENT, SAFETY_MEETING_CONTENT,
SIGNATURES,
ALL_SIGNATURES,
CORPINFO_ID, CORPINFO_ID,
CREATOR, CREATOR,
CREATTIME, CREATTIME,
@ -41,12 +33,9 @@
<!-- 字段值 --> <!-- 字段值 -->
<sql id="FieldValue"> <sql id="FieldValue">
#{SAFETY_MEETING_ID} #{SAFETY_MEETING_ID},
,
#{SAFETY_MEETING_TITLE}, #{SAFETY_MEETING_TITLE},
#{SAFETY_MEETING_CONTENT}, #{SAFETY_MEETING_CONTENT},
#{SIGNATURES},
#{ALL_SIGNATURES},
#{CORPINFO_ID}, #{CORPINFO_ID},
#{CREATOR}, #{CREATOR},
#{CREATTIME}, #{CREATTIME},
@ -80,26 +69,36 @@
set set
SAFETY_MEETING_TITLE=#{SAFETY_MEETING_TITLE}, SAFETY_MEETING_TITLE=#{SAFETY_MEETING_TITLE},
SAFETY_MEETING_CONTENT=#{SAFETY_MEETING_CONTENT}, SAFETY_MEETING_CONTENT=#{SAFETY_MEETING_CONTENT},
SIGNATURES=#{SIGNATURES},
ALL_SIGNATURES=#{ALL_SIGNATURES},
CORPINFO_ID=#{CORPINFO_ID},
CREATOR=#{CREATOR},
CREATTIME=#{CREATTIME},
OPERATOR=#{OPERATOR}, OPERATOR=#{OPERATOR},
OPERATTIME=#{OPERATTIME} OPERATTIME=#{OPERATTIME}
where where
SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} SAFETY_MEETING_ID = #{SAFETY_MEETING_ID}
</update> </update>
<select id="datalistPage" resultType="com.zcloud.entity.PageData"> <select id="datalistPage" resultType="com.zcloud.entity.PageData">
select * from <include refid="tableName"></include> where ISDELETE = '0' and CORPINFO_ID = #{pd.CORPINFO_ID} SELECT
t.*,
COUNT(p.SAFETY_MEETING_ID) ALL_SIGNATURES,
COUNT(p.FEED_BACK) SIGNATURES,
GROUP_CONCAT( i.FILEPATH ) imgs
FROM
`safety_meeting` t
LEFT JOIN bus_imgfiles i ON t.SAFETY_MEETING_ID = i.FOREIGN_KEY
LEFT JOIN safety_meeting_people p ON t.SAFETY_MEETING_ID = p.SAFETY_MEETING_ID and p.ISDELETE = 0
where t.ISDELETE = '0' and t.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.SAFETY_MEETING_TITLE != null and pd.SAFETY_MEETING_TITLE != ''"> <if test="pd.SAFETY_MEETING_TITLE != null and pd.SAFETY_MEETING_TITLE != ''">
and SAFETY_MEETING_TITLE like '%${pd.SAFETY_MEETING_TITLE}%' and t.SAFETY_MEETING_TITLE like '%${pd.SAFETY_MEETING_TITLE}%'
</if> </if>
GROUP BY
t.SAFETY_MEETING_ID
ORDER BY t.OPERATTIME desc
</select> </select>
<select id="findById" resultType="com.zcloud.entity.PageData"> <select id="findById" resultType="com.zcloud.entity.PageData">
select * from <include refid="tableName"></include> where ISDELETE = '0' select * from <include refid="tableName"></include> where ISDELETE = '0'
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 * FROM `safety_meeting_people` where SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} and ISDELETE = 0
</select>
</mapper> </mapper>

View File

@ -16,7 +16,9 @@
<sql id="Field"> <sql id="Field">
f.SAFETY_MEETING_PEOPLE_ID, f.SAFETY_MEETING_PEOPLE_ID,
f.SAFETY_MEETING_ID, f.SAFETY_MEETING_ID,
f.SIGNATORY, f.USER_ID,
f.DEPARTMENT_ID,
f.POST_ID,
f.FEED_BACK, f.FEED_BACK,
f.CORPINFO_ID, f.CORPINFO_ID,
f.CREATOR, f.CREATOR,
@ -30,7 +32,9 @@
<sql id="Field2"> <sql id="Field2">
SAFETY_MEETING_PEOPLE_ID, SAFETY_MEETING_PEOPLE_ID,
SAFETY_MEETING_ID, SAFETY_MEETING_ID,
SIGNATORY, DEPARTMENT_ID,
POST_ID,
USER_ID,
FEED_BACK, FEED_BACK,
CORPINFO_ID, CORPINFO_ID,
CREATOR, CREATOR,
@ -44,7 +48,9 @@
<sql id="FieldValue"> <sql id="FieldValue">
#{SAFETY_MEETING_PEOPLE_ID}, #{SAFETY_MEETING_PEOPLE_ID},
#{SAFETY_MEETING_ID}, #{SAFETY_MEETING_ID},
#{SIGNATORY}, #{DEPARTMENT_ID},
#{POST_ID},
#{USER_ID},
#{FEED_BACK}, #{FEED_BACK},
#{CORPINFO_ID}, #{CORPINFO_ID},
#{CREATOR}, #{CREATOR},
@ -56,7 +62,9 @@
<sql id="FieldValue2"> <sql id="FieldValue2">
#{item.SAFETY_MEETING_PEOPLE_ID}, #{item.SAFETY_MEETING_PEOPLE_ID},
#{item.SAFETY_MEETING_ID}, #{item.SAFETY_MEETING_ID},
#{item.SIGNATORY}, #{item.DEPARTMENT_ID},
#{item.POST_ID},
#{item.USER_ID},
#{item.FEED_BACK}, #{item.FEED_BACK},
#{item.CORPINFO_ID}, #{item.CORPINFO_ID},
#{item.CREATOR}, #{item.CREATOR},
@ -82,5 +90,31 @@
(<include refid="FieldValue2"></include>) (<include refid="FieldValue2"></include>)
</foreach> </foreach>
</insert> </insert>
<update id="removeBySafetMeetingId">
update
<include refid="tableName"></include>
set
ISDELETE = '1',
OPERATOR=#{OPERATOR},
OPERATTIME=#{OPERATTIME}
where
SAFETY_MEETING_ID = #{SAFETY_MEETING_ID}
</update>
<update id="saveOrUpdateBatch">
insert into <include refid="tableName"></include>
(<include refid="Field2"></include>) values
<foreach item="item" index="index" collection="list" separator="," >
(<include refid="FieldValue2"></include>)
</foreach>
ON DUPLICATE KEY UPDATE `ISDELETE` = 0
</update>
<update id="removeBySafetMeetingUserFeedback">
update
<include refid="tableName"></include>
set
FEED_BACK = null
where
SAFETY_MEETING_ID = #{SAFETY_MEETING_ID} and ISDELETE = 1
</update>
</mapper> </mapper>