This commit is contained in:
Timer
2026-03-27 23:46:04 +08:00
parent a5ac9fb038
commit 596b2a68bf
14 changed files with 164 additions and 16 deletions

View File

@ -369,7 +369,9 @@ public class AlarmPointController {
this.mPointService.updateLalarmmin(alarmPoint.getUnitId(), mPoint.getMpointcode()); this.mPointService.updateLalarmmin(alarmPoint.getUnitId(), mPoint.getMpointcode());
// mPoint.setLalarmmin(null); // mPoint.setLalarmmin(null);
} }
// this.mPointService.update2(alarmPoint.getUnitId(),mPoint); // Enable TriggerAlarm to allow ScadaAlarmJob to process this MPoint
mPoint.setTriggeralarm("1");
this.mPointService.update2(alarmPoint.getUnitId(), mPoint);
} }
if (code == Result.SUCCESS) { if (code == Result.SUCCESS) {

View File

@ -197,16 +197,15 @@ public class ProAlarmController {
// Iterator<String> sIterator = jsonObject.keys(); // Iterator<String> sIterator = jsonObject.keys();
JSONArray arr = new JSONArray(); JSONArray arr = new JSONArray();
List<XServer> allxServerList = this.xServerService.selectListByWhere(" where 1=1 "); // List<XServer> allxServerList = this.xServerService.selectListByWhere(" where 1=1 ");
for (XServer xServer : // for (XServer xServer : allxServerList) {
allxServerList) {
// if (jsonObject.get(xServer.getBizid()) != null) { // if (jsonObject.get(xServer.getBizid()) != null) {
// String code_value = jsonObject.get(xServer.getBizid()).toString(); // String code_value = jsonObject.get(xServer.getBizid()).toString();
// code_value = code_value + ",data_stop_alarm"; // code_value = code_value + ",data_stop_alarm";
// code_value = code_value.replace(",", "','"); // code_value = code_value.replace(",", "','");
// List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + " and point_code in ('" + code_value + "')" // List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + " and point_code in ('" + code_value + "')"
// + orderstr); // + orderstr);
List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + orderstr); List<ProAlarm> list = this.proAlarmService.selectListByWhere(companyId, wherestr + orderstr);
// System.out.println(wherestr + " and point_code in ('" + code_value + "')"); // System.out.println(wherestr + " and point_code in ('" + code_value + "')");
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
@ -249,7 +248,7 @@ public class ProAlarmController {
} }
// } // }
} // }
model.addAttribute("result", arr); model.addAttribute("result", arr);
return new ModelAndView("result"); return new ModelAndView("result");
} }

View File

@ -123,6 +123,13 @@ public class RptDayLogController {
User cu = (User) request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
String userId = cu.getId(); String userId = cu.getId();
// 权限验证:检查用户是否有填报权限
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
Result result = Result.failed("您没有该报表的填报权限");
model.addAttribute("result", CommUtil.toJson(result));
return "result";
}
JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId); JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId);
Result result = Result.success(jsonObject); Result result = Result.success(jsonObject);
@ -149,6 +156,14 @@ public class RptDayLogController {
@RequestParam(value = "rptdeptId") String rptdeptId) throws IOException { @RequestParam(value = "rptdeptId") String rptdeptId) throws IOException {
User cu = (User) request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
String userId = cu.getId(); String userId = cu.getId();
// 权限验证:检查用户是否有填报权限
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
Result result = Result.failed("您没有该报表的填报权限");
model.addAttribute("result", CommUtil.toJson(result));
return "result";
}
JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId); JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId);
model.addAttribute("rptDayLog", jsonObject); model.addAttribute("rptDayLog", jsonObject);
// return "/report/reportdetail"; // return "/report/reportdetail";
@ -196,6 +211,15 @@ public class RptDayLogController {
String userId = cu.getId(); String userId = cu.getId();
String json = request.getParameter("json"); String json = request.getParameter("json");
JSONObject jsonObject = JSONObject.fromObject(json); JSONObject jsonObject = JSONObject.fromObject(json);
// 权限验证:检查用户是否有填报权限
String rptdeptId = (String) jsonObject.get("rptdeptId");
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
Result result = Result.failed("您没有该报表的填报权限");
model.addAttribute("result", CommUtil.toJson(result));
return "result";
}
if (jsonObject.get("id")==null||jsonObject.get("id").equals("")) { if (jsonObject.get("id")==null||jsonObject.get("id").equals("")) {
jsonObject.put("id", CommUtil.getUUID()); jsonObject.put("id", CommUtil.getUUID());
} }
@ -268,6 +292,14 @@ public class RptDayLogController {
@RequestParam(value = "rptdeptId", required=false) String rptdeptId) { @RequestParam(value = "rptdeptId", required=false) String rptdeptId) {
User cu = (User) request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
String userId = cu.getId(); String userId = cu.getId();
// 权限验证:检查用户是否有填报权限
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
Result result = Result.failed("您没有该报表的填报权限");
model.addAttribute("result", CommUtil.toJson(result));
return "result";
}
MultipartRequest multipartRequest = (MultipartRequest)request; MultipartRequest multipartRequest = (MultipartRequest)request;
List<MultipartFile> fileList = multipartRequest.getFiles("filelist"); List<MultipartFile> fileList = multipartRequest.getFiles("filelist");

