Compare commits
8 Commits
dafda57a0e
...
b0e2e58d93
| Author | SHA1 | Date | |
|---|---|---|---|
| b0e2e58d93 | |||
| 785654a510 | |||
| 9cc4d4a988 | |||
| fadbe2b59f | |||
| f33f57f6a7 | |||
| c3babf2c4d | |||
| 04610aa678 | |||
| 596b2a68bf |
@ -483,6 +483,7 @@ public class ActivitiController {
|
||||
String passFlag = request.getParameter("passFlag");
|
||||
if (passFlag != null && !passFlag.isEmpty()) {
|
||||
boolean pFlag = Boolean.parseBoolean(passFlag);
|
||||
int totalCount = list.size();
|
||||
Iterator<WorkTask> iterator = list.iterator();
|
||||
while (iterator.hasNext()) {
|
||||
WorkTask workTask = (WorkTask) iterator.next();
|
||||
@ -491,6 +492,10 @@ public class ActivitiController {
|
||||
}
|
||||
|
||||
}
|
||||
// 当 passFlag=false 过滤后返回空列表(即未识别到退回路径),则作为备用方案返回全部路径
|
||||
if (list.isEmpty() && !pFlag && totalCount > 0) {
|
||||
list = workflowProcessDefinitionService.getNextWorkTasks(task.getProcessDefinitionId(), task.getTaskDefinitionKey());
|
||||
}
|
||||
JSONArray jsonArray = new JSONArray();
|
||||
if (list != null && list.size() > 0) {
|
||||
for (WorkTask workTask : list) {
|
||||
|
||||
@ -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");
|
||||
}
|
||||
|
||||
@ -37,6 +37,7 @@ import org.activiti.engine.history.HistoricTaskInstance;
|
||||
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
||||
import org.activiti.engine.runtime.ProcessInstance;
|
||||
import org.activiti.engine.task.Task;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.ui.Model;
|
||||
@ -356,7 +357,7 @@ public class MaintenancePlanController {
|
||||
model.addAttribute("nowDate", CommUtil.nowDate());
|
||||
String maintenancePlanId = pInstance.getBusinessKey();
|
||||
List<BusinessUnitAudit> list = this.businessUnitAuditService.selectListByWhere("where businessId = '" + maintenancePlanId + "' order by insdt desc ");
|
||||
if (list != null && list.size() > 0) {
|
||||
if (CollectionUtils.isNotEmpty(list)){
|
||||
model.addAttribute("businessUnitAudit", list.get(0));
|
||||
}
|
||||
MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(maintenancePlanId);
|
||||
|
||||
@ -279,10 +279,8 @@ public class EquipmentPlanController {
|
||||
if (company != null) {
|
||||
model.addAttribute("companyName", company.getSname());
|
||||
}
|
||||
User user = userService.getUserById(equipmentPlan.getAuditId());
|
||||
if (user != null) {
|
||||
model.addAttribute("userName", user.getCaption());
|
||||
}
|
||||
String userNames = userService.getUserNamesByUserIds(equipmentPlan.getAuditId());
|
||||
model.addAttribute("userName", userNames);
|
||||
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
||||
if (equipmentPlanType_big != null) {
|
||||
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
||||
@ -308,10 +306,8 @@ public class EquipmentPlanController {
|
||||
if (company != null) {
|
||||
model.addAttribute("companyName", company.getSname());
|
||||
}
|
||||
User user = userService.getUserById(equipmentPlan.getAuditId());
|
||||
if (user != null) {
|
||||
model.addAttribute("userName", user.getCaption());
|
||||
}
|
||||
String userNames = userService.getUserNamesByUserIds(equipmentPlan.getAuditId());
|
||||
model.addAttribute("userName", userNames);
|
||||
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
||||
if (equipmentPlanType_big != null) {
|
||||
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
||||
@ -422,10 +418,8 @@ public class EquipmentPlanController {
|
||||
if (company != null) {
|
||||
model.addAttribute("companyName", company.getSname());
|
||||
}
|
||||
User user = userService.getUserById(equipmentPlan.getAuditId());
|
||||
if (user != null) {
|
||||
model.addAttribute("userName", user.getCaption());
|
||||
}
|
||||
String userNames = userService.getUserNamesByUserIds(equipmentPlan.getAuditId());
|
||||
model.addAttribute("userName", userNames);
|
||||
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
||||
if (equipmentPlanType_big != null) {
|
||||
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
||||
|
||||
@ -123,7 +123,9 @@ public class PipelineDataController {
|
||||
@RequestMapping("/deletes.do")
|
||||
public String dodeletes(HttpServletRequest request, Model model,
|
||||
@RequestParam(value = "ids") String ids) {
|
||||
int result = this.pipelineDataService.deleteByWhere("where id in (" + ids + ")");
|
||||
// 移除末尾逗号,防止SQL语法错误
|
||||
String cleanIds = ids.replaceAll("[,\\s]+$", "").replaceAll("^[,\\s]+", "");
|
||||
int result = this.pipelineDataService.deleteByWhere("where id in (" + cleanIds + ")");
|
||||
model.addAttribute("result", result);
|
||||
return "result";
|
||||
}
|
||||
|
||||
@ -374,6 +374,16 @@ public class RptCreateController {
|
||||
@RequestMapping("/doadd.do")
|
||||
public String doadd(HttpServletRequest request, Model model) {
|
||||
User cu = (User) request.getSession().getAttribute("cu");
|
||||
String rptsetId = request.getParameter("rptsetId");
|
||||
|
||||
// 权限验证:检查用户是否有报表生成权限
|
||||
if (rptsetId != null && !rptsetId.isEmpty()) {
|
||||
if (!this.rptCreateService.checkGeneratePermission(rptsetId, cu)) {
|
||||
model.addAttribute("result", "{\"res\":\"您没有该报表的生成权限\",\"msg\":\"您没有该报表的生成权限\"}");
|
||||
return "result";
|
||||
}
|
||||
}
|
||||
|
||||
request.setAttribute("userId", cu.getId());
|
||||
request.setAttribute("userName", cu.getCaption());
|
||||
request.setAttribute("id", CommUtil.getUUID());
|
||||
@ -432,6 +442,14 @@ public class RptCreateController {
|
||||
String rptsetId = request.getParameter("rptsetId");
|
||||
int result = 0;
|
||||
|
||||
// 权限验证:检查用户是否有报表生成权限
|
||||
if (rptCreate.getRptsetId() != null && !rptCreate.getRptsetId().isEmpty()) {
|
||||
if (!this.rptCreateService.checkGeneratePermission(rptCreate.getRptsetId(), cu)) {
|
||||
model.addAttribute("result", "{\"res\":\"您没有该报表的生成权限\",\"msg\":\"您没有该报表的生成权限\"}");
|
||||
return new ModelAndView("result");
|
||||
}
|
||||
}
|
||||
|
||||
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
||||
if (rptInfoSet != null) {
|
||||
//日报
|
||||
@ -545,6 +563,15 @@ public class RptCreateController {
|
||||
User cu = (User) request.getSession().getAttribute("cu");
|
||||
String rptsetId = request.getParameter("rptsetId");
|
||||
int result = 0;
|
||||
|
||||
// 权限验证:检查用户是否有报表生成权限
|
||||
if (rptCreate.getRptsetId() != null && !rptCreate.getRptsetId().isEmpty()) {
|
||||
if (!this.rptCreateService.checkGeneratePermission(rptCreate.getRptsetId(), cu)) {
|
||||
model.addAttribute("result", "{\"res\":\"您没有该报表的生成权限\",\"msg\":\"您没有该报表的生成权限\"}");
|
||||
return new ModelAndView("result");
|
||||
}
|
||||
}
|
||||
|
||||
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
||||
if (rptInfoSet != null) {
|
||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||
@ -750,13 +777,26 @@ public class RptCreateController {
|
||||
@RequestMapping("/getSheet.do")
|
||||
public String getSheet(HttpServletRequest request, Model model,
|
||||
@RequestParam(value = "id") String id) {
|
||||
String path = "";
|
||||
String name = "";
|
||||
Result_Report result1 = new Result_Report();
|
||||
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
||||
if (rptCreate != null) {//报表生成中的预览
|
||||
// 优先使用数据库中存储的文件路径,如果没有则构造路径(兼容旧数据)
|
||||
if (rptCreate.getAbspath() != null && !rptCreate.getAbspath().isEmpty()) {
|
||||
path = rptCreate.getAbspath();
|
||||
} else {
|
||||
path = rptCreate.getRptname() + rptCreate.getId() + ".xls";
|
||||
}
|
||||
// 获取文件扩展名
|
||||
String extension = ".xls";
|
||||
if (path.toLowerCase().endsWith(".xlsx")) {
|
||||
extension = ".xlsx";
|
||||
}
|
||||
String sourcePath = rptCreate.getRptname() + extension;
|
||||
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptCreate.getRptsetId() + "'");
|
||||
try {
|
||||
String sourcePath = rptCreate.getRptname();
|
||||
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), CommUtil.fixRptCreateFileName(rptCreate.getRptname() + rptCreate.getId()));
|
||||
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path);
|
||||
if (isb == null || isb.length == 0) {
|
||||
result1 = Result_Report.failed("文件不存在或已被删除");
|
||||
model.addAttribute("result", CommUtil.toJson(result1));
|
||||
@ -774,7 +814,7 @@ public class RptCreateController {
|
||||
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptInfoSetFile.getMasterid() + "'");
|
||||
try {
|
||||
String sourcePath = "";
|
||||
String path = rptInfoSetFile.getAbspath();
|
||||
path = rptInfoSetFile.getAbspath();
|
||||
// path = path.replaceAll("\\.xlsx", "").replaceAll("\\.xls", "");
|
||||
// byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), CommUtil.fixRptCreateFileName(path));
|
||||
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
|
||||
@ -850,8 +890,18 @@ public class RptCreateController {
|
||||
String name = "";
|
||||
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
||||
if (rptCreate != null) {
|
||||
path = rptCreate.getRptname() + rptCreate.getId() + ".xls";
|
||||
name = rptCreate.getRptname() + ".xls";
|
||||
// 优先使用数据库中存储的文件路径,如果没有则构造路径(兼容旧数据)
|
||||
if (rptCreate.getAbspath() != null && !rptCreate.getAbspath().isEmpty()) {
|
||||
path = rptCreate.getAbspath();
|
||||
} else {
|
||||
path = rptCreate.getRptname() + rptCreate.getId() + ".xls";
|
||||
}
|
||||
// 获取文件扩展名
|
||||
String extension = ".xls";
|
||||
if (path.toLowerCase().endsWith(".xlsx")) {
|
||||
extension = ".xlsx";
|
||||
}
|
||||
name = rptCreate.getRptname() + extension;
|
||||
}
|
||||
byte[] bytes = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path);
|
||||
if (bytes == null || bytes.length == 0) {
|
||||
|
||||
@ -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";
|
||||
@ -191,11 +206,19 @@ public class RptDayLogController {
|
||||
}
|
||||
|
||||
@RequestMapping("/dosave.do")
|
||||
public String dosave(HttpServletRequest request,Model model){
|
||||
public ModelAndView dosave(HttpServletRequest request,Model model){
|
||||
User cu = (User) request.getSession().getAttribute("cu");
|
||||
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)) {
|
||||
model.addAttribute("result", "{\"res\":\"您没有该报表的填报权限\",\"msg\":\"您没有该报表的填报权限\"}");
|
||||
return new ModelAndView("result");
|
||||
}
|
||||
|
||||
if (jsonObject.get("id")==null||jsonObject.get("id").equals("")) {
|
||||
jsonObject.put("id", CommUtil.getUUID());
|
||||
}
|
||||
@ -206,12 +229,12 @@ public class RptDayLogController {
|
||||
e.printStackTrace();
|
||||
Result result = Result.failed("插入失败");
|
||||
model.addAttribute("result", CommUtil.toJson(result));
|
||||
return "result";
|
||||
return new ModelAndView("result");
|
||||
}
|
||||
|
||||
Result result = Result.success(null);
|
||||
model.addAttribute("result", CommUtil.toJson(result));
|
||||
return "result";
|
||||
return new ModelAndView("result");
|
||||
}
|
||||
|
||||
@RequestMapping("/onekeyAudit.do")//一键审核
|
||||
@ -268,6 +291,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");
|
||||
|
||||
@ -181,8 +181,8 @@ public class SafetyCheckComprehensiveController {
|
||||
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
||||
bean.getDutyUserId(), // 当前节点审批人
|
||||
bean.getDutyUserName(), // 当前节点审批人
|
||||
null, // 抄送人
|
||||
null,// 抄送人
|
||||
bean.getCopyUserId(), // 抄送人
|
||||
bean.getCopyUserName(),// 抄送人
|
||||
null);
|
||||
}
|
||||
return Result.success();
|
||||
@ -377,10 +377,9 @@ public class SafetyCheckComprehensiveController {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result response(HttpServletRequest request, SafetyCheckComprehensive bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
||||
|
||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||
|
||||
//通过
|
||||
if (pass == 1) {
|
||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
||||
service.update(bean);
|
||||
|
||||
@ -403,6 +402,7 @@ public class SafetyCheckComprehensiveController {
|
||||
}
|
||||
//不通过
|
||||
else {
|
||||
safetyCheckActivityService.audit(bean.getDutyUserId(), processInstanceId, pass);
|
||||
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
||||
service.update(bean);
|
||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||
|
||||
@ -236,8 +236,8 @@ public class SafetyCheckDaylyController {
|
||||
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
||||
bean.getDutyUserId(), // 当前节点审批人
|
||||
bean.getDutyUserName(), // 当前节点审批人
|
||||
null, // 抄送人
|
||||
null,// 抄送人
|
||||
bean.getCopyUserId(), // 抄送人
|
||||
bean.getCopyUserName(),// 抄送人
|
||||
null);
|
||||
|
||||
}
|
||||
@ -373,10 +373,9 @@ public class SafetyCheckDaylyController {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result response(HttpServletRequest request, SafetyCheckDayly bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
||||
|
||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||
|
||||
//通过
|
||||
if (pass == 1) {
|
||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
||||
safetyCheckDaylyService.update(bean);
|
||||
|
||||
@ -400,6 +399,7 @@ public class SafetyCheckDaylyController {
|
||||
}
|
||||
//不通过
|
||||
else {
|
||||
safetyCheckActivityService.audit(bean.getDutyUserId(), processInstanceId, pass);
|
||||
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
||||
safetyCheckDaylyService.update(bean);
|
||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||
|
||||
@ -197,8 +197,8 @@ public class SafetyCheckSpecialController {
|
||||
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
||||
bean.getDutyUserId(), // 当前节点审批人
|
||||
bean.getDutyUserName(), // 当前节点审批人
|
||||
null, // 抄送人
|
||||
null,// 抄送人
|
||||
bean.getCopyUserId(), // 抄送人
|
||||
bean.getCopyUserName(),// 抄送人
|
||||
null);
|
||||
}
|
||||
return Result.success();
|
||||
@ -393,10 +393,9 @@ public class SafetyCheckSpecialController {
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Result response(HttpServletRequest request, SafetyCheckSpecial bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
||||
|
||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||
|
||||
//通过
|
||||
if (pass == 1) {
|
||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
||||
service.update(bean);
|
||||
|
||||
@ -419,6 +418,7 @@ public class SafetyCheckSpecialController {
|
||||
}
|
||||
//不通过
|
||||
else {
|
||||
safetyCheckActivityService.audit(bean.getDutyUserId(), processInstanceId, pass);
|
||||
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
||||
service.update(bean);
|
||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||
|
||||
@ -343,8 +343,6 @@ public class SafetyExternalCertificateController {
|
||||
int result = 0;
|
||||
for (String id : ids) {
|
||||
result += service.deleteById(id);
|
||||
}
|
||||
for (String id : ids) {
|
||||
safetyFilesService.deleteByBizId(id);
|
||||
}
|
||||
model.addAttribute("result", result);
|
||||
|
||||
@ -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();
|
||||
|
||||
@ -242,10 +242,11 @@ public class ProcessSectionController {
|
||||
@RequestMapping("/getProcessSection4Select.do")
|
||||
public String getProcessSection4Select(HttpServletRequest request, Model model) {
|
||||
String companyId = request.getParameter("companyId"); // 默认查询JSBZ???
|
||||
Company company = this.companyService.selectByPrimaryKey(companyId);
|
||||
// 使用unitService获取Unit信息,因为companyId来自tb_unit表
|
||||
Unit unit = this.unitService.getUnitById(companyId);
|
||||
|
||||
String wherestr = "where 1=1 and active='" + CommString.Active_True + "' ";
|
||||
if (company != null && company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
||||
if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
||||
String bizs = "";//公司下属所有厂id
|
||||
List<Unit> blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId);
|
||||
if (blist != null && blist.size() > 0) {
|
||||
@ -257,7 +258,7 @@ public class ProcessSectionController {
|
||||
}
|
||||
bizs = bizs.replace(",", "','");
|
||||
wherestr += " and (unit_id='" + ProcessSection.UnitId_Sys + "' or (code not in (select code from tb_process_section where unit_id='" + ProcessSection.UnitId_Sys + "')) and unit_id in ('" + bizs + "') ) ";
|
||||
} else if (company != null && company.getType().equals(CommString.UNIT_TYPE_BIZ)) { // B 水厂
|
||||
} else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // B 水厂
|
||||
wherestr += " and unit_id='" + companyId + "' ";
|
||||
}
|
||||
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
|
||||
@ -272,13 +273,13 @@ public class ProcessSectionController {
|
||||
for (int i = 0; i < processSections.size(); i++) {
|
||||
JSONObject jsonObject = new JSONObject();
|
||||
jsonObject.put("id", processSections.get(i).getCode());
|
||||
if (company != null && company.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
||||
if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
||||
if (!processSections.get(i).getUnitId().equals(ProcessSection.UnitId_Sys)) {
|
||||
jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")");
|
||||
} else {
|
||||
jsonObject.put("text", processSections.get(i).getSname());
|
||||
}
|
||||
} else if (company != null && company.getType().equals(CommString.UNIT_TYPE_BIZ)) { // "B";//水厂
|
||||
} else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // "B";//水厂
|
||||
jsonObject.put("text", processSections.get(i).getSname());
|
||||
}
|
||||
|
||||
|
||||
@ -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";
|
||||
}
|
||||
|
||||
|
||||
@ -853,11 +853,13 @@ public class UserController {
|
||||
public String userForSelectByCompany(HttpServletRequest request, Model model) {
|
||||
String userIds = request.getParameter("userIds");
|
||||
String jobIds = request.getParameter("jobIds");
|
||||
String displayDept = request.getParameter("displayDept");
|
||||
if (userIds != null && !userIds.isEmpty()) {
|
||||
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')");
|
||||
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',',','" + userIds + ",')");
|
||||
model.addAttribute("users", JSONArray.fromObject(list));
|
||||
}
|
||||
model.addAttribute("jobIds", jobIds);
|
||||
model.addAttribute("displayDept", displayDept);
|
||||
return "user/userForSelectByCompany";
|
||||
}
|
||||
|
||||
@ -1259,6 +1261,7 @@ public class UserController {
|
||||
model.addAttribute("users", JSONArray.fromObject(list));
|
||||
}
|
||||
model.addAttribute("jobIds", jobIds);
|
||||
model.addAttribute("displayDept", request.getParameter("displayDept"));
|
||||
return "user/userForSelectByWorkOrder";
|
||||
}
|
||||
|
||||
@ -1458,6 +1461,7 @@ public class UserController {
|
||||
model.addAttribute("users", JSONArray.fromObject(list));
|
||||
}
|
||||
model.addAttribute("jobIds", jobIds);
|
||||
model.addAttribute("displayDept", request.getParameter("displayDept"));
|
||||
return "user/userSelectLayer";
|
||||
}
|
||||
|
||||
|
||||
@ -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";
|
||||
}
|
||||
|
||||
|
||||
@ -362,9 +362,22 @@ public class WorkflowProcessDefinitionService {
|
||||
String pvmTransitionId = "";
|
||||
for (WorkTask workTask : list) {
|
||||
PvmTransition item=this.getTransition(processDefId, taskDefId,workTask.getId(),pvmTransitionId);
|
||||
if (item == null) {
|
||||
// 未找到对应路径时默认标记为通过路径,继续处理其他任务
|
||||
workTask.setPassFlag(true);
|
||||
continue;
|
||||
}
|
||||
pvmTransitionId = item.getId();
|
||||
String conditionText=String.valueOf(item.getProperty("conditionText"));
|
||||
if (conditionText!=null && conditionText.contains("!"+CommString.ACTI_KEK_Condition)) {
|
||||
// 检测退回路径:支持多种条件表达式格式
|
||||
// ${!pass} / ${pass == false} / ${pass==false} / ${pass != true} / ${pass!=true}
|
||||
boolean isRejectPath = conditionText != null && (
|
||||
conditionText.contains("!"+CommString.ACTI_KEK_Condition) ||
|
||||
conditionText.contains(CommString.ACTI_KEK_Condition+" == false") ||
|
||||
conditionText.contains(CommString.ACTI_KEK_Condition+"==false") ||
|
||||
conditionText.contains(CommString.ACTI_KEK_Condition+" != true") ||
|
||||
conditionText.contains(CommString.ACTI_KEK_Condition+"!=true"));
|
||||
if (isRejectPath) {
|
||||
workTask.setPassFlag(false);
|
||||
}else{
|
||||
workTask.setPassFlag(true);
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -351,6 +351,8 @@ public class CommonFileServiceImpl implements CommonFileService {
|
||||
String errorMsg = e.getMessage();
|
||||
if (errorMsg != null && errorMsg.contains("NoSuchKey")) {
|
||||
logger.error("MinIO文件不存在: bucketName={}, objectName={}", nameSpace, filePath);
|
||||
} else if (errorMsg != null && errorMsg.contains("NoSuchBucket")) {
|
||||
logger.error("MinIO存储桶不存在: bucketName={}, objectName={}", nameSpace, filePath);
|
||||
} else {
|
||||
logger.error("获取MinIO文件失败: bucketName={}, objectName={}, 错误: {}", nameSpace, filePath, errorMsg, e);
|
||||
}
|
||||
|
||||
@ -112,17 +112,24 @@ public class BusinessUnitAuditService implements CommService<BusinessUnitAudit>{
|
||||
}
|
||||
List<HistoricActivityInstance> list=historyService.createHistoricActivityInstanceQuery().processInstanceId(entity.getProcessid()).activityId(wortTaskId)
|
||||
.orderByHistoricActivityInstanceStartTime().desc().list();
|
||||
if (list != null && list.size()>0) {
|
||||
variables.put(CommString.ACTI_KEK_Assignee, list.get(0).getAssignee());
|
||||
if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){
|
||||
taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion());
|
||||
}
|
||||
}else {
|
||||
variables.put(CommString.ACTI_KEK_Assignee, businessUnitAdapter.getInsuser());
|
||||
if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){
|
||||
taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion());
|
||||
}
|
||||
// 优先取历史记录中的 assignee;若 assignee 为空(候选人任务未签收),则查 BusinessUnitAudit 记录获取实际提交人
|
||||
String targetAssignee = null;
|
||||
if (list != null && list.size() > 0) {
|
||||
targetAssignee = list.get(0).getAssignee();
|
||||
}
|
||||
if (targetAssignee == null && !wortTaskId.isEmpty()) {
|
||||
// 历史 assignee 为空时,从 BusinessUnitAudit 记录中查找该步骤的实际提交人
|
||||
List<BusinessUnitAudit> previousAuditList = this.selectListByWhere(
|
||||
"where businessid='" + entity.getBusinessid() + "' and taskdefinitionkey='" + wortTaskId + "' order by insdt desc");
|
||||
if (previousAuditList != null && previousAuditList.size() > 0) {
|
||||
targetAssignee = previousAuditList.get(0).getInsuser();
|
||||
}
|
||||
}
|
||||
// 设置退回目标处理人(若仍为空则由流程变量 userIds 确定候选人,不再回退到工单创建人)
|
||||
variables.put(CommString.ACTI_KEK_Assignee, targetAssignee);
|
||||
if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){
|
||||
taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion());
|
||||
}
|
||||
}
|
||||
//int res=0;
|
||||
taskService.complete(entity.getTaskid(), variables);
|
||||
@ -141,17 +148,24 @@ public class BusinessUnitAuditService implements CommService<BusinessUnitAudit>{
|
||||
BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity);
|
||||
if(entity.getPassstatus()){
|
||||
//通过
|
||||
if(variables.get(CommString.ACTI_KEK_Candidate_Users)!=null){
|
||||
businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Candidate_Users).toString(),"");
|
||||
String candidateUsers = variables.get(CommString.ACTI_KEK_Candidate_Users) != null
|
||||
? variables.get(CommString.ACTI_KEK_Candidate_Users).toString() : null;
|
||||
if(candidateUsers != null && !candidateUsers.isEmpty()){
|
||||
// 有下一步接收人,通知下一步处理人
|
||||
businessUnitRecord.sendMessage(candidateUsers, "");
|
||||
}else if(variables.get(CommString.ACTI_KEK_AssigneeList) != null){
|
||||
// 会签
|
||||
businessUnitRecord.sendMessage(entity.getTargetusers(), "");
|
||||
}else{
|
||||
//会签
|
||||
if(variables.get(CommString.ACTI_KEK_AssigneeList)!=null){
|
||||
businessUnitRecord.sendMessage(entity.getTargetusers(),"");
|
||||
}
|
||||
// 最后一步,无下一步处理人,通知当前提交人(完成确认)
|
||||
if(entity.getInsuser() != null && !entity.getInsuser().isEmpty()){
|
||||
businessUnitRecord.sendMessage(entity.getInsuser(), "");
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(variables.get(CommString.ACTI_KEK_Assignee)!=null){
|
||||
businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Assignee).toString(),"");
|
||||
// 退回:通知目标处理人(排除空值,避免错误发送)
|
||||
if(variables.get(CommString.ACTI_KEK_Assignee) != null){
|
||||
businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Assignee).toString(), "");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.sipai.service.report;
|
||||
|
||||
import com.sipai.entity.business.BusinessUnitAudit;
|
||||
import com.sipai.entity.report.RptCreate;
|
||||
import com.sipai.entity.user.User;
|
||||
import org.xmlpull.v1.XmlPullParserException;
|
||||
|
||||
import javax.xml.parsers.ParserConfigurationException;
|
||||
@ -45,4 +46,11 @@ public interface RptCreateService {
|
||||
|
||||
//改变状态
|
||||
public abstract int updateStatus(String id);
|
||||
|
||||
/** 检查用户是否有报表生成权限
|
||||
* @param rptInfoSetId 报表配置id
|
||||
* @param user 当前用户
|
||||
* @return true=有权限, false=无权限
|
||||
*/
|
||||
public abstract boolean checkGeneratePermission(String rptInfoSetId, User user);
|
||||
}
|
||||
@ -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);
|
||||
}
|
||||
|
||||
@ -13,6 +13,7 @@ import com.sipai.entity.report.*;
|
||||
import com.sipai.entity.scada.MPoint;
|
||||
import com.sipai.entity.scada.TempReport;
|
||||
import com.sipai.entity.user.User;
|
||||
import com.sipai.entity.user.UserJob;
|
||||
import com.sipai.entity.work.GroupDetail;
|
||||
import com.sipai.entity.work.Scheduling;
|
||||
import com.sipai.service.activiti.WorkflowProcessDefinitionService;
|
||||
@ -24,6 +25,7 @@ import com.sipai.service.report.*;
|
||||
import com.sipai.service.scada.MPointService;
|
||||
import com.sipai.service.scada.TempReportService;
|
||||
import com.sipai.service.user.UserService;
|
||||
import com.sipai.service.user.UserJobService;
|
||||
import com.sipai.service.work.GroupDetailService;
|
||||
import com.sipai.service.work.SchedulingService;
|
||||
import com.sipai.tools.*;
|
||||
@ -107,6 +109,8 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
private BusinessUnitHandleDetailService businessUnitHandleDetailService;
|
||||
@Resource
|
||||
private GroupDetailService groupDetailService;
|
||||
@Resource
|
||||
private UserJobService userJobService;
|
||||
|
||||
@Override
|
||||
public RptCreate selectById(String id) {
|
||||
@ -833,6 +837,20 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
// System.out.println("rptdt==============================================================" + rptdt);
|
||||
String rpttype = rptInfoSet.getRpttype();//报表类型
|
||||
String bucketName = "rptinfosetfile";
|
||||
String endtype = ".xls"; // 默认文件扩展名
|
||||
|
||||
// 首先确保report bucket存在
|
||||
try {
|
||||
MinioClient minioClient = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey());
|
||||
boolean isExist = minioClient.bucketExists("report");
|
||||
if (!isExist) {
|
||||
minioClient.makeBucket("report");
|
||||
logger.info("Created MinIO bucket: report");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
logger.error("Failed to create report bucket", e);
|
||||
}
|
||||
|
||||
List<RptInfoSetFile> filelist = this.rptInfoSetFileService.selectListByWhere(" where masterid='" + rptInfoSet.getId() + "' ");
|
||||
String path = "";
|
||||
try {
|
||||
@ -843,7 +861,11 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
rptInfoSetFile.setAbspath(obj);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
System.out.println(e);
|
||||
logger.error("Failed to get template file from MinIO", e);
|
||||
}
|
||||
if (filelist == null || filelist.size() == 0) {
|
||||
logger.error("No template file configured for report: {}", rptInfoSet.getId());
|
||||
return null;
|
||||
}
|
||||
if (filelist != null && filelist.size() > 0) {
|
||||
// 设定Excel文件所在路径
|
||||
@ -854,7 +876,7 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
byte[] bytes_m = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
|
||||
// Check if bytes_m is null or empty
|
||||
if (bytes_m == null || bytes_m.length == 0) {
|
||||
logger.error("Excel file is empty or not found: " + path);
|
||||
logger.error("Excel template file is empty or not found: {}", path);
|
||||
return null;
|
||||
}
|
||||
// 直接从本地文件创建Workbook, 从输入流创建Workbook
|
||||
@ -866,7 +888,8 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
logger.error("Failed to create workbook from file: " + path, e);
|
||||
e.printStackTrace();
|
||||
}
|
||||
String endtype = path.toLowerCase().endsWith(".xlsx") ? ".xlsx" : ".xls";
|
||||
// 更新文件扩展名(根据模板文件)
|
||||
endtype = path.toLowerCase().endsWith(".xlsx") ? ".xlsx" : ".xls";
|
||||
// 生成一个样式,用在表格数据
|
||||
CellStyle listStyle = null;
|
||||
listStyle = workbook.createCellStyle();
|
||||
@ -1374,6 +1397,10 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
//删除文件 只保留minio中的文件
|
||||
File file = new File(file3);//根据指定的文件名创建File对象
|
||||
file.delete();
|
||||
|
||||
// 保存文件路径到数据库
|
||||
rptCreate.setAbspath(showname + endtype);
|
||||
rptCreateDao.updateByPrimaryKeySelective(rptCreate);
|
||||
} catch (NoSuchAlgorithmException e) {
|
||||
e.printStackTrace();
|
||||
} catch (IOException e) {
|
||||
@ -1912,4 +1939,54 @@ public class RptCreateServiceImpl implements RptCreateService {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查用户是否有报表生成权限
|
||||
* @param rptInfoSetId 报表配置id
|
||||
* @param user 当前用户
|
||||
* @return true=有权限, false=无权限
|
||||
*/
|
||||
@Override
|
||||
public boolean checkGeneratePermission(String rptInfoSetId, User user) {
|
||||
if (user == null || rptInfoSetId == null || rptInfoSetId.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 管理员默认有权限
|
||||
if ("emp01".equals(user.getId())) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// 获取报表配置信息
|
||||
RptInfoSet rptInfoSet = rptInfoSetService.selectById4Simple(rptInfoSetId);
|
||||
if (rptInfoSet == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String userId = user.getId();
|
||||
|
||||
// 检查用户是否在createusers列表中
|
||||
String createusers = rptInfoSet.getCreateusers();
|
||||
if (createusers != null && !createusers.isEmpty()) {
|
||||
if (createusers.contains(userId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// 检查用户岗位是否在generate_position列表中
|
||||
String generatePosition = rptInfoSet.getGeneratePosition();
|
||||
if (generatePosition != null && !generatePosition.isEmpty()) {
|
||||
// 获取用户的所有岗位
|
||||
List<UserJob> userJobs = userJobService.selectListByWhere(" where userid='" + userId + "'");
|
||||
if (userJobs != null && !userJobs.isEmpty()) {
|
||||
for (UserJob userJob : userJobs) {
|
||||
if (generatePosition.contains(userJob.getJobid())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
@ -877,5 +881,69 @@ public class RptDayLogServiceImpl implements RptDayLogService {
|
||||
Result result = Result.success(1);
|
||||
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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -47,12 +47,22 @@ public class SafetyCheckActivityService {
|
||||
if (processDefinitions == null || processDefinitions.size() == 0) {
|
||||
return Result.failed(company.getName() + "缺少该流程定义。");
|
||||
}
|
||||
// 防止重复发起:若该业务已有运行中的流程实例,则跳过,避免创建双倍待办任务
|
||||
List<org.activiti.engine.runtime.ProcessInstance> existingInstances = workflowService.getRuntimeService()
|
||||
.createProcessInstanceQuery()
|
||||
.processDefinitionKey(processKey)
|
||||
.processInstanceBusinessKey(bizId)
|
||||
.active()
|
||||
.list();
|
||||
if (existingInstances != null && !existingInstances.isEmpty()) {
|
||||
return Result.success();
|
||||
}
|
||||
// 启动流程实例
|
||||
// 设置网关条件
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(CommString.ACTI_KEK_Condition, 1);
|
||||
map.put(CommString.ACTI_KEK_Assignee, applyUserId);
|
||||
map.put(CommString.ACTI_KEK_Candidate_Users, applyUserId);
|
||||
map.put(CommString.ACTI_KEK_Candidate_Users, "");
|
||||
|
||||
// 启动流程
|
||||
ProcessInstance processInstance = workflowService.startWorkflow(
|
||||
@ -71,7 +81,7 @@ public class SafetyCheckActivityService {
|
||||
Map<String, Object> map2 = new HashMap<>();
|
||||
map2.put(CommString.ACTI_KEK_Condition, 1);
|
||||
map2.put(CommString.ACTI_KEK_Assignee, nextUserId);
|
||||
map2.put(CommString.ACTI_KEK_Candidate_Users, nextUserId);
|
||||
map2.put(CommString.ACTI_KEK_Candidate_Users, "");
|
||||
workflowService.getTaskService().complete(task.getId(), map2);
|
||||
|
||||
return Result.success();
|
||||
@ -91,10 +101,9 @@ public class SafetyCheckActivityService {
|
||||
Map<String, Object> map = new HashMap<>();
|
||||
map.put(CommString.ACTI_KEK_Condition, pass);
|
||||
map.put(CommString.ACTI_KEK_Assignee, nextUserId);
|
||||
map.put(CommString.ACTI_KEK_Candidate_Users, nextUserId);
|
||||
for (Task task : tasks) {
|
||||
workflowService.getTaskService().complete(task.getId(), map);
|
||||
}
|
||||
map.put(CommString.ACTI_KEK_Candidate_Users, "");
|
||||
// 只完成第一个任务,防止多任务场景下指数级创建待办(如因重复发起导致有多个并发任务时)
|
||||
workflowService.getTaskService().complete(tasks.get(0).getId(), map);
|
||||
return Result.success();
|
||||
}
|
||||
|
||||
|
||||
@ -101,6 +101,9 @@ public class SafetyFilesService implements CommService<SafetyFiles> {
|
||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||
List<MultipartFile> files = multipartRequest.getFiles("file");
|
||||
for (MultipartFile mfile : files) {
|
||||
if (mfile == null || mfile.getSize() == 0) {
|
||||
continue;
|
||||
}
|
||||
String suffix = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
||||
|
||||
//判断保存文件的路径是否存在
|
||||
|
||||
@ -100,44 +100,65 @@ public class SafetyFlowTaskService implements CommService<SafetyFlowTask> {
|
||||
String copyNames,
|
||||
String record) throws ServiceException {
|
||||
|
||||
SafetyFlowTask safetyFlowTask;
|
||||
SafetyFlowTask safetyFlowTask = null;
|
||||
List<SafetyFlowTask> list = selectListByWhere(" where biz_id='" + bizId + "' order by create_time desc");
|
||||
if (list != null && list.size() != 0 && list.get(0).getTaskName().equals(taskTitle)) {
|
||||
safetyFlowTask = list.get(0);
|
||||
safetyFlowTask.setIsDone(true);
|
||||
safetyFlowTask.setCopy(copyNames);
|
||||
safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
||||
update(safetyFlowTask);
|
||||
} else if (list != null && list.size() != 0 && !list.get(0).getTaskName().equals(taskTitle)) {
|
||||
safetyFlowTask = list.get(0);
|
||||
safetyFlowTask.setIsDone(true);
|
||||
safetyFlowTask.setCopy(copyNames);
|
||||
safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
||||
update(safetyFlowTask);
|
||||
|
||||
safetyFlowTask = new SafetyFlowTask();
|
||||
|
||||
safetyFlowTask.setId(UUID.randomUUID().toString());
|
||||
safetyFlowTask.setBizId(bizId);
|
||||
safetyFlowTask.setTaskName(taskTitle);
|
||||
safetyFlowTask.setIsDone(isDone);
|
||||
safetyFlowTask.setDoneTime(isDone ? DateUtil.toStr(null, new Date()) : null);
|
||||
safetyFlowTask.setAuditor(auditorName);
|
||||
safetyFlowTask.setCopy(copyNames);
|
||||
save(safetyFlowTask);
|
||||
|
||||
} else {
|
||||
safetyFlowTask = new SafetyFlowTask();
|
||||
|
||||
safetyFlowTask.setId(UUID.randomUUID().toString());
|
||||
safetyFlowTask.setBizId(bizId);
|
||||
safetyFlowTask.setTaskName(taskTitle);
|
||||
safetyFlowTask.setIsDone(isDone);
|
||||
safetyFlowTask.setDoneTime(isDone ? DateUtil.toStr(null, new Date()) : null);
|
||||
safetyFlowTask.setAuditor(auditorName);
|
||||
safetyFlowTask.setCopy(copyNames);
|
||||
save(safetyFlowTask);
|
||||
|
||||
// 查找是否已存在相同taskTitle的记录
|
||||
SafetyFlowTask existingTask = null;
|
||||
if (list != null && !list.isEmpty()) {
|
||||
for (SafetyFlowTask task : list) {
|
||||
if (task.getTaskName().equals(taskTitle)) {
|
||||
existingTask = task;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isDone) {
|
||||
// 标记任务为完成
|
||||
if (existingTask != null) {
|
||||
// 更新已存在的记录
|
||||
existingTask.setIsDone(true);
|
||||
existingTask.setCopy(copyNames);
|
||||
existingTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
||||
update(existingTask);
|
||||
safetyFlowTask = existingTask;
|
||||
} else {
|
||||
// 创建新的完成记录
|
||||
safetyFlowTask = new SafetyFlowTask();
|
||||
safetyFlowTask.setId(UUID.randomUUID().toString());
|
||||
safetyFlowTask.setBizId(bizId);
|
||||
safetyFlowTask.setTaskName(taskTitle);
|
||||
safetyFlowTask.setIsDone(true);
|
||||
safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
||||
safetyFlowTask.setAuditor(auditorName);
|
||||
safetyFlowTask.setCopy(copyNames);
|
||||
save(safetyFlowTask);
|
||||
}
|
||||
} else {
|
||||
// 创建待处理任务
|
||||
if (existingTask == null) {
|
||||
// 不存在才创建
|
||||
safetyFlowTask = new SafetyFlowTask();
|
||||
safetyFlowTask.setId(UUID.randomUUID().toString());
|
||||
safetyFlowTask.setBizId(bizId);
|
||||
safetyFlowTask.setTaskName(taskTitle);
|
||||
safetyFlowTask.setIsDone(false);
|
||||
safetyFlowTask.setDoneTime(null);
|
||||
safetyFlowTask.setAuditor(auditorName);
|
||||
safetyFlowTask.setCopy(copyNames);
|
||||
save(safetyFlowTask);
|
||||
} else {
|
||||
// 已存在,重置为待处理状态(用于流程回退后重新处理)
|
||||
existingTask.setIsDone(false);
|
||||
existingTask.setDoneTime(null);
|
||||
existingTask.setAuditor(auditorName);
|
||||
existingTask.setCopy(copyNames);
|
||||
update(existingTask);
|
||||
safetyFlowTask = existingTask;
|
||||
}
|
||||
}
|
||||
|
||||
if (StringUtils.isNotEmpty(record)) {
|
||||
SafetyFlowTaskDetail safetyFlowTaskDetail = new SafetyFlowTaskDetail();
|
||||
safetyFlowTaskDetail.setId(UUID.randomUUID().toString());
|
||||
|
||||
@ -346,6 +346,10 @@ var processSelectNodeForHandle = function(taskId){
|
||||
//选择下一节点,先选择审核结果,再选择节点
|
||||
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:passFlag}, function(data) {
|
||||
$("#routeNum").empty();
|
||||
if (!data || data.length === 0) {
|
||||
console.warn('getRoutesForSelect2: no routes found for passFlag=' + passFlag);
|
||||
return;
|
||||
}
|
||||
var selelct = $("#routeNum").select2({
|
||||
data: data,
|
||||
placeholder:'请先选择审核结果',//默认文字提示
|
||||
@ -374,6 +378,10 @@ var processSelectNodeForHandle = function(taskId){
|
||||
})
|
||||
selectResult.val('').trigger("change");
|
||||
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:true}, function(data) {
|
||||
if (!data || data.length === 0) {
|
||||
console.warn('getRoutesForSelect2: no routes found for passFlag=true');
|
||||
return;
|
||||
}
|
||||
var selelct = $("#routeNum").select2({
|
||||
data: data,
|
||||
placeholder:'请先选择审核结果',//默认文字提示
|
||||
|
||||
@ -88,7 +88,10 @@
|
||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||
var datas = "";
|
||||
$.each(checkedItems, function(index, item) {
|
||||
datas += item.id + ",";
|
||||
if (datas != "") {
|
||||
datas += ",";
|
||||
}
|
||||
datas += item.id;
|
||||
});
|
||||
if (datas == "") {
|
||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||
|
||||
@ -234,7 +234,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
||||
{
|
||||
formId: "addForm",
|
||||
hiddenId: "userId",
|
||||
textId: "userName"
|
||||
textId: "userName",
|
||||
displayDept: "true"
|
||||
}, function (data) {
|
||||
$("#user4SelectDiv").html(data);
|
||||
openModal("user4SelectModal");
|
||||
|
||||
@ -47,6 +47,11 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
||||
display: inline-block;
|
||||
vertical-align: top;
|
||||
padding: 8px;
|
||||
width: 140px;
|
||||
text-align: left;
|
||||
}
|
||||
.detail-row {
|
||||
clear: both;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
@ -253,7 +258,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
||||
function initdeTail(list) {
|
||||
let temp = `<div >`
|
||||
list.forEach((item, index) => {
|
||||
temp += `<div><div class="AAA">` + item.deptName + `</div>`
|
||||
temp += `<div class="detail-row"><div class="AAA">` + item.deptName + `</div>`
|
||||
temp += `<div class="AAA">` + item.userName + `</div>`
|
||||
temp += `<div class="AAA">` + item.pass + `</div>`
|
||||
temp += `<div class="AAA">` + item.time + `</div></div>`
|
||||
@ -426,7 +431,9 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label ">查看其它会签意见</label>
|
||||
<div id="deTail"></div>
|
||||
<div class="col-sm-10">
|
||||
<div id="deTail"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="margin-left: 39px">
|
||||
<div id="fileList"></div>
|
||||
|
||||
@ -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
|
||||
|
||||
@ -20,7 +20,12 @@
|
||||
if(datas_name!=""){
|
||||
datas_name+=",";
|
||||
}
|
||||
datas_name+=item.caption;
|
||||
// 支持通过参数控制显示部门名称还是用户名称
|
||||
var displayField = item.caption;
|
||||
if('${param.displayDept}' === 'true' && item._pname) {
|
||||
displayField = item._pname;
|
||||
}
|
||||
datas_name+=displayField;
|
||||
});
|
||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||
|
||||
@ -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