BUG优化

dev
xiepeng 2024-04-10 16:53:54 +08:00
parent 78e0bccac5
commit 4daee83b45
7 changed files with 74 additions and 65 deletions

View File

@ -61,7 +61,15 @@ public class AppTrafficSecurityNoticeController extends BaseController {
Map<String, Object> map = new HashMap<String, Object>();
String errInfo = "success";
PageData pd = this.getPageData();
PageData pageData = new PageData();
pageData.put("NOTIFICATION_ID", pd.getString("NOTIFICATION_ID"));
pageData.put("PERSON_ID", pd.getString("USER_ID"));
PageData securityNotice = securityReadDetail.listByUserIdOrNoticeId(pageData);
if(StringUtils.isEmpty(securityNotice.getString("SIGNEDDATE"))) {
pd.put("SIGNEDDATE",DateUtil.date2Str(new Date())); // 签收时间
}else{
pd.put("SIGNEDDATE",securityNotice.getString("SIGNEDDATE"));
}
pd.put("SIGNING", "1"); //设置签收情况
if (pd.getString("REPLYCONTENT") != null && !pd.getString("REPLYCONTENT").isEmpty()) {
pd.put("REPLYDATE", DateUtil.date2Str(new Date())); //设置回复时间

View File

@ -137,27 +137,27 @@ public class TrafficSecurityNoticeController extends BaseController {
long replyStatusNum = 0;
long signedStatusNum = 0;
for (PageData data : varList) {
pd.put("NOTIFICATION_ID", data.get("NOTIFICATION_ID"));
page.setPd(pd);
List<PageData> readDetail = securityReadDetail.getAllReadDetail(page);
// pd.put("NOTIFICATION_ID", data.get("NOTIFICATION_ID"));
// page.setPd(pd);
// List<PageData> readDetail = securityReadDetail.getAllReadDetail(page);
//
// long currentReplyStatusNum = readDetail.stream()
// .filter(d -> "1".equals(d.getString("REPLY")))
// .count();
// long currentSignedStatusNum = readDetail.stream()
// .filter(d -> "1".equals(d.getString("SIGNING")))
// .count();
// long currentTotalReadDetail = readDetail.size();
//
// replyStatusNum += currentReplyStatusNum;
// signedStatusNum += currentSignedStatusNum;
// data.put("REPLYSTATUSNUM", currentReplyStatusNum);
// data.put("SIGNEDSTATUSNUM", currentSignedStatusNum);
long currentReplyStatusNum = readDetail.stream()
.filter(d -> "1".equals(d.getString("REPLY")))
.count();
long currentSignedStatusNum = readDetail.stream()
.filter(d -> "1".equals(d.getString("SIGNING")))
.count();
long currentTotalReadDetail = readDetail.size();
replyStatusNum += currentReplyStatusNum;
signedStatusNum += currentSignedStatusNum;
data.put("TOTALREADDETAIL", currentTotalReadDetail);
data.put("REPLYSTATUSNUM", currentReplyStatusNum);
data.put("SIGNEDSTATUSNUM", currentSignedStatusNum);
// 获取 回复与签收 的总人数
data.put("TOTALREADDETAIL", Tools.notEmpty(data.getString("PERSON_ID"))?data.getString("PERSON_ID").split(",").length : 0);
}
map.put("REPLYSTATUSNUM", String.valueOf(replyStatusNum));
map.put("SIGNEDSTATUSNUM", String.valueOf(signedStatusNum));
map.put("varList", varList);
map.put("page", page);
map.put("result", errInfo);
@ -167,7 +167,6 @@ public class TrafficSecurityNoticeController extends BaseController {
//详情
@RequestMapping(value="/goEdit")
// @RequiresPermissions("traininginfo:edit")
@ResponseBody
public Object goEdit() throws Exception{
Map<String,Object> map = new HashMap<String,Object>();
@ -176,22 +175,24 @@ public class TrafficSecurityNoticeController extends BaseController {
pd = this.getPageData();
pd = securityNoticeService.findById(pd);//根据ID读取
String[] personIds = pd.getString("PERSON_ID").split(",");
List<PageData> names = new ArrayList<>();
List<PageData> readDetail = new ArrayList<>();
List<PageData> names = new ArrayList<>();
for (String personId : personIds) {
PageData pageData = new PageData();
pageData.put("USER_ID",personId);
pageData.put("NOTIFICATION_ID",pd.getString("NOTIFICATION_ID"));
PageData pageData1 = usersService.findById(pageData);
PageData pd2 = new PageData();
pd2.put("NOTIFICATION_ID", pd.getString("NOTIFICATION_ID"));
pd2.put("PERSON_ID",personId.trim());
PageData pageData = trafficSecurityReadDetailService.listByUserIdOrNoticeId(pd2);
readDetail.add(pageData);
// 通过 用户id获取用户名
PageData user = new PageData();
user.put("USER_ID",personId.trim());
PageData pageData1 = usersService.findById(user);
names.add(pageData1);
Page page = new Page();
page.setPd(pageData);
readDetail = trafficSecurityReadDetailService.listByUserIdOrNoticeId(page);
}
pd.put("readDetail",readDetail);
pd.put("names",names);
map.put("pd", pd);
//map.put("readDetail", readDetail);
map.put("names", names);
map.put("result", errInfo);
return map;
}
@ -250,7 +251,7 @@ public class TrafficSecurityNoticeController extends BaseController {
pd.put("REPLY", "0"); // 回复情况
securityNoticeService.edit(pd);
String[] personIds = pd.getString("PERSON_ID").split(",");
/*String[] personIds = pd.getString("PERSON_ID").split(",");
for (String personId : personIds) {
//pd.put("NOTIFICATION_ID", notificationId);
pd.put("PERSON_ID", personId.trim());
@ -258,7 +259,7 @@ public class TrafficSecurityNoticeController extends BaseController {
pd.put("REPLYSTATUS", "0"); // 主键
pd.put("SIGNEDSTATUS", "0"); // 主键
securityReadDetail.save(pd);
}
}*/
map.put("result", errInfo);
map.put("pd", pd);
return map;
@ -336,8 +337,7 @@ public class TrafficSecurityNoticeController extends BaseController {
issue.put("REPLY", "0");
issue.put("SIGNING", "0");
issue.put("CORPINFO_ID", securityNotice.getString("CORPINFO_ID"));
issue.put("PERSON_ID",personIds[i]);
issue.put("PERSON", securityNotice.getString("PERSON_ID"));
issue.put("PERSON_ID",personIds[i].trim());
issue.put("ISDELETE", "0");
issue.put("CREATOR", Jurisdiction.getUSER_ID());
issue.put("CREATORNAME", Jurisdiction.getUsername());

View File

@ -16,6 +16,6 @@ public interface TrafficSecurityReadDetailMapper {
void edit(PageData pd);
void delete(PageData pd);
PageData listByUserIdOrNoticeId(PageData pd);
List<PageData> listByUserIdOrNoticeId(Page page);
}

View File

@ -16,5 +16,6 @@ public interface TrafficSecurityReadDetailService {
void delete(PageData pd);
List<PageData> listByUserIdOrNoticeId(Page page);
PageData listByUserIdOrNoticeId(PageData pd);
}

View File

@ -40,7 +40,8 @@ public class TrafficSecurityReadDetailImpl implements TrafficSecurityReadDetailS
}
@Override
public List<PageData> listByUserIdOrNoticeId(Page page) {
return securityReadDetailMapper.listByUserIdOrNoticeId(page);
public PageData listByUserIdOrNoticeId(PageData pd) {
return securityReadDetailMapper.listByUserIdOrNoticeId(pd);
}
}

View File

@ -39,7 +39,8 @@
f.VIDEO_ROUTE,
f.VIDEO_NAME,
f.REPLYSTATUS,
f.POSTSTATUS
f.POSTSTATUS,
f.SIGNEDDATE
</sql>
<!-- 字段用于新增 -->
@ -164,10 +165,14 @@
<select id="datalistPage" parameterType="page" resultType="pd">
select
f.*,
i.CORP_NAME
i.CORP_NAME,
count(r.READDETAIL_ID) PERSON_COUNT,
COUNT(case when r.REPLY = '1' then r.READDETAIL_ID END) COUNT_REPLY,
COUNT(case when r.SIGNING = '1' then r.READDETAIL_ID END) COUNT_SIGNING
from
<include refid="tableName"></include> f
left join bus_corp_info i on f.CORPINFO_ID = i.CORPINFO_ID
left join bus_traffic_read_detail r on r.NOTIFICATION_ID = f.NOTIFICATION_ID and r.ISDELETE = '0'
where f.ISDELETE = '0' and f.CORPINFO_ID = #{pd.CORPINFO_ID}
<if test="pd.TITLE != null and pd.TITLE != ''"><!-- 关键词检索-通知标题 -->
and f.TITLE like CONCAT ('%',#{pd.TITLE},'%')
@ -184,6 +189,10 @@
<if test="pd.PRACTITIONER != null and pd.PRACTITIONER != ''"><!-- 关键词检索-从业人员 -->
and f.PRACTITIONER = #{pd.PRACTITIONER}
</if>
<if test="pd.RISKUNITNAME != null and pd.RISKUNITNAME != ''"><!-- 关键词检索-从业人员 -->
and f.LEVEL = #{pd.RISKUNITNAME}
</if>
group by f.NOTIFICATION_ID
ORDER BY f.CREATETIME DESC
</select>

View File

@ -138,6 +138,9 @@
<if test="pd.SIGNEDSTATUS != null and pd.SIGNEDSTATUS != ''"><!-- 关键词检索-签收状态 -->
and f.SIGNEDSTATUS = #{pd.SIGNEDSTATUS}
</if>
<!--<if test="pd.RISKUNITNAME != null and pd.RISKUNITNAME != ''">&lt;!&ndash; 关键词检索-签收状态 &ndash;&gt;
and f.RISKUNITNAME = #{pd.RISKUNITNAME}
</if>-->
</select>
<!-- 列表 -->
@ -193,32 +196,19 @@
<!-- 列表 -->
<select id="listByUserIdOrNoticeId" parameterType="page" resultType="pd">
<select id="listByUserIdOrNoticeId" parameterType="com.zcloud.entity.PageData" resultType="com.zcloud.entity.PageData">
SELECT
c.*,
u.NOTIFICATIONCONTENT,
u.VIDEO_ROUTE,
u.ATTACHMENT_ROUTE,
u.REPLYSTATUS,
u.CREATETIME,
su.NAME
FROM
bus_traffic_read_detail c
INNER JOIN bus_traffic_comprehensivemanagement_securitynotice u ON c.NOTIFICATION_ID = u.NOTIFICATION_ID
INNER JOIN sys_user su on c.PERSON_ID = su.USER_ID
WHERE c.PERSON_ID = #{pd.USER_ID}
AND u.ISDELETE = 0
<if test="pd.NOTIFICATION_ID != null and pd.NOTIFICATION_ID != ''"><!-- 关键词检索-通知标题 -->
and c.NOTIFICATION_ID = #{pd.NOTIFICATION_ID}
</if>
<if test="pd.KEYWORDS != null and pd.KEYWORDS != ''">
AND (
c.SYNOPSIS LIKE CONCAT('%', #{pd.KEYWORDS}, '%')
OR
c.CONTENT LIKE CONCAT('%', #{pd.KEYWORDS}, '%')
)
</if>
ORDER BY u.CREATETIME DESC
LEFT JOIN sys_user su on c.PERSON_ID = su.USER_ID
WHERE c.ISDELETE = 0
and
c.NOTIFICATION_ID = #{NOTIFICATION_ID}
and
c.PERSON_ID = #{PERSON_ID}
ORDER BY c.CREATETIME DESC
</select>