View File

@ -227,7 +227,7 @@ public class PatrolModelController {
User cu=(User)request.getSession().getAttribute("cu"); User cu=(User)request.getSession().getAttribute("cu");
String companyId = request.getParameter("bizId"); String companyId = request.getParameter("bizId");
String type = request.getParameter("type"); String type = request.getParameter("type");
List<PatrolModel> list = this.patrolModelService.selectListByWhere("where unit_id = '"+companyId+"' and type='"+type+"' order by insdt"); List<PatrolModel> list = this.patrolModelService.selectListByWhere("where unit_id = '"+companyId+"' order by insdt");
ArrayList<Select2> list4select2 = new ArrayList<Select2>(); ArrayList<Select2> list4select2 = new ArrayList<Select2>();
for (int i=0;i<list.size();i++){ for (int i=0;i<list.size();i++){
Select2 select2 = new Select2(); Select2 select2 = new Select2();

View File

@ -213,6 +213,9 @@ public class RoleController {
JSONArray json = JSONArray.fromObject(list); JSONArray json = JSONArray.fromObject(list);
model.addAttribute("json", json); model.addAttribute("json", json);
model.addAttribute("roleid", roleid); model.addAttribute("roleid", roleid);
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
model.addAttribute("companyId", request.getParameter("bizid"));
}
return "user/roleUser"; return "user/roleUser";
} }

View File

@ -514,6 +514,21 @@ public class MPointController {
mp.setProcessSection(processSections.get(0)); mp.setProcessSection(processSections.get(0));
} }
} }
// 取redis点位数据最新值没有就是0
for (MPoint mPoint : list) {
String id = mPoint.getId();
int num = mPoint.getId().hashCode() % 25;
RMapCache<String, String> map_redis_data = redissonClient.getMapCache(CommString.RedisMpointFlag + num);
if (map_redis_data.get(id) != null && !"".equals(map_redis_data.get(id))) {
String[] str = map_redis_data.get(id).split(";");
if (str.length >= 3 && str[1] != null && !str[1].isEmpty() && !"null".equals(str[1])) {
mPoint.setParmvalue(new BigDecimal(str[1]));
mPoint.setMeasuredt(str[2]);
} else {
mPoint.setParmvalue(BigDecimal.ZERO);
}
}
}
PageInfo<MPoint> pi = new PageInfo<MPoint>(list); PageInfo<MPoint> pi = new PageInfo<MPoint>(list);
JSONArray json = JSONArray.fromObject(list); JSONArray json = JSONArray.fromObject(list);
result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}"; result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}";

View File

@ -133,6 +133,9 @@ public class SchedulingController {
public String doadd(HttpServletRequest request, Model model, public String doadd(HttpServletRequest request, Model model,
@RequestParam(value = "date") String date) { @RequestParam(value = "date") String date) {
model.addAttribute("date", date.substring(0, 10)); model.addAttribute("date", date.substring(0, 10));
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
model.addAttribute("bizid", request.getParameter("bizid"));
}
return "work/schedulingAdd"; return "work/schedulingAdd";
} }
@ -142,6 +145,9 @@ public class SchedulingController {
String wherestr = " where s.id = '" + schedulingId + "'"; String wherestr = " where s.id = '" + schedulingId + "'";
List<Scheduling> scheduling = this.schedulingService.selectCalenderListByWhere(wherestr); List<Scheduling> scheduling = this.schedulingService.selectCalenderListByWhere(wherestr);
model.addAttribute("scheduling", scheduling.get(0)); model.addAttribute("scheduling", scheduling.get(0));
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
model.addAttribute("bizid", request.getParameter("bizid"));
}
return "work/schedulingEdit"; return "work/schedulingEdit";
} }

