优化BUG

dev
xiepeng 2024-07-12 19:27:13 +08:00
parent e17cd752c0
commit 42c4359074
18 changed files with 298 additions and 93 deletions

View File

@ -1,6 +1,7 @@
package com.zcloud.config;
import com.zcloud.plugins.websocketFace.FaceServer;
import com.zcloud.plugins.websocketOnline.OnlineChatServer;
import org.java_websocket.WebSocketImpl;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
@ -18,10 +19,26 @@ public class StartWebsocketServer implements ApplicationRunner{
@Override
public void run(ApplicationArguments var1) throws Exception{
startWebsocketInstantOnline(); //启动人员在线
startWebsocketInstantFace(); //启动定时人脸识别服务
System.out.println("-------------------系统启动成功-------------------");
}
/**
* 线
*/
public void startWebsocketInstantOnline(){
WebSocketImpl.DEBUG = false;
OnlineChatServer s;
try {
String imPort = "8869"; //即时通讯端口
s = new OnlineChatServer(Integer.parseInt(imPort));
s.start();
} catch (Exception e) {
e.printStackTrace();
}
}
/**
*
*/

View File

@ -8,6 +8,7 @@ import com.zcloud.controller.base.BaseController;
import com.zcloud.entity.Page;
import com.zcloud.entity.PageData;
import com.zcloud.logs.LogAnno;
import com.zcloud.mapper.datasource.hiddenDangerCheckStandard.CustomHiddenMapper;
import com.zcloud.service.bus.*;
import com.zcloud.service.check.ListCheckItemService;
import com.zcloud.service.check.ListManagerService;
@ -18,6 +19,7 @@ import com.zcloud.service.hidden.HiddenService;
import com.zcloud.service.hiddenApi.HiddenApiService;
import com.zcloud.service.hiddenApi.HiddenCheckApiService;
import com.zcloud.service.hiddenApi.HiddenExamineApiService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomHiddenService;
import com.zcloud.service.inspection.SafetyEnvironmentalService;
import com.zcloud.service.sms.MSMLoginService;
import com.zcloud.service.sms.SMSManagementService;
@ -113,6 +115,9 @@ public class AppHiddenController extends BaseController {
@Autowired
private Smb smb;
@Autowired
private CustomHiddenService customHiddenService;
/**
* app
*
@ -1521,8 +1526,21 @@ public class AppHiddenController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
if(StringUtils.isNotEmpty(pd.getString("OPERATION_TYPE")) || StringUtils.equals(pd.getString("OPERATION_TYPE"), "1")) {
pd.put("RECORDITEM_ID", pd.getString("HIDDEN_ID"));
PageData pageData = customHiddenService.findByRecorditemId(pd);
PageData pd2 = new PageData();
pd2.put("FOREIGN_KEY", pageData.getString("HIDDEN_ID"));
pd2.put("TYPE", 3);
List<PageData> hImgs = imgFilesService.listAll(pd2);// 隐患图片
map.put("hImgs", hImgs);
map.put("pd", pageData);
map.put("result", errInfo);
}else{
pd = hiddenService.findById(pd); // 根据ID读取
if (pd.getString("CONFIRM_USER") == null) {
if (StringUtils.isEmpty(pd.getString("CONFIRM_USER"))) {
pd.put("CONFIRM_USER", "");
}
if (pd.getString("CONFIRM_USER") != null || pd.getString("CONFIRM_USER").equals("undefined")) {
@ -1597,6 +1615,7 @@ public class AppHiddenController extends BaseController {
map.put("checkList", checkList);
map.put("repulsecause", repulsecause);
map.put("result", errInfo);
}
return map;
}

View File

@ -1,5 +1,6 @@
package com.zcloud.controller.check;
import com.alibaba.druid.util.StringUtils;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.zcloud.controller.base.BaseController;
@ -8,6 +9,9 @@ import com.zcloud.logs.LogAnno;
import com.zcloud.service.check.*;
import com.zcloud.service.corp.CorpInfoService;
import com.zcloud.service.hidden.HiddenService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomCheckRecordService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomItemService;
import com.zcloud.service.hiddenDangerCheckStandard.CustomService;
import com.zcloud.service.offduty.OffDutyService;
import com.zcloud.service.risk.IdentificationPartsService;
import com.zcloud.service.sms.MSMLoginService;
@ -27,7 +31,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;
/**
* luoxiaobao 2021-01-04 www.zcloudchina.com
@ -70,6 +76,15 @@ public class AppCheckRecordController extends BaseController {
private ListDisableTimeService listDisableTimeService;
@Autowired
private SendMessageUtil sendMessageUtil;
@Autowired
private CustomService customService;
@Autowired
private CustomCheckRecordService customCheckRecordService;
@Autowired
private CustomItemService customItemService;
/**
*
*
@ -353,14 +368,82 @@ public class AppCheckRecordController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
String KEYWORDS = pd.getString("KEYWORDS"); // 关键词检索条件
if (Tools.notEmpty(KEYWORDS))
pd.put("KEYWORDS", KEYWORDS.trim());
PageData ls = listmanagerService.findById(pd);
String USER_NAME = pd.getString("USER_NAME");
PageData cpd = new PageData();
cpd = usersService.findById(pd);
pd.put("ISLEADER", cpd.getString("ISLEADER"));
PageData dept = new PageData();
dept.put("DEPARTMENT_ID", pd.getString("CHECK_DEPARTMENT_ID"));
dept = departmentService.findById(dept);
if (dept != null && dept.getString("ISSUPERVISE").equals("1")) {
pd.put("SUP_DEPARTMENT_ID", dept.getString("DEPARTMENT_ID"));
pd.put("ISSUPERVISE", dept.getString("ISSUPERVISE"));
} else {
pd.put("DEPARTMENT_ID", pd.getString("CHECK_DEPARTMENT_ID"));
}
if (cpd.getString("ISLEADER") != null && cpd.getString("ISLEADER").equals("1")) {
String DEPARTMENT_ID = pd.getString("CHECK_DEPARTMENT_ID");
String ids = departmentService.getDEPARTMENT_IDS(DEPARTMENT_ID);
ids = pd.getString("CHECK_DEPARTMENT_ID") + "," + ids; //把自己部门插入进去
if (ids != null && Tools.notEmpty(ids) && ids.lastIndexOf(",") > -1) {
ids = ids.substring(0, ids.lastIndexOf(","));
pd.put("DEPARTMENT_IDS", ids.split(","));
} else {
pd.put("DEPARTMENT_IDS", DEPARTMENT_ID);
}
}
pd.put("orderUserId", pd.get("USER_ID"));
if(StringUtils.equals(pd.getString("SUB_DEPARTMENT_IDS"), "undefined")) {
pd.put("SUB_DEPARTMENT_IDS", "");
}
List<PageData> varList = customService.getMyCheckList(pd);//列出ListManager列表
for (PageData list : varList) {
String cycle = list.getString("PERIODNAME");
if (cycle.equals("每日")) {
list.put("START_DATE", DateUtil.getDay());
list.put("END_DATE", DateUtil.getDay());
} else if (cycle.equals("每周")) {
list.put("START_DATE", DateUtil.getWeekStart().substring(0, 10));
list.put("END_DATE", DateUtil.getWeekEnd().substring(0, 10));
} else if (cycle.equals("每旬")) {
//1-10
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10 23:59:59"))) {
list.put("START_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "01");
list.put("END_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "10");
}
//10-20
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11 00:00:00"), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20 23:59:59"))) {
list.put("START_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "11");
list.put("END_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "20");
}
//20-月底
if (DateUtil.timeCalendar(new Date(), DateUtil.fomatDateTime(DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21 00:00:00"), DateUtil.fomatDateTime(DateUtil.getMonthEndDay() + " 23:59:59"))) {
list.put("START_DATE", DateUtil.getYear() + "-" + DateUtil.getMonth() + "-" + "21");
list.put("END_DATE", DateUtil.getMonthEndDay());
}
List<PageData> varList = checkrecordService.appdatalist(pd);
} else if (cycle.equals("每月")) {
list.put("START_DATE", DateUtil.getMonthFirstDay());
list.put("END_DATE", DateUtil.getMonthEndDay());
} else if (cycle.equals("每季")) {
list.put("START_DATE", DateUtil.quarterStart());
list.put("END_DATE", DateUtil.quarterEnd());
} else if (cycle.equals("半年")) {
Integer bmonth = Integer.parseInt(DateUtil.getMonth().toString());
if (bmonth <= 6) {
list.put("START_DATE", DateUtil.getYear() + "-01-01");
list.put("END_DATE", DateUtil.getYear() + "-06-30");
} else if (bmonth > 6) {
list.put("START_DATE", DateUtil.getYear() + "-07-01");
list.put("END_DATE", DateUtil.getYear() + "-12-31");
}
} else if (cycle.equals("每年")) {
list.put("START_DATE", DateUtil.getCurrYearFirst());
list.put("END_DATE", DateUtil.getCurrYearLast());
}
}
map.put("varList", varList);
map.put("ls", ls);
/*map.put("ls", ls);*/
map.put("result", errInfo);
return map;
}
@ -379,20 +462,33 @@ public class AppCheckRecordController extends BaseController {
String errInfo = "success";
PageData pd = new PageData();
pd = this.getPageData();
pd = checkrecordService.findById(pd); // 根据ID读取
PageData users = checkuserService.getCheckUser(pd);
List<PageData> varList = recordItemService.listAll(pd);
pd.put("USERS", users.get("USERS"));
if(!StringUtils.isEmpty(pd.getString("OPERATION")) || StringUtils.equals(pd.getString("OPERATION"), "1")) {
pd = listmanagerService.findById(pd);
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.parse(pd.getString("CREATTIME"));
pd.put("CREATTIME",sdf.format(sdf.parse(pd.getString("CREATTIME"))));
map.put("pd", pd);
map.put("result", errInfo);
}else{
pd = customService.findById(pd); // 根据ID读取
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.parse(pd.getString("CREATTIME"));
pd.put("CREATTIME",sdf.format(sdf.parse(pd.getString("CREATTIME"))));
PageData pageData = customCheckRecordService.findByCustomId(pd);
List<PageData> varList = customItemService.listAll(pd);
PageData pd2 = new PageData();
pd2.put("FOREIGN_KEY",pd.get("CHECKRECORD_ID"));
pd2.put("TYPE","13");
List<PageData> qianming = imgFilesService.listAll(pd2);
qianming = qianming.stream().parallel().filter(item -> StringUtils.equals(item.getString("FOREIGN_KEY"), pageData.getString("CHECKRECORD_ID"))).collect(Collectors.toList());
map.put("qianming", qianming);
map.put("varList", varList);
map.put("pd", pd);
map.put("result", errInfo);
}
return map;
}

View File

@ -15,7 +15,9 @@ import com.zcloud.service.system.impl.UserCorpServiceImpl;
import com.zcloud.util.*;
import net.sf.json.JSONObject;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.crypto.hash.SimpleHash;
import org.apache.shiro.util.CollectionUtils;
import org.java_websocket.WebSocket;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
@ -146,7 +148,14 @@ public class AppUsersController extends BaseController {
String errInfo = "success";
pd.put("CORPINFO_ID", Jurisdiction.getCORPINFO_ID());
List<PageData> byUserId = userCorpService.findByUserId(pd);
map.put("pd", byUserId.get(0));
PageData pd2 = new PageData();
if(!CollectionUtils.isEmpty(byUserId)) {
pd2 = byUserId.get(0);
if(StringUtils.equals(pd2.getString("APPLY_TYPE"), "3") || StringUtils.equals(pd2.getString("APPLY_TYPE"), "4")) {
pd2.put("APPLY_STATUS", "1");
}
}
map.put("pd", pd2);
map.put("result", errInfo);
return map;
}

View File

@ -357,5 +357,7 @@ public interface HiddenMapper{
* @throws Exception
*/
List<PageData> hiddenAlllistPage(Page page);
PageData findById2(PageData pd);
}

View File

@ -173,5 +173,7 @@ public interface CustomCheckRecordMapper {
* @return
*/
public List<PageData> listAllYearForTenday(PageData pd);
PageData findByCustomId(PageData pd);
}

View File

@ -308,5 +308,7 @@ public interface CustomHiddenMapper {
PageData findByEmisId(PageData pd);
List<PageData> getListForemisdatalistPage(Page page);
PageData findByRecorditemId(PageData pd);
}

View File

@ -420,5 +420,7 @@ public interface HiddenService{
* @throws Exception
*/
public List<PageData> hiddenlist(Page page)throws Exception;
PageData findById2(PageData pd);
}

View File

@ -854,5 +854,10 @@ public class HiddenServiceImpl implements HiddenService {
public List<PageData> hiddenlist(Page page)throws Exception{
return hiddenMapper.hiddenAlllistPage(page);
}
@Override
public PageData findById2(PageData pd) {
return hiddenMapper.findById2(pd);
}
}

View File

@ -174,5 +174,7 @@ public interface CustomCheckRecordService {
* @return
*/
List<PageData> statisticsListCheckTenday(PageData pd)throws Exception;
PageData findByCustomId(PageData pd);
}

View File

@ -371,5 +371,7 @@ public interface CustomHiddenService {
public PageData findByEmisId(PageData pd)throws Exception;
public List<PageData> getListForemis(Page page)throws Exception;
PageData findByRecorditemId(PageData pd);
}

View File

@ -790,5 +790,10 @@ public class CustomCheckRecordServiceImpl implements CustomCheckRecordService {
}
return list;
}
@Override
public PageData findByCustomId(PageData pd) {
return customCheckRecordMapper.findByCustomId(pd);
}
}

