4 Commits

Author SHA1 Message Date
6c252fe4dd 合并 2026-04-23 17:37:38 +08:00
4aeb894ba9 Merge remote-tracking branch 'origin/deng-release' into process-dev 2026-04-22 20:17:42 +08:00
0377a0cc8c 请假补假 2026-04-09 13:12:26 +08:00
ebf57c2e82 请假补假 2026-04-08 10:30:34 +08:00
39 changed files with 2767 additions and 999 deletions

17
pom.xml
View File

@ -375,6 +375,12 @@
<groupId>org.xhtmlrenderer</groupId> <groupId>org.xhtmlrenderer</groupId>
<artifactId>core-renderer</artifactId> <artifactId>core-renderer</artifactId>
<version>R8</version> <version>R8</version>
<exclusions>
<exclusion>
<groupId>bouncycastle</groupId>
<artifactId>bcprov-jdk14</artifactId>
</exclusion>
</exclusions>
</dependency> </dependency>
<!-- 支持css样式渲染 --> <!-- 支持css样式渲染 -->
<dependency> <dependency>
@ -603,6 +609,17 @@
<groupId>org.redisson</groupId> <groupId>org.redisson</groupId>
<artifactId>redisson</artifactId> <artifactId>redisson</artifactId>
<version>3.11.4</version> <version>3.11.4</version>
<exclusions>
<!-- 项目仍使用 jodd 3.x排除 redisson 传入的 jodd 5.x避免运行时方法签名冲突 -->
<exclusion>
<groupId>org.jodd</groupId>
<artifactId>jodd-bean</artifactId>
</exclusion>
<exclusion>
<groupId>org.jodd</groupId>
<artifactId>jodd-core</artifactId>
</exclusion>
</exclusions>
<!-- <version>3.13.3</version>--> <!-- <version>3.13.3</version>-->
</dependency> </dependency>
<!-- zkclient --> <!-- zkclient -->

View File

@ -0,0 +1,400 @@
package com.sipai.controller.administration;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.sipai.entity.activiti.WorkTask;
import com.sipai.entity.administration.LeaveApply;
import com.sipai.entity.administration.LeaveCommStr;
import com.sipai.entity.base.Result;
import com.sipai.entity.business.BusinessUnit;
import com.sipai.entity.business.BusinessUnitAudit;
import com.sipai.entity.business.BusinessUnitHandle;
import com.sipai.entity.business.BusinessUnitRecord;
import com.sipai.entity.user.User;
import com.sipai.service.activiti.WorkflowProcessDefinitionService;
import com.sipai.service.activiti.WorkflowService;
import com.sipai.service.administration.LeaveApplyService;
import com.sipai.service.business.BusinessUnitAuditService;
import com.sipai.service.business.BusinessUnitHandleService;
import com.sipai.service.user.UserService;
import com.sipai.tools.ActivitiUtil;
import com.sipai.tools.CommString;
import com.sipai.tools.CommUtil;
import net.sf.json.JSONArray;
import org.activiti.engine.RuntimeService;
import org.activiti.engine.TaskService;
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.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.text.SimpleDateFormat;
import java.util.*;
@Controller
@RequestMapping("/administration/leaveApply")
public class LeaveApplyController {
@Resource
private LeaveApplyService leaveApplyService;
@Resource
private WorkflowProcessDefinitionService workflowProcessDefinitionService;
@Resource
private BusinessUnitHandleService businessUnitHandleService;
@Resource
private BusinessUnitAuditService businessUnitAuditService;
@Resource
private WorkflowService workflowService;
@Resource
private RuntimeService runtimeService;
@Resource
private TaskService taskService;
@Resource
private UserService userService;
@RequestMapping("/showList.do")
public String showList(HttpServletRequest request, Model model) {
return "/administration/leaveApplyList";
}
@RequestMapping("/getList.do")
public ModelAndView getList(HttpServletRequest request, Model model,
@RequestParam(value = "page") Integer page,
@RequestParam(value = "rows") Integer rows,
@RequestParam(value = "sort", required = false) String sort,
@RequestParam(value = "order", required = false) String order) {
if (sort == null || "id".equals(sort)) {
sort = " insdt ";
}
if (order == null) {
order = " desc ";
}
String wherestr = " where 1=1 ";
if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) {
wherestr += " and unit_id = '" + request.getParameter("search_code") + "'";
}
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
wherestr += " and (reason like '%" + request.getParameter("search_name") + "%' or insuser like '%" + request.getParameter("search_name") + "%')";
}
if (request.getParameter("applyType") != null && !request.getParameter("applyType").isEmpty()) {
wherestr += " and apply_type = '" + request.getParameter("applyType") + "'";
}
PageHelper.startPage(page, rows);
List<LeaveApply> list = this.leaveApplyService.selectListByWhere(wherestr + " order by " + sort + " " + order);
PageInfo<LeaveApply> pInfo = new PageInfo<LeaveApply>(list);
JSONArray jsonArray = JSONArray.fromObject(list);
String result = "{\"total\":" + pInfo.getTotal() + ",\"rows\":" + jsonArray + "}";
model.addAttribute("result", result);
return new ModelAndView("result");
}
@RequestMapping("/add.do")
public String add(HttpServletRequest request, Model model) {
return "/administration/leaveApplyAdd";
}
@RequestMapping("/save.do")
public String save(HttpServletRequest request, Model model, @ModelAttribute LeaveApply leaveApply) {
User cu = (User) request.getSession().getAttribute("cu");
leaveApply.setId(CommUtil.getUUID());
leaveApply.setInsdt(CommUtil.nowDate());
leaveApply.setInsuser(cu.getId());
leaveApply.setState(LeaveCommStr.STATE_DRAFT);
leaveApply.setDelFlag("0");
int result = this.leaveApplyService.save(leaveApply);
String resultstr = "{\"res\":\"" + result + "\",\"id\":\"" + leaveApply.getId() + "\"}";
model.addAttribute("result", resultstr);
return "result";
}
@RequestMapping("/edit.do")
public String edit(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) {
model.addAttribute("leaveApply", this.leaveApplyService.selectById(id));
return "/administration/leaveApplyEdit";
}
@RequestMapping("/update.do")
public String update(HttpServletRequest request, Model model, @ModelAttribute LeaveApply leaveApply) {
User cu = (User) request.getSession().getAttribute("cu");
leaveApply.setUpduser(cu.getId());
leaveApply.setUpddt(CommUtil.nowDate());
int result = this.leaveApplyService.update(leaveApply);
String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + leaveApply.getId() + "\"}";
model.addAttribute("result", resstr);
return "result";
}
@RequestMapping("/view.do")
public String view(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) {
model.addAttribute("leaveApply", this.leaveApplyService.selectById(id));
return "/administration/leaveApplyView";
}
@RequestMapping("/delete.do")
public String delete(HttpServletRequest request, Model model, @RequestParam(value = "id") String id) {
int result = this.leaveApplyService.deleteById(id);
model.addAttribute("result", result);
return "result";
}
@RequestMapping("/deletes.do")
public String deletes(HttpServletRequest request, Model model, @RequestParam(value = "ids") String ids) {
ids = ids.replace(",", "','");
int result = this.leaveApplyService.deleteByWhere("where id in ('" + ids + "')");
model.addAttribute("result", result);
return "result";
}
@RequestMapping("/startProcess.do")
public String startProcess(HttpServletRequest request, Model model, @ModelAttribute LeaveApply leaveApply) {
User cu = (User) request.getSession().getAttribute("cu");
if (leaveApply.getId() == null || leaveApply.getId().isEmpty()) {
leaveApply.setId(CommUtil.getUUID());
}
leaveApply.setInsuser(cu.getId());
leaveApply.setInsdt(CommUtil.nowDate());
int result = this.leaveApplyService.doStartProcess(leaveApply);
String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + leaveApply.getId() + "\"}";
model.addAttribute("result", resstr);
return "result";
}
@RequestMapping("/showExecuteView.do")
public String showExecuteView(HttpServletRequest request, Model model) {
String id = request.getParameter("id");
LeaveApply leaveApply = this.leaveApplyService.selectById(id);
if (leaveApply == null) {
model.addAttribute("businessUnitRecords", JSONArray.fromObject(new ArrayList<BusinessUnitRecord>()));
model.addAttribute("finishFlag", false);
model.addAttribute("processStarted", false);
model.addAttribute("processMessage", "未找到对应的请假申请记录。");
if (request.getParameter("inModal") != null) {
return "administration/leaveApplyExecuteViewInModal";
}
return "administration/leaveApplyExecuteView";
}
request.setAttribute("business", leaveApply);
List<BusinessUnitRecord> businessUnitRecords = new ArrayList<BusinessUnitRecord>();
User launchUser = userService.getUserById(leaveApply.getInsuser());
String recordUser = leaveApply.getAuditMan();
BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(
leaveApply.getInsdt(), leaveApply.getInsuser(), leaveApply.getId(), leaveApply.getProcessid(),
leaveApply.getUnitId(), null, (recordUser == null || recordUser.trim().isEmpty() || "待签收".equals(recordUser))
? "提交了请假补假申请,等待审批人签收。"
: "提交了请假补假申请至" + recordUser + "进行审批。", launchUser, "流程发起");
businessUnitRecords.add(businessUnitRecord);
boolean processStarted = leaveApply.getProcessdefid() != null && !leaveApply.getProcessdefid().trim().isEmpty();
if (processStarted) {
List<WorkTask> workTasks = workflowProcessDefinitionService.getAllPDTask(leaveApply.getProcessdefid(), "desc");
List<String> keys = new ArrayList<String>();
for (WorkTask workTask : workTasks) {
keys.add(workTask.getTaskKey());
}
Set set = new HashSet();
set.addAll(keys);
keys = new ArrayList<String>();
keys.addAll(set);
for (String item : keys) {
if (BusinessUnit.UNIT_LEAVE_APPLY_HANDLE.equals(item)) {
List<BusinessUnitHandle> list = businessUnitHandleService.selectListByWhere("where businessid='" + id + "'");
for (BusinessUnitHandle businessUnitHandle : list) {
businessUnitRecord = new BusinessUnitRecord(businessUnitHandle);
businessUnitRecords.add(businessUnitRecord);
}
} else if (BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT.equals(item)
|| BusinessUnit.UNIT_LEAVE_APPLY_MANAGER_AUDIT.equals(item)
|| BusinessUnit.UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT.equals(item)) {
List<BusinessUnitAudit> listAudit = businessUnitAuditService.selectListByWhere("where businessid='" + id + "'");
for (BusinessUnitAudit businessUnitAudit : listAudit) {
businessUnitRecord = new BusinessUnitRecord(businessUnitAudit);
businessUnitRecords.add(businessUnitRecord);
}
break;
}
}
}
if (leaveApply.getProcessid() != null && !leaveApply.getProcessid().trim().isEmpty()) {
List<HistoricTaskInstance> list = this.workflowService.getHistoryService().createHistoricTaskInstanceQuery()
.processInstanceId(leaveApply.getProcessid()).list();
for (HistoricTaskInstance task : list) {
if (task.getAssignee() == null || task.getClaimTime() == null) {
continue;
}
businessUnitRecord = new BusinessUnitRecord(task);
businessUnitRecords.add(businessUnitRecord);
}
}
Collections.sort(businessUnitRecords, new Comparator<BusinessUnitRecord>() {
public int compare(BusinessUnitRecord o1, BusinessUnitRecord o2) {
SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
try {
Date dt1 = df.parse(o1.getInsdt());
Date dt2 = df.parse(o2.getInsdt());
if (dt1.getTime() > dt2.getTime()) {
return 1;
} else if (dt1.getTime() < dt2.getTime()) {
return -1;
}
} catch (Exception e) {
e.printStackTrace();
}
return 0;
}
});
model.addAttribute("businessUnitRecords", JSONArray.fromObject(businessUnitRecords));
long num = 0L;
if (leaveApply.getProcessid() != null && !leaveApply.getProcessid().trim().isEmpty()) {
num = runtimeService.createProcessInstanceQuery().processInstanceId(leaveApply.getProcessid()).count();
}
model.addAttribute("finishFlag", processStarted && num <= 0);
model.addAttribute("processStarted", processStarted);
model.addAttribute("processMessage", processStarted ? "" : "当前请假单尚未发起审批流程,仅显示单据信息。");
if (request.getParameter("inModal") != null) {
return "administration/leaveApplyExecuteViewInModal";
}
return "administration/leaveApplyExecuteView";
}
@RequestMapping("/showAudit.do")
public String showAudit(HttpServletRequest request, Model model) {
String taskId = request.getParameter("taskId");
String processInstanceId = request.getParameter("processInstanceId");
BusinessUnitAudit businessUnitAudit = new BusinessUnitAudit();
Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult();
model.addAttribute("taskName", task.getName());
ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
businessUnitAudit.setId(CommUtil.getUUID());
businessUnitAudit.setProcessid(processInstanceId);
businessUnitAudit.setTaskid(taskId);
businessUnitAudit.setBusinessid(pInstance.getBusinessKey());
businessUnitAudit.setTaskdefinitionkey(task.getTaskDefinitionKey());
model.addAttribute("businessUnitAudit", businessUnitAudit);
model.addAttribute("leaveApply", this.leaveApplyService.selectById(pInstance.getBusinessKey()));
List<ActivityImpl> activityImpls = workflowProcessDefinitionService.getNEXTActivities(task.getProcessDefinitionId(), task.getTaskDefinitionKey());
model.addAttribute("showTargetUsersFlag", activityImpls.size() > 0);
return "administration/leaveApplyAudit";
}
@RequestMapping("/doAudit.do")
public String doAudit(HttpServletRequest request, Model model, @ModelAttribute BusinessUnitAudit businessUnitAudit) {
User cu = (User) request.getSession().getAttribute("cu");
businessUnitAudit.setInsuser(cu.getId());
businessUnitAudit.setInsdt(CommUtil.nowDate());
if (businessUnitAudit.getPassstatus() && (businessUnitAudit.getTargetusers() == null || businessUnitAudit.getTargetusers().trim().isEmpty())) {
LeaveApply leaveApply = this.leaveApplyService.selectById(businessUnitAudit.getBusinessid());
businessUnitAudit.setTargetusers(this.leaveApplyService.getDefaultCandidateUserIdsForNextTask(
leaveApply, businessUnitAudit.getTaskdefinitionkey(), businessUnitAudit.getRouteNum(), true));
}
int result = this.leaveApplyService.doAuditProcess(businessUnitAudit);
String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + businessUnitAudit.getId() + "\"}";
model.addAttribute("result", resstr);
return "result";
}
@RequestMapping("/showHandle.do")
public String showHandle(HttpServletRequest request, Model model) {
String taskId = request.getParameter("taskId");
String processInstanceId = request.getParameter("processInstanceId");
String unitId = request.getParameter("unitId");
BusinessUnitHandle businessUnitHandle = new BusinessUnitHandle();
Task task = this.taskService.createTaskQuery().taskId(taskId).singleResult();
model.addAttribute("taskName", task.getName());
List<BusinessUnitHandle> businessUnitHandles = this.businessUnitHandleService.selectListByWhere("where processid='" + processInstanceId + "' and taskId='" + taskId + "'");
if (businessUnitHandles != null && businessUnitHandles.size() > 0) {
businessUnitHandle = businessUnitHandles.get(0);
businessUnitHandle.setTaskid(taskId);
} else {
businessUnitHandle.setId(CommUtil.getUUID());
businessUnitHandle.setProcessid(processInstanceId);
businessUnitHandle.setTaskid(taskId);
ProcessInstance pInstance = runtimeService.createProcessInstanceQuery().processInstanceId(processInstanceId).singleResult();
businessUnitHandle.setBusinessid(pInstance.getBusinessKey());
businessUnitHandle.setTaskdefinitionkey(task.getTaskDefinitionKey());
businessUnitHandle.setUnitid(unitId);
}
String userIds = businessUnitHandle.getTargetusers();
if (userIds != null && !userIds.isEmpty()) {
List<User> users = userService.selectListByWhere("where id in('" + userIds.replace(",", "','") + "')");
String targetUsersName = "";
for (User user : users) {
if (!targetUsersName.isEmpty()) {
targetUsersName += ",";
}
targetUsersName += user.getCaption();
}
model.addAttribute("targetUsersName", targetUsersName);
}
model.addAttribute("businessUnitHandle", businessUnitHandle);
LeaveApply leaveApply = this.leaveApplyService.selectById(businessUnitHandle.getBusinessid());
model.addAttribute("leaveApply", leaveApply);
List<BusinessUnitAudit> businessUnitAudits = this.businessUnitAuditService.selectListByWhere("where businessId = '" + leaveApply.getId() + "' order by insdt desc");
String rejectReason = "";
if (businessUnitAudits != null && businessUnitAudits.size() > 0) {
rejectReason = businessUnitAudits.get(0).getAuditopinion();
}
model.addAttribute("rejectReason", rejectReason);
ActivityImpl activityImpl = workflowProcessDefinitionService.getNEXTActivityImpl(task.getProcessDefinitionId(), task.getTaskDefinitionKey(), CommString.ACTI_Condition_PASS);
model.addAttribute("showTargetUsersFlag", activityImpl != null && "userTask".equals(activityImpl.getProperties().get("type")));
return "administration/leaveApplyHandle";
}
@RequestMapping("/doHandle.do")
public String doHandle(HttpServletRequest request, Model model,
@ModelAttribute LeaveApply leaveApply,
@ModelAttribute BusinessUnitHandle businessUnitHandle) {
User cu = (User) request.getSession().getAttribute("cu");
int result = 0;
leaveApply.setUpduser(cu.getId());
leaveApply.setUpddt(CommUtil.nowDate());
leaveApply.setState(LeaveCommStr.STATE_SECTION_AUDIT);
result = this.leaveApplyService.update(leaveApply);
if (result > 0) {
String routeNum = request.getParameter("routeNum");
businessUnitHandle.setStatus(BusinessUnitHandle.Status_FINISH);
if (!this.businessUnitHandleService.checkExit(businessUnitHandle)) {
businessUnitHandle.setInsuser(cu.getId());
businessUnitHandle.setInsdt(CommUtil.nowDate());
result = this.businessUnitHandleService.save(businessUnitHandle);
} else {
result = this.businessUnitHandleService.update(businessUnitHandle);
}
try {
Map<String, Object> variables = new HashMap<String, Object>();
variables = ActivitiUtil.fixVariableWithRoute(variables, true, routeNum);
if (businessUnitHandle.getTargetusers() == null || businessUnitHandle.getTargetusers().trim().isEmpty()) {
businessUnitHandle.setTargetusers(this.leaveApplyService.getDefaultCandidateUserIds(
leaveApply, BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT));
}
variables.put(CommString.ACTI_KEK_Candidate_Users, businessUnitHandle.getTargetusers());
variables.put(CommString.ACTI_KEK_Assignee, null);
taskService.complete(businessUnitHandle.getTaskid(), variables);
} catch (Exception e) {
e.printStackTrace();
result = 0;
}
}
String resstr = "{\"res\":\"" + result + "\",\"id\":\"" + leaveApply.getId() + "\"}";
model.addAttribute("result", resstr);
return "result";
}
@RequestMapping("/getList4Mobile.do")
public Result getList4Mobile(HttpServletRequest request, Model model) {
String wherestr = "where 1=1 order by insdt desc";
List<LeaveApply> list = this.leaveApplyService.selectListByWhere(wherestr);
JSONArray json = JSONArray.fromObject(list);
String res = "{\"total\":" + list.size() + ",\"rows\":" + json + "}";
return Result.success(res);
}
}

View File