View File

@ -60,4 +60,11 @@ public interface RptDayLogService {
* @return * @return
*/ */
public abstract Result onekeyAudit(String ids ,User cu,String rptdeptId); public abstract Result onekeyAudit(String ids ,User cu,String rptdeptId);
/** 检查用户是否有填报权限
* @param rptdeptId 填报配置id
* @param user 当前用户
* @return true=有权限, false=无权限
*/
public abstract boolean checkInputPermission(String rptdeptId, User user);
} }

View File

@ -10,6 +10,7 @@ import com.sipai.entity.scada.MPoint;
import com.sipai.entity.scada.MPointExpand; import com.sipai.entity.scada.MPointExpand;
import com.sipai.entity.scada.MPointHistory; import com.sipai.entity.scada.MPointHistory;
import com.sipai.entity.user.User; import com.sipai.entity.user.User;
import com.sipai.entity.user.UserJob;
import com.sipai.service.msg.MsgService; import com.sipai.service.msg.MsgService;
import com.sipai.service.msg.MsgServiceImpl; import com.sipai.service.msg.MsgServiceImpl;
import com.sipai.service.msg.MsgTypeService; import com.sipai.service.msg.MsgTypeService;
@ -20,6 +21,7 @@ import com.sipai.service.scada.MPointExpandService;
import com.sipai.service.scada.MPointHistoryService; import com.sipai.service.scada.MPointHistoryService;
import com.sipai.service.scada.MPointService; import com.sipai.service.scada.MPointService;
import com.sipai.service.user.UserService; import com.sipai.service.user.UserService;
import com.sipai.service.user.UserJobService;
import com.sipai.tools.CommUtil; import com.sipai.tools.CommUtil;
import com.sipai.tools.SpringContextUtil; import com.sipai.tools.SpringContextUtil;
import net.sf.json.JSONArray; import net.sf.json.JSONArray;
@ -65,6 +67,8 @@ public class RptDayLogServiceImpl implements RptDayLogService {
private MsgTypeService msgtypeService; private MsgTypeService msgtypeService;
@Resource @Resource
private MPointExpandService mPointExpandService; private MPointExpandService mPointExpandService;
@Resource
private UserJobService userJobService;
@Override @Override
public RptDayLog selectById(String id) { public RptDayLog selectById(String id) {
@ -878,4 +882,68 @@ public class RptDayLogServiceImpl implements RptDayLogService {
return result; return result;
} }
@Override
public boolean checkInputPermission(String rptdeptId, User user) {
if (rptdeptId == null || user == null) {
return false;
}
RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId);
if (rptDeptSet == null) {
return false;
}
Integer roleType = rptDeptSet.getRoleType();
String inputuser = rptDeptSet.getInputuser();
String inputjob = rptDeptSet.getInputjob();
String userId = user.getId();
// role_type=2: 不控制权限,所有人都可以填报
if (roleType != null && roleType == 2) {
return true;
}
// role_type 为 null 或空字符串: 允许所有人
if (roleType == null || roleType == 0 && (inputuser == null || inputuser.isEmpty())
|| roleType == 1 && (inputjob == null || inputjob.isEmpty())) {
return true;
}
// role_type=0: 按用户控制权限
if (roleType == 0) {
if (inputuser != null && !inputuser.isEmpty()) {
// 检查当前用户ID是否在inputuser中
String[] userIds = inputuser.split(",");
for (String uid : userIds) {
if (userId.equals(uid.trim())) {
return true;
}
}
}
return false;
}
// role_type=1: 按岗位控制权限
if (roleType == 1) {
if (inputjob != null && !inputjob.isEmpty()) {
// 获取当前用户的所有岗位
List<UserJob> userJobs = this.userJobService.selectListByWhere("where userid = '" + userId + "'");
if (userJobs != null && !userJobs.isEmpty()) {
String[] jobIds = inputjob.split(",");
for (UserJob userJob : userJobs) {
String userJobId = userJob.getJobid();
for (String jobId : jobIds) {
if (userJobId != null && userJobId.equals(jobId.trim())) {
return true;
}
}
}
}
}
return false;
}
return false;
}
} }