View File

@ -786,5 +786,10 @@ public class CustomHiddenServiceImpl implements CustomHiddenService {
.head(excel.getHead())
.doWrite(excel.getHand());
}
@Override
public PageData findByRecorditemId(PageData pd) {
return customHiddenMapper.findByRecorditemId(pd);
}
}

View File

@ -4426,4 +4426,14 @@
</if>
order by f.CREATTIME desc
</select>
<select id="findById2" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.RECORDITEM_ID = #{RECORDITEM_ID}
group by f.HIDDEN_ID
</select>
</mapper>

View File

@ -1594,4 +1594,13 @@
GROUP BY c.CHECKRECORD_ID
order by PERIODSTART
</select>
<select id="findByCustomId" parameterType="pd" resultType="pd">
select
<include refid="Field"></include>
from
<include refid="tableName"></include> f
where
f.CUSTOM_ID = #{CUSTOM_ID}
</select>
</mapper>

View File

@ -3071,4 +3071,15 @@
HIDDEN_ID = #{HIDDEN_ID}
</insert>
<select id="findByRecorditemId" resultType="com.zcloud.entity.PageData">
select
<include refid="Field"></include>,
u.NAME AS CREATORNAME
from
<include refid="tableName"></include> f
left join sys_user u on u.USER_ID = f.CREATOR
where
f.RECORDITEM_ID = #{RECORDITEM_ID}
</select>
</mapper>