@ -22,13 +22,13 @@ import org.springframework.stereotype.Controller;
import org.springframework.ui.Model; import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import sun.misc.BASE64Decoder;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.File; import java.io.File;
import java.io.FileOutputStream; import java.io.FileOutputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
@ -92,15 +92,9 @@ public class BaiDuAipSpeechController {
String type = request.getParameter("type"); String type = request.getParameter("type");
String upfile_b64 = request.getParameter("upfile_b64"); String upfile_b64 = request.getParameter("upfile_b64");
BASE64Decoder decoder = new BASE64Decoder();
try { try {
//Base64解码 //Base64解码
byte[] b = decoder.decodeBuffer(upfile_b64); byte[] b = Base64.getMimeDecoder().decode(upfile_b64);
for (int i = 0; i < b.length; ++i) {
if (b[i] < 0) {//调整异常数据
b[i] += 256;
}
}
String imgFilePath = "D:\\audio\\recorder.mp3"; String imgFilePath = "D:\\audio\\recorder.mp3";
File fileUploadPath = new File("D:\\audio"); File fileUploadPath = new File("D:\\audio");
if (!fileUploadPath.exists()) { if (!fileUploadPath.exists()) {
@ -129,15 +123,9 @@ public class BaiDuAipSpeechController {
String type = request.getParameter("type"); String type = request.getParameter("type");
String upfile_b64 = request.getParameter("upfile_b64"); String upfile_b64 = request.getParameter("upfile_b64");
BASE64Decoder decoder = new BASE64Decoder();
try { try {
//Base64解码 //Base64解码
byte[] b = decoder.decodeBuffer(upfile_b64); byte[] b = Base64.getMimeDecoder().decode(upfile_b64);
for (int i = 0; i < b.length; ++i) {
if (b[i] < 0) {//调整异常数据
b[i] += 256;
}
}
String imgFilePath = "D:\\audio\\recorder.mp3"; String imgFilePath = "D:\\audio\\recorder.mp3";
File fileUploadPath = new File("D:\\audio"); File fileUploadPath = new File("D:\\audio");
if (!fileUploadPath.exists()) { if (!fileUploadPath.exists()) {

View File

@ -30,7 +30,6 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile; import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest; import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView; import org.springframework.web.servlet.ModelAndView;
import sun.misc.BASE64Encoder;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -41,6 +40,7 @@ import java.io.InputStream;
import java.io.UnsupportedEncodingException; import java.io.UnsupportedEncodingException;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -145,21 +145,27 @@ public class UserController {
wherestr += "and pid in (" + pidstr + ") "; wherestr += "and pid in (" + pidstr + ") ";
} }
} else { } else {
Company company = unitService.getCompanyByUserId(cu.getId()); String companyId = request.getParameter("companyId");
String companyId = "-1"; if (StringUtils.isBlank(companyId) && cu != null && StringUtils.isNotBlank(cu.getId())) {
if (company != null) { Company company = unitService.getCompanyByUserId(cu.getId());
companyId = company.getId(); if (company != null) {
} companyId = company.getId();
List<User> users = unitService.getChildrenUsersById(companyId);
String userIds = "";
for (User user : users) {
if (!userIds.isEmpty()) {
userIds += "','";
} }
userIds += user.getId();
} }
if (!userIds.isEmpty()) { if (StringUtils.isNotBlank(companyId)) {
wherestr += "and id in ('" + userIds + "') "; List<User> users = unitService.getChildrenUsersById(companyId);
String userIds = "";
for (User user : users) {
if (!userIds.isEmpty()) {
userIds += "','";
}
userIds += user.getId();
}
if (!userIds.isEmpty()) {
wherestr += "and id in ('" + userIds + "') ";
}
} else {
wherestr += "and 1=0 ";
} }
} }
} }
@ -587,8 +593,7 @@ public class UserController {
in.read(data); in.read(data);
in.close(); in.close();
//将二进制字节用base64编码以字符串方式存到数据库中 //将二进制字节用base64编码以字符串方式存到数据库中
BASE64Encoder encoder = new BASE64Encoder(); String headPortrait = Base64.getEncoder().encodeToString(data);
String headPortrait = encoder.encode(data);
User cu = (User) request.getSession().getAttribute("cu"); User cu = (User) request.getSession().getAttribute("cu");
UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId()); UserDetail userDetail = this.userDetailService.selectByUserId(cu.getId());
int res = 0; int res = 0;

View File

@ -18,7 +18,6 @@ import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.ModelAttribute; import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RequestParam;
import sun.misc.BASE64Decoder;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.script.ScriptEngine; import javax.script.ScriptEngine;
@ -32,6 +31,7 @@ import java.io.IOException;
import java.io.OutputStream; import java.io.OutputStream;
import java.math.BigDecimal; import java.math.BigDecimal;
import java.text.DecimalFormat; import java.text.DecimalFormat;
import java.util.Base64;
import java.util.List; import java.util.List;
@SuppressWarnings({"restriction", "unused"}) @SuppressWarnings({"restriction", "unused"})
@ -719,12 +719,7 @@ public class WordAnalysisReportStructureController {
String id = strconts[0]; String id = strconts[0];
String img = strconts[2]; String img = strconts[2];
byte[] b2 = new BASE64Decoder().decodeBuffer(img); byte[] b2 = Base64.getMimeDecoder().decode(img);
for (int i = 0; i < b2.length; ++i) {
if (b2[i] < 0) {// 调整异常数据
b2[i] += 256;
}
}
// 生成png图片 // 生成png图片
String contextPath = request.getContextPath().replace("/", ""); String contextPath = request.getContextPath().replace("/", "");
String filepathSever = request.getSession().getServletContext().getRealPath(""); String filepathSever = request.getSession().getServletContext().getRealPath("");

View File

@ -0,0 +1,13 @@
package com.sipai.dao.administration;
import com.sipai.dao.base.CommDaoImpl;
import com.sipai.entity.administration.LeaveApply;
import org.springframework.stereotype.Repository;
@Repository
public class LeaveApplyDao extends CommDaoImpl<LeaveApply> {
public LeaveApplyDao() {
super();
this.setMappernamespace("administration.LeaveApplyMapper");
}
}

View File

@ -50,6 +50,8 @@ public enum ProcessType {
Administration_Reserve("Administration_Reserve","预案工作"), Administration_Reserve("Administration_Reserve","预案工作"),
/*预案*/ /*预案*/
Administration_Temporary("Administration_Temporary","临时任务"), Administration_Temporary("Administration_Temporary","临时任务"),
/*请假补假*/
Administration_Leave("Administration_Leave","请假补假"),
/*工艺调整*/ /*工艺调整*/
Process_Adjustment("Process_Adjustment","工艺调整"), Process_Adjustment("Process_Adjustment","工艺调整"),
/*水质化验*/ /*水质化验*/

View File

@ -0,0 +1,267 @@
package com.sipai.entity.administration;
import com.sipai.entity.base.BusinessUnitAdapter;
public class LeaveApply extends BusinessUnitAdapter {
private String id;
private String insdt;
private String insuser;
private String upduser;
private String upddt;
private String unitId;
private String applyType;
private String leaveType;
private String startTime;
private String endTime;
private String hours;
private String days;
private String reason;
private String handoverDesc;
private String attachmentIds;
private String overtimeRefId;
private String overtimeHours;
private String actualStartTime;
private String actualEndTime;
private String state;
private String stateName;
private String auditManId;
private String auditMan;
private String submissionTime;
private String processid;
private String processdefid;
private String remark;
private String delFlag;
private String insuserName;
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
public String getInsdt() {
return insdt;
}
public void setInsdt(String insdt) {
this.insdt = insdt;
}
public String getInsuser() {
return insuser;
}
public void setInsuser(String insuser) {
this.insuser = insuser;
}
public String getUpduser() {
return upduser;
}
public void setUpduser(String upduser) {
this.upduser = upduser;
}
public String getUpddt() {
return upddt;
}
public void setUpddt(String upddt) {
this.upddt = upddt;
}
public String getUnitId() {
return unitId;
}
public void setUnitId(String unitId) {
this.unitId = unitId;
}
public String getApplyType() {
return applyType;
}
public void setApplyType(String applyType) {
this.applyType = applyType;
}
public String getLeaveType() {
return leaveType;
}
public void setLeaveType(String leaveType) {
this.leaveType = leaveType;
}
public String getStartTime() {
return startTime;
}
public void setStartTime(String startTime) {
this.startTime = startTime;
}
public String getEndTime() {
return endTime;
}
public void setEndTime(String endTime) {
this.endTime = endTime;
}
public String getHours() {
return hours;
}
public void setHours(String hours) {
this.hours = hours;
}
public String getDays() {
return days;
}
public void setDays(String days) {
this.days = days;
}
public String getReason() {
return reason;
}
public void setReason(String reason) {
this.reason = reason;
}
public String getHandoverDesc() {
return handoverDesc;
}
public void setHandoverDesc(String handoverDesc) {
this.handoverDesc = handoverDesc;
}
public String getAttachmentIds() {
return attachmentIds;
}
public void setAttachmentIds(String attachmentIds) {
this.attachmentIds = attachmentIds;
}
public String getOvertimeRefId() {
return overtimeRefId;
}
public void setOvertimeRefId(String overtimeRefId) {
this.overtimeRefId = overtimeRefId;
}
public String getOvertimeHours() {
return overtimeHours;
}
public void setOvertimeHours(String overtimeHours) {
this.overtimeHours = overtimeHours;
}
public String getActualStartTime() {
return actualStartTime;
}
public void setActualStartTime(String actualStartTime) {
this.actualStartTime = actualStartTime;
}
public String getActualEndTime() {
return actualEndTime;
}
public void setActualEndTime(String actualEndTime) {
this.actualEndTime = actualEndTime;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public String getStateName() {
return stateName;
}
public void setStateName(String stateName) {
this.stateName = stateName;
}
public String getAuditManId() {
return auditManId;
}
public void setAuditManId(String auditManId) {
this.auditManId = auditManId;
}
public String getAuditMan() {
return auditMan;
}
public void setAuditMan(String auditMan) {
this.auditMan = auditMan;
}
public String getSubmissionTime() {
return submissionTime;
}
public void setSubmissionTime(String submissionTime) {
this.submissionTime = submissionTime;
}
public String getProcessid() {
return processid;
}
public void setProcessid(String processid) {
this.processid = processid;
}
public String getProcessdefid() {
return processdefid;
}
public void setProcessdefid(String processdefid) {
this.processdefid = processdefid;
}
public String getRemark() {
return remark;
}
public void setRemark(String remark) {
this.remark = remark;
}
public String getDelFlag() {
return delFlag;
}
public void setDelFlag(String delFlag) {
this.delFlag = delFlag;
}
public String getInsuserName() {
return insuserName;
}
public void setInsuserName(String insuserName) {
this.insuserName = insuserName;
}
}

View File

@ -0,0 +1,30 @@
package com.sipai.entity.administration;
public class LeaveCommStr {
public static final String APPLY_TYPE_LEAVE = "leave";
public static final String APPLY_TYPE_COMPENSATORY = "compensatory";
public static final String STATE_DRAFT = "草稿";
public static final String STATE_SECTION_AUDIT = "科长/副科长审批";
public static final String STATE_MANAGER_AUDIT = "分管经理审批";
public static final String STATE_GENERAL_MANAGER_AUDIT = "总经理审批";
public static final String STATE_HANDLE = "退回修改";
public static final String STATE_FINISH = "已通过";
public static final String STATE_REJECT = "已驳回";
public static final String[][] APPLY_TYPES = {
{APPLY_TYPE_LEAVE, "请假"},
{APPLY_TYPE_COMPENSATORY, "补假"}
};
public static final String[][] LEAVE_TYPES = {
{"annual", "年假"},
{"personal", "事假"},
{"sick", "病假"},
{"marriage", "婚假"},
{"maternity", "产假"},
{"funeral", "丧假"},
{"adjustment", "调休"}
};
}

View File

@ -115,6 +115,11 @@ public class BusinessUnit extends SQLAdapter {
//预案工作审核流程节点 //预案工作审核流程节点
public final static String UNIT_Temporary_AUDIT = "temporary_audit";//指标审核 public final static String UNIT_Temporary_AUDIT = "temporary_audit";//指标审核
public final static String UNIT_Temporary_HANDLE = "temporary_handle";//指标业务处理 public final static String UNIT_Temporary_HANDLE = "temporary_handle";//指标业务处理
//请假补假流程节点
public final static String UNIT_LEAVE_APPLY_SECTION_AUDIT = "leave_apply_section_audit";
public final static String UNIT_LEAVE_APPLY_MANAGER_AUDIT = "leave_apply_manager_audit";
public final static String UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT = "leave_apply_general_manager_audit";
public final static String UNIT_LEAVE_APPLY_HANDLE = "leave_apply_handle";
/** /**
* 运行模块 * 运行模块

View File

@ -0,0 +1,160 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="administration.LeaveApplyMapper" >
<resultMap id="BaseResultMap" type="com.sipai.entity.administration.LeaveApply" >
<id column="id" property="id" jdbcType="VARCHAR" />
<result column="insdt" property="insdt" jdbcType="TIMESTAMP" />
<result column="insuser" property="insuser" jdbcType="VARCHAR" />
<result column="upduser" property="upduser" jdbcType="VARCHAR" />
<result column="upddt" property="upddt" jdbcType="TIMESTAMP" />
<result column="unit_id" property="unitId" jdbcType="VARCHAR" />
<result column="apply_type" property="applyType" jdbcType="VARCHAR" />
<result column="leave_type" property="leaveType" jdbcType="VARCHAR" />
<result column="start_time" property="startTime" jdbcType="TIMESTAMP" />
<result column="end_time" property="endTime" jdbcType="TIMESTAMP" />
<result column="hours" property="hours" jdbcType="DECIMAL" />
<result column="days" property="days" jdbcType="DECIMAL" />
<result column="reason" property="reason" jdbcType="VARCHAR" />
<result column="handover_desc" property="handoverDesc" jdbcType="VARCHAR" />
<result column="attachment_ids" property="attachmentIds" jdbcType="VARCHAR" />
<result column="overtime_ref_id" property="overtimeRefId" jdbcType="VARCHAR" />
<result column="overtime_hours" property="overtimeHours" jdbcType="DECIMAL" />
<result column="actual_start_time" property="actualStartTime" jdbcType="TIMESTAMP" />
<result column="actual_end_time" property="actualEndTime" jdbcType="TIMESTAMP" />
<result column="state" property="state" jdbcType="VARCHAR" />
<result column="audit_man_id" property="auditManId" jdbcType="VARCHAR" />
<result column="submission_time" property="submissionTime" jdbcType="TIMESTAMP" />
<result column="processid" property="processid" jdbcType="VARCHAR" />
<result column="processdefid" property="processdefid" jdbcType="VARCHAR" />
<result column="remark" property="remark" jdbcType="VARCHAR" />
<result column="del_flag" property="delFlag" jdbcType="CHAR" />
</resultMap>
<sql id="Base_Column_List" >
id, insdt, insuser, upduser, upddt, unit_id, apply_type, leave_type, start_time, end_time,
hours, days, reason, handover_desc, attachment_ids, overtime_ref_id, overtime_hours,
actual_start_time, actual_end_time, state, audit_man_id, submission_time, processid,
processdefid, remark, del_flag
</sql>
<select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.String" >
select
<include refid="Base_Column_List" />
from tb_administration_leave_apply
where id = #{id,jdbcType=VARCHAR}
</select>
<delete id="deleteByPrimaryKey" parameterType="java.lang.String" >
delete from tb_administration_leave_apply
where id = #{id,jdbcType=VARCHAR}
</delete>
<insert id="insert" parameterType="com.sipai.entity.administration.LeaveApply" >
insert into tb_administration_leave_apply (
id, insdt, insuser, upduser, upddt, unit_id, apply_type, leave_type, start_time, end_time,
hours, days, reason, handover_desc, attachment_ids, overtime_ref_id, overtime_hours,
actual_start_time, actual_end_time, state, submission_time, processid,
processdefid, remark, del_flag)
values (
#{id,jdbcType=VARCHAR}, #{insdt,jdbcType=TIMESTAMP}, #{insuser,jdbcType=VARCHAR}, #{upduser,jdbcType=VARCHAR}, #{upddt,jdbcType=TIMESTAMP},
#{unitId,jdbcType=VARCHAR}, #{applyType,jdbcType=VARCHAR}, #{leaveType,jdbcType=VARCHAR}, #{startTime,jdbcType=TIMESTAMP}, #{endTime,jdbcType=TIMESTAMP},
NULLIF(#{hours,jdbcType=VARCHAR}, ''), NULLIF(#{days,jdbcType=VARCHAR}, ''), #{reason,jdbcType=VARCHAR}, #{handoverDesc,jdbcType=VARCHAR}, #{attachmentIds,jdbcType=VARCHAR},
#{overtimeRefId,jdbcType=VARCHAR}, NULLIF(#{overtimeHours,jdbcType=VARCHAR}, ''), #{actualStartTime,jdbcType=TIMESTAMP}, #{actualEndTime,jdbcType=TIMESTAMP},
#{state,jdbcType=VARCHAR}, #{submissionTime,jdbcType=TIMESTAMP}, #{processid,jdbcType=VARCHAR},
#{processdefid,jdbcType=VARCHAR}, #{remark,jdbcType=VARCHAR}, #{delFlag,jdbcType=CHAR})
</insert>
<insert id="insertSelective" parameterType="com.sipai.entity.administration.LeaveApply" >
insert into tb_administration_leave_apply
<trim prefix="(" suffix=")" suffixOverrides="," >
<if test="id != null" >id,</if>
<if test="insdt != null" >insdt,</if>
<if test="insuser != null" >insuser,</if>
<if test="upduser != null" >upduser,</if>
<if test="upddt != null" >upddt,</if>
<if test="unitId != null" >unit_id,</if>
<if test="applyType != null" >apply_type,</if>
<if test="leaveType != null" >leave_type,</if>
<if test="startTime != null" >start_time,</if>
<if test="endTime != null" >end_time,</if>
<if test="hours != null" >hours,</if>
<if test="days != null" >days,</if>
<if test="reason != null" >reason,</if>
<if test="handoverDesc != null" >handover_desc,</if>
<if test="attachmentIds != null" >attachment_ids,</if>
<if test="overtimeRefId != null" >overtime_ref_id,</if>
<if test="overtimeHours != null" >overtime_hours,</if>
<if test="actualStartTime != null" >actual_start_time,</if>
<if test="actualEndTime != null" >actual_end_time,</if>
<if test="state != null" >state,</if>
<if test="submissionTime != null" >submission_time,</if>
<if test="processid != null" >processid,</if>
<if test="processdefid != null" >processdefid,</if>
<if test="remark != null" >remark,</if>
<if test="delFlag != null" >del_flag,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides="," >
<if test="id != null" >#{id,jdbcType=VARCHAR},</if>
<if test="insdt != null" >#{insdt,jdbcType=TIMESTAMP},</if>
<if test="insuser != null" >#{insuser,jdbcType=VARCHAR},</if>
<if test="upduser != null" >#{upduser,jdbcType=VARCHAR},</if>
<if test="upddt != null" >#{upddt,jdbcType=TIMESTAMP},</if>
<if test="unitId != null" >#{unitId,jdbcType=VARCHAR},</if>
<if test="applyType != null" >#{applyType,jdbcType=VARCHAR},</if>
<if test="leaveType != null" >#{leaveType,jdbcType=VARCHAR},</if>
<if test="startTime != null" >#{startTime,jdbcType=TIMESTAMP},</if>
<if test="endTime != null" >#{endTime,jdbcType=TIMESTAMP},</if>
<if test="hours != null" >NULLIF(#{hours,jdbcType=VARCHAR}, ''),</if>
<if test="days != null" >NULLIF(#{days,jdbcType=VARCHAR}, ''),</if>
<if test="reason != null" >#{reason,jdbcType=VARCHAR},</if>
<if test="handoverDesc != null" >#{handoverDesc,jdbcType=VARCHAR},</if>
<if test="attachmentIds != null" >#{attachmentIds,jdbcType=VARCHAR},</if>
<if test="overtimeRefId != null" >#{overtimeRefId,jdbcType=VARCHAR},</if>
<if test="overtimeHours != null" >NULLIF(#{overtimeHours,jdbcType=VARCHAR}, ''),</if>
<if test="actualStartTime != null" >#{actualStartTime,jdbcType=TIMESTAMP},</if>
<if test="actualEndTime != null" >#{actualEndTime,jdbcType=TIMESTAMP},</if>
<if test="state != null" >#{state,jdbcType=VARCHAR},</if>
<if test="submissionTime != null" >#{submissionTime,jdbcType=TIMESTAMP},</if>
<if test="processid != null" >#{processid,jdbcType=VARCHAR},</if>
<if test="processdefid != null" >#{processdefid,jdbcType=VARCHAR},</if>
<if test="remark != null" >#{remark,jdbcType=VARCHAR},</if>
<if test="delFlag != null" >#{delFlag,jdbcType=CHAR},</if>
</trim>
</insert>
<update id="updateByPrimaryKeySelective" parameterType="com.sipai.entity.administration.LeaveApply" >
update tb_administration_leave_apply
<set >
<if test="insdt != null" >insdt = #{insdt,jdbcType=TIMESTAMP},</if>
<if test="insuser != null" >insuser = #{insuser,jdbcType=VARCHAR},</if>
<if test="upduser != null" >upduser = #{upduser,jdbcType=VARCHAR},</if>
<if test="upddt != null" >upddt = #{upddt,jdbcType=TIMESTAMP},</if>
<if test="unitId != null" >unit_id = #{unitId,jdbcType=VARCHAR},</if>
<if test="applyType != null" >apply_type = #{applyType,jdbcType=VARCHAR},</if>
<if test="leaveType != null" >leave_type = #{leaveType,jdbcType=VARCHAR},</if>
<if test="startTime != null" >start_time = #{startTime,jdbcType=TIMESTAMP},</if>
<if test="endTime != null" >end_time = #{endTime,jdbcType=TIMESTAMP},</if>
<if test="hours != null" >hours = NULLIF(#{hours,jdbcType=VARCHAR}, ''),</if>
<if test="days != null" >days = NULLIF(#{days,jdbcType=VARCHAR}, ''),</if>
<if test="reason != null" >reason = #{reason,jdbcType=VARCHAR},</if>
<if test="handoverDesc != null" >handover_desc = #{handoverDesc,jdbcType=VARCHAR},</if>
<if test="attachmentIds != null" >attachment_ids = #{attachmentIds,jdbcType=VARCHAR},</if>
<if test="overtimeRefId != null" >overtime_ref_id = #{overtimeRefId,jdbcType=VARCHAR},</if>
<if test="overtimeHours != null" >overtime_hours = NULLIF(#{overtimeHours,jdbcType=VARCHAR}, ''),</if>
<if test="actualStartTime != null" >actual_start_time = #{actualStartTime,jdbcType=TIMESTAMP},</if>
<if test="actualEndTime != null" >actual_end_time = #{actualEndTime,jdbcType=TIMESTAMP},</if>
<if test="state != null" >state = #{state,jdbcType=VARCHAR},</if>
audit_man_id = NULL,
<if test="submissionTime != null" >submission_time = #{submissionTime,jdbcType=TIMESTAMP},</if>
<if test="processid != null" >processid = #{processid,jdbcType=VARCHAR},</if>
<if test="processdefid != null" >processdefid = #{processdefid,jdbcType=VARCHAR},</if>
<if test="remark != null" >remark = #{remark,jdbcType=VARCHAR},</if>
<if test="delFlag != null" >del_flag = #{delFlag,jdbcType=CHAR},</if>
</set>
where id = #{id,jdbcType=VARCHAR}
</update>
<select id="selectListByWhere" parameterType="java.lang.String" resultMap="BaseResultMap" >
select
<include refid="Base_Column_List" />
from tb_administration_leave_apply
${where}
</select>
<delete id="deleteByWhere" parameterType="java.lang.String" >
delete from tb_administration_leave_apply
${where}
</delete>
</mapper>

View File

@ -0,0 +1,477 @@
package com.sipai.service.administration;
import com.sipai.dao.administration.LeaveApplyDao;
import com.sipai.entity.activiti.ProcessType;
import com.sipai.entity.administration.LeaveApply;
import com.sipai.entity.administration.LeaveCommStr;
import com.sipai.entity.base.BusinessUnitAdapter;
import com.sipai.entity.business.BusinessUnit;
import com.sipai.entity.business.BusinessUnitAudit;
import com.sipai.entity.business.BusinessUnitRecord;
import com.sipai.entity.maintenance.MaintenanceCommString;
import com.sipai.entity.user.User;
import com.sipai.service.activiti.WorkflowProcessDefinitionService;
import com.sipai.service.activiti.WorkflowService;
import com.sipai.service.business.BusinessUnitAuditService;
import com.sipai.service.user.JobService;
import com.sipai.service.user.UnitService;
import com.sipai.service.user.UserJobService;
import com.sipai.service.user.UserService;
import com.sipai.tools.CommService;
import org.apache.commons.lang3.StringUtils;
import org.activiti.engine.repository.ProcessDefinition;
import org.activiti.engine.runtime.ProcessInstance;
import org.activiti.engine.task.Task;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.LinkedHashSet;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Set;
@Service
public class LeaveApplyService implements CommService<LeaveApply> {
@Resource
private LeaveApplyDao leaveApplyDao;
@Resource
private UserService userService;
@Resource
private WorkflowProcessDefinitionService workflowProcessDefinitionService;
@Resource
private WorkflowService workflowService;
@Resource
private BusinessUnitAuditService businessUnitAuditService;
@Resource
private JobService jobService;
@Resource
private UserJobService userJobService;
@Resource
private UnitService unitService;
@Override
public LeaveApply selectById(String id) {
LeaveApply leaveApply = this.leaveApplyDao.selectByPrimaryKey(id);
this.fillExtraInfo(leaveApply);
return leaveApply;
}
@Override
public int deleteById(String id) {
return this.leaveApplyDao.deleteByPrimaryKey(id);
}
@Override
public int save(LeaveApply leaveApply) {
this.normalizeLeaveApply(leaveApply);
return this.leaveApplyDao.insert(leaveApply);
}
@Override
public int update(LeaveApply leaveApply) {
this.normalizeLeaveApply(leaveApply);
return this.leaveApplyDao.updateByPrimaryKeySelective(leaveApply);
}
@Override
public List<LeaveApply> selectListByWhere(String wherestr) {
LeaveApply leaveApply = new LeaveApply();
leaveApply.setWhere(wherestr);
List<LeaveApply> list = this.leaveApplyDao.selectListByWhere(leaveApply);
if (list != null) {
for (LeaveApply item : list) {
this.fillExtraInfo(item);
}
}
return list;
}
@Override
public int deleteByWhere(String wherestr) {
LeaveApply leaveApply = new LeaveApply();
leaveApply.setWhere(wherestr);
return this.leaveApplyDao.deleteByWhere(leaveApply);
}
public String getUserNamesByUserIds(String userIds) {
if (userIds == null || userIds.isEmpty()) {
return "";
}
userIds = userIds.replace(",", "','");
String userNames = "";
List<User> users = this.userService.selectListByWhere("where id in ('" + userIds + "')");
for (User item : users) {
if (!userNames.isEmpty()) {
userNames += ",";
}
userNames += item.getCaption();
}
return userNames;
}
@Transactional
public int doStartProcess(LeaveApply leaveApply) {
try {
this.normalizeLeaveApply(leaveApply);
String candidateUserIds = this.getDefaultCandidateUserIds(leaveApply, BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT);
Map<String, Object> variables = new HashMap<String, Object>();
if (StringUtils.isBlank(candidateUserIds)) {
return MaintenanceCommString.Response_StartProcess_NoUser;
}
variables.put("userIds", candidateUserIds);
variables.put("applyType", leaveApply.getApplyType());
variables.put("leaveType", leaveApply.getLeaveType());
variables.put("days", leaveApply.getDays());
variables.put("hours", leaveApply.getHours());
variables.put("applicantId", null);
List<ProcessDefinition> processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(
ProcessType.Administration_Leave.getId() + "-" + leaveApply.getUnitId());
if (processDefinitions == null || processDefinitions.size() == 0) {
processDefinitions = workflowProcessDefinitionService.getProcessDefsBykey(ProcessType.Administration_Leave.getId());
}
if (processDefinitions == null || processDefinitions.size() == 0) {
return MaintenanceCommString.Response_StartProcess_NoProcessDef;
}
ProcessInstance processInstance = workflowService.startWorkflow(
leaveApply.getId(), leaveApply.getInsuser(), processDefinitions.get(0).getKey(), variables);
if (processInstance == null) {
throw new RuntimeException();
}
leaveApply.setProcessid(processInstance.getId());
leaveApply.setProcessdefid(processDefinitions.get(0).getId());
leaveApply.setState(LeaveCommStr.STATE_SECTION_AUDIT);
leaveApply.setSubmissionTime(leaveApply.getInsdt());
int res = 0;
LeaveApply db = this.selectById(leaveApply.getId());
if (db != null) {
res = this.leaveApplyDao.updateByPrimaryKeySelective(leaveApply);
} else {
res = this.leaveApplyDao.insert(leaveApply);
}
if (res == 1) {
User user = userService.getUserById(leaveApply.getInsuser());
String recordUser = this.getUserNamesByUserIds(candidateUserIds);
BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(
leaveApply.getInsdt(), leaveApply.getInsuser(), leaveApply.getId(), leaveApply.getProcessid(),
leaveApply.getUnitId(), null, StringUtils.isBlank(recordUser)
? "提交了请假补假申请,等待审批人签收。"
: "提交了请假补假申请至" + recordUser + "进行审批。", user, "流程发起");
businessUnitRecord.sendMessage(candidateUserIds, "");
}
return res;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException();
}
}
public int updateStatus(String id) {
LeaveApply leaveApply = this.selectById(id);
List<Task> task = workflowService.getTaskService().createTaskQuery().processInstanceId(leaveApply.getProcessid()).list();
if (task != null && task.size() > 0) {
leaveApply.setState(task.get(0).getName());
} else {
leaveApply.setState(LeaveCommStr.STATE_FINISH);
}
return this.update(leaveApply);
}
@Transactional
public int doAuditProcess(BusinessUnitAudit entity) {
try {
BusinessUnitAdapter businessUnitAdapter = this.selectById(entity.getBusinessid());
int res = businessUnitAuditService.doAudit(entity, businessUnitAdapter);
if (res > 0) {
this.updateStatus(entity.getBusinessid());
}
return res;
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException();
}
}
private void fillExtraInfo(LeaveApply leaveApply) {
if (leaveApply == null) {
return;
}
if (leaveApply.getAuditManId() != null && !leaveApply.getAuditManId().isEmpty()) {
leaveApply.setAuditMan(this.getUserNamesByUserIds(leaveApply.getAuditManId()));
} else if (StringUtils.isNotBlank(leaveApply.getProcessid())
&& !LeaveCommStr.STATE_FINISH.equals(leaveApply.getState())
&& !LeaveCommStr.STATE_DRAFT.equals(leaveApply.getState())) {
leaveApply.setAuditMan("待签收");
}
if (leaveApply.getInsuser() != null && !leaveApply.getInsuser().isEmpty()) {
User user = this.userService.getUserById(leaveApply.getInsuser());
if (user != null) {
leaveApply.setInsuserName(user.getCaption());
}
}
leaveApply.setStateName(leaveApply.getState());
}
private void normalizeLeaveApply(LeaveApply leaveApply) {
if (leaveApply == null) {
return;
}
leaveApply.setStartTime(StringUtils.trimToNull(leaveApply.getStartTime()));
leaveApply.setEndTime(StringUtils.trimToNull(leaveApply.getEndTime()));
leaveApply.setActualStartTime(this.normalizeDateTimeValue(leaveApply.getActualStartTime()));
leaveApply.setActualEndTime(this.normalizeDateTimeValue(leaveApply.getActualEndTime()));
leaveApply.setHours(StringUtils.trimToNull(leaveApply.getHours()));
leaveApply.setDays(StringUtils.trimToNull(leaveApply.getDays()));
leaveApply.setOvertimeHours(StringUtils.trimToNull(leaveApply.getOvertimeHours()));
this.calculateDuration(leaveApply);
leaveApply.setStartTime(this.normalizeLeaveTimeValue(leaveApply.getStartTime()));
leaveApply.setEndTime(this.normalizeLeaveTimeValue(leaveApply.getEndTime()));
}
public String getDefaultCandidateUserIds(LeaveApply leaveApply) {
return this.getDefaultCandidateUserIds(leaveApply, null);
}
public String getDefaultCandidateUserIds(LeaveApply leaveApply, String taskDefinitionKey) {
if (leaveApply == null) {
return null;
}
String resourceId = StringUtils.trimToNull(taskDefinitionKey);
if (resourceId == null) {
resourceId = BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT;
}
String jobIds = StringUtils.trimToNull(this.jobService.getJobs4Activiti(
leaveApply.getUnitId(), ProcessType.Administration_Leave.getId(), resourceId));
if (StringUtils.isBlank(jobIds) && !BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT.equals(resourceId)) {
jobIds = StringUtils.trimToNull(this.jobService.getJobs4Activiti(
leaveApply.getUnitId(), ProcessType.Administration_Leave.getId()));
}
Set<String> unitUserIds = new LinkedHashSet<String>();
List<User> unitUsers = this.unitService.getChildrenUsersById(leaveApply.getUnitId());
if (unitUsers != null) {
for (User user : unitUsers) {
if (user != null && StringUtils.isNotBlank(user.getId())) {
unitUserIds.add(user.getId());
}
}
}
Set<String> candidateUserIds = new LinkedHashSet<String>();
if (StringUtils.isNotBlank(jobIds)) {
List<com.sipai.entity.user.UserJob> userJobs = this.userJobService.selectListByWhere(
"where jobid in ('" + jobIds.replace(",", "','") + "')");
if (userJobs != null) {
for (com.sipai.entity.user.UserJob userJob : userJobs) {
if (userJob != null && StringUtils.isNotBlank(userJob.getUserid())
&& (unitUserIds.isEmpty() || unitUserIds.contains(userJob.getUserid()))) {
candidateUserIds.add(userJob.getUserid());
}
}
}
}
if (candidateUserIds.isEmpty()) {
candidateUserIds.addAll(unitUserIds);
}
return this.joinUserIds(new ArrayList<String>(candidateUserIds));
}
public String getDefaultCandidateUserIdsForNextTask(LeaveApply leaveApply, String currentTaskDefinitionKey, Integer routeNum, boolean passStatus) {
if (leaveApply == null || StringUtils.isBlank(leaveApply.getProcessdefid()) || StringUtils.isBlank(currentTaskDefinitionKey)) {
return this.getDefaultCandidateUserIds(leaveApply);
}
List<com.sipai.entity.activiti.WorkTask> nextWorkTasks =
workflowProcessDefinitionService.getNextWorkTasks(leaveApply.getProcessdefid(), currentTaskDefinitionKey);
if (nextWorkTasks == null || nextWorkTasks.isEmpty()) {
return null;
}
int expectedRouteNum = routeNum == null ? -1 : routeNum;
boolean matchedRoute = false;
for (com.sipai.entity.activiti.WorkTask workTask : nextWorkTasks) {
if (workTask == null) {
continue;
}
if (workTask.isPassFlag() != passStatus) {
continue;
}
if (expectedRouteNum >= 0 && workTask.getRouteNum() != expectedRouteNum) {
continue;
}
matchedRoute = true;
if (!"userTask".equals(workTask.getType())) {
continue;
}
return this.getDefaultCandidateUserIds(leaveApply, workTask.getTaskKey());
}
return matchedRoute ? null : this.getDefaultCandidateUserIds(leaveApply);
}
private String joinUserIds(List<String> userIds) {
if (userIds == null || userIds.isEmpty()) {
return null;
}
StringBuilder builder = new StringBuilder();
for (String userId : userIds) {
if (StringUtils.isBlank(userId)) {
continue;
}
if (builder.length() > 0) {
builder.append(",");
}
builder.append(userId.trim());
}
return builder.length() == 0 ? null : builder.toString();
}
private void calculateDuration(LeaveApply leaveApply) {
if (StringUtils.isBlank(leaveApply.getStartTime()) || StringUtils.isBlank(leaveApply.getEndTime())) {
leaveApply.setHours(null);
leaveApply.setDays(null);
return;
}
try {
if (this.isHalfDayValue(leaveApply.getStartTime()) && this.isHalfDayValue(leaveApply.getEndTime())) {
LeaveTimePoint startPoint = this.parseLeaveTimePoint(leaveApply.getStartTime());
LeaveTimePoint endPoint = this.parseLeaveTimePoint(leaveApply.getEndTime());
int halfDays = this.calculateHalfDays(startPoint, endPoint);
if (halfDays <= 0) {
leaveApply.setHours(null);
leaveApply.setDays(null);
return;
}
leaveApply.setHours(this.formatDecimal(BigDecimal.valueOf(halfDays * 4L)));
leaveApply.setDays(this.formatDecimal(BigDecimal.valueOf(halfDays).divide(BigDecimal.valueOf(2), 1, RoundingMode.HALF_UP)));
return;
}
Date startDate = this.parseDateTime(leaveApply.getStartTime());
Date endDate = this.parseDateTime(leaveApply.getEndTime());
long diffMillis = endDate.getTime() - startDate.getTime();
if (diffMillis <= 0) {
leaveApply.setHours(null);
leaveApply.setDays(null);
return;
}
BigDecimal hours = BigDecimal.valueOf(diffMillis)
.divide(BigDecimal.valueOf(1000L * 60L * 60L), 2, RoundingMode.HALF_UP);
BigDecimal days = hours.divide(BigDecimal.valueOf(8), 2, RoundingMode.HALF_UP);
if (days.compareTo(BigDecimal.valueOf(0.5)) < 0) {
days = BigDecimal.valueOf(0.5);
}
leaveApply.setHours(this.formatDecimal(hours));
leaveApply.setDays(this.formatDecimal(days));
} catch (ParseException e) {
leaveApply.setHours(null);
leaveApply.setDays(null);
}
}
private boolean isHalfDayValue(String value) {
if (StringUtils.isBlank(value)) {
return false;
}
String trimmed = StringUtils.trim(value);
if (trimmed.matches("^\\d{4}-\\d{2}-\\d{2}\\s+(上午|下午)$")) {
return true;
}
return trimmed.matches("^\\d{4}-\\d{2}-\\d{2}\\s+(00:00(?::00)?|12:00(?::00)?)$");
}
private LeaveTimePoint parseLeaveTimePoint(String value) throws ParseException {
String[] parts = StringUtils.trim(value).split("\\s+");
if (parts.length != 2) {
throw new ParseException("Unsupported leave time format: " + value, 0);
}
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
sdf.setLenient(false);
Calendar calendar = Calendar.getInstance();
calendar.setTime(sdf.parse(parts[0]));
return new LeaveTimePoint(calendar, this.parsePeriodIndex(parts[1]));
}
private int calculateHalfDays(LeaveTimePoint startPoint, LeaveTimePoint endPoint) {
long diffMillis = endPoint.calendar.getTimeInMillis() - startPoint.calendar.getTimeInMillis();
int dayDiff = (int) (diffMillis / (1000 * 60 * 60 * 24));
return dayDiff * 2 + (endPoint.periodIndex - startPoint.periodIndex) + 1;
}
private int parsePeriodIndex(String period) throws ParseException {
if ("下午".equals(period) || "12:00".equals(period) || "12:00:00".equals(period)) {
return 1;
}
if ("上午".equals(period) || "00:00".equals(period) || "00:00:00".equals(period)) {
return 0;
}
throw new ParseException("Unsupported leave period: " + period, 0);
}
private String normalizeLeaveTimeValue(String value) {
if (StringUtils.isBlank(value)) {
return null;
}
String trimmed = StringUtils.trim(value);
if (!trimmed.matches("^\\d{4}-\\d{2}-\\d{2}\\s+(上午|下午)$")) {
return this.normalizeDateTimeValue(trimmed);
}
String[] parts = trimmed.split("\\s+");
return parts[0] + ("下午".equals(parts[1]) ? " 12:00:00" : " 00:00:00");
}
private String normalizeDateTimeValue(String value) {
if (StringUtils.isBlank(value)) {
return null;
}
String trimmed = StringUtils.trim(value);
String[] patterns = new String[]{"yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM-dd"};
for (String pattern : patterns) {
try {
SimpleDateFormat parser = new SimpleDateFormat(pattern);
parser.setLenient(false);
Date parsed = parser.parse(trimmed);
SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
return formatter.format(parsed);
} catch (ParseException e) {
// try next format
}
}
return trimmed;
}
private Date parseDateTime(String value) throws ParseException {
String trimmed = StringUtils.trim(value);
String[] patterns = new String[]{"yyyy-MM-dd HH:mm:ss", "yyyy-MM-dd HH:mm", "yyyy-MM-dd"};
for (String pattern : patterns) {
try {
SimpleDateFormat parser = new SimpleDateFormat(pattern);
parser.setLenient(false);
return parser.parse(trimmed);
} catch (ParseException e) {
// try next format
}
}
throw new ParseException("Unsupported datetime format: " + value, 0);
}
private String formatDecimal(BigDecimal value) {
return value.stripTrailingZeros().toPlainString();
}
private static class LeaveTimePoint {
private final Calendar calendar;
private final int periodIndex;
private LeaveTimePoint(Calendar calendar, int periodIndex) {
this.calendar = calendar;
this.periodIndex = periodIndex;
}
}
}

View File

@ -33,4 +33,13 @@ public interface JobService {
* @return * @return
*/ */
String getJobs4Activiti(String unitId, String type); String getJobs4Activiti(String unitId, String type);
/**
* 获取流程指定节点岗位
* @param unitId 单位ID
* @param type ProcessType中的type
* @param resourceId 流程节点resourceId/taskDefinitionKey
* @return 逗号分隔的岗位ID
*/
String getJobs4Activiti(String unitId, String type, String resourceId);
} }

View File

@ -11,6 +11,7 @@ import com.sipai.entity.user.User;
import com.sipai.entity.user.UserJob; import com.sipai.entity.user.UserJob;
import com.sipai.tools.CommUtil; import com.sipai.tools.CommUtil;
import org.activiti.engine.RepositoryService; import org.activiti.engine.RepositoryService;
import org.activiti.engine.repository.Model;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -156,16 +157,50 @@ public class JobServiceImpl implements JobService {
@Override @Override
public String getJobs4Activiti(String unitId, String type) { public String getJobs4Activiti(String unitId, String type) {
return this.getJobs4Activiti(unitId, type, null);
}
@Override
public String getJobs4Activiti(String unitId, String type, String resourceId) {
Model model = this.findModel(unitId, type);
if (model == null) {
return "";
}
return this.findJobIds(model.getId(), resourceId);
}
private Model findModel(String unitId, String type) {
String sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + type + "-" + unitId + "'"; String sql = "select * from [ACT_RE_MODEL] where KEY_ like '%" + unitId + "%' and KEY_ = '" + type + "-" + unitId + "'";
List<Model> listModel = repositoryService.createNativeModelQuery().sql(sql).list();
if (listModel != null && listModel.size() > 0) {
return listModel.get(0);
}
sql = "select * from [ACT_RE_MODEL] where KEY_ = '" + type + "'";
listModel = repositoryService.createNativeModelQuery().sql(sql).list();
if (listModel != null && listModel.size() > 0) {
return listModel.get(0);
}
return null;
}
private String findJobIds(String modelId, String resourceId) {
String jobIds = ""; String jobIds = "";
List<org.activiti.engine.repository.Model> list_model = repositoryService.createNativeModelQuery().sql(sql).list(); String where = "where model_id = '" + modelId + "'";
if (list_model != null && list_model.size() > 0) { if (resourceId != null && !resourceId.trim().isEmpty()) {
ModelNodeJob modelNodeJob = new ModelNodeJob(); where += " and resource_id = '" + resourceId.trim() + "'";
modelNodeJob.setWhere("where model_id = '" + list_model.get(0).getId() + "'"); }
List<ModelNodeJob> list_model_node = modelNodeJobDao.selectListByWhere(modelNodeJob); ModelNodeJob modelNodeJob = new ModelNodeJob();
HashSet<String> hs = new HashSet<String>(); modelNodeJob.setWhere(where);
for (int i = 0; i < list_model_node.size(); i++) { List<ModelNodeJob> listModelNode = modelNodeJobDao.selectListByWhere(modelNodeJob);
jobIds += "" + list_model_node.get(i).getJobId() + ","; HashSet<String> exists = new HashSet<String>();
if (listModelNode != null) {
for (ModelNodeJob item : listModelNode) {
if (item == null || item.getJobId() == null || item.getJobId().trim().isEmpty()) {
continue;
}
if (exists.add(item.getJobId())) {
jobIds += item.getJobId() + ",";
}
} }
} }
return jobIds; return jobIds;

View File

@ -17,7 +17,6 @@ import net.sf.json.JSONArray;
import net.sf.json.JSONObject; import net.sf.json.JSONObject;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import sun.misc.BASE64Decoder;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
@ -25,6 +24,7 @@ import java.io.ByteArrayInputStream;
import java.io.IOException; import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Base64;
import java.util.HashMap; import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -584,12 +584,7 @@ public class CameraService implements CommService<Camera> {
// System.out.println(imgData); // System.out.println(imgData);
byte[] b = new BASE64Decoder().decodeBuffer(imgData); byte[] b = Base64.getMimeDecoder().decode(imgData);
for (int i = 0; i < b.length; ++i) {
if (b[i] < 0) {// 调整异常数据
b[i] += 256;
}
}
InputStream in = new ByteArrayInputStream(b); InputStream in = new ByteArrayInputStream(b);
minioTemplate.makeBucket(nameSpace); minioTemplate.makeBucket(nameSpace);
minioTemplate.putObject(nameSpace, rid + "_" + filePath + ".jpg", in, null, null, null, contentType); minioTemplate.putObject(nameSpace, rid + "_" + filePath + ".jpg", in, null, null, null, contentType);

View File

@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
import java.io.*; import java.io.*;
import java.nio.ByteBuffer; import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Date; import java.util.Date;
@ -19,6 +20,7 @@ import java.util.logging.Logger;
public class CameraCall { public class CameraCall {
private static HCNetSDK2 hcNetSDK = HCNetSDK2.INSTANCE; private static HCNetSDK2 hcNetSDK = HCNetSDK2.INSTANCE;
private static org.slf4j.Logger logger = LoggerFactory.getLogger(CameraCall.class); private static org.slf4j.Logger logger = LoggerFactory.getLogger(CameraCall.class);
private static final Charset GBK = Charset.forName("GBK");
HCNetSDK2.NET_DVR_USER_LOGIN_INFO m_strLoginINFO = new HCNetSDK2.NET_DVR_USER_LOGIN_INFO(); HCNetSDK2.NET_DVR_USER_LOGIN_INFO m_strLoginINFO = new HCNetSDK2.NET_DVR_USER_LOGIN_INFO();
//HCNetSDK2.NET_DVR_DEVICEINFO_V40 m_strDeviceInfo = new HCNetSDK2.NET_DVR_DEVICEINFO_V40(); //HCNetSDK2.NET_DVR_DEVICEINFO_V40 m_strDeviceInfo = new HCNetSDK2.NET_DVR_DEVICEINFO_V40();
static HCNetSDK2.NET_DVR_DEVICEINFO_V30 m_strDeviceInfo = new HCNetSDK2.NET_DVR_DEVICEINFO_V30(); static HCNetSDK2.NET_DVR_DEVICEINFO_V30 m_strDeviceInfo = new HCNetSDK2.NET_DVR_DEVICEINFO_V30();
@ -493,17 +495,8 @@ public class CameraCall {
Pointer pPlateInfo = strPlateResult.getPointer(); Pointer pPlateInfo = strPlateResult.getPointer();
pPlateInfo.write(0, pAlarmInfo.getByteArray(0, strPlateResult.size()), 0, strPlateResult.size()); pPlateInfo.write(0, pAlarmInfo.getByteArray(0, strPlateResult.size()), 0, strPlateResult.size());
strPlateResult.read(); strPlateResult.read();
try { String plateNo=new String(strPlateResult.struPlateInfo.sLicense, GBK);
String srt3=new String(strPlateResult.struPlateInfo.sLicense,"GBK"); sAlarmType = sAlarmType + ":交通抓拍上传,车牌:"+ plateNo;
sAlarmType = sAlarmType + ":交通抓拍上传,车牌:"+ srt3;
}
catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//报警设备IP地址 //报警设备IP地址
sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); sIP = new String(pAlarmer.sDeviceIP).split("\0", 2);
@ -539,17 +532,8 @@ public class CameraCall {
Pointer pItsPlateInfo = strItsPlateResult.getPointer(); Pointer pItsPlateInfo = strItsPlateResult.getPointer();
pItsPlateInfo.write(0, pAlarmInfo.getByteArray(0, strItsPlateResult.size()), 0, strItsPlateResult.size()); pItsPlateInfo.write(0, pAlarmInfo.getByteArray(0, strItsPlateResult.size()), 0, strItsPlateResult.size());
strItsPlateResult.read(); strItsPlateResult.read();
try { String itsPlateNo=new String(strItsPlateResult.struPlateInfo.sLicense, GBK);
String srt3=new String(strItsPlateResult.struPlateInfo.sLicense,"GBK"); sAlarmType = sAlarmType + ",车辆类型:"+strItsPlateResult.byVehicleType + ",交通抓拍上传,车牌:"+ itsPlateNo;
sAlarmType = sAlarmType + ",车辆类型:"+strItsPlateResult.byVehicleType + ",交通抓拍上传,车牌:"+ srt3;
}
catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//报警设备IP地址 //报警设备IP地址
sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); sIP = new String(pAlarmer.sDeviceIP).split("\0", 2);
@ -626,19 +610,10 @@ public class CameraCall {
Pointer pItsParkVehicle = strItsParkVehicle.getPointer(); Pointer pItsParkVehicle = strItsParkVehicle.getPointer();
pItsParkVehicle.write(0, pAlarmInfo.getByteArray(0, strItsParkVehicle.size()), 0, strItsParkVehicle.size()); pItsParkVehicle.write(0, pAlarmInfo.getByteArray(0, strItsParkVehicle.size()), 0, strItsParkVehicle.size());
strItsParkVehicle.read(); strItsParkVehicle.read();
try { String srtParkingNo=new String(strItsParkVehicle.byParkingNo).trim(); //车位编号
String srtParkingNo=new String(strItsParkVehicle.byParkingNo).trim(); //车位编号 String srtPlate2=new String(strItsParkVehicle.struPlateInfo.sLicense, GBK).trim(); //车牌号码
String srtPlate=new String(strItsParkVehicle.struPlateInfo.sLicense,"GBK").trim(); //车牌号码 sAlarmType = sAlarmType + ",停产场数据,车位编号:"+ srtParkingNo + ",车位状态:"
sAlarmType = sAlarmType + ",停产场数据,车位编号:"+ srtParkingNo + ",车位状态:" + strItsParkVehicle.byLocationStatus+ ",车牌:"+ srtPlate2;
+ strItsParkVehicle.byLocationStatus+ ",车牌:"+ srtPlate;
}
catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
//报警设备IP地址 //报警设备IP地址
sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); sIP = new String(pAlarmer.sDeviceIP).split("\0", 2);
@ -679,15 +654,9 @@ public class CameraCall {
pTFSInfo.write(0, pAlarmInfo.getByteArray(0, strTFSAlarmInfo.size()), 0, strTFSAlarmInfo.size()); pTFSInfo.write(0, pAlarmInfo.getByteArray(0, strTFSAlarmInfo.size()), 0, strTFSAlarmInfo.size());
strTFSAlarmInfo.read(); strTFSAlarmInfo.read();
try { String srtPlate=new String(strTFSAlarmInfo.struPlateInfo.sLicense, GBK).trim(); //车牌号码
String srtPlate=new String(strTFSAlarmInfo.struPlateInfo.sLicense,"GBK").trim(); //车牌号码 sAlarmType = sAlarmType + ":交通取证报警信息,违章类型:"+ strTFSAlarmInfo.dwIllegalType + ",车牌号码:" + srtPlate
sAlarmType = sAlarmType + ":交通取证报警信息,违章类型"+ strTFSAlarmInfo.dwIllegalType + ",车牌号码:" + srtPlate + ",车辆出入状态" + strTFSAlarmInfo.struAIDInfo.byVehicleEnterState;
+ ",车辆出入状态:" + strTFSAlarmInfo.struAIDInfo.byVehicleEnterState;
}
catch (UnsupportedEncodingException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
//报警设备IP地址 //报警设备IP地址
sIP = new String(strTFSAlarmInfo.struDevInfo.struDevIP.sIpV4).split("\0", 2); sIP = new String(strTFSAlarmInfo.struDevInfo.struDevIP.sIpV4).split("\0", 2);
@ -1045,7 +1014,7 @@ public class CameraCall {
sIP = new String(pAlarmer.sDeviceIP).split("\0", 2); sIP = new String(pAlarmer.sDeviceIP).split("\0", 2);
break; break;
} }
} catch (UnsupportedEncodingException ex) { } catch (Exception ex) {
Logger.getLogger(CameraCall.class.getName()).log(Level.SEVERE, null, ex); Logger.getLogger(CameraCall.class.getName()).log(Level.SEVERE, null, ex);
} }
return true; return true;

View File

@ -8,11 +8,11 @@ import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory; import org.apache.commons.fileupload.disk.DiskFileItemFactory;
import org.apache.commons.fileupload.servlet.ServletFileUpload; import org.apache.commons.fileupload.servlet.ServletFileUpload;
import org.apache.commons.fileupload.util.Streams; import org.apache.commons.fileupload.util.Streams;
import sun.misc.BASE64Decoder;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.io.*; import java.io.*;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.Base64;
import java.util.*; import java.util.*;
/** /**
@ -129,16 +129,10 @@ public class UEditorUtil {
String base64Data = this.request.getParameter(fieldName); String base64Data = this.request.getParameter(fieldName);
this.fileName = this.getName("test.png"); this.fileName = this.getName("test.png");
this.url = savePath + "/" + this.fileName; this.url = savePath + "/" + this.fileName;
BASE64Decoder decoder = new BASE64Decoder();
try { try {
File outFile = new File(this.getPhysicalPath(this.url)); File outFile = new File(this.getPhysicalPath(this.url));
OutputStream ro = new FileOutputStream(outFile); OutputStream ro = new FileOutputStream(outFile);
byte[] b = decoder.decodeBuffer(base64Data); byte[] b = Base64.getMimeDecoder().decode(base64Data);
for (int i = 0; i < b.length; ++i) {
if (b[i] < 0) {
b[i] += 256;
}
}
ro.write(b); ro.write(b);
ro.flush(); ro.flush();
ro.close(); ro.close();

View File

@ -1,11 +1,11 @@
driver=com.microsoft.sqlserver.jdbc.SQLServerDriver driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
#url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=SIPAIIS_WMS_HQAQ url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=SIPAIIS_WMS_HQAQ
url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=SIPAIIS_WMS_HQAQ #url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=SIPAIIS_WMS_HQAQ
username=sa username=sa
password=P76XB3nm36aMkN6n password=P76XB3nm36aMkN6n
#scada-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=EIP_PRD_HQWS scada-url=jdbc:sqlserver://127.0.0.1:1433;DatabaseName=EIP_PRD_HQWS
scada-url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=EIP_PRD_HQWS #scada-url=jdbc:sqlserver://122.51.194.184:1433;DatabaseName=EIP_PRD_HQWS
scada-username=sa scada-username=sa
scada-password=P76XB3nm36aMkN6n scada-password=P76XB3nm36aMkN6n

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:activiti="http://activiti.org/bpmn"
xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI"
xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC"
xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI"
targetNamespace="http://com.sipai.activiti">
<process id="Administration_Leave" name="请假补假流程" isExecutable="true">
<documentation>请假补假流程</documentation>
<startEvent id="startevent1" name="Start" activiti:initiator="applyUserId"/>
<userTask id="sectionChiefAudit" name="科长/副科长审批" activiti:candidateUsers="#{userIds}">
<documentation>leave_apply_section_audit</documentation>
</userTask>
<exclusiveGateway id="gatewaySection" name="科长审批判断"/>
<userTask id="managerAudit" name="分管经理审批" activiti:candidateUsers="#{userIds}">
<documentation>leave_apply_manager_audit</documentation>
</userTask>
<exclusiveGateway id="gatewayManager" name="分管经理审批判断"/>
<userTask id="generalManagerAudit" name="总经理审批" activiti:candidateUsers="#{userIds}">
<documentation>leave_apply_general_manager_audit</documentation>
</userTask>
<exclusiveGateway id="gatewayGeneralManager" name="总经理审批判断"/>
<userTask id="modifyApply" name="退回修改" activiti:assignee="${applicantId}">
<documentation>leave_apply_handle</documentation>
</userTask>
<endEvent id="endevent1" name="End"/>
<sequenceFlow id="flow1" sourceRef="startevent1" targetRef="sectionChiefAudit"/>
<sequenceFlow id="flow2" sourceRef="sectionChiefAudit" targetRef="gatewaySection"/>
<sequenceFlow id="flow3" name="通过" sourceRef="gatewaySection" targetRef="managerAudit">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass && route==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow4" name="驳回" sourceRef="gatewaySection" targetRef="modifyApply">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!pass && route==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow5" sourceRef="managerAudit" targetRef="gatewayManager"/>
<sequenceFlow id="flow6" name="通过" sourceRef="gatewayManager" targetRef="generalManagerAudit">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass && route==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow7" name="驳回" sourceRef="gatewayManager" targetRef="modifyApply">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!pass && route==0}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow8" sourceRef="modifyApply" targetRef="sectionChiefAudit"/>
<sequenceFlow id="flow9" sourceRef="generalManagerAudit" targetRef="gatewayGeneralManager"/>
<sequenceFlow id="flow10" name="通过" sourceRef="gatewayGeneralManager" targetRef="endevent1">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${pass && route==1}]]></conditionExpression>
</sequenceFlow>
<sequenceFlow id="flow11" name="驳回" sourceRef="gatewayGeneralManager" targetRef="modifyApply">
<conditionExpression xsi:type="tFormalExpression"><![CDATA[${!pass && route==0}]]></conditionExpression>
</sequenceFlow>
</process>
<bpmndi:BPMNDiagram id="BPMNDiagram_Administration_Leave">
<bpmndi:BPMNPlane bpmnElement="Administration_Leave" id="BPMNPlane_Administration_Leave">
<bpmndi:BPMNShape bpmnElement="startevent1" id="BPMNShape_startevent1">
<omgdc:Bounds height="35.0" width="35.0" x="40.0" y="110.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="sectionChiefAudit" id="BPMNShape_sectionChiefAudit">
<omgdc:Bounds height="55.0" width="120.0" x="110.0" y="100.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="gatewaySection" id="BPMNShape_gatewaySection">
<omgdc:Bounds height="40.0" width="40.0" x="265.0" y="108.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="managerAudit" id="BPMNShape_managerAudit">
<omgdc:Bounds height="55.0" width="100.0" x="350.0" y="100.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="gatewayManager" id="BPMNShape_gatewayManager">
<omgdc:Bounds height="40.0" width="40.0" x="485.0" y="108.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="generalManagerAudit" id="BPMNShape_generalManagerAudit">
<omgdc:Bounds height="55.0" width="100.0" x="560.0" y="100.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="gatewayGeneralManager" id="BPMNShape_gatewayGeneralManager">
<omgdc:Bounds height="40.0" width="40.0" x="695.0" y="108.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="modifyApply" id="BPMNShape_modifyApply">
<omgdc:Bounds height="55.0" width="100.0" x="430.0" y="220.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNShape bpmnElement="endevent1" id="BPMNShape_endevent1">
<omgdc:Bounds height="35.0" width="35.0" x="800.0" y="110.0"/>
</bpmndi:BPMNShape>
<bpmndi:BPMNEdge bpmnElement="flow1" id="BPMNEdge_flow1">
<omgdi:waypoint x="75.0" y="127.0"/>
<omgdi:waypoint x="110.0" y="127.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow2" id="BPMNEdge_flow2">
<omgdi:waypoint x="230.0" y="127.0"/>
<omgdi:waypoint x="265.0" y="128.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow3" id="BPMNEdge_flow3">
<omgdi:waypoint x="305.0" y="128.0"/>
<omgdi:waypoint x="350.0" y="127.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow4" id="BPMNEdge_flow4">
<omgdi:waypoint x="285.0" y="148.0"/>
<omgdi:waypoint x="285.0" y="247.0"/>
<omgdi:waypoint x="430.0" y="247.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow5" id="BPMNEdge_flow5">
<omgdi:waypoint x="450.0" y="127.0"/>
<omgdi:waypoint x="485.0" y="128.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow6" id="BPMNEdge_flow6">
<omgdi:waypoint x="525.0" y="128.0"/>
<omgdi:waypoint x="560.0" y="127.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow7" id="BPMNEdge_flow7">
<omgdi:waypoint x="505.0" y="148.0"/>
<omgdi:waypoint x="505.0" y="247.0"/>
<omgdi:waypoint x="530.0" y="247.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow8" id="BPMNEdge_flow8">
<omgdi:waypoint x="430.0" y="247.0"/>
<omgdi:waypoint x="170.0" y="247.0"/>
<omgdi:waypoint x="170.0" y="155.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow9" id="BPMNEdge_flow9">
<omgdi:waypoint x="660.0" y="127.0"/>
<omgdi:waypoint x="695.0" y="128.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow10" id="BPMNEdge_flow10">
<omgdi:waypoint x="735.0" y="128.0"/>
<omgdi:waypoint x="800.0" y="127.0"/>
</bpmndi:BPMNEdge>
<bpmndi:BPMNEdge bpmnElement="flow11" id="BPMNEdge_flow11">
<omgdi:waypoint x="715.0" y="148.0"/>
<omgdi:waypoint x="715.0" y="247.0"/>
<omgdi:waypoint x="530.0" y="247.0"/>
</bpmndi:BPMNEdge>
</bpmndi:BPMNPlane>
</bpmndi:BPMNDiagram>
</definitions>

View File

@ -1,5 +1,11 @@
{ {
"properties": { "properties": {
"id": {
"type": "keyword"
},
"mpointid": {
"type": "keyword"
},
"parmname": { "parmname": {
"type": "text", "type": "text",
"analyzer": "ik_smart", "analyzer": "ik_smart",
@ -8,6 +14,9 @@
"mpointcode": { "mpointcode": {
"type": "keyword", "type": "keyword",
"normalizer": "my_normalizer" "normalizer": "my_normalizer"
},
"measuredt": {
"type": "date"
} }
} }
} }

View File

@ -1,30 +1,28 @@
{ {
"settings": { "analysis": {
"analysis": { "normalizer": {
"analyzer": { "my_normalizer": {
"char_analyzer": { "type": "custom",
"char_filter": [ "char_filter": [],
"split_by_whitespace_filter" "filter": [
], "lowercase",
"tokenizer": "whitespace" "asciifolding"
} ]
},
"char_filter": {
"split_by_whitespace_filter": {
"type": "pattern_replace",
"pattern": "(.+?)",
"replacement": "$1 "
}
} }
} },
}, "analyzer": {
"mappings": { "char_analyzer": {
"like_search_type": { "char_filter": [
"properties": { "split_by_whitespace_filter"
"name": { ],
"type": "text", "tokenizer": "whitespace"
"analyzer": "char_analyzer" }
} },
"char_filter": {
"split_by_whitespace_filter": {
"type": "pattern_replace",
"pattern": "(.+?)",
"replacement": "$1 "
} }
} }
} }

View File

@ -1,9 +1,9 @@
#redis<69><73><EFBFBD><EFBFBD> #redis<69><73><EFBFBD><EFBFBD>
redis.host=122.51.194.184 # redis.host=122.51.194.184
# redis.host=127.0.0.1 redis.host=127.0.0.1
#<23><><EFBFBD><EFBFBD>single <20><>Ⱥcluster #<23><><EFBFBD><EFBFBD>single <20><>Ⱥcluster
redis.mode=single redis.mode=single
redis.port=26739 redis.port=6379
# redis.port=6379 # redis.port=6379
redis.password=Aa112211 redis.password=Aa112211
redis.maxIdle=100 redis.maxIdle=100
@ -22,6 +22,6 @@ defaultCacheExpireTime=3600
fep.local.cache.capacity =10000 fep.local.cache.capacity =10000
#cluster #cluster
cluster1.host.port=122.51.194.184: 26739 #cluster1.host.port=127.0.0.1:6379

View File

@ -0,0 +1,127 @@
/*
请假补假模块初始化脚本
1) 建表 tb_administration_leave_apply
2) 注册流程节点 tb_business_unit
3) 增加菜单并授权 admin
*/
IF OBJECT_ID('dbo.tb_administration_leave_apply', 'U') IS NULL
BEGIN
CREATE TABLE dbo.tb_administration_leave_apply (
id varchar(50) NOT NULL PRIMARY KEY,
insdt datetime NULL,
insuser varchar(50) NULL,
upduser varchar(50) NULL,
upddt datetime NULL,
unit_id varchar(50) NULL,
apply_type varchar(20) NULL,
leave_type varchar(20) NULL,
start_time datetime NULL,
end_time datetime NULL,
hours decimal(10,2) NULL,
days decimal(10,2) NULL,
reason varchar(1000) NULL,
handover_desc varchar(1000) NULL,
attachment_ids varchar(1000) NULL,
overtime_ref_id varchar(50) NULL,
overtime_hours decimal(10,2) NULL,
actual_start_time datetime NULL,
actual_end_time datetime NULL,
state varchar(100) NULL,
audit_man_id varchar(max) NULL,
submission_time datetime NULL,
processid varchar(100) NULL,
processdefid varchar(100) NULL,
remark varchar(1000) NULL,
del_flag char(1) NULL DEFAULT '0'
);
END
GO
IF OBJECT_ID('dbo.tb_administration_leave_apply', 'U') IS NOT NULL
AND EXISTS (
SELECT 1
FROM sys.columns
WHERE object_id = OBJECT_ID('dbo.tb_administration_leave_apply')
AND name = 'audit_man_id'
AND max_length <> -1
)
BEGIN
ALTER TABLE dbo.tb_administration_leave_apply
ALTER COLUMN audit_man_id varchar(max) NULL;
END
GO
IF NOT EXISTS (SELECT 1 FROM tb_business_unit WHERE id = 'leave_apply_section_audit')
BEGIN
INSERT INTO tb_business_unit (id, name, process_type_id, insdt, insuser, active, url, modal_id)
VALUES ('leave_apply_section_audit', N'请假补假-科长/副科长审批', 'Administration_Leave', GETDATE(), 'emp01', '1',
'administration/leaveApply/showAudit.do', 'subModal');
END
GO
IF NOT EXISTS (SELECT 1 FROM tb_business_unit WHERE id = 'leave_apply_manager_audit')
BEGIN
INSERT INTO tb_business_unit (id, name, process_type_id, insdt, insuser, active, url, modal_id)
VALUES ('leave_apply_manager_audit', N'请假补假-分管经理审批', 'Administration_Leave', GETDATE(), 'emp01', '1',
'administration/leaveApply/showAudit.do', 'subModal');
END
GO
IF NOT EXISTS (SELECT 1 FROM tb_business_unit WHERE id = 'leave_apply_general_manager_audit')
BEGIN
INSERT INTO tb_business_unit (id, name, process_type_id, insdt, insuser, active, url, modal_id)
VALUES ('leave_apply_general_manager_audit', N'请假补假-总经理审批', 'Administration_Leave', GETDATE(), 'emp01', '1',
'administration/leaveApply/showAudit.do', 'subModal');
END
GO
IF NOT EXISTS (SELECT 1 FROM tb_business_unit WHERE id = 'leave_apply_handle')
BEGIN
INSERT INTO tb_business_unit (id, name, process_type_id, insdt, insuser, active, url, modal_id)
VALUES ('leave_apply_handle', N'请假补假-退回修改', 'Administration_Leave', GETDATE(), 'emp01', '1',
'administration/leaveApply/showHandle.do', 'subModal');
END
GO
DECLARE @menuId VARCHAR(50) = 'leave_apply_menu_001';
DECLARE @menuName NVARCHAR(200) = N'请假补假申请';
DECLARE @menuLocation VARCHAR(1000) = 'administration/leaveApply/showList.do';
DECLARE @parentMenuId VARCHAR(50);
DECLARE @nextOrder INT;
SELECT TOP 1 @parentMenuId = id
FROM tb_menuitem
WHERE name IN (N'事项管理', N'行政管理')
AND type = 'menu'
ORDER BY morder;
IF @parentMenuId IS NULL
SET @parentMenuId = '-1';
SELECT @nextOrder = ISNULL(MAX(CAST(morder AS INT)), -1) + 1
FROM tb_menuitem
WHERE pid = @parentMenuId
AND type = 'menu';
IF NOT EXISTS (SELECT 1 FROM tb_menuitem WHERE id = @menuId OR location = @menuLocation)
BEGIN
INSERT INTO tb_menuitem (
id, pid, PowerID, caption, name, description, location, target, onclick, onmouseover, onmouseout,
image, altImage, tooltip, roles, page, width, height, forward, action, morder, lvl, active, type,
mainpage, count, engkey
)
VALUES (
@menuId, @parentMenuId, NULL, NULL, @menuName, NULL, @menuLocation, NULL, NULL, NULL, NULL,
'fa-calendar', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, @nextOrder, NULL, N'启用', 'menu',
NULL, NULL, NULL
);
END
GO
IF OBJECT_ID('dbo.tb_role_menu', 'U') IS NOT NULL
AND NOT EXISTS (SELECT 1 FROM tb_role_menu WHERE roleID = 'rol0001' AND menuID = 'leave_apply_menu_001')
BEGIN
INSERT INTO tb_role_menu (roleID, menuID) VALUES ('rol0001', 'leave_apply_menu_001');
END
GO

View File

@ -0,0 +1,14 @@
/*
请假补假流程审批人字段扩容脚本
场景:
1) audit_man_id 保存当前节点候选审批人 ID 列表
2) 组织下候选人员较多时,原 varchar(250/500) 可能被截断
*/
IF OBJECT_ID('dbo.tb_administration_leave_apply', 'U') IS NOT NULL
AND COL_LENGTH('dbo.tb_administration_leave_apply', 'audit_man_id') IS NOT NULL
BEGIN
ALTER TABLE dbo.tb_administration_leave_apply
ALTER COLUMN audit_man_id varchar(max) NULL;
END
GO

View File

@ -161,6 +161,11 @@
<% request.setAttribute("Administration_Temporary", ProcessType.Administration_Temporary.getId());%> <% request.setAttribute("Administration_Temporary", ProcessType.Administration_Temporary.getId());%>
<% request.setAttribute("UNIT_Temporary_AUDIT", BusinessUnit.UNIT_Temporary_AUDIT);%> <% request.setAttribute("UNIT_Temporary_AUDIT", BusinessUnit.UNIT_Temporary_AUDIT);%>
<% request.setAttribute("UNIT_Temporary_HANDLE", BusinessUnit.UNIT_Temporary_HANDLE);%> <% request.setAttribute("UNIT_Temporary_HANDLE", BusinessUnit.UNIT_Temporary_HANDLE);%>
<% request.setAttribute("Administration_Leave", ProcessType.Administration_Leave.getId());%>
<% request.setAttribute("UNIT_LEAVE_APPLY_SECTION_AUDIT", BusinessUnit.UNIT_LEAVE_APPLY_SECTION_AUDIT);%>
<% request.setAttribute("UNIT_LEAVE_APPLY_MANAGER_AUDIT", BusinessUnit.UNIT_LEAVE_APPLY_MANAGER_AUDIT);%>
<% request.setAttribute("UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT", BusinessUnit.UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT);%>
<% request.setAttribute("UNIT_LEAVE_APPLY_HANDLE", BusinessUnit.UNIT_LEAVE_APPLY_HANDLE);%>
<%--报表--%> <%--报表--%>
<% request.setAttribute("Report_Check", ProcessType.Report_Check.getId());%> <% request.setAttribute("Report_Check", ProcessType.Report_Check.getId());%>
<% request.setAttribute("UNIT_REPORT_CREATE", BusinessUnit.UNIT_REPORT_CREATE);%> <% request.setAttribute("UNIT_REPORT_CREATE", BusinessUnit.UNIT_REPORT_CREATE);%>
@ -346,6 +351,11 @@
$("#subDiv").html(data); $("#subDiv").html(data);
openModal('contractExcuteModal'); openModal('contractExcuteModal');
}); });
} else if (type.indexOf('${Administration_Leave}') != -1) {
$.post(ext.contextPath + '/administration/leaveApply/showExecuteView.do', {id: id}, function (data) {
$("#subDiv").html(data);
openModal('contractExcuteModal');
});
} else if (type.indexOf('${Administration_Reserve}') != -1) { } else if (type.indexOf('${Administration_Reserve}') != -1) {
$.post(ext.contextPath + '/administration/organization/showProcessOrganizationView.do', {id: id}, function (data) { $.post(ext.contextPath + '/administration/organization/showProcessOrganizationView.do', {id: id}, function (data) {
$("#subDiv").html(data); $("#subDiv").html(data);
@ -879,6 +889,31 @@
default: default:
showAlert('w', '未查询到任务模块!', 'mainAlertdiv'); showAlert('w', '未查询到任务模块!', 'mainAlertdiv');
} }
} else if (type.indexOf('${Administration_Leave}') != -1) {
switch (status) {
case '${UNIT_LEAVE_APPLY_SECTION_AUDIT}':
case '${UNIT_LEAVE_APPLY_MANAGER_AUDIT}':
case '${UNIT_LEAVE_APPLY_GENERAL_MANAGER_AUDIT}':
$.post(ext.contextPath + '/administration/leaveApply/showAudit.do', {
processInstanceId: processInstanceId, taskId: taskId, businessKey: businessKey,
unitId: status
}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
break;
case '${UNIT_LEAVE_APPLY_HANDLE}':
$.post(ext.contextPath + '/administration/leaveApply/showHandle.do', {
processInstanceId: processInstanceId, taskId: taskId, businessKey: businessKey,
unitId: status
}, function (data) {
$("#subDiv").html(data);
openModal('subModal');
});
break;
default:
showAlert('w', '未查询到任务模块!', 'mainAlertdiv');
}
} else if (type.indexOf('${Process_Adjustment}') > -1) { } else if (type.indexOf('${Process_Adjustment}') > -1) {
switch (status) { switch (status) {
case '${UNIT_PROCESSADJUSTMENT_EDIT}'://工艺申请 case '${UNIT_PROCESSADJUSTMENT_EDIT}'://工艺申请

View File

@ -0,0 +1,200 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<style type="text/css">
.select2-container .select2-selection--single{height:34px;line-height:34px;}
.select2-selection__arrow{margin-top:3px;}
</style>
<script type="text/javascript">
function padNumber(num) {
return num < 10 ? "0" + num : "" + num;
}
function formatDateValue(date) {
return date.getFullYear() + "-" + padNumber(date.getMonth() + 1) + "-" + padNumber(date.getDate());
}
function normalizeDateValue(value) {
if (!value) {
return "";
}
var match = value.match(/^(\d{4}-\d{2}-\d{2})/);
return match ? match[1] : value;
}
function getHalfDayIndex(period) {
return period === "下午" ? 1 : 0;
}
function getDayNumber(dateText) {
var parts = dateText.split("-");
if (parts.length !== 3) {
return NaN;
}
return Math.floor(new Date(parseInt(parts[0], 10), parseInt(parts[1], 10) - 1, parseInt(parts[2], 10)).getTime() / (24 * 60 * 60 * 1000));
}
function syncLeaveTimeFields() {
var startDate = normalizeDateValue($("#startDate").val());
var endDate = normalizeDateValue($("#endDate").val());
var startPeriod = $("#startPeriod").val();
var endPeriod = $("#endPeriod").val();
$("#startDate").val(startDate);
$("#endDate").val(endDate);
$("#startTime").val(startDate && startPeriod ? (startDate + " " + startPeriod) : "");
$("#endTime").val(endDate && endPeriod ? (endDate + " " + endPeriod) : "");
}
function calculateLeaveDays() {
syncLeaveTimeFields();
var startDate = $("#startDate").val();
var endDate = $("#endDate").val();
var startPeriod = $("#startPeriod").val();
var endPeriod = $("#endPeriod").val();
if (!startDate || !endDate || !startPeriod || !endPeriod) {
$("#hours").val("");
$("#days").val("");
return true;
}
var startUnit = getDayNumber(startDate) * 2 + getHalfDayIndex(startPeriod);
var endUnit = getDayNumber(endDate) * 2 + getHalfDayIndex(endPeriod);
if (isNaN(startUnit) || isNaN(endUnit) || endUnit < startUnit) {
$("#hours").val("");
$("#days").val("");
return false;
}
var halfDays = endUnit - startUnit + 1;
var hours = halfDays * 4;
var days = halfDays / 2;
$("#hours").val(hours.toString());
$("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1));
return true;
}
function doSaveLeaveApply(startProcess) {
$("#subForm").bootstrapValidator('validate');
if ($("#subForm").data('bootstrapValidator').isValid()) {
if (!calculateLeaveDays()) {
showAlert('d', '结束日期时段不能早于开始日期时段');
return;
}
var url = startProcess ? "/administration/leaveApply/startProcess.do" : "/administration/leaveApply/save.do";
$.post(ext.contextPath + url, $("#subForm").serialize(), function(data) {
if (data.res == 1) {
closeModal('subModal');
$("#table").bootstrapTable('refresh');
} else if (data.res == 0) {
showAlert('d', '操作失败');
} else {
showAlert('d', data.res);
}
}, 'json');
}
}
$(function(){
$("#subForm").bootstrapValidator({
live: 'disabled',
fields: {
applyType: {validators: {notEmpty: {message: '请选择申请类型'}}},
leaveType: {validators: {notEmpty: {message: '请选择假别'}}},
startDate: {validators: {notEmpty: {message: '请选择开始日期'}}},
startPeriod: {validators: {notEmpty: {message: '请选择开始时段'}}},
endDate: {validators: {notEmpty: {message: '请选择结束日期'}}},
endPeriod: {validators: {notEmpty: {message: '请选择结束时段'}}},
reason: {validators: {notEmpty: {message: '请填写申请事由'}}}
}
});
$('#startDate,#endDate').datetimepicker({
language: 'zh-CN',
format: 'yyyy-mm-dd',
startView: 'month',
minView: 2,
maxView: 'year',
autoclose: true,
todayBtn: true,
todayHighlight: true
}).on('changeDate', function() {
calculateLeaveDays();
});
$('#startDate,#endDate,#startPeriod,#endPeriod').on('change', function() {
calculateLeaveDays();
});
var today = formatDateValue(new Date());
$("#startDate").val(today);
$("#endDate").val(today);
calculateLeaveDays();
});
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
<h4 class="modal-title">新增请假补假申请</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="subForm">
<input type="hidden" name="unitId" value="${param.companyId}">
<div class="form-group">
<label class="col-sm-3 control-label">申请类型</label>
<div class="col-sm-8">
<select class="form-control" name="applyType">
<option value="leave">请假</option>
<option value="compensatory">补假</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">假别</label>
<div class="col-sm-8">
<select class="form-control" name="leaveType">
<option value="annual">年假</option>
<option value="personal">事假</option>
<option value="sick">病假</option>
<option value="marriage">婚假</option>
<option value="maternity">产假</option>
<option value="funeral">丧假</option>
<option value="adjustment">调休</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开始日期</label>
<div class="col-sm-5"><input type="text" class="form-control" id="startDate" name="startDate" autocomplete="off" placeholder="请选择日期"></div>
<div class="col-sm-3">
<select class="form-control" id="startPeriod" name="startPeriod">
<option value="上午">上午</option>
<option value="下午">下午</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结束日期</label>
<div class="col-sm-5"><input type="text" class="form-control" id="endDate" name="endDate" autocomplete="off" placeholder="请选择日期"></div>
<div class="col-sm-3">
<select class="form-control" id="endPeriod" name="endPeriod">
<option value="上午">上午</option>
<option value="下午">下午</option>
</select>
</div>
</div>
<input type="hidden" id="startTime" name="startTime">
<input type="hidden" id="endTime" name="endTime">
<input type="hidden" id="hours" name="hours">
<div class="form-group">
<label class="col-sm-3 control-label">天数</label>
<div class="col-sm-8"><input type="text" class="form-control" id="days" name="days" readonly placeholder="自动计算"></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">申请事由</label>
<div class="col-sm-8"><textarea class="form-control" rows="3" name="reason"></textarea></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">工作交接</label>
<div class="col-sm-8"><textarea class="form-control" rows="2" name="handoverDesc"></textarea></div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注</label>
<div class="col-sm-8"><textarea class="form-control" rows="2" name="remark"></textarea></div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doSaveLeaveApply(false)">保存</button>
<button type="button" class="btn btn-primary" onclick="doSaveLeaveApply(true)">发起审批</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,94 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
function formatLeaveHalfDay(value) {
if (!value) {
return "";
}
var text = $.trim(value);
var halfDayMatch = text.match(/^(\d{4}-\d{2}-\d{2})\s+(上午|下午)$/);
if (halfDayMatch) {
return halfDayMatch[1] + " " + halfDayMatch[2];
}
var dateTimeMatch = text.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
if (dateTimeMatch) {
var hour = dateTimeMatch[2] ? parseInt(dateTimeMatch[2], 10) : 0;
return dateTimeMatch[1] + " " + (hour >= 12 ? "下午" : "上午");
}
return text;
}
function showUser4SelectsFun() {
var userIds= $("#targetusers").val();
var jobIds= $("#targetjobs").val();
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds}, function(data) {
$("#user4SelectDiv").html(data);
openModal("user4SelectModal");
});
}
function doSubmit() {
$("#subForm").bootstrapValidator('validate');
if ($("#subForm").data('bootstrapValidator').isValid()) {
$.post(ext.contextPath + "/administration/leaveApply/doAudit.do", $("#subForm").serialize(), function(data) {
if (data.res == 1) {
closeModal('subModal');
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', data.res == 0 ? '操作执行失败,请重试' : data.res);
}
}, 'json');
}
}
$(function(){
processSelectNode("${businessUnitAudit.taskid}");
$("#subForm").bootstrapValidator({live:'disabled'});
$("#startTimeText").text(formatLeaveHalfDay("${leaveApply.startTime}"));
$("#endTimeText").text(formatLeaveHalfDay("${leaveApply.endTime}"));
$.post(ext.contextPath + '/administration/leaveApply/showExecuteView.do', {id:'${leaveApply.id}',inModal:'inModal'}, function(data) {
$("#showView").html(data);
});
});
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog modal-xlg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
<h4 class="modal-title">审批(${taskName})</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-7 col-xs-12">
<form class="form-horizontal" id="subForm">
<div class="form-group"><label class="col-sm-3 control-label">申请类型</label><div class="col-sm-8"><p class="form-control-static">${leaveApply.applyType}</p></div></div>
<div class="form-group"><label class="col-sm-3 control-label">假别</label><div class="col-sm-8"><p class="form-control-static">${leaveApply.leaveType}</p></div></div>
<div class="form-group"><label class="col-sm-3 control-label">开始时间</label><div class="col-sm-8"><p class="form-control-static" id="startTimeText"></p></div></div>
<div class="form-group"><label class="col-sm-3 control-label">结束时间</label><div class="col-sm-8"><p class="form-control-static" id="endTimeText"></p></div></div>
<div class="form-group"><label class="col-sm-3 control-label">申请事由</label><div class="col-sm-8"><p class="form-control-static">${leaveApply.reason}</p></div></div>
<input type="hidden" name="id" value="${businessUnitAudit.id}">
<input type="hidden" name="processid" value="${businessUnitAudit.processid}">
<input type="hidden" name="taskid" value="${businessUnitAudit.taskid}">
<input type="hidden" name="businessid" value="${businessUnitAudit.businessid}">
<input type="hidden" name="unitid" value="${param.unitId}">
<input type="hidden" name="taskdefinitionkey" value="${businessUnitAudit.taskdefinitionkey}">
<div class="form-group"><label class="col-sm-3 control-label">审核结果</label><div class="col-sm-6"><select class="form-control select2" id="passstatus" name="passstatus"><option value=true>通过</option><option value=false>驳回</option></select></div></div>
<div class="form-group"><label class="col-sm-3 control-label">下一节点</label><div class="col-sm-6"><select class="form-control select2" id="routeNum" name="routeNum"></select></div></div>
<div class="form-group"><label class="col-sm-3 control-label">审核意见</label><div class="col-sm-6"><textarea class="form-control" rows="2" id="auditopinion" name="auditopinion">通过</textarea></div></div>
<div id="selectUsers" class="form-group">
<label class="col-sm-3 control-label">转至</label>
<div class="col-sm-9">
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName" onclick="showUser4SelectsFun();" placeholder="可不选;不选时谁签收谁审批">
<input id="targetusers" name="targetusers" type="hidden" value="">
<input id="targetjobs" name="targetjobs" type="hidden" value="">
</div>
</div>
</form>
</div>
<div class="col-md-5 col-xs-12" id="showView"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doSubmit()">审核</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,195 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
function normalizeDateValue(value) {
if (!value) {
return "";
}
var match = value.match(/^(\d{4}-\d{2}-\d{2})/);
return match ? match[1] : value;
}
function getHalfDayIndex(period) {
return period === "下午" ? 1 : 0;
}
function getDayNumber(dateText) {
var parts = dateText.split("-");
if (parts.length !== 3) {
return NaN;
}
return Math.floor(new Date(parseInt(parts[0], 10), parseInt(parts[1], 10) - 1, parseInt(parts[2], 10)).getTime() / (24 * 60 * 60 * 1000));
}
function parseLeaveTimeValue(value) {
if (!value) {
return {date: "", period: "上午"};
}
var match = value.match(/^(\d{4}-\d{2}-\d{2})\s*(上午|下午)$/);
if (match) {
return {date: match[1], period: match[2]};
}
var datetimeMatch = value.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
if (datetimeMatch) {
var hour = datetimeMatch[2] ? parseInt(datetimeMatch[2], 10) : 0;
return {date: datetimeMatch[1], period: hour >= 12 ? "下午" : "上午"};
}
return {date: "", period: "上午"};
}
function syncLeaveTimeFields() {
var startDate = normalizeDateValue($("#startDate").val());
var endDate = normalizeDateValue($("#endDate").val());
var startPeriod = $("#startPeriod").val();
var endPeriod = $("#endPeriod").val();
$("#startDate").val(startDate);
$("#endDate").val(endDate);
$("#startTime").val(startDate && startPeriod ? (startDate + " " + startPeriod) : "");
$("#endTime").val(endDate && endPeriod ? (endDate + " " + endPeriod) : "");
}
function calculateLeaveDays() {
syncLeaveTimeFields();
var startDate = $("#startDate").val();
var endDate = $("#endDate").val();
var startPeriod = $("#startPeriod").val();
var endPeriod = $("#endPeriod").val();
if (!startDate || !endDate || !startPeriod || !endPeriod) {
$("#hours").val("");
$("#days").val("");
return true;
}
var startUnit = getDayNumber(startDate) * 2 + getHalfDayIndex(startPeriod);
var endUnit = getDayNumber(endDate) * 2 + getHalfDayIndex(endPeriod);
if (isNaN(startUnit) || isNaN(endUnit) || endUnit < startUnit) {
$("#hours").val("");
$("#days").val("");
return false;
}
var halfDays = endUnit - startUnit + 1;
var hours = halfDays * 4;
var days = halfDays / 2;
$("#hours").val(hours.toString());
$("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1));
return true;
}
function doUpdateLeaveApply(startProcess) {
$("#subForm").bootstrapValidator('validate');
if ($("#subForm").data('bootstrapValidator').isValid()) {
if (!calculateLeaveDays()) {
showAlert('d', '结束日期时段不能早于开始日期时段');
return;
}
var url = startProcess ? "/administration/leaveApply/startProcess.do" : "/administration/leaveApply/update.do";
$.post(ext.contextPath + url, $("#subForm").serialize(), function(data) {
if (data.res == 1) {
closeModal('subModal');
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', data.res == 0 ? '操作失败' : data.res);
}
}, 'json');
}
}
$(function(){
$("#subForm").bootstrapValidator({
live: 'disabled',
fields: {
startDate: {validators: {notEmpty: {message: '请选择开始日期'}}},
startPeriod: {validators: {notEmpty: {message: '请选择开始时段'}}},
endDate: {validators: {notEmpty: {message: '请选择结束日期'}}},
endPeriod: {validators: {notEmpty: {message: '请选择结束时段'}}},
reason: {validators: {notEmpty: {message: '请填写申请事由'}}}
}
});
$('#startDate,#endDate').datetimepicker({
language: 'zh-CN',
format: 'yyyy-mm-dd',
startView: 'month',
minView: 2,
maxView: 'year',
autoclose: true,
todayBtn: true,
todayHighlight: true
}).on('changeDate', function() {
calculateLeaveDays();
});
$('#startDate,#endDate,#startPeriod,#endPeriod').on('change', function() {
calculateLeaveDays();
});
var startInfo = parseLeaveTimeValue("${leaveApply.startTime}");
var endInfo = parseLeaveTimeValue("${leaveApply.endTime}");
$("#applyType").val("${leaveApply.applyType}");
$("#leaveType").val("${leaveApply.leaveType}");
$("#startDate").val(startInfo.date);
$("#startPeriod").val(startInfo.period);
$("#endDate").val(endInfo.date);
$("#endPeriod").val(endInfo.period);
calculateLeaveDays();
});
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
<h4 class="modal-title">编辑请假补假申请</h4>
</div>
<div class="modal-body">
<form class="form-horizontal" id="subForm">
<input type="hidden" name="id" value="${leaveApply.id}">
<input type="hidden" name="unitId" value="${leaveApply.unitId}">
<div class="form-group">
<label class="col-sm-3 control-label">申请类型</label>
<div class="col-sm-8">
<select class="form-control" id="applyType" name="applyType">
<option value="leave">请假</option>
<option value="compensatory">补假</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">假别</label>
<div class="col-sm-8">
<select class="form-control" id="leaveType" name="leaveType">
<option value="annual">年假</option>
<option value="personal">事假</option>
<option value="sick">病假</option>
<option value="marriage">婚假</option>
<option value="maternity">产假</option>
<option value="funeral">丧假</option>
<option value="adjustment">调休</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">开始日期</label>
<div class="col-sm-5"><input class="form-control" id="startDate" name="startDate" autocomplete="off" placeholder="请选择日期"></div>
<div class="col-sm-3">
<select class="form-control" id="startPeriod" name="startPeriod">
<option value="上午">上午</option>
<option value="下午">下午</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结束日期</label>
<div class="col-sm-5"><input class="form-control" id="endDate" name="endDate" autocomplete="off" placeholder="请选择日期"></div>
<div class="col-sm-3">
<select class="form-control" id="endPeriod" name="endPeriod">
<option value="上午">上午</option>
<option value="下午">下午</option>
</select>
</div>
</div>
<input type="hidden" id="startTime" name="startTime" value="${leaveApply.startTime}">
<input type="hidden" id="endTime" name="endTime" value="${leaveApply.endTime}">
<input type="hidden" id="hours" name="hours" value="${leaveApply.hours}">
<div class="form-group"><label class="col-sm-3 control-label">天数</label><div class="col-sm-8"><input class="form-control" id="days" name="days" value="${leaveApply.days}" readonly placeholder="自动计算"></div></div>
<div class="form-group"><label class="col-sm-3 control-label">申请事由</label><div class="col-sm-8"><textarea class="form-control" rows="3" name="reason">${leaveApply.reason}</textarea></div></div>
<div class="form-group"><label class="col-sm-3 control-label">工作交接</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="handoverDesc">${leaveApply.handoverDesc}</textarea></div></div>
<div class="form-group"><label class="col-sm-3 control-label">备注</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="remark">${leaveApply.remark}</textarea></div></div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="doUpdateLeaveApply(false)">保存</button>
<button type="button" class="btn btn-primary" onclick="doUpdateLeaveApply(true)">发起审批</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,24 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<div class="modal fade" id="leaveApplyExcuteModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<h4 class="modal-title">流程详情</h4>
</div>
<div class="modal-body" style="padding-left:0;padding-right:0;">
<div class="row">
<div class="col-md-12">
<jsp:include page="/jsp/administration/leaveApplyExecuteViewInModal.jsp"></jsp:include>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,24 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<c:if test="${not empty processMessage}">
<div class="alert alert-info" style="margin-bottom:10px;">${processMessage}</div>
</c:if>
<ul class="timeline">
<c:forEach items="${businessUnitRecords}" var="item" varStatus="status">
<li>
<c:choose>
<c:when test='${finishFlag && status.last}'>
<i class="fa fa-check bg-blue"></i>
</c:when>
<c:otherwise>
<i class="fa fa-clock-o bg-grey"></i>
</c:otherwise>
</c:choose>
<div class="timeline-item">
<span class="time"><i class="fa fa-clock-o"></i> ${item.insdt.substring(0,16)}</span>
<h3 class="timeline-header"><a href="#">${item.taskName}</a> ${item.user.caption}</h3>
<div class="timeline-body">${item.record}</div>
</div>
</li>
</c:forEach>
</ul>

View File

@ -0,0 +1,196 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
function normalizeDateValue(value) {
if (!value) {
return "";
}
var match = value.match(/^(\d{4}-\d{2}-\d{2})/);
return match ? match[1] : value;
}
function getHalfDayIndex(period) {
return period === "下午" ? 1 : 0;
}
function getDayNumber(dateText) {
var parts = dateText.split("-");
if (parts.length !== 3) {
return NaN;
}
return Math.floor(new Date(parseInt(parts[0], 10), parseInt(parts[1], 10) - 1, parseInt(parts[2], 10)).getTime() / (24 * 60 * 60 * 1000));
}
function parseLeaveTimeValue(value) {
if (!value) {
return {date: "", period: "上午"};
}
var match = value.match(/^(\d{4}-\d{2}-\d{2})\s*(上午|下午)$/);
if (match) {
return {date: match[1], period: match[2]};
}
var datetimeMatch = value.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
if (datetimeMatch) {
var hour = datetimeMatch[2] ? parseInt(datetimeMatch[2], 10) : 0;
return {date: datetimeMatch[1], period: hour >= 12 ? "下午" : "上午"};
}
return {date: "", period: "上午"};
}
function syncLeaveTimeFields() {
var startDate = normalizeDateValue($("#startDate").val());
var endDate = normalizeDateValue($("#endDate").val());
var startPeriod = $("#startPeriod").val();
var endPeriod = $("#endPeriod").val();
$("#startDate").val(startDate);
$("#endDate").val(endDate);
$("#startTime").val(startDate && startPeriod ? (startDate + " " + startPeriod) : "");
$("#endTime").val(endDate && endPeriod ? (endDate + " " + endPeriod) : "");
}
function calculateLeaveDays() {
syncLeaveTimeFields();
var startDate = $("#startDate").val();
var endDate = $("#endDate").val();
var startPeriod = $("#startPeriod").val();
var endPeriod = $("#endPeriod").val();
if (!startDate || !endDate || !startPeriod || !endPeriod) {
$("#hours").val("");
$("#days").val("");
return true;
}
var startUnit = getDayNumber(startDate) * 2 + getHalfDayIndex(startPeriod);
var endUnit = getDayNumber(endDate) * 2 + getHalfDayIndex(endPeriod);
if (isNaN(startUnit) || isNaN(endUnit) || endUnit < startUnit) {
$("#hours").val("");
$("#days").val("");
return false;
}
var halfDays = endUnit - startUnit + 1;
var hours = halfDays * 4;
var days = halfDays / 2;
$("#hours").val(hours.toString());
$("#days").val(days % 1 === 0 ? days.toString() : days.toFixed(1));
return true;
}
function showUser4AuditSelectsFun() {
var userIds= $("#targetusers").val();
var jobIds= $("#targetjobs").val();
$.post(ext.contextPath + '/user/userForSelectByCompany.do', {formId:"subUnitForm",hiddenId:"targetusers",textId:"targetUsersName",userIds:userIds,jobIds:jobIds}, function(data) {
$("#user4SelectDiv").html(data);
openModal("user4SelectModal");
});
}
function dosubmit() {
$("#subForm").bootstrapValidator('validate');
if ($("#subForm").data('bootstrapValidator').isValid()) {
if (!calculateLeaveDays()) {
showAlert('d', '结束时间必须大于开始时间');
return;
}
var routeNum = $("#routeNum").val();
$.post(ext.contextPath + "/administration/leaveApply/doHandle.do", $("#subForm").serialize() + "&" + $("#subUnitForm").serialize() + "&routeNum=" + routeNum, function(data) {
if (data.res == 1) {
closeModal('subModal');
$("#table").bootstrapTable('refresh');
} else {
showAlert('d', data.res == 0 ? '保存失败' : data.res);
}
}, 'json');
}
}
$(function(){
processSelectNodeForHandle("${businessUnitHandle.taskid}");
$("#subForm").bootstrapValidator({live:'disabled',fields:{
startDate:{validators:{notEmpty:{message:'请选择开始日期'}}},
startPeriod:{validators:{notEmpty:{message:'请选择开始时段'}}},
endDate:{validators:{notEmpty:{message:'请选择结束日期'}}},
endPeriod:{validators:{notEmpty:{message:'请选择结束时段'}}},
reason:{validators:{notEmpty:{message:'请填写申请事由'}}}
}});
$('#startDate,#endDate').datetimepicker({
language: 'zh-CN',
format: 'yyyy-mm-dd',
startView: 'month',
minView: 2,
maxView: 'year',
autoclose: true,
todayBtn: true,
todayHighlight: true
}).on('changeDate', function() {
calculateLeaveDays();
});
$('#startDate,#endDate,#startPeriod,#endPeriod').on('change', function() {
calculateLeaveDays();
});
$.post(ext.contextPath + '/administration/leaveApply/showExecuteView.do', {id:'${leaveApply.id}',inModal:'inModal'}, function(data) {
$("#showView").html(data);
});
var startInfo = parseLeaveTimeValue("${leaveApply.startTime}");
var endInfo = parseLeaveTimeValue("${leaveApply.endTime}");
$("#startDate").val(startInfo.date);
$("#startPeriod").val(startInfo.period);
$("#endDate").val(endInfo.date);
$("#endPeriod").val(endInfo.period);
calculateLeaveDays();
});
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog modal-xlg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
<h4 class="modal-title">退回修改(${taskName})</h4>
</div>
<div class="modal-body">
<div class="row">
<div class="col-md-7 col-xs-12">
<form class="form-horizontal" id="subForm">
<input type="hidden" name="id" value="${leaveApply.id}">
<input type="hidden" name="unitId" value="${leaveApply.unitId}">
<div class="form-group"><label class="col-sm-3 control-label">申请类型</label><div class="col-sm-8"><input class="form-control" name="applyType" value="${leaveApply.applyType}"></div></div>
<div class="form-group"><label class="col-sm-3 control-label">假别</label><div class="col-sm-8"><input class="form-control" name="leaveType" value="${leaveApply.leaveType}"></div></div>
<div class="form-group">
<label class="col-sm-3 control-label">开始日期</label>
<div class="col-sm-5"><input class="form-control" id="startDate" name="startDate" autocomplete="off" placeholder="请选择日期"></div>
<div class="col-sm-3">
<select class="form-control" id="startPeriod" name="startPeriod">
<option value="上午">上午</option>
<option value="下午">下午</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">结束日期</label>
<div class="col-sm-5"><input class="form-control" id="endDate" name="endDate" autocomplete="off" placeholder="请选择日期"></div>
<div class="col-sm-3">
<select class="form-control" id="endPeriod" name="endPeriod">
<option value="上午">上午</option>
<option value="下午">下午</option>
</select>
</div>
</div>
<input type="hidden" id="startTime" name="startTime" value="${leaveApply.startTime}">
<input type="hidden" id="endTime" name="endTime" value="${leaveApply.endTime}">
<input type="hidden" id="hours" name="hours" value="${leaveApply.hours}">
<div class="form-group"><label class="col-sm-3 control-label">天数</label><div class="col-sm-8"><input class="form-control" id="days" name="days" value="${leaveApply.days}" readonly placeholder="自动计算"></div></div>
<div class="form-group"><label class="col-sm-3 control-label">申请事由</label><div class="col-sm-8"><textarea class="form-control" rows="3" name="reason">${leaveApply.reason}</textarea></div></div>
<div class="form-group"><label class="col-sm-3 control-label">工作交接</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="handoverDesc">${leaveApply.handoverDesc}</textarea></div></div>
<div class="form-group"><label class="col-sm-3 control-label">备注</label><div class="col-sm-8"><textarea class="form-control" rows="2" name="remark">${leaveApply.remark}</textarea></div></div>
</form>
<form class="form-horizontal" id="subUnitForm">
<input type="hidden" name="id" value="${businessUnitHandle.id}">
<input type="hidden" name="processid" value="${businessUnitHandle.processid}">
<input type="hidden" name="taskid" value="${businessUnitHandle.taskid}">
<input type="hidden" name="businessid" value="${businessUnitHandle.businessid}">
<input type="hidden" name="taskdefinitionkey" value="${businessUnitHandle.taskdefinitionkey}">
<input type="hidden" name="unitid" value="${businessUnitHandle.unitid}">
<div class="form-group"><label class="col-sm-3 control-label">驳回意见</label><div class="col-sm-8"><textarea class="form-control" rows="2" readonly>${rejectReason}</textarea></div></div>
<div class="form-group"><label class="col-sm-3 control-label">下一节点</label><div class="col-sm-6"><select class="form-control select2" id="routeNum" name="routeNum"></select></div></div>
<div id="selectUsers" class="form-group"><label class="col-sm-3 control-label">提交至</label><div class="col-sm-9"><input type="text" class="form-control" id="targetUsersName" name="targetUsersName" onclick="showUser4AuditSelectsFun();" placeholder="可不选;不选时谁签收谁审批"><input id="targetusers" name="targetusers" type="hidden" value="${businessUnitHandle.targetusers}"><input id="targetjobs" name="targetjobs" type="hidden" value=""></div></div>
</form>
</div>
<div class="col-md-5 col-xs-12" id="showView"></div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
<button type="button" class="btn btn-primary" onclick="dosubmit()">提交</button>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,161 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
<%@ page import="com.sipai.entity.base.ServerObject" %>
<jsp:include page="/jsp/inc.jsp"></jsp:include>
<style type="text/css">
.main-header,.content-header,.main-footer{display:none;}
.table-hover>tbody>tr:hover{cursor:pointer;}
</style>
<script type="text/javascript">
var companyId = "";
var addFun = function() {
$.post(ext.contextPath + '/administration/leaveApply/add.do', {companyId: companyId}, function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var editFun = function(id) {
$.post(ext.contextPath + '/administration/leaveApply/edit.do', {id:id}, function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var viewFun = function(id) {
$.post(ext.contextPath + '/administration/leaveApply/view.do', {id:id}, function(data) {
$("#subDiv").html(data);
openModal('subModal');
});
};
var processFun = function(id) {
$.post(ext.contextPath + '/administration/leaveApply/showExecuteView.do', {id:id}, function(data) {
$("#subDiv").html(data);
openModal('leaveApplyExcuteModal');
});
};
var showNotStartedProcessTip = function() {
showAlert('i', '该请假单尚未发起审批流程');
};
var formatLeaveHalfDay = function(value) {
if (!value) {
return "";
}
var text = $.trim(value);
var halfDayMatch = text.match(/^(\d{4}-\d{2}-\d{2})\s+(上午|下午)$/);
if (halfDayMatch) {
return halfDayMatch[1] + " " + halfDayMatch[2];
}
var dateTimeMatch = text.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
if (dateTimeMatch) {
var hour = dateTimeMatch[2] ? parseInt(dateTimeMatch[2], 10) : 0;
return dateTimeMatch[1] + " " + (hour >= 12 ? "下午" : "上午");
}
return text;
};
var applyTypeTextMap = {
"leave": "请假",
"compensatory": "补假"
};
var leaveTypeTextMap = {
"annual": "年假",
"personal": "事假",
"sick": "病假",
"marriage": "婚假",
"maternity": "产假",
"funeral": "丧假",
"adjustment": "调休"
};
var formatApplyType = function(value) {
return applyTypeTextMap[value] || value || "";
};
var formatLeaveType = function(value) {
return leaveTypeTextMap[value] || value || "";
};
var formatProcessStarted = function(row) {
return row.processdefid ? "已发起" : "未发起";
};
var deleteFun = function(id) {
$.post(ext.contextPath + '/administration/leaveApply/delete.do', {id:id}, function(data) {
if (data == 1) { $("#table").bootstrapTable('refresh'); } else { showAlert('d','删除失败','mainAlertdiv'); }
});
};
var dosearch = function(){ $("#table").bootstrapTable('refresh'); };
$(function(){
$.post(ext.contextPath + '/user/getUnitForTree.do', {ng:''}, function(data){
if (data.length > 0) {
companyId = data[0].id;
$("#search_pid").val(companyId);
$("#cname_input").val(data[0].text);
initFun();
}
}, 'json');
});
var initFun = function() {
$("#table").bootstrapTable({
url: ext.contextPath + '/administration/leaveApply/getList.do',
cache: false,
striped: true,
pagination: true,
pageList: [10,20,50],
pageSize: 10,
pageNumber: 1,
sidePagination: 'server',
queryParams: function(params) {
return {rows: params.limit,page: params.offset/params.limit+1,sort: params.sort,order: params.order,search_code: companyId,search_name: $("#search_name").val(),applyType: $("#applyType").val()};
},
sortName: 'insdt',
sortOrder: 'desc',
columns: [
{checkbox: true},
{field: 'applyType', title: '申请类型', align: 'center', formatter: function(value){ return formatApplyType(value); }},
{field: 'leaveType', title: '假别', align: 'center', formatter: function(value){ return formatLeaveType(value); }},
{field: 'startTime', title: '开始时间', align: 'center', formatter: function(value){ return formatLeaveHalfDay(value); }},
{field: 'endTime', title: '结束时间', align: 'center', formatter: function(value){ return formatLeaveHalfDay(value); }},
{field: 'days', title: '天数', align: 'center'},
{field: 'auditMan', title: '审批人', align: 'center'},
{field: 'processdefid', title: '流程状态', align: 'center', formatter: function(value,row){ return formatProcessStarted(row); }},
{field: 'stateName', title: '状态', align: 'center'},
{field: 'id', title: '操作', align: 'center', formatter: function(value,row,index){
var processLink = row.processdefid
? "<a href='javascript:processFun(\""+row.id+"\")'>流程</a>"
: "<a href='javascript:showNotStartedProcessTip()'>未发起</a>";
return "<a href='javascript:editFun(\""+row.id+"\")'>编辑</a> | "
+ processLink + " | "
+ "<a href='javascript:deleteFun(\""+row.id+"\")'>删除</a>";
}}
]
});
};
</script>
<!DOCTYPE html>
<head>
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
</head>
<body>
<section class="content">
<div id="mainAlertdiv"></div>
<div id="subDiv"></div>
<div id="user4SelectDiv"></div>
<div class="box box-primary">
<div class="box-header with-border">
<h3 class="box-title">请假补假申请</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-primary btn-sm" onclick="addFun()">新增</button>
</div>
</div>
<div class="box-body">
<form id="searchForm" class="form-inline" style="margin-bottom:10px;">
<input type="hidden" id="search_pid">
<input type="text" id="cname_input" class="form-control" placeholder="厂区" readonly>
<input type="text" id="search_name" class="form-control" placeholder="事由关键字">
<select id="applyType" class="form-control">
<option value="">全部类型</option>
<option value="leave">请假</option>
<option value="compensatory">补假</option>
</select>
<button type="button" class="btn btn-default" onclick="dosearch()">查询</button>
</form>
<table id="table" class="table table-hover"></table>
</div>
</div>
</section>
</body>

View File

@ -0,0 +1,47 @@
<%@ page language="java" pageEncoding="UTF-8"%>
<script type="text/javascript">
function formatLeaveHalfDay(value) {
if (!value) {
return "";
}
var text = $.trim(value);
var halfDayMatch = text.match(/^(\d{4}-\d{2}-\d{2})\s+(上午|下午)$/);
if (halfDayMatch) {
return halfDayMatch[1] + " " + halfDayMatch[2];
}
var dateTimeMatch = text.match(/^(\d{4}-\d{2}-\d{2})(?:\s+(\d{1,2})(?::\d{1,2}(?::\d{1,2})?)?(?:\.\d+)?)?$/);
if (dateTimeMatch) {
var hour = dateTimeMatch[2] ? parseInt(dateTimeMatch[2], 10) : 0;
return dateTimeMatch[1] + " " + (hour >= 12 ? "下午" : "上午");
}
return text;
}
$(function(){
$("#viewStartTimeText").text(formatLeaveHalfDay("${leaveApply.startTime}"));
$("#viewEndTimeText").text(formatLeaveHalfDay("${leaveApply.endTime}"));
});
</script>
<div class="modal fade" id="subModal">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal"><span>&times;</span></button>
<h4 class="modal-title">查看申请</h4>
</div>
<div class="modal-body">
<table class="table table-bordered">
<tr><th>申请类型</th><td>${leaveApply.applyType}</td><th>假别</th><td>${leaveApply.leaveType}</td></tr>
<tr><th>开始时间</th><td id="viewStartTimeText"></td><th>结束时间</th><td id="viewEndTimeText"></td></tr>
<tr><th>天数</th><td>${leaveApply.days}</td><th>审批人</th><td>${leaveApply.auditMan}</td></tr>
<tr><th>状态</th><td colspan="3">${leaveApply.stateName}</td></tr>
<tr><th>申请事由</th><td colspan="3">${leaveApply.reason}</td></tr>
<tr><th>工作交接</th><td colspan="3">${leaveApply.handoverDesc}</td></tr>
<tr><th>备注</th><td colspan="3">${leaveApply.remark}</td></tr>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
</div>
</div>
</div>
</div>

View File

@ -1,205 +0,0 @@
# SIPAIIS_WMS_JSSW 项目使用说明文档
## 项目概述
SIPAIIS_WMS_JSSW 是一个基于Java的污水处理管理平台SIPAIIS Wastewater Management System for JSSW旨在提供全过程的监控、管理和优化服务。该系统采用Spring框架、MyBatis ORM、Activiti工作流引擎等技术栈支持多种集成如Redis缓存、RabbitMQ消息队列、MQTT物联网通信等。
### 技术栈
- **后端框架**: Spring 5.1.12, Spring MVC, Spring Security
- **数据库ORM**: MyBatis 3.5.1
- **工作流**: Activiti 5.22.0
- **缓存**: Redis, Redisson
- **消息队列**: RabbitMQ, Spring AMQP
- **物联网**: MQTT (Eclipse Paho), Modbus
- **搜索**: Elasticsearch
- **定时任务**: Quartz, XXL-Job
- **WebSocket**: 实时通信
- **报表**: JasperReports, iText PDF
- **Excel处理**: Apache POI, EasyExcel
- **对象存储**: MinIO
- **其他**: Hutool工具库, Lombok, Knife4j API文档
### 部署环境
- **Java版本**: JDK 1.8
- **应用服务器**: 支持WAR包部署如Tomcat, Jetty
- **数据库**: SQL Server (推荐), 支持其他JDBC兼容数据库
- **端口**: 默认8088 (Jetty)
## 功能点梳理
基于项目中的功能清单,系统包含以下主要功能模块:
### 1. 用户管理
- 用户信息增删改查
- 部门组织架构管理
- 角色权限管理
- 菜单配置
### 2. 监控与报警
- 测点数据管理
- 报警记录管理
- 报警类型配置
- 设备监控
### 3. 设备管理
- 设备基本信息管理
- 设备类型分类
- 设备生命周期管理(采购、入库、出库、维修、保养、巡检、点检、润滑、校准、报废等)
- 设备统计、分析、排名、对比、预警
- BIM设备关联与巡检
### 4. 工单管理
- 工作工单管理
- 维修工单处理
- 保养工单管理
- 工单执行与跟踪
### 5. 备品备件管理
- 备件库存管理
- 采购记录管理
- 库存调拨管理
### 6. 视频监控
- 摄像头管理
- NVR设备管理
### 7. 巡检与考核
- 巡检计划与记录
- KPI考核指标、计划、结果
### 8. 消息与通知
- 系统消息管理
- 短信用户管理
### 9. 工作流管理
- 工作流流程管理
- 请假申请
- 任务管理
### 10. 文档管理
- 文档资料管理
- 图书资料管理
- 图纸管理
### 11. 报表与分析
- 数据报表管理
- 工作日报管理
- 能源数据监控
- 生产工艺参数
- 生产指标管理
### 12. 可视化展示
- 大屏数据可视化
- 工艺流程图管理
- 页面布局配置
### 13. 计划与交互
- 生产计划管理
- 页面交互配置
- 数据类型定义
### 14. BIM管理
- BIM模型管理
- BIM巡检路线
- BIM设备关联
- BIM报警记录
### 15. 其他模块
- 缓存数据管理
- JSP配置
- 第三方接口集成
## 功能点间相互依赖关系
### 核心依赖关系
- **设备管理** 是基础模块其他模块如报警、工单、巡检、BIM等均依赖设备数据。
- **测点与报警**: 报警依赖测点数据和设备状态。
- **工单管理**: 维修、保养工单依赖设备信息和工作流引擎。
- **工作流**: 工单、请假、任务等流程依赖Activiti工作流。
- **巡检与KPI**: 巡检记录影响KPI考核结果。
- **BIM**: BIM设备关联依赖设备管理BIM报警依赖报警模块。
- **报表与可视化**: 依赖各模块数据进行统计和展示。
- **消息通知**: 报警、工单等事件触发消息发送。
- **缓存与消息队列**: Redis用于缓存热点数据RabbitMQ用于异步处理MQTT用于设备通信。
### 数据流依赖
- 用户权限控制贯穿所有模块。
- 设备数据是中心,影响报警、工单、统计等。
- 工作流驱动业务流程,如工单审批。
- 集成技术Redis、MQ、ES支持高性能和实时性。
## 安装与部署
### 环境要求
- JDK 1.8+
- Maven 3.6+
- 数据库SQL Server 2012+ 或兼容JDBC数据库
- Redis 2.6+
- RabbitMQ 5.9+
- Elasticsearch 3.2+
- MinIO (可选,用于文件存储)
### 部署步骤
1. **克隆或下载项目**:
```
git clone <repository-url>
cd SIPAIIS_WMS_JSSW
```
2. **配置数据库**:
- 编辑 `src/main/resources/db.properties` 配置数据库连接。
- 执行数据库脚本初始化表结构。
3. **配置其他服务**:
- 编辑 `config.properties`, `redis.properties`, `rabbitmq.properties`, `mqtt.properties` 等配置文件。
- 启动Redis, RabbitMQ, Elasticsearch等服务。
4. **构建项目**:
```
mvn clean package
```
5. **部署WAR包**:
- 将 `target/TGLW.war` 部署到Tomcat或Jetty。
- 默认端口8088可在 `pom.xml` 中修改。
6. **启动应用**:
- 访问 `http://localhost:8088/` 进入系统。
### 配置说明
- **applicationContext.xml**: Spring上下文配置XXL-Job执行器。
- **log4j.properties**: 日志配置。
- **xxl-job-executor.properties**: 定时任务配置。
## 使用指南
### 系统登录
- 默认管理员账号:根据配置。
- 登录后,根据角色权限访问不同模块。
### 主要操作
- **设备管理**: 添加设备,配置参数,监控状态。
- **报警处理**: 查看报警记录,确认处理。
- **工单执行**: 创建工单,分配任务,跟踪进度。
- **巡检管理**: 设置巡检计划,记录巡检结果。
- **报表查看**: 生成各类统计报表。
- **BIM可视化**: 查看3D模型关联设备数据。
### API文档
- 使用Knife4j查看API接口`http://localhost:8088/doc.html`
### 维护与监控
- 日志文件:`logs/TGLW.log`
- 监控Redis、MQ连接状态。
- 使用XXL-Job管理定时任务。
## 注意事项
- 确保数据库和外部服务正常运行。
- 定期备份数据。
- 根据实际环境调整配置文件。
- 安全配置启用Spring Security定期更新密码。
## 联系与支持
- 项目维护者JSSW团队
- 版本0.0.1-SNAPSHOT
- 更新日期2026-04-05

View File

@ -1,191 +0,0 @@
功能名称 功能说明 接口路径 对应数据表名 页面文件
用户管理 用户信息的增删改查 /user/user TB_USER userList.jsp
部门管理 部门组织架构管理 /user/dept TB_DEPT deptList.jsp
角色管理 系统角色权限管理 /user/role TB_ROLE roleList.jsp
菜单管理 系统菜单配置 /user/menu TB_MENU menuList.jsp
测点管理 监控测点数据管理 /work/mpoint TB_MPOINT mPointList.jsp
报警记录 报警信息记录管理 /alarm/record TB_ALARMRECORD alarmRecordList.jsp
报警类型 报警类型配置管理 /alarm/type TB_ALARMTYPE alarmTypeList.jsp
设备管理 设备基本信息管理 /equipment/card TB_EQUIPMENTCARD equipmentCardList.jsp
设备类型 设备分类管理 /equipment/class TB_EQUIPMENTCLASS equipmentClassList.jsp
工单管理 工作工单管理 /workorder/detail TB_WORKORDERDETAIL workorderList.jsp
维修工单 维修工单处理 /workorder/repair TB_WORKORDERREPAIR repairList.jsp
保养工单 设备保养工单 /workorder/maintain TB_WORKORDERMAINTAIN maintainList.jsp
备品备件 备件库存管理 /sparepart/stock TB_STOCK stockList.jsp
采购记录 备件采购记录 /sparepart/purchase TB_PURCHASERECORD purchaseList.jsp
库存调拨 库存调拨管理 /sparepart/transfer TB_STOCKTRANSFER transferList.jsp
视频监控 监控摄像头管理 /work/camera TB_CAMERA cameraList.jsp
NVR设备 网络录像机管理 /work/cameranvr TB_CAMERANVR cameraNVRList.jsp
巡检计划 设备巡检计划 /patrol/plan TB_PATROLPLAN patrolPlanList.jsp
巡检记录 巡检执行记录 /patrol/record TB_PATROLRECORD patrolRecordList.jsp
考核指标 KPI考核指标管理 /work/kpipoint TB_KPIPOINT kpiPointList.jsp
考核计划 KPI考核计划 /kpi/plan TB_KPIPLAN kpiPlanList.jsp
考核结果 KPI考核结果 /kpi/result TB_KPIRESULT kpiResultList.jsp
消息管理 系统消息通知 /msg/message TB_MESSAGE msgList.jsp
短信用户 短信发送用户 /msg/smsuser TB_SMSUSER smsUserList.jsp
工作流管理 工作流流程管理 /activiti/process TB_OEPROCESS processList.jsp
请假申请 员工请假申请 /activiti/leave TB_LEAVE leaveList.jsp
任务管理 工作任务管理 /activiti/task TB_WORKTASK taskList.jsp
文档管理 文档资料管理 /document/file TB_DOCUMENT documentList.jsp
图书资料 图书资料管理 /document/book TB_BOOK bookList.jsp
图纸管理 工程图纸管理 /document/drawing TB_DRAWING drawingList.jsp
报表管理 数据报表管理 /report/info TB_RPTINFO rptInfoList.jsp
日报管理 工作日报管理 /report/daylog TB_RPTDAYLOG rptDayLogList.jsp
能源管理 能源数据监控 /energy/manage TB_ENERGYDATA energyList.jsp
工艺参数 生产工艺参数 /process/parameter TB_PROCESSPARAM paramList.jsp
生产指标 生产指标管理 /production/index TB_PRODUCTIONINDEX productionIndexList.jsp
大屏展示 数据可视化大屏 /visual/largescreen TB_LARGESCREEN largeScreen.jsp
工艺流程 工艺流程图管理 /visual/process TB_PROCESSPIC processPicList.jsp
布局管理 页面布局配置 /visual/layout TB_LAYOUT layoutList.jsp
计划管理 生产计划管理 /plan/manage TB_PLAN planList.jsp
计划布局 计划布局配置 /plan/layout TB_PLANLAYOUT planLayoutList.jsp
交互配置 页面交互配置 /interaction/config TB_INTERACTION interactionList.jsp
数据类型 数据类型定义 /data/type TB_DATATYPE dataTypeList.jsp
缓存数据 缓存数据管理 /cache/data TB_CACHEDATA cacheDataList.jsp
JSP配置 JSP页面配置 /jsp/configure TB_JSPCONFIGURE jspConfigureList.jsp
JSP元素 JSP页面元素 /jsp/element TB_JSPELEMENT jspElementList.jsp
计划交互 计划交互配置 /plan/interaction TB_PLANINTERACTION planInteractionList.jsp
BIM管理 BIM模型管理 /bim/manage TB_BIM bimList.jsp
BIM路线 BIM巡检路线 /bim/route TB_BIMROUTE bimRouteList.jsp
BIM设备 BIM设备关联 /bim/equipment TB_BIMEQUIPMENT bimEquipmentList.jsp
报警相机 报警摄像头关联 /bim/camera TB_BIMCAMERA bimCameraList.jsp
报警记录 BIM报警记录 /bim/alarm TB_BIMALARM bimAlarmList.jsp
设备地图 设备地图展示 /eq/map TB_EQMAP eqMap.jsp
设备统计 设备统计分析 /eq/statistics TB_EQSTATISTICS eqStatistics.jsp
设备完好率 设备完好率统计 /eq/intactrate TB_EQINTACTRATE eqIntactRate.jsp
设备概况 设备概况总览 /eq/overview TB_EQOVERVIEW eqOverview.jsp
设备分析 设备数据分析 /eq/analysis TB_EQANALYSIS eqAnalysis.jsp
设备排名 设备性能排名 /eq/ranking TB_EQRANKING eqRanking.jsp
设备对比 设备对比分析 /eq/compare TB_EQCOMPARE eqCompare.jsp
设备预警 设备预警管理 /eq/warning TB_EQWARNING eqWarning.jsp
设备报警 设备报警管理 /eq/alarm TB_EQALARM eqAlarm.jsp
设备维修 设备维修管理 /eq/repair TB_EQREPAIR eqRepair.jsp
设备保养 设备保养管理 /eq/maintain TB_EQMAINTAIN eqMaintain.jsp
设备巡检 设备巡检管理 /eq/patrol TB_EQPATROL eqPatrol.jsp
设备点检 设备点检管理 /eq/check TB_EQCHECK eqCheck.jsp
设备润滑 设备润滑管理 /eq/lubricate TB_EQLUBRICATE eqLubricate.jsp
设备校准 设备校准管理 /eq/calibrate TB_EQCALIBRATE eqCalibrate.jsp
设备报废 设备报废管理 /eq/scrap TB_EQSCRAP eqScrap.jsp
设备借用 设备借用管理 /eq/borrow TB_EQBORROW eqBorrow.jsp
设备归还 设备归还管理 /eq/return TB_EQRETURN eqReturn.jsp
设备转移 设备转移管理 /eq/transfer TB_EQTRANSFER eqTransfer.jsp
设备盘点 设备盘点管理 /eq/inventory TB_EQINVENTORY eqInventory.jsp
设备验收 设备验收管理 /eq/acceptance TB_EQACCEPTANCE eqAcceptance.jsp
设备合同 设备合同管理 /eq/contract TB_EQCONTRACT eqContract.jsp
设备供应商 设备供应商管理 /eq/supplier TB_EQSUPPLIER eqSupplier.jsp
设备采购 设备采购管理 /eq/purchase TB_EQPURCHASE eqPurchase.jsp
设备入库 设备入库管理 /eq/instock TB_EQINSTOCK eqInStock.jsp
设备出库 设备出库管理 /eq/outstock TB_EQOUTSTOCK eqOutStock.jsp
设备调拨 设备调拨管理 /eq/transfer TB_EQTRANSFER2 eqTransfer2.jsp
设备借用申请 设备借用申请 /eq/borrowapply TB_EQBORROWAPPLY eqBorrowApply.jsp
设备维修申请 设备维修申请 /eq/repairapply TB_EQREPAIRAPPLY eqRepairApply.jsp
设备保养计划 设备保养计划 /eq/maintainplan TB_EQMAINTAINPLAN eqMaintainPlan.jsp
设备巡检计划 设备巡检计划 /eq/patrolplan TB_EQPATROLPLAN eqPatrolPlan.jsp
设备点检计划 设备点检计划 /eq/checkplan TB_EQCHECKPLAN eqCheckPlan.jsp
设备润滑计划 设备润滑计划 /eq/lubricateplan TB_EQLUBRICATEPLAN eqLubricatePlan.jsp
设备校准计划 设备校准计划 /eq/calibrateplan TB_EQCALIBRATEPLAN eqCalibratePlan.jsp
设备培训计划 设备培训计划 /eq/trainplan TB_EQTRAINPLAN eqTrainPlan.jsp
设备培训记录 设备培训记录 /eq/trainrecord TB_EQTRAINRECORD eqTrainRecord.jsp
设备事故记录 设备事故记录 /eq/accident TB_EQACCIDENT eqAccident.jsp
设备故障记录 设备故障记录 /eq/fault TB_EQFAULT eqFault.jsp
设备维修记录 设备维修记录 /eq/repairrecord TB_EQREPAIRRECORD eqRepairRecord.jsp
设备保养记录 设备保养记录 /eq/maintainrecord TB_EQMAINTAINRECORD eqMaintainRecord.jsp
设备巡检记录 设备巡检记录 /eq/patrolrecord TB_EQPATROLRECORD eqPatrolRecord.jsp
设备点检记录 设备点检记录 /eq/checkrecord TB_EQCHECKRECORD eqCheckRecord.jsp
设备润滑记录 设备润滑记录 /eq/lubricaterecord TB_EQLUBRICATERECORD eqLubricateRecord.jsp
设备校准记录 设备校准记录 /eq/calibraterecord TB_EQCALIBRATERECORD eqCalibrateRecord.jsp
设备台账 设备台账管理 /eq/account TB_EQACCOUNT eqAccount.jsp
设备档案 设备档案管理 /eq/archive TB_EQARCHIVE eqArchive.jsp
设备卡片 设备卡片管理 /eq/card TB_EQCARD eqCard.jsp
设备履历 设备履历管理 /eq/resume TB_EQRESUME eqResume.jsp
设备评价 设备评价管理 /eq/evaluate TB_EQEVALUATE eqEvaluate.jsp
设备评级 设备评级管理 /eq/rating TB_EQRATING eqRating.jsp
设备分类 设备分类管理 /eq/category TB_EQCATEGORY eqCategory.jsp
设备状态 设备状态管理 /eq/status TB_EQSTATUS eqStatus.jsp
设备参数 设备参数管理 /eq/parameter TB_EQPARAMETER eqParameter.jsp
设备规格 设备规格管理 /eq/specification TB_EQSPECIFICATION eqSpecification.jsp
设备型号 设备型号管理 /eq/model TB_EQMODEL eqModel.jsp
设备品牌 设备品牌管理 /eq/brand TB_EQBRAND eqBrand.jsp
设备制造商 设备制造商管理 /eq/manufacturer TB_EQMANUFACTURER eqManufacturer.jsp
设备使用年限 设备使用年限管理 /eq/age TB_EQAGE eqAge.jsp
设备折旧 设备折旧管理 /eq/depreciation TB_EQDEPRECIATION eqDepreciation.jsp
设备价值 设备价值管理 /eq/value TB_EQVALUE eqValue.jsp
设备利用率 设备利用率管理 /eq/utilization TB_EQUTILIZATION eqUtilization.jsp
设备效率 设备效率管理 /eq/efficiency TB_EQEFFICIENCY eqEfficiency.jsp
设备性能 设备性能管理 /eq/performance TB_EQPERFORMANCE eqPerformance.jsp
设备质量 设备质量管理 /eq/quality TB_EQQUALITY eqQuality.jsp
设备安全 设备安全管理 /eq/safety TB_EQSAFETY eqSafety.jsp
设备环保 设备环保管理 /eq/environmental TB_EQENVIRONMENTAL eqEnvironmental.jsp
设备能耗 设备能耗管理 /eq/energy TB_EQENERGY eqEnergy.jsp
设备成本 设备成本管理 /eq/cost TB_EQCOST eqCost.jsp
设备利润 设备利润管理 /eq/profit TB_EQPROFIT eqProfit.jsp
设备投资 设备投资管理 /eq/investment TB_EQINVESTMENT eqInvestment.jsp
设备回报 设备回报管理 /eq/return TB_EQRETURN eqReturn.jsp
设备风险 设备风险管理 /eq/risk TB_EQRISK eqRisk.jsp
设备保险 设备保险管理 /eq/insurance TB_EQINSURANCE eqInsurance.jsp
设备保修 设备保修管理 /eq/warranty TB_EQWARRANTY eqWarranty.jsp
设备服务 设备服务管理 /eq/service TB_EQSERVICE eqService.jsp
设备支持 设备支持管理 /eq/support TB_EQSUPPORT eqSupport.jsp
设备维护 设备维护管理 /eq/maintenance TB_EQMAINTENANCE eqMaintenance.jsp
设备升级 设备升级管理 /eq/upgrade TB_EQUPGRADE eqUpgrade.jsp
设备更新 设备更新管理 /eq/update TB_EQUPDATE eqUpdate.jsp
设备替换 设备替换管理 /eq/replace TB_EQREPLACE eqReplace.jsp
设备淘汰 设备淘汰管理 /eq/eliminate TB_EQELIMINATE eqEliminate.jsp
设备处置 设备处置管理 /eq/disposal TB_EQDISPOSAL eqDisposal.jsp
设备拍卖 设备拍卖管理 /eq/auction TB_EQAUCTION eqAuction.jsp
设备捐赠 设备捐赠管理 /eq/donate TB_EQDONATE eqDonate.jsp
设备报废申请 设备报废申请 /eq/scrapapply TB_EQSCRAPAPPLY eqScrapApply.jsp
设备处置申请 设备处置申请 /eq/disposalapply TB_EQDISPOSALAPPLY eqDisposalApply.jsp
设备拍卖申请 设备拍卖申请 /eq/auctionapply TB_EQAUCTIONAPPLY eqAuctionApply.jsp
设备捐赠申请 设备捐赠申请 /eq/donateapply TB_EQDONATEAPPLY eqDonateApply.jsp
设备评估 设备评估管理 /eq/assessment TB_EQASSESSMENT eqAssessment.jsp
设备估价 设备估价管理 /eq/valuation TB_EQVALUATION eqValuation.jsp
设备鉴定 设备鉴定管理 /eq/appraisal TB_EQAPPRAISAL eqAppraisal.jsp
设备检测 设备检测管理 /eq/detection TB_EQDETECTION eqDetection.jsp
设备检验 设备检验管理 /eq/inspection TB_EQINSPECTION eqInspection.jsp
设备试验 设备试验管理 /eq/test TB_EQTEST eqTest.jsp
设备验证 设备验证管理 /eq/verification TB_EQVERIFICATION eqVerification.jsp
设备确认 设备确认管理 /eq/confirmation TB_EQCONFIRMATION eqConfirmation.jsp
设备审核 设备审核管理 /eq/audit TB_EQAUDIT eqAudit.jsp
设备审批 设备审批管理 /eq/approve TB_EQAPPROVE eqApprove.jsp
设备备案 设备备案管理 /eq/record TB_EQRECORD eqRecord.jsp
设备注册 设备注册管理 /eq/register TB_EQREGISTER eqRegister.jsp
设备登记 设备登记管理 /eq/registration TB_EQREGISTRATION eqRegistration.jsp
设备申报 设备申报管理 /eq/declare TB_EQDECLARE eqDeclare.jsp
设备报备 设备报备管理 /eq/report TB_EQREPORT eqReport.jsp
设备通报 设备通报管理 /eq/notify TB_EQNOTIFY eqNotify.jsp
设备公告 设备公告管理 /eq/announcement TB_EQANNOUNCEMENT eqAnnouncement.jsp
设备通知 设备通知管理 /eq/notice TB_EQNOTICE eqNotice.jsp
设备提醒 设备提醒管理 /eq/remind TB_EQREMIND eqRemind.jsp
设备预警 设备预警管理 /eq/earlywarning TB_EQEARLYWARNING eqEarlyWarning.jsp
设备预告 设备预告管理 /eq/forecast TB_EQFORECAST eqForecast.jsp
设备预测 设备预测管理 /eq/prediction TB_EQPREDICTION eqPrediction.jsp
设备预报 设备预报管理 /eq/prediction2 TB_EQPREDICTION2 eqPrediction2.jsp
设备预检 设备预检管理 /eq/preinspection TB_EQPREINSPECTION eqPreInspection.jsp
设备预修 设备预修管理 /eq/prerepair TB_EQPREREPAIR eqPreRepair.jsp
设备预保 设备预保管理 /eq/premaintain TB_EQPREMAINTAIN eqPreMaintain.jsp
设备预巡检 设备预巡检管理 /eq/prepatrol TB_EQPREPATROL eqPrePatrol.jsp
设备预点检 设备预点检管理 /eq/precheck TB_EQPRECHECK eqPreCheck.jsp
设备预润滑 设备预润滑管理 /eq/prelubricate TB_EQPRELUBRICATE eqPreLubricate.jsp
设备预校准 设备预校准管理 /eq/precalibrate TB_EQPRECALIBRATE eqPreCalibrate.jsp
设备预培训 设备预培训管理 /eq/pretrain TB_EQPRETRAIN eqPreTrain.jsp
设备预事故 设备预事故管理 /eq/preaccident TB_EQPREACCIDENT eqPreAccident.jsp
设备预故障 设备预故障管理 /eq/prefault TB_EQPREFAULT eqPreFault.jsp
设备预维修 设备预维修管理 /eq/prerepair2 TB_EQPREREPAIR2 eqPreRepair2.jsp
设备预保养 设备预保养管理 /eq/premaintain2 TB_EQPREMAINTAIN2 eqPreMaintain2.jsp
设备预巡检 设备预巡检管理 /eq/prepatrol2 TB_EQPREPATROL2 eqPrePatrol2.jsp
设备预点检 设备预点检管理 /eq/precheck2 TB_EQPRECHECK2 eqPreCheck2.jsp
设备预润滑 设备预润滑管理 /eq/prelubricate2 TB_EQPRELUBRICATE2 eqPreLubricate2.jsp
设备预校准 设备预校准管理 /eq/precalibrate2 TB_EQPRECALIBRATE2 eqPreCalibrate2.jsp
设备预培训 设备预培训管理 /eq/pretrain2 TB_EQPRETRAIN2 eqPreTrain2.jsp
设备预事故 设备预事故管理 /eq/preaccident2 TB_EQPREACCIDENT2 eqPreAccident2.jsp
设备预故障 设备预故障管理 /eq/prefault2 TB_EQPREFAULT2 eqPreFault2.jsp
设备预维修 设备预维修管理 /eq/prerepair3 TB_EQPREREPAIR3 eqPreRepair3.jsp
设备预保养 设备预保养管理 /eq/premaintain3 TB_EQPREMAINTAIN3 eqPreMaintain3.jsp
设备预巡检 设备预巡检管理 /eq/prepatrol3 TB_EQPREPATROL3 eqPrePatrol3.jsp
设备预点检 设备预点检管理 /eq/precheck3 TB_EQPRECHECK3 eqPreCheck3.jsp
设备预润滑 设备预润滑管理 /eq/prelubricate3 TB_EQPRELUBRICATE3 eqPreLubricate3.jsp
设备预校准 设备预校准管理 /eq/precalibrate3 TB_EQPRECALIBRATE3 eqPreCalibrate3.jsp
设备预培训 设备预培训管理 /eq/pretrain3 TB_EQPRETRAIN3 eqPreTrain3.jsp
设备预事故 设备预事故管理 /eq/preaccident3 TB_EQPREACCIDENT3 eqPreAccident3.jsp
设备预故障 设备预故障管理 /eq/prefault3 TB_EQPREFAULT3 eqPreFault3.jsp

Binary file not shown.

View File

@ -1,459 +0,0 @@
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="utf-8"/>
<meta content="width=device-width, initial-scale=1.0" name="viewport"/>
<title>智水云 - 污水处理全流程监控一张图</title>
<script src="https://cdn.tailwindcss.com"></script>
<script src="https://code.iconify.design/3/3.1.1/iconify.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/chart.js"></script>
<style>
@import url('https://fonts.googleapis.com/css2?family=Share+Tech+Mono&display=swap');
:root {
--panel-bg: rgba(15, 23, 42, 0.7);
--border-color: rgba(51, 65, 85, 0.4);
--accent-blue: #3b82f6;
}
body {
background-color: #020617;
background-image: radial-gradient(circle at 50% 50%, #0f172a 0%, #020617 100%);
color: #e2e8f0;
overflow: hidden;
height: 100vh;
font-family: "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
display: flex;
flex-direction: column;
padding: 1rem;
}
.font-digital { font-family: 'Share+Tech+Mono', monospace; }
.glass-card {
background: var(--panel-bg);
border: 1px solid var(--border-color);
border-top: 2px solid var(--accent-blue);
transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
backdrop-filter: blur(4px);
display: flex;
flex-direction: column;
justify-content: space-between;
}
.glass-card:hover {
border-color: #60a5fa;
box-shadow: 0 8px 20px rgba(0, 0, 0, 0.4);
transform: translateY(-2px);
background: rgba(30, 41, 59, 0.6);
}
.status-pulse {
width: 8px;
height: 8px;
border-radius: 50%;
display: inline-block;
animation: pulse 2s infinite;
}
@keyframes pulse {
0% { box-shadow: 0 0 0 0px rgba(34, 197, 94, 0.7); }
70% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
100% { box-shadow: 0 0 0 0px rgba(34, 197, 94, 0); }
}
.grid-container {
display: grid;
grid-template-columns: 1fr 280px;
gap: 0.75rem;
flex: 1;
min-height: 0;
overflow: hidden;
}
.stats-panel {
height: 120px;
margin-bottom: 0.75rem;
display: grid;
grid-template-columns: 1fr 1fr 2fr 280px;
gap: 0.75rem;
flex-shrink: 0;
}
.alarm-panel {
height: 100%;
background: rgba(30, 41, 59, 0.4);
border-top: 2px solid #ef4444;
display: flex;
flex-direction: column;
overflow: hidden;
}
.table-container {
background: var(--panel-bg);
border: 1px solid var(--border-color);
border-top: 2px solid var(--accent-blue);
backdrop-filter: blur(4px);
overflow: hidden;
display: flex;
flex-direction: column;
}
table {
width: 100%;
border-collapse: collapse;
text-align: left;
font-size: 0.85rem;
}
thead {
background: rgba(30, 41, 59, 0.8);
position: sticky;
top: 0;
z-index: 10;
}
th {
padding: 0.75rem 1rem;
font-weight: 600;
color: #94a3b8;
text-transform: uppercase;
letter-spacing: 0.05em;
font-size: 0.75rem;
border-bottom: 1px solid var(--border-color);
}
td {
padding: 0.65rem 1rem;
border-bottom: 1px solid rgba(51, 65, 85, 0.2);
color: #e2e8f0;
}
tbody tr:nth-child(even) {
background: rgba(255, 255, 255, 0.02);
}
tbody tr:hover {
background: rgba(59, 130, 246, 0.1);
}
.status-tag {
padding: 2px 8px;
border-radius: 9999px;
font-size: 0.7rem;
font-weight: 600;
}
.status-online { background: rgba(34, 197, 94, 0.2); color: #4ade80; border: 1px solid rgba(34, 197, 94, 0.3); }
.status-offline { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.param-chip {
display: inline-block;
background: rgba(15, 23, 42, 0.6);
padding: 2px 6px;
border-radius: 4px;
margin-right: 4px;
font-family: 'Share+Tech+Mono', monospace;
}
.param-label-mini {
color: #64748b;
font-size: 10px;
margin-right: 4px;
}
.alarm-list {
flex: 1;
overflow-y: auto;
padding: 0.5rem;
}
.alarm-list::-webkit-scrollbar { width: 4px; }
.alarm-list::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 10px; }
.alarm-item {
background: rgba(15, 23, 42, 0.5);
border-left: 3px solid transparent;
margin-bottom: 0.5rem;
padding: 0.6rem;
font-size: 0.75rem;
transition: all 0.2s;
}
.alarm-item:hover { background: rgba(15, 23, 42, 0.8); }
.alarm-high { border-left-color: #ef4444; }
.alarm-mid { border-left-color: #f59e0b; }
.alarm-low { border-left-color: #3b82f6; }
.badge {
padding: 1px 4px;
border-radius: 2px;
font-size: 0.65rem;
}
.badge-high { background: rgba(239, 68, 68, 0.2); color: #f87171; border: 1px solid rgba(239, 68, 68, 0.3); }
.badge-mid { background: rgba(245, 158, 11, 0.2); color: #fbbf24; border: 1px solid rgba(245, 158, 11, 0.3); }
.badge-low { background: rgba(59, 130, 246, 0.2); color: #60a5fa; border: 1px solid rgba(59, 130, 246, 0.3); }
.flow-card {
padding: 1rem;
display: flex;
flex-direction: column;
justify-content: center;
border-radius: 4px;
}
.flow-card.industrial { border-top-color: #f59e0b; }
.flow-card.domestic { border-top-color: #10b981; }
.chart-container {
position: relative;
padding: 10px;
border-radius: 4px;
}
.param-label { color: #94a3b8; font-size: 0.7rem; font-weight: 500; }
.param-value { color: #f8fafc; font-size: 1.05rem; font-family: 'Share+Tech+Mono', monospace; }
.unit { font-size: 0.65rem; color: #64748b; margin-left: 2px; }
.card-header { padding: 0.6rem 0.8rem; border-bottom: 1px solid rgba(255,255,255,0.05); }
.card-body { padding: 0.6rem 0.8rem; flex: 1; }
.card-footer { padding: 0.4rem 0.8rem; background: rgba(0,0,0,0.15); border-top: 1px solid rgba(255,255,255,0.03); }
</style>
</head>
<body>
<!-- 顶部状态栏 -->
<header class="flex items-center justify-between mb-4 px-1">
<div class="flex items-center space-x-3">
<span class="iconify text-blue-500 text-3xl" data-icon="material-symbols:water-drop-outline"></span>
<div>
<h1 class="text-xl font-bold tracking-tight text-white leading-tight">智水云 · 全流程数字化管控平台</h1>
<p class="text-[10px] text-blue-400 font-mono tracking-widest uppercase" id="current-time">SYSTEM STATUS: 2026-03-22 10:45:00</p>
</div>
</div>
<div class="flex items-center space-x-6">
<div class="flex space-x-6 text-[11px] font-medium bg-slate-800/30 px-4 py-2 rounded-full border border-slate-700/50">
<span class="text-white flex items-center"><i class="w-1.5 h-1.5 bg-green-500 rounded-full mr-2"></i> 运行中: 24h</span>
<span class="text-slate-400">负荷: 78%</span>
<span class="text-slate-400">能效: 0.32 kW·h/m³</span>
</div>
<div class="flex items-center space-x-3 border-l border-slate-700 pl-6">
<div class="text-right">
<p class="text-[10px] text-slate-400 leading-none">值班主管</p>
<p class="text-xs text-white">王建国 (A组)</p>
</div>
<div class="w-8 h-8 bg-blue-600 rounded-lg flex items-center justify-center font-bold text-white shadow-lg"></div>
</div>
</div>
</header>
<!-- 核心统计区域 -->
<div class="stats-panel">
<div class="glass-card flow-card industrial">
<div class="flex items-center space-x-2 mb-2">
<span class="iconify text-orange-400" data-icon="material-symbols:factory-outline"></span>
<span class="text-[10px] font-bold text-orange-400 uppercase">工业进水累计</span>
</div>
<div class="flex justify-between items-end gap-2">
<div>
<p class="param-label text-[9px]">当日总量</p>
<p class="text-2xl font-digital text-white leading-none">10,867<span class="unit"></span></p>
</div>
<div class="text-right border-l border-slate-700/50 pl-2">
<p class="param-label text-[9px]">环比</p>
<p class="text-xs font-digital text-orange-300">+2.4% ↑</p>
</div>
</div>
</div>
<div class="glass-card flow-card domestic">
<div class="flex items-center space-x-2 mb-2">
<span class="iconify text-green-400" data-icon="material-symbols:home-outline"></span>
<span class="text-[10px] font-bold text-green-400 uppercase">生活进水累计</span>
</div>
<div class="flex justify-between items-end gap-2">
<div>
<p class="param-label text-[9px]">当日总量</p>
<p class="text-2xl font-digital text-white leading-none">7,569<span class="unit"></span></p>
</div>
<div class="text-right border-l border-slate-700/50 pl-2">
<p class="param-label text-[9px]">环比</p>
<p class="text-xs font-digital text-green-300">-1.8% ↓</p>
</div>
</div>
</div>
<div class="glass-card chart-container">
<div class="absolute top-2 left-4 z-10 flex items-center space-x-2">
<span class="w-1.5 h-1.5 bg-blue-500 rounded-full animate-pulse"></span>
<span class="text-[10px] text-slate-400 font-bold uppercase tracking-wider">进水流量7日趋势 (m³/d)</span>
</div>
<canvas id="flowChart"></canvas>
</div>
<!-- 统计面板右侧对应的告警总览 -->
<div class="glass-card flex flex-col justify-center p-3 relative overflow-hidden" style="border-top-color: #ef4444;">
<div class="absolute -right-4 -top-4 opacity-10">
<span class="iconify text-8xl text-red-500" data-icon="material-symbols:warning-outline"></span>
</div>
<div class="flex items-center justify-between mb-1">
<span class="text-[10px] font-bold text-red-400">设备运行异常</span>
<span class="badge badge-high animate-pulse">实时监控</span>
</div>
<div class="flex items-end justify-between">
<div>
<div class="text-3xl font-digital text-red-500">03</div>
<div class="text-[9px] text-slate-500 uppercase tracking-wider">Active Alarms</div>
</div>
<div class="text-right">
<div class="text-[10px] text-slate-400">待处理: <span class="text-red-400 font-digital">03</span></div>
<div class="text-[10px] text-slate-400">已闭环: <span class="text-green-500 font-digital">12</span>/今日</div>
</div>
</div>
</div>
</div>
<!-- 工艺流程数据表格 -->
<main class="grid-container">
<div class="table-container">
<div class="p-3 border-b border-slate-700/50 flex justify-between items-center bg-slate-900/40">
<div class="flex items-center space-x-2">
<span class="iconify text-blue-500" data-icon="material-symbols:AppSettings-outline"></span>
<h2 class="text-xs font-bold uppercase tracking-wider text-slate-300">全流程生产工艺实时数据概览</h2>
</div>
<div class="flex space-x-4">
<span class="text-[10px] text-green-500 flex items-center"><span class="w-2 h-2 bg-green-500 rounded-full mr-1 animate-pulse"></span> 生产正常</span>
<span class="text-[10px] text-slate-500">更新时间: 2026-03-22 10:15:30</span>
</div>
</div>
<div class="overflow-y-auto flex-1">
<table>
<thead>
<tr>
<th>工艺段名称</th>
<th>状态</th>
<th>瞬时流量 (m³/h)</th>
<th>关键参数 1</th>
<th>关键参数 2</th>
<th>关键参数 3</th>
<th class="text-right">设备ID</th>
</tr>
</thead>
<tbody>
<tr><td class="font-bold text-slate-200">01. 细格栅与提升</td><td><span class="status-tag status-online">运行中</span></td><td class="font-digital text-blue-400">1,245.8</td><td><span class="param-label-mini">液位:</span><span class="param-chip text-green-400">1.8m</span></td><td><span class="param-label-mini">pH:</span><span class="param-chip text-white">7.2</span></td><td><span class="param-label-mini">主泵:</span><span class="param-chip text-white">2#</span></td><td class="text-right font-mono text-[10px] text-slate-500">P101</td></tr>
<tr><td class="font-bold text-slate-200">02. 曝气沉砂池</td><td><span class="status-tag status-online">运行中</span></td><td class="font-digital text-blue-400">1,238.2</td><td><span class="param-label-mini">DO:</span><span class="param-chip text-white">2.5mg/L</span></td><td><span class="param-label-mini">速:</span><span class="param-chip text-white">35Hz</span></td><td><span class="param-label-mini">油:</span><span class="param-chip text-green-400">0.2</span></td><td class="text-right font-mono text-[10px] text-slate-500">D205</td></tr>
<tr><td class="font-bold text-slate-200">03. 初次沉淀池</td><td><span class="status-tag status-online">运行中</span></td><td class="font-digital text-blue-400">1,232.0</td><td><span class="param-label-mini">SS:</span><span class="param-chip text-white">180mg/L</span></td><td><span class="param-label-mini">泥位:</span><span class="param-chip text-white">0.8m</span></td><td><span class="param-label-mini">刮泥:</span><span class="param-chip text-white">ON</span></td><td class="text-right font-mono text-[10px] text-slate-500">S302</td></tr>
<tr><td class="font-bold text-slate-200">04. A/A/O 生物反应器</td><td><span class="status-tag status-online">运行中</span></td><td class="font-digital text-blue-400">1,230.5</td><td><span class="param-label-mini">厌氧ORP:</span><span class="param-chip text-white">-180mV</span></td><td><span class="param-label-mini">MLSS:</span><span class="param-chip text-white">3250</span></td><td><span class="param-label-mini">回流:</span><span class="param-chip text-white">100%</span></td><td class="text-right font-mono text-[10px] text-slate-500">B401</td></tr>
<tr><td class="font-bold text-slate-200">05. 二次沉淀池组</td><td><span class="status-tag status-offline">故障告警</span></td><td class="font-digital text-red-400">1,228.1</td><td><span class="param-label-mini">出水SS:</span><span class="param-chip text-red-400">22.4</span></td><td><span class="param-label-mini">泥层:</span><span class="param-chip text-white">1.2m</span></td><td><span class="param-label-mini">泵组:</span><span class="param-chip text-red-500">ERR</span></td><td class="text-right font-mono text-[10px] text-slate-500">S204</td></tr>
<tr><td class="font-bold text-slate-200">06. 磁混凝高效沉淀</td><td><span class="status-tag status-online">运行中</span></td><td class="font-digital text-blue-400">1,225.0</td><td><span class="param-label-mini">投药:</span><span class="param-chip text-white">12.5mg/L</span></td><td><span class="param-label-mini">磁粉:</span><span class="param-chip text-white">保持</span></td><td><span class="param-label-mini">浊度:</span><span class="param-chip text-green-400">4.2</span></td><td class="text-right font-mono text-[10px] text-slate-500">M501</td></tr>
<tr><td class="font-bold text-slate-200">07. V型滤池</td><td><span class="status-tag status-online">运行中</span></td><td class="font-digital text-blue-400">1,210.6</td><td><span class="param-label-mini">滤速:</span><span class="param-chip text-white">6.5m/h</span></td><td><span class="param-label-mini">水头失:</span><span class="param-chip text-white">1.2m</span></td><td><span class="param-label-mini">反冲:</span><span class="param-chip text-white">4:30</span></td><td class="text-right font-mono text-[10px] text-slate-500">F602</td></tr>
<tr><td class="font-bold text-slate-200">08. 紫外消毒/次氯酸钠</td><td><span class="status-tag status-online">运行中</span></td><td class="font-digital text-blue-400">1,208.5</td><td><span class="param-label-mini">强度:</span><span class="param-chip text-white">35mW</span></td><td><span class="param-label-mini">余氯:</span><span class="param-chip text-green-400">0.45</span></td><td><span class="param-label-mini">运行:</span><span class="param-chip text-white">12h</span></td><td class="text-right font-mono text-[10px] text-slate-500">V501</td></tr>
<tr><td class="font-bold text-slate-200">09. 核心鼓风机房</td><td><span class="status-tag status-online">运行中</span></td><td class="font-digital text-blue-400">254 m³</td><td><span class="param-label-mini">压:</span><span class="param-chip text-green-400">58kPa</span></td><td><span class="param-label-mini">温:</span><span class="param-chip text-white">62℃</span></td><td><span class="param-label-mini">功率:</span><span class="param-chip text-white">185kW</span></td><td class="text-right font-mono text-[10px] text-slate-500">M601</td></tr>
<tr><td class="font-bold text-slate-200 text-blue-400">10. 总出水在线监测</td><td><span class="status-tag status-online">达标运行</span></td><td class="font-digital text-blue-400">18.5k</td><td><span class="param-label-mini">COD:</span><span class="param-chip text-green-400">22.4</span></td><td><span class="param-label-mini">NH3:</span><span class="param-chip text-green-400">0.24</span></td><td><span class="param-label-mini">TP:</span><span class="param-chip text-green-400">0.08</span></td><td class="text-right font-mono text-[10px] text-slate-500">OUT-M</td></tr>
<tr><td class="font-bold text-slate-200">11. 污泥脱水系统</td><td><span class="status-tag status-online">运行中</span></td><td class="font-digital text-blue-400">--</td><td><span class="param-label-mini">含水:</span><span class="param-chip text-white">78.2%</span></td><td><span class="param-label-mini">产泥:</span><span class="param-chip text-white">12.5t</span></td><td><span class="param-label-mini">药量:</span><span class="param-chip text-white">4.2</span></td><td class="text-right font-mono text-[10px] text-slate-500">W701</td></tr>
</tbody>
</table>
</div>
<div class="px-3 py-2 border-t border-slate-700/50 bg-slate-900/40 flex justify-between items-center">
<div class="text-[10px] text-slate-500">系统就绪,当前生产效率:<span class="text-blue-400">92%</span></div>
<div class="flex space-x-2">
<button class="bg-blue-600/20 text-blue-400 text-[10px] px-3 py-1 rounded border border-blue-500/30 hover:bg-blue-600/40 transition">导出历史报表</button>
<button class="bg-slate-700 text-slate-200 text-[10px] px-3 py-1 rounded hover:bg-slate-600 transition">自定义列</button>
</div>
</div>
</div>
<!-- 15. 设备异常告警面板 (占据右侧整列) -->
<div class="glass-card alarm-panel">
<div class="card-header flex justify-between items-center bg-red-950/20">
<div class="flex items-center space-x-2">
<span class="iconify text-red-500 animate-pulse" data-icon="material-symbols:fmd-bad"></span>
<span class="text-xs font-bold text-red-100 uppercase tracking-wider">实时告警列表</span>
</div>
<div class="flex space-x-2">
<button class="text-[9px] bg-slate-800 hover:bg-slate-700 px-2 py-0.5 rounded transition">忽略全部</button>
<button class="text-[9px] bg-blue-600 hover:bg-blue-500 px-2 py-0.5 rounded transition">导出日志</button>
</div>
</div>
<div class="alarm-list">
<!-- 告警项 1 -->
<div class="alarm-item alarm-high">
<div class="flex justify-between mb-1">
<span class="badge badge-high font-bold uppercase">Critical</span>
<span class="text-[9px] text-slate-500 font-mono">10:42:15</span>
</div>
<div class="font-bold text-slate-200">鼓风机房 #2 离心风机</div>
<div class="text-[10px] text-red-400 mt-1 flex items-center">
<span class="iconify mr-1" data-icon="material-symbols:bolt"></span>
运行电流过载 (45.2A &gt; 40.0A)
</div>
<div class="flex justify-end space-x-2 mt-2">
<button class="text-[9px] border border-slate-700 hover:border-slate-500 px-2 py-1 rounded">查看详情</button>
<button class="text-[9px] bg-red-600/80 hover:bg-red-500 px-2 py-1 rounded text-white" onclick="alert('已发送工单给维保组')">立即处理</button>
</div>
</div>
<!-- 告警项 2 -->
<div class="alarm-item alarm-mid">
<div class="flex justify-between mb-1">
<span class="badge badge-mid font-bold uppercase">Warning</span>
<span class="text-[9px] text-slate-500 font-mono">10:05:21</span>
</div>
<div class="font-bold text-slate-200">2# 二沉池 吸泥机</div>
<div class="text-[10px] text-orange-400 mt-1 flex items-center">
<span class="iconify mr-1" data-icon="material-symbols:settings-backup-restore"></span>
转速异常波动 (+/- 15%)
</div>
<div class="flex justify-end space-x-2 mt-2">
<button class="text-[9px] border border-slate-700 hover:border-slate-500 px-2 py-1 rounded w-full text-slate-300">远程复位</button>
</div>
</div>
<!-- 告警项 3 -->
<div class="alarm-item alarm-low">
<div class="flex justify-between mb-1">
<span class="badge badge-low font-bold uppercase">Info</span>
<span class="text-[9px] text-slate-500 font-mono">09:12:05</span>
</div>
<div class="font-bold text-slate-200">加药间 PAC 储罐</div>
<div class="text-[10px] text-blue-300 mt-1 flex items-center">
<span class="iconify mr-1" data-icon="material-symbols:water-medium"></span>
低液位预警 (剩余 15%)
</div>
<div class="flex justify-end mt-2">
<button class="text-[9px] text-blue-400 hover:underline">申请补料</button>
</div>
</div>
</div>
<div class="card-footer text-center bg-slate-900/50 p-2 border-t border-slate-800">
<p class="text-[9px] text-slate-500 hover:text-blue-400 cursor-pointer transition">查看所有历史记录 (6张待办) »</p>
</div>
</div>
</main>
<footer class="mt-4 flex items-center justify-between px-2 text-[10px] text-slate-600 border-t border-slate-800 pt-2 h-6"> <div class="flex space-x-8">
<p>© 2026 智水云污水处理管理有限公司</p>
<p><i class="iconify inline mr-1" data-icon="material-symbols:location-on"></i> 江苏省南通市华东第二污水处理厂</p>
</div>
<div class="flex space-x-6">
<p class="flex items-center text-green-700 font-medium"><i class="iconify mr-1" data-icon="material-symbols:check-circle"></i> 云端数据实时同步中 (25ms)</p>
<p>生产智脑 V4.2.0-PROD</p>
</div>
</footer>
<script>
// 自动刷新当前时刻
function updateClock() {
const now = new Date();
const timeStr = `SYSTEM STATUS: ${now.getFullYear()}-${String(now.getMonth()+1).padStart(2,'0')}-${String(now.getDate()).padStart(2,'0')} ${String(now.getHours()).padStart(2,'0')}:${String(now.getMinutes()).padStart(2,'0')}:${String(now.getSeconds()).padStart(2,'0')}`;
document.getElementById('current-time').textContent = timeStr;
}
setInterval(updateClock, 1000);
// Chart.js 趋势分析
const ctx = document.getElementById('flowChart').getContext('2d');
const flowChart = new Chart(ctx, {
type: 'bar',
data: {
labels: ['03/16', '03/17', '03/18', '03/19', '03/20', '03/21', '03/22'],
datasets: [
{
label: '工业污水',
data: [11200, 10800, 11500, 10200, 12100, 10600, 10867],
backgroundColor: 'rgba(245, 158, 11, 0.4)',
borderColor: '#f59e0b',
borderWidth: 1.5,
borderRadius: 3
},
{
label: '生活污水',
data: [7200, 7120, 7800, 7400, 7650, 7420, 7569],
backgroundColor: 'rgba(59, 130, 246, 0.4)',
borderColor: '#3b82f6',
borderWidth: 1.5,
borderRadius: 3
}
]
},
options: {
responsive: true,
maintainAspectRatio: false,
plugins: {
legend: { display: false }
},
scales: {
x: {
grid: { display: false },
ticks: { color: '#64748b', font: { size: 9 } }
},
y: {
beginAtZero: false,
grid: { color: 'rgba(255, 255, 255, 0.03)' },
ticks: { color: '#64748b', font: { size: 9 }, stepSize: 5000 }
}
}
}
});
</script>
</body>
</html>