Compare commits
24 Commits
785654a510
...
process-de
| Author | SHA1 | Date | |
|---|---|---|---|
| 6c252fe4dd | |||
| 4aeb894ba9 | |||
| 2ca6153cda | |||
| 6738104534 | |||
| e5da30098f | |||
| 65c2a978b8 | |||
| 80fa5872fd | |||
| 5c576ddfcb | |||
| 0377a0cc8c | |||
| f89ab0f90d | |||
| 78ec2cbe85 | |||
| 6c08c4fd1b | |||
| ebf57c2e82 | |||
| 3c9ba8a7f5 | |||
| abdd3b7add | |||
| ebe3148a58 | |||
| 6d5c8bfd65 | |||
| 0c8b530339 | |||
| b9d6a7458f | |||
| 784ac30847 | |||
| b0e2e58d93 | |||
| dafda57a0e | |||
| c11112b066 | |||
| 5bacfa37d4 |
43
pom.xml
43
pom.xml
@ -21,6 +21,12 @@
|
|||||||
<!-- 数据<E695B0>?-->
|
<!-- 数据<E695B0>?-->
|
||||||
</properties>
|
</properties>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>net.java.dev.jna</groupId>
|
||||||
|
<artifactId>jna</artifactId>
|
||||||
|
<version>5.4.0</version>
|
||||||
|
</dependency>
|
||||||
<!-- spring核心<E6A0B8>?-->
|
<!-- spring核心<E6A0B8>?-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework</groupId>
|
<groupId>org.springframework</groupId>
|
||||||
@ -369,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>
|
||||||
@ -597,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 -->
|
||||||
@ -781,11 +804,11 @@
|
|||||||
<version>1.6.1</version>
|
<version>1.6.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- jna -->
|
<!-- jna -->
|
||||||
<dependency>
|
<!-- <dependency>-->
|
||||||
<groupId>net.java.dev.jna</groupId>
|
<!-- <groupId>net.java.dev.jna</groupId>-->
|
||||||
<artifactId>jna</artifactId>
|
<!-- <artifactId>jna</artifactId>-->
|
||||||
<version>1.0</version>
|
<!-- <version>1.0</version>-->
|
||||||
</dependency>
|
<!-- </dependency>-->
|
||||||
<!-- jna examples -->
|
<!-- jna examples -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>net.java.dev.jna</groupId>
|
<groupId>net.java.dev.jna</groupId>
|
||||||
@ -796,6 +819,14 @@
|
|||||||
<build>
|
<build>
|
||||||
<finalName>TGLW</finalName>
|
<finalName>TGLW</finalName>
|
||||||
<resources>
|
<resources>
|
||||||
|
<!-- <resource>-->
|
||||||
|
<!-- <directory>libs/win64</directory>-->
|
||||||
|
<!-- <targetPath>win64</targetPath>-->
|
||||||
|
<!-- <includes>-->
|
||||||
|
<!-- <include>*.dll</include>-->
|
||||||
|
<!-- </includes>-->
|
||||||
|
<!-- <filtering>false</filtering>-->
|
||||||
|
<!-- </resource>-->
|
||||||
<resource>
|
<resource>
|
||||||
<directory>src/main/java</directory>
|
<directory>src/main/java</directory>
|
||||||
<includes>
|
<includes>
|
||||||
@ -874,4 +905,4 @@
|
|||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
</project>
|
</project>
|
||||||
|
|||||||
@ -1,9 +0,0 @@
|
|||||||
package com.sipai.activiti;
|
|
||||||
|
|
||||||
public class Test {
|
|
||||||
public static void main(String[] args) {
|
|
||||||
int a = 3;
|
|
||||||
int b = 3;
|
|
||||||
System.out.println(a % b);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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()) {
|
||||||
|
|||||||
@ -2217,12 +2217,27 @@ public class EquipmentCardController {
|
|||||||
HttpServletResponse response, Model model) throws IOException {
|
HttpServletResponse response, Model model) throws IOException {
|
||||||
String wherestr = " where 1=1 ";
|
String wherestr = " where 1=1 ";
|
||||||
String unitId = request.getParameter("unitId");
|
String unitId = request.getParameter("unitId");
|
||||||
|
if (unitId == null || unitId.isEmpty()) {
|
||||||
|
unitId = request.getParameter("companyId");
|
||||||
|
}
|
||||||
String search_name = request.getParameter("search_name");
|
String search_name = request.getParameter("search_name");
|
||||||
|
if (search_name == null || search_name.trim().isEmpty()) {
|
||||||
|
search_name = request.getParameter("equipmentName");
|
||||||
|
}
|
||||||
String processSectionId = request.getParameter("processSectionId");
|
String processSectionId = request.getParameter("processSectionId");
|
||||||
|
if (processSectionId == null || processSectionId.trim().isEmpty() || "undefined".equals(processSectionId)) {
|
||||||
|
processSectionId = request.getParameter("processSection");
|
||||||
|
}
|
||||||
String equipmentClassId = request.getParameter("equipmentClassId");
|
String equipmentClassId = request.getParameter("equipmentClassId");
|
||||||
|
if (equipmentClassId == null || equipmentClassId.trim().isEmpty() || "undefined".equals(equipmentClassId)) {
|
||||||
|
equipmentClassId = request.getParameter("search_pid1");
|
||||||
|
}
|
||||||
String equipmentLevel = request.getParameter("equipmentLevel");
|
String equipmentLevel = request.getParameter("equipmentLevel");
|
||||||
String equipmentClassCode = request.getParameter("equipmentClassCode");//类似竹一的计量表 该页面仅显示一种设备类型的
|
String equipmentClassCode = request.getParameter("equipmentClassCode");//类似竹一的计量表 该页面仅显示一种设备类型的
|
||||||
String ids = request.getParameter("ids");//页面勾选的设备id
|
String ids = request.getParameter("ids");//页面勾选的设备id
|
||||||
|
if (ids == null || ids.trim().isEmpty()) {
|
||||||
|
ids = request.getParameter("equipmentIds");
|
||||||
|
}
|
||||||
|
|
||||||
if (unitId != null && !unitId.isEmpty()) {
|
if (unitId != null && !unitId.isEmpty()) {
|
||||||
//获取公司下所有子节点
|
//获取公司下所有子节点
|
||||||
@ -2272,6 +2287,26 @@ public class EquipmentCardController {
|
|||||||
|
|
||||||
// System.out.println(wherestr);
|
// System.out.println(wherestr);
|
||||||
|
|
||||||
|
if (ids != null && !ids.trim().isEmpty()) {
|
||||||
|
// 兼容前端可能携带的首尾逗号与空白,确保仅导出选中设备。
|
||||||
|
String[] idArr = ids.split(",");
|
||||||
|
StringBuilder selectedIds = new StringBuilder();
|
||||||
|
for (String id : idArr) {
|
||||||
|
if (id != null) {
|
||||||
|
String trimmedId = id.trim();
|
||||||
|
if (!trimmedId.isEmpty()) {
|
||||||
|
if (selectedIds.length() > 0) {
|
||||||
|
selectedIds.append("','");
|
||||||
|
}
|
||||||
|
selectedIds.append(trimmedId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (selectedIds.length() > 0) {
|
||||||
|
wherestr += " and id in ('" + selectedIds + "') ";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
List<EquipmentCard> equipmentCards = this.equipmentCardService.selectListByWhere(wherestr);
|
List<EquipmentCard> equipmentCards = this.equipmentCardService.selectListByWhere(wherestr);
|
||||||
//导出文件到指定目录,兼容Linux
|
//导出文件到指定目录,兼容Linux
|
||||||
this.equipmentCardService.downloadEquipmentExcel(response, equipmentCards);
|
this.equipmentCardService.downloadEquipmentExcel(response, equipmentCards);
|
||||||
|
|||||||
@ -104,7 +104,7 @@ public class KpiPlanController {
|
|||||||
if (StringUtils.isNotBlank(positonTypeList)) {
|
if (StringUtils.isNotBlank(positonTypeList)) {
|
||||||
wherestr += " and j.level_type = " + positonTypeList;
|
wherestr += " and j.level_type = " + positonTypeList;
|
||||||
}
|
}
|
||||||
wherestr += "and p.create_user_id ='" + id + "'";
|
wherestr += " and p.create_user_id ='" + id + "'";
|
||||||
PageHelper.startPage(page, rows);
|
PageHelper.startPage(page, rows);
|
||||||
List<KpiPlan> list = kpiPlanService.selectListByWhere(wherestr + orderstr);
|
List<KpiPlan> list = kpiPlanService.selectListByWhere(wherestr + orderstr);
|
||||||
|
|
||||||
@ -387,7 +387,8 @@ public class KpiPlanController {
|
|||||||
@RequestMapping("/export.do")
|
@RequestMapping("/export.do")
|
||||||
public void export(HttpServletRequest request, HttpServletResponse response,
|
public void export(HttpServletRequest request, HttpServletResponse response,
|
||||||
@RequestParam(value = "periodTypeName", required = false) String periodTypeList,
|
@RequestParam(value = "periodTypeName", required = false) String periodTypeList,
|
||||||
@RequestParam(value = "positionType", required = false) String positonTypeList) throws IOException {
|
@RequestParam(value = "positionType", required = false) String positonTypeList,
|
||||||
|
@RequestParam(value = "ids", required = false) String ids) throws IOException {
|
||||||
// 摘自列表查询接口 start
|
// 摘自列表查询接口 start
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String id = cu.getId();
|
String id = cu.getId();
|
||||||
@ -399,6 +400,10 @@ public class KpiPlanController {
|
|||||||
if (StringUtils.isNotBlank(positonTypeList) && !"null".equals(positonTypeList)) {
|
if (StringUtils.isNotBlank(positonTypeList) && !"null".equals(positonTypeList)) {
|
||||||
wherestr += " and j.level_type = " + positonTypeList;
|
wherestr += " and j.level_type = " + positonTypeList;
|
||||||
}
|
}
|
||||||
|
if (StringUtils.isNotBlank(ids)) {
|
||||||
|
String idstr = ids.replace("'", "").replace(",", "','");
|
||||||
|
wherestr += " and p.id in ('" + idstr + "')";
|
||||||
|
}
|
||||||
wherestr += "and p.create_user_id ='" + id + "'";
|
wherestr += "and p.create_user_id ='" + id + "'";
|
||||||
|
|
||||||
List<KpiPlan> list = kpiPlanService.selectListByWhere(wherestr + orderstr);
|
List<KpiPlan> list = kpiPlanService.selectListByWhere(wherestr + orderstr);
|
||||||
|
|||||||
@ -122,14 +122,14 @@ public class RptDayLogController {
|
|||||||
@RequestParam(value = "rptdt") String rptdt) throws IOException {
|
@RequestParam(value = "rptdt") String rptdt) throws IOException {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String userId = cu.getId();
|
String userId = cu.getId();
|
||||||
|
|
||||||
// 权限验证:检查用户是否有填报权限
|
// 权限验证:检查用户是否有填报权限
|
||||||
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
// if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
||||||
Result result = Result.failed("您没有该报表的填报权限");
|
// Result result = Result.failed("您没有该报表的填报权限");
|
||||||
model.addAttribute("result", CommUtil.toJson(result));
|
// model.addAttribute("result", CommUtil.toJson(result));
|
||||||
return "result";
|
// return "result";
|
||||||
}
|
// }
|
||||||
|
|
||||||
JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId);
|
JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId);
|
||||||
|
|
||||||
Result result = Result.success(jsonObject);
|
Result result = Result.success(jsonObject);
|
||||||
@ -251,6 +251,29 @@ public class RptDayLogController {
|
|||||||
@RequestMapping("/dodeletes.do")
|
@RequestMapping("/dodeletes.do")
|
||||||
public String dodels(HttpServletRequest request,Model model,
|
public String dodels(HttpServletRequest request,Model model,
|
||||||
@RequestParam(value="ids") String ids){
|
@RequestParam(value="ids") String ids){
|
||||||
|
// User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
// String userId = cu.getId();
|
||||||
|
|
||||||
|
// 获取rptdeptId,假设从参数或第一个ID推断
|
||||||
|
// String rptdeptId = request.getParameter("rptdeptId");
|
||||||
|
// if (rptdeptId == null || rptdeptId.isEmpty()) {
|
||||||
|
// // 如果没有提供rptdeptId,从第一个ID获取
|
||||||
|
// String[] idArray = ids.split(",");
|
||||||
|
// if (idArray.length > 0) {
|
||||||
|
// RptDayLog rptDayLog = this.rptDayLogService.selectById(idArray[0]);
|
||||||
|
// if (rptDayLog != null) {
|
||||||
|
// rptdeptId = rptDayLog.getRptdeptId();
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有生成权限
|
||||||
|
// if (!this.rptDayLogService.checkGeneratePermission(rptdeptId, cu)) {
|
||||||
|
// Result result = Result.failed("您没有该报表的删除权限,无法删除");// 生成权限=删除权限
|
||||||
|
// model.addAttribute("result", CommUtil.toJson(result));
|
||||||
|
// return "result";
|
||||||
|
// }
|
||||||
|
|
||||||
String[] idArray = ids.split(",");
|
String[] idArray = ids.split(",");
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < idArray.length; i++) {
|
for (int i = 0; i < idArray.length; i++) {
|
||||||
|
|||||||
@ -222,18 +222,50 @@ public class SafetyCertificateController {
|
|||||||
|
|
||||||
@RequestMapping("/deletes.do")
|
@RequestMapping("/deletes.do")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String delete(HttpServletRequest request, Model model, String[] ids) throws IOException {
|
public String delete(HttpServletRequest request, Model model,
|
||||||
|
@RequestParam(value = "ids", required = false) String ids,
|
||||||
|
@RequestParam(value = "staffIds", required = false) String staffIds) throws IOException {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
for (String id : ids) {
|
|
||||||
|
// 兼容:支持 ids/staffIds 传 CSV,也支持重复参数数组
|
||||||
|
Set<String> idSet = new LinkedHashSet<>(parseRequestIds(request, "ids", ids));
|
||||||
|
idSet.addAll(parseRequestIds(request, "staffIds", staffIds));
|
||||||
|
|
||||||
|
for (String id : idSet) {
|
||||||
result += service.deleteById(id);
|
result += service.deleteById(id);
|
||||||
}
|
|
||||||
for (String id : ids) {
|
|
||||||
safetyFilesService.deleteByBizId(id);
|
safetyFilesService.deleteByBizId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
model.addAttribute("result", result);
|
model.addAttribute("result", result);
|
||||||
return "result";
|
return "result";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<String> parseRequestIds(HttpServletRequest request, String paramName, String rawIds) {
|
||||||
|
List<String> result = new ArrayList<>(parseIdTokens(rawIds));
|
||||||
|
String[] values = request.getParameterValues(paramName);
|
||||||
|
if (values != null) {
|
||||||
|
for (String value : values) {
|
||||||
|
result.addAll(parseIdTokens(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private List<String> parseIdTokens(String rawIds) {
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isBlank(rawIds) || "null".equals(rawIds)) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String[] split = rawIds.split(",");
|
||||||
|
for (String id : split) {
|
||||||
|
String value = org.apache.commons.lang3.StringUtils.trim(id);
|
||||||
|
if (org.apache.commons.lang3.StringUtils.isNotBlank(value) && value.matches("^[0-9A-Za-z_-]+$")) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转导入页面
|
* 跳转导入页面
|
||||||
*
|
*
|
||||||
|
|||||||
@ -339,16 +339,39 @@ public class SafetyExternalCertificateController {
|
|||||||
|
|
||||||
@RequestMapping("/deletes.do")
|
@RequestMapping("/deletes.do")
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public String delete(HttpServletRequest request, Model model, String[] ids) throws IOException {
|
public String delete(HttpServletRequest request, Model model,
|
||||||
|
@RequestParam(value = "ids", required = false) String ids,
|
||||||
|
@RequestParam(value = "staffIds", required = false) String staffIds) throws IOException {
|
||||||
int result = 0;
|
int result = 0;
|
||||||
for (String id : ids) {
|
|
||||||
|
// 兼容:支持 ids/staffIds 传 CSV,也支持重复参数数组
|
||||||
|
Set<String> certificateIdSet = new LinkedHashSet<>(parseRequestIds(request, "ids", ids));
|
||||||
|
Set<String> staffIdSet = new LinkedHashSet<>(parseRequestIds(request, "staffIds", staffIds));
|
||||||
|
|
||||||
|
for (String id : certificateIdSet) {
|
||||||
result += service.deleteById(id);
|
result += service.deleteById(id);
|
||||||
safetyFilesService.deleteByBizId(id);
|
safetyFilesService.deleteByBizId(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for (String staffId : staffIdSet) {
|
||||||
|
safetyExternalStaffService.deleteById(staffId);
|
||||||
|
}
|
||||||
|
|
||||||
model.addAttribute("result", result);
|
model.addAttribute("result", result);
|
||||||
return "result";
|
return "result";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<String> parseRequestIds(HttpServletRequest request, String paramName, String rawIds) {
|
||||||
|
List<String> result = new ArrayList<>(parseExportIds(rawIds));
|
||||||
|
String[] values = request.getParameterValues(paramName);
|
||||||
|
if (values != null) {
|
||||||
|
for (String value : values) {
|
||||||
|
result.addAll(parseExportIds(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转导入页面
|
* 跳转导入页面
|
||||||
*
|
*
|
||||||
@ -536,67 +559,61 @@ public class SafetyExternalCertificateController {
|
|||||||
public void export(HttpServletRequest request, HttpServletResponse response,
|
public void export(HttpServletRequest request, HttpServletResponse response,
|
||||||
@RequestParam(value = "issueDate", required = false) String issueDate,
|
@RequestParam(value = "issueDate", required = false) String issueDate,
|
||||||
@RequestParam(value = "jobType", required = false) String jobType,
|
@RequestParam(value = "jobType", required = false) String jobType,
|
||||||
@RequestParam(value = "companyParam", required = false) String companyParam) throws IOException {
|
@RequestParam(value = "companyParam", required = false) String companyParam,
|
||||||
// 摘自列表查询接口 start
|
@RequestParam(value = "search_name", required = false) String searchName,
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
@RequestParam(value = "ids", required = false) String ids,
|
||||||
|
@RequestParam(value = "staffIds", required = false) String staffIds) throws IOException {
|
||||||
|
// 与列表接口保持一致,避免“页面有数据但导出为空”
|
||||||
String sort = " sc.userid, sc.create_time ";
|
String sort = " sc.userid, sc.create_time ";
|
||||||
String order = " desc ";
|
String order = " desc ";
|
||||||
String orderstr = " order by " + sort + " " + order;
|
String orderstr = " order by " + sort + " " + order;
|
||||||
String wherestr = " where flag='2' ";
|
String wherestr = " where 1=1 ";
|
||||||
if (request.getParameter("search_code") != null && !request.getParameter("search_code").isEmpty()) {
|
|
||||||
List<Unit> unitlist = unitService.getUnitChildrenById(request.getParameter("search_code"));
|
|
||||||
String pidstr = "";
|
|
||||||
for (int i = 0; i < unitlist.size(); i++) {
|
|
||||||
pidstr += "'" + unitlist.get(i).getId() + "',";
|
|
||||||
}
|
|
||||||
if (pidstr != "") {
|
|
||||||
pidstr = pidstr.substring(0, pidstr.length() - 1);
|
|
||||||
wherestr += "and u.pid in (" + pidstr + ") ";
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
Company company = unitService.getCompanyByUserId(cu.getId());
|
|
||||||
String companyId = "-1";
|
|
||||||
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()) {
|
|
||||||
wherestr += "and u.id in ('" + userIds + "') ";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// 搜索框筛选
|
// 搜索框筛选
|
||||||
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
|
if (StringUtils.isNotBlank(searchName)) {
|
||||||
wherestr += " and (sc.certificate_name like '%" + request.getParameter("search_name") + "%'" +
|
wherestr += " and (sc.certificate_name like '%" + searchName + "%'" +
|
||||||
" or ses.name like '%" + request.getParameter("search_name") + "%')";
|
" or ses.name like '%" + searchName + "%')";
|
||||||
}
|
}
|
||||||
|
|
||||||
// 领证时间筛选
|
// 领证时间筛选
|
||||||
if (StringUtils.isNotBlank(issueDate) && !"null".equals(issueDate)) {
|
if (StringUtils.isNotBlank(issueDate) && !"null".equals(issueDate)) {
|
||||||
String[] split = issueDate.split("~");
|
String[] split = issueDate.split("~");
|
||||||
String issueDate_param_start_time = split[0].trim();
|
if (split.length == 2) {
|
||||||
String issueDate_param_end_time = split[1].trim();
|
String issueDate_param_start_time = split[0].trim();
|
||||||
wherestr += " and sc.issue_date >= '" + issueDate_param_start_time + "'" +
|
String issueDate_param_end_time = split[1].trim();
|
||||||
" and sc.issue_date <= '" + issueDate_param_end_time + "'";
|
wherestr += " and sc.issue_date >= '" + issueDate_param_start_time + "'" +
|
||||||
|
" and sc.issue_date <= '" + issueDate_param_end_time + "'";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//作业类型
|
// 作业类型
|
||||||
if (StringUtils.isNotBlank(jobType) && !"null".equals(jobType)) {
|
if (StringUtils.isNotBlank(jobType) && !"null".equals(jobType)) {
|
||||||
wherestr += " and sc.job_type = '" + jobType + "'";
|
wherestr += " and sc.job_type = '" + jobType + "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
//施工单位
|
// 施工单位
|
||||||
if (StringUtils.isNotBlank(companyParam) && !"null".equals(companyParam)) {
|
if (StringUtils.isNotBlank(companyParam) && !"null".equals(companyParam)) {
|
||||||
wherestr += " and ses.company = '" + companyParam + "'";
|
wherestr += " and ses.company = '" + companyParam + "'";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 勾选导出:有勾选则仅导出勾选数据;无勾选则按筛选条件导出全部
|
||||||
|
List<String> certificateIdList = parseExportIds(ids);
|
||||||
|
List<String> staffIdList = parseExportIds(staffIds);
|
||||||
|
if (!CollectionUtils.isEmpty(certificateIdList) || !CollectionUtils.isEmpty(staffIdList)) {
|
||||||
|
StringBuilder selectedWhere = new StringBuilder(" and (");
|
||||||
|
if (!CollectionUtils.isEmpty(certificateIdList)) {
|
||||||
|
selectedWhere.append("sc.id in (").append(joinForSqlIn(certificateIdList)).append(")");
|
||||||
|
}
|
||||||
|
if (!CollectionUtils.isEmpty(staffIdList)) {
|
||||||
|
if (!CollectionUtils.isEmpty(certificateIdList)) {
|
||||||
|
selectedWhere.append(" or ");
|
||||||
|
}
|
||||||
|
selectedWhere.append("ses.id in (").append(joinForSqlIn(staffIdList)).append(")");
|
||||||
|
}
|
||||||
|
selectedWhere.append(")");
|
||||||
|
wherestr += selectedWhere;
|
||||||
|
}
|
||||||
|
|
||||||
List<SafetyExternalCertificateVo> list = this.service.selectListByConditionForExternal(wherestr + orderstr);
|
List<SafetyExternalCertificateVo> list = this.service.selectListByConditionForExternal(wherestr + orderstr);
|
||||||
List<SafetyExternalCertificateExcel> excelList = new ArrayList<>();
|
List<SafetyExternalCertificateExcel> excelList = new ArrayList<>();
|
||||||
SafetyExternalCertificateExcel excelEntity = null;
|
SafetyExternalCertificateExcel excelEntity = null;
|
||||||
@ -605,7 +622,7 @@ public class SafetyExternalCertificateController {
|
|||||||
BeanUtils.copyProperties(vo, excelEntity);
|
BeanUtils.copyProperties(vo, excelEntity);
|
||||||
excelList.add(excelEntity);
|
excelList.add(excelEntity);
|
||||||
}
|
}
|
||||||
// 摘自列表查询接口 end
|
|
||||||
response.setContentType("application/vnd.ms-excel");
|
response.setContentType("application/vnd.ms-excel");
|
||||||
response.setCharacterEncoding("utf8");
|
response.setCharacterEncoding("utf8");
|
||||||
response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode("外部人员证书信息", "UTF-8") + ".xlsx");
|
response.setHeader("Content-disposition", "attachment;filename=" + java.net.URLEncoder.encode("外部人员证书信息", "UTF-8") + ".xlsx");
|
||||||
@ -616,4 +633,31 @@ public class SafetyExternalCertificateController {
|
|||||||
excelWriter.finish();
|
excelWriter.finish();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<String> parseExportIds(String rawIds) {
|
||||||
|
List<String> result = new ArrayList<>();
|
||||||
|
if (StringUtils.isBlank(rawIds) || "null".equals(rawIds)) {
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
String[] split = rawIds.split(",");
|
||||||
|
for (String id : split) {
|
||||||
|
String value = StringUtils.trim(id);
|
||||||
|
// 仅保留安全字符,避免拼接 SQL 时引入非法字符
|
||||||
|
if (StringUtils.isNotBlank(value) && value.matches("^[0-9A-Za-z_-]+$")) {
|
||||||
|
result.add(value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
private String joinForSqlIn(List<String> idList) {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
for (int i = 0; i < idList.size(); i++) {
|
||||||
|
if (i > 0) {
|
||||||
|
sb.append(",");
|
||||||
|
}
|
||||||
|
sb.append("'").append(idList.get(i)).append("'");
|
||||||
|
}
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -134,6 +134,12 @@ public class SewageController {
|
|||||||
public String dosave(HttpServletRequest request,Model model,
|
public String dosave(HttpServletRequest request,Model model,
|
||||||
@ModelAttribute Sewage sewage) {
|
@ModelAttribute Sewage sewage) {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
String contractNumber = sewage.getContractNumber() == null ? null : sewage.getContractNumber().trim();
|
||||||
|
sewage.setContractNumber(contractNumber);
|
||||||
|
if (this.sewageService.existsByContractNumber(contractNumber)) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"合同编号已存在,不可重复\"}");
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
sewage.setId(CommUtil.getUUID());
|
sewage.setId(CommUtil.getUUID());
|
||||||
int result = this.sewageService.save(sewage);
|
int result = this.sewageService.save(sewage);
|
||||||
String resultstr = "{\"res\":\""+result+"\",\"id\":\""+sewage.getId()+"\"}";
|
String resultstr = "{\"res\":\""+result+"\",\"id\":\""+sewage.getId()+"\"}";
|
||||||
@ -193,6 +199,12 @@ public class SewageController {
|
|||||||
public String doupdate(HttpServletRequest request,Model model,
|
public String doupdate(HttpServletRequest request,Model model,
|
||||||
@ModelAttribute Sewage sewage) {
|
@ModelAttribute Sewage sewage) {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
String contractNumber = sewage.getContractNumber() == null ? null : sewage.getContractNumber().trim();
|
||||||
|
sewage.setContractNumber(contractNumber);
|
||||||
|
if (this.sewageService.existsByContractNumberExcludeId(contractNumber, sewage.getId())) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"合同编号已存在,不可重复\"}");
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
int result = this.sewageService.update(sewage);
|
int result = this.sewageService.update(sewage);
|
||||||
String resstr="{\"res\":\""+result+"\",\"id\":\""+sewage.getId()+"\"}";
|
String resstr="{\"res\":\""+result+"\",\"id\":\""+sewage.getId()+"\"}";
|
||||||
model.addAttribute("result", resstr);
|
model.addAttribute("result", resstr);
|
||||||
@ -348,7 +360,8 @@ public class SewageController {
|
|||||||
@RequestMapping(value = "downloadExcelFun.do")
|
@RequestMapping(value = "downloadExcelFun.do")
|
||||||
public ModelAndView downloadExcelFun(HttpServletRequest request,
|
public ModelAndView downloadExcelFun(HttpServletRequest request,
|
||||||
HttpServletResponse response, Model model) throws IOException {
|
HttpServletResponse response, Model model) throws IOException {
|
||||||
this.sewageService.outExcelFun(response);
|
String ids = request.getParameter("ids");
|
||||||
|
this.sewageService.outExcelFun(response, ids);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -242,11 +242,20 @@ public class ProcessSectionController {
|
|||||||
@RequestMapping("/getProcessSection4Select.do")
|
@RequestMapping("/getProcessSection4Select.do")
|
||||||
public String getProcessSection4Select(HttpServletRequest request, Model model) {
|
public String getProcessSection4Select(HttpServletRequest request, Model model) {
|
||||||
String companyId = request.getParameter("companyId"); // 默认查询JSBZ???
|
String companyId = request.getParameter("companyId"); // 默认查询JSBZ???
|
||||||
// 使用unitService获取Unit信息,因为companyId来自tb_unit表
|
// companyId在不同页面可能来自tb_unit或tb_company,统一兼容两种来源
|
||||||
Unit unit = this.unitService.getUnitById(companyId);
|
Unit unit = this.unitService.getUnitById(companyId);
|
||||||
|
String unitType = null;
|
||||||
|
if (unit != null) {
|
||||||
|
unitType = unit.getType();
|
||||||
|
} else if (companyId != null && !companyId.isEmpty()) {
|
||||||
|
Company company = this.unitService.getCompById(companyId);
|
||||||
|
if (company != null) {
|
||||||
|
unitType = company.getType();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
String wherestr = "where 1=1 and active='" + CommString.Active_True + "' ";
|
String wherestr = "where 1=1 and active='" + CommString.Active_True + "' ";
|
||||||
if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
if (CommString.UNIT_TYPE_COMPANY.equals(unitType)) { // "C";//公司
|
||||||
String bizs = "";//公司下属所有厂id
|
String bizs = "";//公司下属所有厂id
|
||||||
List<Unit> blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId);
|
List<Unit> blist = this.unitService.getParentCompanyChildrenBizByUnitid(companyId);
|
||||||
if (blist != null && blist.size() > 0) {
|
if (blist != null && blist.size() > 0) {
|
||||||
@ -258,7 +267,7 @@ public class ProcessSectionController {
|
|||||||
}
|
}
|
||||||
bizs = bizs.replace(",", "','");
|
bizs = bizs.replace(",", "','");
|
||||||
wherestr += " and (unit_id='" + ProcessSection.UnitId_Sys + "' or (code not in (select code from tb_process_section where unit_id='" + ProcessSection.UnitId_Sys + "')) and unit_id in ('" + bizs + "') ) ";
|
wherestr += " and (unit_id='" + ProcessSection.UnitId_Sys + "' or (code not in (select code from tb_process_section where unit_id='" + ProcessSection.UnitId_Sys + "')) and unit_id in ('" + bizs + "') ) ";
|
||||||
} else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // B 水厂
|
} else if (CommString.UNIT_TYPE_BIZ.equals(unitType)) { // B 水厂
|
||||||
wherestr += " and unit_id='" + companyId + "' ";
|
wherestr += " and unit_id='" + companyId + "' ";
|
||||||
}
|
}
|
||||||
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
|
if (request.getParameter("search_name") != null && !request.getParameter("search_name").isEmpty()) {
|
||||||
@ -273,13 +282,16 @@ public class ProcessSectionController {
|
|||||||
for (int i = 0; i < processSections.size(); i++) {
|
for (int i = 0; i < processSections.size(); i++) {
|
||||||
JSONObject jsonObject = new JSONObject();
|
JSONObject jsonObject = new JSONObject();
|
||||||
jsonObject.put("id", processSections.get(i).getCode());
|
jsonObject.put("id", processSections.get(i).getCode());
|
||||||
if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_COMPANY)) { // "C";//公司
|
if (CommString.UNIT_TYPE_COMPANY.equals(unitType)) { // "C";//公司
|
||||||
if (!processSections.get(i).getUnitId().equals(ProcessSection.UnitId_Sys)) {
|
if (!processSections.get(i).getUnitId().equals(ProcessSection.UnitId_Sys)) {
|
||||||
jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")");
|
jsonObject.put("text", processSections.get(i).getSname() + "(" + processSections.get(i).getCompanySname() + ")");
|
||||||
} else {
|
} else {
|
||||||
jsonObject.put("text", processSections.get(i).getSname());
|
jsonObject.put("text", processSections.get(i).getSname());
|
||||||
}
|
}
|
||||||
} else if (unit != null && unit.getType().equals(CommString.UNIT_TYPE_BIZ)) { // "B";//水厂
|
} else if (CommString.UNIT_TYPE_BIZ.equals(unitType)) { // "B";//水厂
|
||||||
|
jsonObject.put("text", processSections.get(i).getSname());
|
||||||
|
} else {
|
||||||
|
// 兜底,避免前端下拉出现有id无text导致显示为空
|
||||||
jsonObject.put("text", processSections.get(i).getSname());
|
jsonObject.put("text", processSections.get(i).getSname());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import io.swagger.annotations.*;
|
|||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
import org.activiti.engine.RepositoryService;
|
import org.activiti.engine.RepositoryService;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
import org.apache.commons.fileupload.servlet.ServletFileUpload;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -29,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;
|
||||||
@ -40,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;
|
||||||
|
|
||||||
@ -144,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 ";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -586,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;
|
||||||
@ -866,6 +872,9 @@ public class UserController {
|
|||||||
public String getUsersByIds(HttpServletRequest request, Model model) {
|
public String getUsersByIds(HttpServletRequest request, Model model) {
|
||||||
String userIds = request.getParameter("userIds");
|
String userIds = request.getParameter("userIds");
|
||||||
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')");
|
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')");
|
||||||
|
if (CollectionUtils.isNotEmpty(list)){
|
||||||
|
list = list.stream().filter(u -> StringUtils.isNotBlank(u.getId())).collect(toList());
|
||||||
|
}
|
||||||
JSONArray json = JSONArray.fromObject(list);
|
JSONArray json = JSONArray.fromObject(list);
|
||||||
model.addAttribute("result", json);
|
model.addAttribute("result", json);
|
||||||
return "result";
|
return "result";
|
||||||
|
|||||||
@ -89,11 +89,26 @@ public class KPIPointController {
|
|||||||
// List<MPointHistory> lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
|
// List<MPointHistory> lists = mPointHistoryService.selectListByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
|
||||||
// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
|
// int dd= mPointHistoryService.deleteByTableAWhere("tb_mp_11_GNJ1_F","MeasureDT='2016-01-10 10:16:57'");
|
||||||
for (int i=0; i < list.size(); i++) {
|
for (int i=0; i < list.size(); i++) {
|
||||||
ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid());
|
String rawBizId = list.get(i).getBizid();
|
||||||
|
ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid());
|
||||||
|
if (processSection == null && list.get(i).getProcesssectionid() != null && !list.get(i).getProcesssectionid().isEmpty()) {
|
||||||
|
// KPI里历史数据存在按code保存工艺段的场景,优先按厂区code匹配,再回退到系统库
|
||||||
|
List<ProcessSection> processSectionList = this.processSectionService.selectSimpleListByWhere(
|
||||||
|
"where code='" + list.get(i).getProcesssectionid() + "' and unit_id='" + rawBizId + "' "
|
||||||
|
);
|
||||||
|
if (processSectionList == null || processSectionList.isEmpty()) {
|
||||||
|
processSectionList = this.processSectionService.selectSimpleListByWhere(
|
||||||
|
"where code='" + list.get(i).getProcesssectionid() + "' and unit_id='" + ProcessSection.UnitId_Sys + "' "
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (processSectionList != null && !processSectionList.isEmpty()) {
|
||||||
|
processSection = processSectionList.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (processSection != null) {
|
if (processSection != null) {
|
||||||
list.get(i).setProcessectionname(processSection.getName());
|
list.get(i).setProcessectionname(processSection.getName());
|
||||||
}
|
}
|
||||||
Company company = this.unitService.getCompById(list.get(i).getBizid());
|
Company company = this.unitService.getCompById(rawBizId);
|
||||||
if (company != null) {
|
if (company != null) {
|
||||||
list.get(i).setBizid(company.getName());
|
list.get(i).setBizid(company.getName());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4152,8 +4152,15 @@ public class MPointController {
|
|||||||
for (int i = 0; i < ids.length; i++) {
|
for (int i = 0; i < ids.length; i++) {
|
||||||
com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject();
|
com.alibaba.fastjson.JSONObject jsonObject2 = new com.alibaba.fastjson.JSONObject();
|
||||||
|
|
||||||
//通过es查询bizid
|
//通过数据库查询测点(优先通过unitId和测点编码查询)
|
||||||
MPoint mPoint_es = mPointService.selectById(ids[i]);
|
MPoint mPoint_es = mPointService.selectById(unitId, ids[i]);
|
||||||
|
if (mPoint_es == null) {
|
||||||
|
// 尝试通过测点编码查询
|
||||||
|
List<MPoint> mPointList = mPointService.selectListByWhere(unitId, "where mpointcode='" + ids[i] + "'");
|
||||||
|
if (mPointList != null && mPointList.size() > 0) {
|
||||||
|
mPoint_es = mPointList.get(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
if (mPoint_es != null) {
|
if (mPoint_es != null) {
|
||||||
unitId = mPoint_es.getBizid();
|
unitId = mPoint_es.getBizid();
|
||||||
|
|
||||||
|
|||||||
@ -481,7 +481,7 @@ public class SchedulingController {
|
|||||||
JSONArray array = new JSONArray();
|
JSONArray array = new JSONArray();
|
||||||
String[] workpeopleids = scheduling.getWorkpeople().split(",");
|
String[] workpeopleids = scheduling.getWorkpeople().split(",");
|
||||||
if (workpeopleids != null && workpeopleids.length > 0) {
|
if (workpeopleids != null && workpeopleids.length > 0) {
|
||||||
if (!workpeopleids[0].equals("")) {
|
if (!userId.equals(workpeopleids[0])) {
|
||||||
for (int i = 0; i < workpeopleids.length; i++) {
|
for (int i = 0; i < workpeopleids.length; i++) {
|
||||||
if (!userId.equals(workpeopleids[i])) {
|
if (!userId.equals(workpeopleids[i])) {
|
||||||
JSONObject object = new JSONObject();
|
JSONObject object = new JSONObject();
|
||||||
@ -1156,6 +1156,10 @@ public class SchedulingController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 获取交班表单数据
|
||||||
|
List<GroupContentFormData> formDataList = this.groupContentFormDataService.selectListByWhere(" where schedulingId='" + schedulingId + "' ");
|
||||||
|
model.addAttribute("formDataList", formDataList);
|
||||||
|
|
||||||
model.addAttribute("scheduling", scheduling);
|
model.addAttribute("scheduling", scheduling);
|
||||||
return "work/schedulingView";
|
return "work/schedulingView";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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("");
|
||||||
|
|||||||
@ -1252,21 +1252,14 @@ public class WorkorderDetailController {
|
|||||||
@RequestMapping("/doExportRepair.do")
|
@RequestMapping("/doExportRepair.do")
|
||||||
public ModelAndView doExportRepair(HttpServletRequest request,
|
public ModelAndView doExportRepair(HttpServletRequest request,
|
||||||
HttpServletResponse response, Model model,
|
HttpServletResponse response, Model model,
|
||||||
@RequestParam(value = "ids") String ids,
|
@RequestParam(value = "ids", required = false) String ids,
|
||||||
@RequestParam(value = "type") String type) throws IOException {
|
@RequestParam(value = "type") String type) throws IOException {
|
||||||
if (ids != null && !ids.equals("")) {
|
String whereStr = buildExportWhereByIdsAndType(ids, type);
|
||||||
String[] id = ids.split(",");
|
try {
|
||||||
String workorderDetailsIds = "";
|
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
||||||
for (String s : id) {
|
this.workorderDetailService.doExportRepair(response, workorderDetails, type);
|
||||||
workorderDetailsIds += "'" + s + "',";
|
} catch (Exception e) {
|
||||||
}
|
e.printStackTrace();
|
||||||
String whereStr = "where id in (" + workorderDetailsIds.substring(0, workorderDetailsIds.length() - 1) + ")";
|
|
||||||
try {
|
|
||||||
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
|
||||||
this.workorderDetailService.doExportRepair(response, workorderDetails, type);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -1292,21 +1285,14 @@ public class WorkorderDetailController {
|
|||||||
@RequestMapping("/doExportRepairJS.do")
|
@RequestMapping("/doExportRepairJS.do")
|
||||||
public ModelAndView doExportRepairJS(HttpServletRequest request,
|
public ModelAndView doExportRepairJS(HttpServletRequest request,
|
||||||
HttpServletResponse response, Model model,
|
HttpServletResponse response, Model model,
|
||||||
@RequestParam(value = "ids") String ids,
|
@RequestParam(value = "ids", required = false) String ids,
|
||||||
@RequestParam(value = "type") String type) throws IOException {
|
@RequestParam(value = "type") String type) throws IOException {
|
||||||
if (ids != null && !ids.equals("")) {
|
String whereStr = buildExportWhereByIdsAndType(ids, type);
|
||||||
String[] id = ids.split(",");
|
try {
|
||||||
String workorderDetailsIds = "";
|
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
||||||
for (String s : id) {
|
this.workorderDetailService.doExportRepairJS(response, workorderDetails, type);
|
||||||
workorderDetailsIds += "'" + s + "',";
|
} catch (Exception e) {
|
||||||
}
|
e.printStackTrace();
|
||||||
String whereStr = "where id in (" + workorderDetailsIds.substring(0, workorderDetailsIds.length() - 1) + ")";
|
|
||||||
try {
|
|
||||||
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
|
||||||
this.workorderDetailService.doExportRepairJS(response, workorderDetails, type);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -1332,26 +1318,47 @@ public class WorkorderDetailController {
|
|||||||
@RequestMapping("/doExportMain.do")
|
@RequestMapping("/doExportMain.do")
|
||||||
public ModelAndView doExportMain(HttpServletRequest request,
|
public ModelAndView doExportMain(HttpServletRequest request,
|
||||||
HttpServletResponse response, Model model,
|
HttpServletResponse response, Model model,
|
||||||
@RequestParam(value = "ids") String ids,
|
@RequestParam(value = "ids", required = false) String ids,
|
||||||
@RequestParam(value = "type") String type) throws IOException {
|
@RequestParam(value = "type") String type) throws IOException {
|
||||||
if (ids != null && !ids.equals("")) {
|
String whereStr = buildExportWhereByIdsAndType(ids, type);
|
||||||
String[] id = ids.split(",");
|
try {
|
||||||
String workorderDetailsIds = "";
|
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
||||||
for (String s : id) {
|
this.workorderDetailService.doExportMain(response, workorderDetails, type);
|
||||||
workorderDetailsIds += "'" + s + "',";
|
} catch (Exception e) {
|
||||||
}
|
e.printStackTrace();
|
||||||
String whereStr = "where id in (" + workorderDetailsIds.substring(0, workorderDetailsIds.length() - 1) + ")";
|
|
||||||
// System.out.println(whereStr);
|
|
||||||
try {
|
|
||||||
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
|
||||||
this.workorderDetailService.doExportMain(response, workorderDetails, type);
|
|
||||||
} catch (Exception e) {
|
|
||||||
e.printStackTrace();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String buildExportWhereByIdsAndType(String ids, String type) {
|
||||||
|
String normalizedIds = normalizeIds(ids);
|
||||||
|
if (!normalizedIds.isEmpty()) {
|
||||||
|
String[] idArr = normalizedIds.split(",");
|
||||||
|
StringBuilder idBuilder = new StringBuilder();
|
||||||
|
for (String item : idArr) {
|
||||||
|
String id = item.trim();
|
||||||
|
if (id.isEmpty()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
if (idBuilder.length() > 0) {
|
||||||
|
idBuilder.append(",");
|
||||||
|
}
|
||||||
|
idBuilder.append("'").append(id).append("'");
|
||||||
|
}
|
||||||
|
if (idBuilder.length() > 0) {
|
||||||
|
return "where id in (" + idBuilder + ")";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "where type = '" + type + "'";
|
||||||
|
}
|
||||||
|
|
||||||
|
private String normalizeIds(String ids) {
|
||||||
|
if (ids == null || ids.trim().isEmpty()) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
return ids.replace("'", "").replace(" ", "").replaceAll(",+$", "");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日历中弹出指定日期的 维修单
|
* 日历中弹出指定日期的 维修单
|
||||||
*
|
*
|
||||||
|
|||||||
@ -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");
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -69,4 +69,4 @@ public class MPointDao extends CommDaoImpl<MPoint>{
|
|||||||
paramMap.put("mpointcode",mpointcode);
|
paramMap.put("mpointcode",mpointcode);
|
||||||
return this.getSqlSession().delete("scada.MPointMapper.updateLalarmmin", paramMap);
|
return this.getSqlSession().delete("scada.MPointMapper.updateLalarmmin", paramMap);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.sipai.entity.sparepart.Sewage;
|
|||||||
import org.springframework.stereotype.Repository;
|
import org.springframework.stereotype.Repository;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Repository
|
@Repository
|
||||||
public class SewageDao extends CommDaoImpl<Sewage> {
|
public class SewageDao extends CommDaoImpl<Sewage> {
|
||||||
@ -16,5 +17,13 @@ public class SewageDao extends CommDaoImpl<Sewage> {
|
|||||||
List<Sewage> list = getSqlSession().selectList(this.getMappernamespace()+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), sewage);
|
List<Sewage> list = getSqlSession().selectList(this.getMappernamespace()+"."+Thread.currentThread().getStackTrace()[1].getMethodName(), sewage);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Integer selectCountByContractNumber(String contractNumber) {
|
||||||
|
return getSqlSession().selectOne(this.getMappernamespace() + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), contractNumber);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Integer selectCountByContractNumberExcludeId(Map<String, String> params) {
|
||||||
|
return getSqlSession().selectOne(this.getMappernamespace() + "." + Thread.currentThread().getStackTrace()[1].getMethodName(), params);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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","工艺调整"),
|
||||||
/*水质化验*/
|
/*水质化验*/
|
||||||
|
|||||||
267
src/main/java/com/sipai/entity/administration/LeaveApply.java
Normal file
267
src/main/java/com/sipai/entity/administration/LeaveApply.java
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -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", "调休"}
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -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";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 运行模块
|
* 运行模块
|
||||||
|
|||||||
@ -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>
|
||||||
@ -312,6 +312,17 @@
|
|||||||
delete from TB_Sewage_Source
|
delete from TB_Sewage_Source
|
||||||
${where}
|
${where}
|
||||||
</delete>
|
</delete>
|
||||||
|
<select id="selectCountByContractNumber" resultType="java.lang.Integer" parameterType="java.lang.String" >
|
||||||
|
select count(1)
|
||||||
|
from TB_Sewage_Source
|
||||||
|
where contract_number = #{contractNumber,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
|
<select id="selectCountByContractNumberExcludeId" resultType="java.lang.Integer" parameterType="java.util.Map" >
|
||||||
|
select count(1)
|
||||||
|
from TB_Sewage_Source
|
||||||
|
where contract_number = #{contractNumber,jdbcType=VARCHAR}
|
||||||
|
and id != #{id,jdbcType=VARCHAR}
|
||||||
|
</select>
|
||||||
<select id="selectDistinctCityByWhere" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
<select id="selectDistinctCityByWhere" resultMap="BaseResultMap" parameterType="java.lang.String" >
|
||||||
select Distinct [city] as [city]
|
select Distinct [city] as [city]
|
||||||
from TB_Sewage_Source
|
from TB_Sewage_Source
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -20,9 +20,12 @@ import org.slf4j.Logger;
|
|||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
import org.springframework.web.context.request.RequestContextHolder;
|
||||||
|
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
@ -377,12 +380,12 @@ public class CommonFileServiceImpl implements CommonFileService {
|
|||||||
try {
|
try {
|
||||||
// 安全获取文件名(自动检测编码)
|
// 安全获取文件名(自动检测编码)
|
||||||
fileName = getSafeFileName(item);
|
fileName = getSafeFileName(item);
|
||||||
|
|
||||||
// 生成MinIO安全的对象名称
|
// 生成MinIO安全的对象名称
|
||||||
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
|
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss");
|
||||||
String timestamp = dateFormat.format(new Date());
|
String timestamp = dateFormat.format(new Date());
|
||||||
filePath = generateMinioObjectName(fileName, timestamp);
|
filePath = generateMinioObjectName(fileName, timestamp);
|
||||||
|
|
||||||
InputStream in = item.getInputStream();
|
InputStream in = item.getInputStream();
|
||||||
String contentType = item.getContentType();
|
String contentType = item.getContentType();
|
||||||
minioTemplate.makeBucket(nameSpace);
|
minioTemplate.makeBucket(nameSpace);
|
||||||
@ -391,7 +394,7 @@ public class CommonFileServiceImpl implements CommonFileService {
|
|||||||
CommonFile commonFile = new CommonFile();
|
CommonFile commonFile = new CommonFile();
|
||||||
commonFile.setId(CommUtil.getUUID());
|
commonFile.setId(CommUtil.getUUID());
|
||||||
commonFile.setMasterid(masterId);
|
commonFile.setMasterid(masterId);
|
||||||
// 20210105 YYJ 用于文件表绑定资料节点用字段 tb_doc_file内和masterId一样
|
// 20210105 YYJ 用于文件表绑定<EFBFBD><EFBFBD>料节点用字段 tb_doc_file内和masterId一样
|
||||||
// commonFile.setPid(masterId);
|
// commonFile.setPid(masterId);
|
||||||
commonFile.setFilename(fileName); // 保存原始文件名用于显示
|
commonFile.setFilename(fileName); // 保存原始文件名用于显示
|
||||||
commonFile.setType(contentType);
|
commonFile.setType(contentType);
|
||||||
@ -400,6 +403,19 @@ public class CommonFileServiceImpl implements CommonFileService {
|
|||||||
commonFile.setAbspath(filePath); // 保存MinIO对象名称
|
commonFile.setAbspath(filePath); // 保存MinIO对象名称
|
||||||
commonFile.setInsdt(CommUtil.nowDate());
|
commonFile.setInsdt(CommUtil.nowDate());
|
||||||
commonFile.setSize((int) item.getSize());
|
commonFile.setSize((int) item.getSize());
|
||||||
|
// 获取当前用户ID并设置
|
||||||
|
try {
|
||||||
|
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
||||||
|
if (attributes != null) {
|
||||||
|
HttpServletRequest request = attributes.getRequest();
|
||||||
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
if (cu != null) {
|
||||||
|
commonFile.setInsuser(cu.getId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.warn("无法获取当前用户信息: {}", e.getMessage());
|
||||||
|
}
|
||||||
res = this.insertByTable(tableName, commonFile);
|
res = this.insertByTable(tableName, commonFile);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Failed to update file to MinIO for masterId: {}", masterId, e);
|
logger.error("Failed to update file to MinIO for masterId: {}", masterId, e);
|
||||||
|
|||||||
@ -67,4 +67,11 @@ public interface RptDayLogService {
|
|||||||
* @return true=有权限, false=无权限
|
* @return true=有权限, false=无权限
|
||||||
*/
|
*/
|
||||||
public abstract boolean checkInputPermission(String rptdeptId, User user);
|
public abstract boolean checkInputPermission(String rptdeptId, User user);
|
||||||
|
|
||||||
|
/** 检查用户是否有生成权限
|
||||||
|
* @param rptdeptId 填报配置id
|
||||||
|
* @param user 当前用户
|
||||||
|
* @return true=有权限, false=无权限
|
||||||
|
*/
|
||||||
|
public abstract boolean checkGeneratePermission(String rptdeptId, User user);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -71,6 +71,14 @@ public interface RptInfoSetService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public abstract String getRptInfoSetIds(String userId, String unitId, String type);
|
public abstract String getRptInfoSetIds(String userId, String unitId, String type);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查用户是否有生成权限
|
||||||
|
* @param rptInfoSetId 报表配置ID
|
||||||
|
* @param user 用户
|
||||||
|
* @return true=有权限, false=无权限
|
||||||
|
*/
|
||||||
|
public abstract boolean checkGeneratePermission(String rptInfoSetId, com.sipai.entity.user.User user);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|||||||
@ -17,6 +17,7 @@ import com.sipai.service.msg.MsgTypeService;
|
|||||||
import com.sipai.service.report.RptDayLogService;
|
import com.sipai.service.report.RptDayLogService;
|
||||||
import com.sipai.service.report.RptDayValSetService;
|
import com.sipai.service.report.RptDayValSetService;
|
||||||
import com.sipai.service.report.RptDeptSetService;
|
import com.sipai.service.report.RptDeptSetService;
|
||||||
|
import com.sipai.service.report.RptInfoSetService;
|
||||||
import com.sipai.service.scada.MPointExpandService;
|
import com.sipai.service.scada.MPointExpandService;
|
||||||
import com.sipai.service.scada.MPointHistoryService;
|
import com.sipai.service.scada.MPointHistoryService;
|
||||||
import com.sipai.service.scada.MPointService;
|
import com.sipai.service.scada.MPointService;
|
||||||
@ -70,6 +71,9 @@ public class RptDayLogServiceImpl implements RptDayLogService {
|
|||||||
@Resource
|
@Resource
|
||||||
private UserJobService userJobService;
|
private UserJobService userJobService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RptInfoSetService rptInfoSetService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RptDayLog selectById(String id) {
|
public RptDayLog selectById(String id) {
|
||||||
RptDayLog rptDayLog =this.rptDayLogDao.selectByPrimaryKey(id);
|
RptDayLog rptDayLog =this.rptDayLogDao.selectByPrimaryKey(id);
|
||||||
@ -946,4 +950,23 @@ public class RptDayLogServiceImpl implements RptDayLogService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkGeneratePermission(String rptdeptId, User user) {
|
||||||
|
if (rptdeptId == null || user == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId);
|
||||||
|
if (rptDeptSet == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String rptInfoSetId = rptDeptSet.getBizId(); // 假设bizId是RptInfoSet的ID
|
||||||
|
if (rptInfoSetId == null || rptInfoSetId.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.rptInfoSetService.checkGeneratePermission(rptInfoSetId, user);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -615,4 +615,49 @@ public class RptInfoSetServiceImpl implements RptInfoSetService {
|
|||||||
}
|
}
|
||||||
return list_result;
|
return list_result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkGeneratePermission(String rptInfoSetId, User user) {
|
||||||
|
if (rptInfoSetId == null || user == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RptInfoSet rptInfoSet = this.selectById(rptInfoSetId);
|
||||||
|
if (rptInfoSet == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String userId = user.getId();
|
||||||
|
String createusers = rptInfoSet.getCreateusers();
|
||||||
|
String generatePosition = rptInfoSet.getGeneratePosition();
|
||||||
|
|
||||||
|
// 检查createusers
|
||||||
|
if (createusers != null && !createusers.isEmpty()) {
|
||||||
|
String[] userIds = createusers.split(",");
|
||||||
|
for (String uid : userIds) {
|
||||||
|
if (userId.equals(uid.trim())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查generatePosition
|
||||||
|
if (generatePosition != null && !generatePosition.isEmpty()) {
|
||||||
|
// 获取当前用户的所有岗位
|
||||||
|
List<UserJob> userJobs = userJobService.selectListByWhere("where userid = '" + userId + "'");
|
||||||
|
if (userJobs != null && !userJobs.isEmpty()) {
|
||||||
|
String[] jobIds = generatePosition.split(",");
|
||||||
|
for (UserJob userJob : userJobs) {
|
||||||
|
String userJobId = userJob.getJobid();
|
||||||
|
for (String jobId : jobIds) {
|
||||||
|
if (userJobId != null && userJobId.equals(jobId.trim())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1474,7 +1474,7 @@ public class MPointService {
|
|||||||
if (DateUtil.isCellDateFormatted(cell)) {
|
if (DateUtil.isCellDateFormatted(cell)) {
|
||||||
//用于转化为日期格式
|
//用于转化为日期格式
|
||||||
Date d = cell.getDateCellValue();
|
Date d = cell.getDateCellValue();
|
||||||
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String cellDate = formater.format(d);
|
String cellDate = formater.format(d);
|
||||||
return cellDate;
|
return cellDate;
|
||||||
} else {
|
} else {
|
||||||
@ -1510,7 +1510,7 @@ public class MPointService {
|
|||||||
if (DateUtil.isCellDateFormatted(cell)) {
|
if (DateUtil.isCellDateFormatted(cell)) {
|
||||||
//用于转化为日期格式
|
//用于转化为日期格式
|
||||||
Date d = cell.getDateCellValue();
|
Date d = cell.getDateCellValue();
|
||||||
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
|
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String cellDate = formater.format(d);
|
String cellDate = formater.format(d);
|
||||||
return cellDate;
|
return cellDate;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@ -26,24 +26,27 @@ import java.io.InputStream;
|
|||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import static org.apache.poi.ss.usermodel.CellType.STRING;
|
import static org.apache.poi.ss.usermodel.CellType.STRING;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class SewageService implements CommService<Sewage>{
|
public class SewageService implements CommService<Sewage> {
|
||||||
@Resource
|
@Resource
|
||||||
private SewageDao SewageDao;
|
private SewageDao SewageDao;
|
||||||
@Resource
|
@Resource
|
||||||
private UnitService unitService;
|
private UnitService unitService;
|
||||||
@Resource
|
@Resource
|
||||||
private CompanyService companyService;
|
private CompanyService companyService;
|
||||||
@Resource
|
@Resource
|
||||||
private ProcessSectionService processSectionService;
|
private ProcessSectionService processSectionService;
|
||||||
@Resource
|
@Resource
|
||||||
private SewageInputService sewageInputService;
|
private SewageInputService sewageInputService;
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private JsywPointService jsywPointService;
|
private JsywPointService jsywPointService;
|
||||||
|
|
||||||
@ -62,84 +65,108 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Sewage selectById(String id) {
|
public Sewage selectById(String id) {
|
||||||
Sewage sewage = SewageDao.selectByPrimaryKey(id);
|
Sewage sewage = SewageDao.selectByPrimaryKey(id);
|
||||||
sewage.setCompany(this.unitService.getCompById(sewage.getUnitId()));
|
sewage.setCompany(this.unitService.getCompById(sewage.getUnitId()));
|
||||||
ProcessSection processSection = this.getProcessSectionByStoredValue(sewage.getProcessSectionId());
|
ProcessSection processSection = this.getProcessSectionByStoredValue(sewage.getProcessSectionId());
|
||||||
if (processSection != null) {
|
if (processSection != null) {
|
||||||
sewage.setProcessSection(processSection);
|
sewage.setProcessSection(processSection);
|
||||||
}
|
}
|
||||||
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere("where sewage_id='"+sewage.getContractNumber()+"' order by insdt");
|
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere("where sewage_id='" + sewage.getContractNumber() + "' order by insdt");
|
||||||
if(sewageInputList!=null && sewageInputList.size()>0){
|
if (sewageInputList != null && sewageInputList.size() > 0) {
|
||||||
sewage.set_input(true);
|
sewage.set_input(true);
|
||||||
}else{
|
} else {
|
||||||
sewage.set_input(false);
|
sewage.set_input(false);
|
||||||
}
|
}
|
||||||
List<JsywPoint> jsywPointList = this.jsywPointService.selectListByWhere("where psname='"+sewage.getName()+"' order by update_date");
|
List<JsywPoint> jsywPointList = this.jsywPointService.selectListByWhere("where psname='" + sewage.getName() + "' order by update_date");
|
||||||
if(jsywPointList!=null && jsywPointList.size()>0){
|
if (jsywPointList != null && jsywPointList.size() > 0) {
|
||||||
sewage.set_point(true);
|
sewage.set_point(true);
|
||||||
}else{
|
} else {
|
||||||
sewage.set_point(false);
|
sewage.set_point(false);
|
||||||
}
|
}
|
||||||
return sewage;
|
return sewage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int deleteById(String id) {
|
|
||||||
return SewageDao.deleteByPrimaryKey(id);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int save(Sewage sewage) {
|
|
||||||
return SewageDao.insert(sewage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public int update(Sewage sewage) {
|
|
||||||
return SewageDao.updateByPrimaryKeySelective(sewage);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Sewage> selectListByWhere(String wherestr) {
|
public int deleteById(String id) {
|
||||||
Sewage sewage = new Sewage();
|
return SewageDao.deleteByPrimaryKey(id);
|
||||||
sewage.setWhere(wherestr);
|
}
|
||||||
List<Sewage> list = SewageDao.selectListByWhere(sewage);
|
|
||||||
for (Sewage item : list) {
|
@Override
|
||||||
item.setCompany(this.unitService.getCompById(item.getUnitId()));
|
public int save(Sewage sewage) {
|
||||||
ProcessSection processSection = this.getProcessSectionByStoredValue(item.getProcessSectionId());
|
return SewageDao.insert(sewage);
|
||||||
if (processSection != null) {
|
}
|
||||||
item.setProcessSection(processSection);
|
|
||||||
}
|
@Override
|
||||||
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere4Pure("where sewage_id='"+item.getContractNumber()+"' order by insdt");
|
public int update(Sewage sewage) {
|
||||||
if(sewageInputList!=null && sewageInputList.size()>0){
|
return SewageDao.updateByPrimaryKeySelective(sewage);
|
||||||
item.set_input(true);
|
}
|
||||||
}else{
|
|
||||||
|
@Override
|
||||||
|
public List<Sewage> selectListByWhere(String wherestr) {
|
||||||
|
Sewage sewage = new Sewage();
|
||||||
|
sewage.setWhere(wherestr);
|
||||||
|
List<Sewage> list = SewageDao.selectListByWhere(sewage);
|
||||||
|
for (Sewage item : list) {
|
||||||
|
item.setCompany(this.unitService.getCompById(item.getUnitId()));
|
||||||
|
ProcessSection processSection = this.getProcessSectionByStoredValue(item.getProcessSectionId());
|
||||||
|
if (processSection != null) {
|
||||||
|
item.setProcessSection(processSection);
|
||||||
|
}
|
||||||
|
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere4Pure("where sewage_id='" + item.getContractNumber() + "' order by insdt");
|
||||||
|
if (sewageInputList != null && sewageInputList.size() > 0) {
|
||||||
|
item.set_input(true);
|
||||||
|
} else {
|
||||||
item.set_input(false);
|
item.set_input(false);
|
||||||
}
|
}
|
||||||
List<JsywPoint> jsywPointList = this.jsywPointService.selectListByWhere("where psname='"+item.getName()+"' order by update_date");
|
List<JsywPoint> jsywPointList = this.jsywPointService.selectListByWhere("where psname='" + item.getName() + "' order by update_date");
|
||||||
if(jsywPointList!=null && jsywPointList.size()>0){
|
if (jsywPointList != null && jsywPointList.size() > 0) {
|
||||||
item.set_point(true);
|
item.set_point(true);
|
||||||
}else{
|
} else {
|
||||||
item.set_point(false);
|
item.set_point(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
@Override
|
|
||||||
public int deleteByWhere(String wherestr) {
|
@Override
|
||||||
Sewage sewage = new Sewage();
|
public int deleteByWhere(String wherestr) {
|
||||||
sewage.setWhere(wherestr);
|
Sewage sewage = new Sewage();
|
||||||
return SewageDao.deleteByWhere(sewage);
|
sewage.setWhere(wherestr);
|
||||||
}
|
return SewageDao.deleteByWhere(sewage);
|
||||||
|
}
|
||||||
|
|
||||||
public List<Sewage> selectDistinctCityByWhere(String wherestr) {
|
public List<Sewage> selectDistinctCityByWhere(String wherestr) {
|
||||||
Sewage sewage = new Sewage();
|
Sewage sewage = new Sewage();
|
||||||
sewage.setWhere(wherestr);
|
sewage.setWhere(wherestr);
|
||||||
List<Sewage> list = SewageDao.selectDistinctCityByWhere(sewage);
|
List<Sewage> list = SewageDao.selectDistinctCityByWhere(sewage);
|
||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean existsByContractNumber(String contractNumber) {
|
||||||
|
if (contractNumber == null || contractNumber.trim().isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
Integer count = SewageDao.selectCountByContractNumber(contractNumber.trim());
|
||||||
|
return count != null && count > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean existsByContractNumberExcludeId(String contractNumber, String id) {
|
||||||
|
if (contractNumber == null || contractNumber.trim().isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if (id == null || id.trim().isEmpty()) {
|
||||||
|
return existsByContractNumber(contractNumber);
|
||||||
|
}
|
||||||
|
Map<String, String> params = new HashMap<String, String>();
|
||||||
|
params.put("contractNumber", contractNumber.trim());
|
||||||
|
params.put("id", id.trim());
|
||||||
|
Integer count = SewageDao.selectCountByContractNumberExcludeId(params);
|
||||||
|
return count != null && count > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* xls文件数据转换
|
* xls文件数据转换
|
||||||
*
|
*
|
||||||
@ -154,24 +181,26 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
return cell.getCellFormula();
|
return cell.getCellFormula();
|
||||||
case NUMERIC:
|
case NUMERIC:
|
||||||
|
|
||||||
//判断是否为日期类型
|
//判断是否为日期类型
|
||||||
if (DateUtil.isCellDateFormatted(cell)) {
|
if (DateUtil.isCellDateFormatted(cell)) {
|
||||||
//用于转化为日期格式
|
//用于转化为日期格式
|
||||||
Date d = cell.getDateCellValue();
|
Date d = cell.getDateCellValue();
|
||||||
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat formater = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
String cellDate = formater.format(d);
|
String cellDate = formater.format(d);
|
||||||
return cellDate;
|
return cellDate;
|
||||||
} else {
|
} else {
|
||||||
cell.setCellType(STRING);
|
cell.setCellType(STRING);
|
||||||
return cell.getStringCellValue();
|
return cell.getStringCellValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
case STRING:
|
case STRING:
|
||||||
return cell.getStringCellValue();
|
return cell.getStringCellValue();
|
||||||
default:
|
default:
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} private String getBizId(String bizName) {
|
}
|
||||||
|
|
||||||
|
private String getBizId(String bizName) {
|
||||||
String bizId = "";
|
String bizId = "";
|
||||||
List<Company> CompanyList = this.companyService.selectListByWhere("where sname = '" + bizName + "' or name = '" + bizName + "' ");
|
List<Company> CompanyList = this.companyService.selectListByWhere("where sname = '" + bizName + "' or name = '" + bizName + "' ");
|
||||||
if (CompanyList != null && CompanyList.size() > 0) {
|
if (CompanyList != null && CompanyList.size() > 0) {
|
||||||
@ -201,20 +230,20 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
int maxCellNum = row.getLastCellNum();//最后一列
|
int maxCellNum = row.getLastCellNum();//最后一列
|
||||||
|
|
||||||
Sewage sewage = new Sewage();
|
Sewage sewage = new Sewage();
|
||||||
|
|
||||||
HSSFCell cell = row.getCell(1);
|
HSSFCell cell = row.getCell(1);
|
||||||
if (getStringVal(cell)==null) {
|
if (getStringVal(cell) == null) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
sewage.setContractNumber(getStringVal(cell));
|
sewage.setContractNumber(getStringVal(cell));
|
||||||
|
|
||||||
cell = row.getCell(2);
|
cell = row.getCell(2);
|
||||||
System.out.println(getStringVal(cell));
|
System.out.println(getStringVal(cell));
|
||||||
sewage.setContractOrder(Integer.parseInt(getStringVal(cell)));
|
sewage.setContractOrder(Integer.parseInt(getStringVal(cell)));
|
||||||
|
|
||||||
cell = row.getCell(3);
|
cell = row.getCell(3);
|
||||||
sewage.setName(getStringVal(cell));
|
sewage.setName(getStringVal(cell));
|
||||||
|
|
||||||
cell = row.getCell(4);
|
cell = row.getCell(4);
|
||||||
sewage.setAddress(getStringVal(cell));
|
sewage.setAddress(getStringVal(cell));
|
||||||
cell = row.getCell(5);
|
cell = row.getCell(5);
|
||||||
@ -224,10 +253,10 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
cell = row.getCell(7);
|
cell = row.getCell(7);
|
||||||
sewage.setPhone(getStringVal(cell));
|
sewage.setPhone(getStringVal(cell));
|
||||||
cell = row.getCell(8);
|
cell = row.getCell(8);
|
||||||
List<ProcessSection> processSectionList = this.processSectionService.selectListByWhere("where name = '"+getStringVal(cell)+"' and unit_id = 'JSBZ'");
|
List<ProcessSection> processSectionList = this.processSectionService.selectListByWhere("where name = '" + getStringVal(cell) + "' and unit_id = 'JSBZ'");
|
||||||
if (processSectionList.size()>0) {
|
if (processSectionList.size() > 0) {
|
||||||
sewage.setProcessSectionId(processSectionList.get(0)==null?"":processSectionList.get(0).getCode());
|
sewage.setProcessSectionId(processSectionList.get(0) == null ? "" : processSectionList.get(0).getCode());
|
||||||
}
|
}
|
||||||
cell = row.getCell(9);
|
cell = row.getCell(9);
|
||||||
sewage.setUnitId(this.getBizId(getStringVal(cell)));
|
sewage.setUnitId(this.getBizId(getStringVal(cell)));
|
||||||
cell = row.getCell(10);
|
cell = row.getCell(10);
|
||||||
@ -241,7 +270,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
cell = row.getCell(14);
|
cell = row.getCell(14);
|
||||||
sewage.setPermit(getStringVal(cell));
|
sewage.setPermit(getStringVal(cell));
|
||||||
cell = row.getCell(15);
|
cell = row.getCell(15);
|
||||||
sewage.setDisplacement(Integer.parseInt((getStringVal(cell)==null?"0":getStringVal(cell))));
|
sewage.setDisplacement(Integer.parseInt((getStringVal(cell) == null ? "0" : getStringVal(cell))));
|
||||||
cell = row.getCell(16);
|
cell = row.getCell(16);
|
||||||
sewage.setStandard(getStringVal(cell));
|
sewage.setStandard(getStringVal(cell));
|
||||||
cell = row.getCell(17);
|
cell = row.getCell(17);
|
||||||
@ -254,30 +283,30 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
sewage.setAttribute(getStringVal(cell));
|
sewage.setAttribute(getStringVal(cell));
|
||||||
cell = row.getCell(27);
|
cell = row.getCell(27);
|
||||||
sewage.setRemark(getStringVal(cell));
|
sewage.setRemark(getStringVal(cell));
|
||||||
|
|
||||||
// sewage.setVentNum(ventNum);
|
// sewage.setVentNum(ventNum);
|
||||||
|
|
||||||
sewage.setId(CommUtil.getUUID());
|
sewage.setId(CommUtil.getUUID());
|
||||||
|
|
||||||
List<Sewage> selectListByWhere = this.selectListByWhere("where contract_number = '"+sewage.getContractNumber()+"'");
|
List<Sewage> selectListByWhere = this.selectListByWhere("where contract_number = '" + sewage.getContractNumber() + "'");
|
||||||
if (selectListByWhere!=null&&selectListByWhere.size()>0) {
|
if (selectListByWhere != null && selectListByWhere.size() > 0) {
|
||||||
sewage.setId(selectListByWhere.get(0).getId());
|
sewage.setId(selectListByWhere.get(0).getId());
|
||||||
|
|
||||||
int result = this.update(sewage);
|
int result = this.update(sewage);
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
sumNum++;
|
sumNum++;
|
||||||
} else {
|
} else {
|
||||||
failNum++;
|
failNum++;
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
|
|
||||||
int result = this.save(sewage);
|
int result = this.save(sewage);
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
sumNum++;
|
sumNum++;
|
||||||
} else {
|
} else {
|
||||||
failNum++;
|
failNum++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -293,8 +322,12 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void outExcelFun(HttpServletResponse response) throws IOException {
|
public void outExcelFun(HttpServletResponse response) throws IOException {
|
||||||
String fileName = "金山排海工程有限公司纳管企业表.xls";
|
outExcelFun(response, null);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void outExcelFun(HttpServletResponse response, String ids) throws IOException {
|
||||||
|
String fileName = "金山卫污水厂纳管企业表.xls";
|
||||||
String title = "纳管企业";
|
String title = "纳管企业";
|
||||||
// 声明一个工作薄
|
// 声明一个工作薄
|
||||||
HSSFWorkbook workbook = new HSSFWorkbook();
|
HSSFWorkbook workbook = new HSSFWorkbook();
|
||||||
@ -372,7 +405,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
|
|
||||||
//产生表格表头
|
//产生表格表头
|
||||||
String excelTitleStr = "序号,合同编号,合同顺序,单位名称,单位地址,合同到期日,联系人,联系电话,*所属泵站,*所属车间,排污许可证编号,雨、污水管平面图,环评报告/登记表/批复,所属行业,排水许可证(编号)复印件/申请表,实际日排量(吨/天),排放标准(排水许可证),管网所有权单位,统一社会信用代码,地址位置(经纬度),接入管网坐标-经度(度),接入管网坐标-经度(分),接入管网坐标-经度(秒),接入管网坐标-纬度(度),接入管网坐标-纬度(分),接入管网坐标-纬度(秒),管网属性(分流/合流),备注";
|
String excelTitleStr = "序号,合同编号,合同顺序,单位名称,单位地址,合同到期日,联系人,联系电话,*所属泵站,*所属车间,排污许可证编号,雨、污水管平面图,环评报告/登记表/批复,所属行业,排水许可证(编号)复印件/申请表,实际日排量(吨/天),排放标准(排水许可证),管网所有权单位,统一社会信用代码,地址位置(经纬度),接入管网坐标-经度(度),接入管网坐标-经度(分),接入管网坐标-经度(秒),接入管网坐标-纬度(度),接入管网坐标-纬度(分),接入管网坐标-纬度(秒),管网属性(分流/合流),备注";
|
||||||
|
|
||||||
String[] excelTitle = excelTitleStr.split(",");
|
String[] excelTitle = excelTitleStr.split(",");
|
||||||
HSSFRow row = sheet.createRow(1);
|
HSSFRow row = sheet.createRow(1);
|
||||||
row.setHeight((short) 800);
|
row.setHeight((short) 800);
|
||||||
@ -418,17 +451,17 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
handRow.setHeight((short) 500);
|
handRow.setHeight((short) 500);
|
||||||
HSSFCell cell = handRow.createCell(0);
|
HSSFCell cell = handRow.createCell(0);
|
||||||
cell.setCellStyle(headStyle);
|
cell.setCellStyle(headStyle);
|
||||||
cell.setCellValue("金山排海工程有限公司纳管企业表");
|
cell.setCellValue("金山卫污水厂纳管企业表");
|
||||||
// 说明
|
// 说明
|
||||||
// HSSFCell smcell = handRow.createCell(5);
|
// HSSFCell smcell = handRow.createCell(5);
|
||||||
// smcell.setCellStyle(tipStyle);
|
// smcell.setCellStyle(tipStyle);
|
||||||
// smcell.setCellValue("注:日期格式(xxxx-xx-xx或xxxx/xx/xx), 班组类型,班组, 班次(根据系统配置名称填写),模式(填写巡检菜单里面的巡检模式) 排版日期,班组类型,班组,班次,模式都为必填项(集控班组可不填模式)。");
|
// smcell.setCellValue("注:日期格式(xxxx-xx-xx或xxxx/xx/xx), 班组类型,班组, 班次(根据系统配置名称填写),模式(填写巡检菜单里面的巡检模式) 排版日期,班组类型,班组,班次,模式都为必填项(集控班组可不填模式)。");
|
||||||
|
|
||||||
List<Sewage> list = this.selectListByWhere("where 1=1 order by contract_order asc");
|
List<Sewage> list = this.selectListByWhere(buildExportWhere(ids));
|
||||||
int n = 1;
|
int n = 1;
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
Sewage sewage = list.get(i);
|
Sewage sewage = list.get(i);
|
||||||
HSSFRow listrow1 = sheet.createRow(i + 2);
|
HSSFRow listrow1 = sheet.createRow(i + 2);
|
||||||
listrow1.setHeight((short) 400);
|
listrow1.setHeight((short) 400);
|
||||||
HSSFCell listcell0 = listrow1.createCell(0);
|
HSSFCell listcell0 = listrow1.createCell(0);
|
||||||
@ -441,7 +474,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
|
|
||||||
HSSFCell listcell2 = listrow1.createCell(2);
|
HSSFCell listcell2 = listrow1.createCell(2);
|
||||||
listcell2.setCellStyle(listStyle);
|
listcell2.setCellStyle(listStyle);
|
||||||
listcell2.setCellValue(sewage.getContractOrder());
|
listcell2.setCellValue(sewage.getContractOrder() == null ? 1 : sewage.getContractOrder());
|
||||||
|
|
||||||
HSSFCell listcell3 = listrow1.createCell(3);
|
HSSFCell listcell3 = listrow1.createCell(3);
|
||||||
listcell3.setCellStyle(listStyle);
|
listcell3.setCellStyle(listStyle);
|
||||||
@ -501,7 +534,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
|
|
||||||
HSSFCell listcell15 = listrow1.createCell(15);
|
HSSFCell listcell15 = listrow1.createCell(15);
|
||||||
listcell15.setCellStyle(listStyle);
|
listcell15.setCellStyle(listStyle);
|
||||||
listcell15.setCellValue((sewage.getDisplacement()==null?0:sewage.getDisplacement()));
|
listcell15.setCellValue((sewage.getDisplacement() == null ? 0 : sewage.getDisplacement()));
|
||||||
|
|
||||||
HSSFCell listcell16 = listrow1.createCell(16);
|
HSSFCell listcell16 = listrow1.createCell(16);
|
||||||
listcell16.setCellStyle(listStyle);
|
listcell16.setCellStyle(listStyle);
|
||||||
@ -572,31 +605,56 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
workbook.close();
|
workbook.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
|
private String buildExportWhere(String ids) {
|
||||||
|
String orderBy = " order by contract_order asc";
|
||||||
|
if (ids == null || ids.trim().isEmpty()) {
|
||||||
|
return "where 1=1" + orderBy;
|
||||||
|
}
|
||||||
|
String[] arr = ids.split(",");
|
||||||
|
List<String> idList = new ArrayList<String>();
|
||||||
|
for (String item : arr) {
|
||||||
|
if (item == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
String id = item.trim();
|
||||||
|
if (!id.isEmpty() && id.matches("[A-Za-z0-9-]+")) {
|
||||||
|
idList.add("'" + id + "'");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (idList.isEmpty()) {
|
||||||
|
return "where 1=1" + orderBy;
|
||||||
|
}
|
||||||
|
String idstr = String.join(",", idList);
|
||||||
|
return "where id in (" + idstr + ")" + orderBy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
* 获取树,三层结构,processSection为根节点,sewage为子节点
|
* 获取树,三层结构,processSection为根节点,sewage为子节点
|
||||||
* @方法名:getTreeList
|
*
|
||||||
* @参数 @param
|
* @方法名:getTreeList
|
||||||
* @参数 @return
|
* @参数 @param
|
||||||
|
* @参数 @return
|
||||||
* @返回类型 String
|
* @返回类型 String
|
||||||
*/
|
*/
|
||||||
public String getTreeList(List<Sewage> list) {
|
public String getTreeList(List<Sewage> list) {
|
||||||
JSONArray list_result = new JSONArray();
|
JSONArray list_result = new JSONArray();
|
||||||
if(list!=null && list.size()>0){
|
if (list != null && list.size() > 0) {
|
||||||
String processSectionId = null;
|
String processSectionId = null;
|
||||||
String unitId = null;
|
String unitId = null;
|
||||||
JSONObject root_childs = new JSONObject();
|
JSONObject root_childs = new JSONObject();
|
||||||
JSONArray root_childlist = new JSONArray();
|
JSONArray root_childlist = new JSONArray();
|
||||||
JSONObject childs = new JSONObject();
|
JSONObject childs = new JSONObject();
|
||||||
JSONArray childlist = new JSONArray();
|
JSONArray childlist = new JSONArray();
|
||||||
for(int i=0;i<list.size();i++){
|
for (int i = 0; i < list.size(); i++) {
|
||||||
Sewage sewage = list.get(i);
|
Sewage sewage = list.get(i);
|
||||||
if(unitId==null || unitId.isEmpty()){
|
if (unitId == null || unitId.isEmpty()) {
|
||||||
unitId = sewage.getUnitId();
|
unitId = sewage.getUnitId();
|
||||||
Company company = sewage.getCompany();
|
Company company = sewage.getCompany();
|
||||||
if(company != null){
|
if (company != null) {
|
||||||
root_childs.put("id", company.getId());
|
root_childs.put("id", company.getId());
|
||||||
root_childs.put("text", company.getName());
|
root_childs.put("text", company.getName());
|
||||||
}else{
|
} else {
|
||||||
root_childs.put("id", unitId);
|
root_childs.put("id", unitId);
|
||||||
//没有关联Company或者unitId不存在
|
//没有关联Company或者unitId不存在
|
||||||
root_childs.put("text", "无区域数据");
|
root_childs.put("text", "无区域数据");
|
||||||
@ -604,8 +662,8 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
root_childs.put("pid", "-1");
|
root_childs.put("pid", "-1");
|
||||||
root_childs.put("type", "unit");
|
root_childs.put("type", "unit");
|
||||||
}
|
}
|
||||||
if(!unitId.equals(sewage.getUnitId())){
|
if (!unitId.equals(sewage.getUnitId())) {
|
||||||
//向当前根节点添加所有子节点
|
//向当前根节点添加所有子节点
|
||||||
childs.put("nodes", childlist);
|
childs.put("nodes", childlist);
|
||||||
root_childlist.add(childs);
|
root_childlist.add(childs);
|
||||||
root_childs.put("nodes", root_childlist);
|
root_childs.put("nodes", root_childlist);
|
||||||
@ -618,10 +676,10 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
//初始设置根节点
|
//初始设置根节点
|
||||||
unitId = sewage.getUnitId();
|
unitId = sewage.getUnitId();
|
||||||
Company company = sewage.getCompany();
|
Company company = sewage.getCompany();
|
||||||
if(company != null){
|
if (company != null) {
|
||||||
root_childs.put("id", company.getId());
|
root_childs.put("id", company.getId());
|
||||||
root_childs.put("text", company.getName());
|
root_childs.put("text", company.getName());
|
||||||
}else{
|
} else {
|
||||||
root_childs.put("id", unitId);
|
root_childs.put("id", unitId);
|
||||||
//没有关联Company或者unitId不存在
|
//没有关联Company或者unitId不存在
|
||||||
root_childs.put("text", "无区域数据");
|
root_childs.put("text", "无区域数据");
|
||||||
@ -631,15 +689,15 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
//初始设置根节点
|
//初始设置根节点
|
||||||
processSectionId = null;
|
processSectionId = null;
|
||||||
}
|
}
|
||||||
if(processSectionId==null || processSectionId.isEmpty()){
|
if (processSectionId == null || processSectionId.isEmpty()) {
|
||||||
//初始设置根节点
|
//初始设置根节点
|
||||||
processSectionId = sewage.getProcessSectionId();
|
processSectionId = sewage.getProcessSectionId();
|
||||||
ProcessSection processSection = sewage.getProcessSection();
|
ProcessSection processSection = sewage.getProcessSection();
|
||||||
if(processSection != null){
|
if (processSection != null) {
|
||||||
childs.put("id", processSection.getCode());
|
childs.put("id", processSection.getCode());
|
||||||
childs.put("text", processSection.getName());
|
childs.put("text", processSection.getName());
|
||||||
}else{
|
} else {
|
||||||
if(processSectionId.isEmpty()){
|
if (processSectionId.isEmpty()) {
|
||||||
processSectionId = "error";
|
processSectionId = "error";
|
||||||
}
|
}
|
||||||
childs.put("id", processSectionId);
|
childs.put("id", processSectionId);
|
||||||
@ -648,9 +706,9 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
}
|
}
|
||||||
childs.put("pid", unitId);
|
childs.put("pid", unitId);
|
||||||
childs.put("type", "processSection");
|
childs.put("type", "processSection");
|
||||||
|
|
||||||
}
|
}
|
||||||
if(processSectionId.equals(sewage.getProcessSectionId())){
|
if (processSectionId.equals(sewage.getProcessSectionId())) {
|
||||||
//设置子节点sewage
|
//设置子节点sewage
|
||||||
JSONObject child = new JSONObject();
|
JSONObject child = new JSONObject();
|
||||||
child.put("id", sewage.getId());
|
child.put("id", sewage.getId());
|
||||||
@ -658,7 +716,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
child.put("pid", processSectionId);
|
child.put("pid", processSectionId);
|
||||||
child.put("type", "sewage");
|
child.put("type", "sewage");
|
||||||
childlist.add(child);
|
childlist.add(child);
|
||||||
}else{
|
} else {
|
||||||
//向当前根节点添加所有子节点
|
//向当前根节点添加所有子节点
|
||||||
childs.put("nodes", childlist);
|
childs.put("nodes", childlist);
|
||||||
root_childlist.add(childs);
|
root_childlist.add(childs);
|
||||||
@ -668,11 +726,11 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
//初始设置根节点
|
//初始设置根节点
|
||||||
processSectionId = sewage.getProcessSectionId();
|
processSectionId = sewage.getProcessSectionId();
|
||||||
ProcessSection processSection = sewage.getProcessSection();
|
ProcessSection processSection = sewage.getProcessSection();
|
||||||
if(processSection != null){
|
if (processSection != null) {
|
||||||
childs.put("id", processSection.getCode());
|
childs.put("id", processSection.getCode());
|
||||||
childs.put("text", processSection.getName());
|
childs.put("text", processSection.getName());
|
||||||
}else{
|
} else {
|
||||||
if(processSectionId.isEmpty()){
|
if (processSectionId.isEmpty()) {
|
||||||
processSectionId = "error";
|
processSectionId = "error";
|
||||||
}
|
}
|
||||||
childs.put("id", processSectionId);
|
childs.put("id", processSectionId);
|
||||||
@ -688,7 +746,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
child.put("type", "sewage");
|
child.put("type", "sewage");
|
||||||
childlist.add(child);
|
childlist.add(child);
|
||||||
}
|
}
|
||||||
if((i+1)==list.size()){
|
if ((i + 1) == list.size()) {
|
||||||
//最后子节点结束时,向当前根节点添加所有子节点
|
//最后子节点结束时,向当前根节点添加所有子节点
|
||||||
childs.put("nodes", childlist);
|
childs.put("nodes", childlist);
|
||||||
root_childlist.add(childs);
|
root_childlist.add(childs);
|
||||||
|
|||||||
@ -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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -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;
|
||||||
|
|||||||
@ -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();
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
138
src/main/resources/diagrams/leave/Administration_Leave.bpmn
Normal file
138
src/main/resources/diagrams/leave/Administration_Leave.bpmn
Normal 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>
|
||||||
@ -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"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,31 +1,29 @@
|
|||||||
{
|
{
|
||||||
"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 "
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
127
src/main/resources/sql/add_leave_apply_module.sql
Normal file
127
src/main/resources/sql/add_leave_apply_module.sql
Normal 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
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
14
src/main/resources/sql/upgrade_leave_apply_audit_man_id.sql
Normal file
14
src/main/resources/sql/upgrade_leave_apply_audit_man_id.sql
Normal 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
|
||||||
BIN
src/main/webapp/IMG/loginbp.png
Normal file
BIN
src/main/webapp/IMG/loginbp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 72 KiB |
@ -204,4 +204,4 @@ function GetLunarDay(solarYear, solarMonth, solarDay) {
|
|||||||
e2c(solarYear, solarMonth, solarDay);
|
e2c(solarYear, solarMonth, solarDay);
|
||||||
return GetcDateString();
|
return GetcDateString();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -116,8 +116,11 @@ var getFileListMinioPic = function (divId, status, entityId, previews, previewCo
|
|||||||
tbName: tbName,
|
tbName: tbName,
|
||||||
bucketName: bucketName
|
bucketName: bucketName
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
|
// 清空数组而不是重新赋值,这样可以保持引用不变
|
||||||
|
previews.length = 0;
|
||||||
|
previewConfigs.length = 0;
|
||||||
|
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
previews = new Array();
|
|
||||||
$('#maintenancefile').show();
|
$('#maintenancefile').show();
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
var previewConfig = new Object();
|
var previewConfig = new Object();
|
||||||
@ -133,10 +136,9 @@ var getFileListMinioPic = function (divId, status, entityId, previews, previewCo
|
|||||||
}
|
}
|
||||||
previewConfigs.push(previewConfig);
|
previewConfigs.push(previewConfig);
|
||||||
}
|
}
|
||||||
showFileInput_new(divId, previews, previewConfigs);
|
|
||||||
} else {
|
|
||||||
$('#' + divId).hide();
|
|
||||||
}
|
}
|
||||||
|
// 无论是否有数据都重新初始化控件
|
||||||
|
showFileInput_new(divId, previews, previewConfigs);
|
||||||
}, 'json');
|
}, 'json');
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -174,7 +174,7 @@
|
|||||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
||||||
sort: params.sort, // 要排序的字段
|
sort: params.sort, // 要排序的字段
|
||||||
order: params.order,
|
order: params.order,
|
||||||
search_name: $('#search_name').val(),
|
// search_name: $('#search_name').val(),
|
||||||
search_code: $('#search_code').val()
|
search_code: $('#search_code').val()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -301,14 +301,14 @@
|
|||||||
<label class="form-label" id="companylabel">公司</label>
|
<label class="form-label" id="companylabel">公司</label>
|
||||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||||
<span class="select2-selection select2-selection--single" id="company" style="width:220px;border: none;background: transparent;" ></span>
|
<span class="select2-selection select2-selection--single" id="company" style="width:220px;border: none;background: transparent;" ></span>
|
||||||
<div class="form-group pull-right" >
|
<!-- <div class="form-group pull-right" >
|
||||||
<div class="input-group input-group-sm" style="width: 250px;">
|
<div class="input-group input-group-sm" style="width: 250px;">
|
||||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="名称">
|
||||||
<div class="input-group-btn">
|
<div class="input-group-btn">
|
||||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div> -->
|
||||||
</div>
|
</div>
|
||||||
<table id="table"></table>
|
<table id="table"></table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -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}'://工艺申请
|
||||||
|
|||||||
200
src/main/webapp/jsp/administration/leaveApplyAdd.jsp
Normal file
200
src/main/webapp/jsp/administration/leaveApplyAdd.jsp
Normal 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>×</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>
|
||||||
94
src/main/webapp/jsp/administration/leaveApplyAudit.jsp
Normal file
94
src/main/webapp/jsp/administration/leaveApplyAudit.jsp
Normal 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>×</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>
|
||||||
195
src/main/webapp/jsp/administration/leaveApplyEdit.jsp
Normal file
195
src/main/webapp/jsp/administration/leaveApplyEdit.jsp
Normal 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>×</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>
|
||||||
24
src/main/webapp/jsp/administration/leaveApplyExecuteView.jsp
Normal file
24
src/main/webapp/jsp/administration/leaveApplyExecuteView.jsp
Normal 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">×</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>
|
||||||
@ -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>
|
||||||
196
src/main/webapp/jsp/administration/leaveApplyHandle.jsp
Normal file
196
src/main/webapp/jsp/administration/leaveApplyHandle.jsp
Normal 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>×</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>
|
||||||
161
src/main/webapp/jsp/administration/leaveApplyList.jsp
Normal file
161
src/main/webapp/jsp/administration/leaveApplyList.jsp
Normal 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>
|
||||||
47
src/main/webapp/jsp/administration/leaveApplyView.jsp
Normal file
47
src/main/webapp/jsp/administration/leaveApplyView.jsp
Normal 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>×</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>
|
||||||
@ -1,9 +1,10 @@
|
|||||||
<%@ page language="java" pageEncoding="UTF-8" %>
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
|
|
||||||
var previews = new Array();
|
// 不重新定义这些变量,直接使用主页面的全局变量
|
||||||
var previewConfigs = new Array();
|
// var previews = new Array();
|
||||||
var filelist = new Array();
|
// var previewConfigs = new Array();
|
||||||
|
// var filelist = new Array();
|
||||||
|
|
||||||
//初始化fileinput控件(第一次初始化)
|
//初始化fileinput控件(第一次初始化)
|
||||||
function initFileInput(ctrlName, uploadUrl) {
|
function initFileInput(ctrlName, uploadUrl) {
|
||||||
@ -55,9 +56,10 @@
|
|||||||
//导入文件上传完成之后的事件
|
//导入文件上传完成之后的事件
|
||||||
control.on("fileuploaded", function (event, data, previewId, index) {
|
control.on("fileuploaded", function (event, data, previewId, index) {
|
||||||
if (data.response.suc) {
|
if (data.response.suc) {
|
||||||
<%--getFileListMinioPic('${param.divId}','edit');--%>
|
// 直接使用主页面的全局变量重新加载文件列表
|
||||||
// getFileListMinioPic('abnormityFileId', 'edit', '', previews, previewConfigs);
|
|
||||||
getFileListMinioPic('${param.divId}', 'edit', '', previews, previewConfigs);
|
getFileListMinioPic('${param.divId}', 'edit', '', previews, previewConfigs);
|
||||||
|
// 关闭上传弹窗,返回主页面
|
||||||
|
closeModal('fileInputModal');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,9 +141,9 @@
|
|||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
var buts = "";
|
var buts = "";
|
||||||
|
|
||||||
buts += '<security:authorize buttonUrl="equipment/location.do">';
|
// buts += '<security:authorize buttonUrl="equipment/location.do">';
|
||||||
buts += '<button class="btn btn-default btn-sm" title="定位" onclick="locationFun(\'' + row.id + '\')"><i class="fa fa-map-marker"></i><span class="hidden-md hidden-lg"> 定位</span></button>';
|
// buts += '<button class="btn btn-default btn-sm" title="定位" onclick="locationFun(\'' + row.id + '\')"><i class="fa fa-map-marker"></i><span class="hidden-md hidden-lg"> 定位</span></button>';
|
||||||
buts += '</security:authorize>';
|
// buts += '</security:authorize>';
|
||||||
|
|
||||||
buts += '<security:authorize buttonUrl="equipment/edit.do">';
|
buts += '<security:authorize buttonUrl="equipment/edit.do">';
|
||||||
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||||
|
|||||||
@ -105,16 +105,15 @@
|
|||||||
masterId: id,
|
masterId: id,
|
||||||
tbName: tbName
|
tbName: tbName
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
//console.info(data)
|
// 清空之前的配置
|
||||||
|
previews = [];
|
||||||
|
previewConfigs = [];
|
||||||
if (data.length > 0) {
|
if (data.length > 0) {
|
||||||
previews = new Array();
|
|
||||||
$('#maintenancefile').show();
|
$('#maintenancefile').show();
|
||||||
for (var i = 0; i < data.length; i++) {
|
for (var i = 0; i < data.length; i++) {
|
||||||
var previewConfig = new Object();
|
var previewConfig = new Object();
|
||||||
var path = data[i].abspath;
|
// 预览地址:添加preview=true参数,让浏览器内嵌显示
|
||||||
path = path.substring(path.indexOf('webapps') + 7, path.length);
|
var path = ext.contextPath + "/report/rptInfoSetFile/downloadFile4minio.do?id=" + data[i].id + "&tbName=" + tbName + "&preview=true";
|
||||||
path = ext.basePath.replace(ext.contextPath, '') + path.replace(/\\/g, "\/");
|
|
||||||
;
|
|
||||||
previews.push(path);
|
previews.push(path);
|
||||||
previewConfig['width'] = '2500px';
|
previewConfig['width'] = '2500px';
|
||||||
previewConfig['caption'] = data[i].filename;
|
previewConfig['caption'] = data[i].filename;
|
||||||
|
|||||||
@ -47,7 +47,7 @@
|
|||||||
$("#subForm").bootstrapValidator('validate');//提交验证
|
$("#subForm").bootstrapValidator('validate');//提交验证
|
||||||
//setTimeout(function(){
|
//setTimeout(function(){
|
||||||
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
if ($("#subForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||||
$.post(ext.contextPath + "/equipment/maintenancePlan/doupdate.do", $("#subForm").serialize(), function(data) {
|
$.post(ext.contextPath + "/maintenance/equipmentPlan/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||||
if (data.res == 1){
|
if (data.res == 1){
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
closeModal("subModal");
|
closeModal("subModal");
|
||||||
@ -70,7 +70,7 @@
|
|||||||
$("#subUnitForm").bootstrapValidator('validate');//提交验证
|
$("#subUnitForm").bootstrapValidator('validate');//提交验证
|
||||||
//setTimeout(function(){
|
//setTimeout(function(){
|
||||||
if ($("#subForm").data('bootstrapValidator').isValid() && $("#subUnitForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
if ($("#subForm").data('bootstrapValidator').isValid() && $("#subUnitForm").data('bootstrapValidator').isValid()) {//获取验证结果,如果成功,执行下面代码
|
||||||
$.post(ext.contextPath + "/equipment/maintenancePlan/doupdate.do", $("#subForm").serialize(), function(data) {
|
$.post(ext.contextPath + "/maintenance/equipmentPlan/doupdate.do", $("#subForm").serialize(), function(data) {
|
||||||
var routeNum = $("#routeNum").val();
|
var routeNum = $("#routeNum").val();
|
||||||
if (data.res == 1){
|
if (data.res == 1){
|
||||||
$.post(ext.contextPath + "/equipment/maintenancePlan/submitAuditAgain.do", $("#subUnitForm").serialize()+"&routeNum="+routeNum, function(unitdata) {
|
$.post(ext.contextPath + "/equipment/maintenancePlan/submitAuditAgain.do", $("#subUnitForm").serialize()+"&routeNum="+routeNum, function(unitdata) {
|
||||||
@ -426,6 +426,43 @@
|
|||||||
</div>
|
</div>
|
||||||
<div id="fileArea"></div>--%>
|
<div id="fileArea"></div>--%>
|
||||||
</form>
|
</form>
|
||||||
|
<!--流程审核退回后显示-->
|
||||||
|
<form class="form-horizontal" id="subUnitForm" enctype="multipart/form-data">
|
||||||
|
<input type="hidden" class="form-control" name="id" value="${businessUnitHandle.id}">
|
||||||
|
<input type="hidden" class="form-control" name="processid" value="${businessUnitHandle.processid}">
|
||||||
|
<input type="hidden" class="form-control" name="taskid" value="${businessUnitHandle.taskid}">
|
||||||
|
<input type="hidden" class="form-control" name="businessid" value="${businessUnitHandle.businessid}">
|
||||||
|
<input type="hidden" class="form-control" name="taskdefinitionkey" value="${businessUnitHandle.taskdefinitionkey}">
|
||||||
|
<input type="hidden" class="form-control" name="unitid" value="${businessUnitHandle.unitid}">
|
||||||
|
<c:if test='${not empty businessUnitAudit.auditopinion}'>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">审核意见:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<textarea class="form-control" id="auditopinion" name="auditopinion" rows="2" placeholder="审核意见">${businessUnitAudit.auditopinion}</textarea>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</c:if>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">*下一节点</label>
|
||||||
|
<div class="col-sm-6">
|
||||||
|
<select class="form-control select2" id="routeNum" name="routeNum" style="width: 270px;">
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div id="selectUsers" class="form-group">
|
||||||
|
<label class="col-sm-2 control-label">提交至:</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
|
<input type="text" class="form-control" id="targetUsersName" name="targetUsersName" placeholder="下一级人员" onclick="showUser4AuditSelectsFun();">
|
||||||
|
<input id="targetusers" name="targetusers" type="hidden" value="${businessUnitHandle.targetusers}"/>
|
||||||
|
<input class="form-control" id="targetjobs" name="targetjobs" type="hidden" value=""/>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- 文件上传,显示 -->
|
||||||
|
<div class="form-group" style="margin:8px">
|
||||||
|
<button type="button" class="btn btn-default btn-file" onclick="fileinput_process()"><i class="fa fa-paperclip"></i>上传文件</button>
|
||||||
|
</div>
|
||||||
|
<div class="file-border" id="fileArea"></div>
|
||||||
|
</form>
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
<h3 class="box-title">关联设备</h3>
|
<h3 class="box-title">关联设备</h3>
|
||||||
|
|||||||
@ -296,7 +296,17 @@
|
|||||||
function exportExcel() {
|
function exportExcel() {
|
||||||
var periodTypeName = $('#periodTypeList').val();
|
var periodTypeName = $('#periodTypeList').val();
|
||||||
var positionType = $('#positionTypeList').val();
|
var positionType = $('#positionTypeList').val();
|
||||||
window.open(ext.contextPath + "/kpi/kpiPlan/export.do?periodTypeName=" + periodTypeName + "&positionType=" + positionType);
|
let checkedItems = $("#table").bootstrapTable('getSelections');
|
||||||
|
let ids = "";
|
||||||
|
$.each(checkedItems, function (index, item) {
|
||||||
|
ids += item.id + ",";
|
||||||
|
});
|
||||||
|
if (ids !== "") {
|
||||||
|
ids = ids.substring(0, ids.length - 1);
|
||||||
|
window.open(ext.contextPath + "/kpi/kpiPlan/export.do?periodTypeName=" + periodTypeName + "&positionType=" + positionType + "&ids=" + encodeURIComponent(ids));
|
||||||
|
} else {
|
||||||
|
window.open(ext.contextPath + "/kpi/kpiPlan/export.do?periodTypeName=" + periodTypeName + "&positionType=" + positionType);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -135,7 +135,7 @@
|
|||||||
//配置logo
|
//配置logo
|
||||||
var array = eval(${jsonArray});
|
var array = eval(${jsonArray});
|
||||||
var verCode = true;
|
var verCode = true;
|
||||||
var bgpath = ["IMG/login/bg1.png"];
|
var bgpath = ["IMG/loginbp.png"];
|
||||||
if(array!=null && array!=undefined && array.length>0){
|
if(array!=null && array!=undefined && array.length>0){
|
||||||
for(var i =0;i<array.length;i++){
|
for(var i =0;i<array.length;i++){
|
||||||
var img = null;
|
var img = null;
|
||||||
@ -325,15 +325,9 @@
|
|||||||
<div class="content" style="height:100%;vertical-align: middle;" id="login-content">
|
<div class="content" style="height:100%;vertical-align: middle;" id="login-content">
|
||||||
<!-- BEGIN 登录 FORM -->
|
<!-- BEGIN 登录 FORM -->
|
||||||
<form class="login-form " id="loginForm">
|
<form class="login-form " id="loginForm">
|
||||||
<div class="logo row">
|
<!-- <div class="logo row">
|
||||||
<img src="IMG/login/title.png" style="width:100%;" alt="" id="login-title" />
|
<img src="IMG/login/title.png" style="width:100%;" alt="" id="login-title" />
|
||||||
<!-- <div class="col-lg-8 col-sm-8 col-md-8 col-xs-8">
|
</div> -->
|
||||||
<h5 style="color:black" class="form-title">西派埃智能</h4>
|
|
||||||
<h2 style="margin:0px">南康智慧水厂运管平台</h2>
|
|
||||||
<h4 style="color:black;margin-top:4px" >精益运行工业互联网平台</h4>
|
|
||||||
|
|
||||||
</div> -->
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div id="alertDiv"></div>
|
<div id="alertDiv"></div>
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
398
src/main/webapp/jsp/main_JS_Company2_init.jsp
Normal file
398
src/main/webapp/jsp/main_JS_Company2_init.jsp
Normal file
@ -0,0 +1,398 @@
|
|||||||
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||||
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||||
|
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||||
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||||
|
|
||||||
|
<%@ page import="com.sipai.entity.base.MainConfig" %>
|
||||||
|
<% request.setAttribute("type_pro", MainConfig.type_pro); %>
|
||||||
|
<% request.setAttribute("type_safe", MainConfig.type_safe); %>
|
||||||
|
<% request.setAttribute("type_eff", MainConfig.type_eff); %>
|
||||||
|
<% request.setAttribute("type_pic", MainConfig.type_pic); %>
|
||||||
|
|
||||||
|
<!DOCTYPE html>
|
||||||
|
|
||||||
|
<head>
|
||||||
|
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||||
|
</title>
|
||||||
|
|
||||||
|
<!-- 引用页头及CSS页-->
|
||||||
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||||
|
<!-- echarts-->
|
||||||
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.4.1.0.min.js"
|
||||||
|
charset="utf-8"></script>
|
||||||
|
|
||||||
|
<script type="text/javascript" src="<%=request.getContextPath()%>/JS/main/main_js.js" charset="utf-8"></script>
|
||||||
|
<style>
|
||||||
|
/*
|
||||||
|
根据不同分辨率显示不同px的文字大小
|
||||||
|
*/
|
||||||
|
@media (min-width: 1080px) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (min-width: 1550px) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
.fontValue {
|
||||||
|
text-align: center;
|
||||||
|
margin-top: 20px;
|
||||||
|
margin-left: 70px;
|
||||||
|
font-size: 20px;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fontText {
|
||||||
|
margin-left: 20px;
|
||||||
|
font-size: 14px;
|
||||||
|
color: #ffffff;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
.carousel-inner,
|
||||||
|
.carousel-inner >.item,
|
||||||
|
.carousel-inner >.item >img{
|
||||||
|
width:100%;height:100%;
|
||||||
|
}
|
||||||
|
.carousel-caption{
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0;
|
||||||
|
background-color: RGBA(55,141,204,0.5);
|
||||||
|
bottom: 10px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<script type="text/javascript">
|
||||||
|
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
firstFun();
|
||||||
|
});
|
||||||
|
|
||||||
|
window.onresize = function () {
|
||||||
|
firstFun();
|
||||||
|
}
|
||||||
|
|
||||||
|
function firstFun() {
|
||||||
|
//var height = document.documentElement.clientHeight;
|
||||||
|
var height = $(window).height();
|
||||||
|
$('#mainDiv').css('height', height);//页面加载先给高度
|
||||||
|
|
||||||
|
$.ajax({
|
||||||
|
type: 'GET',
|
||||||
|
url: ext.contextPath + '/base/mainConfig/getJson.do',
|
||||||
|
async: true,
|
||||||
|
data: {unitId: unitId},
|
||||||
|
globle: false,
|
||||||
|
error: function () {
|
||||||
|
return false;
|
||||||
|
},
|
||||||
|
success: function (data) {
|
||||||
|
var data = eval('(' + data + ')');
|
||||||
|
for (var i = 0; i < data.mpcode.length; i++) {
|
||||||
|
var code = data.mpcode[i].mpointId;
|
||||||
|
var funname = data.mpcode[i].funName;
|
||||||
|
var divid = data.mpcode[i].divId;
|
||||||
|
var testid = data.mpcode[i].testId;
|
||||||
|
var mpointId = data.mpcode[i].mpointId;
|
||||||
|
if (data.mpcode[i].type == '${type_pro}') {//生产
|
||||||
|
eval(funname + "('" + unitId + "','" + code + "','" + divid + "','" + testid + "')")
|
||||||
|
}
|
||||||
|
if (data.mpcode[i].type == '${type_safe}') {//安全
|
||||||
|
eval(funname + "('" + unitId + "','" + code + "','" + divid + "','" + testid + "')")
|
||||||
|
}
|
||||||
|
if (data.mpcode[i].type == '${type_eff}') {//效率
|
||||||
|
eval(funname + "('" + unitId + "','" + code + "','" + divid + "','" + testid + "')")
|
||||||
|
}
|
||||||
|
if (data.mpcode[i].type == '${type_pic}') {//左上角图片
|
||||||
|
//eval(funname + "('" + unitId + "')")
|
||||||
|
getUnitsByUnitId4Select(unitId,funname,mpointId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//安全
|
||||||
|
// echartColumnar2(unitId, 'TH_03_FIT040001D_FLOW_C', 'myChartsafe1');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
//优良差
|
||||||
|
$(".evaluateIcon").attr("src", ext.contextPath + "/IMG/main/evaluate.png");
|
||||||
|
|
||||||
|
//左上角图片
|
||||||
|
// $("#mainImg").attr("src", ext.contextPath + "/IMG/main/main.jpg");
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body>
|
||||||
|
<div id="mainDiv" style="background:#f1f1f1;">
|
||||||
|
|
||||||
|
<div style="float:left;height:100%;width:35%;">
|
||||||
|
<div style="float:left;height:45%;width:100%;padding:5px 5px 5px 5px;">
|
||||||
|
<div style="height:100%;width:100%;background-color:#ffffff;">
|
||||||
|
<%--图片--%>
|
||||||
|
<!-- <img src="" id="mainImg" style="width:100%;height:100%;"> -->
|
||||||
|
<div id="carousel-example-generic" class="carousel slide" data-ride="carousel" style="width:100%;height:100%;">
|
||||||
|
|
||||||
|
<!-- Wrapper for slides -->
|
||||||
|
<div class="carousel-inner" role="listbox" id="carousel-items">
|
||||||
|
</div>
|
||||||
|
<!-- Controls -->
|
||||||
|
<a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
|
||||||
|
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
|
||||||
|
<span class="sr-only">Previous</span>
|
||||||
|
</a>
|
||||||
|
<a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
|
||||||
|
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
|
||||||
|
<span class="sr-only">Next</span>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="float:left;height:55%;width:100%;padding:5px 5px 5px 5px;">
|
||||||
|
<div style="height:100%;width:100%;background-color:#ffffff;">
|
||||||
|
<div style="width:100%;height:5%;float:left;border-bottom:2px solid #67aad7;font-weight: bold;">
|
||||||
|
水量及电耗
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
|
||||||
|
<div style="width:48%;height:45%;float:left;background-color:#378dcc;margin:1%;">
|
||||||
|
<div class="fontValue" id="safe_value_1">-</div>
|
||||||
|
<div class="fontText" id="safe_text_1">-</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:48%;height:45%;float:right;background-color:#67aad7;margin:1%;">
|
||||||
|
<div class="fontValue" id="safe_value_2">-</div>
|
||||||
|
<div class="fontText" id="safe_text_2">-</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="width:48%;height:45%;float:left;background-color:#FACA00;margin:1%;">
|
||||||
|
<div class="fontValue" id="safe_value_3">-</div>
|
||||||
|
<div class="fontText" id="safe_text_3">-</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:48%;height:45%;float:right;background-color:#66D97C;margin:1%;">
|
||||||
|
<div class="fontValue" id="safe_value_4">-</div>
|
||||||
|
<div class="fontText" id="safe_text_4">-</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:55%;float:left;padding: 5px 5px 5px 5px;">
|
||||||
|
<div style="width:100%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:100%;float:left;" id="myChartProduce8"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div style="float:left;height:100%;width:65%;">
|
||||||
|
<div style="float:left;height:50%;width:100%;padding:5px 5px 5px 5px;">
|
||||||
|
<div style="height:100%;width:100%;background-color:#ffffff;">
|
||||||
|
<div style="width:100%;height:5%;float:left;border-bottom:2px solid #67aad7;font-weight: bold;">
|
||||||
|
一车间
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#cbe3f9;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce1_js"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce1_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#badaf8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce2_js"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce2_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#73afd8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce3_js"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce3_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:80%;height:100%;float:left;padding: 5px 10px 30px 10px;">
|
||||||
|
<div style="width:100%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText1_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce1_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText2_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce2_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText3_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce3_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText4_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce4_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText5_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce5_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:4%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText6_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce6_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText7_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce7_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText8_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce8_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText9_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce9_js"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText10_js">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce10_js"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="float:left;height:50%;width:100%;padding:5px 5px 5px 5px;">
|
||||||
|
<div style="height:100%;width:100%;background-color:#ffffff;">
|
||||||
|
<div style="width:100%;height:5%;float:left;border-bottom:2px solid #67aad7;font-weight: bold;">
|
||||||
|
二车间
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:96%;float:left;">
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#cbe3f9;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce1_cs"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce1_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#badaf8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce2_cs"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce2_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:25%;float:left;background-color:#73afd8;margin:6%;">
|
||||||
|
<div class="fontValue" style="color: #0c4377;" id="valueProduce3_cs"></div>
|
||||||
|
<div class="fontText" style="color: #0c4377;" id="textProduce3_cs"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:80%;height:96%;float:left;padding: 5px 10px 30px 10px;">
|
||||||
|
<div style="width:100%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText1_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce1_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText2_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce2_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText3_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce3_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText4_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce4_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText5_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce5_cs"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:4%;float:left;"></div>
|
||||||
|
<div style="width:100%;height:40%;float:left;">
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText6_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce6_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText7_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce7_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText8_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce8_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText9_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce9_cs"></div>
|
||||||
|
</div>
|
||||||
|
<div style="width:20%;height:100%;float:left;">
|
||||||
|
<div style="width:100%;height:20%;padding-top:10%;padding-right:5%;" align="center"
|
||||||
|
id="myChartProduceText10_cs">
|
||||||
|
-
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:80%;" id="myChartProduce10_cs"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div style="width:100%;height:3%;float:left;"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
|
||||||
|
</html>
|
||||||
@ -173,8 +173,8 @@
|
|||||||
return repo.text;
|
return repo.text;
|
||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on('change', function () {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
//工艺段选择后,清空原有工艺段选择的设备
|
//工艺段选择后,清空原有工艺段选择的设备
|
||||||
$("#equipmentIds").val("");
|
$("#equipmentIds").val("");
|
||||||
$("#equipname").val("");
|
$("#equipname").val("");
|
||||||
|
|||||||
@ -159,8 +159,8 @@
|
|||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('${abnormity.processSectionId}').trigger("change");
|
selelct_.val('${abnormity.processSectionId}').trigger("change.select2");
|
||||||
},'json');
|
},'json');
|
||||||
};
|
};
|
||||||
var companyId = "${abnormity.bizId}";
|
var companyId = "${abnormity.bizId}";
|
||||||
$(function(){
|
$(function(){
|
||||||
@ -181,9 +181,9 @@
|
|||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
if(data!=null && data.length>0){
|
if(data!=null && data.length>0){
|
||||||
selelct_.val('${abnormity.processSectionId}').trigger("change");
|
selelct_.val('${abnormity.processSectionId}').trigger("change.select2");
|
||||||
}
|
}
|
||||||
selelct_.on('change',function(){
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
|
||||||
//工艺段选择后,清空原有工艺段选择的设备
|
//工艺段选择后,清空原有工艺段选择的设备
|
||||||
$("#equipmentIds").val("");
|
$("#equipmentIds").val("");
|
||||||
$("#equipname").val("");
|
$("#equipname").val("");
|
||||||
|
|||||||
@ -195,8 +195,8 @@
|
|||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change",function(e){
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(e){
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
},'json');
|
},'json');
|
||||||
|
|||||||
@ -156,8 +156,8 @@
|
|||||||
return repo.text;
|
return repo.text;
|
||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
initAPPFun();
|
initAPPFun();
|
||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
@ -493,8 +493,8 @@
|
|||||||
return repo.text;
|
return repo.text;
|
||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
// dosearch();
|
// dosearch();
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
});
|
});
|
||||||
|
|||||||
@ -170,16 +170,16 @@
|
|||||||
return repo.text;
|
return repo.text;
|
||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
var statusSelect = $("#statusSelect").select2({
|
var statusSelect = $("#statusSelect").select2({
|
||||||
minimumResultsForSearch: 10,
|
minimumResultsForSearch: 10,
|
||||||
placeholder: '请选择',
|
placeholder: '请选择',
|
||||||
}).val('').trigger("change");
|
}).val('').trigger("change.select2");
|
||||||
statusSelect.on("change", function (e) {
|
statusSelect.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
$("#table").bootstrapTable({ // 对应table标签的id
|
$("#table").bootstrapTable({ // 对应table标签的id
|
||||||
|
|||||||
@ -174,8 +174,8 @@
|
|||||||
return repo.text;
|
return repo.text;
|
||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val("").trigger("change");
|
selelct_.val("").trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|||||||
@ -354,7 +354,7 @@
|
|||||||
</div>--%>
|
</div>--%>
|
||||||
|
|
||||||
<div class="form-group" style="margin:8px">
|
<div class="form-group" style="margin:8px">
|
||||||
<button type="button" class="btn btn-default btn-file" onclick="fileinputPic('maintenanceDetailFile')"
|
<button type="button" class="btn btn-default btn-file" onclick="fileinputPic('abnormityFileId')"
|
||||||
id="btn_save"><i
|
id="btn_save"><i
|
||||||
class="fa fa-paperclip"></i>上传图片
|
class="fa fa-paperclip"></i>上传图片
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@ -187,8 +187,8 @@
|
|||||||
return repo.text;
|
return repo.text;
|
||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val("").trigger("change");
|
selelct_.val("").trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|||||||
@ -271,8 +271,8 @@
|
|||||||
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
formatResult: function formatRepo(repo) { return repo.text; }, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val("").trigger("change");
|
selelct_.val("").trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|||||||
@ -78,8 +78,11 @@
|
|||||||
rptdt: time,
|
rptdt: time,
|
||||||
rptdeptId: '${param.rptdeptId}'
|
rptdeptId: '${param.rptdeptId}'
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
$("#rptDiv").html(data);
|
if (data.code > 0) {
|
||||||
openModal('subModal');
|
$("#rptDiv").html(data); openModal('subModal');
|
||||||
|
} else {
|
||||||
|
showAlert('d', '您没有该报表的填报权限', 'mainAlertdiv');
|
||||||
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -160,7 +163,7 @@
|
|||||||
if (data.code > 0) {
|
if (data.code > 0) {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
} else {
|
} else {
|
||||||
showAlert('d', '删除失败', 'mainAlertdiv');
|
showAlert('d', data.msg, 'mainAlertdiv');
|
||||||
}
|
}
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -129,11 +129,17 @@
|
|||||||
};
|
};
|
||||||
var deletesFun = function () {
|
var deletesFun = function () {
|
||||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||||
var datas = "";
|
var ids = [];
|
||||||
|
var staffIds = [];
|
||||||
$.each(checkedItems, function (index, item) {
|
$.each(checkedItems, function (index, item) {
|
||||||
datas += item.id + ",";
|
if (item.id) {
|
||||||
|
ids.push(item.id);
|
||||||
|
} else if (item.staffId) {
|
||||||
|
// 兼容模式:若后续行模型提供备用ID,批删也可工作
|
||||||
|
staffIds.push(item.staffId);
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (datas == "") {
|
if (ids.length === 0 && staffIds.length === 0) {
|
||||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||||
} else {
|
} else {
|
||||||
swal({
|
swal({
|
||||||
@ -157,7 +163,10 @@
|
|||||||
}
|
}
|
||||||
}).then(function (willDelete) {
|
}).then(function (willDelete) {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
$.post(ext.contextPath + '/safety/internalCertificate/deletes.do', {ids: datas}, function (data) {
|
$.post(ext.contextPath + '/safety/internalCertificate/deletes.do', {
|
||||||
|
ids: ids.join(","),
|
||||||
|
staffIds: staffIds.join(",")
|
||||||
|
}, function (data) {
|
||||||
if (data > 0) {
|
if (data > 0) {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
// 初始化 作业类型
|
// 初始化 作业类型
|
||||||
@ -313,17 +322,17 @@
|
|||||||
field: 'jobType', // 返回json数据中的name
|
field: 'jobType', // 返回json数据中的name
|
||||||
title: '作业类型', // 表格表头显示文字
|
title: '作业类型', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle', // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
}, {
|
}, {
|
||||||
field: 'issuingAuthority', // 返回json数据中的name
|
field: 'issuingAuthority', // 返回json数据中的name
|
||||||
title: '发证机构', // 表格表头显示文字
|
title: '发证机构', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle', // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
}, {
|
}, {
|
||||||
field: 'issueDate', // 返回json数据中的name
|
field: 'issueDate', // 返回json数据中的name
|
||||||
title: '领证时间', // 表格表头显示文字
|
title: '领证时间', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle', // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
}, {
|
}, {
|
||||||
field: 'expirationDate', // 返回json数据中的name
|
field: 'expirationDate', // 返回json数据中的name
|
||||||
title: '有效期至', // 表格表头显示文字
|
title: '有效期至', // 表格表头显示文字
|
||||||
|
|||||||
@ -115,7 +115,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
var fileinput = function () {
|
var fileinput = function () {
|
||||||
$('#file').click();
|
$('#file').click();
|
||||||
};
|
};
|
||||||
var filedel = function () {
|
var filedel = function (index) {
|
||||||
fileList.splice(index,1)
|
fileList.splice(index,1)
|
||||||
$('#test').html(initFileInputView())
|
$('#test').html(initFileInputView())
|
||||||
};
|
};
|
||||||
|
|||||||
@ -354,7 +354,9 @@
|
|||||||
var buts= '';
|
var buts= '';
|
||||||
buts+= '<button class="btn btn-default btn-sm" title="瞬时流量" onclick="showLineFun(\'' + (row.ventNum || '') + '\', \'SSLL\')"><i class="fa fa-line-chart"></i></button>';
|
buts+= '<button class="btn btn-default btn-sm" title="瞬时流量" onclick="showLineFun(\'' + (row.ventNum || '') + '\', \'SSLL\')"><i class="fa fa-line-chart"></i></button>';
|
||||||
buts+= '<button class="btn btn-default btn-sm" title="累计流量" onclick="showLineFun(\'' + (row.ventNum || '') + '\', \'LJLL\')"><i class="fa fa-area-chart"></i></button>';
|
buts+= '<button class="btn btn-default btn-sm" title="累计流量" onclick="showLineFun(\'' + (row.ventNum || '') + '\', \'LJLL\')"><i class="fa fa-area-chart"></i></button>';
|
||||||
buts+= '<button class="btn btn-default btn-sm" title="查看点位" onclick="showpointFun(\'' + row.name + '\')"><i class="fa fa-check-square-o"></i></button>';
|
|
||||||
|
// buts+= '<button class="btn btn-default btn-sm" title="查看点位" onclick="showpointFun(\'' + row.name + '\')"><i class="fa fa-check-square-o"></i></button>';
|
||||||
|
|
||||||
buts+= '<security:authorize buttonUrl="sparepart/sewage/edit.do">';
|
buts+= '<security:authorize buttonUrl="sparepart/sewage/edit.do">';
|
||||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||||
buts+= '</security:authorize>';
|
buts+= '</security:authorize>';
|
||||||
@ -398,7 +400,17 @@
|
|||||||
|
|
||||||
//导出
|
//导出
|
||||||
function downloadExcelFun() {
|
function downloadExcelFun() {
|
||||||
window.open(ext.contextPath + "/sparepart/sewage/downloadExcelFun.do");
|
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||||
|
var ids = "";
|
||||||
|
$.each(checkedItems, function(index, item){
|
||||||
|
ids += item.id + ",";
|
||||||
|
});
|
||||||
|
if(ids !== ""){
|
||||||
|
ids = ids.substring(0, ids.length - 1);
|
||||||
|
window.open(ext.contextPath + "/sparepart/sewage/downloadExcelFun.do?ids=" + encodeURIComponent(ids));
|
||||||
|
}else{
|
||||||
|
window.open(ext.contextPath + "/sparepart/sewage/downloadExcelFun.do");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
|
|||||||
@ -20,7 +20,10 @@
|
|||||||
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
src="<%=request.getContextPath()%>/node_modules/bootstrap-switch/dist/js/bootstrap-switch.min.js"
|
||||||
charset="utf-8"></script>
|
charset="utf-8"></script>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var companyId = unitId;
|
var companyId = '';
|
||||||
|
$(function() {
|
||||||
|
companyId = unitId;
|
||||||
|
});
|
||||||
var addFun = function () {
|
var addFun = function () {
|
||||||
$.post(ext.contextPath + '/user/addJob.do', {companyId: companyId}, function (data) {
|
$.post(ext.contextPath + '/user/addJob.do', {companyId: companyId}, function (data) {
|
||||||
$("#subDiv").html(data);
|
$("#subDiv").html(data);
|
||||||
|
|||||||
@ -534,7 +534,7 @@
|
|||||||
<img src="/images/大屏/企业简介.png" style="height:60px;width:420px;"/>
|
<img src="/images/大屏/企业简介.png" style="height:60px;width:420px;"/>
|
||||||
</div>
|
</div>
|
||||||
<div style="float: left;width: 100%;height: 137px;padding-top: 10px;padding-left: 20px;color: #ffffff;line-height: 30px;font-size: 20px;font-weight: 400;letter-spacing:2px;">
|
<div style="float: left;width: 100%;height: 137px;padding-top: 10px;padding-left: 20px;color: #ffffff;line-height: 30px;font-size: 20px;font-weight: 400;letter-spacing:2px;">
|
||||||
上海金山排海工程有限公司成立于1993年,主要承担金山东部地区生活污水和工业废水的收集处理任务,服务范围包括金山东部亭林、张堰、山阳、漕泾四镇及金山工业区、金山新城区、金山卫钱圩地区,服务区域约155平方公里。
|
上海金山卫污水厂成立于1993年,主要承担金山东部地区生活污水和工业废水的收集处理任务,服务范围包括金山东部亭林、张堰、山阳、漕泾四镇及金山工业区、金山新城区、金山卫钱圩地区,服务区域约155平方公里。
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div style='position: absolute;width: 440px;height: 470px;left: 21px;
|
<div style='position: absolute;width: 440px;height: 470px;left: 21px;
|
||||||
|
|||||||
@ -233,12 +233,12 @@ pageEncoding="UTF-8"%>
|
|||||||
class="drawer-nav-icon"
|
class="drawer-nav-icon"
|
||||||
/>企业
|
/>企业
|
||||||
</div>
|
</div>
|
||||||
<div class="drawer-nav-item" onclick="switchTab('tab-pipeline', this)">
|
<!-- <div class="drawer-nav-item" onclick="switchTab('tab-pipeline', this)">
|
||||||
<img
|
<img
|
||||||
src="<%=request.getContextPath()%>/IMG/icon_gd.png"
|
src="<%=request.getContextPath()%>/IMG/icon_gd.png"
|
||||||
class="drawer-nav-icon"
|
class="drawer-nav-icon"
|
||||||
/>管道
|
/>管道
|
||||||
</div>
|
</div> -->
|
||||||
<!-- <div class="drawer-nav-item" onclick="switchTab('tab-well', this)">
|
<!-- <div class="drawer-nav-item" onclick="switchTab('tab-well', this)">
|
||||||
<img
|
<img
|
||||||
src="<%=request.getContextPath()%>/IMG/icon_gj.png"
|
src="<%=request.getContextPath()%>/IMG/icon_gj.png"
|
||||||
@ -548,15 +548,6 @@ pageEncoding="UTF-8"%>
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div style="max-height: 400px; overflow-y: auto" id="company-table-container">
|
<div style="max-height: 400px; overflow-y: auto" id="company-table-container">
|
||||||
<div id="company-loading" style="display: none; text-align: center; padding: 20px;">
|
|
||||||
<i class="glyphicon glyphicon-refresh" style="font-size: 24px; color: #007bff; animation: spin 1s infinite linear;"></i>
|
|
||||||
<p style="margin-top: 10px; color: #666; font-size: 12px">数据加载中...</p>
|
|
||||||
<style>
|
|
||||||
@keyframes spin {
|
|
||||||
100% { transform: rotate(360deg); }
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
</div>
|
|
||||||
<table
|
<table
|
||||||
class="table table-bordered table-hover table-condensed table-custom"
|
class="table table-bordered table-hover table-condensed table-custom"
|
||||||
style="font-size: 12px; white-space: nowrap"
|
style="font-size: 12px; white-space: nowrap"
|
||||||
@ -578,6 +569,10 @@ pageEncoding="UTF-8"%>
|
|||||||
</thead>
|
</thead>
|
||||||
<tbody id="company-table-body"></tbody>
|
<tbody id="company-table-body"></tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<div id="company-loading" style="display: none; text-align: center; padding: 20px;">
|
||||||
|
<i class="glyphicon glyphicon-refresh" style="font-size: 24px; color: #007bff; animation: spin 1s infinite linear;"></i>
|
||||||
|
<p style="margin-top: 10px; color: #666; font-size: 12px">数据加载中...</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -1116,12 +1111,12 @@ pageEncoding="UTF-8"%>
|
|||||||
// 泵站名称到经纬度的映射
|
// 泵站名称到经纬度的映射
|
||||||
lngLatMap: {
|
lngLatMap: {
|
||||||
'卫八路泵站': { lng: 121.277502, lat: 30.720661 },
|
'卫八路泵站': { lng: 121.277502, lat: 30.720661 },
|
||||||
'春华泵站': { lng: 121.287567, lat: 30.727986 },
|
'春华路泵站': { lng: 121.287567, lat: 30.727986 },
|
||||||
'九号泵站': { lng: 121.286513, lat: 30.716669 }
|
'九号泵站': { lng: 121.286513, lat: 30.716669 },
|
||||||
},
|
},
|
||||||
transform: function(item, idx) {
|
transform: function(item, idx) {
|
||||||
var name = item.text || item.name || '';
|
var name = item.text || item.name || '';
|
||||||
var lngLat = this.lngLatMap[name] || { lng: 121.32 + idx * 0.01, lat: 30.76 - idx * 0.005 };
|
var lngLat = this.lngLatMap[name] ? this.lngLatMap[name] : { lng: 121.32 + idx * 0.01, lat: 30.76 - idx * 0.005 };
|
||||||
return {
|
return {
|
||||||
id: item.id || 'pump_' + idx,
|
id: item.id || 'pump_' + idx,
|
||||||
name: name,
|
name: name,
|
||||||
@ -1330,7 +1325,9 @@ pageEncoding="UTF-8"%>
|
|||||||
// 直接返回数组
|
// 直接返回数组
|
||||||
list = res;
|
list = res;
|
||||||
}
|
}
|
||||||
config.data = list.map(config.transform);
|
config.data = list.map(function(item, idx) {
|
||||||
|
return config.transform(item, idx);
|
||||||
|
});
|
||||||
config.loaded = true;
|
config.loaded = true;
|
||||||
console.log('[' + type + '] 加载完成:', config.data.length, '条');
|
console.log('[' + type + '] 加载完成:', config.data.length, '条');
|
||||||
return config.data;
|
return config.data;
|
||||||
@ -1605,7 +1602,7 @@ pageEncoding="UTF-8"%>
|
|||||||
var item = dataConfig.company.data[index];
|
var item = dataConfig.company.data[index];
|
||||||
if (!item || !item.lng || !item.lat) return;
|
if (!item || !item.lng || !item.lat) return;
|
||||||
map.panTo(new T.LngLat(item.lng, item.lat));
|
map.panTo(new T.LngLat(item.lng, item.lat));
|
||||||
map.setZoom(15);
|
map.setZoom(16);
|
||||||
selectMarker(item.name, 'company');
|
selectMarker(item.name, 'company');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -113,7 +113,7 @@ var selectMPint = function(pid) {
|
|||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
if(data!=null && data.length>0){
|
if(data!=null && data.length>0){
|
||||||
selelct_.val(data[0].id).trigger("change");
|
selelct_.val(data[0].id).trigger("change.select2");
|
||||||
}
|
}
|
||||||
},'json');
|
},'json');
|
||||||
}else{
|
}else{
|
||||||
@ -131,8 +131,8 @@ var selectMPint = function(pid) {
|
|||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct.val('').trigger("change");
|
selelct.val('').trigger("change.select2");
|
||||||
selelct.on("change",function(e){
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
|
||||||
var companyId= $(this).val();
|
var companyId= $(this).val();
|
||||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||||
$("#processsectionid").empty();
|
$("#processsectionid").empty();
|
||||||
@ -147,8 +147,8 @@ var selectMPint = function(pid) {
|
|||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
|
selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
|
||||||
},'json');
|
},'json');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},'json');
|
},'json');
|
||||||
|
|||||||
@ -89,8 +89,8 @@ var selectMPint = function(pid) {
|
|||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
|
selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
|
||||||
},'json');
|
},'json');
|
||||||
};
|
};
|
||||||
|
|
||||||
$(function(){
|
$(function(){
|
||||||
@ -116,8 +116,8 @@ var selectMPint = function(pid) {
|
|||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('${kPIPoint.processsectionid}').trigger("change");
|
selelct_.val('${kPIPoint.processsectionid}').trigger("change.select2");
|
||||||
},'json');
|
},'json');
|
||||||
}else{
|
}else{
|
||||||
$("#hidden_bizid").attr("disabled","disabled");
|
$("#hidden_bizid").attr("disabled","disabled");
|
||||||
$("#input_bizid").css("display", "none");
|
$("#input_bizid").css("display", "none");
|
||||||
@ -133,8 +133,8 @@ var selectMPint = function(pid) {
|
|||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct.val('${kPIPoint.bizid}').trigger("change");
|
selelct.val('${kPIPoint.bizid}').trigger("change.select2");
|
||||||
selelct.on("change",function(e){
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
|
||||||
var companyId= $(this).val();
|
var companyId= $(this).val();
|
||||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||||
$("#processsectionid").empty();
|
$("#processsectionid").empty();
|
||||||
@ -149,8 +149,8 @@ var selectMPint = function(pid) {
|
|||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
},'json');
|
},'json');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},'json');
|
},'json');
|
||||||
|
|||||||
@ -1,406 +1,435 @@
|
|||||||
<%@ page language="java" pageEncoding="UTF-8"%>
|
<%@ page language="java" pageEncoding="UTF-8" %>
|
||||||
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
|
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c" %>
|
||||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %>
|
||||||
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
|
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %>
|
||||||
<%@ page import="com.sipai.entity.base.ServerObject"%>
|
<%@ page import="com.sipai.entity.base.ServerObject" %>
|
||||||
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security"%>
|
<%@ taglib uri="http://www.springsecurity.org/jsp" prefix="security" %>
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<!-- <html lang="zh-CN"> -->
|
<!-- <html lang="zh-CN"> -->
|
||||||
<!-- BEGIN HEAD -->
|
<!-- BEGIN HEAD -->
|
||||||
<head>
|
<head>
|
||||||
<title><%= ServerObject.atttable.get("TOPTITLE")%></title>
|
<title><%= ServerObject.atttable.get("TOPTITLE")%>
|
||||||
|
</title>
|
||||||
|
|
||||||
<!-- 引用页头及CSS页-->
|
<!-- 引用页头及CSS页-->
|
||||||
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
<jsp:include page="/jsp/inc.jsp"></jsp:include>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
.select2-container .select2-selection--single{
|
.select2-container .select2-selection--single {
|
||||||
height:34px;
|
height: 34px;
|
||||||
line-height: 34px;
|
line-height: 34px;
|
||||||
}
|
}
|
||||||
.select2-selection__arrow{
|
|
||||||
margin-top:3px;
|
|
||||||
}
|
|
||||||
</style>
|
|
||||||
<script type="text/javascript">
|
|
||||||
var companyId = "";
|
|
||||||
var showMaintenanceList = function(id) {
|
|
||||||
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId:id} , function(data) {
|
|
||||||
$("#subDiv").html(data);
|
|
||||||
openModal('subMaintenanceModal');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var showHandleDetailList = function(id) {
|
|
||||||
stopBubbleDefaultEvent();
|
|
||||||
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId:id} , function(data) {
|
|
||||||
$("#subDiv").html(data);
|
|
||||||
openModal('handleDetailModal');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
var viewEquipmentFun = function(equipmentName,equipmentCardID,id) {
|
|
||||||
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {equipmentName:equipmentName,equipmentCardID:equipmentCardID,id:id} , function(data) {
|
|
||||||
$("#subEquipmentDiv").html(data);
|
|
||||||
openModal('subEquipmentModal');
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
var addFun = function() {
|
.select2-selection__arrow {
|
||||||
$.post(ext.contextPath + '/work/kpipoint/add.do', {} , function(data) {
|
margin-top: 3px;
|
||||||
$("#subDiv").html(data);
|
}
|
||||||
openModal('subModal');
|
</style>
|
||||||
});
|
<script type="text/javascript">
|
||||||
};
|
var companyId = "";
|
||||||
|
var showMaintenanceList = function (id) {
|
||||||
|
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId: id}, function (data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('subMaintenanceModal');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var showHandleDetailList = function (id) {
|
||||||
|
stopBubbleDefaultEvent();
|
||||||
|
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId: id}, function (data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('handleDetailModal');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
var viewEquipmentFun = function (equipmentName, equipmentCardID, id) {
|
||||||
|
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {
|
||||||
|
equipmentName: equipmentName,
|
||||||
|
equipmentCardID: equipmentCardID,
|
||||||
|
id: id
|
||||||
|
}, function (data) {
|
||||||
|
$("#subEquipmentDiv").html(data);
|
||||||
|
openModal('subEquipmentModal');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
var editFun = function(id) {
|
var addFun = function () {
|
||||||
stopBubbleDefaultEvent();
|
$.post(ext.contextPath + '/work/kpipoint/add.do', {}, function (data) {
|
||||||
$.post(ext.contextPath + '/work/kpipoint/edit.do', {id:id} , function(data) {
|
$("#subDiv").html(data);
|
||||||
$("#subDiv").html(data);
|
openModal('subModal');
|
||||||
openModal('subModal');
|
});
|
||||||
});
|
};
|
||||||
};
|
|
||||||
|
|
||||||
var viewFun = function(id){
|
var editFun = function (id) {
|
||||||
$.post(ext.contextPath + '/work/kpipoint/view.do', {id:id} , function(data) {
|
stopBubbleDefaultEvent();
|
||||||
$("#subDiv").html(data);
|
$.post(ext.contextPath + '/work/kpipoint/edit.do', {id: id}, function (data) {
|
||||||
openModal('subModal');
|
$("#subDiv").html(data);
|
||||||
});
|
openModal('subModal');
|
||||||
};
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var viewFun = function (id) {
|
||||||
|
$.post(ext.contextPath + '/work/kpipoint/view.do', {id: id}, function (data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('subModal');
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
|
var deleteFun = function (id) {
|
||||||
|
stopBubbleDefaultEvent();
|
||||||
|
swal({
|
||||||
|
text: "您确定要删除此记录?",
|
||||||
|
dangerMode: true,
|
||||||
|
buttons: {
|
||||||
|
cancel: {
|
||||||
|
text: "取消",
|
||||||
|
value: null,
|
||||||
|
visible: true,
|
||||||
|
className: "btn btn-default btn-sm",
|
||||||
|
closeModal: true,
|
||||||
|
},
|
||||||
|
confirm: {
|
||||||
|
text: "确定",
|
||||||
|
value: true,
|
||||||
|
visible: true,
|
||||||
|
className: "btn btn-danger btn-sm",
|
||||||
|
closeModal: true
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.then(function (willDelete) {
|
||||||
|
if (willDelete) {
|
||||||
|
$.post(ext.contextPath + '/work/kpipoint/delete.do', {id: id}, function (data) {
|
||||||
|
if (data == 1) {
|
||||||
|
$("#table").bootstrapTable('refresh');
|
||||||
|
} else {
|
||||||
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
var deleteFun = function(id) {
|
|
||||||
stopBubbleDefaultEvent();
|
|
||||||
swal({
|
|
||||||
text: "您确定要删除此记录?",
|
|
||||||
dangerMode: true,
|
|
||||||
buttons: {
|
|
||||||
cancel: {
|
|
||||||
text: "取消",
|
|
||||||
value: null,
|
|
||||||
visible: true,
|
|
||||||
className: "btn btn-default btn-sm",
|
|
||||||
closeModal: true,
|
|
||||||
},
|
|
||||||
confirm: {
|
|
||||||
text: "确定",
|
|
||||||
value: true,
|
|
||||||
visible: true,
|
|
||||||
className: "btn btn-danger btn-sm",
|
|
||||||
closeModal: true
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.then(function(willDelete) {
|
|
||||||
if (willDelete) {
|
|
||||||
$.post(ext.contextPath + '/work/kpipoint/delete.do', {id : id}, function(data) {
|
|
||||||
if(data==1){
|
|
||||||
$("#table").bootstrapTable('refresh');
|
|
||||||
}else{
|
|
||||||
showAlert('d','删除失败','mainAlertdiv');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
};
|
||||||
}
|
//删除多条资产类型数据
|
||||||
});
|
var deletesFun = function () {
|
||||||
};
|
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||||
//删除多条资产类型数据
|
var datas = "";
|
||||||
var deletesFun = function() {
|
$.each(checkedItems, function (index, item) {
|
||||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
datas += item.id + ",";
|
||||||
var datas="";
|
});
|
||||||
$.each(checkedItems, function(index, item){
|
if (datas == "") {
|
||||||
datas+=item.id+",";
|
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||||
});
|
} else {
|
||||||
if(datas==""){
|
swal({
|
||||||
showAlert('d','请先选择记录','mainAlertdiv');
|
text: "您确定要删除此记录?",
|
||||||
}else{
|
dangerMode: true,
|
||||||
swal({
|
buttons: {
|
||||||
text: "您确定要删除此记录?",
|
cancel: {
|
||||||
dangerMode: true,
|
text: "取消",
|
||||||
buttons: {
|
value: null,
|
||||||
cancel: {
|
visible: true,
|
||||||
text: "取消",
|
className: "btn btn-default btn-sm",
|
||||||
value: null,
|
closeModal: true,
|
||||||
visible: true,
|
},
|
||||||
className: "btn btn-default btn-sm",
|
confirm: {
|
||||||
closeModal: true,
|
text: "确定",
|
||||||
},
|
value: true,
|
||||||
confirm: {
|
visible: true,
|
||||||
text: "确定",
|
className: "btn btn-danger btn-sm",
|
||||||
value: true,
|
closeModal: true
|
||||||
visible: true,
|
}
|
||||||
className: "btn btn-danger btn-sm",
|
}
|
||||||
closeModal: true
|
})
|
||||||
}
|
.then(function (willDelete) {
|
||||||
}
|
if (willDelete) {
|
||||||
})
|
$.post(ext.contextPath + '/work/kpipoint/deletes.do', {ids: datas}, function (data) {
|
||||||
.then(function(willDelete) {
|
if (data > 0) {
|
||||||
if (willDelete) {
|
$("#table").bootstrapTable('refresh');
|
||||||
$.post(ext.contextPath + '/work/kpipoint/deletes.do', {ids:datas} , function(data) {
|
} else {
|
||||||
if(data>0){
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||||
$("#table").bootstrapTable('refresh');
|
}
|
||||||
}else{
|
});
|
||||||
showAlert('d','删除失败','mainAlertdiv');
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
}
|
};
|
||||||
});
|
var dosearch = function () {
|
||||||
}
|
$("#table").bootstrapTable('refresh');
|
||||||
};
|
};
|
||||||
var dosearch = function() {
|
var loadProcessSectionSelect = function (bizId) {
|
||||||
$("#table").bootstrapTable('refresh');
|
if (!bizId) {
|
||||||
};
|
refreshSelect();
|
||||||
var refreshSelect = function() {
|
return;
|
||||||
var selelct_ =$("#processSection").select2({
|
}
|
||||||
data: null,
|
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: bizId}, function (data) {
|
||||||
placeholder:'请选择',//默认文字提示
|
$("#processSection").empty();
|
||||||
allowClear: true,//允许清空
|
var selelct_ = $("#processSection").select2({
|
||||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
data: data,
|
||||||
language: "zh-CN",
|
cache: false,
|
||||||
minimumInputLength: 0,
|
placeholder: '请选择',
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
allowClear: true,
|
||||||
});
|
escapeMarkup: function (markup) {
|
||||||
$("#processSection").empty();
|
return markup;
|
||||||
// $("#table").bootstrapTable('refresh', {data:null});
|
},
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
language: "zh-CN",
|
||||||
};
|
minimumInputLength: 0,
|
||||||
|
minimumResultsForSearch: 10,
|
||||||
|
formatResult: function formatRepo(repo) {
|
||||||
$(function() {
|
return repo.text;
|
||||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
},
|
||||||
if(data.length == 1){
|
formatSelection: function formatRepoSelection(repo) {
|
||||||
//选择厂区为一个厂时隐藏选择框
|
return repo.text;
|
||||||
$("#search_code").css("display", "none");
|
}
|
||||||
$("#company").text(data[0].text);
|
});
|
||||||
companyId=data[0].id;
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'});
|
||||||
dosearch();
|
// 初始化时仅刷新控件显示,不触发查询
|
||||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
selelct_.val('').trigger("change.select2");
|
||||||
$("#processSection").empty();
|
// 用select2事件触发查询,避免普通change导致选中文本被立即重置
|
||||||
var selelct_ =$("#processSection").select2({
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
|
// 让select2先完成渲染,再执行查询
|
||||||
|
setTimeout(function () {
|
||||||
|
dosearch();
|
||||||
|
}, 0);
|
||||||
|
});
|
||||||
|
}, 'json');
|
||||||
|
};
|
||||||
|
var refreshSelect = function () {
|
||||||
|
var selelct_ = $("#processSection").select2({
|
||||||
|
data: null,
|
||||||
|
placeholder: '请选择',//默认文字提示
|
||||||
|
allowClear: true,//允许清空
|
||||||
|
escapeMarkup: function (markup) {
|
||||||
|
return markup;
|
||||||
|
}, // 自定义格式化防止xss注入
|
||||||
|
language: "zh-CN",
|
||||||
|
minimumInputLength: 0,
|
||||||
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||||
|
});
|
||||||
|
$("#processSection").empty();
|
||||||
|
// $("#table").bootstrapTable('refresh', {data:null});
|
||||||
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
$(function () {
|
||||||
|
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function (data) {
|
||||||
|
if (data.length == 1) {
|
||||||
|
//选择厂区为一个厂时隐藏选择框
|
||||||
|
$("#search_code").css("display", "none");
|
||||||
|
$("#company").text(data[0].text);
|
||||||
|
companyId = data[0].id;
|
||||||
|
loadProcessSectionSelect(companyId);
|
||||||
|
dosearch();
|
||||||
|
} else {
|
||||||
|
// 当前页面可能不展示厂区下拉(search_code被注释),兜底按当前厂区/首个厂区加载工艺段
|
||||||
|
if ($("#search_code").length == 0) {
|
||||||
|
companyId = (typeof unitId !== "undefined" && unitId) ? unitId : data[0].id;
|
||||||
|
loadProcessSectionSelect(companyId);
|
||||||
|
dosearch();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$("#company").css("display", "none");
|
||||||
|
var selelct = $("#search_code").select2({
|
||||||
data: data,
|
data: data,
|
||||||
cache : false,
|
placeholder: '请选择',//默认文字提示
|
||||||
placeholder:'请选择',//默认文字提示
|
|
||||||
allowClear: true,//允许清空
|
allowClear: true,//允许清空
|
||||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
escapeMarkup: function (markup) {
|
||||||
language: "zh-CN",
|
return markup;
|
||||||
|
}, // 自定义格式化防止xss注入
|
||||||
|
language: "zh-CN",
|
||||||
minimumInputLength: 0,
|
minimumInputLength: 0,
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo) {
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
return repo.text;
|
||||||
});
|
}, // 函数用来渲染结果
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
formatSelection: function formatRepoSelection(repo) {
|
||||||
selelct_.val('').trigger("change");
|
return repo.text;
|
||||||
selelct_.on("change",function(e){
|
} // 函数用于呈现当前的选择
|
||||||
dosearch();
|
});
|
||||||
});
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
|
selelct.val('').trigger("change.select2");
|
||||||
},'json');
|
refreshSelect();
|
||||||
}else{
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
$("#company").css("display", "none");
|
companyId = $(this).val();
|
||||||
var selelct=$("#search_code").select2({
|
dosearch();
|
||||||
data : data ,
|
refreshSelect();
|
||||||
placeholder:'请选择',//默认文字提示
|
loadProcessSectionSelect(companyId);
|
||||||
allowClear: true,//允许清空
|
});
|
||||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
|
||||||
language: "zh-CN",
|
|
||||||
minimumInputLength: 0,
|
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|
||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
|
||||||
});
|
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
|
||||||
selelct.val('').trigger("change");
|
|
||||||
refreshSelect();
|
|
||||||
selelct.on("change",function(e){
|
|
||||||
companyId= $(this).val();
|
|
||||||
dosearch();
|
|
||||||
refreshSelect();
|
|
||||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
|
||||||
$("#processSection").empty();
|
|
||||||
var selelct_ =$("#processSection").select2({
|
|
||||||
data: data,
|
|
||||||
cache : false,
|
|
||||||
placeholder:'请选择',//默认文字提示
|
|
||||||
allowClear: true,//允许清空
|
|
||||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
|
||||||
language: "zh-CN",
|
|
||||||
minimumInputLength: 0,
|
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|
||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
|
||||||
});
|
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
|
||||||
selelct_.val('').trigger("change");
|
|
||||||
selelct_.on("change",function(e){
|
|
||||||
dosearch();
|
|
||||||
});
|
|
||||||
},'json');
|
|
||||||
});
|
|
||||||
}
|
|
||||||
},'json');
|
|
||||||
|
|
||||||
$("#table").bootstrapTable({ // 对应table标签的id
|
|
||||||
url: ext.contextPath + '/work/kpipoint/getlist.do', // 获取表格数据的url
|
|
||||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
|
||||||
striped: true, //表格显示条纹,默认为false
|
|
||||||
pagination: true, // 在表格底部显示分页组件,默认false
|
|
||||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
|
||||||
pageSize: 50, // 页面数据条数
|
|
||||||
pageNumber: 1, // 首页页码
|
|
||||||
sidePagination: 'server', // 设置为服务器端分页
|
|
||||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
|
||||||
return {
|
|
||||||
rows: params.limit, // 每页要显示的数据条数
|
|
||||||
page: params.offset/params.limit+1, // 每页显示数据的开始页码
|
|
||||||
sort: params.sort, // 要排序的字段
|
|
||||||
order: params.order,
|
|
||||||
search_name : $('#search_name').val(),
|
|
||||||
companyId: unitId,
|
|
||||||
pSectionId: $("#processSection").val(),
|
|
||||||
}
|
}
|
||||||
},
|
}, 'json');
|
||||||
sortName: 'grade', // 要排序的字段
|
|
||||||
sortOrder: 'asc', // 排序规则
|
$("#table").bootstrapTable({ // 对应table标签的id
|
||||||
onClickRow: function (row) {//单击行事件,执行查看功能
|
url: ext.contextPath + '/work/kpipoint/getlist.do', // 获取表格数据的url
|
||||||
viewFun(row.id);
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||||
},
|
striped: true, //表格显示条纹,默认为false
|
||||||
columns: [
|
pagination: true, // 在表格底部显示分页组件,默认false
|
||||||
{
|
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||||
checkbox: true, // 显示一个勾选框
|
pageSize: 50, // 页面数据条数
|
||||||
},{
|
pageNumber: 1, // 首页页码
|
||||||
field: 'mpointid', // 返回json数据中的name
|
sidePagination: 'server', // 设置为服务器端分页
|
||||||
title: '测量点编号', // 表格表头显示文字
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||||
align: 'center', // 左右居中
|
return {
|
||||||
valign: 'middle' // 上下居中
|
rows: params.limit, // 每页要显示的数据条数
|
||||||
},{
|
page: params.offset / params.limit + 1, // 每页显示数据的开始页码
|
||||||
field: 'mpointname', // 返回json数据中的name
|
sort: params.sort, // 要排序的字段
|
||||||
title: '测量点名称', // 表格表头显示文字
|
order: params.order,
|
||||||
align: 'center', // 左右居中
|
search_name: $('#search_name').val(),
|
||||||
valign: 'middle' // 上下居中
|
companyId: companyId,
|
||||||
},{
|
pSectionId: $("#processSection").val(),
|
||||||
field: 'bizid', // 返回json数据中的name
|
|
||||||
title: '所属厂区', // 表格表头显示文字
|
|
||||||
align: 'center', // 左右居中
|
|
||||||
valign: 'middle' // 上下居中
|
|
||||||
},{
|
|
||||||
field: 'processectionname', // 返回json数据中的name
|
|
||||||
title: '工艺段', // 表格表头显示文字
|
|
||||||
align: 'center', // 左右居中
|
|
||||||
valign: 'middle' // 上下居中
|
|
||||||
},{
|
|
||||||
field: 'grade', // 返回json数据中的name
|
|
||||||
title: '重要等级', // 表格表头显示文字
|
|
||||||
align: 'center', // 左右居中
|
|
||||||
valign: 'middle'
|
|
||||||
},{
|
|
||||||
title: "操作",
|
|
||||||
align: 'center',
|
|
||||||
valign: 'middle',
|
|
||||||
width: 120, // 定义列的宽度,单位为像素px
|
|
||||||
formatter: function (value, row, index) {
|
|
||||||
var buts="";
|
|
||||||
buts+= '<security:authorize buttonUrl="work/scadaPic/edit.do">';
|
|
||||||
buts+= '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
|
||||||
buts+= '</security:authorize>';
|
|
||||||
|
|
||||||
buts+= '<security:authorize buttonUrl="work/scadaPic/delete.do">';
|
|
||||||
buts+='<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\''+row.id+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
|
||||||
buts+= '</security:authorize>';
|
|
||||||
|
|
||||||
buts='<div class="btn-group" >'+buts+'</div>';
|
|
||||||
return buts;
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
sortName: 'grade', // 要排序的字段
|
||||||
|
sortOrder: 'asc', // 排序规则
|
||||||
|
onClickRow: function (row) {//单击行事件,执行查看功能
|
||||||
|
viewFun(row.id);
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
checkbox: true, // 显示一个勾选框
|
||||||
|
}, {
|
||||||
|
field: 'mpointid', // 返回json数据中的name
|
||||||
|
title: '测量点编号', // 表格表头显示文字
|
||||||
|
align: 'center', // 左右居中
|
||||||
|
valign: 'middle' // 上下居中
|
||||||
|
}, {
|
||||||
|
field: 'mpointname', // 返回json数据中的name
|
||||||
|
title: '测量点名称', // 表格表头显示文字
|
||||||
|
align: 'center', // 左右居中
|
||||||
|
valign: 'middle' // 上下居中
|
||||||
|
}, {
|
||||||
|
field: 'bizid', // 返回json数据中的name
|
||||||
|
title: '所属厂区', // 表格表头显示文字
|
||||||
|
align: 'center', // 左右居中
|
||||||
|
valign: 'middle' // 上下居中
|
||||||
|
}, {
|
||||||
|
field: 'processectionname', // 返回json数据中的name
|
||||||
|
title: '工艺段', // 表格表头显示文字
|
||||||
|
align: 'center', // 左右居中
|
||||||
|
valign: 'middle' // 上下居中
|
||||||
|
}, {
|
||||||
|
field: 'grade', // 返回json数据中的name
|
||||||
|
title: '重要等级', // 表格表头显示文字
|
||||||
|
align: 'center', // 左右居中
|
||||||
|
valign: 'middle'
|
||||||
|
}, {
|
||||||
|
title: "操作",
|
||||||
|
align: 'center',
|
||||||
|
valign: 'middle',
|
||||||
|
width: 120, // 定义列的宽度,单位为像素px
|
||||||
|
formatter: function (value, row, index) {
|
||||||
|
var buts = "";
|
||||||
|
buts += '<security:authorize buttonUrl="work/scadaPic/edit.do">';
|
||||||
|
buts += '<button class="btn btn-default btn-sm" title="编辑" onclick="editFun(\'' + row.id + '\')"><i class="fa fa-edit"></i><span class="hidden-md hidden-lg"> 编辑</span></button>';
|
||||||
|
buts += '</security:authorize>';
|
||||||
|
|
||||||
|
buts += '<security:authorize buttonUrl="work/scadaPic/delete.do">';
|
||||||
|
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button';
|
||||||
|
buts += '</security:authorize>';
|
||||||
|
|
||||||
|
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||||
|
return buts;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
onLoadSuccess: function () { //加载成功时执行
|
||||||
|
adjustBootstrapTableView("table");
|
||||||
|
},
|
||||||
|
onLoadError: function () { //加载失败时执行
|
||||||
|
console.info("加载数据失败");
|
||||||
}
|
}
|
||||||
],
|
|
||||||
onLoadSuccess: function(){ //加载成功时执行
|
})
|
||||||
adjustBootstrapTableView("table");
|
|
||||||
},
|
|
||||||
onLoadError: function(){ //加载失败时执行
|
});
|
||||||
console.info("加载数据失败");
|
</script>
|
||||||
}
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</head>
|
</head>
|
||||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||||
<div class="wrapper">
|
<div class="wrapper">
|
||||||
<!-- 引用top -->
|
<!-- 引用top -->
|
||||||
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
<%-- <jsp:include page="/jsp/top.jsp"></jsp:include> --%>
|
||||||
<!-- 菜单栏 -->
|
<!-- 菜单栏 -->
|
||||||
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
<%-- <jsp:include page="/jsp/left.jsp"></jsp:include> --%>
|
||||||
<div class="content-wrapper">
|
<div class="content-wrapper">
|
||||||
<!-- Content Header (Page header) -->
|
<!-- Content Header (Page header) -->
|
||||||
<section class="content-header">
|
<section class="content-header">
|
||||||
<h1 id ="head_title"></h1>
|
<h1 id="head_title"></h1>
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li><a id ='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
<li><a id='head_firstlevel' href="#"><i class="fa fa-dashboard"></i> </a></li>
|
||||||
<!-- <li class="active">Here</li> -->
|
<!-- <li class="active">Here</li> -->
|
||||||
</ol>
|
</ol>
|
||||||
</section>
|
</section>
|
||||||
<!-- Main content -->
|
<!-- Main content -->
|
||||||
<section class="content container-fluid">
|
<section class="content container-fluid">
|
||||||
<div id="mainAlertdiv"></div>
|
<div id="mainAlertdiv"></div>
|
||||||
<div id="subDiv"></div>
|
<div id="subDiv"></div>
|
||||||
<div id="mpSubDiv"></div>
|
<div id="mpSubDiv"></div>
|
||||||
<div >
|
<div>
|
||||||
<!-- <div class="form-group">
|
<!-- <div class="form-group">
|
||||||
<label class="form-label" id="companylabel">水厂:</label>
|
<label class="form-label" id="companylabel">水厂:</label>
|
||||||
<label class="form-label" id="company" style="width:180px;border: none;background: transparent;" ></label>
|
<label class="form-label" id="company" style="width:180px;border: none;background: transparent;" ></label>
|
||||||
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
<select class="form-control select2 " id="search_code" name ="search_code" style="width: 220px;"></select>
|
||||||
</div> -->
|
</div> -->
|
||||||
<div class="form-group form-inline" style="padding:0;">
|
<div class="form-group form-inline" style="padding:0;">
|
||||||
|
<div class="form-group form-inline">
|
||||||
<div class="form-group form-inline">
|
<div class="form-group form-inline">
|
||||||
<div class="form-group form-inline">
|
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
||||||
<div class="btn-group" style="width: 220px;padding-bottom:10px;">
|
<security:authorize buttonUrl="work/scadaPic/add.do">
|
||||||
<security:authorize buttonUrl="work/scadaPic/add.do">
|
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i class="fa fa-plus"></i> 新增</button>
|
class="fa fa-plus"></i> 新增
|
||||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
</button>
|
||||||
</security:authorize>
|
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||||
</div>
|
class="fa fa-trash-o"></i> 删除
|
||||||
</div>
|
</button>
|
||||||
</div>
|
</security:authorize>
|
||||||
<div class="form-group pull-right" >
|
|
||||||
<div class="input-group input-group-sm" style="width: 250px;">
|
|
||||||
<input type="text" id="search_name" name="search_name" class="form-control pull-right" placeholder="编号">
|
|
||||||
<div class="input-group-btn">
|
|
||||||
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i></button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group pull-right">
|
|
||||||
<label class="form-label">工艺段</label>
|
|
||||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 220px;"></select>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group pull-right">
|
||||||
<table id="table"></table>
|
<div class="input-group input-group-sm" style="width: 250px;">
|
||||||
|
<input type="text" id="search_name" name="search_name" class="form-control pull-right"
|
||||||
|
placeholder="编号">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<button class="btn btn-default" onclick="dosearch();"><i class="fa fa-search"></i>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group pull-right">
|
||||||
|
<label class="form-label">工艺段</label>
|
||||||
|
<select class="form-control select2 " id="processSection" name="processSection"
|
||||||
|
style="width: 220px;"></select>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<table id="table"></table>
|
||||||
|
</div>
|
||||||
</section>
|
|
||||||
<!-- /.content -->
|
|
||||||
</div>
|
</section>
|
||||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
<!-- /.content -->
|
||||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
|
||||||
</div>
|
</div>
|
||||||
|
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||||
|
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||||
|
</div>
|
||||||
</body>
|
</body>
|
||||||
<!-- 文件上传-->
|
<!-- 文件上传-->
|
||||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
<link rel="stylesheet" href="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/css/fileinput.min.css"/>
|
||||||
<%-- <script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
<%-- <script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script> --%>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js" charset="utf-8"></script> --%>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc"+"ript>")
|
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/fileinput.min.js\"></sc" + "ript>")
|
||||||
document.write("<scr"+"ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc"+"ript>")
|
document.write("<scr" + "ipt src=\"<%=request.getContextPath()%>/node_modules/bootstrap-fileinput/js/locales/zh.js\"></sc" + "ript>")
|
||||||
</script>
|
</script>
|
||||||
<!-- 引入ChartJS-->
|
<!-- 引入ChartJS-->
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.min.js"
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js" charset="utf-8"></script>
|
charset="utf-8"></script>
|
||||||
|
<script type="text/javascript" src="<%=request.getContextPath()%>/node_modules/chart.js/dist/Chart.bundle.min.js"
|
||||||
|
charset="utf-8"></script>
|
||||||
<!-- 引入daterangepicker-->
|
<!-- 引入daterangepicker-->
|
||||||
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
<link rel="stylesheet" href="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.css"/>
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/moment.min.js"
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js" charset="utf-8"></script>
|
charset="utf-8"></script>
|
||||||
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/bootstrap-daterangepicker/daterangepicker.js"
|
||||||
|
charset="utf-8"></script>
|
||||||
<!-- echarts-->
|
<!-- echarts-->
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/echarts.js" charset="utf-8"></script>
|
||||||
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>
|
<script type="text/javascript" src="<%=request.getContextPath()%>/plugins/echarts/macarons.js" charset="utf-8"></script>
|
||||||
|
|||||||
@ -139,6 +139,34 @@ var companyId = "";
|
|||||||
var dosearch = function() {
|
var dosearch = function() {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
};
|
};
|
||||||
|
var loadProcessSectionSelect = function(companyId) {
|
||||||
|
if (!companyId) {
|
||||||
|
refreshSelect();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
||||||
|
$("#processSection").empty();
|
||||||
|
var selelct_ =$("#processSection").select2({
|
||||||
|
data: data,
|
||||||
|
cache : false,
|
||||||
|
placeholder:'请选择',
|
||||||
|
allowClear: true,
|
||||||
|
escapeMarkup: function (markup) { return markup; },
|
||||||
|
language: "zh-CN",
|
||||||
|
minimumInputLength: 0,
|
||||||
|
minimumResultsForSearch: 10,
|
||||||
|
formatResult: function formatRepo(repo){return repo.text;},
|
||||||
|
formatSelection: function formatRepoSelection(repo){return repo.text;}
|
||||||
|
});
|
||||||
|
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'});
|
||||||
|
selelct_.val('').trigger("change.select2");
|
||||||
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
|
||||||
|
setTimeout(function(){
|
||||||
|
dosearch();
|
||||||
|
},0);
|
||||||
|
});
|
||||||
|
},'json');
|
||||||
|
};
|
||||||
var refreshSelect = function() {
|
var refreshSelect = function() {
|
||||||
var selelct_ =$("#processSection").select2({
|
var selelct_ =$("#processSection").select2({
|
||||||
data: null,
|
data: null,
|
||||||
@ -163,27 +191,7 @@ var companyId = "";
|
|||||||
$("#company").text(data[0].text);
|
$("#company").text(data[0].text);
|
||||||
companyId=data[0].id;
|
companyId=data[0].id;
|
||||||
dosearch();
|
dosearch();
|
||||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
loadProcessSectionSelect(companyId);
|
||||||
$("#processSection").empty();
|
|
||||||
var selelct_ =$("#processSection").select2({
|
|
||||||
data: data,
|
|
||||||
cache : false,
|
|
||||||
placeholder:'请选择',//默认文字提示
|
|
||||||
allowClear: true,//允许清空
|
|
||||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
|
||||||
language: "zh-CN",
|
|
||||||
minimumInputLength: 0,
|
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|
||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
|
||||||
});
|
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
|
||||||
selelct_.val('').trigger("change");
|
|
||||||
selelct_.on("change",function(e){
|
|
||||||
dosearch();
|
|
||||||
});
|
|
||||||
|
|
||||||
},'json');
|
|
||||||
}else{
|
}else{
|
||||||
$("#company").css("display", "none");
|
$("#company").css("display", "none");
|
||||||
var selelct=$("#search_code").select2({
|
var selelct=$("#search_code").select2({
|
||||||
@ -198,33 +206,14 @@ var companyId = "";
|
|||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||||
selelct.val('').trigger("change");
|
selelct.val('').trigger("change.select2");
|
||||||
refreshSelect();
|
refreshSelect();
|
||||||
selelct.on("change",function(e){
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
|
||||||
companyId= $(this).val();
|
companyId= $(this).val();
|
||||||
dosearch();
|
dosearch();
|
||||||
refreshSelect();
|
refreshSelect();
|
||||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
loadProcessSectionSelect(companyId);
|
||||||
$("#processSection").empty();
|
});
|
||||||
var selelct_ =$("#processSection").select2({
|
|
||||||
data: data,
|
|
||||||
cache : false,
|
|
||||||
placeholder:'请选择',//默认文字提示
|
|
||||||
allowClear: true,//允许清空
|
|
||||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
|
||||||
language: "zh-CN",
|
|
||||||
minimumInputLength: 0,
|
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
|
||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
|
||||||
});
|
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
|
||||||
selelct_.val('').trigger("change");
|
|
||||||
selelct_.on("change",function(e){
|
|
||||||
dosearch();
|
|
||||||
});
|
|
||||||
},'json');
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
},'json');
|
},'json');
|
||||||
|
|
||||||
|
|||||||
@ -366,8 +366,8 @@
|
|||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
@ -394,9 +394,8 @@
|
|||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
selelct.val('').trigger("change");
|
selelct.val('').trigger("change.select2");
|
||||||
//refreshSelect();
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
selelct.on("change", function (e) {
|
|
||||||
companyId = $(this).val();
|
companyId = $(this).val();
|
||||||
//dosearch();
|
//dosearch();
|
||||||
//refreshSelect();
|
//refreshSelect();
|
||||||
@ -422,8 +421,8 @@
|
|||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|||||||
@ -325,8 +325,8 @@
|
|||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
@ -353,9 +353,8 @@
|
|||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
selelct.val('').trigger("change");
|
selelct.val('').trigger("change.select2");
|
||||||
//refreshSelect();
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
selelct.on("change", function (e) {
|
|
||||||
companyId = $(this).val();
|
companyId = $(this).val();
|
||||||
//dosearch();
|
//dosearch();
|
||||||
//refreshSelect();
|
//refreshSelect();
|
||||||
@ -381,8 +380,8 @@
|
|||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function (e) {
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
|
|||||||
@ -133,8 +133,8 @@
|
|||||||
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo) { return repo.text; } // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
$(".select2-selection--single").css({ 'height': '30px', 'paddingTop': '4px' })
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -149,8 +149,8 @@
|
|||||||
minimumInputLength: 0,
|
minimumInputLength: 0,
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||||
});
|
});
|
||||||
select.val('').trigger("change");
|
select.val('').trigger("change.select2");
|
||||||
select.on("change", function (e) {
|
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -166,8 +166,8 @@
|
|||||||
minimumInputLength: 0,
|
minimumInputLength: 0,
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||||
});
|
});
|
||||||
select.val("").trigger("change");
|
select.val("").trigger("change.select2");
|
||||||
select.on("change", function (e) {
|
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -196,8 +196,8 @@
|
|||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -181,8 +181,8 @@
|
|||||||
minimumInputLength: 0,
|
minimumInputLength: 0,
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||||
});
|
});
|
||||||
select.val('').trigger("change");
|
select.val('').trigger("change.select2");
|
||||||
select.on("change", function (e) {
|
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -200,8 +200,8 @@
|
|||||||
minimumInputLength: 0,
|
minimumInputLength: 0,
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||||
});
|
});
|
||||||
select.val("").trigger("change");
|
select.val("").trigger("change.select2");
|
||||||
select.on("change", function (e) {
|
select.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -231,8 +231,8 @@
|
|||||||
} // 函数用于呈现当前的选择
|
} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change", function (e) {
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
$("#table").bootstrapTable('refresh', {pageNumber: 1});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -108,7 +108,7 @@
|
|||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
if(data!=null && data.length>0){
|
if(data!=null && data.length>0){
|
||||||
selelct_.val(data[0].id).trigger("change");
|
selelct_.val(data[0].id).trigger("change.select2");
|
||||||
}
|
}
|
||||||
},'json');
|
},'json');
|
||||||
}else{
|
}else{
|
||||||
@ -126,7 +126,7 @@
|
|||||||
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
formatResult: function formatRepo(repo){return repo.text;}, // 函数用来渲染结果
|
||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
selelct.on("change",function(e){
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
|
||||||
companyId= $(this).val();
|
companyId= $(this).val();
|
||||||
//重新选择厂区后清空设备和工艺段数据
|
//重新选择厂区后清空设备和工艺段数据
|
||||||
$("#equipname").val("");
|
$("#equipname").val("");
|
||||||
@ -134,7 +134,7 @@
|
|||||||
$("#processSectionId").val("");
|
$("#processSectionId").val("");
|
||||||
$("#processectionname").val("");
|
$("#processectionname").val("");
|
||||||
});
|
});
|
||||||
selelct.val('').trigger("change");
|
selelct.val('').trigger("change.select2");
|
||||||
}
|
}
|
||||||
},'json');
|
},'json');
|
||||||
|
|
||||||
@ -149,9 +149,9 @@
|
|||||||
.updateStatus('plannedenddt', 'NOT_VALIDATED',null)
|
.updateStatus('plannedenddt', 'NOT_VALIDATED',null)
|
||||||
.validateField('plannedenddt');
|
.validateField('plannedenddt');
|
||||||
});
|
});
|
||||||
$("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change");
|
$("#active").select2({minimumResultsForSearch: 10}).val('${Active_True}').trigger("change.select2");
|
||||||
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val('${INTER_MAINTENANCE}').trigger("change");
|
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val('${INTER_MAINTENANCE}').trigger("change.select2");
|
||||||
});
|
});
|
||||||
//选择设备,根据厂区id选择厂内设备
|
//选择设备,根据厂区id选择厂内设备
|
||||||
var selectEquipmentCard = function() {
|
var selectEquipmentCard = function() {
|
||||||
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:companyId, equipmentId:$("#equipid").val()} , function(data) {
|
$.post(ext.contextPath + '/equipment/showEquipmentCardForSelect.do', {companyId:companyId, equipmentId:$("#equipid").val()} , function(data) {
|
||||||
|
|||||||
@ -101,7 +101,7 @@
|
|||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
if(data!=null && data.length>0){
|
if(data!=null && data.length>0){
|
||||||
selelct_.val(data[0].id).trigger("change");
|
selelct_.val(data[0].id).trigger("change.select2");
|
||||||
}
|
}
|
||||||
},'json');
|
},'json');
|
||||||
}else{
|
}else{
|
||||||
@ -119,7 +119,7 @@
|
|||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
|
|
||||||
selelct.on("change",function(e){
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function(e){
|
||||||
companyId = $(this).val();
|
companyId = $(this).val();
|
||||||
//重新选择厂区后清空设备和工艺段数据
|
//重新选择厂区后清空设备和工艺段数据
|
||||||
if(companyId != "${maintenanceDetail.companyid}"){
|
if(companyId != "${maintenanceDetail.companyid}"){
|
||||||
@ -129,10 +129,10 @@
|
|||||||
$("#processectionname").val("");
|
$("#processectionname").val("");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
selelct.val('${maintenanceDetail.companyid}').trigger("change");
|
selelct.val('${maintenanceDetail.companyid}').trigger("change.select2");
|
||||||
}
|
}
|
||||||
},'json');
|
},'json');
|
||||||
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val("${maintenanceDetail.maintenanceWay}").trigger("change");
|
$("#maintenanceWay").select2({minimumResultsForSearch: 10}).val("${maintenanceDetail.maintenanceWay}").trigger("change.select2");
|
||||||
//选择时间
|
//选择时间
|
||||||
$('#startDate').datepicker({
|
$('#startDate').datepicker({
|
||||||
language: 'zh-CN',
|
language: 'zh-CN',
|
||||||
|
|||||||
@ -133,8 +133,8 @@
|
|||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change",function(e){
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -153,9 +153,9 @@
|
|||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||||
selelct.val('').trigger("change");
|
selelct.val('').trigger("change.select2");
|
||||||
refreshSelect();
|
refreshSelect();
|
||||||
selelct.on("change",function(e){
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear",function(){
|
||||||
companyId= $(this).val();
|
companyId= $(this).val();
|
||||||
dosearch();
|
dosearch();
|
||||||
refreshSelect();
|
refreshSelect();
|
||||||
@ -174,8 +174,8 @@
|
|||||||
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
formatSelection: function formatRepoSelection(repo){return repo.text;} // 函数用于呈现当前的选择
|
||||||
});
|
});
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
||||||
selelct_.val('').trigger("change");
|
selelct_.val('').trigger("change.select2");
|
||||||
selelct_.on("change",function(e){
|
selelct_.off("select2:select select2:clear").on("select2:select select2:clear",function(){
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
});
|
||||||
},'json');
|
},'json');
|
||||||
|
|||||||
@ -418,17 +418,12 @@
|
|||||||
|
|
||||||
var getExs = function () {
|
var getExs = function () {
|
||||||
var datas = selectionIds.toString();
|
var datas = selectionIds.toString();
|
||||||
if (datas === "") {
|
var params = {
|
||||||
showAlert('d', '请选中之后导出', 'mainAlertdiv');
|
responseType: 'blob',
|
||||||
} else {
|
ids: datas,
|
||||||
// window.open(ext.contextPath + "/workorder/workorderDetail/doExportMain.do?ids=" + datas + "&type=maintain");
|
type: 'maintain'
|
||||||
var params = {
|
};
|
||||||
responseType: 'blob',
|
postExcelFile(params, ext.contextPath + '/workorder/workorderDetail/doExportMain.do');
|
||||||
ids: datas,
|
|
||||||
type: 'maintain'
|
|
||||||
};
|
|
||||||
postExcelFile(params, ext.contextPath + '/workorder/workorderDetail/doExportMain.do');
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function postExcelFile(params, url) { //params是post请求需要的参数,url是请求url地址
|
function postExcelFile(params, url) { //params是post请求需要的参数,url是请求url地址
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user