View File

@ -56,7 +56,7 @@
//编辑用户信息 //编辑用户信息
var editUserFun = function (roleid, bizid) { var editUserFun = function (roleid, bizid) {
$.post(ext.contextPath + '/user/showRoleUser.do', { roleid: roleid }, function (data) { $.post(ext.contextPath + '/user/showRoleUser.do', { roleid: roleid, bizid: bizid }, function (data) {
$("#subDiv_User").html(data); $("#subDiv_User").html(data);
openModal('roleUserModal'); openModal('roleUserModal');
}); });

View File

@ -88,9 +88,14 @@
$("#search_pid").select2({ $("#search_pid").select2({
ajax: { ajax: {
type:'POST', type:'POST',
url: ext.contextPath +"/work/group/getListForSelect.do", url: ext.contextPath +"/user/getDeptByBizId4Select.do",
dataType: 'json', dataType: 'json',
delay: 250, delay: 250,
data: function (params) {
return {
companyId: '${companyId}'
};
},
processResults: function (data) { processResults: function (data) {
return { return {
results: data results: data

View File

@ -202,9 +202,14 @@
}, 'json'); }, 'json');
//巡检模式 //巡检模式
var patrolType = '${param.patroltype}';
var bizIdForPatrol = '${bizid}';
if (!bizIdForPatrol || bizIdForPatrol === '') {
bizIdForPatrol = unitId;
}
$.post(ext.contextPath + "/timeEfficiency/patrolModel/getPatrolModelList4Select3.do", { $.post(ext.contextPath + "/timeEfficiency/patrolModel/getPatrolModelList4Select3.do", {
type: '${param.patroltype}', type: patrolType,
bizId: unitId bizId: bizIdForPatrol
}, function (data) { }, function (data) {
var selectpatrolmode_add = $("#schedulingAddModal #patrolmode").select2({ var selectpatrolmode_add = $("#schedulingAddModal #patrolmode").select2({
data: data, data: data,

View File

@ -134,9 +134,14 @@
}, 'json'); }, 'json');
//巡检模式 //巡检模式
var patrolType = '${param.patroltype}';
var bizIdForPatrol = '${bizid}';
if (!bizIdForPatrol || bizIdForPatrol === '') {
bizIdForPatrol = unitId;
}
$.post(ext.contextPath + "/timeEfficiency/patrolModel/getPatrolModelList4Select3.do", { $.post(ext.contextPath + "/timeEfficiency/patrolModel/getPatrolModelList4Select3.do", {
type: '${param.patroltype}', type: patrolType,
bizId: unitId bizId: bizIdForPatrol
}, function (data) { }, function (data) {
var selectpatrolmode_edit = $("#schedulingEditModal #patrolmode").select2({ var selectpatrolmode_edit = $("#schedulingEditModal #patrolmode").select2({
data: data, data: data,

View File

@ -8,15 +8,16 @@
<script type="text/javascript"> <script type="text/javascript">
var date = "${date}"; var date = "${date}";
var bizid = "${param.bizid}";
var addFun = function () { var addFun = function () {
$.post(ext.contextPath + '/work/scheduling/add.do', { date: date }, $.post(ext.contextPath + '/work/scheduling/add.do', { date: date, bizid: bizid },
function (data) { function (data) {
$("#addDiv").html(data); $("#addDiv").html(data);
openModal('schedulingAddModal'); openModal('schedulingAddModal');
}); });
}; };
var viewFun = function (id) { var viewFun = function (id) {
$.post(ext.contextPath + '/work/scheduling/view.do', { id: id }, function (data) { $.post(ext.contextPath + '/work/scheduling/view.do', { id: id, bizid: bizid }, function (data) {
$("#viewDiv").html(data); $("#viewDiv").html(data);
openModal('schedulingEditModal'); openModal('schedulingEditModal');
}); });