View File

@ -190,7 +190,9 @@
blsd.BZ as TASK_TYPE_NUM,
bhd1.DICTIONARY_NAME as CHECK_CATEGORY_NAME,
bhd2.DICTIONARY_NAME as CHECK_ITEM_NAME,
btl.TERM_DESCRIBE as BAO_BAO_NUM_NAME
btl.TERM_DESCRIBE as BAO_BAO_NUM_NAME,
bhr.*,
bhh.*
from
<include refid="tableName"></include> f
left join bus_hiddendangercheckstandard_custom bl on bl.CUSTOM_ID = f.CUSTOM_ID
@ -200,6 +202,8 @@
left join bus_hiddendangercheckstandard_dictionary bhd1 on bhd1.DICTIONARY_ID = f.CHECK_CATEGORY and bhd1.ISDELETE = 0
left join bus_hiddendangercheckstandard_dictionary bhd2 on bhd2.DICTIONARY_ID = f.CHECK_ITEM and bhd2.ISDELETE = 0
left join bus_hiddendangercheckstandard_term_library btl on btl.TASK_NUM = f.BAO_BAO_NUM and btl.WORK_TYPE = blsd.BZ
left join bus_hiddendangercheckstandard_recorditem bhr on bhr.CUSTOM_ID = f.CUSTOM_ID
left join bus_hiddendangercheckstandard_hidden bhh on bhh.RECORDITEM_ID = bhr.RECORDITEM_ID
where f.ISDELETE = '0'
<if test="CUSTOM_ID != null and CUSTOM_ID != ''"><!-- 检查表id -->
and f.CUSTOM_ID = #{CUSTOM_ID}

View File

@ -870,6 +870,8 @@
f.START_DATE,
f.END_DATE,
f.BAO_BAO_TYPE,
u1.NAME BAO_BAO_USER_NAME,
f.START_DATE,
COUNT(bhci.CUSTOM_ITEM_ID) count,
getStandardCheckedNum(f.CUSTOM_ID) checkCount
from
@ -878,6 +880,7 @@
left join sys_dictionaries p on f.PERIOD = p.BIANMA
left join OA_DEPARTMENT d on d.DEPARTMENT_ID=f.DEPARTMENT_ID
left join sys_user u on u.USER_ID = f.USER_ID
left join sys_user u1 on u.USER_ID = f.BAO_BAO_USER_ID
left join bus_hiddendangercheckstandard_custom_item bhci on bhci.CUSTOM_ID = f.CUSTOM_ID and bhci.ISDELETE = '0'
where f.ISDELETE = 0
and (f.TYPE != 'listType0005'