Compare commits
31 Commits
1cd6750710
...
deng-relea
| Author | SHA1 | Date | |
|---|---|---|---|
| 12447a547c | |||
| e5c3849948 | |||
| 8cc0555d1f | |||
| 2ca6153cda | |||
| 6738104534 | |||
| e5da30098f | |||
| 65c2a978b8 | |||
| 80fa5872fd | |||
| 5c576ddfcb | |||
| f89ab0f90d | |||
| 78ec2cbe85 | |||
| 6c08c4fd1b | |||
| 3c9ba8a7f5 | |||
| abdd3b7add | |||
| ebe3148a58 | |||
| 6d5c8bfd65 | |||
| 0c8b530339 | |||
| b9d6a7458f | |||
| 784ac30847 | |||
| b0e2e58d93 | |||
| 785654a510 | |||
| dafda57a0e | |||
| 9cc4d4a988 | |||
| fadbe2b59f | |||
| c11112b066 | |||
| f33f57f6a7 | |||
| c3babf2c4d | |||
| 04610aa678 | |||
| 596b2a68bf | |||
| 5bacfa37d4 | |||
| a5ac9fb038 |
24
pom.xml
24
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>
|
||||||
@ -781,11 +787,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 +802,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>
|
||||||
|
|||||||
@ -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);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -483,6 +483,7 @@ public class ActivitiController {
|
|||||||
String passFlag = request.getParameter("passFlag");
|
String passFlag = request.getParameter("passFlag");
|
||||||
if (passFlag != null && !passFlag.isEmpty()) {
|
if (passFlag != null && !passFlag.isEmpty()) {
|
||||||
boolean pFlag = Boolean.parseBoolean(passFlag);
|
boolean pFlag = Boolean.parseBoolean(passFlag);
|
||||||
|
int totalCount = list.size();
|
||||||
Iterator<WorkTask> iterator = list.iterator();
|
Iterator<WorkTask> iterator = list.iterator();
|
||||||
while (iterator.hasNext()) {
|
while (iterator.hasNext()) {
|
||||||
WorkTask workTask = (WorkTask) iterator.next();
|
WorkTask workTask = (WorkTask) iterator.next();
|
||||||
@ -491,6 +492,11 @@ public class ActivitiController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
// 当过滤后返回空列表,则作为备用方案返回全部路径
|
||||||
|
if (list.isEmpty() && totalCount > 0) {
|
||||||
|
list = workflowProcessDefinitionService.getNextWorkTasks(task.getProcessDefinitionId(), task.getTaskDefinitionKey());
|
||||||
|
}
|
||||||
|
}
|
||||||
JSONArray jsonArray = new JSONArray();
|
JSONArray jsonArray = new JSONArray();
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
for (WorkTask workTask : list) {
|
for (WorkTask workTask : list) {
|
||||||
@ -504,7 +510,6 @@ public class ActivitiController {
|
|||||||
|
|
||||||
}
|
}
|
||||||
model.addAttribute("result", jsonArray.toString());
|
model.addAttribute("result", jsonArray.toString());
|
||||||
}
|
|
||||||
return "result";
|
return "result";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
package com.sipai.controller.administration;
|
package com.sipai.controller.administration;
|
||||||
|
|
||||||
|
import com.sipai.tools.HttpUtil;
|
||||||
|
import com.sipai.tools.DeviceAccessHttpUtil;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
import net.sf.json.JSONObject;
|
import net.sf.json.JSONObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Controller;
|
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;
|
||||||
@ -9,6 +13,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.InputStream;
|
||||||
import java.time.LocalDate;
|
import java.time.LocalDate;
|
||||||
import java.time.format.DateTimeFormatter;
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -17,11 +22,19 @@ import java.util.Comparator;
|
|||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/administration/attendance")
|
@RequestMapping("/administration/attendance")
|
||||||
public class AttendanceController {
|
public class AttendanceController {
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(AttendanceController.class);
|
||||||
private static final DateTimeFormatter DAY_FMT = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
private static final DateTimeFormatter DAY_FMT = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
private static final int DEFAULT_FETCH_DAYS = 30;
|
||||||
|
private static final int DEFAULT_REMOTE_PAGE_SIZE = 200;
|
||||||
|
private static final int MAX_REMOTE_PAGES_PER_DAY = 100;
|
||||||
|
private static final String DEFAULT_API_URL = "http://127.0.0.1:8090/dh-netsdk/attendance/getDailyRecordList";
|
||||||
|
private static final Properties ATTENDANCE_PROPS = loadAttendanceProps();
|
||||||
|
|
||||||
@RequestMapping("/showList.do")
|
@RequestMapping("/showList.do")
|
||||||
public String showList(HttpServletRequest request, Model model) {
|
public String showList(HttpServletRequest request, Model model) {
|
||||||
@ -42,7 +55,8 @@ public class AttendanceController {
|
|||||||
|
|
||||||
LocalDate startDate = parseDay(start);
|
LocalDate startDate = parseDay(start);
|
||||||
LocalDate endDate = parseDay(end);
|
LocalDate endDate = parseDay(end);
|
||||||
List<Map<String, Object>> allRows = buildMockRows();
|
LocalDate[] range = resolveRange(startDate, endDate);
|
||||||
|
List<Map<String, Object>> allRows = loadRowsFromRemote(request, range[0], range[1]);
|
||||||
List<Map<String, Object>> filtered = new ArrayList<Map<String, Object>>();
|
List<Map<String, Object>> filtered = new ArrayList<Map<String, Object>>();
|
||||||
|
|
||||||
for (Map<String, Object> item : allRows) {
|
for (Map<String, Object> item : allRows) {
|
||||||
@ -64,10 +78,10 @@ public class AttendanceController {
|
|||||||
if (!status.isEmpty() && !status.equals(st)) {
|
if (!status.isEmpty() && !status.equals(st)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (startDate != null && day != null && day.isBefore(startDate)) {
|
if (startDate != null && (day == null || day.isBefore(startDate))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (endDate != null && day != null && day.isAfter(endDate)) {
|
if (endDate != null && (day == null || day.isAfter(endDate))) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
filtered.add(item);
|
filtered.add(item);
|
||||||
@ -86,6 +100,239 @@ public class AttendanceController {
|
|||||||
return new ModelAndView("result");
|
return new ModelAndView("result");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private List<Map<String, Object>> loadRowsFromRemote(HttpServletRequest request, LocalDate startDate, LocalDate endDate) {
|
||||||
|
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
|
||||||
|
if (startDate == null || endDate == null) {
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
int pageSize = getIntProp("attendance.api.pageSize", DEFAULT_REMOTE_PAGE_SIZE);
|
||||||
|
String url = getProp("attendance.api.url", DEFAULT_API_URL);
|
||||||
|
Map<String, String> headers = buildDhHeaders(request);
|
||||||
|
|
||||||
|
LocalDate day = startDate;
|
||||||
|
while (!day.isAfter(endDate)) {
|
||||||
|
for (int pageNum = 1; pageNum <= MAX_REMOTE_PAGES_PER_DAY; pageNum++) {
|
||||||
|
com.alibaba.fastjson.JSONObject req = new com.alibaba.fastjson.JSONObject();
|
||||||
|
req.put("day", DAY_FMT.format(day));
|
||||||
|
req.put("pageNum", pageNum);
|
||||||
|
req.put("pageSize", pageSize);
|
||||||
|
|
||||||
|
String respText;
|
||||||
|
try {
|
||||||
|
respText = HttpUtil.sendPost(url, req, headers);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOG.error("Attendance request failed, day={}, pageNum={}", day, pageNum, ex);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
int fetched = appendRowsFromResponse(rows, respText, day, pageNum);
|
||||||
|
if (fetched <= 0 || fetched < pageSize) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
day = day.plusDays(1);
|
||||||
|
}
|
||||||
|
return rows;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int appendRowsFromResponse(List<Map<String, Object>> rows, String respText, LocalDate day, int pageNum) {
|
||||||
|
if (respText == null || respText.trim().isEmpty()) {
|
||||||
|
LOG.warn("Attendance response empty, day={}, pageNum={}", day, pageNum);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
JSONObject resp;
|
||||||
|
try {
|
||||||
|
resp = JSONObject.fromObject(respText);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOG.error("Attendance response parse error, day={}, pageNum={}, body={}", day, pageNum, shorten(respText), ex);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
boolean success = "true".equalsIgnoreCase(String.valueOf(resp.opt("success")));
|
||||||
|
if (!success) {
|
||||||
|
LOG.warn("Attendance response unsuccessful, day={}, pageNum={}, message={}", day, pageNum, resp.optString("message"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
JSONArray data = resp.optJSONArray("data");
|
||||||
|
if (data == null || data.isEmpty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < data.size(); i++) {
|
||||||
|
Object item = data.get(i);
|
||||||
|
JSONObject dto = item instanceof JSONObject ? (JSONObject) item : JSONObject.fromObject(item);
|
||||||
|
rows.add(mapRemoteRecord(dto));
|
||||||
|
}
|
||||||
|
return data.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Map<String, String> buildDhHeaders(HttpServletRequest request) {
|
||||||
|
String ip = getProp("attendance.api.deviceIp", "192.168.1.108");
|
||||||
|
String user = getProp("attendance.api.deviceUser", "admin");
|
||||||
|
String port = getProp("attendance.api.devicePort", "37777");
|
||||||
|
// String ts = safe(request.getParameter("dhTs"));
|
||||||
|
// if (ts.isEmpty()) {
|
||||||
|
// ts = String.valueOf(System.nanoTime());
|
||||||
|
// }
|
||||||
|
String ts = nextUniqueTimestamp();
|
||||||
|
|
||||||
|
String plainPwd = getProp("attendance.api.devicePassword", "");
|
||||||
|
if (plainPwd.isEmpty()) {
|
||||||
|
LOG.warn("attendance.api.devicePassword is empty, DH attendance call may fail auth");
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, String> headers;
|
||||||
|
try {
|
||||||
|
headers = DeviceAccessHttpUtil.buildDeviceHeaders(ip, user, plainPwd, ts, port);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new IllegalStateException("Build DH device headers failed", ex);
|
||||||
|
}
|
||||||
|
headers.put("Content-Type", "application/json");
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Map<String, Object> mapRemoteRecord(JSONObject dto) {
|
||||||
|
String eventTime = dto.optString("eventTime");
|
||||||
|
String attendanceDate = extractDate(eventTime);
|
||||||
|
String checkInTime = extractTime(eventTime);
|
||||||
|
|
||||||
|
Map<String, Object> row = new LinkedHashMap<String, Object>();
|
||||||
|
row.put("id", buildRowId(dto, attendanceDate, checkInTime));
|
||||||
|
row.put("employeeNo", firstNonEmpty(dto.optString("userId"), dto.optString("cardNo")));
|
||||||
|
row.put("employeeName", firstNonEmpty(dto.optString("userName"), dto.optString("userId"), "--"));
|
||||||
|
row.put("deptName", firstNonEmpty(dto.optString("deptName"), "--"));
|
||||||
|
row.put("attendanceDate", attendanceDate);
|
||||||
|
row.put("checkInTime", checkInTime);
|
||||||
|
row.put("checkOutTime", "--");
|
||||||
|
row.put("workHours", "--");
|
||||||
|
row.put("status", resolveStatus(dto));
|
||||||
|
row.put("source", "第三方接口(DH)");
|
||||||
|
|
||||||
|
// Keep raw fields for troubleshooting and later expansion.
|
||||||
|
row.put("cardNo", dto.optString("cardNo"));
|
||||||
|
row.put("channel", dto.optInt("channel"));
|
||||||
|
row.put("openMethod", dto.optInt("openMethod"));
|
||||||
|
row.put("result", dto.optInt("result"));
|
||||||
|
row.put("errCode", dto.optInt("errCode"));
|
||||||
|
row.put("attendanceState", dto.optInt("attendanceState"));
|
||||||
|
row.put("attendanceStateText", dto.optString("attendanceStateText"));
|
||||||
|
return row;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String resolveStatus(JSONObject dto) {
|
||||||
|
String text = safe(dto.optString("attendanceStateText"));
|
||||||
|
if (!text.isEmpty()) {
|
||||||
|
return text;
|
||||||
|
}
|
||||||
|
int state = dto.optInt("attendanceState", -1);
|
||||||
|
if (state == 0) {
|
||||||
|
return "正常";
|
||||||
|
}
|
||||||
|
if (state == 1) {
|
||||||
|
return "迟到";
|
||||||
|
}
|
||||||
|
if (state == 2) {
|
||||||
|
return "早退";
|
||||||
|
}
|
||||||
|
if (state == 3) {
|
||||||
|
return "缺卡";
|
||||||
|
}
|
||||||
|
return "未知";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String buildRowId(JSONObject dto, String date, String time) {
|
||||||
|
String uid = safe(dto.optString("userId"));
|
||||||
|
String idx = String.valueOf(dto.optInt("index", 0));
|
||||||
|
return firstNonEmpty(uid, "U") + "-" + safe(date) + "-" + safe(time) + "-" + idx;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String firstNonEmpty(String... values) {
|
||||||
|
if (values == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
for (String v : values) {
|
||||||
|
if (v != null && !v.trim().isEmpty()) {
|
||||||
|
return v.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String extractDate(String eventTime) {
|
||||||
|
String v = safe(eventTime);
|
||||||
|
if (v.length() >= 10) {
|
||||||
|
return v.substring(0, 10);
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String extractTime(String eventTime) {
|
||||||
|
String v = safe(eventTime);
|
||||||
|
if (v.contains("T") && v.length() >= 19) {
|
||||||
|
return v.substring(11, 19);
|
||||||
|
}
|
||||||
|
int blank = v.indexOf(' ');
|
||||||
|
if (blank >= 0 && v.length() >= blank + 9) {
|
||||||
|
return v.substring(blank + 1, blank + 9);
|
||||||
|
}
|
||||||
|
return v;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static LocalDate[] resolveRange(LocalDate startDate, LocalDate endDate) {
|
||||||
|
LocalDate now = LocalDate.now();
|
||||||
|
LocalDate start = startDate;
|
||||||
|
LocalDate end = endDate;
|
||||||
|
if (start == null && end == null) {
|
||||||
|
// No date filter from UI: fetch only current day.
|
||||||
|
start = now;
|
||||||
|
end = now;
|
||||||
|
} else if (start == null) {
|
||||||
|
// Only end date provided: query that single day.
|
||||||
|
start = end;
|
||||||
|
} else if (end == null) {
|
||||||
|
// Only start date provided: query that single day.
|
||||||
|
end = start;
|
||||||
|
}
|
||||||
|
if (start.isAfter(end)) {
|
||||||
|
LocalDate t = start;
|
||||||
|
start = end;
|
||||||
|
end = t;
|
||||||
|
}
|
||||||
|
return new LocalDate[]{start, end};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Properties loadAttendanceProps() {
|
||||||
|
Properties p = new Properties();
|
||||||
|
try (InputStream in = AttendanceController.class.getClassLoader().getResourceAsStream("thirdRequest.properties")) {
|
||||||
|
if (in != null) {
|
||||||
|
p.load(in);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOG.warn("Load thirdRequest.properties failed", ex);
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getProp(String key, String defaultValue) {
|
||||||
|
String v = ATTENDANCE_PROPS.getProperty(key);
|
||||||
|
return v == null || v.trim().isEmpty() ? defaultValue : v.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int getIntProp(String key, int defaultValue) {
|
||||||
|
String v = getProp(key, String.valueOf(defaultValue));
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(v);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String shorten(String text) {
|
||||||
|
if (text == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String oneLine = text.replace('\n', ' ').replace('\r', ' ');
|
||||||
|
return oneLine.length() > 400 ? oneLine.substring(0, 400) + "..." : oneLine;
|
||||||
|
}
|
||||||
|
|
||||||
private static void sortRows(List<Map<String, Object>> rows, String sort, String order) {
|
private static void sortRows(List<Map<String, Object>> rows, String sort, String order) {
|
||||||
final boolean asc = "asc".equalsIgnoreCase(order);
|
final boolean asc = "asc".equalsIgnoreCase(order);
|
||||||
final String sortField = (sort == null || sort.trim().isEmpty() || "id".equals(sort)) ? "attendanceDate" : sort;
|
final String sortField = (sort == null || sort.trim().isEmpty() || "id".equals(sort)) ? "attendanceDate" : sort;
|
||||||
@ -117,61 +364,6 @@ public class AttendanceController {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<Map<String, Object>> buildMockRows() {
|
|
||||||
String[][] employees = {
|
|
||||||
{"E0001", "张三", "生产部"},
|
|
||||||
{"E0002", "李四", "设备部"},
|
|
||||||
{"E0003", "王五", "品控部"},
|
|
||||||
{"E0004", "赵六", "仓储部"},
|
|
||||||
{"E0005", "钱七", "行政部"}
|
|
||||||
};
|
|
||||||
|
|
||||||
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
|
|
||||||
LocalDate today = LocalDate.now();
|
|
||||||
int idSeq = 1;
|
|
||||||
|
|
||||||
for (int d = 0; d < 45; d++) {
|
|
||||||
LocalDate day = today.minusDays(d);
|
|
||||||
String dayStr = DAY_FMT.format(day);
|
|
||||||
for (int i = 0; i < employees.length; i++) {
|
|
||||||
String[] emp = employees[i];
|
|
||||||
int flag = d + i;
|
|
||||||
|
|
||||||
String status = "正常";
|
|
||||||
String checkIn = "08:55";
|
|
||||||
String checkOut = "18:05";
|
|
||||||
String workHours = "8.5";
|
|
||||||
|
|
||||||
if (flag % 19 == 0) {
|
|
||||||
status = "缺卡";
|
|
||||||
checkOut = "--";
|
|
||||||
workHours = "4.2";
|
|
||||||
} else if (flag % 11 == 0) {
|
|
||||||
status = "迟到";
|
|
||||||
checkIn = "09:" + (10 + (flag % 20));
|
|
||||||
workHours = "7.8";
|
|
||||||
} else if (flag % 13 == 0) {
|
|
||||||
status = "早退";
|
|
||||||
checkOut = "17:" + (20 + (flag % 30));
|
|
||||||
workHours = "7.1";
|
|
||||||
}
|
|
||||||
|
|
||||||
Map<String, Object> row = new LinkedHashMap<String, Object>();
|
|
||||||
row.put("id", "mock-" + idSeq++);
|
|
||||||
row.put("employeeNo", emp[0]);
|
|
||||||
row.put("employeeName", emp[1]);
|
|
||||||
row.put("deptName", emp[2]);
|
|
||||||
row.put("attendanceDate", dayStr);
|
|
||||||
row.put("checkInTime", checkIn);
|
|
||||||
row.put("checkOutTime", checkOut);
|
|
||||||
row.put("workHours", workHours);
|
|
||||||
row.put("status", status);
|
|
||||||
row.put("source", "第三方接口(MOCK)");
|
|
||||||
rows.add(row);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return rows;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static String safe(String s) {
|
private static String safe(String s) {
|
||||||
return s == null ? "" : s.trim();
|
return s == null ? "" : s.trim();
|
||||||
@ -191,4 +383,17 @@ public class AttendanceController {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final AtomicLong TS_SEQ = new AtomicLong();
|
||||||
|
|
||||||
|
private static String nextUniqueTimestamp() {
|
||||||
|
long now = System.nanoTime();
|
||||||
|
while (true) {
|
||||||
|
long prev = TS_SEQ.get();
|
||||||
|
long next = now > prev ? now : prev + 1;
|
||||||
|
if (TS_SEQ.compareAndSet(prev, next)) {
|
||||||
|
return String.valueOf(next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -369,7 +369,9 @@ public class AlarmPointController {
|
|||||||
this.mPointService.updateLalarmmin(alarmPoint.getUnitId(), mPoint.getMpointcode());
|
this.mPointService.updateLalarmmin(alarmPoint.getUnitId(), mPoint.getMpointcode());
|
||||||
// mPoint.setLalarmmin(null);
|
// mPoint.setLalarmmin(null);
|
||||||
}
|
}
|
||||||
// this.mPointService.update2(alarmPoint.getUnitId(),mPoint);
|
// Enable TriggerAlarm to allow ScadaAlarmJob to process this MPoint
|
||||||
|
mPoint.setTriggeralarm("1");
|
||||||
|
this.mPointService.update2(alarmPoint.getUnitId(), mPoint);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (code == Result.SUCCESS) {
|
if (code == Result.SUCCESS) {
|
||||||
|
|||||||
@ -197,16 +197,15 @@ public class ProAlarmController {
|
|||||||
// Iterator<String> sIterator = jsonObject.keys();
|
// Iterator<String> sIterator = jsonObject.keys();
|
||||||
|
|
||||||
JSONArray arr = new JSONArray();
|
JSONArray arr = new JSONArray();
|
||||||
List<XServer> allxServerList = this.xServerService.selectListByWhere(" where 1=1 ");
|
// List<XServer> allxServerList = this.xServerService.selectListByWhere(" where 1=1 ");
|
||||||
for (XServer xServer :
|
// for (XServer xServer : allxServerList) {
|
||||||
allxServerList) {
|
|
||||||
// if (jsonObject.get(xServer.getBizid()) != null) {
|
// if (jsonObject.get(xServer.getBizid()) != null) {
|
||||||
// String code_value = jsonObject.get(xServer.getBizid()).toString();
|
// String code_value = jsonObject.get(xServer.getBizid()).toString();
|
||||||
// code_value = code_value + ",data_stop_alarm";
|
// code_value = code_value + ",data_stop_alarm";
|
||||||
// code_value = code_value.replace(",", "','");
|
// code_value = code_value.replace(",", "','");
|
||||||
// List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + " and point_code in ('" + code_value + "')"
|
// List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + " and point_code in ('" + code_value + "')"
|
||||||
// + orderstr);
|
// + orderstr);
|
||||||
List<ProAlarm> list = this.proAlarmService.selectListByWhere(xServer.getBizid(), wherestr + orderstr);
|
List<ProAlarm> list = this.proAlarmService.selectListByWhere(companyId, wherestr + orderstr);
|
||||||
// System.out.println(wherestr + " and point_code in ('" + code_value + "')");
|
// System.out.println(wherestr + " and point_code in ('" + code_value + "')");
|
||||||
if (list != null && list.size() > 0) {
|
if (list != null && list.size() > 0) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
@ -249,7 +248,7 @@ public class ProAlarmController {
|
|||||||
}
|
}
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
// }
|
||||||
model.addAttribute("result", arr);
|
model.addAttribute("result", arr);
|
||||||
return new ModelAndView("result");
|
return new ModelAndView("result");
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -37,6 +37,7 @@ import org.activiti.engine.history.HistoricTaskInstance;
|
|||||||
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
import org.activiti.engine.impl.pvm.process.ActivityImpl;
|
||||||
import org.activiti.engine.runtime.ProcessInstance;
|
import org.activiti.engine.runtime.ProcessInstance;
|
||||||
import org.activiti.engine.task.Task;
|
import org.activiti.engine.task.Task;
|
||||||
|
import org.apache.commons.collections.CollectionUtils;
|
||||||
import org.springframework.stereotype.Controller;
|
import org.springframework.stereotype.Controller;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
import org.springframework.ui.Model;
|
import org.springframework.ui.Model;
|
||||||
@ -356,7 +357,9 @@ public class MaintenancePlanController {
|
|||||||
model.addAttribute("nowDate", CommUtil.nowDate());
|
model.addAttribute("nowDate", CommUtil.nowDate());
|
||||||
String maintenancePlanId = pInstance.getBusinessKey();
|
String maintenancePlanId = pInstance.getBusinessKey();
|
||||||
List<BusinessUnitAudit> list = this.businessUnitAuditService.selectListByWhere("where businessId = '" + maintenancePlanId + "' order by insdt desc ");
|
List<BusinessUnitAudit> list = this.businessUnitAuditService.selectListByWhere("where businessId = '" + maintenancePlanId + "' order by insdt desc ");
|
||||||
|
if (CollectionUtils.isNotEmpty(list)){
|
||||||
model.addAttribute("businessUnitAudit", list.get(0));
|
model.addAttribute("businessUnitAudit", list.get(0));
|
||||||
|
}
|
||||||
MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(maintenancePlanId);
|
MaintenancePlan maintenancePlan = this.maintenancePlanService.selectById(maintenancePlanId);
|
||||||
model.addAttribute("maintenancePlan", maintenancePlan);
|
model.addAttribute("maintenancePlan", maintenancePlan);
|
||||||
EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(maintenancePlanId);
|
EquipmentPlan equipmentPlan = this.equipmentPlanService.selectById(maintenancePlanId);
|
||||||
|
|||||||
@ -1,6 +1,11 @@
|
|||||||
package com.sipai.controller.jsyw;
|
package com.sipai.controller.jsyw;
|
||||||
|
|
||||||
|
import com.sipai.tools.DeviceAccessHttpUtil;
|
||||||
|
import com.sipai.tools.HttpUtil;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
|
import net.sf.json.JSONObject;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Controller;
|
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;
|
||||||
@ -8,15 +13,27 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.servlet.ModelAndView;
|
import org.springframework.web.servlet.ModelAndView;
|
||||||
|
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.LinkedHashMap;
|
||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
import java.util.Properties;
|
||||||
|
import java.util.concurrent.atomic.AtomicLong;
|
||||||
|
|
||||||
@Controller
|
@Controller
|
||||||
@RequestMapping("/jsyw/vehicleGate")
|
@RequestMapping("/jsyw/vehicleGate")
|
||||||
public class VehicleGateController {
|
public class VehicleGateController {
|
||||||
|
private static final Logger LOG = LoggerFactory.getLogger(VehicleGateController.class);
|
||||||
|
private static final DateTimeFormatter DAY_FMT = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
private static final int DEFAULT_REMOTE_PAGE_SIZE = 200;
|
||||||
|
private static final int MAX_REMOTE_PAGES_PER_DAY = 100;
|
||||||
|
private static final String DEFAULT_API_URL = "http://127.0.0.1:8090/dh-netsdk/vehicleGate/getDailyRecognizedVehicleList";
|
||||||
|
private static final Properties VEHICLE_GATE_PROPS = loadVehicleGateProps();
|
||||||
|
private static final AtomicLong TS_SEQ = new AtomicLong();
|
||||||
|
|
||||||
@RequestMapping("/showList.do")
|
@RequestMapping("/showList.do")
|
||||||
public String showList(HttpServletRequest request, Model model) {
|
public String showList(HttpServletRequest request, Model model) {
|
||||||
@ -31,14 +48,18 @@ public class VehicleGateController {
|
|||||||
String passDate = safeStr(request.getParameter("passDate"));
|
String passDate = safeStr(request.getParameter("passDate"));
|
||||||
String direction = safeStr(request.getParameter("direction"));
|
String direction = safeStr(request.getParameter("direction"));
|
||||||
String status = safeStr(request.getParameter("status"));
|
String status = safeStr(request.getParameter("status"));
|
||||||
|
LocalDate queryDay = parseDay(passDate);
|
||||||
|
if (queryDay == null) {
|
||||||
|
queryDay = LocalDate.now();
|
||||||
|
}
|
||||||
|
|
||||||
List<Map<String, Object>> mockRows = buildMockRows();
|
List<Map<String, Object>> remoteRows = loadRowsFromRemote(queryDay, plateNo);
|
||||||
List<Map<String, Object>> filteredRows = new ArrayList<Map<String, Object>>();
|
List<Map<String, Object>> filteredRows = new ArrayList<Map<String, Object>>();
|
||||||
int inCount = 0;
|
int inCount = 0;
|
||||||
int outCount = 0;
|
int outCount = 0;
|
||||||
int abnormalCount = 0;
|
int abnormalCount = 0;
|
||||||
|
|
||||||
for (Map<String, Object> item : mockRows) {
|
for (Map<String, Object> item : remoteRows) {
|
||||||
String itemPlateNo = safeStr(item.get("plateNo")).toUpperCase(Locale.ROOT);
|
String itemPlateNo = safeStr(item.get("plateNo")).toUpperCase(Locale.ROOT);
|
||||||
String itemPassTime = safeStr(item.get("passTime"));
|
String itemPassTime = safeStr(item.get("passTime"));
|
||||||
String itemDirection = safeStr(item.get("direction"));
|
String itemDirection = safeStr(item.get("direction"));
|
||||||
@ -69,46 +90,209 @@ public class VehicleGateController {
|
|||||||
pageRows = filteredRows.subList(pageStart, pageEnd);
|
pageRows = filteredRows.subList(pageStart, pageEnd);
|
||||||
}
|
}
|
||||||
|
|
||||||
JSONArray rowsJson = JSONArray.fromObject(pageRows);
|
JSONObject result = new JSONObject();
|
||||||
String result = "{"
|
result.put("total", total);
|
||||||
+ "\"total\":" + total + ","
|
result.put("rows", JSONArray.fromObject(pageRows));
|
||||||
+ "\"rows\":" + rowsJson + ","
|
result.put("summaryInCount", inCount);
|
||||||
+ "\"summaryInCount\":" + inCount + ","
|
result.put("summaryOutCount", outCount);
|
||||||
+ "\"summaryOutCount\":" + outCount + ","
|
result.put("summaryInsideCount", inCount - outCount);
|
||||||
+ "\"summaryInsideCount\":" + (inCount - outCount) + ","
|
result.put("summaryAbnormalCount", abnormalCount);
|
||||||
+ "\"summaryAbnormalCount\":" + abnormalCount
|
model.addAttribute("result", result.toString());
|
||||||
+ "}";
|
|
||||||
model.addAttribute("result", result);
|
|
||||||
return new ModelAndView("result");
|
return new ModelAndView("result");
|
||||||
}
|
}
|
||||||
|
|
||||||
private String safeStr(Object value) {
|
private List<Map<String, Object>> loadRowsFromRemote(LocalDate day, String plateNo) {
|
||||||
return value == null ? "" : String.valueOf(value).trim();
|
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
|
||||||
|
int pageSize = getIntProp("vehicleGate.api.pageSize", DEFAULT_REMOTE_PAGE_SIZE);
|
||||||
|
String url = getProp("vehicleGate.api.url", DEFAULT_API_URL);
|
||||||
|
|
||||||
|
for (int pageNum = 1; pageNum <= MAX_REMOTE_PAGES_PER_DAY; pageNum++) {
|
||||||
|
com.alibaba.fastjson.JSONObject req = new com.alibaba.fastjson.JSONObject();
|
||||||
|
req.put("day", DAY_FMT.format(day));
|
||||||
|
req.put("plateNumber", plateNo);
|
||||||
|
req.put("pageNum", pageNum);
|
||||||
|
req.put("pageSize", pageSize);
|
||||||
|
|
||||||
|
String ts = nextUniqueTimestamp();
|
||||||
|
Map<String, String> headers = buildDhHeaders(ts);
|
||||||
|
|
||||||
|
String respText;
|
||||||
|
try {
|
||||||
|
respText = HttpUtil.sendPost(url, req, headers);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOG.error("VehicleGate request failed, day={}, pageNum={}", day, pageNum, ex);
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Map<String, Object>> buildMockRows() {
|
int fetched = appendRowsFromResponse(rows, respText, day, pageNum);
|
||||||
List<Map<String, Object>> rows = new ArrayList<Map<String, Object>>();
|
if (fetched <= 0 || fetched < pageSize) {
|
||||||
rows.add(buildRow("鲁A12345", "IN", "2026-03-03 08:12:21", "东门1号闸", "张三", "NORMAL", "自动识别放行"));
|
break;
|
||||||
rows.add(buildRow("鲁B66K88", "OUT", "2026-03-03 08:18:46", "东门1号闸", "李四", "NORMAL", "自动识别放行"));
|
}
|
||||||
rows.add(buildRow("鲁C99871", "IN", "2026-03-03 08:27:19", "南门2号闸", "王五", "ABNORMAL", "车牌识别异常,人工放行"));
|
}
|
||||||
rows.add(buildRow("鲁A77889", "IN", "2026-03-03 09:04:52", "北门1号闸", "赵六", "NORMAL", "自动识别放行"));
|
|
||||||
rows.add(buildRow("鲁D22319", "OUT", "2026-03-03 09:19:11", "南门2号闸", "钱七", "NORMAL", "自动识别放行"));
|
|
||||||
rows.add(buildRow("鲁E55120", "IN", "2026-03-03 10:03:35", "西门1号闸", "孙八", "NORMAL", "访客车辆"));
|
|
||||||
rows.add(buildRow("鲁F90111", "OUT", "2026-03-03 10:16:05", "北门1号闸", "周九", "ABNORMAL", "未登记离场,值班确认"));
|
|
||||||
rows.add(buildRow("鲁A0P365", "IN", "2026-03-03 10:42:30", "东门1号闸", "吴十", "NORMAL", "自动识别放行"));
|
|
||||||
return rows;
|
return rows;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map<String, Object> buildRow(String plateNo, String direction, String passTime, String gateName,
|
private int appendRowsFromResponse(List<Map<String, Object>> rows, String respText, LocalDate day, int pageNum) {
|
||||||
String driverName, String status, String note) {
|
if (respText == null || respText.trim().isEmpty()) {
|
||||||
Map<String, Object> row = new HashMap<String, Object>();
|
LOG.warn("VehicleGate response empty, day={}, pageNum={}", day, pageNum);
|
||||||
row.put("plateNo", plateNo);
|
return 0;
|
||||||
row.put("direction", direction);
|
}
|
||||||
row.put("passTime", passTime);
|
JSONObject resp;
|
||||||
row.put("gateName", gateName);
|
try {
|
||||||
row.put("driverName", driverName);
|
resp = JSONObject.fromObject(respText);
|
||||||
row.put("status", status);
|
} catch (Exception ex) {
|
||||||
row.put("note", note);
|
LOG.error("VehicleGate response parse error, day={}, pageNum={}, body={}", day, pageNum, shorten(respText), ex);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
boolean success = "true".equalsIgnoreCase(String.valueOf(resp.opt("success")));
|
||||||
|
if (!success) {
|
||||||
|
LOG.warn("VehicleGate response unsuccessful, day={}, pageNum={}, message={}", day, pageNum, resp.optString("message"));
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
JSONArray data = resp.optJSONArray("data");
|
||||||
|
if (data == null || data.isEmpty()) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
for (int i = 0; i < data.size(); i++) {
|
||||||
|
Object item = data.get(i);
|
||||||
|
JSONObject dto = item instanceof JSONObject ? (JSONObject) item : JSONObject.fromObject(item);
|
||||||
|
rows.add(mapRemoteRecord(dto));
|
||||||
|
}
|
||||||
|
return data.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Map<String, String> buildDhHeaders(String ts) {
|
||||||
|
String ip = getProp("vehicleGate.api.deviceIp", "192.168.1.108");
|
||||||
|
String user = getProp("vehicleGate.api.deviceUser", "admin");
|
||||||
|
String port = getProp("vehicleGate.api.devicePort", "37777");
|
||||||
|
String plainPwd = getProp("vehicleGate.api.devicePassword", "");
|
||||||
|
if (plainPwd.isEmpty()) {
|
||||||
|
LOG.warn("vehicleGate.api.devicePassword is empty, vehicle gate call may fail auth");
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
Map<String, String> headers = DeviceAccessHttpUtil.buildDeviceHeaders(ip, user, plainPwd, ts, port);
|
||||||
|
headers.put("Content-Type", "application/json");
|
||||||
|
return headers;
|
||||||
|
} catch (Exception ex) {
|
||||||
|
throw new IllegalStateException("Build vehicle gate headers failed", ex);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String nextUniqueTimestamp() {
|
||||||
|
long now = System.nanoTime();
|
||||||
|
while (true) {
|
||||||
|
long prev = TS_SEQ.get();
|
||||||
|
long next = now > prev ? now : prev + 1;
|
||||||
|
if (TS_SEQ.compareAndSet(prev, next)) {
|
||||||
|
return String.valueOf(next);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Map<String, Object> mapRemoteRecord(JSONObject dto) {
|
||||||
|
String eventTime = safeStr(dto.optString("eventTime"));
|
||||||
|
int channel = dto.optInt("channel", -1);
|
||||||
|
int lane = dto.optInt("lane", -1);
|
||||||
|
|
||||||
|
Map<String, Object> row = new LinkedHashMap<String, Object>();
|
||||||
|
row.put("plateNo", safeStr(dto.optString("plateNumber")));
|
||||||
|
row.put("direction", resolveDirection(dto));
|
||||||
|
row.put("passTime", eventTime);
|
||||||
|
row.put("gateName", buildGateName(channel, lane));
|
||||||
|
row.put("driverName", "--");
|
||||||
|
row.put("status", resolveStatus(dto));
|
||||||
|
row.put("note", firstNonEmpty(safeStr(dto.optString("allowStatusText")), "通道" + channel + " 车道" + lane));
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String resolveDirection(JSONObject dto) {
|
||||||
|
String text = safeStr(dto.optString("allowStatusText"));
|
||||||
|
if (text.contains("出")) {
|
||||||
|
return "OUT";
|
||||||
|
}
|
||||||
|
if (text.contains("进") || text.contains("入")) {
|
||||||
|
return "IN";
|
||||||
|
}
|
||||||
|
int lane = dto.optInt("lane", -1);
|
||||||
|
if (lane > 0 && lane % 2 == 0) {
|
||||||
|
return "OUT";
|
||||||
|
}
|
||||||
|
return "IN";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String resolveStatus(JSONObject dto) {
|
||||||
|
int allow = dto.optInt("allowStatus", -1);
|
||||||
|
if (allow == 1) {
|
||||||
|
return "NORMAL";
|
||||||
|
}
|
||||||
|
return "ABNORMAL";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String buildGateName(int channel, int lane) {
|
||||||
|
if (channel < 0 && lane < 0) {
|
||||||
|
return "--";
|
||||||
|
}
|
||||||
|
return "通道" + channel + "-车道" + lane;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String safeStr(Object value) {
|
||||||
|
return value == null ? "" : String.valueOf(value).trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String firstNonEmpty(String... values) {
|
||||||
|
if (values == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
for (String value : values) {
|
||||||
|
if (value != null && !value.trim().isEmpty()) {
|
||||||
|
return value.trim();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
private static LocalDate parseDay(String day) {
|
||||||
|
if (day == null || day.trim().isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
return LocalDate.parse(day.trim(), DAY_FMT);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static Properties loadVehicleGateProps() {
|
||||||
|
Properties p = new Properties();
|
||||||
|
try (InputStream in = VehicleGateController.class.getClassLoader().getResourceAsStream("thirdRequest.properties")) {
|
||||||
|
if (in != null) {
|
||||||
|
p.load(in);
|
||||||
|
}
|
||||||
|
} catch (Exception ex) {
|
||||||
|
LOG.warn("Load thirdRequest.properties failed", ex);
|
||||||
|
}
|
||||||
|
return p;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String getProp(String key, String defaultValue) {
|
||||||
|
String v = VEHICLE_GATE_PROPS.getProperty(key);
|
||||||
|
return v == null || v.trim().isEmpty() ? defaultValue : v.trim();
|
||||||
|
}
|
||||||
|
|
||||||
|
private static int getIntProp(String key, int defaultValue) {
|
||||||
|
String v = getProp(key, String.valueOf(defaultValue));
|
||||||
|
try {
|
||||||
|
return Integer.parseInt(v);
|
||||||
|
} catch (Exception ex) {
|
||||||
|
return defaultValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static String shorten(String text) {
|
||||||
|
if (text == null) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
String oneLine = text.replace('\n', ' ').replace('\r', ' ');
|
||||||
|
return oneLine.length() > 400 ? oneLine.substring(0, 400) + "..." : oneLine;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -279,10 +279,8 @@ public class EquipmentPlanController {
|
|||||||
if (company != null) {
|
if (company != null) {
|
||||||
model.addAttribute("companyName", company.getSname());
|
model.addAttribute("companyName", company.getSname());
|
||||||
}
|
}
|
||||||
User user = userService.getUserById(equipmentPlan.getAuditId());
|
String userNames = userService.getUserNamesByUserIds(equipmentPlan.getAuditId());
|
||||||
if (user != null) {
|
model.addAttribute("userName", userNames);
|
||||||
model.addAttribute("userName", user.getCaption());
|
|
||||||
}
|
|
||||||
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
||||||
if (equipmentPlanType_big != null) {
|
if (equipmentPlanType_big != null) {
|
||||||
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
||||||
@ -308,10 +306,8 @@ public class EquipmentPlanController {
|
|||||||
if (company != null) {
|
if (company != null) {
|
||||||
model.addAttribute("companyName", company.getSname());
|
model.addAttribute("companyName", company.getSname());
|
||||||
}
|
}
|
||||||
User user = userService.getUserById(equipmentPlan.getAuditId());
|
String userNames = userService.getUserNamesByUserIds(equipmentPlan.getAuditId());
|
||||||
if (user != null) {
|
model.addAttribute("userName", userNames);
|
||||||
model.addAttribute("userName", user.getCaption());
|
|
||||||
}
|
|
||||||
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
||||||
if (equipmentPlanType_big != null) {
|
if (equipmentPlanType_big != null) {
|
||||||
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
||||||
@ -422,10 +418,8 @@ public class EquipmentPlanController {
|
|||||||
if (company != null) {
|
if (company != null) {
|
||||||
model.addAttribute("companyName", company.getSname());
|
model.addAttribute("companyName", company.getSname());
|
||||||
}
|
}
|
||||||
User user = userService.getUserById(equipmentPlan.getAuditId());
|
String userNames = userService.getUserNamesByUserIds(equipmentPlan.getAuditId());
|
||||||
if (user != null) {
|
model.addAttribute("userName", userNames);
|
||||||
model.addAttribute("userName", user.getCaption());
|
|
||||||
}
|
|
||||||
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
EquipmentPlanType equipmentPlanType_big = equipmentPlanTypeService.selectById(equipmentPlan.getPlanTypeBig());
|
||||||
if (equipmentPlanType_big != null) {
|
if (equipmentPlanType_big != null) {
|
||||||
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
model.addAttribute("planTypeBigName", equipmentPlanType_big.getName());
|
||||||
|
|||||||
@ -123,7 +123,9 @@ public class PipelineDataController {
|
|||||||
@RequestMapping("/deletes.do")
|
@RequestMapping("/deletes.do")
|
||||||
public String dodeletes(HttpServletRequest request, Model model,
|
public String dodeletes(HttpServletRequest request, Model model,
|
||||||
@RequestParam(value = "ids") String ids) {
|
@RequestParam(value = "ids") String ids) {
|
||||||
int result = this.pipelineDataService.deleteByWhere("where id in (" + ids + ")");
|
// 移除末尾逗号,防止SQL语法错误
|
||||||
|
String cleanIds = ids.replaceAll("[,\\s]+$", "").replaceAll("^[,\\s]+", "");
|
||||||
|
int result = this.pipelineDataService.deleteByWhere("where id in (" + cleanIds + ")");
|
||||||
model.addAttribute("result", result);
|
model.addAttribute("result", result);
|
||||||
return "result";
|
return "result";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -374,6 +374,16 @@ public class RptCreateController {
|
|||||||
@RequestMapping("/doadd.do")
|
@RequestMapping("/doadd.do")
|
||||||
public String doadd(HttpServletRequest request, Model model) {
|
public String doadd(HttpServletRequest request, Model model) {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
String rptsetId = request.getParameter("rptsetId");
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有报表生成权限
|
||||||
|
if (rptsetId != null && !rptsetId.isEmpty()) {
|
||||||
|
if (!this.rptCreateService.checkGeneratePermission(rptsetId, cu)) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"您没有该报表的生成权限\",\"msg\":\"您没有该报表的生成权限\"}");
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
request.setAttribute("userId", cu.getId());
|
request.setAttribute("userId", cu.getId());
|
||||||
request.setAttribute("userName", cu.getCaption());
|
request.setAttribute("userName", cu.getCaption());
|
||||||
request.setAttribute("id", CommUtil.getUUID());
|
request.setAttribute("id", CommUtil.getUUID());
|
||||||
@ -394,14 +404,20 @@ public class RptCreateController {
|
|||||||
@RequestMapping("/doaddMore.do")
|
@RequestMapping("/doaddMore.do")
|
||||||
public String doaddMore(HttpServletRequest request, Model model) {
|
public String doaddMore(HttpServletRequest request, Model model) {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
if (cu == null) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"用户未登录\",\"msg\":\"用户未登录\"}");
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
request.setAttribute("userId", cu.getId());
|
request.setAttribute("userId", cu.getId());
|
||||||
request.setAttribute("userName", cu.getCaption());
|
request.setAttribute("userName", cu.getCaption());
|
||||||
request.setAttribute("id", CommUtil.getUUID());
|
request.setAttribute("id", CommUtil.getUUID());
|
||||||
String rpttype = request.getParameter("rpttype");
|
String rpttype = request.getParameter("rpttype");
|
||||||
if (RptInfoSet.RptType_Day.equals(rpttype)) {
|
if (RptInfoSet.RptType_Day.equals(rpttype)) {
|
||||||
request.setAttribute("dateD", CommUtil.nowDate().substring(0, 10));
|
request.setAttribute("dateD", CommUtil.nowDate().substring(0, 10));
|
||||||
} else if (RptInfoSet.RptType_Month.equals(rpttype) || RptInfoSet.RptType_Quarterly.equals(rpttype) || RptInfoSet.RptType_HalfYear.equals(rpttype)) {
|
} else if (RptInfoSet.RptType_Month.equals(rpttype) || RptInfoSet.RptType_HalfYear.equals(rpttype)) {
|
||||||
request.setAttribute("dateD", CommUtil.nowDate().substring(0, 7));
|
request.setAttribute("dateM", CommUtil.nowDate().substring(0, 7));
|
||||||
|
} else if (RptInfoSet.RptType_Quarterly.equals(rpttype)) {
|
||||||
|
request.setAttribute("dateQ", CommUtil.nowDate().substring(0, 7));
|
||||||
} else if (RptInfoSet.RptType_Year.equals(rpttype)) {
|
} else if (RptInfoSet.RptType_Year.equals(rpttype)) {
|
||||||
request.setAttribute("dateY", CommUtil.nowDate().substring(0, 4));
|
request.setAttribute("dateY", CommUtil.nowDate().substring(0, 4));
|
||||||
}
|
}
|
||||||
@ -432,6 +448,14 @@ public class RptCreateController {
|
|||||||
String rptsetId = request.getParameter("rptsetId");
|
String rptsetId = request.getParameter("rptsetId");
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有报表生成权限
|
||||||
|
if (rptCreate.getRptsetId() != null && !rptCreate.getRptsetId().isEmpty()) {
|
||||||
|
if (!this.rptCreateService.checkGeneratePermission(rptCreate.getRptsetId(), cu)) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"您没有该报表的生成权限\",\"msg\":\"您没有该报表的生成权限\"}");
|
||||||
|
return new ModelAndView("result");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
||||||
if (rptInfoSet != null) {
|
if (rptInfoSet != null) {
|
||||||
//日报
|
//日报
|
||||||
@ -545,6 +569,15 @@ public class RptCreateController {
|
|||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String rptsetId = request.getParameter("rptsetId");
|
String rptsetId = request.getParameter("rptsetId");
|
||||||
int result = 0;
|
int result = 0;
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有报表生成权限
|
||||||
|
if (rptCreate.getRptsetId() != null && !rptCreate.getRptsetId().isEmpty()) {
|
||||||
|
if (!this.rptCreateService.checkGeneratePermission(rptCreate.getRptsetId(), cu)) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"您没有该报表的生成权限\",\"msg\":\"您没有该报表的生成权限\"}");
|
||||||
|
return new ModelAndView("result");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
RptInfoSet rptInfoSet = rptInfoSetService.selectById(rptCreate.getRptsetId());
|
||||||
if (rptInfoSet != null) {
|
if (rptInfoSet != null) {
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
||||||
@ -696,7 +729,14 @@ public class RptCreateController {
|
|||||||
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
||||||
if (rptCreate != null) {//报表生成
|
if (rptCreate != null) {//报表生成
|
||||||
try {
|
try {
|
||||||
String base = this.rptCreateService.convertExceltoHtml(CommUtil.fixRptCreateFileName(rptCreate.getRptname() + rptCreate.getId()), sheetname, id, layerType, FileNameSpaceEnum.RptCreateFile.getNameSpace());
|
// 优先使用数据库中存储的文件路径,如果没有则构造路径(兼容旧数据)
|
||||||
|
String filePath;
|
||||||
|
if (rptCreate.getAbspath() != null && !rptCreate.getAbspath().isEmpty()) {
|
||||||
|
filePath = rptCreate.getAbspath();
|
||||||
|
} else {
|
||||||
|
filePath = CommUtil.fixRptCreateFileName(rptCreate.getRptname() + rptCreate.getId());
|
||||||
|
}
|
||||||
|
String base = this.rptCreateService.convertExceltoHtml(filePath, sheetname, id, layerType, FileNameSpaceEnum.RptCreateFile.getNameSpace());
|
||||||
//截取掉sheet名 目前只能先截取h2
|
//截取掉sheet名 目前只能先截取h2
|
||||||
String result = subRangeString(base, "<h2>", "</h2>");
|
String result = subRangeString(base, "<h2>", "</h2>");
|
||||||
result = result.replaceAll("<table class=\"t1\">", "<table class=\"t1\" id=\"t1\">");
|
result = result.replaceAll("<table class=\"t1\">", "<table class=\"t1\" id=\"t1\">");
|
||||||
@ -750,13 +790,26 @@ public class RptCreateController {
|
|||||||
@RequestMapping("/getSheet.do")
|
@RequestMapping("/getSheet.do")
|
||||||
public String getSheet(HttpServletRequest request, Model model,
|
public String getSheet(HttpServletRequest request, Model model,
|
||||||
@RequestParam(value = "id") String id) {
|
@RequestParam(value = "id") String id) {
|
||||||
|
String path = "";
|
||||||
|
String name = "";
|
||||||
Result_Report result1 = new Result_Report();
|
Result_Report result1 = new Result_Report();
|
||||||
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
||||||
if (rptCreate != null) {//报表生成中的预览
|
if (rptCreate != null) {//报表生成中的预览
|
||||||
|
// 优先使用数据库中存储的文件路径,如果没有则构造路径(兼容旧数据)
|
||||||
|
if (rptCreate.getAbspath() != null && !rptCreate.getAbspath().isEmpty()) {
|
||||||
|
path = rptCreate.getAbspath();
|
||||||
|
} else {
|
||||||
|
path = rptCreate.getRptname() + rptCreate.getId() + ".xls";
|
||||||
|
}
|
||||||
|
// 获取文件扩展名
|
||||||
|
String extension = ".xls";
|
||||||
|
if (path.toLowerCase().endsWith(".xlsx")) {
|
||||||
|
extension = ".xlsx";
|
||||||
|
}
|
||||||
|
String sourcePath = rptCreate.getRptname() + extension;
|
||||||
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptCreate.getRptsetId() + "'");
|
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptCreate.getRptsetId() + "'");
|
||||||
try {
|
try {
|
||||||
String sourcePath = rptCreate.getRptname();
|
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path);
|
||||||
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), CommUtil.fixRptCreateFileName(rptCreate.getRptname() + rptCreate.getId()));
|
|
||||||
if (isb == null || isb.length == 0) {
|
if (isb == null || isb.length == 0) {
|
||||||
result1 = Result_Report.failed("文件不存在或已被删除");
|
result1 = Result_Report.failed("文件不存在或已被删除");
|
||||||
model.addAttribute("result", CommUtil.toJson(result1));
|
model.addAttribute("result", CommUtil.toJson(result1));
|
||||||
@ -774,7 +827,7 @@ public class RptCreateController {
|
|||||||
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptInfoSetFile.getMasterid() + "'");
|
List<RptInfoSetSheet> list = rptInfoSetSheetService.selectListByWhere("where rptInfoSet_id = '" + rptInfoSetFile.getMasterid() + "'");
|
||||||
try {
|
try {
|
||||||
String sourcePath = "";
|
String sourcePath = "";
|
||||||
String path = rptInfoSetFile.getAbspath();
|
path = rptInfoSetFile.getAbspath();
|
||||||
// path = path.replaceAll("\\.xlsx", "").replaceAll("\\.xls", "");
|
// path = path.replaceAll("\\.xlsx", "").replaceAll("\\.xls", "");
|
||||||
// byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), CommUtil.fixRptCreateFileName(path));
|
// byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), CommUtil.fixRptCreateFileName(path));
|
||||||
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
|
byte[] isb = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
|
||||||
@ -850,8 +903,18 @@ public class RptCreateController {
|
|||||||
String name = "";
|
String name = "";
|
||||||
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
RptCreate rptCreate = this.rptCreateService.selectById(id);
|
||||||
if (rptCreate != null) {
|
if (rptCreate != null) {
|
||||||
|
// 优先使用数据库中存储的文件路径,如果没有则构造路径(兼容旧数据)
|
||||||
|
if (rptCreate.getAbspath() != null && !rptCreate.getAbspath().isEmpty()) {
|
||||||
|
path = rptCreate.getAbspath();
|
||||||
|
} else {
|
||||||
path = rptCreate.getRptname() + rptCreate.getId() + ".xls";
|
path = rptCreate.getRptname() + rptCreate.getId() + ".xls";
|
||||||
name = rptCreate.getRptname() + ".xls";
|
}
|
||||||
|
// 获取文件扩展名
|
||||||
|
String extension = ".xls";
|
||||||
|
if (path.toLowerCase().endsWith(".xlsx")) {
|
||||||
|
extension = ".xlsx";
|
||||||
|
}
|
||||||
|
name = rptCreate.getRptname() + extension;
|
||||||
}
|
}
|
||||||
byte[] bytes = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path);
|
byte[] bytes = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptCreateFile.getNameSpace(), path);
|
||||||
if (bytes == null || bytes.length == 0) {
|
if (bytes == null || bytes.length == 0) {
|
||||||
|
|||||||
@ -123,6 +123,13 @@ public class RptDayLogController {
|
|||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String userId = cu.getId();
|
String userId = cu.getId();
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有填报权限
|
||||||
|
// if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
||||||
|
// Result result = Result.failed("您没有该报表的填报权限");
|
||||||
|
// model.addAttribute("result", CommUtil.toJson(result));
|
||||||
|
// return "result";
|
||||||
|
// }
|
||||||
|
|
||||||
JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId);
|
JSONObject jsonObject = this.rptDayLogService.getJson(null,rptdeptId,rptdt,userId);
|
||||||
|
|
||||||
Result result = Result.success(jsonObject);
|
Result result = Result.success(jsonObject);
|
||||||
@ -149,6 +156,14 @@ public class RptDayLogController {
|
|||||||
@RequestParam(value = "rptdeptId") String rptdeptId) throws IOException {
|
@RequestParam(value = "rptdeptId") String rptdeptId) throws IOException {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String userId = cu.getId();
|
String userId = cu.getId();
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有填报权限
|
||||||
|
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
||||||
|
Result result = Result.failed("您没有该报表的填报权限");
|
||||||
|
model.addAttribute("result", CommUtil.toJson(result));
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId);
|
JSONObject jsonObject = this.rptDayLogService.getJson(id,rptdeptId,null,userId);
|
||||||
model.addAttribute("rptDayLog", jsonObject);
|
model.addAttribute("rptDayLog", jsonObject);
|
||||||
// return "/report/reportdetail";
|
// return "/report/reportdetail";
|
||||||
@ -191,11 +206,19 @@ public class RptDayLogController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/dosave.do")
|
@RequestMapping("/dosave.do")
|
||||||
public String dosave(HttpServletRequest request,Model model){
|
public ModelAndView dosave(HttpServletRequest request,Model model){
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String userId = cu.getId();
|
String userId = cu.getId();
|
||||||
String json = request.getParameter("json");
|
String json = request.getParameter("json");
|
||||||
JSONObject jsonObject = JSONObject.fromObject(json);
|
JSONObject jsonObject = JSONObject.fromObject(json);
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有填报权限
|
||||||
|
String rptdeptId = (String) jsonObject.get("rptdeptId");
|
||||||
|
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
||||||
|
model.addAttribute("result", "{\"res\":\"您没有该报表的填报权限\",\"msg\":\"您没有该报表的填报权限\"}");
|
||||||
|
return new ModelAndView("result");
|
||||||
|
}
|
||||||
|
|
||||||
if (jsonObject.get("id")==null||jsonObject.get("id").equals("")) {
|
if (jsonObject.get("id")==null||jsonObject.get("id").equals("")) {
|
||||||
jsonObject.put("id", CommUtil.getUUID());
|
jsonObject.put("id", CommUtil.getUUID());
|
||||||
}
|
}
|
||||||
@ -206,12 +229,12 @@ public class RptDayLogController {
|
|||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
Result result = Result.failed("插入失败");
|
Result result = Result.failed("插入失败");
|
||||||
model.addAttribute("result", CommUtil.toJson(result));
|
model.addAttribute("result", CommUtil.toJson(result));
|
||||||
return "result";
|
return new ModelAndView("result");
|
||||||
}
|
}
|
||||||
|
|
||||||
Result result = Result.success(null);
|
Result result = Result.success(null);
|
||||||
model.addAttribute("result", CommUtil.toJson(result));
|
model.addAttribute("result", CommUtil.toJson(result));
|
||||||
return "result";
|
return new ModelAndView("result");
|
||||||
}
|
}
|
||||||
|
|
||||||
@RequestMapping("/onekeyAudit.do")//一键审核
|
@RequestMapping("/onekeyAudit.do")//一键审核
|
||||||
@ -228,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++) {
|
||||||
@ -268,6 +314,14 @@ public class RptDayLogController {
|
|||||||
@RequestParam(value = "rptdeptId", required=false) String rptdeptId) {
|
@RequestParam(value = "rptdeptId", required=false) String rptdeptId) {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
String userId = cu.getId();
|
String userId = cu.getId();
|
||||||
|
|
||||||
|
// 权限验证:检查用户是否有填报权限
|
||||||
|
if (!this.rptDayLogService.checkInputPermission(rptdeptId, cu)) {
|
||||||
|
Result result = Result.failed("您没有该报表的填报权限");
|
||||||
|
model.addAttribute("result", CommUtil.toJson(result));
|
||||||
|
return "result";
|
||||||
|
}
|
||||||
|
|
||||||
MultipartRequest multipartRequest = (MultipartRequest)request;
|
MultipartRequest multipartRequest = (MultipartRequest)request;
|
||||||
|
|
||||||
List<MultipartFile> fileList = multipartRequest.getFiles("filelist");
|
List<MultipartFile> fileList = multipartRequest.getFiles("filelist");
|
||||||
|
|||||||
@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转导入页面
|
* 跳转导入页面
|
||||||
*
|
*
|
||||||
|
|||||||
@ -114,6 +114,8 @@ public class SafetyCheckComprehensiveController {
|
|||||||
model.addAttribute("checkItemList", SafetyCheckItemComprehensiveEnum.getAllEnableType4JSON());
|
model.addAttribute("checkItemList", SafetyCheckItemComprehensiveEnum.getAllEnableType4JSON());
|
||||||
//检查结果下拉
|
//检查结果下拉
|
||||||
model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON());
|
model.addAttribute("checkResultList", SafetyCheckResultEnum.getAllEnableType4JSON());
|
||||||
|
// 预生成ID,用于附件上传
|
||||||
|
model.addAttribute("preId", UUID.randomUUID().toString());
|
||||||
return "safety/SafetyCheckComprehensiveAdd";
|
return "safety/SafetyCheckComprehensiveAdd";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -126,13 +128,10 @@ public class SafetyCheckComprehensiveController {
|
|||||||
@RequestMapping("/save.do")
|
@RequestMapping("/save.do")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Result save(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile[] multipartFiles) throws Exception {
|
public Result save(HttpServletRequest request, SafetyCheckComprehensive bean) throws Exception {
|
||||||
User cu = (User) request.getSession().getAttribute("cu");
|
User cu = (User) request.getSession().getAttribute("cu");
|
||||||
|
if (StringUtils.isEmpty(bean.getId())) {
|
||||||
bean.setId(UUID.randomUUID().toString());
|
bean.setId(UUID.randomUUID().toString());
|
||||||
if (multipartFiles != null) {
|
|
||||||
for (MultipartFile file : multipartFiles) {
|
|
||||||
safetyFilesService.upload(request, file, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE.getId(), SafetyCheckStatusEnum.APPLY.getId(), bean.getId());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
bean.setCheckCode(safetySeqService.code(request, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE));
|
bean.setCheckCode(safetySeqService.code(request, SafetyFunctionEnum.SAFETY_CHECK_COMPREHENSIVE));
|
||||||
if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) {
|
if (bean.getCheckResult() == SafetyCheckResultEnum.OK.getId()) {
|
||||||
@ -156,12 +155,12 @@ public class SafetyCheckComprehensiveController {
|
|||||||
@RequestMapping("/saveApply.do")
|
@RequestMapping("/saveApply.do")
|
||||||
@ResponseBody
|
@ResponseBody
|
||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Result saveApply(HttpServletRequest request, SafetyCheckComprehensive bean, MultipartFile[] file) throws Exception {
|
public Result saveApply(HttpServletRequest request, SafetyCheckComprehensive bean) throws Exception {
|
||||||
if (StringUtils.isEmpty(bean.getDutyUserId())) {
|
if (StringUtils.isEmpty(bean.getDutyUserId())) {
|
||||||
return Result.failed("整改负责人不能为空!");
|
return Result.failed("整改负责人不能为空!");
|
||||||
}
|
}
|
||||||
|
|
||||||
save(request, bean, file);
|
save(request, bean);
|
||||||
// 不相符的才提交申请
|
// 不相符的才提交申请
|
||||||
if (bean.getCheckResult() == SafetyCheckResultEnum.NOT_OK.getId()) {
|
if (bean.getCheckResult() == SafetyCheckResultEnum.NOT_OK.getId()) {
|
||||||
safetyCheckActivityService.apply(bean.getCreateUserId(), bean.getDutyUserId(), ProcessType.SAFETY_CHECK_COMPREHENSIVE, bean.getId());
|
safetyCheckActivityService.apply(bean.getCreateUserId(), bean.getDutyUserId(), ProcessType.SAFETY_CHECK_COMPREHENSIVE, bean.getId());
|
||||||
@ -181,8 +180,8 @@ public class SafetyCheckComprehensiveController {
|
|||||||
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
||||||
bean.getDutyUserId(), // 当前节点审批人
|
bean.getDutyUserId(), // 当前节点审批人
|
||||||
bean.getDutyUserName(), // 当前节点审批人
|
bean.getDutyUserName(), // 当前节点审批人
|
||||||
null, // 抄送人
|
bean.getCopyUserId(), // 抄送人
|
||||||
null,// 抄送人
|
bean.getCopyUserName(),// 抄送人
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@ -377,10 +376,9 @@ public class SafetyCheckComprehensiveController {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Result response(HttpServletRequest request, SafetyCheckComprehensive bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
public Result response(HttpServletRequest request, SafetyCheckComprehensive bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
||||||
|
|
||||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
|
||||||
|
|
||||||
//通过
|
//通过
|
||||||
if (pass == 1) {
|
if (pass == 1) {
|
||||||
|
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
||||||
service.update(bean);
|
service.update(bean);
|
||||||
|
|
||||||
@ -403,6 +401,7 @@ public class SafetyCheckComprehensiveController {
|
|||||||
}
|
}
|
||||||
//不通过
|
//不通过
|
||||||
else {
|
else {
|
||||||
|
safetyCheckActivityService.audit(bean.getDutyUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
||||||
service.update(bean);
|
service.update(bean);
|
||||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||||
|
|||||||
@ -236,8 +236,8 @@ public class SafetyCheckDaylyController {
|
|||||||
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
||||||
bean.getDutyUserId(), // 当前节点审批人
|
bean.getDutyUserId(), // 当前节点审批人
|
||||||
bean.getDutyUserName(), // 当前节点审批人
|
bean.getDutyUserName(), // 当前节点审批人
|
||||||
null, // 抄送人
|
bean.getCopyUserId(), // 抄送人
|
||||||
null,// 抄送人
|
bean.getCopyUserName(),// 抄送人
|
||||||
null);
|
null);
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -373,10 +373,9 @@ public class SafetyCheckDaylyController {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Result response(HttpServletRequest request, SafetyCheckDayly bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
public Result response(HttpServletRequest request, SafetyCheckDayly bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
||||||
|
|
||||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
|
||||||
|
|
||||||
//通过
|
//通过
|
||||||
if (pass == 1) {
|
if (pass == 1) {
|
||||||
|
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
||||||
safetyCheckDaylyService.update(bean);
|
safetyCheckDaylyService.update(bean);
|
||||||
|
|
||||||
@ -400,6 +399,7 @@ public class SafetyCheckDaylyController {
|
|||||||
}
|
}
|
||||||
//不通过
|
//不通过
|
||||||
else {
|
else {
|
||||||
|
safetyCheckActivityService.audit(bean.getDutyUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
||||||
safetyCheckDaylyService.update(bean);
|
safetyCheckDaylyService.update(bean);
|
||||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||||
|
|||||||
@ -197,8 +197,8 @@ public class SafetyCheckSpecialController {
|
|||||||
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
SafetyCheckStatusEnum.RESPONSE.getTaskTitle(),
|
||||||
bean.getDutyUserId(), // 当前节点审批人
|
bean.getDutyUserId(), // 当前节点审批人
|
||||||
bean.getDutyUserName(), // 当前节点审批人
|
bean.getDutyUserName(), // 当前节点审批人
|
||||||
null, // 抄送人
|
bean.getCopyUserId(), // 抄送人
|
||||||
null,// 抄送人
|
bean.getCopyUserName(),// 抄送人
|
||||||
null);
|
null);
|
||||||
}
|
}
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@ -393,10 +393,9 @@ public class SafetyCheckSpecialController {
|
|||||||
@Transactional(rollbackFor = Exception.class)
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Result response(HttpServletRequest request, SafetyCheckSpecial bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
public Result response(HttpServletRequest request, SafetyCheckSpecial bean, String processInstanceId, int pass) throws IOException, ServiceException {
|
||||||
|
|
||||||
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
|
||||||
|
|
||||||
//通过
|
//通过
|
||||||
if (pass == 1) {
|
if (pass == 1) {
|
||||||
|
safetyCheckActivityService.audit(bean.getConfirmUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
bean.setStatus(SafetyCheckStatusEnum.COMPLETE.getId());
|
||||||
service.update(bean);
|
service.update(bean);
|
||||||
|
|
||||||
@ -419,6 +418,7 @@ public class SafetyCheckSpecialController {
|
|||||||
}
|
}
|
||||||
//不通过
|
//不通过
|
||||||
else {
|
else {
|
||||||
|
safetyCheckActivityService.audit(bean.getDutyUserId(), processInstanceId, pass);
|
||||||
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
bean.setStatus(SafetyCheckStatusEnum.APPLY.getId());
|
||||||
service.update(bean);
|
service.update(bean);
|
||||||
safetyFlowTaskService.saveWorkFlowRecord(true,
|
safetyFlowTaskService.saveWorkFlowRecord(true,
|
||||||
|
|||||||
@ -339,18 +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);
|
||||||
}
|
|
||||||
for (String id : ids) {
|
|
||||||
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;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 跳转导入页面
|
* 跳转导入页面
|
||||||
*
|
*
|
||||||
@ -538,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("~");
|
||||||
|
if (split.length == 2) {
|
||||||
String issueDate_param_start_time = split[0].trim();
|
String issueDate_param_start_time = split[0].trim();
|
||||||
String issueDate_param_end_time = split[1].trim();
|
String issueDate_param_end_time = split[1].trim();
|
||||||
wherestr += " and sc.issue_date >= '" + issueDate_param_start_time + "'" +
|
wherestr += " and sc.issue_date >= '" + issueDate_param_start_time + "'" +
|
||||||
" and sc.issue_date <= '" + issueDate_param_end_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;
|
||||||
@ -607,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");
|
||||||
@ -618,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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -227,7 +227,7 @@ public class PatrolModelController {
|
|||||||
User cu=(User)request.getSession().getAttribute("cu");
|
User cu=(User)request.getSession().getAttribute("cu");
|
||||||
String companyId = request.getParameter("bizId");
|
String companyId = request.getParameter("bizId");
|
||||||
String type = request.getParameter("type");
|
String type = request.getParameter("type");
|
||||||
List<PatrolModel> list = this.patrolModelService.selectListByWhere("where unit_id = '"+companyId+"' and type='"+type+"' order by insdt");
|
List<PatrolModel> list = this.patrolModelService.selectListByWhere("where unit_id = '"+companyId+"' order by insdt");
|
||||||
ArrayList<Select2> list4select2 = new ArrayList<Select2>();
|
ArrayList<Select2> list4select2 = new ArrayList<Select2>();
|
||||||
for (int i=0;i<list.size();i++){
|
for (int i=0;i<list.size();i++){
|
||||||
Select2 select2 = new Select2();
|
Select2 select2 = new Select2();
|
||||||
|
|||||||
@ -242,10 +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???
|
||||||
Company company = this.companyService.selectByPrimaryKey(companyId);
|
// companyId在不同页面可能来自tb_unit或tb_company,统一兼容两种来源
|
||||||
|
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 (company != null && company.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) {
|
||||||
@ -257,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 (company != null && company.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()) {
|
||||||
@ -272,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 (company != null && company.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 (company != null && company.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());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -213,6 +213,9 @@ public class RoleController {
|
|||||||
JSONArray json = JSONArray.fromObject(list);
|
JSONArray json = JSONArray.fromObject(list);
|
||||||
model.addAttribute("json", json);
|
model.addAttribute("json", json);
|
||||||
model.addAttribute("roleid", roleid);
|
model.addAttribute("roleid", roleid);
|
||||||
|
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
|
||||||
|
model.addAttribute("companyId", request.getParameter("bizid"));
|
||||||
|
}
|
||||||
return "user/roleUser";
|
return "user/roleUser";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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;
|
||||||
@ -852,11 +853,13 @@ public class UserController {
|
|||||||
public String userForSelectByCompany(HttpServletRequest request, Model model) {
|
public String userForSelectByCompany(HttpServletRequest request, Model model) {
|
||||||
String userIds = request.getParameter("userIds");
|
String userIds = request.getParameter("userIds");
|
||||||
String jobIds = request.getParameter("jobIds");
|
String jobIds = request.getParameter("jobIds");
|
||||||
|
String displayDept = request.getParameter("displayDept");
|
||||||
if (userIds != null && !userIds.isEmpty()) {
|
if (userIds != null && !userIds.isEmpty()) {
|
||||||
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',','," + userIds + ",')");
|
List<User> list = this.userService.selectListByWhere("where id in ('" + userIds.replace(",", "','") + "') order by CHARINDEX(','+ id +',',','" + userIds + ",')");
|
||||||
model.addAttribute("users", JSONArray.fromObject(list));
|
model.addAttribute("users", JSONArray.fromObject(list));
|
||||||
}
|
}
|
||||||
model.addAttribute("jobIds", jobIds);
|
model.addAttribute("jobIds", jobIds);
|
||||||
|
model.addAttribute("displayDept", displayDept);
|
||||||
return "user/userForSelectByCompany";
|
return "user/userForSelectByCompany";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -864,6 +867,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";
|
||||||
@ -1255,6 +1261,7 @@ public class UserController {
|
|||||||
model.addAttribute("users", JSONArray.fromObject(list));
|
model.addAttribute("users", JSONArray.fromObject(list));
|
||||||
}
|
}
|
||||||
model.addAttribute("jobIds", jobIds);
|
model.addAttribute("jobIds", jobIds);
|
||||||
|
model.addAttribute("displayDept", request.getParameter("displayDept"));
|
||||||
return "user/userForSelectByWorkOrder";
|
return "user/userForSelectByWorkOrder";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1454,6 +1461,7 @@ public class UserController {
|
|||||||
model.addAttribute("users", JSONArray.fromObject(list));
|
model.addAttribute("users", JSONArray.fromObject(list));
|
||||||
}
|
}
|
||||||
model.addAttribute("jobIds", jobIds);
|
model.addAttribute("jobIds", jobIds);
|
||||||
|
model.addAttribute("displayDept", request.getParameter("displayDept"));
|
||||||
return "user/userSelectLayer";
|
return "user/userSelectLayer";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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++) {
|
||||||
|
String rawBizId = list.get(i).getBizid();
|
||||||
ProcessSection processSection = this.processSectionService.selectById(list.get(i).getProcesssectionid());
|
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());
|
||||||
}
|
}
|
||||||
|
|||||||
@ -514,6 +514,21 @@ public class MPointController {
|
|||||||
mp.setProcessSection(processSections.get(0));
|
mp.setProcessSection(processSections.get(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// 取redis点位数据最新值,没有就是0
|
||||||
|
for (MPoint mPoint : list) {
|
||||||
|
String id = mPoint.getId();
|
||||||
|
int num = mPoint.getId().hashCode() % 25;
|
||||||
|
RMapCache<String, String> map_redis_data = redissonClient.getMapCache(CommString.RedisMpointFlag + num);
|
||||||
|
if (map_redis_data.get(id) != null && !"".equals(map_redis_data.get(id))) {
|
||||||
|
String[] str = map_redis_data.get(id).split(";");
|
||||||
|
if (str.length >= 3 && str[1] != null && !str[1].isEmpty() && !"null".equals(str[1])) {
|
||||||
|
mPoint.setParmvalue(new BigDecimal(str[1]));
|
||||||
|
mPoint.setMeasuredt(str[2]);
|
||||||
|
} else {
|
||||||
|
mPoint.setParmvalue(BigDecimal.ZERO);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
PageInfo<MPoint> pi = new PageInfo<MPoint>(list);
|
PageInfo<MPoint> pi = new PageInfo<MPoint>(list);
|
||||||
JSONArray json = JSONArray.fromObject(list);
|
JSONArray json = JSONArray.fromObject(list);
|
||||||
result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}";
|
result = "{\"total\":" + pi.getTotal() + ",\"rows\":" + json + "}";
|
||||||
@ -4137,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();
|
||||||
|
|
||||||
|
|||||||
@ -133,6 +133,9 @@ public class SchedulingController {
|
|||||||
public String doadd(HttpServletRequest request, Model model,
|
public String doadd(HttpServletRequest request, Model model,
|
||||||
@RequestParam(value = "date") String date) {
|
@RequestParam(value = "date") String date) {
|
||||||
model.addAttribute("date", date.substring(0, 10));
|
model.addAttribute("date", date.substring(0, 10));
|
||||||
|
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
|
||||||
|
model.addAttribute("bizid", request.getParameter("bizid"));
|
||||||
|
}
|
||||||
return "work/schedulingAdd";
|
return "work/schedulingAdd";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -142,6 +145,9 @@ public class SchedulingController {
|
|||||||
String wherestr = " where s.id = '" + schedulingId + "'";
|
String wherestr = " where s.id = '" + schedulingId + "'";
|
||||||
List<Scheduling> scheduling = this.schedulingService.selectCalenderListByWhere(wherestr);
|
List<Scheduling> scheduling = this.schedulingService.selectCalenderListByWhere(wherestr);
|
||||||
model.addAttribute("scheduling", scheduling.get(0));
|
model.addAttribute("scheduling", scheduling.get(0));
|
||||||
|
if(request.getParameter("bizid") != null && !request.getParameter("bizid").isEmpty()){
|
||||||
|
model.addAttribute("bizid", request.getParameter("bizid"));
|
||||||
|
}
|
||||||
return "work/schedulingEdit";
|
return "work/schedulingEdit";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -475,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();
|
||||||
@ -1150,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";
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1252,22 +1252,15 @@ 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(",");
|
|
||||||
String workorderDetailsIds = "";
|
|
||||||
for (String s : id) {
|
|
||||||
workorderDetailsIds += "'" + s + "',";
|
|
||||||
}
|
|
||||||
String whereStr = "where id in (" + workorderDetailsIds.substring(0, workorderDetailsIds.length() - 1) + ")";
|
|
||||||
try {
|
try {
|
||||||
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
||||||
this.workorderDetailService.doExportRepair(response, workorderDetails, type);
|
this.workorderDetailService.doExportRepair(response, workorderDetails, type);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1292,22 +1285,15 @@ 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(",");
|
|
||||||
String workorderDetailsIds = "";
|
|
||||||
for (String s : id) {
|
|
||||||
workorderDetailsIds += "'" + s + "',";
|
|
||||||
}
|
|
||||||
String whereStr = "where id in (" + workorderDetailsIds.substring(0, workorderDetailsIds.length() - 1) + ")";
|
|
||||||
try {
|
try {
|
||||||
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
||||||
this.workorderDetailService.doExportRepairJS(response, workorderDetails, type);
|
this.workorderDetailService.doExportRepairJS(response, workorderDetails, type);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
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(",");
|
|
||||||
String workorderDetailsIds = "";
|
|
||||||
for (String s : id) {
|
|
||||||
workorderDetailsIds += "'" + s + "',";
|
|
||||||
}
|
|
||||||
String whereStr = "where id in (" + workorderDetailsIds.substring(0, workorderDetailsIds.length() - 1) + ")";
|
|
||||||
// System.out.println(whereStr);
|
|
||||||
try {
|
try {
|
||||||
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
List<WorkorderDetail> workorderDetails = workorderDetailService.selectListByWhere(whereStr);
|
||||||
this.workorderDetailService.doExportMain(response, workorderDetails, type);
|
this.workorderDetailService.doExportMain(response, workorderDetails, type);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
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(",+$", "");
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 日历中弹出指定日期的 维修单
|
* 日历中弹出指定日期的 维修单
|
||||||
*
|
*
|
||||||
|
|||||||
@ -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> {
|
||||||
@ -17,4 +18,12 @@ public class SewageDao extends CommDaoImpl<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);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
@ -34,9 +34,16 @@ public class AuthorizeTag extends BodyTagSupport {
|
|||||||
@SuppressWarnings("static-access")
|
@SuppressWarnings("static-access")
|
||||||
@Override
|
@Override
|
||||||
public int doStartTag() {
|
public int doStartTag() {
|
||||||
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
|
ServletRequestAttributes requestAttributes = (ServletRequestAttributes)RequestContextHolder.getRequestAttributes();
|
||||||
|
if (requestAttributes == null) {
|
||||||
|
return this.SKIP_BODY;
|
||||||
|
}
|
||||||
|
HttpServletRequest request = requestAttributes.getRequest();
|
||||||
SecurityContextImpl securityContextImpl = (SecurityContextImpl) request
|
SecurityContextImpl securityContextImpl = (SecurityContextImpl) request
|
||||||
.getSession().getAttribute("SPRING_SECURITY_CONTEXT");
|
.getSession().getAttribute("SPRING_SECURITY_CONTEXT");
|
||||||
|
if (securityContextImpl == null || securityContextImpl.getAuthentication() == null) {
|
||||||
|
return this.SKIP_BODY;
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
//获取当前登录名
|
//获取当前登录名
|
||||||
String name = securityContextImpl.getAuthentication().getName();
|
String name = securityContextImpl.getAuthentication().getName();
|
||||||
|
|||||||
@ -284,22 +284,8 @@ public class WorkflowProcessDefinitionService {
|
|||||||
String id = activityImpl.getId();
|
String id = activityImpl.getId();
|
||||||
if(taskDefinitionKey.toLowerCase().equals(id.toLowerCase())){
|
if(taskDefinitionKey.toLowerCase().equals(id.toLowerCase())){
|
||||||
System.out.println("当前执行的任务:"+activityImpl.getProperty("name"));
|
System.out.println("当前执行的任务:"+activityImpl.getProperty("name"));
|
||||||
//获取从某个节点出来的所有子节点-网关
|
//获取从某个节点出来的所有子节点(递归处理多层网关嵌套)
|
||||||
List<PvmTransition> outTransitions_gw = activityImpl.getOutgoingTransitions();
|
collectNextActivities(activityImpl.getOutgoingTransitions(), activityImpls);
|
||||||
for(PvmTransition tr_gw:outTransitions_gw){
|
|
||||||
//获取线路的终点节点-网关
|
|
||||||
PvmActivity ac_gw = tr_gw.getDestination();
|
|
||||||
if(ac_gw.getProperty("type").equals("userTask") || ac_gw.getProperty("type").equals("endEvent")){
|
|
||||||
activityImpls.add((ActivityImpl)ac_gw);
|
|
||||||
}else{
|
|
||||||
List<PvmTransition> outTransitions =ac_gw.getOutgoingTransitions();
|
|
||||||
for(PvmTransition tr:outTransitions){
|
|
||||||
PvmActivity ac = tr.getDestination();
|
|
||||||
ActivityImpl itemActivityImpl =(ActivityImpl)ac;
|
|
||||||
activityImpls.add(itemActivityImpl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -318,27 +304,37 @@ public class WorkflowProcessDefinitionService {
|
|||||||
if (taskDefinitionKey.toLowerCase().equals(id.toLowerCase()) || (StringUtil.isBlank(taskDefinitionKey) &&
|
if (taskDefinitionKey.toLowerCase().equals(id.toLowerCase()) || (StringUtil.isBlank(taskDefinitionKey) &&
|
||||||
activityImpl.getProperty("type").equals("startEvent"))) {
|
activityImpl.getProperty("type").equals("startEvent"))) {
|
||||||
System.out.println("当前执行的任务:" + activityImpl.getProperty("name"));
|
System.out.println("当前执行的任务:" + activityImpl.getProperty("name"));
|
||||||
//获取从某个节点出来的所有子节点-网关
|
//获取从某个节点出来的所有子节点
|
||||||
List<PvmTransition> outTransitions_gw = activityImpl.getOutgoingTransitions();
|
collectNextActivities(activityImpl.getOutgoingTransitions(), activityImpls);
|
||||||
for (PvmTransition tr_gw : outTransitions_gw) {
|
|
||||||
//获取线路的终点节点-网关
|
|
||||||
PvmActivity ac_gw = tr_gw.getDestination();
|
|
||||||
if (ac_gw.getProperty("type").equals("userTask") || ac_gw.getProperty("type").equals("endEvent")) {
|
|
||||||
activityImpls.add((ActivityImpl) ac_gw);
|
|
||||||
} else {
|
|
||||||
List<PvmTransition> outTransitions = ac_gw.getOutgoingTransitions();
|
|
||||||
for (PvmTransition tr : outTransitions) {
|
|
||||||
PvmActivity ac = tr.getDestination();
|
|
||||||
ActivityImpl itemActivityImpl = (ActivityImpl) ac;
|
|
||||||
activityImpls.add(itemActivityImpl);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return activityImpls;
|
return activityImpls;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归收集后续节点,处理多层网关嵌套
|
||||||
|
* @param transitions 当前层的流出路径
|
||||||
|
* @param result 收集结果的列表
|
||||||
|
*/
|
||||||
|
private void collectNextActivities(List<PvmTransition> transitions, List<ActivityImpl> result) {
|
||||||
|
if (transitions == null || transitions.isEmpty()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
for (PvmTransition tr : transitions) {
|
||||||
|
PvmActivity dest = tr.getDestination();
|
||||||
|
String destType = String.valueOf(dest.getProperty("type"));
|
||||||
|
if ("userTask".equals(destType) || "endEvent".equals(destType)) {
|
||||||
|
// 目标是用户任务或结束事件,直接收集
|
||||||
|
result.add((ActivityImpl) dest);
|
||||||
|
} else if ("exclusiveGateway".equals(destType) || "parallelGateway".equals(destType)
|
||||||
|
|| "inclusiveGateway".equals(destType)) {
|
||||||
|
// 目标是网关,递归遍历其流出路径
|
||||||
|
collectNextActivities(dest.getOutgoingTransitions(), result);
|
||||||
|
}
|
||||||
|
// 其他类型(如serviceTask、scriptTask等)忽略
|
||||||
|
}
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* 查找含routeNum的workTask
|
* 查找含routeNum的workTask
|
||||||
* @param processDefId
|
* @param processDefId
|
||||||
@ -362,9 +358,22 @@ public class WorkflowProcessDefinitionService {
|
|||||||
String pvmTransitionId = "";
|
String pvmTransitionId = "";
|
||||||
for (WorkTask workTask : list) {
|
for (WorkTask workTask : list) {
|
||||||
PvmTransition item=this.getTransition(processDefId, taskDefId,workTask.getId(),pvmTransitionId);
|
PvmTransition item=this.getTransition(processDefId, taskDefId,workTask.getId(),pvmTransitionId);
|
||||||
|
if (item == null) {
|
||||||
|
// 未找到对应路径时默认标记为通过路径,继续处理其他任务
|
||||||
|
workTask.setPassFlag(true);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
pvmTransitionId = item.getId();
|
pvmTransitionId = item.getId();
|
||||||
String conditionText=String.valueOf(item.getProperty("conditionText"));
|
String conditionText=String.valueOf(item.getProperty("conditionText"));
|
||||||
if (conditionText!=null && conditionText.contains("!"+CommString.ACTI_KEK_Condition)) {
|
// 检测退回路径:支持多种条件表达式格式
|
||||||
|
// ${!pass} / ${pass == false} / ${pass==false} / ${pass != true} / ${pass!=true}
|
||||||
|
boolean isRejectPath = conditionText != null && (
|
||||||
|
conditionText.contains("!"+CommString.ACTI_KEK_Condition) ||
|
||||||
|
conditionText.contains(CommString.ACTI_KEK_Condition+" == false") ||
|
||||||
|
conditionText.contains(CommString.ACTI_KEK_Condition+"==false") ||
|
||||||
|
conditionText.contains(CommString.ACTI_KEK_Condition+" != true") ||
|
||||||
|
conditionText.contains(CommString.ACTI_KEK_Condition+"!=true"));
|
||||||
|
if (isRejectPath) {
|
||||||
workTask.setPassFlag(false);
|
workTask.setPassFlag(false);
|
||||||
}else{
|
}else{
|
||||||
workTask.setPassFlag(true);
|
workTask.setPassFlag(true);
|
||||||
@ -382,12 +391,12 @@ public class WorkflowProcessDefinitionService {
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* 获取两节点的路径条件--20190710-王贤平
|
* 递归查找从sourceTaskDefId到destTaskDefId的路径条件,处理多层网关嵌套
|
||||||
|
* @param processDefId
|
||||||
* @param sourceTaskDefId
|
* @param sourceTaskDefId
|
||||||
* @param destTaskDefId
|
* @param destTaskDefId
|
||||||
* @param processDefId
|
|
||||||
* @param pvmTransitionId 出现多路径时,避免重复
|
* @param pvmTransitionId 出现多路径时,避免重复
|
||||||
* @return
|
* @return 带条件文本的路径(优先返回第一个含有条件的路径)
|
||||||
*/
|
*/
|
||||||
public PvmTransition getTransition(String processDefId,String sourceTaskDefId,String destTaskDefId,String pvmTransitionId) {
|
public PvmTransition getTransition(String processDefId,String sourceTaskDefId,String destTaskDefId,String pvmTransitionId) {
|
||||||
|
|
||||||
@ -397,24 +406,48 @@ public class WorkflowProcessDefinitionService {
|
|||||||
for(ActivityImpl activityImpl:activitiList){
|
for(ActivityImpl activityImpl:activitiList){
|
||||||
String id = activityImpl.getId();
|
String id = activityImpl.getId();
|
||||||
if(sourceTaskDefId.toLowerCase().equals(id.toLowerCase())){
|
if(sourceTaskDefId.toLowerCase().equals(id.toLowerCase())){
|
||||||
//获取从某个节点出来的所有子节点-网关
|
PvmTransition result = findTransitionToDestination(activityImpl.getOutgoingTransitions(), destTaskDefId, pvmTransitionId, null);
|
||||||
List<PvmTransition> outTransitions_gw = activityImpl.getOutgoingTransitions();
|
return result;
|
||||||
for(PvmTransition tr_gw:outTransitions_gw){
|
|
||||||
//获取线路的终点节点-网关
|
|
||||||
PvmActivity ac_gw = tr_gw.getDestination();
|
|
||||||
if(ac_gw.getId().equals(destTaskDefId) && !tr_gw.getId().equals(pvmTransitionId)){
|
|
||||||
return tr_gw;
|
|
||||||
}else{
|
|
||||||
List<PvmTransition> outTransitions =ac_gw.getOutgoingTransitions();
|
|
||||||
for(PvmTransition tr:outTransitions){
|
|
||||||
PvmActivity ac = tr.getDestination();
|
|
||||||
if(ac.getId().equals(destTaskDefId) && !tr.getId().equals(pvmTransitionId)){
|
|
||||||
return tr;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 递归遍历路径,查找目标节点,处理多层网关嵌套
|
||||||
|
* @param transitions 当前层的流出路径
|
||||||
|
* @param destTaskDefId 目标节点ID
|
||||||
|
* @param pvmTransitionId 需要跳过的路径ID
|
||||||
|
* @param firstConditionTransition 第一个含有条件文本的路径(优先返回)
|
||||||
|
* @return 带条件文本的路径,或直接到达目标的路径
|
||||||
|
*/
|
||||||
|
private PvmTransition findTransitionToDestination(List<PvmTransition> transitions, String destTaskDefId, String pvmTransitionId, PvmTransition firstConditionTransition) {
|
||||||
|
if (transitions == null || transitions.isEmpty()) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
for (PvmTransition tr : transitions) {
|
||||||
|
if (tr.getId().equals(pvmTransitionId)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
PvmActivity dest = tr.getDestination();
|
||||||
|
// 记录第一个含有条件文本的路径
|
||||||
|
PvmTransition conditionTransition = firstConditionTransition;
|
||||||
|
String conditionText = String.valueOf(tr.getProperty("conditionText"));
|
||||||
|
if (conditionTransition == null && conditionText != null && !conditionText.isEmpty() && !"null".equals(conditionText)) {
|
||||||
|
conditionTransition = tr;
|
||||||
|
}
|
||||||
|
// 直接找到目标节点
|
||||||
|
if (dest.getId().equals(destTaskDefId)) {
|
||||||
|
return conditionTransition != null ? conditionTransition : tr;
|
||||||
|
}
|
||||||
|
// 目标是网关,递归遍历
|
||||||
|
String destType = String.valueOf(dest.getProperty("type"));
|
||||||
|
if ("exclusiveGateway".equals(destType) || "parallelGateway".equals(destType)
|
||||||
|
|| "inclusiveGateway".equals(destType)) {
|
||||||
|
PvmTransition found = findTransitionToDestination(dest.getOutgoingTransitions(), destTaskDefId, pvmTransitionId, conditionTransition);
|
||||||
|
if (found != null) {
|
||||||
|
return found;
|
||||||
}
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -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;
|
||||||
@ -351,6 +354,8 @@ public class CommonFileServiceImpl implements CommonFileService {
|
|||||||
String errorMsg = e.getMessage();
|
String errorMsg = e.getMessage();
|
||||||
if (errorMsg != null && errorMsg.contains("NoSuchKey")) {
|
if (errorMsg != null && errorMsg.contains("NoSuchKey")) {
|
||||||
logger.error("MinIO文件不存在: bucketName={}, objectName={}", nameSpace, filePath);
|
logger.error("MinIO文件不存在: bucketName={}, objectName={}", nameSpace, filePath);
|
||||||
|
} else if (errorMsg != null && errorMsg.contains("NoSuchBucket")) {
|
||||||
|
logger.error("MinIO存储桶不存在: bucketName={}, objectName={}", nameSpace, filePath);
|
||||||
} else {
|
} else {
|
||||||
logger.error("获取MinIO文件失败: bucketName={}, objectName={}, 错误: {}", nameSpace, filePath, errorMsg, e);
|
logger.error("获取MinIO文件失败: bucketName={}, objectName={}, 错误: {}", nameSpace, filePath, errorMsg, e);
|
||||||
}
|
}
|
||||||
@ -389,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);
|
||||||
@ -398,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);
|
||||||
|
|||||||
@ -112,17 +112,24 @@ public class BusinessUnitAuditService implements CommService<BusinessUnitAudit>{
|
|||||||
}
|
}
|
||||||
List<HistoricActivityInstance> list=historyService.createHistoricActivityInstanceQuery().processInstanceId(entity.getProcessid()).activityId(wortTaskId)
|
List<HistoricActivityInstance> list=historyService.createHistoricActivityInstanceQuery().processInstanceId(entity.getProcessid()).activityId(wortTaskId)
|
||||||
.orderByHistoricActivityInstanceStartTime().desc().list();
|
.orderByHistoricActivityInstanceStartTime().desc().list();
|
||||||
if (list != null && list.size()>0) {
|
// 优先取历史记录中的 assignee;若 assignee 为空(候选人任务未签收),则查 BusinessUnitAudit 记录获取实际提交人
|
||||||
variables.put(CommString.ACTI_KEK_Assignee, list.get(0).getAssignee());
|
String targetAssignee = null;
|
||||||
|
if (list != null && list.size() > 0) {
|
||||||
|
targetAssignee = list.get(0).getAssignee();
|
||||||
|
}
|
||||||
|
if (targetAssignee == null && !wortTaskId.isEmpty()) {
|
||||||
|
// 历史 assignee 为空时,从 BusinessUnitAudit 记录中查找该步骤的实际提交人
|
||||||
|
List<BusinessUnitAudit> previousAuditList = this.selectListByWhere(
|
||||||
|
"where businessid='" + entity.getBusinessid() + "' and taskdefinitionkey='" + wortTaskId + "' order by insdt desc");
|
||||||
|
if (previousAuditList != null && previousAuditList.size() > 0) {
|
||||||
|
targetAssignee = previousAuditList.get(0).getInsuser();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// 设置退回目标处理人(若仍为空则由流程变量 userIds 确定候选人,不再回退到工单创建人)
|
||||||
|
variables.put(CommString.ACTI_KEK_Assignee, targetAssignee);
|
||||||
if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){
|
if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){
|
||||||
taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion());
|
taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion());
|
||||||
}
|
}
|
||||||
}else {
|
|
||||||
variables.put(CommString.ACTI_KEK_Assignee, businessUnitAdapter.getInsuser());
|
|
||||||
if(entity.getAuditopinion()!=null && !entity.getAuditopinion().isEmpty()){
|
|
||||||
taskService.addComment(entity.getTaskid(), entity.getProcessid(), entity.getAuditopinion());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//int res=0;
|
//int res=0;
|
||||||
taskService.complete(entity.getTaskid(), variables);
|
taskService.complete(entity.getTaskid(), variables);
|
||||||
@ -141,17 +148,24 @@ public class BusinessUnitAuditService implements CommService<BusinessUnitAudit>{
|
|||||||
BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity);
|
BusinessUnitRecord businessUnitRecord = new BusinessUnitRecord(entity);
|
||||||
if(entity.getPassstatus()){
|
if(entity.getPassstatus()){
|
||||||
//通过
|
//通过
|
||||||
if(variables.get(CommString.ACTI_KEK_Candidate_Users)!=null){
|
String candidateUsers = variables.get(CommString.ACTI_KEK_Candidate_Users) != null
|
||||||
businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Candidate_Users).toString(),"");
|
? variables.get(CommString.ACTI_KEK_Candidate_Users).toString() : null;
|
||||||
|
if(candidateUsers != null && !candidateUsers.isEmpty()){
|
||||||
|
// 有下一步接收人,通知下一步处理人
|
||||||
|
businessUnitRecord.sendMessage(candidateUsers, "");
|
||||||
|
}else if(variables.get(CommString.ACTI_KEK_AssigneeList) != null){
|
||||||
|
// 会签
|
||||||
|
businessUnitRecord.sendMessage(entity.getTargetusers(), "");
|
||||||
}else{
|
}else{
|
||||||
//会签
|
// 最后一步,无下一步处理人,通知当前提交人(完成确认)
|
||||||
if(variables.get(CommString.ACTI_KEK_AssigneeList)!=null){
|
if(entity.getInsuser() != null && !entity.getInsuser().isEmpty()){
|
||||||
businessUnitRecord.sendMessage(entity.getTargetusers(),"");
|
businessUnitRecord.sendMessage(entity.getInsuser(), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}else{
|
}else{
|
||||||
if(variables.get(CommString.ACTI_KEK_Assignee)!=null){
|
// 退回:通知目标处理人(排除空值,避免错误发送)
|
||||||
businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Assignee).toString(),"");
|
if(variables.get(CommString.ACTI_KEK_Assignee) != null){
|
||||||
|
businessUnitRecord.sendMessage(variables.get(CommString.ACTI_KEK_Assignee).toString(), "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.sipai.service.report;
|
|||||||
|
|
||||||
import com.sipai.entity.business.BusinessUnitAudit;
|
import com.sipai.entity.business.BusinessUnitAudit;
|
||||||
import com.sipai.entity.report.RptCreate;
|
import com.sipai.entity.report.RptCreate;
|
||||||
|
import com.sipai.entity.user.User;
|
||||||
import org.xmlpull.v1.XmlPullParserException;
|
import org.xmlpull.v1.XmlPullParserException;
|
||||||
|
|
||||||
import javax.xml.parsers.ParserConfigurationException;
|
import javax.xml.parsers.ParserConfigurationException;
|
||||||
@ -45,4 +46,11 @@ public interface RptCreateService {
|
|||||||
|
|
||||||
//改变状态
|
//改变状态
|
||||||
public abstract int updateStatus(String id);
|
public abstract int updateStatus(String id);
|
||||||
|
|
||||||
|
/** 检查用户是否有报表生成权限
|
||||||
|
* @param rptInfoSetId 报表配置id
|
||||||
|
* @param user 当前用户
|
||||||
|
* @return true=有权限, false=无权限
|
||||||
|
*/
|
||||||
|
public abstract boolean checkGeneratePermission(String rptInfoSetId, User user);
|
||||||
}
|
}
|
||||||
@ -60,4 +60,18 @@ public interface RptDayLogService {
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public abstract Result onekeyAudit(String ids ,User cu,String rptdeptId);
|
public abstract Result onekeyAudit(String ids ,User cu,String rptdeptId);
|
||||||
|
|
||||||
|
/** 检查用户是否有填报权限
|
||||||
|
* @param rptdeptId 填报配置id
|
||||||
|
* @param user 当前用户
|
||||||
|
* @return true=有权限, false=无权限
|
||||||
|
*/
|
||||||
|
public abstract boolean checkInputPermission(String rptdeptId, User user);
|
||||||
|
|
||||||
|
/** 检查用户是否有生成权限
|
||||||
|
* @param rptdeptId 填报配置id
|
||||||
|
* @param user 当前用户
|
||||||
|
* @return true=有权限, false=无权限
|
||||||
|
*/
|
||||||
|
public abstract boolean checkGeneratePermission(String rptdeptId, User user);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -72,6 +72,14 @@ public interface RptInfoSetService {
|
|||||||
*/
|
*/
|
||||||
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);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param list_result
|
* @param list_result
|
||||||
|
|||||||
@ -13,6 +13,7 @@ import com.sipai.entity.report.*;
|
|||||||
import com.sipai.entity.scada.MPoint;
|
import com.sipai.entity.scada.MPoint;
|
||||||
import com.sipai.entity.scada.TempReport;
|
import com.sipai.entity.scada.TempReport;
|
||||||
import com.sipai.entity.user.User;
|
import com.sipai.entity.user.User;
|
||||||
|
import com.sipai.entity.user.UserJob;
|
||||||
import com.sipai.entity.work.GroupDetail;
|
import com.sipai.entity.work.GroupDetail;
|
||||||
import com.sipai.entity.work.Scheduling;
|
import com.sipai.entity.work.Scheduling;
|
||||||
import com.sipai.service.activiti.WorkflowProcessDefinitionService;
|
import com.sipai.service.activiti.WorkflowProcessDefinitionService;
|
||||||
@ -24,6 +25,7 @@ import com.sipai.service.report.*;
|
|||||||
import com.sipai.service.scada.MPointService;
|
import com.sipai.service.scada.MPointService;
|
||||||
import com.sipai.service.scada.TempReportService;
|
import com.sipai.service.scada.TempReportService;
|
||||||
import com.sipai.service.user.UserService;
|
import com.sipai.service.user.UserService;
|
||||||
|
import com.sipai.service.user.UserJobService;
|
||||||
import com.sipai.service.work.GroupDetailService;
|
import com.sipai.service.work.GroupDetailService;
|
||||||
import com.sipai.service.work.SchedulingService;
|
import com.sipai.service.work.SchedulingService;
|
||||||
import com.sipai.tools.*;
|
import com.sipai.tools.*;
|
||||||
@ -107,6 +109,8 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
private BusinessUnitHandleDetailService businessUnitHandleDetailService;
|
private BusinessUnitHandleDetailService businessUnitHandleDetailService;
|
||||||
@Resource
|
@Resource
|
||||||
private GroupDetailService groupDetailService;
|
private GroupDetailService groupDetailService;
|
||||||
|
@Resource
|
||||||
|
private UserJobService userJobService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RptCreate selectById(String id) {
|
public RptCreate selectById(String id) {
|
||||||
@ -833,6 +837,20 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
// System.out.println("rptdt==============================================================" + rptdt);
|
// System.out.println("rptdt==============================================================" + rptdt);
|
||||||
String rpttype = rptInfoSet.getRpttype();//报表类型
|
String rpttype = rptInfoSet.getRpttype();//报表类型
|
||||||
String bucketName = "rptinfosetfile";
|
String bucketName = "rptinfosetfile";
|
||||||
|
String endtype = ".xls"; // 默认文件扩展名
|
||||||
|
|
||||||
|
// 首先确保report bucket存在
|
||||||
|
try {
|
||||||
|
MinioClient minioClient = new MinioClient(minioProp.getEndPoint(), minioProp.getAccessKey(), minioProp.getSecretKey());
|
||||||
|
boolean isExist = minioClient.bucketExists("report");
|
||||||
|
if (!isExist) {
|
||||||
|
minioClient.makeBucket("report");
|
||||||
|
logger.info("Created MinIO bucket: report");
|
||||||
|
}
|
||||||
|
} catch (Exception e) {
|
||||||
|
logger.error("Failed to create report bucket", e);
|
||||||
|
}
|
||||||
|
|
||||||
List<RptInfoSetFile> filelist = this.rptInfoSetFileService.selectListByWhere(" where masterid='" + rptInfoSet.getId() + "' ");
|
List<RptInfoSetFile> filelist = this.rptInfoSetFileService.selectListByWhere(" where masterid='" + rptInfoSet.getId() + "' ");
|
||||||
String path = "";
|
String path = "";
|
||||||
try {
|
try {
|
||||||
@ -843,7 +861,11 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
rptInfoSetFile.setAbspath(obj);
|
rptInfoSetFile.setAbspath(obj);
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
System.out.println(e);
|
logger.error("Failed to get template file from MinIO", e);
|
||||||
|
}
|
||||||
|
if (filelist == null || filelist.size() == 0) {
|
||||||
|
logger.error("No template file configured for report: {}", rptInfoSet.getId());
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
if (filelist != null && filelist.size() > 0) {
|
if (filelist != null && filelist.size() > 0) {
|
||||||
// 设定Excel文件所在路径
|
// 设定Excel文件所在路径
|
||||||
@ -854,7 +876,7 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
byte[] bytes_m = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
|
byte[] bytes_m = commonFileService.getInputStreamBytes(FileNameSpaceEnum.RptInfoSetFile.getNameSpace(), path);
|
||||||
// Check if bytes_m is null or empty
|
// Check if bytes_m is null or empty
|
||||||
if (bytes_m == null || bytes_m.length == 0) {
|
if (bytes_m == null || bytes_m.length == 0) {
|
||||||
logger.error("Excel file is empty or not found: " + path);
|
logger.error("Excel template file is empty or not found: {}", path);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
// 直接从本地文件创建Workbook, 从输入流创建Workbook
|
// 直接从本地文件创建Workbook, 从输入流创建Workbook
|
||||||
@ -866,7 +888,8 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
logger.error("Failed to create workbook from file: " + path, e);
|
logger.error("Failed to create workbook from file: " + path, e);
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
String endtype = path.toLowerCase().endsWith(".xlsx") ? ".xlsx" : ".xls";
|
// 更新文件扩展名(根据模板文件)
|
||||||
|
endtype = path.toLowerCase().endsWith(".xlsx") ? ".xlsx" : ".xls";
|
||||||
// 生成一个样式,用在表格数据
|
// 生成一个样式,用在表格数据
|
||||||
CellStyle listStyle = null;
|
CellStyle listStyle = null;
|
||||||
listStyle = workbook.createCellStyle();
|
listStyle = workbook.createCellStyle();
|
||||||
@ -1374,6 +1397,10 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
//删除文件 只保留minio中的文件
|
//删除文件 只保留minio中的文件
|
||||||
File file = new File(file3);//根据指定的文件名创建File对象
|
File file = new File(file3);//根据指定的文件名创建File对象
|
||||||
file.delete();
|
file.delete();
|
||||||
|
|
||||||
|
// 保存文件路径到数据库
|
||||||
|
rptCreate.setAbspath(showname + endtype);
|
||||||
|
rptCreateDao.updateByPrimaryKeySelective(rptCreate);
|
||||||
} catch (NoSuchAlgorithmException e) {
|
} catch (NoSuchAlgorithmException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@ -1912,4 +1939,54 @@ public class RptCreateServiceImpl implements RptCreateService {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 检查用户是否有报表生成权限
|
||||||
|
* @param rptInfoSetId 报表配置id
|
||||||
|
* @param user 当前用户
|
||||||
|
* @return true=有权限, false=无权限
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public boolean checkGeneratePermission(String rptInfoSetId, User user) {
|
||||||
|
if (user == null || rptInfoSetId == null || rptInfoSetId.isEmpty()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 管理员默认有权限
|
||||||
|
if ("emp01".equals(user.getId())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 获取报表配置信息
|
||||||
|
RptInfoSet rptInfoSet = rptInfoSetService.selectById4Simple(rptInfoSetId);
|
||||||
|
if (rptInfoSet == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
String userId = user.getId();
|
||||||
|
|
||||||
|
// 检查用户是否在createusers列表中
|
||||||
|
String createusers = rptInfoSet.getCreateusers();
|
||||||
|
if (createusers != null && !createusers.isEmpty()) {
|
||||||
|
if (createusers.contains(userId)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查用户岗位是否在generate_position列表中
|
||||||
|
String generatePosition = rptInfoSet.getGeneratePosition();
|
||||||
|
if (generatePosition != null && !generatePosition.isEmpty()) {
|
||||||
|
// 获取用户的所有岗位
|
||||||
|
List<UserJob> userJobs = userJobService.selectListByWhere(" where userid='" + userId + "'");
|
||||||
|
if (userJobs != null && !userJobs.isEmpty()) {
|
||||||
|
for (UserJob userJob : userJobs) {
|
||||||
|
if (generatePosition.contains(userJob.getJobid())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,16 +10,19 @@ import com.sipai.entity.scada.MPoint;
|
|||||||
import com.sipai.entity.scada.MPointExpand;
|
import com.sipai.entity.scada.MPointExpand;
|
||||||
import com.sipai.entity.scada.MPointHistory;
|
import com.sipai.entity.scada.MPointHistory;
|
||||||
import com.sipai.entity.user.User;
|
import com.sipai.entity.user.User;
|
||||||
|
import com.sipai.entity.user.UserJob;
|
||||||
import com.sipai.service.msg.MsgService;
|
import com.sipai.service.msg.MsgService;
|
||||||
import com.sipai.service.msg.MsgServiceImpl;
|
import com.sipai.service.msg.MsgServiceImpl;
|
||||||
import com.sipai.service.msg.MsgTypeService;
|
import com.sipai.service.msg.MsgTypeService;
|
||||||
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;
|
||||||
import com.sipai.service.user.UserService;
|
import com.sipai.service.user.UserService;
|
||||||
|
import com.sipai.service.user.UserJobService;
|
||||||
import com.sipai.tools.CommUtil;
|
import com.sipai.tools.CommUtil;
|
||||||
import com.sipai.tools.SpringContextUtil;
|
import com.sipai.tools.SpringContextUtil;
|
||||||
import net.sf.json.JSONArray;
|
import net.sf.json.JSONArray;
|
||||||
@ -65,6 +68,11 @@ public class RptDayLogServiceImpl implements RptDayLogService {
|
|||||||
private MsgTypeService msgtypeService;
|
private MsgTypeService msgtypeService;
|
||||||
@Resource
|
@Resource
|
||||||
private MPointExpandService mPointExpandService;
|
private MPointExpandService mPointExpandService;
|
||||||
|
@Resource
|
||||||
|
private UserJobService userJobService;
|
||||||
|
|
||||||
|
@Resource
|
||||||
|
private RptInfoSetService rptInfoSetService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public RptDayLog selectById(String id) {
|
public RptDayLog selectById(String id) {
|
||||||
@ -878,4 +886,87 @@ public class RptDayLogServiceImpl implements RptDayLogService {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkInputPermission(String rptdeptId, User user) {
|
||||||
|
if (rptdeptId == null || user == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
RptDeptSet rptDeptSet = this.rptDeptSetService.selectById(rptdeptId);
|
||||||
|
if (rptDeptSet == null) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
Integer roleType = rptDeptSet.getRoleType();
|
||||||
|
String inputuser = rptDeptSet.getInputuser();
|
||||||
|
String inputjob = rptDeptSet.getInputjob();
|
||||||
|
String userId = user.getId();
|
||||||
|
|
||||||
|
// role_type=2: 不控制权限,所有人都可以填报
|
||||||
|
if (roleType != null && roleType == 2) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// role_type 为 null 或空字符串: 允许所有人
|
||||||
|
if (roleType == null || roleType == 0 && (inputuser == null || inputuser.isEmpty())
|
||||||
|
|| roleType == 1 && (inputjob == null || inputjob.isEmpty())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// role_type=0: 按用户控制权限
|
||||||
|
if (roleType == 0) {
|
||||||
|
if (inputuser != null && !inputuser.isEmpty()) {
|
||||||
|
// 检查当前用户ID是否在inputuser中
|
||||||
|
String[] userIds = inputuser.split(",");
|
||||||
|
for (String uid : userIds) {
|
||||||
|
if (userId.equals(uid.trim())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// role_type=1: 按岗位控制权限
|
||||||
|
if (roleType == 1) {
|
||||||
|
if (inputjob != null && !inputjob.isEmpty()) {
|
||||||
|
// 获取当前用户的所有岗位
|
||||||
|
List<UserJob> userJobs = this.userJobService.selectListByWhere("where userid = '" + userId + "'");
|
||||||
|
if (userJobs != null && !userJobs.isEmpty()) {
|
||||||
|
String[] jobIds = inputjob.split(",");
|
||||||
|
for (UserJob userJob : userJobs) {
|
||||||
|
String userJobId = userJob.getJobid();
|
||||||
|
for (String jobId : jobIds) {
|
||||||
|
if (userJobId != null && userJobId.equals(jobId.trim())) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,12 +47,22 @@ public class SafetyCheckActivityService {
|
|||||||
if (processDefinitions == null || processDefinitions.size() == 0) {
|
if (processDefinitions == null || processDefinitions.size() == 0) {
|
||||||
return Result.failed(company.getName() + "缺少该流程定义。");
|
return Result.failed(company.getName() + "缺少该流程定义。");
|
||||||
}
|
}
|
||||||
|
// 防止重复发起:若该业务已有运行中的流程实例,则跳过,避免创建双倍待办任务
|
||||||
|
List<org.activiti.engine.runtime.ProcessInstance> existingInstances = workflowService.getRuntimeService()
|
||||||
|
.createProcessInstanceQuery()
|
||||||
|
.processDefinitionKey(processKey)
|
||||||
|
.processInstanceBusinessKey(bizId)
|
||||||
|
.active()
|
||||||
|
.list();
|
||||||
|
if (existingInstances != null && !existingInstances.isEmpty()) {
|
||||||
|
return Result.success();
|
||||||
|
}
|
||||||
// 启动流程实例
|
// 启动流程实例
|
||||||
// 设置网关条件
|
// 设置网关条件
|
||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put(CommString.ACTI_KEK_Condition, 1);
|
map.put(CommString.ACTI_KEK_Condition, 1);
|
||||||
map.put(CommString.ACTI_KEK_Assignee, applyUserId);
|
map.put(CommString.ACTI_KEK_Assignee, applyUserId);
|
||||||
map.put(CommString.ACTI_KEK_Candidate_Users, applyUserId);
|
map.put(CommString.ACTI_KEK_Candidate_Users, "");
|
||||||
|
|
||||||
// 启动流程
|
// 启动流程
|
||||||
ProcessInstance processInstance = workflowService.startWorkflow(
|
ProcessInstance processInstance = workflowService.startWorkflow(
|
||||||
@ -71,7 +81,7 @@ public class SafetyCheckActivityService {
|
|||||||
Map<String, Object> map2 = new HashMap<>();
|
Map<String, Object> map2 = new HashMap<>();
|
||||||
map2.put(CommString.ACTI_KEK_Condition, 1);
|
map2.put(CommString.ACTI_KEK_Condition, 1);
|
||||||
map2.put(CommString.ACTI_KEK_Assignee, nextUserId);
|
map2.put(CommString.ACTI_KEK_Assignee, nextUserId);
|
||||||
map2.put(CommString.ACTI_KEK_Candidate_Users, nextUserId);
|
map2.put(CommString.ACTI_KEK_Candidate_Users, "");
|
||||||
workflowService.getTaskService().complete(task.getId(), map2);
|
workflowService.getTaskService().complete(task.getId(), map2);
|
||||||
|
|
||||||
return Result.success();
|
return Result.success();
|
||||||
@ -91,10 +101,9 @@ public class SafetyCheckActivityService {
|
|||||||
Map<String, Object> map = new HashMap<>();
|
Map<String, Object> map = new HashMap<>();
|
||||||
map.put(CommString.ACTI_KEK_Condition, pass);
|
map.put(CommString.ACTI_KEK_Condition, pass);
|
||||||
map.put(CommString.ACTI_KEK_Assignee, nextUserId);
|
map.put(CommString.ACTI_KEK_Assignee, nextUserId);
|
||||||
map.put(CommString.ACTI_KEK_Candidate_Users, nextUserId);
|
map.put(CommString.ACTI_KEK_Candidate_Users, "");
|
||||||
for (Task task : tasks) {
|
// 只完成第一个任务,防止多任务场景下指数级创建待办(如因重复发起导致有多个并发任务时)
|
||||||
workflowService.getTaskService().complete(task.getId(), map);
|
workflowService.getTaskService().complete(tasks.get(0).getId(), map);
|
||||||
}
|
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -101,6 +101,9 @@ public class SafetyFilesService implements CommService<SafetyFiles> {
|
|||||||
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
|
||||||
List<MultipartFile> files = multipartRequest.getFiles("file");
|
List<MultipartFile> files = multipartRequest.getFiles("file");
|
||||||
for (MultipartFile mfile : files) {
|
for (MultipartFile mfile : files) {
|
||||||
|
if (mfile == null || mfile.getSize() == 0) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
String suffix = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
String suffix = mfile.getOriginalFilename().substring(mfile.getOriginalFilename().lastIndexOf("."));
|
||||||
|
|
||||||
//判断保存文件的路径是否存在
|
//判断保存文件的路径是否存在
|
||||||
|
|||||||
@ -100,44 +100,65 @@ public class SafetyFlowTaskService implements CommService<SafetyFlowTask> {
|
|||||||
String copyNames,
|
String copyNames,
|
||||||
String record) throws ServiceException {
|
String record) throws ServiceException {
|
||||||
|
|
||||||
SafetyFlowTask safetyFlowTask;
|
SafetyFlowTask safetyFlowTask = null;
|
||||||
List<SafetyFlowTask> list = selectListByWhere(" where biz_id='" + bizId + "' order by create_time desc");
|
List<SafetyFlowTask> list = selectListByWhere(" where biz_id='" + bizId + "' order by create_time desc");
|
||||||
if (list != null && list.size() != 0 && list.get(0).getTaskName().equals(taskTitle)) {
|
|
||||||
safetyFlowTask = list.get(0);
|
|
||||||
safetyFlowTask.setIsDone(true);
|
|
||||||
safetyFlowTask.setCopy(copyNames);
|
|
||||||
safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
|
||||||
update(safetyFlowTask);
|
|
||||||
} else if (list != null && list.size() != 0 && !list.get(0).getTaskName().equals(taskTitle)) {
|
|
||||||
safetyFlowTask = list.get(0);
|
|
||||||
safetyFlowTask.setIsDone(true);
|
|
||||||
safetyFlowTask.setCopy(copyNames);
|
|
||||||
safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
|
||||||
update(safetyFlowTask);
|
|
||||||
|
|
||||||
safetyFlowTask = new SafetyFlowTask();
|
// 查找是否已存在相同taskTitle的记录
|
||||||
|
SafetyFlowTask existingTask = null;
|
||||||
safetyFlowTask.setId(UUID.randomUUID().toString());
|
if (list != null && !list.isEmpty()) {
|
||||||
safetyFlowTask.setBizId(bizId);
|
for (SafetyFlowTask task : list) {
|
||||||
safetyFlowTask.setTaskName(taskTitle);
|
if (task.getTaskName().equals(taskTitle)) {
|
||||||
safetyFlowTask.setIsDone(isDone);
|
existingTask = task;
|
||||||
safetyFlowTask.setDoneTime(isDone ? DateUtil.toStr(null, new Date()) : null);
|
break;
|
||||||
safetyFlowTask.setAuditor(auditorName);
|
}
|
||||||
safetyFlowTask.setCopy(copyNames);
|
}
|
||||||
save(safetyFlowTask);
|
}
|
||||||
|
|
||||||
|
if (isDone) {
|
||||||
|
// 标记任务为完成
|
||||||
|
if (existingTask != null) {
|
||||||
|
// 更新已存在的记录
|
||||||
|
existingTask.setIsDone(true);
|
||||||
|
existingTask.setCopy(copyNames);
|
||||||
|
existingTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
||||||
|
update(existingTask);
|
||||||
|
safetyFlowTask = existingTask;
|
||||||
} else {
|
} else {
|
||||||
|
// 创建新的完成记录
|
||||||
safetyFlowTask = new SafetyFlowTask();
|
safetyFlowTask = new SafetyFlowTask();
|
||||||
|
|
||||||
safetyFlowTask.setId(UUID.randomUUID().toString());
|
safetyFlowTask.setId(UUID.randomUUID().toString());
|
||||||
safetyFlowTask.setBizId(bizId);
|
safetyFlowTask.setBizId(bizId);
|
||||||
safetyFlowTask.setTaskName(taskTitle);
|
safetyFlowTask.setTaskName(taskTitle);
|
||||||
safetyFlowTask.setIsDone(isDone);
|
safetyFlowTask.setIsDone(true);
|
||||||
safetyFlowTask.setDoneTime(isDone ? DateUtil.toStr(null, new Date()) : null);
|
safetyFlowTask.setDoneTime(DateUtil.toStr(null, new Date()));
|
||||||
safetyFlowTask.setAuditor(auditorName);
|
safetyFlowTask.setAuditor(auditorName);
|
||||||
safetyFlowTask.setCopy(copyNames);
|
safetyFlowTask.setCopy(copyNames);
|
||||||
save(safetyFlowTask);
|
save(safetyFlowTask);
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// 创建待处理任务
|
||||||
|
if (existingTask == null) {
|
||||||
|
// 不存在才创建
|
||||||
|
safetyFlowTask = new SafetyFlowTask();
|
||||||
|
safetyFlowTask.setId(UUID.randomUUID().toString());
|
||||||
|
safetyFlowTask.setBizId(bizId);
|
||||||
|
safetyFlowTask.setTaskName(taskTitle);
|
||||||
|
safetyFlowTask.setIsDone(false);
|
||||||
|
safetyFlowTask.setDoneTime(null);
|
||||||
|
safetyFlowTask.setAuditor(auditorName);
|
||||||
|
safetyFlowTask.setCopy(copyNames);
|
||||||
|
save(safetyFlowTask);
|
||||||
|
} else {
|
||||||
|
// 已存在,重置为待处理状态(用于流程回退后重新处理)
|
||||||
|
existingTask.setIsDone(false);
|
||||||
|
existingTask.setDoneTime(null);
|
||||||
|
existingTask.setAuditor(auditorName);
|
||||||
|
existingTask.setCopy(copyNames);
|
||||||
|
update(existingTask);
|
||||||
|
safetyFlowTask = existingTask;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (StringUtils.isNotEmpty(record)) {
|
if (StringUtils.isNotEmpty(record)) {
|
||||||
SafetyFlowTaskDetail safetyFlowTaskDetail = new SafetyFlowTaskDetail();
|
SafetyFlowTaskDetail safetyFlowTaskDetail = new SafetyFlowTaskDetail();
|
||||||
safetyFlowTaskDetail.setId(UUID.randomUUID().toString());
|
safetyFlowTaskDetail.setId(UUID.randomUUID().toString());
|
||||||
|
|||||||
@ -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,13 +26,16 @@ 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
|
||||||
@ -71,16 +74,16 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
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;
|
||||||
@ -112,27 +115,29 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
if (processSection != null) {
|
if (processSection != null) {
|
||||||
item.setProcessSection(processSection);
|
item.setProcessSection(processSection);
|
||||||
}
|
}
|
||||||
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere4Pure("where sewage_id='"+item.getContractNumber()+"' order by insdt");
|
List<SewageInput> sewageInputList = this.sewageInputService.selectListByWhere4Pure("where sewage_id='" + item.getContractNumber() + "' order by insdt");
|
||||||
if(sewageInputList!=null && sewageInputList.size()>0){
|
if (sewageInputList != null && sewageInputList.size() > 0) {
|
||||||
item.set_input(true);
|
item.set_input(true);
|
||||||
}else{
|
} 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
|
@Override
|
||||||
public int deleteByWhere(String wherestr) {
|
public int deleteByWhere(String wherestr) {
|
||||||
Sewage sewage = new Sewage();
|
Sewage sewage = new Sewage();
|
||||||
sewage.setWhere(wherestr);
|
sewage.setWhere(wherestr);
|
||||||
return SewageDao.deleteByWhere(sewage);
|
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);
|
||||||
@ -140,6 +145,28 @@ public class SewageService implements CommService<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文件数据转换
|
||||||
*
|
*
|
||||||
@ -171,7 +198,9 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
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) {
|
||||||
@ -203,7 +232,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
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));
|
||||||
@ -224,9 +253,9 @@ 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)));
|
||||||
@ -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);
|
||||||
@ -259,8 +288,8 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
|
|
||||||
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);
|
||||||
@ -269,7 +298,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
} else {
|
} else {
|
||||||
failNum++;
|
failNum++;
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
|
|
||||||
int result = this.save(sewage);
|
int result = this.save(sewage);
|
||||||
if (result == 1) {
|
if (result == 1) {
|
||||||
@ -294,7 +323,11 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
}
|
}
|
||||||
|
|
||||||
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();
|
||||||
@ -418,13 +451,13 @@ 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++) {
|
||||||
@ -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,8 +605,33 @@ 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
|
* @方法名:getTreeList
|
||||||
* @参数 @param
|
* @参数 @param
|
||||||
* @参数 @return
|
* @参数 @return
|
||||||
@ -581,22 +639,22 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
*/
|
*/
|
||||||
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,7 +662,7 @@ 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);
|
||||||
@ -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);
|
||||||
@ -650,7 +708,7 @@ public class SewageService implements CommService<Sewage>{
|
|||||||
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);
|
||||||
|
|||||||
@ -132,6 +132,7 @@ public class PatrolContentsServiceImpl implements PatrolContentsService {
|
|||||||
jsonObject.put("id", list3.get(j).getId());
|
jsonObject.put("id", list3.get(j).getId());
|
||||||
jsonObject.put("name", list3.get(j).getContents());
|
jsonObject.put("name", list3.get(j).getContents());
|
||||||
jsonObject.put("text", list3.get(j).getContents());
|
jsonObject.put("text", list3.get(j).getContents());
|
||||||
|
jsonObject.put("contentsDetail", list3.get(j).getContentsDetail());
|
||||||
jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Equipment);
|
jsonObject.put("type", TimeEfficiencyCommStr.PatrolEquipment_Equipment);
|
||||||
jsonObject.put("icon", TimeEfficiencyCommStr.PatrolContents);
|
jsonObject.put("icon", TimeEfficiencyCommStr.PatrolContents);
|
||||||
jsonArrayEqu.add(jsonObject);
|
jsonArrayEqu.add(jsonObject);
|
||||||
|
|||||||
261
src/main/java/com/sipai/tools/DeviceAccessHttpUtil.java
Normal file
261
src/main/java/com/sipai/tools/DeviceAccessHttpUtil.java
Normal file
@ -0,0 +1,261 @@
|
|||||||
|
package com.sipai.tools;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
import javax.crypto.Cipher;
|
||||||
|
import javax.crypto.spec.SecretKeySpec;
|
||||||
|
import java.nio.charset.StandardCharsets;
|
||||||
|
import java.util.Base64;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备HTTP访问工具类:
|
||||||
|
* <ul>
|
||||||
|
* <li>发送时自动填充设备相关请求头</li>
|
||||||
|
* <li>接收时解析并校验请求头,防止重放、参数篡改、时间戳过期等安全风险</li>
|
||||||
|
* <li>提供AES加密/解密工具,保护敏感信息</li>
|
||||||
|
* <li>支持配置化密钥和时间戳有效期,便于运维和安全加固</li>
|
||||||
|
* </ul>
|
||||||
|
* <p>
|
||||||
|
* 主要头部:
|
||||||
|
* Dh-Device-Ip、Dh-Device-User、Dh-Device-Password、Dh-Device-Timestamp、Dh-Device-Port
|
||||||
|
* <p>
|
||||||
|
* 推荐通过Spring注入本工具类,避免静态方法带来的配置注入问题。
|
||||||
|
*/
|
||||||
|
@Component
|
||||||
|
public class DeviceAccessHttpUtil {
|
||||||
|
/**
|
||||||
|
* AES加密密钥,长度16位。可通过配置覆盖,避免硬编码泄露。
|
||||||
|
*/
|
||||||
|
private static String AES_KEY = "NetSDK1234567890"; // 16位密钥
|
||||||
|
@Value("${crypto.aes-key:NetSDK1234567890}")
|
||||||
|
public void setAesKey(String aesKey) {
|
||||||
|
String key = aesKey == null ? "" : aesKey.trim();
|
||||||
|
if (key.length() != 16 && key.length() != 24 && key.length() != 32) {
|
||||||
|
throw new IllegalArgumentException("crypto.aes-key length must be 16/24/32");
|
||||||
|
}
|
||||||
|
AES_KEY = key;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备请求时间戳有效期(毫秒),默认5分钟。可通过配置覆盖。
|
||||||
|
* 注意:内部会转换为微秒进行比较,以支持微秒级时间戳精度。
|
||||||
|
*/
|
||||||
|
private static long TIMESTAMP_EXPIRE_MS = 300000L;
|
||||||
|
@Value("${device.timestamp.expire-ms:300000}")
|
||||||
|
public void setTimestampExpireMs(long timestampExpireMs) {
|
||||||
|
TIMESTAMP_EXPIRE_MS = timestampExpireMs;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String ALGORITHM = "AES";
|
||||||
|
|
||||||
|
// 设备 HTTP 头部 key 常量,便于全局复用和维护
|
||||||
|
public static final String HEADER_DEVICE_IP = "Dh-Device-Ip";
|
||||||
|
public static final String HEADER_DEVICE_USER = "Dh-Device-User";
|
||||||
|
public static final String HEADER_DEVICE_PASSWORD = "Dh-Device-Password";
|
||||||
|
public static final String HEADER_DEVICE_TIMESTAMP = "Dh-Device-Timestamp";
|
||||||
|
public static final String HEADER_DEVICE_PORT = "Dh-Device-Port";
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 防重放 nonce 集合及最大容量,防止同一加密串被多次使用。
|
||||||
|
*/
|
||||||
|
private static final int NONCE_SET_MAX_SIZE = 10000;
|
||||||
|
private static final java.util.Set<String> usedNonceSet = java.util.Collections.synchronizedSet(new java.util.LinkedHashSet<>());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 构造设备访问请求头,自动加密密码并填充所有必需字段。
|
||||||
|
* 使用方式:获取返回结果,遍历map kv,直接填充到请求头。
|
||||||
|
* @param ip 设备IP
|
||||||
|
* @param user 用户名
|
||||||
|
* @param password 明文密码
|
||||||
|
* @param timestamp 时间戳(建议用System.nanoTime()获取微秒级时间戳)
|
||||||
|
* @param port 端口号
|
||||||
|
* @return 设备请求头Map
|
||||||
|
* @throws Exception 加密异常
|
||||||
|
*/
|
||||||
|
public static Map<String, String> buildDeviceHeaders(String ip, String user, String password, String timestamp, String port) throws Exception {
|
||||||
|
Map<String, String> headers = new HashMap<>();
|
||||||
|
headers.put(HEADER_DEVICE_IP, ip);
|
||||||
|
headers.put(HEADER_DEVICE_USER, user);
|
||||||
|
headers.put(HEADER_DEVICE_TIMESTAMP, timestamp);
|
||||||
|
headers.put(HEADER_DEVICE_PORT, port);
|
||||||
|
// 密码加密(password|timestamp)
|
||||||
|
String encPwd = encryptWithTimestamp(password, timestamp);
|
||||||
|
headers.put(HEADER_DEVICE_PASSWORD, encPwd);
|
||||||
|
return headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解析并校验设备请求头,返回解析结果DeviceAccessInfo。
|
||||||
|
* 校验项:参数完整性、密码解密、时间戳一致性、防重放、端口校验。
|
||||||
|
* 校验失败抛异常。
|
||||||
|
* @param request HttpServletRequest
|
||||||
|
* @return DeviceAccessInfo(ip、user、password、timestamp、port)
|
||||||
|
* @throws IllegalArgumentException 校验或解密异常
|
||||||
|
*/
|
||||||
|
public static DeviceAccessInfo parseAndValidateDeviceHeaders(javax.servlet.http.HttpServletRequest request) {
|
||||||
|
String ip = request.getHeader(HEADER_DEVICE_IP);
|
||||||
|
String encPwd = request.getHeader(HEADER_DEVICE_PASSWORD);
|
||||||
|
String user = request.getHeader(HEADER_DEVICE_USER);
|
||||||
|
String ts = request.getHeader(HEADER_DEVICE_TIMESTAMP);
|
||||||
|
String portStr = request.getHeader(HEADER_DEVICE_PORT);
|
||||||
|
if (user == null || user.isEmpty()) user = "admin";
|
||||||
|
return parseAndValidateDeviceHeaders(ip, encPwd, user, ts, portStr);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 统一参数校验和解密逻辑,失败抛异常,成功返回DeviceAccessInfo。
|
||||||
|
* <ul>
|
||||||
|
* <li>参数完整性校验</li>
|
||||||
|
* <li>重放攻击防护(同一加密串只允许用一次)</li>
|
||||||
|
* <li>密码解密与格式校验</li>
|
||||||
|
* <li>时间戳一致性与有效期校验</li>
|
||||||
|
* <li>端口号格式校验</li>
|
||||||
|
* </ul>
|
||||||
|
* @param ip 设备IP
|
||||||
|
* @param encPwd 加密密码
|
||||||
|
* @param user 用户名
|
||||||
|
* @param ts 时间戳
|
||||||
|
* @param portStr 端口字符串
|
||||||
|
* @return DeviceAccessInfo 校验通过的设备信息
|
||||||
|
* @throws IllegalArgumentException 校验失败
|
||||||
|
*/
|
||||||
|
public static DeviceAccessInfo parseAndValidateDeviceHeaders(String ip, String encPwd, String user, String ts, String portStr) {
|
||||||
|
if (ip == null || encPwd == null || ts == null) {
|
||||||
|
throw new IllegalArgumentException("缺少设备登录信息: ip, encPwd, ts");
|
||||||
|
}
|
||||||
|
String nonce = encPwd;
|
||||||
|
synchronized (usedNonceSet) {
|
||||||
|
if (usedNonceSet.contains(nonce)) {
|
||||||
|
throw new IllegalArgumentException("请求重放: nonce=" + nonce);
|
||||||
|
}
|
||||||
|
usedNonceSet.add(nonce);
|
||||||
|
if (usedNonceSet.size() > NONCE_SET_MAX_SIZE) {
|
||||||
|
String first = usedNonceSet.iterator().next();
|
||||||
|
usedNonceSet.remove(first);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
String[] pwdTsNonce;
|
||||||
|
try {
|
||||||
|
pwdTsNonce = decryptWithTimestamp(encPwd);
|
||||||
|
} catch (Exception e) {
|
||||||
|
throw new IllegalArgumentException("密码解密异常: " + e.getMessage(), e);
|
||||||
|
}
|
||||||
|
if (pwdTsNonce.length != 2) {
|
||||||
|
throw new IllegalArgumentException("密码解密格式错误: encPwd=" + encPwd);
|
||||||
|
}
|
||||||
|
String pwd = pwdTsNonce[0];
|
||||||
|
String tsInPwd = pwdTsNonce[1];
|
||||||
|
if (!ts.equals(tsInPwd)) {
|
||||||
|
throw new IllegalArgumentException("时间戳校验失败: ts=" + ts + ", tsInPwd=" + tsInPwd);
|
||||||
|
}
|
||||||
|
long now = System.nanoTime();
|
||||||
|
long tsLong;
|
||||||
|
try { tsLong = Long.parseLong(ts); } catch (Exception e) {
|
||||||
|
throw new IllegalArgumentException("时间戳格式错误: ts=" + ts);
|
||||||
|
}
|
||||||
|
if (Math.abs(now - tsLong) > TIMESTAMP_EXPIRE_MS * 1000) { // 转换为微秒进行比较
|
||||||
|
throw new IllegalArgumentException("登录请求已过期: now=" + now + ", tsLong=" + tsLong + ", expireMs=" + TIMESTAMP_EXPIRE_MS);
|
||||||
|
}
|
||||||
|
int port = 37777;
|
||||||
|
if (portStr != null && !portStr.isEmpty()) {
|
||||||
|
try {
|
||||||
|
port = Integer.parseInt(portStr);
|
||||||
|
} catch (NumberFormatException e) {
|
||||||
|
throw new IllegalArgumentException("Device-Port格式错误: portStr=" + portStr);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return new DeviceAccessInfo(ip, user, pwd, ts, port);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES加密(ECB模式,PKCS5Padding),用于加密敏感数据。
|
||||||
|
* @param data 明文
|
||||||
|
* @return base64编码的密文
|
||||||
|
* @throws Exception 加密异常
|
||||||
|
*/
|
||||||
|
private static String encrypt(String data) throws Exception {
|
||||||
|
Cipher cipher = Cipher.getInstance(ALGORITHM);
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(AES_KEY.getBytes(StandardCharsets.UTF_8), ALGORITHM);
|
||||||
|
cipher.init(Cipher.ENCRYPT_MODE, keySpec);
|
||||||
|
byte[] encrypted = cipher.doFinal(data.getBytes(StandardCharsets.UTF_8));
|
||||||
|
return Base64.getEncoder().encodeToString(encrypted);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* AES解密(ECB模式,PKCS5Padding),用于解密敏感数据。
|
||||||
|
* @param encryptedData base64编码的密文
|
||||||
|
* @return 明文
|
||||||
|
* @throws Exception 解密异常
|
||||||
|
*/
|
||||||
|
private static String decrypt(String encryptedData) throws Exception {
|
||||||
|
Cipher cipher = Cipher.getInstance(ALGORITHM);
|
||||||
|
SecretKeySpec keySpec = new SecretKeySpec(AES_KEY.getBytes(StandardCharsets.UTF_8), ALGORITHM);
|
||||||
|
cipher.init(Cipher.DECRYPT_MODE, keySpec);
|
||||||
|
byte[] decoded = Base64.getDecoder().decode(encryptedData);
|
||||||
|
byte[] decrypted = cipher.doFinal(decoded);
|
||||||
|
return new String(decrypted, StandardCharsets.UTF_8);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 生成加密字符串:password|timestamp
|
||||||
|
* @param password 明文密码
|
||||||
|
* @param timestamp 时间戳
|
||||||
|
* @return 加密后字符串
|
||||||
|
* @throws Exception 加密异常
|
||||||
|
*/
|
||||||
|
private static String encryptWithTimestamp(String password, String timestamp) throws Exception {
|
||||||
|
return encrypt(password + "|" + timestamp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 解密并返回[password, timestamp]
|
||||||
|
* @param encryptedData 加密后字符串
|
||||||
|
* @return [password, timestamp]
|
||||||
|
* @throws Exception 解密异常
|
||||||
|
*/
|
||||||
|
private static String[] decryptWithTimestamp(String encryptedData) throws Exception {
|
||||||
|
String plain = decrypt(encryptedData);
|
||||||
|
return plain.split("\\|", 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 设备访问信息结构体,封装所有校验通过的关键信息。
|
||||||
|
* 用于业务层安全登录、日志审计等场景。
|
||||||
|
*/
|
||||||
|
public static class DeviceAccessInfo {
|
||||||
|
/** 设备IP */
|
||||||
|
public final String ip;
|
||||||
|
/** 用户名 */
|
||||||
|
public final String user;
|
||||||
|
/** 明文密码(已解密) */
|
||||||
|
public final String password;
|
||||||
|
/** 时间戳 */
|
||||||
|
public final String timestamp;
|
||||||
|
/** 端口号 */
|
||||||
|
public final int port;
|
||||||
|
public DeviceAccessInfo(String ip, String user, String password, String timestamp, int port) {
|
||||||
|
this.ip = ip;
|
||||||
|
this.user = user;
|
||||||
|
this.password = password;
|
||||||
|
this.timestamp = timestamp;
|
||||||
|
this.port = port;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 本地测试主方法,演示加密解密流程。
|
||||||
|
*/
|
||||||
|
public static void main(String[] args) throws Exception {
|
||||||
|
String password = "admin";
|
||||||
|
String timestamp = String.valueOf(System.nanoTime());
|
||||||
|
String encrypted = encryptWithTimestamp(password, timestamp);
|
||||||
|
System.out.println("加密后: " + encrypted);
|
||||||
|
String[] decrypted = decryptWithTimestamp(encrypted);
|
||||||
|
System.out.println("解密后 password: " + decrypted[0]);
|
||||||
|
System.out.println("解密后 timestamp: " + decrypted[1]);
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
@ -3,3 +3,28 @@ boturl=http://10.194.10.169:9206/nsapi/jqrsssj
|
|||||||
bottoken=http://10.194.10.169:9206/nsapi/getoken?objkey=sipai
|
bottoken=http://10.194.10.169:9206/nsapi/getoken?objkey=sipai
|
||||||
#interfaces=http://192.168.1.137:8080/BLG/assayMonthWater.do?method=sampleinto¶ms=
|
#interfaces=http://192.168.1.137:8080/BLG/assayMonthWater.do?method=sampleinto¶ms=
|
||||||
#interfaces=http://localhost:8099/SIPAIIS_WMS_HQAQ/whp/test/WhpSamplingPlanTaskAudit/test1111.do?method=sampleinto¶ms=
|
#interfaces=http://localhost:8099/SIPAIIS_WMS_HQAQ/whp/test/WhpSamplingPlanTaskAudit/test1111.do?method=sampleinto¶ms=
|
||||||
|
|
||||||
|
# Attendance third-party API settings
|
||||||
|
attendance.api.url=http://127.0.0.1:8090/dh-netsdk/attendance/getDailyRecordList
|
||||||
|
attendance.api.pageSize=200
|
||||||
|
attendance.api.deviceIp=192.168.1.108
|
||||||
|
attendance.api.deviceUser=admin
|
||||||
|
attendance.api.devicePort=37777
|
||||||
|
# Plain password used for header encryption.
|
||||||
|
attendance.api.devicePassword=
|
||||||
|
|
||||||
|
# DeviceAccessHttpUtil crypto settings
|
||||||
|
# AES key length must be 16/24/32 characters
|
||||||
|
crypto.aes-key=NetSDK1234567890
|
||||||
|
# Timestamp expiration (ms)
|
||||||
|
device.timestamp.expire-ms=300000
|
||||||
|
|
||||||
|
# Vehicle gate third-party API settings (independent from attendance.api.*)
|
||||||
|
vehicleGate.api.url=http://127.0.0.1:8090/dh-netsdk/vehicleGate/getDailyRecognizedVehicleList
|
||||||
|
vehicleGate.api.pageSize=200
|
||||||
|
vehicleGate.api.deviceIp=192.168.1.108
|
||||||
|
vehicleGate.api.deviceUser=admin
|
||||||
|
vehicleGate.api.devicePort=37777
|
||||||
|
# Plain password used for header encryption.
|
||||||
|
vehicleGate.api.devicePassword=
|
||||||
|
|
||||||
|
|||||||
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 |
@ -238,6 +238,10 @@ var processSelectNode = function(taskId){
|
|||||||
//选择下一节点,先选择审核结果,再选择节点
|
//选择下一节点,先选择审核结果,再选择节点
|
||||||
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:passFlag}, function(data) {
|
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:passFlag}, function(data) {
|
||||||
$("#routeNum").empty();
|
$("#routeNum").empty();
|
||||||
|
if (!data || data.length === 0) {
|
||||||
|
console.warn('getRoutesForSelect2: no routes found for passFlag=' + passFlag);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var selelct = $("#routeNum").select2({
|
var selelct = $("#routeNum").select2({
|
||||||
data: data,
|
data: data,
|
||||||
placeholder:'请先选择审核结果',//默认文字提示
|
placeholder:'请先选择审核结果',//默认文字提示
|
||||||
@ -346,6 +350,10 @@ var processSelectNodeForHandle = function(taskId){
|
|||||||
//选择下一节点,先选择审核结果,再选择节点
|
//选择下一节点,先选择审核结果,再选择节点
|
||||||
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:passFlag}, function(data) {
|
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:passFlag}, function(data) {
|
||||||
$("#routeNum").empty();
|
$("#routeNum").empty();
|
||||||
|
if (!data || data.length === 0) {
|
||||||
|
console.warn('getRoutesForSelect2: no routes found for passFlag=' + passFlag);
|
||||||
|
return;
|
||||||
|
}
|
||||||
var selelct = $("#routeNum").select2({
|
var selelct = $("#routeNum").select2({
|
||||||
data: data,
|
data: data,
|
||||||
placeholder:'请先选择审核结果',//默认文字提示
|
placeholder:'请先选择审核结果',//默认文字提示
|
||||||
@ -374,6 +382,10 @@ var processSelectNodeForHandle = function(taskId){
|
|||||||
})
|
})
|
||||||
selectResult.val('').trigger("change");
|
selectResult.val('').trigger("change");
|
||||||
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:true}, function(data) {
|
$.post(ext.contextPath + "/activiti/workflow/getRoutesForSelect2.do", {taskId:taskId,passFlag:true}, function(data) {
|
||||||
|
if (!data || data.length === 0) {
|
||||||
|
console.warn('getRoutesForSelect2: no routes found for passFlag=true');
|
||||||
|
return;
|
||||||
|
}
|
||||||
var selelct = $("#routeNum").select2({
|
var selelct = $("#routeNum").select2({
|
||||||
data: data,
|
data: data,
|
||||||
placeholder:'请先选择审核结果',//默认文字提示
|
placeholder:'请先选择审核结果',//默认文字提示
|
||||||
|
|||||||
@ -870,7 +870,7 @@ function openModal(modalId) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1060,6 +1060,12 @@ $(function () {
|
|||||||
});
|
});
|
||||||
//FastClick.attach(document.body);
|
//FastClick.attach(document.body);
|
||||||
|
|
||||||
|
// 解决嵌套模态框中输入框无法获得焦点的问题
|
||||||
|
// 禁用Bootstrap模态框的enforceFocus,允许嵌套模态框中的输入框正常工作
|
||||||
|
if ($.fn.modal && $.fn.modal.Constructor) {
|
||||||
|
$.fn.modal.Constructor.prototype.enforceFocus = function() {};
|
||||||
|
}
|
||||||
|
|
||||||
//弹窗关闭触发方法
|
//弹窗关闭触发方法
|
||||||
/*$(".modal").on("hidden.bs.modal", function() {
|
/*$(".modal").on("hidden.bs.modal", function() {
|
||||||
$('.modal').css("overflow","auto");
|
$('.modal').css("overflow","auto");
|
||||||
|
|||||||
@ -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>
|
||||||
|
|||||||
@ -533,6 +533,14 @@
|
|||||||
$("#subDiv").html(data);
|
$("#subDiv").html(data);
|
||||||
openModal('subModal');
|
openModal('subModal');
|
||||||
});
|
});
|
||||||
|
} else if (type.indexOf('${SAFETY_JOB_INSIDE}') != -1) {
|
||||||
|
$.post(ext.contextPath + '/safety/SafetyJobInside/view.do', {id: id}, function (data) {
|
||||||
|
$("#subDiv").html(data);
|
||||||
|
openModal('subModal');
|
||||||
|
});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
showAlert('w', `未查询到任务模块!${type}`, 'mainAlertdiv');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var deleteFun = function (id) {
|
var deleteFun = function (id) {
|
||||||
|
|||||||
@ -147,7 +147,7 @@
|
|||||||
<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>
|
||||||
<span class="text-muted" style="margin-left: 10px;">当前为第三方考勤接口模拟数据(MOCK)</span>
|
<span class="text-muted" style="margin-left: 10px;">当前为第三方考勤接口实时数据</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="box-body">
|
<div class="box-body">
|
||||||
<div class="form-inline" style="margin-bottom: 10px;">
|
<div class="form-inline" style="margin-bottom: 10px;">
|
||||||
|
|||||||
@ -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');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -551,6 +551,8 @@
|
|||||||
if($(".file-preview-thumbnails").html() == null || $(".file-preview-thumbnails").html().length==0 || $.trim($(".file-preview-thumbnails").html())==''){
|
if($(".file-preview-thumbnails").html() == null || $(".file-preview-thumbnails").html().length==0 || $.trim($(".file-preview-thumbnails").html())==''){
|
||||||
showAlert('d','上传的文件不能为空!','alertFileEditDiv');
|
showAlert('d','上传的文件不能为空!','alertFileEditDiv');
|
||||||
} else {
|
} else {
|
||||||
|
var editorText = editor.txt.html();
|
||||||
|
$("#wContent").val(editorText);
|
||||||
$.post(ext.contextPath + "/documentData/doupdate.do", $("#fileInputModalForm").serialize(), function (data) {
|
$.post(ext.contextPath + "/documentData/doupdate.do", $("#fileInputModalForm").serialize(), function (data) {
|
||||||
if (data.res == 1){
|
if (data.res == 1){
|
||||||
$("#fileTable").bootstrapTable('refresh');
|
$("#fileTable").bootstrapTable('refresh');
|
||||||
|
|||||||
@ -19,6 +19,10 @@
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var dosearchBelong = function() {
|
||||||
|
$("#equipmentBelongTable").bootstrapTable('refresh');
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
//显示已经勾选的数据
|
//显示已经勾选的数据
|
||||||
function stateFormatter(value, row, index) {
|
function stateFormatter(value, row, index) {
|
||||||
@ -53,6 +57,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_belongname').val()
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
queryParamsType: "limit",
|
queryParamsType: "limit",
|
||||||
@ -110,6 +115,12 @@
|
|||||||
<div id="mainAlertdiv"></div>
|
<div id="mainAlertdiv"></div>
|
||||||
<div id="menu4SelectDiv"></div>
|
<div id="menu4SelectDiv"></div>
|
||||||
<div id="modal-body">
|
<div id="modal-body">
|
||||||
|
<div class="input-group input-group-sm" style="width: 250px;float: right;margin-bottom: 15px;">
|
||||||
|
<input type="text" id="search_belongname" name="search_belongname" class="form-control pull-right" placeholder="归属名称/编码">
|
||||||
|
<div class="input-group-btn">
|
||||||
|
<button class="btn btn-default" onclick="dosearchBelong();"><i class="fa fa-search"></i></button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="table-scrollable">
|
<div class="table-scrollable">
|
||||||
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="equipmentBelongTable"></table>
|
<table class="table table-bordered table-striped" style="overflow:auto;width:100%" id="equipmentBelongTable"></table>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -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) {
|
||||||
@ -425,6 +425,43 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div id="fileArea"></div>--%>
|
<div id="fileArea"></div>--%>
|
||||||
|
</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>
|
</form>
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
<div class="box-header with-border">
|
<div class="box-header with-border">
|
||||||
|
|||||||
@ -296,8 +296,18 @@
|
|||||||
function exportExcel() {
|
function exportExcel() {
|
||||||
var periodTypeName = $('#periodTypeList').val();
|
var periodTypeName = $('#periodTypeList').val();
|
||||||
var positionType = $('#positionTypeList').val();
|
var positionType = $('#positionTypeList').val();
|
||||||
|
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);
|
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">
|
|
||||||
<h5 style="color:black" class="form-title">西派埃智能</h4>
|
|
||||||
<h2 style="margin:0px">南康智慧水厂运管平台</h2>
|
|
||||||
<h4 style="color:black;margin-top:4px" >精益运行工业互联网平台</h4>
|
|
||||||
|
|
||||||
</div> -->
|
</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,7 +159,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_.val('${abnormity.processSectionId}').trigger("change");
|
selelct_.val('${abnormity.processSectionId}').trigger("change.select2");
|
||||||
},'json');
|
},'json');
|
||||||
};
|
};
|
||||||
var companyId = "${abnormity.bizId}";
|
var companyId = "${abnormity.bizId}";
|
||||||
@ -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');
|
||||||
|
|||||||
@ -88,7 +88,10 @@
|
|||||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||||
var datas = "";
|
var datas = "";
|
||||||
$.each(checkedItems, function(index, item) {
|
$.each(checkedItems, function(index, item) {
|
||||||
datas += item.id + ",";
|
if (datas != "") {
|
||||||
|
datas += ",";
|
||||||
|
}
|
||||||
|
datas += item.id;
|
||||||
});
|
});
|
||||||
if (datas == "") {
|
if (datas == "") {
|
||||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||||
|
|||||||
@ -72,6 +72,18 @@
|
|||||||
}).on('hide', function (e) {
|
}).on('hide', function (e) {
|
||||||
$('#subForm').data('bootstrapValidator').updateStatus('rptdtM_Start', 'NOT_VALIDATED', null).validateField('rptdtM_Start');
|
$('#subForm').data('bootstrapValidator').updateStatus('rptdtM_Start', 'NOT_VALIDATED', null).validateField('rptdtM_Start');
|
||||||
});
|
});
|
||||||
|
$('#rptdtQ_Start').datepicker({
|
||||||
|
changeYear: true,
|
||||||
|
changeMonth: true,
|
||||||
|
format: 'yyyy-mm',
|
||||||
|
language: "zh-CN",
|
||||||
|
autoclose: true,
|
||||||
|
startView: 1,
|
||||||
|
minViewMode: 1,
|
||||||
|
maxViewMode: 2,
|
||||||
|
}).on('hide', function (e) {
|
||||||
|
$('#subForm').data('bootstrapValidator').updateStatus('rptdtQ_Start', 'NOT_VALIDATED', null).validateField('rptdtQ_Start');
|
||||||
|
});
|
||||||
$('#rptdtY_Start').datepicker({
|
$('#rptdtY_Start').datepicker({
|
||||||
format: 'yyyy',
|
format: 'yyyy',
|
||||||
language: "zh-CN",
|
language: "zh-CN",
|
||||||
@ -105,6 +117,18 @@
|
|||||||
}).on('hide', function (e) {
|
}).on('hide', function (e) {
|
||||||
$('#subForm').data('bootstrapValidator').updateStatus('rptdtM_End', 'NOT_VALIDATED', null).validateField('rptdtM_End');
|
$('#subForm').data('bootstrapValidator').updateStatus('rptdtM_End', 'NOT_VALIDATED', null).validateField('rptdtM_End');
|
||||||
});
|
});
|
||||||
|
$('#rptdtQ_End').datepicker({
|
||||||
|
changeYear: true,
|
||||||
|
changeMonth: true,
|
||||||
|
format: 'yyyy-mm',
|
||||||
|
language: "zh-CN",
|
||||||
|
autoclose: true,
|
||||||
|
startView: 1,
|
||||||
|
minViewMode: 1,
|
||||||
|
maxViewMode: 2,
|
||||||
|
}).on('hide', function (e) {
|
||||||
|
$('#subForm').data('bootstrapValidator').updateStatus('rptdtQ_End', 'NOT_VALIDATED', null).validateField('rptdtQ_End');
|
||||||
|
});
|
||||||
$('#rptdtY_End').datepicker({
|
$('#rptdtY_End').datepicker({
|
||||||
format: 'yyyy',
|
format: 'yyyy',
|
||||||
language: "zh-CN",
|
language: "zh-CN",
|
||||||
@ -146,6 +170,8 @@
|
|||||||
value="${dateD}">
|
value="${dateD}">
|
||||||
<input type="text" class="form-control" id="rptdtM_Start" name="rptdt_start" style="width: 132px;"
|
<input type="text" class="form-control" id="rptdtM_Start" name="rptdt_start" style="width: 132px;"
|
||||||
value="${dateM}">
|
value="${dateM}">
|
||||||
|
<input type="text" class="form-control" id="rptdtQ_Start" name="rptdt_start" style="width: 132px;"
|
||||||
|
value="${dateQ}">
|
||||||
<input type="text" class="form-control" id="rptdtY_Start" name="rptdt_start" style="width: 132px;"
|
<input type="text" class="form-control" id="rptdtY_Start" name="rptdt_start" style="width: 132px;"
|
||||||
value="${dateY}">
|
value="${dateY}">
|
||||||
</div>
|
</div>
|
||||||
@ -160,6 +186,8 @@
|
|||||||
value="${dateD}">
|
value="${dateD}">
|
||||||
<input type="text" class="form-control" id="rptdtM_End" name="rptdt_end" style="width: 132px;"
|
<input type="text" class="form-control" id="rptdtM_End" name="rptdt_end" style="width: 132px;"
|
||||||
value="${dateM}">
|
value="${dateM}">
|
||||||
|
<input type="text" class="form-control" id="rptdtQ_End" name="rptdt_end" style="width: 132px;"
|
||||||
|
value="${dateQ}">
|
||||||
<input type="text" class="form-control" id="rptdtY_End" name="rptdt_end" style="width: 132px;"
|
<input type="text" class="form-control" id="rptdtY_End" name="rptdt_end" style="width: 132px;"
|
||||||
value="${dateY}">
|
value="${dateY}">
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -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');
|
||||||
|
|
||||||
|
|||||||
@ -263,7 +263,8 @@
|
|||||||
field: 'name', // 返回json数据中的name
|
field: 'name', // 返回json数据中的name
|
||||||
title: '姓名', // 表格表头显示文字
|
title: '姓名', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle' // 上下居中
|
valign: 'middle', // 上下居中
|
||||||
|
width: 200,
|
||||||
}, {
|
}, {
|
||||||
/* field: 'gender', // 返回json数据中的name
|
/* field: 'gender', // 返回json数据中的name
|
||||||
title: '性别', // 表格表头显示文字
|
title: '性别', // 表格表头显示文字
|
||||||
|
|||||||
@ -55,6 +55,7 @@
|
|||||||
.table-hover > tbody > tr:hover {
|
.table-hover > tbody > tr:hover {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
.input-clear-a {
|
.input-clear-a {
|
||||||
|
|
||||||
color: white;
|
color: white;
|
||||||
@ -98,8 +99,8 @@
|
|||||||
let text = "您确定要删除此 证书 信息?";
|
let text = "您确定要删除此 证书 信息?";
|
||||||
let delUrl = ext.contextPath + '/safety/externalCertificate/delete.do';
|
let delUrl = ext.contextPath + '/safety/externalCertificate/delete.do';
|
||||||
|
|
||||||
if(!id){
|
if (!id) {
|
||||||
id =staffId;//外部员工ID
|
id = staffId;//外部员工ID
|
||||||
text = "您确定要删除此 人员 信息?"
|
text = "您确定要删除此 人员 信息?"
|
||||||
delUrl = ext.contextPath + '/safety/externalStaff/delete.do';
|
delUrl = ext.contextPath + '/safety/externalStaff/delete.do';
|
||||||
}
|
}
|
||||||
@ -143,11 +144,15 @@
|
|||||||
}
|
}
|
||||||
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);
|
||||||
|
staffIds.push(item.staffId || "");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (datas == "") {
|
if (ids.length === 0 && staffIds.length === 0) {
|
||||||
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||||
} else {
|
} else {
|
||||||
swal({
|
swal({
|
||||||
@ -171,7 +176,10 @@
|
|||||||
}
|
}
|
||||||
}).then(function (willDelete) {
|
}).then(function (willDelete) {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
$.post(ext.contextPath + '/safety/externalCertificate/deletes.do', {ids: datas}, function (data) {
|
$.post(ext.contextPath + '/safety/externalCertificate/deletes.do', {
|
||||||
|
ids: ids.join(","),
|
||||||
|
staffIds: staffIds.join(",")
|
||||||
|
}, function (data) {
|
||||||
if (data > 0) {
|
if (data > 0) {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
// 初始化 作业类型
|
// 初始化 作业类型
|
||||||
@ -204,11 +212,24 @@
|
|||||||
var companyParam = $('#companyParam').val();
|
var companyParam = $('#companyParam').val();
|
||||||
var issueDate = $('#reservationtimeD').val();
|
var issueDate = $('#reservationtimeD').val();
|
||||||
|
|
||||||
window.open(ext.contextPath + "/safety/externalCertificate/exportExcel.do?search_name=" + search_name
|
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||||
+ "&search_code=" + search_code
|
var ids = [];
|
||||||
+ "&jobType=" + jobType
|
var staffIds = [];
|
||||||
+ "&issueDate=" + issueDate
|
$.each(checkedItems, function (index, item) {
|
||||||
+ "&companyParam=" + companyParam
|
if (item.id) {
|
||||||
|
ids.push(item.id);
|
||||||
|
} else if (item.staffId) {
|
||||||
|
staffIds.push(item.staffId);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
window.open(ext.contextPath + "/safety/externalCertificate/exportExcel.do?search_name=" + encodeURIComponent(search_name || "")
|
||||||
|
+ "&search_code=" + encodeURIComponent(search_code || "")
|
||||||
|
+ "&jobType=" + encodeURIComponent(jobType || "")
|
||||||
|
+ "&issueDate=" + encodeURIComponent(issueDate || "")
|
||||||
|
+ "&companyParam=" + encodeURIComponent(companyParam || "")
|
||||||
|
+ "&ids=" + encodeURIComponent(ids.join(","))
|
||||||
|
+ "&staffIds=" + encodeURIComponent(staffIds.join(","))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -234,6 +255,7 @@
|
|||||||
// 初始化 表格数据
|
// 初始化 表格数据
|
||||||
initFun();
|
initFun();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 时间筛选
|
// 时间筛选
|
||||||
function initDate1() {
|
function initDate1() {
|
||||||
var locale = {
|
var locale = {
|
||||||
@ -288,6 +310,7 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
//作业类型下拉数据
|
//作业类型下拉数据
|
||||||
function jobTypePulldown() {
|
function jobTypePulldown() {
|
||||||
//选择 从事岗位
|
//选择 从事岗位
|
||||||
@ -316,8 +339,9 @@
|
|||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
}
|
}
|
||||||
|
|
||||||
//施工单位下拉数据
|
//施工单位下拉数据
|
||||||
function companyPulldown(){
|
function companyPulldown() {
|
||||||
$.post(ext.contextPath + "/safety/externalStaff/companyPulldown.do", {}, function (data) {
|
$.post(ext.contextPath + "/safety/externalStaff/companyPulldown.do", {}, function (data) {
|
||||||
$("#companyParam").empty();
|
$("#companyParam").empty();
|
||||||
var selelct_ = $("#companyParam").select2({
|
var selelct_ = $("#companyParam").select2({
|
||||||
@ -343,6 +367,7 @@
|
|||||||
});
|
});
|
||||||
}, 'json');
|
}, 'json');
|
||||||
}
|
}
|
||||||
|
|
||||||
// 初始表格
|
// 初始表格
|
||||||
var nowDate = new Date();
|
var nowDate = new Date();
|
||||||
var initFun = function () {
|
var initFun = function () {
|
||||||
@ -391,17 +416,17 @@
|
|||||||
field: 'company', // 返回json数据中的name
|
field: 'company', // 返回json数据中的name
|
||||||
title: '施工单位名称', // 表格表头显示文字
|
title: '施工单位名称', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle', // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
}, {
|
}, {
|
||||||
field: 'certificateName', // 返回json数据中的name
|
field: 'certificateName', // 返回json数据中的name
|
||||||
title: '证书名称', // 表格表头显示文字
|
title: '证书名称', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle', // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
}, {
|
}, {
|
||||||
field: 'certificateNo', // 返回json数据中的name
|
field: 'certificateNo', // 返回json数据中的name
|
||||||
title: '证书编号', // 表格表头显示文字
|
title: '证书编号', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle', // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
}, {
|
}, {
|
||||||
field: 'jobCode', // 返回json数据中的name
|
field: 'jobCode', // 返回json数据中的name
|
||||||
title: '作业项目代码', // 表格表头显示文字
|
title: '作业项目代码', // 表格表头显示文字
|
||||||
@ -411,39 +436,49 @@
|
|||||||
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: '有效期至', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle', // 上下居中
|
valign: 'middle', // 上下居中
|
||||||
cellStyle:function(value,row,index){// 修改列(单元格)的颜色
|
cellStyle: function (value, row, index) {// 修改列(单元格)的颜色
|
||||||
if(value){
|
if (value) {
|
||||||
var stime = Date.parse(nowDate);
|
var stime = Date.parse(nowDate);
|
||||||
var etime = Date.parse(new Date(value));
|
var etime = Date.parse(new Date(value));
|
||||||
// 两个时间戳相差的毫秒数
|
// 两个时间戳相差的毫秒数
|
||||||
var usedTime = etime - stime;
|
var usedTime = etime - stime;
|
||||||
if(usedTime > 0){
|
if (usedTime > 0) {
|
||||||
// 计算相差的天数
|
// 计算相差的天数
|
||||||
var days = Math.floor(usedTime / (24 * 3600 * 1000));
|
var days = Math.floor(usedTime / (24 * 3600 * 1000));
|
||||||
if(days <= 30){
|
if (days <= 30) {
|
||||||
return {css:{"background-color":"rgba(220,29,54,1)","color":"rgba(255,255,255,1)"}};
|
return {
|
||||||
|
css: {
|
||||||
|
"background-color": "rgba(220,29,54,1)",
|
||||||
|
"color": "rgba(255,255,255,1)"
|
||||||
}
|
}
|
||||||
}else{
|
};
|
||||||
return {css:{"background-color":"rgba(220,29,54,1)","color":"rgba(255,255,255,1)"}};
|
}
|
||||||
|
} else {
|
||||||
|
return {
|
||||||
|
css: {
|
||||||
|
"background-color": "rgba(220,29,54,1)",
|
||||||
|
"color": "rgba(255,255,255,1)"
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return {css:{}};
|
return {css: {}};
|
||||||
}
|
}
|
||||||
}, {
|
}, {
|
||||||
title: "操作",
|
title: "操作",
|
||||||
@ -454,7 +489,7 @@
|
|||||||
var buts = '';
|
var buts = '';
|
||||||
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 += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\',\''+row.staffId+'\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
|
buts += '<button class="btn btn-default btn-sm" title="删除" onclick="deleteFun(\'' + row.id + '\',\'' + row.staffId + '\')"><i class="fa fa fa-trash-o"></i><span class="hidden-md hidden-lg">删除</span></button>';
|
||||||
|
|
||||||
buts += '<button class="btn btn-default btn-sm" title="下载" onclick="fileDownload(\'' + row.fileId + '\')"><i class="fa fa-paperclip"></i><span class="hidden-md hidden-lg">下载</span></button>';
|
buts += '<button class="btn btn-default btn-sm" title="下载" onclick="fileDownload(\'' + row.fileId + '\')"><i class="fa fa-paperclip"></i><span class="hidden-md hidden-lg">下载</span></button>';
|
||||||
// buts += '<button class="btn btn-default btn-sm" title="查看详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">查看详情</span></button>';
|
// buts += '<button class="btn btn-default btn-sm" title="查看详情" onclick="viewFun(\'' + row.id + '\')"><i class="fa fa-eye"></i><span class="hidden-md hidden-lg">查看详情</span></button>';
|
||||||
@ -500,14 +535,14 @@
|
|||||||
* @param colspan 合并列
|
* @param colspan 合并列
|
||||||
* @param target 目标表格对象
|
* @param target 目标表格对象
|
||||||
*/
|
*/
|
||||||
function mergeCells(data,fieldName,colspan,target){
|
function mergeCells(data, fieldName, colspan, target) {
|
||||||
//声明一个map计算相同属性值在data对象出现的次数和
|
//声明一个map计算相同属性值在data对象出现的次数和
|
||||||
var sortMap = {};
|
var sortMap = {};
|
||||||
for(var i = 0 ; i < data.length ; i++){
|
for (var i = 0; i < data.length; i++) {
|
||||||
for(var prop in data[i]){
|
for (var prop in data[i]) {
|
||||||
if(prop == fieldName){
|
if (prop == fieldName) {
|
||||||
var key = data[i][prop]
|
var key = data[i][prop]
|
||||||
if(sortMap.hasOwnProperty(key)){
|
if (sortMap.hasOwnProperty(key)) {
|
||||||
sortMap[key] = sortMap[key] * 1 + 1;
|
sortMap[key] = sortMap[key] * 1 + 1;
|
||||||
} else {
|
} else {
|
||||||
sortMap[key] = 1;
|
sortMap[key] = 1;
|
||||||
@ -516,17 +551,28 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(var prop in sortMap){
|
for (var prop in sortMap) {
|
||||||
// console.log(prop,sortMap[prop])
|
// console.log(prop,sortMap[prop])
|
||||||
}
|
}
|
||||||
var index = 0;
|
var index = 0;
|
||||||
for(var prop in sortMap){
|
for (var prop in sortMap) {
|
||||||
var count = sortMap[prop] * 1;
|
var count = sortMap[prop] * 1;
|
||||||
$(target).bootstrapTable('mergeCells',{index:index, field:fieldName, colspan: colspan, rowspan: count});
|
$(target).bootstrapTable('mergeCells', {
|
||||||
$(target).bootstrapTable('mergeCells',{index:index, field:'company', colspan: colspan, rowspan: count});
|
index: index,
|
||||||
|
field: fieldName,
|
||||||
|
colspan: colspan,
|
||||||
|
rowspan: count
|
||||||
|
});
|
||||||
|
$(target).bootstrapTable('mergeCells', {
|
||||||
|
index: index,
|
||||||
|
field: 'company',
|
||||||
|
colspan: colspan,
|
||||||
|
rowspan: count
|
||||||
|
});
|
||||||
index += count;
|
index += count;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var timedel = function () {
|
var timedel = function () {
|
||||||
$('#reservationtimeD').val('');
|
$('#reservationtimeD').val('');
|
||||||
timeRangeEnd = null;
|
timeRangeEnd = null;
|
||||||
@ -554,10 +600,12 @@
|
|||||||
<div>
|
<div>
|
||||||
<div class="form-group" style="padding:0;">
|
<div class="form-group" style="padding:0;">
|
||||||
<div class="btn-group" style="width: 300px;padding-bottom:10px;">
|
<div class="btn-group" style="width: 300px;padding-bottom:10px;">
|
||||||
<button type="button" class="btn btn-default btn-sm" onclick="addFun();" style="margin-right: 15px"><i
|
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"
|
||||||
|
style="margin-right: 15px"><i
|
||||||
class="fa fa-plus"></i> 新增
|
class="fa fa-plus"></i> 新增
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();" style="margin-right: 15px"><i
|
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"
|
||||||
|
style="margin-right: 15px"><i
|
||||||
class="fa fa-trash-o"></i> 删除
|
class="fa fa-trash-o"></i> 删除
|
||||||
</button>
|
</button>
|
||||||
<button type="button" class="btn btn-default btn-sm" style="margin-right: 15px"
|
<button type="button" class="btn btn-default btn-sm" style="margin-right: 15px"
|
||||||
@ -575,12 +623,14 @@
|
|||||||
<div class="form-group pull-right form-inline">
|
<div class="form-group pull-right form-inline">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label">施工单位名称:</label>
|
<label class="form-label">施工单位名称:</label>
|
||||||
<select class="form-control select2" id="companyParam" name="companyParam" style="width: 180px;">
|
<select class="form-control select2" id="companyParam" name="companyParam"
|
||||||
|
style="width: 180px;">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="form-label">作业类型:</label>
|
<label class="form-label">作业类型:</label>
|
||||||
<select class="form-control select2" id="jobTypeParam" name="jobTypeParam" style="width: 180px;">
|
<select class="form-control select2" id="jobTypeParam" name="jobTypeParam"
|
||||||
|
style="width: 180px;">
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="input-group input-group-sm" style="width: 200px;">
|
<div class="input-group input-group-sm" style="width: 200px;">
|
||||||
|
|||||||
@ -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: '有效期至', // 表格表头显示文字
|
||||||
|
|||||||
@ -16,16 +16,10 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
.form-horizontal {
|
.form-horizontal {
|
||||||
padding-top: 20px;
|
padding-top: 20px;
|
||||||
}
|
}
|
||||||
.DDD{
|
|
||||||
list-style: none;
|
|
||||||
line-height: 30px;
|
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var fileList = []
|
|
||||||
// 初始化
|
// 初始化
|
||||||
$(function () {
|
$(function () {
|
||||||
$('#test').outerHTML = initFileInputView()
|
|
||||||
//初始化 检查日期
|
//初始化 检查日期
|
||||||
$("#checkDate").datepicker({
|
$("#checkDate").datepicker({
|
||||||
language: 'zh-CN',
|
language: 'zh-CN',
|
||||||
@ -45,7 +39,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
// 初始化‘提交’按钮
|
// 初始化'提交'按钮
|
||||||
$("#submitBt").hide();
|
$("#submitBt").hide();
|
||||||
$("#checkResult").change(function () {
|
$("#checkResult").change(function () {
|
||||||
var type = $("#checkResult option:selected").val();
|
var type = $("#checkResult option:selected").val();
|
||||||
@ -72,37 +66,11 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
|
|
||||||
// 初始化 检查项目下拉
|
// 初始化 检查项目下拉
|
||||||
checkItemDropDownInit()
|
checkItemDropDownInit()
|
||||||
|
|
||||||
|
// 初始化 附件列表
|
||||||
|
initFileList();
|
||||||
});
|
});
|
||||||
|
|
||||||
// 点击文件
|
|
||||||
var fileinput = function () {
|
|
||||||
$('#file').click();
|
|
||||||
};
|
|
||||||
// 清空文件
|
|
||||||
var filedel = function () {
|
|
||||||
fileList.splice(index,1)
|
|
||||||
$('#test').html(initFileInputView())
|
|
||||||
};
|
|
||||||
// 选中文件
|
|
||||||
var fileSelected = function () {
|
|
||||||
var filename = $('#file').val();
|
|
||||||
fileList.push(...$('#file')[0].files)
|
|
||||||
$('#test').html(initFileInputView())
|
|
||||||
};
|
|
||||||
function initFileInputView() {
|
|
||||||
let button = (index) => {
|
|
||||||
return `<button type="button" class="btn btn-default btn-file" onclick="filedel(`+index+`)"
|
|
||||||
style="position: fixed;right: 193px;height: 24px;width:24px;padding-top:2px;margin-top: 3px" id="btn_save1"><i class="fa fa-trash-o" style="margin-left: -5px"></i></button>`
|
|
||||||
}
|
|
||||||
let temp = `<ul class="DDD">`
|
|
||||||
fileList.forEach((item, index) => {
|
|
||||||
temp += `<li>`+item.name+button(index)+`</li>`
|
|
||||||
})
|
|
||||||
temp += `<ul>`
|
|
||||||
temp += `<input type="hidden" class="form-control" name="fileName" id="fileName" readonly
|
|
||||||
style="width:650px;border:none;background-color: white"/>`
|
|
||||||
return temp
|
|
||||||
}
|
|
||||||
// 处理 检查类型 前缀拼接
|
// 处理 检查类型 前缀拼接
|
||||||
function handleCheckType(formData) {
|
function handleCheckType(formData) {
|
||||||
let checktype = $('input[type=radio][name=checkType]:checked').val();
|
let checktype = $('input[type=radio][name=checkType]:checked').val();
|
||||||
@ -112,6 +80,19 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 加载附件
|
||||||
|
function initFileList() {
|
||||||
|
// SAFETY_CHECK_COMPREHENSIVE(9, "综合安全检查","ZH"),
|
||||||
|
$.post(ext.contextPath + '/safety/SafetyFiles/fileListShow.do',
|
||||||
|
{
|
||||||
|
bizId: '${preId}',
|
||||||
|
functionCode: 9,
|
||||||
|
statusCode: 1
|
||||||
|
}, function (data) {
|
||||||
|
$("#fileList").html(data);
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
// 保存
|
// 保存
|
||||||
function saveFun() {
|
function saveFun() {
|
||||||
$("#addForm").bootstrapValidator('validate');//提交验证
|
$("#addForm").bootstrapValidator('validate');//提交验证
|
||||||
@ -128,7 +109,6 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
processData: false,
|
processData: false,
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
success: function (data) {
|
success: function (data) {
|
||||||
// console.log(data)
|
|
||||||
if (data.code == 1) {
|
if (data.code == 1) {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
closeModal('subModal');
|
closeModal('subModal');
|
||||||
@ -303,6 +283,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
<!-- 新增界面formid强制为addForm -->
|
<!-- 新增界面formid强制为addForm -->
|
||||||
<form class="form-horizontal" id="addForm" enctype="multipart/form-data">
|
<form class="form-horizontal" id="addForm" enctype="multipart/form-data">
|
||||||
<div id="alertDiv"></div>
|
<div id="alertDiv"></div>
|
||||||
|
<input type="hidden" class="form-control" id="id" name="id" value="${preId}"/>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label">检查类型</label>
|
<label class="col-sm-2 control-label">检查类型</label>
|
||||||
@ -415,26 +396,12 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group" style="margin-left: 20px">
|
||||||
<label class="col-sm-2 control-label ">附件资料:</label>
|
<div class="col-sm-10" id="fileList"></div>
|
||||||
<div class="col-sm-1" style="display: flex">
|
|
||||||
<button type="button" class="btn btn-default btn-file" onclick="fileinput()"
|
|
||||||
id="btn_save"><i class="fa fa-paperclip"></i></button>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-7">
|
|
||||||
<div id="test" ></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="form-group" style="margin:8px;">
|
|
||||||
<input type="file" name="file" id="file" multiple class="file-loading"
|
|
||||||
onchange="fileSelected()"/>
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
<div class="modal-foo
|
<div class="modal-footer">
|
||||||
|
|
||||||
ter">
|
|
||||||
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
<button type="button" class="btn btn-default " data-dismiss="modal">关闭</button>
|
||||||
<button type="button" class="btn btn-primary " style="margin-left: 10px" onclick="saveFun()">
|
<button type="button" class="btn btn-primary " style="margin-left: 10px" onclick="saveFun()">
|
||||||
保存
|
保存
|
||||||
|
|||||||
@ -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())
|
||||||
};
|
};
|
||||||
|
|||||||
@ -72,7 +72,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())
|
||||||
};
|
};
|
||||||
@ -234,7 +234,8 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
{
|
{
|
||||||
formId: "addForm",
|
formId: "addForm",
|
||||||
hiddenId: "userId",
|
hiddenId: "userId",
|
||||||
textId: "userName"
|
textId: "userName",
|
||||||
|
displayDept: "true"
|
||||||
}, function (data) {
|
}, function (data) {
|
||||||
$("#user4SelectDiv").html(data);
|
$("#user4SelectDiv").html(data);
|
||||||
openModal("user4SelectModal");
|
openModal("user4SelectModal");
|
||||||
|
|||||||
@ -47,6 +47,11 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
display: inline-block;
|
display: inline-block;
|
||||||
vertical-align: top;
|
vertical-align: top;
|
||||||
padding: 8px;
|
padding: 8px;
|
||||||
|
width: 140px;
|
||||||
|
text-align: left;
|
||||||
|
}
|
||||||
|
.detail-row {
|
||||||
|
clear: both;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -253,7 +258,7 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
function initdeTail(list) {
|
function initdeTail(list) {
|
||||||
let temp = `<div >`
|
let temp = `<div >`
|
||||||
list.forEach((item, index) => {
|
list.forEach((item, index) => {
|
||||||
temp += `<div><div class="AAA">` + item.deptName + `</div>`
|
temp += `<div class="detail-row"><div class="AAA">` + item.deptName + `</div>`
|
||||||
temp += `<div class="AAA">` + item.userName + `</div>`
|
temp += `<div class="AAA">` + item.userName + `</div>`
|
||||||
temp += `<div class="AAA">` + item.pass + `</div>`
|
temp += `<div class="AAA">` + item.pass + `</div>`
|
||||||
temp += `<div class="AAA">` + item.time + `</div></div>`
|
temp += `<div class="AAA">` + item.time + `</div></div>`
|
||||||
@ -426,8 +431,10 @@ PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD
|
|||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-sm-2 control-label ">查看其它会签意见</label>
|
<label class="col-sm-2 control-label ">查看其它会签意见</label>
|
||||||
|
<div class="col-sm-10">
|
||||||
<div id="deTail"></div>
|
<div id="deTail"></div>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
<div class="form-group" style="margin-left: 39px">
|
<div class="form-group" style="margin-left: 39px">
|
||||||
<div id="fileList"></div>
|
<div id="fileList"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -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,8 +400,18 @@
|
|||||||
|
|
||||||
//导出
|
//导出
|
||||||
function downloadExcelFun() {
|
function downloadExcelFun() {
|
||||||
|
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");
|
window.open(ext.contextPath + "/sparepart/sewage/downloadExcelFun.do");
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
</head>
|
</head>
|
||||||
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
<body onload="initMenu()" class="hold-transition ${cu.themeclass} sidebar-mini">
|
||||||
|
|||||||
@ -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);
|
||||||
|
|||||||
@ -56,7 +56,7 @@
|
|||||||
|
|
||||||
//编辑用户信息
|
//编辑用户信息
|
||||||
var editUserFun = function (roleid, bizid) {
|
var editUserFun = function (roleid, bizid) {
|
||||||
$.post(ext.contextPath + '/user/showRoleUser.do', { roleid: roleid }, function (data) {
|
$.post(ext.contextPath + '/user/showRoleUser.do', { roleid: roleid, bizid: bizid }, function (data) {
|
||||||
$("#subDiv_User").html(data);
|
$("#subDiv_User").html(data);
|
||||||
openModal('roleUserModal');
|
openModal('roleUserModal');
|
||||||
});
|
});
|
||||||
|
|||||||
@ -88,9 +88,14 @@
|
|||||||
$("#search_pid").select2({
|
$("#search_pid").select2({
|
||||||
ajax: {
|
ajax: {
|
||||||
type:'POST',
|
type:'POST',
|
||||||
url: ext.contextPath +"/work/group/getListForSelect.do",
|
url: ext.contextPath +"/user/getDeptByBizId4Select.do",
|
||||||
dataType: 'json',
|
dataType: 'json',
|
||||||
delay: 250,
|
delay: 250,
|
||||||
|
data: function (params) {
|
||||||
|
return {
|
||||||
|
companyId: '${companyId}'
|
||||||
|
};
|
||||||
|
},
|
||||||
processResults: function (data) {
|
processResults: function (data) {
|
||||||
return {
|
return {
|
||||||
results: data
|
results: data
|
||||||
|
|||||||
@ -20,7 +20,12 @@
|
|||||||
if(datas_name!=""){
|
if(datas_name!=""){
|
||||||
datas_name+=",";
|
datas_name+=",";
|
||||||
}
|
}
|
||||||
datas_name+=item.caption;
|
// 支持通过参数控制显示部门名称还是用户名称
|
||||||
|
var displayField = item.caption;
|
||||||
|
if('${param.displayDept}' === 'true' && item._pname) {
|
||||||
|
displayField = item._pname;
|
||||||
|
}
|
||||||
|
datas_name+=displayField;
|
||||||
});
|
});
|
||||||
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
$('#${param.formId} #${param.hiddenId}' ).val(datas);
|
||||||
$('#${param.formId} #${param.textId}').val(datas_name);
|
$('#${param.formId} #${param.textId}').val(datas_name);
|
||||||
|
|||||||
@ -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,7 +147,7 @@ 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');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -89,7 +89,7 @@ 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');
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -116,7 +116,7 @@ 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");
|
||||||
@ -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,7 +149,7 @@ 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');
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,71 +1,77 @@
|
|||||||
<%@ 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;
|
.select2-selection__arrow {
|
||||||
|
margin-top: 3px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var companyId = "";
|
var companyId = "";
|
||||||
var showMaintenanceList = function(id) {
|
var showMaintenanceList = function (id) {
|
||||||
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId:id} , function(data) {
|
$.post(ext.contextPath + '/maintenance/showMaintenanceList4Equipment.do', {equipmentId: id}, function (data) {
|
||||||
$("#subDiv").html(data);
|
$("#subDiv").html(data);
|
||||||
openModal('subMaintenanceModal');
|
openModal('subMaintenanceModal');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var showHandleDetailList = function(id) {
|
var showHandleDetailList = function (id) {
|
||||||
stopBubbleDefaultEvent();
|
stopBubbleDefaultEvent();
|
||||||
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId:id} , function(data) {
|
$.post(ext.contextPath + '/maintenance/showHandleDetailList4Equipment.do', {equipmentId: id}, function (data) {
|
||||||
$("#subDiv").html(data);
|
$("#subDiv").html(data);
|
||||||
openModal('handleDetailModal');
|
openModal('handleDetailModal');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
var viewEquipmentFun = function(equipmentName,equipmentCardID,id) {
|
var viewEquipmentFun = function (equipmentName, equipmentCardID, id) {
|
||||||
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {equipmentName:equipmentName,equipmentCardID:equipmentCardID,id:id} , function(data) {
|
$.post(ext.contextPath + '/equipment/viewEquipmentCard.do', {
|
||||||
|
equipmentName: equipmentName,
|
||||||
|
equipmentCardID: equipmentCardID,
|
||||||
|
id: id
|
||||||
|
}, function (data) {
|
||||||
$("#subEquipmentDiv").html(data);
|
$("#subEquipmentDiv").html(data);
|
||||||
openModal('subEquipmentModal');
|
openModal('subEquipmentModal');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var addFun = function() {
|
var addFun = function () {
|
||||||
$.post(ext.contextPath + '/work/kpipoint/add.do', {} , function(data) {
|
$.post(ext.contextPath + '/work/kpipoint/add.do', {}, function (data) {
|
||||||
$("#subDiv").html(data);
|
$("#subDiv").html(data);
|
||||||
openModal('subModal');
|
openModal('subModal');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var editFun = function(id) {
|
var editFun = function (id) {
|
||||||
stopBubbleDefaultEvent();
|
stopBubbleDefaultEvent();
|
||||||
$.post(ext.contextPath + '/work/kpipoint/edit.do', {id:id} , 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 viewFun = function (id) {
|
||||||
$.post(ext.contextPath + '/work/kpipoint/view.do', {id:id} , function(data) {
|
$.post(ext.contextPath + '/work/kpipoint/view.do', {id: id}, function (data) {
|
||||||
$("#subDiv").html(data);
|
$("#subDiv").html(data);
|
||||||
openModal('subModal');
|
openModal('subModal');
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
var deleteFun = function(id) {
|
var deleteFun = function (id) {
|
||||||
stopBubbleDefaultEvent();
|
stopBubbleDefaultEvent();
|
||||||
swal({
|
swal({
|
||||||
text: "您确定要删除此记录?",
|
text: "您确定要删除此记录?",
|
||||||
@ -87,13 +93,13 @@ var companyId = "";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function(willDelete) {
|
.then(function (willDelete) {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
$.post(ext.contextPath + '/work/kpipoint/delete.do', {id : id}, function(data) {
|
$.post(ext.contextPath + '/work/kpipoint/delete.do', {id: id}, function (data) {
|
||||||
if(data==1){
|
if (data == 1) {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
}else{
|
} else {
|
||||||
showAlert('d','删除失败','mainAlertdiv');
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -101,15 +107,15 @@ var companyId = "";
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
//删除多条资产类型数据
|
//删除多条资产类型数据
|
||||||
var deletesFun = function() {
|
var deletesFun = function () {
|
||||||
var checkedItems = $("#table").bootstrapTable('getSelections');
|
var checkedItems = $("#table").bootstrapTable('getSelections');
|
||||||
var datas="";
|
var datas = "";
|
||||||
$.each(checkedItems, function(index, item){
|
$.each(checkedItems, function (index, item) {
|
||||||
datas+=item.id+",";
|
datas += item.id + ",";
|
||||||
});
|
});
|
||||||
if(datas==""){
|
if (datas == "") {
|
||||||
showAlert('d','请先选择记录','mainAlertdiv');
|
showAlert('d', '请先选择记录', 'mainAlertdiv');
|
||||||
}else{
|
} else {
|
||||||
swal({
|
swal({
|
||||||
text: "您确定要删除此记录?",
|
text: "您确定要删除此记录?",
|
||||||
dangerMode: true,
|
dangerMode: true,
|
||||||
@ -130,13 +136,13 @@ var companyId = "";
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.then(function(willDelete) {
|
.then(function (willDelete) {
|
||||||
if (willDelete) {
|
if (willDelete) {
|
||||||
$.post(ext.contextPath + '/work/kpipoint/deletes.do', {ids:datas} , function(data) {
|
$.post(ext.contextPath + '/work/kpipoint/deletes.do', {ids: datas}, function (data) {
|
||||||
if(data>0){
|
if (data > 0) {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
}else{
|
} else {
|
||||||
showAlert('d','删除失败','mainAlertdiv');
|
showAlert('d', '删除失败', 'mainAlertdiv');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -144,115 +150,128 @@ var companyId = "";
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
var dosearch = function() {
|
var dosearch = function () {
|
||||||
$("#table").bootstrapTable('refresh');
|
$("#table").bootstrapTable('refresh');
|
||||||
};
|
};
|
||||||
var refreshSelect = function() {
|
var loadProcessSectionSelect = function (bizId) {
|
||||||
var selelct_ =$("#processSection").select2({
|
if (!bizId) {
|
||||||
|
refreshSelect();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId: bizId}, 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");
|
||||||
|
// 用select2事件触发查询,避免普通change导致选中文本被立即重置
|
||||||
|
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,
|
data: null,
|
||||||
placeholder:'请选择',//默认文字提示
|
placeholder: '请选择',//默认文字提示
|
||||||
allowClear: true,//允许清空
|
allowClear: true,//允许清空
|
||||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
escapeMarkup: function (markup) {
|
||||||
|
return markup;
|
||||||
|
}, // 自定义格式化防止xss注入
|
||||||
language: "zh-CN",
|
language: "zh-CN",
|
||||||
minimumInputLength: 0,
|
minimumInputLength: 0,
|
||||||
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
minimumResultsForSearch: 10,//数据超过十个启用搜索框
|
||||||
});
|
});
|
||||||
$("#processSection").empty();
|
$("#processSection").empty();
|
||||||
// $("#table").bootstrapTable('refresh', {data:null});
|
// $("#table").bootstrapTable('refresh', {data:null});
|
||||||
$(".select2-selection--single").css({'height':'30px','paddingTop':'4px'})
|
$(".select2-selection--single").css({'height': '30px', 'paddingTop': '4px'})
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
$(function() {
|
$(function () {
|
||||||
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function(data) {
|
$.post(ext.contextPath + "/user/getSearchBizsByUserId4Select.do", {}, function (data) {
|
||||||
if(data.length == 1){
|
if (data.length == 1) {
|
||||||
//选择厂区为一个厂时隐藏选择框
|
//选择厂区为一个厂时隐藏选择框
|
||||||
$("#search_code").css("display", "none");
|
$("#search_code").css("display", "none");
|
||||||
$("#company").text(data[0].text);
|
$("#company").text(data[0].text);
|
||||||
companyId=data[0].id;
|
companyId = data[0].id;
|
||||||
|
loadProcessSectionSelect(companyId);
|
||||||
dosearch();
|
dosearch();
|
||||||
$.post(ext.contextPath + "/user/processSection/getProcessSection4Select.do", {companyId:companyId}, function(data) {
|
} else {
|
||||||
$("#processSection").empty();
|
// 当前页面可能不展示厂区下拉(search_code被注释),兜底按当前厂区/首个厂区加载工艺段
|
||||||
var selelct_ =$("#processSection").select2({
|
if ($("#search_code").length == 0) {
|
||||||
data: data,
|
companyId = (typeof unitId !== "undefined" && unitId) ? unitId : data[0].id;
|
||||||
cache : false,
|
loadProcessSectionSelect(companyId);
|
||||||
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();
|
dosearch();
|
||||||
});
|
return;
|
||||||
|
}
|
||||||
},'json');
|
|
||||||
}else{
|
|
||||||
$("#company").css("display", "none");
|
$("#company").css("display", "none");
|
||||||
var selelct=$("#search_code").select2({
|
var selelct = $("#search_code").select2({
|
||||||
data : data ,
|
|
||||||
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");
|
|
||||||
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,
|
data: data,
|
||||||
cache : false,
|
placeholder: '请选择',//默认文字提示
|
||||||
placeholder:'请选择',//默认文字提示
|
|
||||||
allowClear: true,//允许清空
|
allowClear: true,//允许清空
|
||||||
escapeMarkup: function (markup) { return markup; }, // 自定义格式化防止xss注入
|
escapeMarkup: function (markup) {
|
||||||
|
return markup;
|
||||||
|
}, // 自定义格式化防止xss注入
|
||||||
language: "zh-CN",
|
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;
|
||||||
|
}, // 函数用来渲染结果
|
||||||
|
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){
|
refreshSelect();
|
||||||
|
selelct.off("select2:select select2:clear").on("select2:select select2:clear", function () {
|
||||||
|
companyId = $(this).val();
|
||||||
dosearch();
|
dosearch();
|
||||||
});
|
refreshSelect();
|
||||||
},'json');
|
loadProcessSectionSelect(companyId);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
},'json');
|
}, 'json');
|
||||||
|
|
||||||
$("#table").bootstrapTable({ // 对应table标签的id
|
$("#table").bootstrapTable({ // 对应table标签的id
|
||||||
url: ext.contextPath + '/work/kpipoint/getlist.do', // 获取表格数据的url
|
url: ext.contextPath + '/work/kpipoint/getlist.do', // 获取表格数据的url
|
||||||
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
cache: false, // 设置为 false 禁用 AJAX 数据缓存, 默认为true
|
||||||
striped: true, //表格显示条纹,默认为false
|
striped: true, //表格显示条纹,默认为false
|
||||||
pagination: true, // 在表格底部显示分页组件,默认false
|
pagination: true, // 在表格底部显示分页组件,默认false
|
||||||
pageList: [10, 20,50], // 设置页面可以显示的数据条数
|
pageList: [10, 20, 50], // 设置页面可以显示的数据条数
|
||||||
pageSize: 50, // 页面数据条数
|
pageSize: 50, // 页面数据条数
|
||||||
pageNumber: 1, // 首页页码
|
pageNumber: 1, // 首页页码
|
||||||
sidePagination: 'server', // 设置为服务器端分页
|
sidePagination: 'server', // 设置为服务器端分页
|
||||||
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
queryParams: function (params) { // 请求服务器数据时发送的参数,可以在这里添加额外的查询参数,返回false则终止请求
|
||||||
return {
|
return {
|
||||||
rows: params.limit, // 每页要显示的数据条数
|
rows: params.limit, // 每页要显示的数据条数
|
||||||
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(),
|
||||||
companyId: unitId,
|
companyId: companyId,
|
||||||
pSectionId: $("#processSection").val(),
|
pSectionId: $("#processSection").val(),
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -264,55 +283,55 @@ var companyId = "";
|
|||||||
columns: [
|
columns: [
|
||||||
{
|
{
|
||||||
checkbox: true, // 显示一个勾选框
|
checkbox: true, // 显示一个勾选框
|
||||||
},{
|
}, {
|
||||||
field: 'mpointid', // 返回json数据中的name
|
field: 'mpointid', // 返回json数据中的name
|
||||||
title: '测量点编号', // 表格表头显示文字
|
title: '测量点编号', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle' // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
},{
|
}, {
|
||||||
field: 'mpointname', // 返回json数据中的name
|
field: 'mpointname', // 返回json数据中的name
|
||||||
title: '测量点名称', // 表格表头显示文字
|
title: '测量点名称', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle' // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
},{
|
}, {
|
||||||
field: 'bizid', // 返回json数据中的name
|
field: 'bizid', // 返回json数据中的name
|
||||||
title: '所属厂区', // 表格表头显示文字
|
title: '所属厂区', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle' // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
},{
|
}, {
|
||||||
field: 'processectionname', // 返回json数据中的name
|
field: 'processectionname', // 返回json数据中的name
|
||||||
title: '工艺段', // 表格表头显示文字
|
title: '工艺段', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle' // 上下居中
|
valign: 'middle' // 上下居中
|
||||||
},{
|
}, {
|
||||||
field: 'grade', // 返回json数据中的name
|
field: 'grade', // 返回json数据中的name
|
||||||
title: '重要等级', // 表格表头显示文字
|
title: '重要等级', // 表格表头显示文字
|
||||||
align: 'center', // 左右居中
|
align: 'center', // 左右居中
|
||||||
valign: 'middle'
|
valign: 'middle'
|
||||||
},{
|
}, {
|
||||||
title: "操作",
|
title: "操作",
|
||||||
align: 'center',
|
align: 'center',
|
||||||
valign: 'middle',
|
valign: 'middle',
|
||||||
width: 120, // 定义列的宽度,单位为像素px
|
width: 120, // 定义列的宽度,单位为像素px
|
||||||
formatter: function (value, row, index) {
|
formatter: function (value, row, index) {
|
||||||
var buts="";
|
var buts = "";
|
||||||
buts+= '<security:authorize buttonUrl="work/scadaPic/edit.do">';
|
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 += '<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>';
|
||||||
|
|
||||||
buts+= '<security:authorize buttonUrl="work/scadaPic/delete.do">';
|
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 += '<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 += '</security:authorize>';
|
||||||
|
|
||||||
buts='<div class="btn-group" >'+buts+'</div>';
|
buts = '<div class="btn-group" >' + buts + '</div>';
|
||||||
return buts;
|
return buts;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
onLoadSuccess: function(){ //加载成功时执行
|
onLoadSuccess: function () { //加载成功时执行
|
||||||
adjustBootstrapTableView("table");
|
adjustBootstrapTableView("table");
|
||||||
},
|
},
|
||||||
onLoadError: function(){ //加载失败时执行
|
onLoadError: function () { //加载失败时执行
|
||||||
console.info("加载数据失败");
|
console.info("加载数据失败");
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -320,11 +339,11 @@ var companyId = "";
|
|||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
</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> --%>
|
||||||
<!-- 菜单栏 -->
|
<!-- 菜单栏 -->
|
||||||
@ -332,9 +351,9 @@ var companyId = "";
|
|||||||
<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>
|
||||||
@ -343,7 +362,7 @@ var companyId = "";
|
|||||||
<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>
|
||||||
@ -354,23 +373,30 @@ var companyId = "";
|
|||||||
<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 class="fa fa-plus"></i> 新增</button>
|
<button type="button" class="btn btn-default btn-sm" onclick="addFun();"><i
|
||||||
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i class="fa fa-trash-o"></i> 删除</button>
|
class="fa fa-plus"></i> 新增
|
||||||
|
</button>
|
||||||
|
<button type="button" class="btn btn-default btn-sm" onclick="deletesFun();"><i
|
||||||
|
class="fa fa-trash-o"></i> 删除
|
||||||
|
</button>
|
||||||
</security:authorize>
|
</security:authorize>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<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 class="form-group pull-right">
|
<div class="form-group pull-right">
|
||||||
<label class="form-label">工艺段</label>
|
<label class="form-label">工艺段</label>
|
||||||
<select class="form-control select2 " id="processSection" name ="processSection" style="width: 220px;"></select>
|
<select class="form-control select2 " id="processSection" name="processSection"
|
||||||
|
style="width: 220px;"></select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -378,29 +404,32 @@ var companyId = "";
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
<!-- /.content -->
|
<!-- /.content -->
|
||||||
</div>
|
</div>
|
||||||
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
<%-- <jsp:include page="/jsp/bottom.jsp"></jsp:include> --%>
|
||||||
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
<%-- <jsp:include page="/jsp/side.jsp"></jsp:include> --%>
|
||||||
</div>
|
</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,32 +206,13 @@ 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');
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user