bug
This commit is contained in:
@ -369,7 +369,9 @@ public class AlarmPointController {
|
||||
this.mPointService.updateLalarmmin(alarmPoint.getUnitId(), mPoint.getMpointcode());
|
||||
// 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) {
|
||||
|
||||
@ -197,16 +197,15 @@ public class ProAlarmController {
|
||||
// Iterator<String> sIterator = jsonObject.keys();
|
||||
|
||||
JSONArray arr = new JSONArray();
|
||||
List<XServer> allxServerList = this.xServerService.selectListByWhere(" where 1=1 ");
|
||||
for (XServer xServer :
|
||||
allxServerList) {
|
||||
// List<XServer> allxServerList = this.xServerService.selectListByWhere(" where 1=1 ");
|
||||
// for (XServer xServer : allxServerList) {
|
||||
// if (jsonObject.get(xServer.getBizid()) != null) {
|
||||
// String code_value = jsonObject.get(xServer.getBizid()).toString();
|
||||
// code_value = code_value + ",data_stop_alarm";
|
||||
// code_value = code_value.replace(",", "','");
|
||||
// List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + " and point_code in ('" + code_value + "')"
|
||||
// + 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 + "')");
|
||||
if (list != null && list.size() > 0) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
@ -249,7 +248,7 @@ public class ProAlarmController {
|
||||
}
|
||||
// }
|
||||
|
||||
}
|
||||
// }
|
||||
model.addAttribute("result", arr);
|
||||
return new ModelAndView("result");
|
||||
}
|
||||
|
||||
@ -123,6 +123,13 @@ public class RptDayLogController {
|
||||
User cu = (User) request.getSession().getAttribute("cu");
|
||||
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);
|
||||
|
||||
Result result = Result.success(jsonObject);
|
||||
@ -149,6 +156,14 @@ public class RptDayLogController {
|
||||
@RequestParam(value = "rptdeptId") String rptdeptId) throws IOException {
|
||||
User cu = (User) request.getSession().getAttribute("cu");
|
||||
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);
|
||||
model.addAttribute("rptDayLog", jsonObject);
|
||||
// return "/report/reportdetail";
|
||||
@ -196,6 +211,15 @@ public class RptDayLogController {
|
||||
String userId = cu.getId();
|
||||
String json = request.getParameter("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("")) {
|
||||
jsonObject.put("id", CommUtil.getUUID());
|
||||
}
|
||||
@ -268,6 +292,14 @@ public class RptDayLogController {
|
||||
@RequestParam(value = "rptdeptId", required=false) String rptdeptId) {
|
||||
User cu = (User) request.getSession().getAttribute("cu");
|
||||
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;
|
||||
|
||||
List<MultipartFile> fileList = multipartRequest.getFiles("filelist");
|
||||
|
||||
@ -227,7 +227,7 @@ public class PatrolModelController {
|
||||
User cu=(User)request.getSession().getAttribute("cu");
|
||||
String companyId = request.getParameter("bizId");
|
||||
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>();
|
||||
for (int i=0;i<list.size();i++){
|
||||
Select2 select2 = new Select2();
|
||||
|
||||
@ -213,6 +213,9 @@ public class RoleController {
|
||||
JSONArray json = JSONArray.fromObject(list);
|
||||
model.addAttribute("json", json);
|
||||
model.addAttribute("roleid", roleid);
|
||||
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
|
||||
model.addAttribute("companyId", request.getParameter("bizid"));
|
||||
}
|
||||
return "user/roleUser";
|
||||
}
|
||||
|
||||
|
||||
@ -514,6 +514,21 @@ public class MPointController {
|
||||
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);
|
||||
JSONArray json = JSONArray.fromObject(list);
|
||||
result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}";
|
||||
|
||||
@ -133,6 +133,9 @@ public class SchedulingController {
|
||||
public String doadd(HttpServletRequest request, Model model,
|
||||
@RequestParam(value = "date") String date) {
|
||||
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";
|
||||
}
|
||||
|
||||
@ -142,6 +145,9 @@ public class SchedulingController {
|
||||
String wherestr = " where s.id = '" + schedulingId + "'";
|
||||
List<Scheduling> scheduling = this.schedulingService.selectCalenderListByWhere(wherestr);
|
||||
model.addAttribute("scheduling", scheduling.get(0));
|
||||
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
|
||||
model.addAttribute("bizid", request.getParameter("bizid"));
|
||||
}
|
||||
return "work/schedulingEdit";
|
||||
}
|
||||
|
||||
|
||||
@ -60,4 +60,11 @@ public interface RptDayLogService {
|
||||
* @return
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
@ -10,6 +10,7 @@ import com.sipai.entity.scada.MPoint;
|
||||
import com.sipai.entity.scada.MPointExpand;
|
||||
import com.sipai.entity.scada.MPointHistory;
|
||||
import com.sipai.entity.user.User;
|
||||
import com.sipai.entity.user.UserJob;
|
||||
import com.sipai.service.msg.MsgService;
|
||||
import com.sipai.service.msg.MsgServiceImpl;
|
||||
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.MPointService;
|
||||
import com.sipai.service.user.UserService;
|
||||
import com.sipai.service.user.UserJobService;
|
||||
import com.sipai.tools.CommUtil;
|
||||
import com.sipai.tools.SpringContextUtil;
|
||||
import net.sf.json.JSONArray;
|
||||
@ -65,6 +67,8 @@ public class RptDayLogServiceImpl implements RptDayLogService {
|
||||
private MsgTypeService msgtypeService;
|
||||
@Resource
|
||||
private MPointExpandService mPointExpandService;
|
||||
@Resource
|
||||
private UserJobService userJobService;
|
||||
|
||||
@Override
|
||||
public RptDayLog selectById(String id) {
|
||||
@ -878,4 +882,68 @@ public class RptDayLogServiceImpl implements RptDayLogService {
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -56,7 +56,7 @@
|
||||
|
||||
//编辑用户信息
|
||||
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);
|
||||
openModal('roleUserModal');
|
||||
});
|
||||
|
||||
@ -88,9 +88,14 @@
|
||||
$("#search_pid").select2({
|
||||
ajax: {
|
||||
type:'POST',
|
||||
url: ext.contextPath +"/work/group/getListForSelect.do",
|
||||
url: ext.contextPath +"/user/getDeptByBizId4Select.do",
|
||||
dataType: 'json',
|
||||
delay: 250,
|
||||
data: function (params) {
|
||||
return {
|
||||
companyId: '${companyId}'
|
||||
};
|
||||
},
|
||||
processResults: function (data) {
|
||||
return {
|
||||
results: data
|
||||
|
||||
@ -202,9 +202,14 @@
|
||||
}, 'json');
|
||||
|
||||
//巡检模式
|
||||
var patrolType = '${param.patroltype}';
|
||||
var bizIdForPatrol = '${bizid}';
|
||||
if (!bizIdForPatrol || bizIdForPatrol === '') {
|
||||
bizIdForPatrol = unitId;
|
||||
}
|
||||
$.post(ext.contextPath + "/timeEfficiency/patrolModel/getPatrolModelList4Select3.do", {
|
||||
type: '${param.patroltype}',
|
||||
bizId: unitId
|
||||
type: patrolType,
|
||||
bizId: bizIdForPatrol
|
||||
}, function (data) {
|
||||
var selectpatrolmode_add = $("#schedulingAddModal #patrolmode").select2({
|
||||
data: data,
|
||||
|
||||
@ -134,9 +134,14 @@
|
||||
}, 'json');
|
||||
|
||||
//巡检模式
|
||||
var patrolType = '${param.patroltype}';
|
||||
var bizIdForPatrol = '${bizid}';
|
||||
if (!bizIdForPatrol || bizIdForPatrol === '') {
|
||||
bizIdForPatrol = unitId;
|
||||
}
|
||||
$.post(ext.contextPath + "/timeEfficiency/patrolModel/getPatrolModelList4Select3.do", {
|
||||
type: '${param.patroltype}',
|
||||
bizId: unitId
|
||||
type: patrolType,
|
||||
bizId: bizIdForPatrol
|
||||
}, function (data) {
|
||||
var selectpatrolmode_edit = $("#schedulingEditModal #patrolmode").select2({
|
||||
data: data,
|
||||
|
||||
@ -8,15 +8,16 @@
|
||||
|
||||
<script type="text/javascript">
|
||||
var date = "${date}";
|
||||
var bizid = "${param.bizid}";
|
||||
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) {
|
||||
$("#addDiv").html(data);
|
||||
openModal('schedulingAddModal');
|
||||
});
|
||||
};
|
||||
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);
|
||||
openModal('schedulingEditModal');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user