Merge branch 'dev_xd' of http://62.234.3.186:3000/jiangyq/YZProjectCloud into dev_xd
# Conflicts: # yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/WxMenuConfigMapper.xmldev_xd
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 788 B |
|
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 816 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 731 B |
|
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 738 B |
|
|
@ -0,0 +1,332 @@
|
|||
function aggregateDataByDate(executionData) {
|
||||
const dateMap = new Map();
|
||||
// 按start排序,相同时按end排序
|
||||
executionData.sort((a, b) => {
|
||||
const startA = new Date(a.start);
|
||||
const startB = new Date(b.start);
|
||||
if (startA.getTime() !== startB.getTime()) {
|
||||
return startA - startB;
|
||||
}
|
||||
const endA = new Date(a.end);
|
||||
const endB = new Date(b.end);
|
||||
return endA - endB;
|
||||
});
|
||||
// 获取整个时间范围
|
||||
let minDate = new Date(executionData[0].start);
|
||||
let maxDate = new Date(executionData[0].end);
|
||||
|
||||
// 遍历所有任务,找到最小和最大日期
|
||||
executionData.forEach((task) => {
|
||||
const startDate = new Date(task.start);
|
||||
const endDate = new Date(task.end);
|
||||
|
||||
if (startDate < minDate) minDate = startDate;
|
||||
if (endDate > maxDate) maxDate = endDate;
|
||||
});
|
||||
|
||||
// 初始化每一天的数据
|
||||
const currentDate = new Date(minDate);
|
||||
while (currentDate <= maxDate) {
|
||||
const dateStr = currentDate.toISOString().split("T")[0];
|
||||
dateMap.set(dateStr, {
|
||||
date: dateStr,
|
||||
planned: 0,
|
||||
completed: 0,
|
||||
progressSum: 0,
|
||||
progressCount: 0,
|
||||
});
|
||||
currentDate.setDate(currentDate.getDate() + 1);
|
||||
}
|
||||
|
||||
// 为每个任务创建日期范围
|
||||
executionData.forEach((task) => {
|
||||
const startDate = new Date(task.start);
|
||||
const endDate = new Date(task.end);
|
||||
|
||||
// 遍历任务的每一天
|
||||
const currentTaskDate = new Date(startDate);
|
||||
while (currentTaskDate <= endDate) {
|
||||
const dateStr = currentTaskDate.toISOString().split("T")[0];
|
||||
|
||||
if (dateMap.has(dateStr)) {
|
||||
// 增加计划任务数
|
||||
dateMap.get(dateStr).planned += 1;
|
||||
}
|
||||
|
||||
// 移动到下一天
|
||||
currentTaskDate.setDate(currentTaskDate.getDate() + 1);
|
||||
}
|
||||
});
|
||||
|
||||
// 统计完成任务(基于开始日期)
|
||||
executionData.forEach((task) => {
|
||||
if (task.process !== null) {
|
||||
const startDate = task.start;
|
||||
|
||||
if (dateMap.has(startDate)) {
|
||||
dateMap.get(startDate).completed += 1;
|
||||
dateMap.get(startDate).progressSum += task.process;
|
||||
dateMap.get(startDate).progressCount += 1;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// 转换为数组并按日期排序
|
||||
const result = Array.from(dateMap.values()).sort((a, b) => {
|
||||
return new Date(a.date) - new Date(b.date);
|
||||
});
|
||||
|
||||
// 获取今天的日期
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
// 计算累积进度
|
||||
let totalPlanned = 0;
|
||||
let totalCompleted = 0;
|
||||
let totalProgressSum = 0;
|
||||
let totalProgressCount = 0;
|
||||
|
||||
result.forEach((item) => {
|
||||
totalPlanned += item.planned;
|
||||
// 检查日期是否在今天之后
|
||||
const itemDate = new Date(item.date);
|
||||
if (itemDate > today) {
|
||||
// 今日之后的数据设置为null
|
||||
item.completed = null;
|
||||
item.progressSum = null;
|
||||
item.progressCount = null;
|
||||
} else {
|
||||
totalCompleted += item.completed || 0;
|
||||
totalProgressSum += item.progressSum || 0;
|
||||
totalProgressCount += item.progressCount || 0;
|
||||
}
|
||||
|
||||
// 添加累积数据
|
||||
item.cumulativePlanned = totalPlanned;
|
||||
// 对于今日之后的数据,cumulativeCompleted也设置为null
|
||||
if (new Date(item.date) > today) {
|
||||
item.cumulativeCompleted = null;
|
||||
} else {
|
||||
item.cumulativeCompleted = totalCompleted;
|
||||
}
|
||||
item.cumulativeProgress =
|
||||
totalProgressCount > 0 ? totalProgressSum / totalProgressCount : 0;
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
function makeTaskTrendOptions(that, datas) {
|
||||
// 填充统计数据表格
|
||||
const summaryData = aggregateDataByDate(datas);
|
||||
// 准备图表数据
|
||||
const dates = summaryData.map((item) => item.date);
|
||||
const cumulativePlanned = summaryData.map((item) => {
|
||||
const totalTasks = summaryData[summaryData.length - 1].cumulativePlanned;
|
||||
return totalTasks > 0 ? (item.cumulativePlanned / totalTasks) * 100 : 0;
|
||||
});
|
||||
|
||||
const cumulativeCompleted = summaryData.map((item) => {
|
||||
// 如果completed为null,表示该日期在今日之后,返回null
|
||||
if (item.cumulativeCompleted === null) {
|
||||
return null;
|
||||
}
|
||||
const totalTasks = summaryData[summaryData.length - 1].cumulativePlanned;
|
||||
return totalTasks > 0 ? (item.cumulativeCompleted / totalTasks) * 100 : 0;
|
||||
});
|
||||
let is1K = that.$dpi() == "1K";
|
||||
let is2K = that.$dpi() == "2K";
|
||||
// 配置图表选项
|
||||
const option = {
|
||||
tooltip: {
|
||||
trigger: "axis",
|
||||
formatter: function (params) {
|
||||
let result = params[0].name + "<br/>";
|
||||
// 查找当前日期的数据
|
||||
const currentItem = summaryData.find(
|
||||
(item) => item.date === params[0].name
|
||||
);
|
||||
if (currentItem) {
|
||||
// 计算统计数据
|
||||
const totalDays = summaryData.length; // 总天数
|
||||
// 计划完成天数(有计划任务的天数)
|
||||
const plannedDays = summaryData.filter(
|
||||
(item) => item.planned > 0
|
||||
).length;
|
||||
|
||||
// 实际完成天数处理
|
||||
let actualCompletedDays = 0;
|
||||
const currentDate = new Date(currentItem.date);
|
||||
const today = new Date();
|
||||
today.setHours(0, 0, 0, 0);
|
||||
|
||||
if (currentDate > today) {
|
||||
// 今日之后的日期,使用之前最大的完成天数值
|
||||
const pastData = summaryData.filter((item) => {
|
||||
const itemDate = new Date(item.date);
|
||||
return itemDate <= today && item.completed > 0;
|
||||
});
|
||||
actualCompletedDays = pastData.length;
|
||||
} else {
|
||||
// 今日及之前的日期,使用当前的实际完成天数
|
||||
actualCompletedDays = summaryData.filter((item) => {
|
||||
const itemDate = new Date(item.date);
|
||||
return itemDate <= currentDate && item.completed > 0;
|
||||
}).length;
|
||||
}
|
||||
|
||||
result += "总天数: " + totalDays + " 天<br/>";
|
||||
result += "计划天数: " + plannedDays + " 天<br/>";
|
||||
result += "完成天数: " + actualCompletedDays + " 天<br/>";
|
||||
}
|
||||
|
||||
params.forEach((param) => {
|
||||
// 处理null值和undefined的情况
|
||||
if (param.value === null || param.value === undefined) {
|
||||
result += param.marker + param.seriesName + ": 无数据<br/>";
|
||||
} else {
|
||||
result +=
|
||||
param.marker +
|
||||
param.seriesName +
|
||||
": " +
|
||||
param.value.toFixed(2) +
|
||||
"%<br/>";
|
||||
}
|
||||
});
|
||||
return result;
|
||||
},
|
||||
axisPointer: {
|
||||
lineStyle: {
|
||||
color: "#57617B",
|
||||
},
|
||||
},
|
||||
textStyle: {
|
||||
fontSize: is1K ? 12 : is2K ? 18 : 20,
|
||||
},
|
||||
},
|
||||
legend: {
|
||||
icon: "rect",
|
||||
itemWidth: 14,
|
||||
itemHeight: 10,
|
||||
itemGap: 15,
|
||||
data: ["计划任务累积进度", "已完成任务累积进度"],
|
||||
top: -5,
|
||||
textStyle: {
|
||||
fontSize: is1K ? 12 : is2K ? 20 : 30,
|
||||
color: "#c8dbfc",
|
||||
},
|
||||
},
|
||||
grid: {
|
||||
top: "10%",
|
||||
left: "2%",
|
||||
right: "3%",
|
||||
bottom: "5%",
|
||||
containLabel: true,
|
||||
},
|
||||
xAxis: {
|
||||
boundaryGap: false,
|
||||
type: "category",
|
||||
data: dates,
|
||||
axisLine: {
|
||||
//坐标轴轴线相关设置。数学上的x轴
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#25597e",
|
||||
type: "dashed",
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
|
||||
axisLabel: {
|
||||
//坐标轴刻度标签的相关设置
|
||||
textStyle: {
|
||||
color: "#c5d9fc",
|
||||
margin: 20,
|
||||
fontSize: 12,
|
||||
},
|
||||
},
|
||||
},
|
||||
yAxis: {
|
||||
type: "value",
|
||||
name: "累积进度 (%)",
|
||||
axisLabel: {
|
||||
formatter: "{value} %",
|
||||
//坐标轴刻度标签的相关设置
|
||||
textStyle: {
|
||||
color: "#c5d9fc",
|
||||
margin: 20,
|
||||
fontSize: is1K ? 12 : is2K ? 16 : 20,
|
||||
},
|
||||
},
|
||||
nameTextStyle: {
|
||||
color: "#c5d9fc",
|
||||
fontSize: is1K ? 12 : is2K ? 18 : 24,
|
||||
},
|
||||
axisLine: {
|
||||
//坐标轴轴线相关设置。数学上的x轴
|
||||
show: false,
|
||||
lineStyle: {
|
||||
color: "#c5d9fc",
|
||||
type: "dashed",
|
||||
},
|
||||
},
|
||||
axisTick: {
|
||||
show: false,
|
||||
},
|
||||
splitLine: {
|
||||
show: true,
|
||||
lineStyle: {
|
||||
color: "#25597e",
|
||||
type: "dashed",
|
||||
},
|
||||
},
|
||||
},
|
||||
dataZoom: [
|
||||
{
|
||||
type: "inside",
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
end: 100,
|
||||
},
|
||||
],
|
||||
series: [
|
||||
{
|
||||
name: "计划任务累积进度",
|
||||
type: "line",
|
||||
data: cumulativePlanned,
|
||||
smooth: true,
|
||||
itemStyle: {
|
||||
color: "#36A2EB",
|
||||
},
|
||||
areaStyle: {
|
||||
color: "#36A2EB",
|
||||
opacity: 0.2,
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "已完成任务累积进度",
|
||||
type: "line",
|
||||
data: cumulativeCompleted,
|
||||
connectNulls: false, // 不连接null值
|
||||
smooth: true,
|
||||
itemStyle: {
|
||||
color: "#FF6384",
|
||||
},
|
||||
areaStyle: {
|
||||
color: "#FF6384",
|
||||
opacity: 0.2,
|
||||
},
|
||||
},
|
||||
],
|
||||
};
|
||||
return option;
|
||||
}
|
||||
|
||||
export default {
|
||||
makeTaskTrendOptions,
|
||||
};
|
||||
|
|
@ -11,21 +11,22 @@ import org.springframework.context.annotation.Configuration;
|
|||
@Configuration
|
||||
@ConfigurationProperties(prefix = "baidu.face")
|
||||
public class BaiduFaceProperties {
|
||||
|
||||
|
||||
private String imgUrl="https://xiangguan.sxyanzhu.com";
|
||||
/**
|
||||
* 百度人脸识别应用的App ID
|
||||
*/
|
||||
private String appId = "7034646";
|
||||
private String appId = "117160042";//"119949649";//
|
||||
|
||||
/**
|
||||
* 百度人脸识别应用的API Key
|
||||
*/
|
||||
private String apiKey = "L3PiEzO9dMFJDExMTjOxuTtq";
|
||||
private String apiKey = "rS40xCCuGuVNFRopPI0jlMuj";//"L3PiEzO9dMFJDExMTjOxuTtq";//
|
||||
|
||||
/**
|
||||
* 百度人脸识别应用的Secret Key
|
||||
*/
|
||||
private String secretKey = "40LMey6WC1MYIqLU4m5Qe8K4foFUM1bc";
|
||||
private String secretKey ="3bY7dADqQq3O4UpXpFA1FJAj6LN57QCS";//"40LMey6WC1MYIqLU4m5Qe8K4foFUM1bc" ;//
|
||||
|
||||
/**
|
||||
* 相似度阈值,大于此值认为是同一个人
|
||||
|
|
@ -48,7 +49,15 @@ public class BaiduFaceProperties {
|
|||
private int retryDelay = 2000;
|
||||
|
||||
// Getter和Setter方法
|
||||
|
||||
|
||||
public String getImgUrl() {
|
||||
return imgUrl;
|
||||
}
|
||||
|
||||
public void setImgUrl(String imgUrl) {
|
||||
this.imgUrl = imgUrl;
|
||||
}
|
||||
|
||||
public String getAppId() {
|
||||
return appId;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,344 @@
|
|||
package com.yanzhu.common.core.utils;
|
||||
|
||||
import com.baidu.aip.face.AipFace;
|
||||
import com.yanzhu.common.core.config.BaiduFaceProperties;
|
||||
import com.yanzhu.common.core.utils.bean.BaiduFaceUserInfo;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* 基于百度人脸识别API的人脸库管理工具类
|
||||
* 提供人脸注册、更新、删除、查询等管理功能
|
||||
*
|
||||
* @author yanzhu
|
||||
*/
|
||||
@Component
|
||||
public class BaiduFaceManageUtils {
|
||||
|
||||
@Autowired
|
||||
private BaiduFaceProperties baiduFaceProperties;
|
||||
|
||||
// 初始化AipFace客户端
|
||||
private static AipFace client;
|
||||
|
||||
// QPS限制相关常量
|
||||
private static int QPS_LIMIT_DELAY = 1000; // 1秒延迟,避免QPS限制
|
||||
private static int MAX_RETRY_ATTEMPTS = 3; // 最大重试次数
|
||||
private static int RETRY_DELAY = 2000; // 重试延迟(毫秒)
|
||||
private static String imgBaseUrl="";
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// 从配置中获取参数
|
||||
String appId = baiduFaceProperties.getAppId();
|
||||
String apiKey = baiduFaceProperties.getApiKey();
|
||||
String secretKey = baiduFaceProperties.getSecretKey();
|
||||
imgBaseUrl=baiduFaceProperties.getImgUrl();
|
||||
// 初始化AipFace客户端
|
||||
client = new AipFace(appId, apiKey, secretKey);
|
||||
|
||||
// 设置网络连接参数
|
||||
client.setConnectionTimeoutInMillis(2000);
|
||||
client.setSocketTimeoutInMillis(60000);
|
||||
|
||||
// 更新静态变量
|
||||
QPS_LIMIT_DELAY = baiduFaceProperties.getQpsLimitDelay();
|
||||
MAX_RETRY_ATTEMPTS = baiduFaceProperties.getMaxRetryAttempts();
|
||||
RETRY_DELAY = baiduFaceProperties.getRetryDelay();
|
||||
}
|
||||
|
||||
public static void staticInit(BaiduFaceProperties baiduFaceProperties) {
|
||||
// 从配置中获取参数
|
||||
String appId = baiduFaceProperties.getAppId();
|
||||
String apiKey = baiduFaceProperties.getApiKey();
|
||||
String secretKey = baiduFaceProperties.getSecretKey();
|
||||
imgBaseUrl=baiduFaceProperties.getImgUrl();
|
||||
// 初始化AipFace客户端
|
||||
client = new AipFace(appId, apiKey, secretKey);
|
||||
|
||||
// 设置网络连接参数
|
||||
client.setConnectionTimeoutInMillis(2000);
|
||||
client.setSocketTimeoutInMillis(60000);
|
||||
|
||||
// 更新静态变量
|
||||
QPS_LIMIT_DELAY = baiduFaceProperties.getQpsLimitDelay();
|
||||
MAX_RETRY_ATTEMPTS = baiduFaceProperties.getMaxRetryAttempts();
|
||||
RETRY_DELAY = baiduFaceProperties.getRetryDelay();
|
||||
}
|
||||
/**
|
||||
* 人脸注册
|
||||
* 用于向人脸库中添加用户人脸信息
|
||||
*
|
||||
* @param imageBase64 图片信息,Base64编码
|
||||
* @param groupId 用户组ID(用于区分不同的人脸库)
|
||||
* @param userId 用户ID(用于标识用户)
|
||||
* @param userInfo 用户信息(可选,长度限制256B)
|
||||
* @return 注册结果,包含人脸ID等信息
|
||||
*/
|
||||
public static JSONObject faceRegister(String imageBase64, String groupId, String userId, String userInfo) {
|
||||
try {
|
||||
// 检查client是否已初始化
|
||||
if (client == null) {
|
||||
System.err.println("错误: Baidu AipFace client未初始化,请确保在Spring容器中正确初始化BaiduFaceManageUtils");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 添加延迟以避免QPS限制
|
||||
Thread.sleep(QPS_LIMIT_DELAY);
|
||||
|
||||
// 传入可选参数调用接口
|
||||
HashMap<String, String> options = new HashMap<String, String>();
|
||||
if (userInfo != null && !userInfo.isEmpty()) {
|
||||
options.put("user_info", userInfo);
|
||||
}
|
||||
options.put("quality_control", "NORMAL");
|
||||
options.put("liveness_control", "LOW");
|
||||
options.put("action_type", "REPLACE"); // 若在此用户组下不存在此用户ID,则添加,否则更新
|
||||
|
||||
// 调用百度人脸识别API的人脸注册接口
|
||||
JSONObject response = client.addUser(imageBase64, "BASE64", groupId, userId, options);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 人脸更新
|
||||
* 用于更新人脸库中的用户人脸信息
|
||||
*
|
||||
* @param imageBase64 图片信息,Base64编码
|
||||
* @param groupId 用户组ID
|
||||
* @param userId 用户ID
|
||||
* @param userInfo 用户信息(可选)
|
||||
* @return 更新结果
|
||||
*/
|
||||
public static JSONObject faceUpdate(String imageBase64, String groupId, String userId, String userInfo) {
|
||||
try {
|
||||
// 检查client是否已初始化
|
||||
if (client == null) {
|
||||
System.err.println("错误: Baidu AipFace client未初始化,请确保在Spring容器中正确初始化BaiduFaceManageUtils");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 添加延迟以避免QPS限制
|
||||
Thread.sleep(QPS_LIMIT_DELAY);
|
||||
|
||||
// 传入可选参数调用接口
|
||||
HashMap<String, String> options = new HashMap<String, String>();
|
||||
if (userInfo != null && !userInfo.isEmpty()) {
|
||||
options.put("user_info", userInfo);
|
||||
}
|
||||
options.put("quality_control", "NORMAL");
|
||||
options.put("liveness_control", "LOW");
|
||||
|
||||
// 调用百度人脸识别API的人脸更新接口
|
||||
JSONObject response = client.updateUser(imageBase64, "BASE64", groupId, userId, options);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 人脸删除
|
||||
* 用于从人脸库中删除用户人脸信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param groupId 用户组ID
|
||||
* @return 删除结果
|
||||
*/
|
||||
public static JSONObject faceDelete(String userId, String groupId) {
|
||||
try {
|
||||
// 检查client是否已初始化
|
||||
if (client == null) {
|
||||
System.err.println("错误: Baidu AipFace client未初始化,请确保在Spring容器中正确初始化BaiduFaceManageUtils");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 添加延迟以避免QPS限制
|
||||
Thread.sleep(QPS_LIMIT_DELAY);
|
||||
|
||||
// 传入可选参数调用接口
|
||||
HashMap<String, String> options = new HashMap<String, String>();
|
||||
|
||||
// 调用百度人脸识别API的人脸删除接口
|
||||
JSONObject response = client.faceDelete(userId, groupId, "", options);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 用户信息查询
|
||||
* 用于查询人脸库中的用户信息
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param groupId 用户组ID
|
||||
* @return 用户信息
|
||||
*/
|
||||
public static JSONObject getUserInfo(String userId, String groupId) {
|
||||
try {
|
||||
// 检查client是否已初始化
|
||||
if (client == null) {
|
||||
System.err.println("错误: Baidu AipFace client未初始化,请确保在Spring容器中正确初始化BaiduFaceManageUtils");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 添加延迟以避免QPS限制
|
||||
Thread.sleep(QPS_LIMIT_DELAY);
|
||||
|
||||
// 传入可选参数调用接口
|
||||
HashMap<String, String> options = new HashMap<String, String>();
|
||||
|
||||
// 调用百度人脸识别API的用户信息查询接口
|
||||
JSONObject response = client.getUser(userId, groupId, options);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户人脸列表
|
||||
* 用于查询指定用户在指定用户组下的人脸列表
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param groupId 用户组ID
|
||||
* @return 人脸列表
|
||||
*/
|
||||
public static JSONObject getFaceList(String userId, String groupId) {
|
||||
try {
|
||||
// 检查client是否已初始化
|
||||
if (client == null) {
|
||||
System.err.println("错误: Baidu AipFace client未初始化,请确保在Spring容器中正确初始化BaiduFaceManageUtils");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 添加延迟以避免QPS限制
|
||||
Thread.sleep(QPS_LIMIT_DELAY);
|
||||
|
||||
// 传入可选参数调用接口
|
||||
HashMap<String, String> options = new HashMap<String, String>();
|
||||
|
||||
// 调用百度人脸识别API的获取用户人脸列表接口
|
||||
JSONObject response = client.faceGetlist(userId, groupId, options);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取用户组列表
|
||||
* 用于查询当前应用下所有用户组
|
||||
*
|
||||
* @param startIndex 起始索引,默认为0
|
||||
* @param length 返回数量,默认为100,最大为1000
|
||||
* @return 用户组列表
|
||||
*/
|
||||
public static JSONObject getGroupList(int startIndex, int length) {
|
||||
try {
|
||||
// 检查client是否已初始化
|
||||
if (client == null) {
|
||||
System.err.println("错误: Baidu AipFace client未初始化,请确保在Spring容器中正确初始化BaiduFaceManageUtils");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 添加延迟以避免QPS限制
|
||||
Thread.sleep(QPS_LIMIT_DELAY);
|
||||
|
||||
// 传入可选参数调用接口
|
||||
HashMap<String, String> options = new HashMap<String, String>();
|
||||
options.put("start", String.valueOf(startIndex));
|
||||
options.put("length", String.valueOf(length));
|
||||
|
||||
// 调用百度人脸识别API的获取用户组列表接口
|
||||
JSONObject response = client.getGroupList(options);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 人脸搜索
|
||||
* 在指定人脸库中查找最相似的人脸
|
||||
*
|
||||
* @param imageBase64 图片信息,Base64编码
|
||||
* @param groupIds 用户组ID列表(多个用逗号分隔)
|
||||
* @return 搜索结果
|
||||
*/
|
||||
public static JSONObject faceSearch(String imageBase64, String groupIds) {
|
||||
try {
|
||||
// 检查client是否已初始化
|
||||
if (client == null) {
|
||||
System.err.println("错误: Baidu AipFace client未初始化,请确保在Spring容器中正确初始化BaiduFaceManageUtils");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 添加延迟以避免QPS限制
|
||||
Thread.sleep(QPS_LIMIT_DELAY);
|
||||
|
||||
// 传入可选参数调用接口
|
||||
HashMap<String, Object> options = new HashMap<String, Object>();
|
||||
options.put("quality_control", "NORMAL");
|
||||
options.put("liveness_control", "LOW");
|
||||
options.put("max_user_num", "3"); // 最多返回3个匹配用户
|
||||
|
||||
// 调用百度人脸识别API的人脸搜索接口
|
||||
JSONObject response = client.search(imageBase64, "BASE64", groupIds, options);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 人脸复制
|
||||
* 用于将用户从一个用户组复制到另一个用户组
|
||||
*
|
||||
* @param userId 用户ID
|
||||
* @param srcGroupId 源用户组ID
|
||||
* @param dstGroupId 目标用户组ID
|
||||
* @return 复制结果
|
||||
*/
|
||||
public static JSONObject faceCopy(String userId, String srcGroupId, String dstGroupId) {
|
||||
try {
|
||||
// 检查client是否已初始化
|
||||
if (client == null) {
|
||||
System.err.println("错误: Baidu AipFace client未初始化,请确保在Spring容器中正确初始化BaiduFaceManageUtils");
|
||||
return null;
|
||||
}
|
||||
|
||||
// 添加延迟以避免QPS限制
|
||||
Thread.sleep(QPS_LIMIT_DELAY);
|
||||
|
||||
// 传入可选参数调用接口
|
||||
HashMap<String, String> options = new HashMap<String, String>();
|
||||
options.put("src_group_id", srcGroupId);
|
||||
options.put("dst_group_id", dstGroupId);
|
||||
|
||||
// 调用百度人脸识别API的人脸复制接口
|
||||
JSONObject response = client.userCopy(userId, options);
|
||||
return response;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,8 +1,11 @@
|
|||
package com.yanzhu.common.core.utils;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.baidu.aip.face.AipFace;
|
||||
import com.baidu.aip.face.MatchRequest;
|
||||
import com.yanzhu.common.core.config.BaiduFaceProperties;
|
||||
import com.yanzhu.common.core.utils.BaiduFaceManageUtils;
|
||||
import com.yanzhu.common.core.utils.bean.BaiduFaceUserInfo;
|
||||
import org.json.JSONObject;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
|
@ -26,7 +29,7 @@ public class BaiduFaceSimilarityUtils {
|
|||
|
||||
@Autowired
|
||||
private BaiduFaceProperties baiduFaceProperties;
|
||||
|
||||
|
||||
// 初始化AipFace客户端
|
||||
private static AipFace client;
|
||||
|
||||
|
|
@ -37,14 +40,16 @@ public class BaiduFaceSimilarityUtils {
|
|||
private static int QPS_LIMIT_DELAY = 1000; // 1秒延迟,避免QPS限制
|
||||
private static int MAX_RETRY_ATTEMPTS = 3; // 最大重试次数
|
||||
private static int RETRY_DELAY = 2000; // 重试延迟(毫秒)
|
||||
|
||||
private static String imgBaseUrl="https://xiangguan.sxyanzhu.com";
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
// 从配置中获取参数
|
||||
String appId = baiduFaceProperties.getAppId();
|
||||
String apiKey = baiduFaceProperties.getApiKey();
|
||||
String secretKey = baiduFaceProperties.getSecretKey();
|
||||
|
||||
imgBaseUrl=baiduFaceProperties.getImgUrl();
|
||||
|
||||
// 初始化AipFace客户端
|
||||
client = new AipFace(appId, apiKey, secretKey);
|
||||
|
||||
|
|
@ -125,6 +130,130 @@ public class BaiduFaceSimilarityUtils {
|
|||
return similarity >= SIMILARITY_THRESHOLD;
|
||||
}
|
||||
|
||||
/**
|
||||
* 使用人脸库进行人脸对比
|
||||
* 将第一张图片注册到人脸库,然后用第二张图片在该人脸库中搜索匹配
|
||||
*
|
||||
* @param imageBase64_1 第一张图片的Base64编码(用于注册到人脸库)
|
||||
* @param imageBase64_2 第二张图片的Base64编码(用于在人脸库中搜索)
|
||||
* @param groupId 人脸库组ID
|
||||
* @param userId 用户ID
|
||||
* @return 相似度,范围0-1,越大表示越相似
|
||||
*/
|
||||
public static double calculateFaceSimilarityWithFaceLibrary(String imageBase64_1, String imageBase64_2, String groupId, String userId) {
|
||||
try {
|
||||
// 先将第一张图片注册到人脸库
|
||||
JSONObject registerResult = BaiduFaceManageUtils.faceRegister(imageBase64_1, groupId, userId, "临时用户");
|
||||
|
||||
// 检查注册结果
|
||||
if (registerResult != null && registerResult.has("error_code")) {
|
||||
String errorCode = registerResult.getString("error_code");
|
||||
if (!"0".equals(errorCode)) {
|
||||
System.err.println("人脸注册失败: " + registerResult.optString("error_msg", "未知错误"));
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
// 使用第二张图片在人脸库中搜索
|
||||
JSONObject searchResult = BaiduFaceManageUtils.faceSearch(imageBase64_2, groupId);
|
||||
|
||||
// 检查搜索结果
|
||||
if (searchResult != null && searchResult.has("error_code")) {
|
||||
String errorCode = searchResult.getString("error_code");
|
||||
if (!"0".equals(errorCode)) {
|
||||
System.err.println("人脸搜索失败: " + searchResult.optString("error_msg", "未知错误"));
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
// 解析搜索结果
|
||||
if (searchResult.has("result") && !searchResult.isNull("result")) {
|
||||
JSONObject result = searchResult.getJSONObject("result");
|
||||
if (result != null && result.has("user_list")) {
|
||||
org.json.JSONArray userList = result.getJSONArray("user_list");
|
||||
if (userList.length() > 0) {
|
||||
JSONObject user = userList.getJSONObject(0);
|
||||
if (user.has("score")) {
|
||||
// 百度API返回的相似度是百分比,需要转换为0-1范围
|
||||
double score = user.getDouble("score");
|
||||
return score / 100.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0.0;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据图片和分组ID,基于相似度查找人员,未找到返回null
|
||||
*
|
||||
* @param imgUrl 图片的Base64编码
|
||||
* @param groupId 用户组ID
|
||||
* @return 匹配的用户ID,未找到返回null
|
||||
*/
|
||||
public static BaiduFaceUserInfo findFaceSimilarityWithFaceLibrary(String imgUrl, String groupId) {
|
||||
try {
|
||||
if(StringUtils.isBlank(imgUrl)){
|
||||
return null;
|
||||
}
|
||||
if(!imgUrl.toLowerCase().startsWith("http")){
|
||||
imgUrl=imgBaseUrl+imgUrl;
|
||||
}
|
||||
String imageBase64=downloadAndEncodeImage(imgUrl);
|
||||
if (imageBase64 == null) {
|
||||
return null;
|
||||
}
|
||||
// 使用百度人脸识别API进行人脸搜索
|
||||
JSONObject searchResult = BaiduFaceManageUtils.faceSearch(imageBase64, groupId);
|
||||
|
||||
// 检查搜索结果
|
||||
if (searchResult != null && searchResult.has("error_code")) {
|
||||
Long errorCode = searchResult.getLong("error_code");
|
||||
if (0 == errorCode) { // 请求成功
|
||||
// 解析搜索结果
|
||||
if (searchResult.has("result") && !searchResult.isNull("result")) {
|
||||
JSONObject result = searchResult.getJSONObject("result");
|
||||
if (result != null && result.has("user_list")) {
|
||||
org.json.JSONArray userList = result.getJSONArray("user_list");
|
||||
if (userList.length() > 0) {
|
||||
JSONObject user = userList.getJSONObject(0);
|
||||
if (user.has("score")) {
|
||||
double score = user.getDouble("score");
|
||||
BaiduFaceUserInfo userInfo = new BaiduFaceUserInfo();
|
||||
userInfo.setSimilarity(score);
|
||||
if (score >= SIMILARITY_THRESHOLD) {
|
||||
if (user.has("user_info")) {
|
||||
userInfo.setUserId(user.getString("user_id"));
|
||||
userInfo.setGroupId(user.getString("group_id"));
|
||||
if (user.has("user_info")) {
|
||||
String jUser = user.getString("user_info");
|
||||
userInfo.setUserInfo(JSON.parseObject(jUser, Map.class));
|
||||
return userInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.err.println("人脸搜索失败: " + searchResult.optString("error_msg", "未知错误"));
|
||||
}
|
||||
}
|
||||
|
||||
return null; // 未找到匹配的用户
|
||||
}
|
||||
return null;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 下载图片并转换为Base64编码
|
||||
*
|
||||
|
|
@ -146,7 +275,14 @@ public class BaiduFaceSimilarityUtils {
|
|||
|
||||
// 将图片转换为Base64编码
|
||||
ByteArrayOutputStream baos = new ByteArrayOutputStream();
|
||||
ImageIO.write(image, "jpg", baos);
|
||||
|
||||
// 根据图片URL的扩展名确定图片格式,如果没有扩展名或不是png,则默认使用jpg
|
||||
String format = "jpg";
|
||||
if (imageUrl.toLowerCase().endsWith(".png")) {
|
||||
format = "png";
|
||||
}
|
||||
|
||||
ImageIO.write(image, format, baos);
|
||||
byte[] imageBytes = baos.toByteArray();
|
||||
return Base64.getEncoder().encodeToString(imageBytes);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -242,8 +378,73 @@ public class BaiduFaceSimilarityUtils {
|
|||
return 0.0;
|
||||
}
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
public static void main(String[] args) throws IOException {
|
||||
String userPicture3 = "/statics/2025/09/03/c4e2c8fb9d9f66e03902f9e3fea17f99_20250903165717A003.jpg";
|
||||
String userPicture1 = "https://xiangguan.sxyanzhu.com/statics/2025/09/16/8f24c9ee7a0c533679043412dc746e27_20250916092139A739.png";
|
||||
//String imageBase64 = downloadAndEncodeImage(userPicture3);
|
||||
String groupId="G191";
|
||||
BaiduFaceManageUtils.staticInit(new BaiduFaceProperties());
|
||||
BaiduFaceUserInfo user=findFaceSimilarityWithFaceLibrary(userPicture3, groupId);
|
||||
if(user==null){https://xiangguan.sxyanzhu.com/statics/2025/09/16/8f24c9ee7a0c533679043412dc746e27_20250916092139A739.png
|
||||
System.out.printf("未找到匹配用户");
|
||||
}else{
|
||||
System.out.println("匹配用户:"+JSON.toJSONString(user));
|
||||
}
|
||||
}
|
||||
|
||||
public static void main6(String[] args) {
|
||||
String userPicture1 = "https://xiangguan.sxyanzhu.com/statics/2025/09/03/836e5c21f83604894486069394dcd22e_20250903170015A004.jpg";
|
||||
String userPicture2 = "http://62.234.3.186/statics/2025/06/11/a28457e2847333886c8e0f4fd9cd24bc_20250611101313A331.jpg";
|
||||
String userPicture3 = "https://xiangguan.sxyanzhu.com/statics/2025/09/03/c4e2c8fb9d9f66e03902f9e3fea17f99_20250903165717A003.jpg";
|
||||
String userPicture4 = "https://xiangguan.sxyanzhu.com/statics/2025/09/03/8c7dd922ad47494fc02c388e12c00eac_20250903132353A852.png";
|
||||
String userPicture5 = "http://62.234.3.186/statics/2025/06/11/87052f8fa3eaa8840bc2e4fe556a825e_20250611101011A328.jpg";
|
||||
String userPicture6 = "https://xiangguan.sxyanzhu.com/statics/2025/09/05/a851473a6f5f6373b1ea73487d36dfba_20250905095748A594.jpg";
|
||||
// 打印每张图片的人脸信息
|
||||
List<BaiduFaceUserInfo> users = new ArrayList<BaiduFaceUserInfo>();
|
||||
users.add(new BaiduFaceUserInfo("U0001","张三", "G002", userPicture1));
|
||||
users.add(new BaiduFaceUserInfo("U0002","李君", "G002", userPicture2));
|
||||
users.add(new BaiduFaceUserInfo("U0003","王五", "G002", userPicture4));
|
||||
users.add(new BaiduFaceUserInfo("U0004","赵六", "G002", userPicture5));
|
||||
users.add(new BaiduFaceUserInfo("U0005","龙小孟", "G002", userPicture6));
|
||||
|
||||
BaiduFaceManageUtils.staticInit(new BaiduFaceProperties());
|
||||
// 把users注册到百度人脸库
|
||||
System.out.println("开始注册用户到百度人脸库...");
|
||||
for (BaiduFaceUserInfo user : users) {
|
||||
try {
|
||||
// 下载图片并转换为Base64编码
|
||||
String imageBase64 = downloadAndEncodeImage(user.getImage());
|
||||
if (imageBase64 != null) {
|
||||
// 调用百度人脸库管理工具注册用户
|
||||
JSONObject result = BaiduFaceManageUtils.faceUpdate(imageBase64, user.getGroupId(), user.getUserId().toString(), JSON.toJSONString(user));
|
||||
if (result != null && result.has("error_code")) {
|
||||
long errorCode = result.getLong("error_code");
|
||||
if (errorCode==0) {
|
||||
System.out.println("用户 " + user.getUserId() + " 注册成功");
|
||||
} else {
|
||||
String errorMsg = result.getString("error_msg");
|
||||
if(StringUtils.isNotBlank(errorMsg) && errorMsg.contains("not exists")){
|
||||
result=BaiduFaceManageUtils.faceRegister(imageBase64, user.getGroupId(), user.getUserId().toString(), JSON.toJSONString(user));
|
||||
}else{
|
||||
System.err.println("用户 " + user.getUserId() + " 注册失败: " + result.optString("error_msg", "未知错误"));
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
System.err.println("用户 " + user.getUserId() + " 图片下载失败");
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
System.err.println("用户 " + user.getUserId() + " 注册异常");
|
||||
}
|
||||
}
|
||||
System.out.println("用户注册完成");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static void main1(String[] args) {
|
||||
System.out.println("开始测试人脸相似度算法...");
|
||||
|
||||
// 测试1:同一个人的不同照片(应该匹配)
|
||||
|
|
@ -279,4 +480,76 @@ public class BaiduFaceSimilarityUtils {
|
|||
|
||||
System.out.println("\n测试完成。");
|
||||
}
|
||||
|
||||
// 人脸注册
|
||||
public static String faceAdd(BaiduFaceUserInfo bfUser) {
|
||||
String imgUrl= bfUser.getImage();
|
||||
if (imgUrl==null||imgUrl.isEmpty()){
|
||||
return "注册失败:无图片";
|
||||
}
|
||||
if(!imgUrl.toLowerCase().startsWith("http")){
|
||||
imgUrl=imgBaseUrl+imgUrl;
|
||||
}
|
||||
try{
|
||||
String imageBase64 = downloadAndEncodeImage(imgUrl);
|
||||
if (StringUtils.isNotEmpty(imageBase64)){
|
||||
JSONObject result = BaiduFaceManageUtils.faceRegister(imageBase64, bfUser.getGroupId(), bfUser.getUserId(), bfUser.getUserInfoStr());
|
||||
long errorCode = result.getLong("error_code");
|
||||
if (errorCode==0) {
|
||||
return "注册成功:" + bfUser.getUserId() + " 注册成功";
|
||||
} else {
|
||||
return "注册失败:" + bfUser.getUserId() + " ," + result.optString("error_msg");
|
||||
}
|
||||
}else{
|
||||
return "注册失败:图片编码失败";
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return "注册异常:"+e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// 人脸更新
|
||||
public static String faceUpdate(BaiduFaceUserInfo bfUser) {
|
||||
String imgUrl= bfUser.getImage();
|
||||
if (imgUrl==null||imgUrl.isEmpty()){
|
||||
return "更新失败:无图片";
|
||||
}
|
||||
if(!imgUrl.toLowerCase().startsWith("http")){
|
||||
imgUrl=imgBaseUrl+imgUrl;
|
||||
}
|
||||
try{
|
||||
String imageBase64 = downloadAndEncodeImage(imgUrl);
|
||||
if (StringUtils.isNotEmpty(imageBase64)){
|
||||
JSONObject result = BaiduFaceManageUtils.faceUpdate(imageBase64, bfUser.getGroupId(), bfUser.getUserId(), bfUser.getUserInfoStr());
|
||||
long errorCode = result.getLong("error_code");
|
||||
if (errorCode==0) {
|
||||
return "更新成功:" + bfUser.getUserId() + " 更新成功";
|
||||
} else {
|
||||
String errorMsg = result.getString("error_msg");
|
||||
if(StringUtils.isNotBlank(errorMsg) && errorMsg.contains("not exist")){
|
||||
return faceAdd(bfUser);
|
||||
}
|
||||
return "更新失败:" + bfUser.getUserId() + " ," + result.optString("error_msg");
|
||||
}
|
||||
}else{
|
||||
return "更新失败:图片编码失败";
|
||||
}
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
return "更新异常:"+e.getMessage();
|
||||
}
|
||||
}
|
||||
|
||||
// 人脸删除
|
||||
public static String faceDelete(String userId,String groupId) {
|
||||
JSONObject result = BaiduFaceManageUtils.faceDelete(userId,groupId);
|
||||
long errorCode = result.getLong("error_code");
|
||||
if (errorCode==0) {
|
||||
return "删除成功:" + userId + " 删除成功";
|
||||
} else {
|
||||
return "删除失败:" + groupId + " ," + result.optString("error_msg");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -11,7 +11,7 @@ public class OcrService {
|
|||
|
||||
public static final String TOKEN_URL="https://aip.baidubce.com/oauth/2.0/token";
|
||||
public static final String OCR_URL="https://aip.baidubce.com/rest/2.0/ocr/v1/idcard";
|
||||
public static final String APP_ID = "6283230";
|
||||
public static final String APP_ID = "117160042";
|
||||
public static final String APP_KEY="rS40xCCuGuVNFRopPI0jlMuj";
|
||||
public static final String APP_SECRET="3bY7dADqQq3O4UpXpFA1FJAj6LN57QCS";
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,81 @@
|
|||
package com.yanzhu.common.core.utils.bean;
|
||||
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class BaiduFaceUserInfo {
|
||||
public BaiduFaceUserInfo(String userId, String userName, String groupId, String image) {
|
||||
this.userId = userId;
|
||||
this.groupId = groupId;
|
||||
this.image = image;
|
||||
this.userInfo=new HashMap<>();
|
||||
this.userInfo.put("userId", userId);
|
||||
this.userInfo.put("userName", userName);
|
||||
this.userInfo.put("projectId", groupId);
|
||||
}
|
||||
|
||||
public BaiduFaceUserInfo(String userId, String groupId, String image) {
|
||||
this.userId = userId;
|
||||
this.groupId = groupId;
|
||||
this.image = image;
|
||||
this.userInfo=new HashMap<>();
|
||||
}
|
||||
|
||||
public BaiduFaceUserInfo() {
|
||||
this.userInfo=new HashMap<>();
|
||||
}
|
||||
|
||||
private String userId;
|
||||
private String groupId;
|
||||
private String image;
|
||||
|
||||
private double similarity;
|
||||
|
||||
public double getSimilarity() {
|
||||
return similarity;
|
||||
}
|
||||
|
||||
public void setSimilarity(double similarity) {
|
||||
this.similarity = similarity;
|
||||
}
|
||||
|
||||
public String getUserId() {
|
||||
return userId;
|
||||
}
|
||||
|
||||
public void setUserId(String userId) {
|
||||
this.userId = userId;
|
||||
}
|
||||
|
||||
public String getGroupId() {
|
||||
return groupId;
|
||||
}
|
||||
|
||||
public void setGroupId(String groupId) {
|
||||
this.groupId = groupId;
|
||||
}
|
||||
|
||||
public String getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(String image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
private Map<String, Object> userInfo;
|
||||
|
||||
public Map<String, Object> getUserInfo() {
|
||||
return userInfo;
|
||||
}
|
||||
|
||||
public void setUserInfo(Map<String, Object> userInfo) {
|
||||
this.userInfo = userInfo;
|
||||
}
|
||||
public String getUserInfoStr() {
|
||||
return JSON.toJSONString(userInfo);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -53,6 +53,132 @@ public class ProMobileAttendanceData extends BaseEntity
|
|||
|
||||
private String basePath;
|
||||
|
||||
/** 用户名 */
|
||||
@Excel(name = "用户名")
|
||||
private String userName;
|
||||
|
||||
/** 用户手机号 */
|
||||
@Excel(name = "用户手机号")
|
||||
private String userPhone;
|
||||
|
||||
/** 子部门名称 */
|
||||
@Excel(name = "子部门名称")
|
||||
private String subDeptName;
|
||||
|
||||
/** 子部门组别名称 */
|
||||
@Excel(name = "子部门组别名称")
|
||||
private String subDeptGroupName;
|
||||
|
||||
/** 工种名称 */
|
||||
@Excel(name = "工种名称")
|
||||
private String craftTypeName;
|
||||
|
||||
/** 岗位名称 */
|
||||
@Excel(name = "岗位名称")
|
||||
private String craftPostName;
|
||||
|
||||
/** 岗位名称 */
|
||||
@Excel(name = "岗位名称")
|
||||
private String userPost;
|
||||
|
||||
private Date startDate;
|
||||
private Date endDate;
|
||||
/** 用户性别 */
|
||||
@Excel(name = "用户性别")
|
||||
private String userSex;
|
||||
|
||||
/** 考勤设备 */
|
||||
@Excel(name = "考勤设备")
|
||||
private String attDevice;
|
||||
|
||||
public String getAttDevice() {
|
||||
return attDevice;
|
||||
}
|
||||
|
||||
public void setAttDevice(String attDevice) {
|
||||
this.attDevice = attDevice;
|
||||
}
|
||||
|
||||
public String getUserSex() {
|
||||
return userSex;
|
||||
}
|
||||
|
||||
public void setUserSex(String userSex) {
|
||||
this.userSex = userSex;
|
||||
}
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(Date startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getUserName() {
|
||||
return userName;
|
||||
}
|
||||
|
||||
public void setUserName(String userName) {
|
||||
this.userName = userName;
|
||||
}
|
||||
|
||||
public String getUserPhone() {
|
||||
return userPhone;
|
||||
}
|
||||
|
||||
public void setUserPhone(String userPhone) {
|
||||
this.userPhone = userPhone;
|
||||
}
|
||||
|
||||
public String getSubDeptName() {
|
||||
return subDeptName;
|
||||
}
|
||||
|
||||
public void setSubDeptName(String subDeptName) {
|
||||
this.subDeptName = subDeptName;
|
||||
}
|
||||
|
||||
public String getSubDeptGroupName() {
|
||||
return subDeptGroupName;
|
||||
}
|
||||
|
||||
public void setSubDeptGroupName(String subDeptGroupName) {
|
||||
this.subDeptGroupName = subDeptGroupName;
|
||||
}
|
||||
|
||||
public String getCraftTypeName() {
|
||||
return craftTypeName;
|
||||
}
|
||||
|
||||
public void setCraftTypeName(String craftTypeName) {
|
||||
this.craftTypeName = craftTypeName;
|
||||
}
|
||||
|
||||
public String getCraftPostName() {
|
||||
return craftPostName;
|
||||
}
|
||||
|
||||
public void setCraftPostName(String craftPostName) {
|
||||
this.craftPostName = craftPostName;
|
||||
}
|
||||
|
||||
public String getUserPost() {
|
||||
return userPost;
|
||||
}
|
||||
|
||||
public void setUserPost(String userPost) {
|
||||
this.userPost = userPost;
|
||||
}
|
||||
|
||||
public String getBasePath() {
|
||||
return basePath;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@ import com.yanzhu.common.core.web.domain.BaseEntity;
|
|||
import org.apache.commons.lang3.builder.ToStringBuilder;
|
||||
import org.apache.commons.lang3.builder.ToStringStyle;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
/**
|
||||
* 员工出入场记录对象 pro_user_inout_record
|
||||
*
|
||||
|
|
@ -73,6 +75,49 @@ public class ProUserInoutRecord extends BaseEntity
|
|||
@Excel(name = "用户岗位")
|
||||
private String userPost;
|
||||
|
||||
/** 工种类型名称 */
|
||||
@Excel(name = "工种类型名称")
|
||||
private String craftTypeName;
|
||||
|
||||
/** 工种岗位名称 */
|
||||
@Excel(name = "工种岗位名称")
|
||||
private String craftPostName;
|
||||
|
||||
private Date startDate;
|
||||
private Date endDate;
|
||||
|
||||
public Date getStartDate() {
|
||||
return startDate;
|
||||
}
|
||||
|
||||
public void setStartDate(Date startDate) {
|
||||
this.startDate = startDate;
|
||||
}
|
||||
|
||||
public Date getEndDate() {
|
||||
return endDate;
|
||||
}
|
||||
|
||||
public void setEndDate(Date endDate) {
|
||||
this.endDate = endDate;
|
||||
}
|
||||
|
||||
public String getCraftTypeName() {
|
||||
return craftTypeName;
|
||||
}
|
||||
|
||||
public void setCraftTypeName(String craftTypeName) {
|
||||
this.craftTypeName = craftTypeName;
|
||||
}
|
||||
|
||||
public String getCraftPostName() {
|
||||
return craftPostName;
|
||||
}
|
||||
|
||||
public void setCraftPostName(String craftPostName) {
|
||||
this.craftPostName = craftPostName;
|
||||
}
|
||||
|
||||
public String getUserPost() {
|
||||
return userPost;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ public interface ProPlanMapper
|
|||
/**
|
||||
* 查询计划任务数据
|
||||
*/
|
||||
public List<ProPlan> findAllPlanDatasByProId(Long proId);
|
||||
public List<ProPlan> findAllPlanDatasByProId(@Param("proId") Long proId,@Param("noBim") String noBim);
|
||||
|
||||
/**
|
||||
* 查询计划任务数据
|
||||
|
|
|
|||
|
|
@ -0,0 +1,49 @@
|
|||
package com.yanzhu.services;
|
||||
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
|
||||
public interface IBaiduFaceService {
|
||||
|
||||
/**
|
||||
* 系统用户百度人脸识别增加
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
String addSysUser(SysUser user);
|
||||
|
||||
/**
|
||||
* 系统用户百度人脸识别更新
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
String updateSysUser(SysUser user,boolean isRefresh);
|
||||
|
||||
/**
|
||||
* 系统用户百度人脸识别删除
|
||||
* @param userIds
|
||||
* @return
|
||||
*/
|
||||
String deleteSysUser(Long[] userIds);
|
||||
|
||||
/**
|
||||
* 项目用户百度人脸识别更新
|
||||
* @param proProjectInfoSubdeptsUsers
|
||||
* @return
|
||||
*/
|
||||
String updateProUser(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers,boolean isRefresh);
|
||||
|
||||
/**
|
||||
* 项目用户百度人脸识别删除
|
||||
* @param ids
|
||||
* @return
|
||||
*/
|
||||
String deleteProUser(Long[] ids);
|
||||
|
||||
/**
|
||||
* 项目用户百度人脸识别增加
|
||||
* @param proProjectInfoSubdeptsUsers
|
||||
* @return
|
||||
*/
|
||||
String addProUser(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
|
|
@ -0,0 +1,162 @@
|
|||
package com.yanzhu.services.impl;
|
||||
|
||||
|
||||
import com.yanzhu.common.core.utils.BaiduFaceSimilarityUtils;
|
||||
import com.yanzhu.common.core.utils.bean.BaiduFaceUserInfo;
|
||||
import com.yanzhu.common.core.utils.StringUtils;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||
import com.yanzhu.manage.mapper.ProProjectInfoSubdeptsUsersMapper;
|
||||
import com.yanzhu.services.IBaiduFaceService;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
import com.yanzhu.system.mapper.SysUserMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
@Service
|
||||
public class BaiduFaceService implements IBaiduFaceService {
|
||||
|
||||
@Autowired
|
||||
private SysUserMapper sysUserMapper;
|
||||
|
||||
@Autowired
|
||||
private ProProjectInfoSubdeptsUsersMapper proProjectInfoSubdeptsUsersMapper;
|
||||
|
||||
/**
|
||||
* 系统用户百度人脸识别增加
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String addSysUser(SysUser user) {
|
||||
if(StringUtils.isEmpty(user.getAvatar())){
|
||||
return "失败:无照片";
|
||||
}
|
||||
BaiduFaceUserInfo bfUser = new BaiduFaceUserInfo();
|
||||
bfUser.setUserId("S"+user.getUserId());
|
||||
bfUser.setGroupId("G"+user.getDeptId());
|
||||
bfUser.setImage(user.getAvatar());
|
||||
bfUser.getUserInfo().put("userName", user.getUserName());
|
||||
bfUser.getUserInfo().put("userId", user.getUserId());
|
||||
bfUser.getUserInfo().put("projectId", user.getDeptId());
|
||||
bfUser.getUserInfo().put("phone", user.getPhonenumber());
|
||||
bfUser.getUserInfo().put("cardCode", user.getCardCode());
|
||||
return BaiduFaceSimilarityUtils.faceAdd(bfUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统用户百度人脸识别更新
|
||||
* @param user
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String updateSysUser(SysUser user,boolean isRefresh) {
|
||||
if(StringUtils.isEmpty(user.getAvatar())){
|
||||
return "失败:无照片";
|
||||
}
|
||||
if(!isRefresh){
|
||||
SysUser oldUser=sysUserMapper.selectUserByUserId(user.getUserId());
|
||||
if(oldUser==null){
|
||||
return "失败:用户不存在";
|
||||
}
|
||||
if(StringUtils.equals(oldUser.getAvatar(),user.getAvatar())){
|
||||
return "失败:照片未改变";
|
||||
}
|
||||
}
|
||||
BaiduFaceUserInfo bfUser = new BaiduFaceUserInfo();
|
||||
bfUser.setUserId("S"+user.getUserId());
|
||||
bfUser.setGroupId("G"+user.getDeptId());
|
||||
bfUser.setImage(user.getAvatar());
|
||||
bfUser.getUserInfo().put("userName", user.getUserName());
|
||||
bfUser.getUserInfo().put("userId", user.getUserId());
|
||||
bfUser.getUserInfo().put("projectId", user.getDeptId());
|
||||
bfUser.getUserInfo().put("phone", user.getPhonenumber());
|
||||
bfUser.getUserInfo().put("cardCode", user.getCardCode());
|
||||
return BaiduFaceSimilarityUtils.faceUpdate(bfUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 系统用户百度人脸识别删除
|
||||
* @param userIds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String deleteSysUser(Long[] userIds) {
|
||||
for(Long userId:userIds){
|
||||
SysUser user=sysUserMapper.selectUserByUserId(userId);
|
||||
if(user!=null){
|
||||
BaiduFaceSimilarityUtils.faceDelete("S"+user.getUserId(),"G"+user.getDeptId());
|
||||
}
|
||||
}
|
||||
return "删除成功";
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目用户百度人脸识别增加
|
||||
* @param proProjectInfoSubdeptsUsers
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String updateProUser(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers,boolean isRefresh) {
|
||||
if(StringUtils.isEmpty(proProjectInfoSubdeptsUsers.getUserPicture())){
|
||||
return "失败:无照片";
|
||||
}
|
||||
if(!isRefresh) {
|
||||
ProProjectInfoSubdeptsUsers oldUser = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(proProjectInfoSubdeptsUsers.getId());
|
||||
if (oldUser == null) {
|
||||
return "失败:用户不存在";
|
||||
}
|
||||
if (StringUtils.equals(oldUser.getUserPicture(), proProjectInfoSubdeptsUsers.getUserPicture())) {
|
||||
return "失败:照片未改变";
|
||||
}
|
||||
}
|
||||
BaiduFaceUserInfo bfUser = new BaiduFaceUserInfo();
|
||||
bfUser.setUserId("P"+proProjectInfoSubdeptsUsers.getUserId());
|
||||
bfUser.setGroupId("G"+proProjectInfoSubdeptsUsers.getProjectId());
|
||||
bfUser.setImage(proProjectInfoSubdeptsUsers.getUserPicture());
|
||||
bfUser.getUserInfo().put("userName", proProjectInfoSubdeptsUsers.getUserName());
|
||||
bfUser.getUserInfo().put("userId", proProjectInfoSubdeptsUsers.getUserId());
|
||||
bfUser.getUserInfo().put("projectId", proProjectInfoSubdeptsUsers.getProjectId());
|
||||
bfUser.getUserInfo().put("phone", proProjectInfoSubdeptsUsers.getUserPhone());
|
||||
bfUser.getUserInfo().put("cardCode", proProjectInfoSubdeptsUsers.getCardCode());
|
||||
return BaiduFaceSimilarityUtils.faceUpdate(bfUser);
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目用户百度人脸识别删除
|
||||
* @param userIds
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String deleteProUser(Long[] userIds) {
|
||||
for(Long userId:userIds){
|
||||
ProProjectInfoSubdeptsUsers user=proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(userId);
|
||||
if(user!=null){
|
||||
BaiduFaceSimilarityUtils.faceDelete("P"+user.getUserId(),"G"+user.getProjectId());
|
||||
}
|
||||
}
|
||||
return "删除成功";
|
||||
}
|
||||
|
||||
/**
|
||||
* 项目用户百度人脸识别增加
|
||||
* @param proProjectInfoSubdeptsUsers
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public String addProUser(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers) {
|
||||
if(StringUtils.isEmpty(proProjectInfoSubdeptsUsers.getUserPicture())){
|
||||
return "失败:无照片";
|
||||
}
|
||||
BaiduFaceUserInfo bfUser = new BaiduFaceUserInfo();
|
||||
bfUser.setUserId("P"+proProjectInfoSubdeptsUsers.getUserId());
|
||||
bfUser.setGroupId("G"+proProjectInfoSubdeptsUsers.getProjectId());
|
||||
bfUser.setImage(proProjectInfoSubdeptsUsers.getUserPicture());
|
||||
bfUser.getUserInfo().put("userName", proProjectInfoSubdeptsUsers.getUserName());
|
||||
bfUser.getUserInfo().put("userId", proProjectInfoSubdeptsUsers.getUserId());
|
||||
bfUser.getUserInfo().put("projectId", proProjectInfoSubdeptsUsers.getProjectId());
|
||||
bfUser.getUserInfo().put("phone", proProjectInfoSubdeptsUsers.getUserPhone());
|
||||
bfUser.getUserInfo().put("cardCode", proProjectInfoSubdeptsUsers.getCardCode());
|
||||
return BaiduFaceSimilarityUtils.faceAdd(bfUser);
|
||||
}
|
||||
}
|
||||
|
|
@ -63,7 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
and ( (c.is_all=1 and c.valid=0 ) or g.group_id= #{groupId})
|
||||
</if>
|
||||
<if test="userId!=null">
|
||||
and ( (c.is_all=1 and c.valid=0 ) or g.group_id in (SELECT sub_dept_group from pro_project_info_subdepts_users where user_id=#{userId}) )
|
||||
and ( (c.is_all=1 and c.valid=0 ) or g.group_id in (SELECT sub_dept_group from pro_project_info_subdepts_users where user_id=#{userId} order by ifnull(update_time,date('2099-12-31')) desc ,create_time desc LIMIT 1) )
|
||||
</if>
|
||||
</where>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -21,31 +21,58 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="userPhone" column="user_phone" />
|
||||
<result property="subDeptName" column="sub_dept_name" />
|
||||
<result property="subDeptGroupName" column="sub_dept_group_name" />
|
||||
<result property="craftTypeName" column="craft_type_name" />
|
||||
<result property="craftPostName" column="craft_post_name" />
|
||||
<result property="userPost" column="user_post" />
|
||||
<result property="userSex" column="user_sex" />
|
||||
<result property="attDevice" column="att_device" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProMobileAttendanceDataVo">
|
||||
select id, user_id, project_id, cfg_id, in_out, longitude, latitude, att_date, att_img, is_del, remark, state, create_by, create_time, update_by, update_time from pro_mobile_attendance_data
|
||||
|
||||
select pma.id, pma.user_id, pma.project_id, pma.cfg_id, pma.in_out, pma.longitude, pma.latitude, pma.att_date, pma.att_img, pma.is_del,
|
||||
pma.remark, pma.state, pma.create_by, pma.create_time, pma.update_by, pma.update_time,
|
||||
dic1.dict_label as craft_type_name,dic2.dict_label as craft_post_name,pma.att_device,
|
||||
psu.user_name, psu.user_phone,psu.sub_dept_name,psu.sub_dept_group_name,psu.user_post,psu.user_sex
|
||||
from pro_mobile_attendance_data pma
|
||||
left join (
|
||||
SELECT t.* FROM pro_project_info_subdepts_users t
|
||||
INNER JOIN (SELECT user_id, MAX(CONCAT(IFNULL(update_time, DATE('2099-12-31')), create_time)) AS max_time_key FROM pro_project_info_subdepts_users GROUP BY user_id) t_max ON t.user_id = t_max.user_id
|
||||
AND CONCAT(IFNULL(t.update_time, DATE('2099-12-31')), t.create_time) = t_max.max_time_key
|
||||
) psu ON pma.user_id = psu.user_id
|
||||
left join sys_dict_data dic1 on psu.`craft_type`=dic1.`dict_value` and dic1.`dict_type`='pro_craft_type'
|
||||
left join sys_dict_data dic2 on psu.`craft_post`=dic2.`dict_value` and dic2.`dict_type`='pro_craft_post'
|
||||
|
||||
</sql>
|
||||
|
||||
<select id="selectProMobileAttendanceDataList" parameterType="ProMobileAttendanceData" resultMap="ProMobileAttendanceDataResult">
|
||||
<include refid="selectProMobileAttendanceDataVo"/>
|
||||
<where>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="cfgId != null "> and cfg_id = #{cfgId}</if>
|
||||
<if test="inOut != null and inOut != ''"> and in_out = #{inOut}</if>
|
||||
<if test="longitude != null "> and longitude = #{longitude}</if>
|
||||
<if test="latitude != null "> and latitude = #{latitude}</if>
|
||||
<if test="attDate != null "> and att_date = #{attDate}</if>
|
||||
<if test="attImg != null and attImg != ''"> and att_img = #{attImg}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="userId != null "> and pma.user_id = #{userId}</if>
|
||||
<if test="projectId != null "> and pma.project_id = #{projectId}</if>
|
||||
<if test="cfgId != null "> and pma.cfg_id = #{cfgId}</if>
|
||||
<if test="inOut != null and inOut != ''"> and pma.in_out = #{inOut}</if>
|
||||
<if test="longitude != null "> and pma.longitude = #{longitude}</if>
|
||||
<if test="latitude != null "> and pma.latitude = #{latitude}</if>
|
||||
<if test="attDate != null "> and pma.att_date = #{attDate}</if>
|
||||
<if test="attImg != null and attImg != ''"> and pma.att_img = #{attImg}</if>
|
||||
<if test="isDel != null "> and pma.is_del = #{isDel}</if>
|
||||
<if test="state != null "> and pma.state = #{state}</if>
|
||||
<if test="userName!=null and userName!=''"> and psu.user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userPhone!=null and userPhone!=''"> and psu.user_phone like concat('%', #{userPhone}, '%')</if>
|
||||
<if test="startDate!=null"> and date(pma.att_date) >= date(#{startDate})</if>
|
||||
<if test="endDate!=null"> and date(pma.att_date) <= date(#{endDate})</if>
|
||||
</where>
|
||||
order by pma.att_date desc,pma.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectProMobileAttendanceDataById" parameterType="Long" resultMap="ProMobileAttendanceDataResult">
|
||||
<include refid="selectProMobileAttendanceDataVo"/>
|
||||
where id = #{id}
|
||||
where pma.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProMobileAttendanceData" parameterType="ProMobileAttendanceData" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
@ -59,6 +86,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="latitude != null">latitude,</if>
|
||||
<if test="attDate != null">att_date,</if>
|
||||
<if test="attImg != null">att_img,</if>
|
||||
<if test="attDevice != null">att_device,</if>
|
||||
<if test="isDel != null">is_del,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="state != null">state,</if>
|
||||
|
|
@ -76,6 +104,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="latitude != null">#{latitude},</if>
|
||||
<if test="attDate != null">#{attDate},</if>
|
||||
<if test="attImg != null">#{attImg},</if>
|
||||
<if test="attDevice != null">#{attDevice},</if>
|
||||
<if test="isDel != null">#{isDel},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="state != null">#{state},</if>
|
||||
|
|
@ -97,6 +126,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="latitude != null">latitude = #{latitude},</if>
|
||||
<if test="attDate != null">att_date = #{attDate},</if>
|
||||
<if test="attImg != null">att_img = #{attImg},</if>
|
||||
<if test="attDevice != null">att_device = #{attDevice},</if>
|
||||
<if test="isDel != null">is_del = #{isDel},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="state != null">state = #{state},</if>
|
||||
|
|
|
|||
|
|
@ -419,7 +419,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
pp.predecessors,
|
||||
pp.plan_start_date,
|
||||
pp.plan_finish_date,
|
||||
pp.bim_id,
|
||||
<choose>
|
||||
<when test="noBim = null or noBim = ''">
|
||||
left(ifnull(pp.bim_id,''),10) bim_id,
|
||||
</when>
|
||||
<otherwise>
|
||||
pp.bim_id,
|
||||
</otherwise>
|
||||
</choose>
|
||||
|
||||
pp.operator,
|
||||
pp.operator_id,
|
||||
pp.group_id,
|
||||
|
|
|
|||
|
|
@ -165,6 +165,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<select id="selectProProjectInfoSubdeptsUsersByParamId" resultMap="ProProjectInfoSubdeptsUsersResult">
|
||||
<include refid="selectProProjectInfoSubdeptsUsersVo"/>
|
||||
where psu.project_id = #{proId} and psu.user_id = #{userId}
|
||||
order by ifnull(psu.update_time, date('2099-12-31')) desc,psu.create_time desc
|
||||
limit 1
|
||||
</select>
|
||||
|
||||
<insert id="insertProProjectInfoSubdeptsUsers" parameterType="ProProjectInfoSubdeptsUsers" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
|||
|
|
@ -28,37 +28,48 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="craftTypeName" column="craft_type_name" />
|
||||
<result property="craftPostName" column="craft_post_name" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectProUserInoutRecordVo">
|
||||
select id, project_id, user_id, user_name, user_phone,user_post, user_picture, user_sex, use_status, sub_dept_id, sub_dept_name, sub_dept_type, sub_dept_group, sub_dept_group_name, craft_type, craft_post, is_del, remark, state, create_by, create_time, update_by, update_time from pro_user_inout_record
|
||||
select pur.id, pur.project_id, pur.user_id, pur.user_name, pur.user_phone,pur.user_post, pur.user_picture, pur.user_sex, pur.use_status,
|
||||
pur.sub_dept_id, pur.sub_dept_name, pur.sub_dept_type, pur.sub_dept_group, pur.sub_dept_group_name,
|
||||
pur.craft_type, pur.craft_post, pur.is_del, pur.remark, pur.state, pur.create_by, pur.create_time, pur.update_by, pur.update_time,
|
||||
dic1.dict_label as craft_type_name,dic2.dict_label as craft_post_name
|
||||
from pro_user_inout_record pur
|
||||
left join sys_dict_data dic1 on pur.`craft_type`=dic1.`dict_value` and dic1.`dict_type`='pro_craft_type'
|
||||
left join sys_dict_data dic2 on pur.`craft_post`=dic2.`dict_value` and dic2.`dict_type`='pro_craft_post'
|
||||
</sql>
|
||||
|
||||
<select id="selectProUserInoutRecordList" parameterType="ProUserInoutRecord" resultMap="ProUserInoutRecordResult">
|
||||
<include refid="selectProUserInoutRecordVo"/>
|
||||
<where>
|
||||
<if test="projectId != null "> and project_id = #{projectId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userPhone != null and userPhone != ''"> and user_phone = #{userPhone}</if>
|
||||
<if test="userPicture != null and userPicture != ''"> and user_picture = #{userPicture}</if>
|
||||
<if test="userSex != null and userSex != ''"> and user_sex = #{userSex}</if>
|
||||
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if>
|
||||
<if test="subDeptId != null "> and sub_dept_id = #{subDeptId}</if>
|
||||
<if test="subDeptName != null and subDeptName != ''"> and sub_dept_name like concat('%', #{subDeptName}, '%')</if>
|
||||
<if test="subDeptType != null and subDeptType != ''"> and sub_dept_type = #{subDeptType}</if>
|
||||
<if test="subDeptGroup != null "> and sub_dept_group = #{subDeptGroup}</if>
|
||||
<if test="subDeptGroupName != null and subDeptGroupName != ''"> and sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if>
|
||||
<if test="craftType != null and craftType != ''"> and craft_type = #{craftType}</if>
|
||||
<if test="craftPost != null and craftPost != ''"> and craft_post = #{craftPost}</if>
|
||||
<if test="isDel != null "> and is_del = #{isDel}</if>
|
||||
<if test="state != null "> and state = #{state}</if>
|
||||
<if test="projectId != null "> and pur.project_id = #{projectId}</if>
|
||||
<if test="userId != null "> and pur.user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and pur.user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="userPhone != null and userPhone != ''"> and pur.user_phone = #{userPhone}</if>
|
||||
<if test="userPicture != null and userPicture != ''"> and pur.user_picture = #{userPicture}</if>
|
||||
<if test="userSex != null and userSex != ''"> and pur.user_sex = #{userSex}</if>
|
||||
<if test="useStatus != null and useStatus != ''"> and pur.use_status = #{useStatus}</if>
|
||||
<if test="subDeptId != null "> and pur.sub_dept_id = #{subDeptId}</if>
|
||||
<if test="subDeptName != null and subDeptName != ''"> and pur.sub_dept_name like concat('%', #{subDeptName}, '%')</if>
|
||||
<if test="subDeptType != null and subDeptType != ''"> and pur.sub_dept_type = #{subDeptType}</if>
|
||||
<if test="subDeptGroup != null "> and pur.sub_dept_group = #{subDeptGroup}</if>
|
||||
<if test="subDeptGroupName != null and subDeptGroupName != ''"> and pur.sub_dept_group_name like concat('%', #{subDeptGroupName}, '%')</if>
|
||||
<if test="craftType != null and craftType != ''"> and pur.craft_type = #{craftType}</if>
|
||||
<if test="craftPost != null and craftPost != ''"> and pur.craft_post = #{craftPost}</if>
|
||||
<if test="isDel != null "> and pur.is_del = #{isDel}</if>
|
||||
<if test="state != null "> and pur.state = #{state}</if>
|
||||
<if test="startDate != null"> and date(pur.create_time) >= date(#{startDate})</if>
|
||||
<if test="endDate != null"> and date(pur.create_time) <= date(#{endDate})</if>
|
||||
</where>
|
||||
order by pur.create_time desc,pur.id desc
|
||||
</select>
|
||||
|
||||
<select id="selectProUserInoutRecordById" parameterType="Long" resultMap="ProUserInoutRecordResult">
|
||||
<include refid="selectProUserInoutRecordVo"/>
|
||||
where id = #{id}
|
||||
where pur.id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertProUserInoutRecord" parameterType="ProUserInoutRecord" useGeneratedKeys="true" keyProperty="id">
|
||||
|
|
|
|||
|
|
@ -140,7 +140,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
left join wx_menu_config_role smcr on smcr.smcid = smc.id
|
||||
left join sys_user_role ur on ur.role_id = smcr.role_id
|
||||
where smc.del_flag = 0
|
||||
<<<<<<< .mine
|
||||
<if test="currentUserId != null"> and ur.user_id = #{currentUserId}</if>
|
||||
=======
|
||||
and (ur.user_id = #{currentUserId} or smc.menu_identi='GRQMPZ')
|
||||
>>>>>>> .theirs
|
||||
<if test="activeProjectId != null"> and smc.project_id = #{activeProjectId}</if>
|
||||
<if test="menuType != null and menuType != ''"> and smc.menu_type = #{menuType}</if>
|
||||
order by smc.menu_sort asc
|
||||
|
|
|
|||
|
|
@ -144,6 +144,16 @@ public class QuartzProjectAttendanceData extends BaseEntity
|
|||
}
|
||||
|
||||
|
||||
private String inOut;
|
||||
|
||||
public String getInOut() {
|
||||
return inOut;
|
||||
}
|
||||
|
||||
public void setInOut(String inOut) {
|
||||
this.inOut = inOut;
|
||||
}
|
||||
|
||||
private Long projectId;
|
||||
@Excel(name = "项目名称")
|
||||
private String projectName;
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ import com.alibaba.fastjson2.JSON;
|
|||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.constant.SecurityConstants;
|
||||
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||
import com.yanzhu.common.core.domain.R;
|
||||
import com.yanzhu.common.core.enums.*;
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
|
|
@ -17,6 +18,8 @@ import com.yanzhu.common.redis.service.RedisService;
|
|||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.job.domain.*;
|
||||
import com.yanzhu.job.service.*;
|
||||
import com.yanzhu.manage.domain.ProMobileAttendanceData;
|
||||
import com.yanzhu.manage.mapper.ProMobileAttendanceDataMapper;
|
||||
import com.yanzhu.system.api.RemoteFileService;
|
||||
import com.yanzhu.system.api.RemoteUserService;
|
||||
import com.yanzhu.system.api.domain.SysFile;
|
||||
|
|
@ -70,6 +73,9 @@ public class AttendanceJgwTask {
|
|||
@Autowired
|
||||
private IQuartzProAttendanceDataService quartzProAttendanceDataService;
|
||||
|
||||
@Autowired
|
||||
private ProMobileAttendanceDataMapper proMobileAttendanceDataMapper;
|
||||
|
||||
private final String code = "jgw";
|
||||
private static final String JGW_HOST = "http://api.gongyoumishu.com:80/gomeetapi/";
|
||||
|
||||
|
|
@ -1017,6 +1023,13 @@ public class AttendanceJgwTask {
|
|||
quartzProAttendanceDataQuery.setSubDeptId(quartzProSubdeptsUsers.getSubDeptId());
|
||||
quartzProAttendanceDataQuery.setUserId(quartzProSubdeptsUsers.getUserId());
|
||||
quartzProAttendanceDataQuery.setSearchValue(json.getString("signDate"));
|
||||
|
||||
ProMobileAttendanceData mobileAttendanceData = new ProMobileAttendanceData();
|
||||
mobileAttendanceData.setProjectId(quartzProAttendanceDataQuery.getProjectId());
|
||||
mobileAttendanceData.setUserId(quartzProAttendanceDataQuery.getUserId());
|
||||
mobileAttendanceData.setCfgId(it.getId());
|
||||
mobileAttendanceData.setAttDevice("device");
|
||||
|
||||
List<QuartzProAttendanceData> attendanceDataList = quartzProAttendanceDataService.selectProAttendanceDataList(quartzProAttendanceDataQuery);
|
||||
if(attendanceDataList!=null && attendanceDataList.size()>0){
|
||||
QuartzProAttendanceData quartzProAttendanceData = attendanceDataList.get(0);
|
||||
|
|
@ -1026,22 +1039,34 @@ public class AttendanceJgwTask {
|
|||
quartzProAttendanceData.setInTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
mobileAttendanceData.setInOut("in");
|
||||
mobileAttendanceData.setAttImg(checkPhoto);
|
||||
mobileAttendanceData.setAttDate(quartzProAttendanceData.getInTime());
|
||||
}
|
||||
}else if(machineType.equals("3")){
|
||||
//签出
|
||||
quartzProAttendanceData.setOutTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setOutPhoto(checkPhoto);
|
||||
mobileAttendanceData.setInOut("in");
|
||||
mobileAttendanceData.setAttImg(checkPhoto);
|
||||
mobileAttendanceData.setAttDate(quartzProAttendanceData.getOutTime());
|
||||
}else{
|
||||
//默认
|
||||
if(quartzProAttendanceData.getInData()==null){
|
||||
quartzProAttendanceData.setInTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
mobileAttendanceData.setInOut("in");
|
||||
mobileAttendanceData.setAttImg(checkPhoto);
|
||||
mobileAttendanceData.setAttDate(quartzProAttendanceData.getInTime());
|
||||
}else{
|
||||
quartzProAttendanceData.setOutTime(DateUtils.parseDate(json.getString("checkinTime")));
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setOutPhoto(checkPhoto);
|
||||
mobileAttendanceData.setInOut("out");
|
||||
mobileAttendanceData.setAttImg(checkPhoto);
|
||||
mobileAttendanceData.setAttDate(quartzProAttendanceData.getOutTime());
|
||||
}
|
||||
}
|
||||
quartzProAttendanceData.setUpdateBy("JGW-TASK");
|
||||
|
|
@ -1067,16 +1092,25 @@ public class AttendanceJgwTask {
|
|||
quartzProAttendanceData.setInTime(checkinTime);
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
mobileAttendanceData.setInOut("in");
|
||||
mobileAttendanceData.setAttImg(checkPhoto);
|
||||
mobileAttendanceData.setAttDate(quartzProAttendanceData.getInTime());
|
||||
}else if(machineType.equals("3")){
|
||||
//签出
|
||||
quartzProAttendanceData.setOutTime(checkinTime);
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setOutPhoto(checkPhoto);
|
||||
mobileAttendanceData.setInOut("out");
|
||||
mobileAttendanceData.setAttImg(checkPhoto);
|
||||
mobileAttendanceData.setAttDate(quartzProAttendanceData.getOutTime());
|
||||
}else{
|
||||
//默认
|
||||
quartzProAttendanceData.setInTime(checkinTime);
|
||||
String checkPhoto = getPhoto(appId, token, it.getProjectPackage(), datePath, json.getString("signimg"));
|
||||
quartzProAttendanceData.setInPhoto(checkPhoto);
|
||||
mobileAttendanceData.setInOut("in");
|
||||
mobileAttendanceData.setAttImg(checkPhoto);
|
||||
mobileAttendanceData.setAttDate(quartzProAttendanceData.getInTime());
|
||||
}
|
||||
quartzProAttendanceData.setDeviceNo(json.getString("deviceSerialNo"));
|
||||
quartzProAttendanceData.setCreateBy("JGW-TASK");
|
||||
|
|
@ -1084,6 +1118,12 @@ public class AttendanceJgwTask {
|
|||
quartzProAttendanceData.setSource(quartzProSubdeptsUsers.getSource());
|
||||
quartzProAttendanceDataService.insertProAttendanceData(quartzProAttendanceData);
|
||||
}
|
||||
|
||||
if(StringUtils.isNotEmpty(mobileAttendanceData.getAttImg())){
|
||||
mobileAttendanceData.setCreateTime(new Date());
|
||||
mobileAttendanceData.setCreateBy(SecurityContextHolder.getUserName());
|
||||
proMobileAttendanceDataMapper.insertProMobileAttendanceData(mobileAttendanceData);
|
||||
}
|
||||
}
|
||||
}
|
||||
doSyncAttendanceData(jo, endId, it);
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import cn.hutool.core.util.NumberUtil;
|
|||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.yanzhu.common.core.context.SecurityContextHolder;
|
||||
import com.yanzhu.common.core.enums.*;
|
||||
import com.yanzhu.common.core.text.Convert;
|
||||
import com.yanzhu.common.core.utils.DateUtils;
|
||||
|
|
@ -13,6 +14,8 @@ import com.yanzhu.common.core.utils.http.HttpUtils;
|
|||
import com.yanzhu.common.redis.service.RedisService;
|
||||
import com.yanzhu.job.domain.*;
|
||||
import com.yanzhu.job.service.*;
|
||||
import com.yanzhu.manage.domain.ProMobileAttendanceData;
|
||||
import com.yanzhu.manage.mapper.ProMobileAttendanceDataMapper;
|
||||
import com.yanzhu.system.api.RemoteFileService;
|
||||
import com.yanzhu.system.api.RemoteUserService;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
|
@ -58,6 +61,8 @@ public class AttendanceSzjTask {
|
|||
@Autowired
|
||||
private IQuartzProjectAttendanceDataService attendanceDataService;
|
||||
|
||||
@Autowired
|
||||
private ProMobileAttendanceDataMapper proMobileAttendanceDataMapper;
|
||||
|
||||
private final String code = "szj";
|
||||
private static final String SZJ_HOST = "https://sc.uni-ubi.com/sc/api/";
|
||||
|
|
@ -139,9 +144,11 @@ public class AttendanceSzjTask {
|
|||
QuartzProjectAttendanceData attendance = new QuartzProjectAttendanceData();
|
||||
attendance.setServerid(jo.getString("id"));
|
||||
if(1==jo.getInteger("doorType")){
|
||||
attendance.setInOut("in");
|
||||
attendance.setAttendanceTime(jo.getString("showTime"));
|
||||
}else{
|
||||
attendance.setAttendanceOutTime(jo.getString("showTime"));
|
||||
attendance.setInOut("out");
|
||||
}
|
||||
attendance.setIdentification(jo.getString("idCardNo"));
|
||||
attendance.setWorkerName(jo.getString("personName"));
|
||||
|
|
@ -625,6 +632,25 @@ public class AttendanceSzjTask {
|
|||
att.setId(attList.get(0).getId());
|
||||
attendanceDataService.updateSurProjectAttendanceData(att);
|
||||
}
|
||||
|
||||
ProMobileAttendanceData proMobileAttendanceData=new ProMobileAttendanceData();
|
||||
proMobileAttendanceData.setCfgId(cfg.getId());
|
||||
proMobileAttendanceData.setUserId(user.getId());
|
||||
proMobileAttendanceData.setProjectId(user.getProjectId());
|
||||
proMobileAttendanceData.setInOut(att.getInOut());
|
||||
if("in".equals(att.getInOut())){
|
||||
proMobileAttendanceData.setAttDate(DateUtil.parseDate(att.getAttendanceTime()));
|
||||
}else{
|
||||
proMobileAttendanceData.setAttDate(DateUtil.parseDate(att.getAttendanceOutTime()));
|
||||
}
|
||||
proMobileAttendanceData.setAttImg(att.getScanPhoto());
|
||||
proMobileAttendanceData.setCreateTime(new Date());
|
||||
proMobileAttendanceData.setCreateBy(SecurityContextHolder.getUserName());
|
||||
proMobileAttendanceData.setIsDel(0L);
|
||||
proMobileAttendanceData.setRemark("");
|
||||
proMobileAttendanceData.setState(0L);
|
||||
|
||||
//TODO 保存考勤日志未完成(第三方)
|
||||
}
|
||||
if(atts.size()==100){
|
||||
doSyncAttendance(token,cfg,offset,startTime,endTime);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@ import net.hasor.spring.boot.EnableHasor;
|
|||
import net.hasor.spring.boot.EnableHasorWeb;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* 业务模块
|
||||
|
|
@ -17,6 +18,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@SpringBootApplication
|
||||
@ComponentScan(basePackages = {"com.yanzhu"})
|
||||
@EnableHasor()
|
||||
@EnableHasorWeb()
|
||||
public class YanZhuManageApplication
|
||||
|
|
|
|||
|
|
@ -19,10 +19,7 @@ import com.yanzhu.common.redis.service.RedisService;
|
|||
import com.yanzhu.common.security.service.TokenService;
|
||||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.manage.api.vo.*;
|
||||
import com.yanzhu.manage.domain.SurProjectAttendanceData;
|
||||
import com.yanzhu.manage.domain.SurProjectAttendanceGroup;
|
||||
import com.yanzhu.manage.domain.SurProjectAttendanceUser;
|
||||
import com.yanzhu.manage.domain.SysApplyConfig;
|
||||
import com.yanzhu.manage.domain.*;
|
||||
import com.yanzhu.manage.enums.HttpStatusEnum;
|
||||
import com.yanzhu.manage.service.ISurProjectAttendanceDataService;
|
||||
import com.yanzhu.manage.service.ISurProjectAttendanceGroupService;
|
||||
|
|
@ -308,7 +305,11 @@ public class LabourApiController extends BaseController {
|
|||
findData.setAppId(sysApplyConfig.getAppId());
|
||||
findData.setWorkerId(req.getWorkerId());
|
||||
findData.setAttendanceTime(req.getAttendanceTime());
|
||||
//TODO 保存考勤日志未完成(第三方)
|
||||
SurProjectAttendanceData surProjectAttendanceData = surProjectAttendanceDataService.findCurrentAttendanceData(findData);
|
||||
ProMobileAttendanceData proMobileAttendanceData = new ProMobileAttendanceData();
|
||||
proMobileAttendanceData.setCfgId(sysApplyConfig.getCfgId());
|
||||
|
||||
if (surProjectAttendanceData != null) {
|
||||
//这里不能修改出勤时间
|
||||
if (Objects.equals("L", req.getAttendanceType())) {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,105 @@
|
|||
package com.yanzhu.manage.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.common.core.web.page.TableDataInfo;
|
||||
import com.yanzhu.common.log.annotation.Log;
|
||||
import com.yanzhu.common.log.enums.BusinessType;
|
||||
import com.yanzhu.common.security.annotation.RequiresPermissions;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.PostMapping;
|
||||
import org.springframework.web.bind.annotation.PutMapping;
|
||||
import org.springframework.web.bind.annotation.DeleteMapping;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
import org.springframework.web.bind.annotation.RequestBody;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
import com.yanzhu.manage.domain.ProMobileAttendanceData;
|
||||
import com.yanzhu.manage.service.IProMobileAttendanceDataService;
|
||||
|
||||
/**
|
||||
* 人员考勤记录Controller
|
||||
*
|
||||
* @author yanzhu
|
||||
* @date 2025-09-17
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/mobileAttendanceData")
|
||||
public class ProMobileAttendanceDataController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IProMobileAttendanceDataService proMobileAttendanceDataService;
|
||||
|
||||
/**
|
||||
* 查询人员考勤记录列表
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(ProMobileAttendanceData proMobileAttendanceData)
|
||||
{
|
||||
startPage();
|
||||
List<ProMobileAttendanceData> list = proMobileAttendanceDataService.selectProMobileAttendanceDataList(proMobileAttendanceData);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出人员考勤记录列表
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:export")
|
||||
@Log(title = "人员考勤记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, ProMobileAttendanceData proMobileAttendanceData)
|
||||
{
|
||||
List<ProMobileAttendanceData> list = proMobileAttendanceDataService.selectProMobileAttendanceDataList(proMobileAttendanceData);
|
||||
ExcelUtil<ProMobileAttendanceData> util = new ExcelUtil<ProMobileAttendanceData>(ProMobileAttendanceData.class);
|
||||
util.exportExcel(response, list, "人员考勤记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取人员考勤记录详细信息
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") Long id)
|
||||
{
|
||||
return success(proMobileAttendanceDataService.selectProMobileAttendanceDataById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增人员考勤记录
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:add")
|
||||
@Log(title = "人员考勤记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody ProMobileAttendanceData proMobileAttendanceData)
|
||||
{
|
||||
return toAjax(proMobileAttendanceDataService.insertProMobileAttendanceData(proMobileAttendanceData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改人员考勤记录
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:edit")
|
||||
@Log(title = "人员考勤记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody ProMobileAttendanceData proMobileAttendanceData)
|
||||
{
|
||||
return toAjax(proMobileAttendanceDataService.updateProMobileAttendanceData(proMobileAttendanceData));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除人员考勤记录
|
||||
*/
|
||||
@RequiresPermissions("manage:mobileAttendanceData:remove")
|
||||
@Log(title = "人员考勤记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable Long[] ids)
|
||||
{
|
||||
return toAjax(proMobileAttendanceDataService.deleteProMobileAttendanceDataByIds(ids));
|
||||
}
|
||||
}
|
||||
|
|
@ -244,8 +244,8 @@ public class ProPlanController extends BaseController
|
|||
* 查询任务状态统计
|
||||
*/
|
||||
@GetMapping(value = "/findAllPlanDatas/{proId}")
|
||||
public AjaxResult findAllPlanDatas(@PathVariable("proId") Long proId){
|
||||
List<ProPlan> plans = proPlanService.findAllPlanDatasByProId(proId);
|
||||
public AjaxResult findAllPlanDatas(@PathVariable("proId") Long proId,String noBim){
|
||||
List<ProPlan> plans = proPlanService.findAllPlanDatasByProId(proId,noBim);
|
||||
return success(plans);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -825,4 +825,14 @@ public class ProProjectInfoSubdeptsUsersController extends BaseController
|
|||
return userList;
|
||||
}
|
||||
|
||||
@GetMapping("/updateBaiduFaceLibrary/{projectId}")
|
||||
@RequiresPermissions("manage:proProjectInfoSubdeptsUsers:list")
|
||||
public AjaxResult updateBaiduFaceLibrary(@PathVariable("projectId") Long projectId){
|
||||
if(SecurityUtils.isAdmin(SecurityUtils.getUserId())){
|
||||
proProjectInfoSubdeptsUsersService.updateBaiduFaceLibrary(projectId);
|
||||
return AjaxResult.success("更新成功");
|
||||
}else{
|
||||
return AjaxResult.error("非管理员不能操作");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,11 +6,9 @@ import com.yanzhu.common.core.utils.StringUtils;
|
|||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
import com.yanzhu.manage.domain.AttendanceUbiData;
|
||||
import com.yanzhu.manage.domain.AttendanceUbiDevice;
|
||||
import com.yanzhu.manage.domain.ProMobileAttendanceData;
|
||||
import com.yanzhu.manage.domain.ProProjectInfoSubdeptsUsers;
|
||||
import com.yanzhu.manage.service.IAttendanceUbiDataService;
|
||||
import com.yanzhu.manage.service.IAttendanceUbiDeviceService;
|
||||
import com.yanzhu.manage.service.IProProjectInfoDeptsService;
|
||||
import com.yanzhu.manage.service.IProProjectInfoSubdeptsUsersService;
|
||||
import com.yanzhu.manage.service.*;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
|
|
@ -35,6 +33,9 @@ public class UniCallBackController {
|
|||
@Autowired
|
||||
private IAttendanceUbiDeviceService attendanceUbiDeviceService;
|
||||
|
||||
@Autowired
|
||||
private IProMobileAttendanceDataService proMobileAttendanceDataService;
|
||||
|
||||
/**
|
||||
* 识别回调
|
||||
* @return
|
||||
|
|
@ -122,6 +123,7 @@ public class UniCallBackController {
|
|||
if(device==null){
|
||||
return AjaxResult.error("没有查询到设备No");
|
||||
}
|
||||
ProMobileAttendanceData attendanceData=new ProMobileAttendanceData();
|
||||
if(list.size()==0){
|
||||
//增加操作
|
||||
ProProjectInfoSubdeptsUsers userWhere=new ProProjectInfoSubdeptsUsers();
|
||||
|
|
@ -145,14 +147,22 @@ public class UniCallBackController {
|
|||
addData.setSubDeptGroupName(proUser.getSubDeptGroupName());
|
||||
addData.setCraftPost(proUser.getCraftPost());
|
||||
addData.setCraftType(proUser.getCraftType());
|
||||
attendanceData.setUserId(proUser.getUserId());
|
||||
attendanceData.setProjectId(projectId);
|
||||
attendanceData.setAttDate(showTime);
|
||||
attendanceData.setAttImg(filePath);
|
||||
if(device.getDirection()==0) {
|
||||
addData.setInTime(showTime);
|
||||
addData.setInData(data);
|
||||
addData.setInPhoto(filePath);
|
||||
attendanceData.setInOut("in");
|
||||
proMobileAttendanceDataService.addAttendanceData(attendanceData);
|
||||
}else{
|
||||
addData.setOutPhoto(filePath);
|
||||
addData.setOutData(data);
|
||||
addData.setOutTime(showTime);
|
||||
attendanceData.setInOut("out");
|
||||
proMobileAttendanceDataService.addAttendanceData(attendanceData);
|
||||
}
|
||||
addData.setDeviceNo(deviceNo);
|
||||
attendanceUbiDataService.insertAttendanceUbiData(addData);
|
||||
|
|
@ -166,7 +176,13 @@ public class UniCallBackController {
|
|||
}
|
||||
Date dt1=upData.getInTime();
|
||||
Date dt2=upData.getOutTime();
|
||||
attendanceData.setUserId(upData.getUserId());
|
||||
attendanceData.setProjectId(projectId);
|
||||
attendanceData.setAttDate(showTime);
|
||||
attendanceData.setAttImg(filePath);
|
||||
if(device.getDirection()==0){
|
||||
attendanceData.setInOut("in");
|
||||
proMobileAttendanceDataService.addAttendanceData(attendanceData);
|
||||
//入
|
||||
if(dt1==null || showTime.getTime()<dt1.getTime()){
|
||||
upData.setInPhoto(filePath);
|
||||
|
|
@ -184,6 +200,8 @@ public class UniCallBackController {
|
|||
}else {
|
||||
return AjaxResult.success();
|
||||
}
|
||||
attendanceData.setInOut("out");
|
||||
proMobileAttendanceDataService.addAttendanceData(attendanceData);
|
||||
}
|
||||
attendanceUbiDataService.updateAttendanceUbiData(upData);
|
||||
return AjaxResult.success("更新成功");
|
||||
|
|
|
|||
|
|
@ -4,7 +4,9 @@ import java.util.List;
|
|||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import cn.hutool.core.util.NumberUtil;
|
||||
import com.yanzhu.common.core.utils.BaiduFaceSimilarityUtils;
|
||||
import com.yanzhu.common.core.utils.bean.BaiduFaceUserInfo;
|
||||
import com.yanzhu.common.core.utils.poi.ExcelUtil;
|
||||
import com.yanzhu.common.core.web.controller.BaseController;
|
||||
import com.yanzhu.common.core.web.domain.AjaxResult;
|
||||
|
|
@ -129,18 +131,15 @@ public class ProMobileAttendanceConfigController extends BaseController
|
|||
@PostMapping("/attendance")
|
||||
public AjaxResult attendance(@RequestBody ProMobileAttendanceData attData){
|
||||
//根据用户上传的照片与用户信息的照片计算相似度
|
||||
String userPicture =attData.getBasePath()+ attData.getUserPicture();
|
||||
String attImg=attData.getBasePath()+attData.getAttImg();
|
||||
|
||||
// 使用专门为人脸识别考勤优化的相似度计算
|
||||
double similarity = BaiduFaceSimilarityUtils.calculateFaceSimilarity(userPicture, attImg);
|
||||
System.out.println("相似度:"+similarity);
|
||||
|
||||
double threshold = BaiduFaceSimilarityUtils.SIMILARITY_THRESHOLD;
|
||||
|
||||
if (similarity >= threshold) {
|
||||
String attImg=attData.getAttImg();
|
||||
double threshold=BaiduFaceSimilarityUtils.SIMILARITY_THRESHOLD;
|
||||
BaiduFaceUserInfo baiduFaceUserInfo=BaiduFaceSimilarityUtils.findFaceSimilarityWithFaceLibrary(attImg,"G"+attData.getProjectId());
|
||||
double similarity =baiduFaceUserInfo!=null? baiduFaceUserInfo.getSimilarity():0;
|
||||
if (baiduFaceUserInfo!=null) {
|
||||
// 相似度达标,允许考勤
|
||||
attData.setUserId(NumberUtil.parseLong(baiduFaceUserInfo.getUserInfo().get("userId").toString()));
|
||||
int cnt=attendanceUbiDataService.addMobiileAttendanceData(attData);
|
||||
attData.setAttDevice("mobile");
|
||||
cnt+=proMobileAttendanceDataService.insertProMobileAttendanceData(attData);
|
||||
return AjaxResult.success("考勤成功,人脸匹配 (相似度: " + String.format("%.2f", similarity) + ")");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -58,4 +58,9 @@ public interface IProMobileAttendanceDataService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteProMobileAttendanceDataById(Long id);
|
||||
|
||||
/**
|
||||
* 新增考勤数据
|
||||
*/
|
||||
public int addAttendanceData(ProMobileAttendanceData attendanceData);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,7 +96,7 @@ public interface IProPlanService
|
|||
/**
|
||||
* 查询计划任务数据
|
||||
*/
|
||||
public List<ProPlan> findAllPlanDatasByProId(Long proId);
|
||||
public List<ProPlan> findAllPlanDatasByProId(Long proId,String noBim);
|
||||
|
||||
/**
|
||||
* 查询计划任务数据
|
||||
|
|
|
|||
|
|
@ -267,4 +267,11 @@ public interface IProProjectInfoSubdeptsUsersService
|
|||
* 完成三级安全教育人数
|
||||
*/
|
||||
Long getEduCompletedCount(Long prjId);
|
||||
|
||||
/**
|
||||
* 更新项目的百度人脸库
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
Long updateBaiduFaceLibrary(Long projectId);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
package com.yanzhu.manage.service;
|
||||
|
||||
import com.yanzhu.device.domain.ProjectPitMonitCfg;
|
||||
import com.yanzhu.manage.domain.ProMobileAttendanceData;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -74,4 +76,6 @@ public interface IProjectPitMonitCfgService
|
|||
* @return 结果
|
||||
*/
|
||||
public int deleteSurProjectPitMonitCfgById(Long id);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@ import com.yanzhu.manage.domain.ProCostOutput;
|
|||
import com.yanzhu.manage.mapper.ProCostOutputMapper;
|
||||
import com.yanzhu.manage.service.IProCostOutputService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.actuate.web.mappings.MappingsEndpoint;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
/**
|
||||
|
|
@ -22,8 +21,7 @@ public class ProCostOutputServiceImpl implements IProCostOutputService
|
|||
{
|
||||
@Autowired
|
||||
private ProCostOutputMapper proCostOutputMapper;
|
||||
@Autowired
|
||||
private MappingsEndpoint mappingsEndpoint;
|
||||
|
||||
|
||||
/**
|
||||
* 查询项目成本产值
|
||||
|
|
|
|||
|
|
@ -97,4 +97,14 @@ public class ProMobileAttendanceDataServiceImpl implements IProMobileAttendanceD
|
|||
{
|
||||
return proMobileAttendanceDataMapper.deleteProMobileAttendanceDataById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int addAttendanceData(ProMobileAttendanceData attendanceData) {
|
||||
attendanceData.setIsDel(0L);
|
||||
attendanceData.setRemark("");
|
||||
attendanceData.setCfgId(0L);
|
||||
attendanceData.setState(0L);
|
||||
attendanceData.setAttDevice("device");
|
||||
return insertProMobileAttendanceData(attendanceData);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -215,8 +215,8 @@ public class ProPlanServiceImpl implements IProPlanService
|
|||
* 查询计划任务数据
|
||||
*/
|
||||
@Override
|
||||
public List<ProPlan> findAllPlanDatasByProId(Long proId){
|
||||
return proPlanMapper.findAllPlanDatasByProId(proId);
|
||||
public List<ProPlan> findAllPlanDatasByProId(Long proId,String noBim){
|
||||
return proPlanMapper.findAllPlanDatasByProId(proId,noBim);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ import com.yanzhu.manage.utils.pdf.FileUtil;
|
|||
import com.yanzhu.manage.utils.pdf.PdfImageSignetUtil;
|
||||
import com.yanzhu.manage.utils.pdf.PoiUtil;
|
||||
import com.yanzhu.security.utils.DictUtils;
|
||||
import com.yanzhu.services.IBaiduFaceService;
|
||||
import com.yanzhu.system.api.RemoteFlowService;
|
||||
import com.yanzhu.system.api.RemoteUserService;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
|
|
@ -90,6 +91,8 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
@Autowired
|
||||
private IProUserInoutRecordService iProUserInoutRecordService;
|
||||
|
||||
@Autowired
|
||||
private IBaiduFaceService baiduFaceService;
|
||||
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ProProjectInfoSubdeptsUsersServiceImpl.class);
|
||||
|
|
@ -156,6 +159,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
proProjectInfoSubdeptsUsers.setSubDeptName(proProjectInfo.getProjectName());
|
||||
}
|
||||
}
|
||||
baiduFaceService.addProUser(proProjectInfoSubdeptsUsers);
|
||||
return proProjectInfoSubdeptsUsersMapper.insertProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
/**
|
||||
|
|
@ -279,7 +283,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
FileUtil.copyFile(file,new File(savePath));
|
||||
}
|
||||
proProjectInfoSubdeptsUsers.setQrCode(profilePath);
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
|
|
@ -348,7 +352,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
deptUser.setUserPicture(proProjectInfoSubdeptsUsers.getUserPicture());
|
||||
deptUser.setUpdateBy(SecurityUtils.getUsername());
|
||||
deptUser.setUpdateTime(DateUtils.getNowDate());
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(deptUser);
|
||||
updateProjectInfoSubdeptsUsers(deptUser);
|
||||
/**
|
||||
* 考勤需要信息改变时推送信息...
|
||||
*/
|
||||
|
|
@ -383,7 +387,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
if(oldUserData.getApproveStatus()==ApproveStatus.refuse.getCode()){
|
||||
// 删除用户冗余数据...
|
||||
oldUserData.setIsDel(IsDelEnums.DEL.getCode());
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(oldUserData);
|
||||
updateProjectInfoSubdeptsUsers(oldUserData);
|
||||
}else{
|
||||
throw new ServiceException("手机号码已存在");
|
||||
}
|
||||
|
|
@ -707,14 +711,14 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
FileUtil.copyFile(file,new File(savePath));
|
||||
}
|
||||
proProjectInfoSubdeptsUsers.setQrCode(profilePath);
|
||||
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
return updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
return updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -750,7 +754,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
}
|
||||
user.setUseStatus(status);
|
||||
iProUserInoutRecordService.addRecord(user);
|
||||
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(user);
|
||||
return updateProjectInfoSubdeptsUsers(user);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -994,10 +998,14 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
sysUser.setActiveProjectId(proProjectInfoSubdeptsUsers.getProjectId());
|
||||
remoteUserService.registerUserInfo(sysUser, SecurityConstants.INNER);
|
||||
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
return proProjectInfoSubdeptsUsers;
|
||||
}
|
||||
|
||||
public int updateProjectInfoSubdeptsUsers(ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers){
|
||||
baiduFaceService.updateProUser(proProjectInfoSubdeptsUsers,false);
|
||||
return proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
/**
|
||||
* 批量删除分包单位工人
|
||||
*
|
||||
|
|
@ -1010,6 +1018,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
for(Long id:ids){
|
||||
uniService.syncUserRevoke(id);
|
||||
}
|
||||
baiduFaceService.deleteProUser(ids);
|
||||
return proProjectInfoSubdeptsUsersMapper.deleteProProjectInfoSubdeptsUsersByIds(ids);
|
||||
}
|
||||
|
||||
|
|
@ -1023,6 +1032,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
public int deleteProProjectInfoSubdeptsUsersById(Long id)
|
||||
{
|
||||
uniService.syncUserRevoke(id);
|
||||
baiduFaceService.deleteProUser(new Long[]{id});
|
||||
return proProjectInfoSubdeptsUsersMapper.deleteProProjectInfoSubdeptsUsersById(id);
|
||||
}
|
||||
|
||||
|
|
@ -1130,7 +1140,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
}
|
||||
}
|
||||
|
||||
int res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proSubdeptsUser);
|
||||
int res = updateProjectInfoSubdeptsUsers(proSubdeptsUser);
|
||||
|
||||
// 保存业务签名
|
||||
basSignetMapper.deleteBasSignetByParams(proSubdeptsUser.getProjectId(),proSubdeptsUser.getUserId());
|
||||
|
|
@ -1286,7 +1296,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
proProjectInfoSubdeptsUsers.setUseStatus(UseStateEnums.IN.getCode());
|
||||
proProjectInfoSubdeptsUsers.setUseDate(DateUtils.getNowDate());
|
||||
proProjectInfoSubdeptsUsers.setApproveStatus(ApproveStatus.exempt.getCode());
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
// 人员入场信息
|
||||
uniService.syncUniUser(proProjectInfoSubdeptsUsers,true);
|
||||
}
|
||||
|
|
@ -1324,7 +1334,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
}
|
||||
if(flag){
|
||||
proProjectInfoSubdeptsUsers.setEduFilePath(newFilePath.replace(ProfileConfig.profilePath,ProfileConfig.profile));
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1360,7 +1370,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
}
|
||||
if(flag){
|
||||
proProjectInfoSubdeptsUsers.setEduFilePath(newFilePath.replace(ProfileConfig.profilePath,ProfileConfig.profile));
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1396,7 +1406,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
}
|
||||
if(flag){
|
||||
proProjectInfoSubdeptsUsers.setEduFilePath(newFilePath.replace(ProfileConfig.profilePath,ProfileConfig.profile));
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1483,7 +1493,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
try {
|
||||
ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersById(proUserId);
|
||||
proProjectInfoSubdeptsUsers.setApproveStatus(ApproveStatus.refuse.getCode());
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}catch (Exception e){
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
|
@ -1578,7 +1588,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
if(res>0){
|
||||
ProProjectInfoSubdeptsUsers proProjectInfoSubdeptsUsers = proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersByParamId(id,userId);
|
||||
proProjectInfoSubdeptsUsers.setSortBy(0L);
|
||||
res = proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
res = updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
boolean isAdmin= (SecurityUtils.isAdmin(userId) || SecurityUtils.isGSAdmin());
|
||||
|
||||
|
|
@ -1709,7 +1719,7 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
}
|
||||
if(flag){
|
||||
proProjectInfoSubdeptsUsers.setEduFilePath(newFilePath.replace(ProfileConfig.profilePath,ProfileConfig.profile));
|
||||
proProjectInfoSubdeptsUsersMapper.updateProProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
updateProjectInfoSubdeptsUsers(proProjectInfoSubdeptsUsers);
|
||||
}
|
||||
}else{
|
||||
throw new ServiceException("未查询三级安全教育主管签名信息...");
|
||||
|
|
@ -1825,4 +1835,33 @@ public class ProProjectInfoSubdeptsUsersServiceImpl implements IProProjectInfoSu
|
|||
return proProjectInfoSubdeptsUsersMapper.getEduCompletedCount(prjId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新项目的百度人脸库
|
||||
* @param projectId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public Long updateBaiduFaceLibrary(Long projectId) {
|
||||
ProProjectInfoSubdeptsUsers where=new ProProjectInfoSubdeptsUsers();
|
||||
where.setProjectId(projectId);
|
||||
List<ProProjectInfoSubdeptsUsers> list=proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(where);
|
||||
int cnt=0;
|
||||
for(ProProjectInfoSubdeptsUsers u:list){
|
||||
String res= baiduFaceService.updateProUser(u,true);
|
||||
if(res!=null && res.contains("成功")){
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
SysUser syWhere=new SysUser();
|
||||
syWhere.setDeptId(projectId);
|
||||
List<SysUser> sysUsers=sysUserMapper.selectUserList(syWhere);
|
||||
for(SysUser sysUser:sysUsers){
|
||||
String res= baiduFaceService.updateSysUser(sysUser,true);
|
||||
if(res!=null && res.contains("成功")){
|
||||
cnt++;
|
||||
}
|
||||
}
|
||||
return cnt*1L;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -102,7 +102,7 @@ public class ProUserInoutRecordServiceImpl implements IProUserInoutRecordService
|
|||
@Override
|
||||
public int addRecord(ProProjectInfoSubdeptsUsers user) {
|
||||
ProUserInoutRecord record = new ProUserInoutRecord();
|
||||
record.setUserId(user.getId());
|
||||
record.setUserId(user.getUserId());
|
||||
record.setUseStatus(user.getUseStatus());
|
||||
record.setUserName(user.getUserName());
|
||||
record.setUserPhone(user.getUserPhone());
|
||||
|
|
|
|||
|
|
@ -4,10 +4,12 @@ import com.yanzhu.common.core.utils.DateUtils;
|
|||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.device.domain.ProjectPitMonitCfg;
|
||||
import com.yanzhu.device.mapper.ProjectPitMonitCfgMapper;
|
||||
import com.yanzhu.manage.domain.ProMobileAttendanceData;
|
||||
import com.yanzhu.manage.service.IProjectPitMonitCfgService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
|
|
@ -112,4 +114,5 @@ public class ProjectPitMonitCfgServiceImpl implements IProjectPitMonitCfgService
|
|||
{
|
||||
return projectPitMonitCfgMapper.deleteSurProjectPitMonitCfgById(id);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@ import org.springframework.boot.autoconfigure.SpringBootApplication;
|
|||
import com.yanzhu.common.security.annotation.EnableCustomConfig;
|
||||
import com.yanzhu.common.security.annotation.EnableRyFeignClients;
|
||||
import com.yanzhu.common.swagger.annotation.EnableCustomSwagger2;
|
||||
import org.springframework.context.annotation.ComponentScan;
|
||||
|
||||
/**
|
||||
* 系统模块
|
||||
|
|
@ -14,6 +15,7 @@ import com.yanzhu.common.swagger.annotation.EnableCustomSwagger2;
|
|||
@EnableCustomConfig
|
||||
@EnableCustomSwagger2
|
||||
@EnableRyFeignClients
|
||||
@ComponentScan(basePackages = {"com.yanzhu"})
|
||||
@SpringBootApplication
|
||||
public class YanZhuSystemApplication
|
||||
{
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ import com.yanzhu.common.security.service.TokenService;
|
|||
import com.yanzhu.common.security.utils.SecurityUtils;
|
||||
import com.yanzhu.manage.domain.AttendanceCfg;
|
||||
import com.yanzhu.manage.mapper.AttendanceCfgMapper;
|
||||
import com.yanzhu.services.IBaiduFaceService;
|
||||
import com.yanzhu.system.api.domain.SysDept;
|
||||
import com.yanzhu.system.api.domain.SysRole;
|
||||
import com.yanzhu.system.api.domain.SysUser;
|
||||
|
|
@ -77,6 +78,8 @@ public class SysUserController extends BaseController {
|
|||
@Autowired
|
||||
private AttendanceCfgMapper attendanceCfgMapper;
|
||||
|
||||
@Autowired
|
||||
private IBaiduFaceService baiduFaceService;
|
||||
/**
|
||||
* 获取用户列表
|
||||
*/
|
||||
|
|
@ -377,7 +380,9 @@ public class SysUserController extends BaseController {
|
|||
}*/
|
||||
user.setCreateBy(SecurityUtils.getUsername());
|
||||
user.setPassword(SecurityUtils.encryptPassword(user.getPassword()));
|
||||
return toAjax(userService.insertUser(user));
|
||||
AjaxResult result= toAjax(userService.insertUser(user));
|
||||
baiduFaceService.addSysUser(user);
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -386,7 +391,9 @@ public class SysUserController extends BaseController {
|
|||
@Log(title = "用户管理", businessType = BusinessType.INSERT)
|
||||
@PostMapping("/addUser")
|
||||
public AjaxResult addUser(@Validated @RequestBody SysUser user) {
|
||||
return toAjax(userService.insertUserWx(user));
|
||||
AjaxResult result= toAjax(userService.insertUserWx(user));
|
||||
baiduFaceService.addSysUser(user);
|
||||
return result;
|
||||
}
|
||||
|
||||
@GetMapping("/getUserByName/{userName}")
|
||||
|
|
@ -409,6 +416,7 @@ public class SysUserController extends BaseController {
|
|||
return error("修改用户'" + user.getUserName() + "'失败,邮箱账号已存在");
|
||||
}
|
||||
user.setUpdateBy(SecurityUtils.getUsername());
|
||||
baiduFaceService.updateSysUser(user,false);
|
||||
return toAjax(userService.updateUser(user));
|
||||
}
|
||||
|
||||
|
|
@ -422,6 +430,7 @@ public class SysUserController extends BaseController {
|
|||
if (ArrayUtils.contains(userIds, SecurityUtils.getUserId())) {
|
||||
return error("当前用户不能删除");
|
||||
}
|
||||
baiduFaceService.deleteSysUser(userIds);
|
||||
return toAjax(userService.deleteUserByIds(userIds));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2,11 +2,11 @@
|
|||
module.exports = {
|
||||
timeout: 60000,
|
||||
appId: "wx007a8fd50dc185b2",
|
||||
//baseUrl: "https://xiangguan.sxyanzhu.com/wechat",
|
||||
baseUrl: "https://jaszpt.crfeb.com.cn/wechat",
|
||||
baseUrl: "https://xiangguan.sxyanzhu.com/wechat",
|
||||
//baseUrl: "https://jaszpt.crfeb.com.cn/wechat",
|
||||
//baseUrl: "http://127.0.0.1:8080",
|
||||
//baseImgUrl: "https://xiangguan.sxyanzhu.com",
|
||||
baseImgUrl: "https://jaszpt.crfeb.com.cn",
|
||||
baseImgUrl: "https://xiangguan.sxyanzhu.com",
|
||||
//baseImgUrl: "https://jaszpt.crfeb.com.cn",
|
||||
//baseImgUrl: 'http://127.0.0.1:9300',
|
||||
noSecuritys: [
|
||||
"/code",
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { getToken, getUserInfo } from "../../../../utils/auth.js";
|
||||
import { getMobileAttendanceConfig } from "../../../../api/project.js";
|
||||
import { calculateDistance } from "../../../../utils/location.js";
|
||||
|
||||
import cfg from "../../../../config.js";
|
||||
const app = getApp();
|
||||
|
||||
Page({
|
||||
|
|
@ -20,6 +20,7 @@ Page({
|
|||
currentAddress: "", // 当前位置地址
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
baseImgUrl: cfg.baseImgUrl,
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -168,7 +169,11 @@ Page({
|
|||
},
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到其它页面。*/
|
||||
if (wx.getStorageSync("nav-menu") == "xmgl") {
|
||||
if (wx.getStorageSync("nav-menu") == "prjInfo") {
|
||||
wx.redirectTo({
|
||||
url: "../../../project_info/index",
|
||||
});
|
||||
} else if (wx.getStorageSync("nav-menu") == "xmgl") {
|
||||
wx.redirectTo({
|
||||
url: "../../../project_more/index",
|
||||
});
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{baseImgUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@ Page({
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
baseImgUrl: config.baseImgUrl, // 添加 baseImgUrl 到页面数据中
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
<van-row>
|
||||
<van-col span="4">
|
||||
<view class="header_img" bindtap="returnToPage">
|
||||
<image src="/images/left.png"></image>
|
||||
<image src="../../../../images/left.png"></image>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="15">
|
||||
|
|
@ -31,7 +31,7 @@
|
|||
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{baseImgUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -75,7 +75,7 @@
|
|||
<view class="inspect_add_to" bindtap="doAddCfg">
|
||||
|
||||
<view style="padding-top: 22rpx">
|
||||
<image src="/images/new_add.png"></image>
|
||||
<image src="../../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -73,13 +73,13 @@
|
|||
</view>
|
||||
<view wx:if="{{ listData.length == 0 }}">
|
||||
<view style="padding-top: 70px; text-align: -webkit-center">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px; height: 105px"></image>
|
||||
<image src="{{ imgBaseUrl }}/cdn/appimgs/nodata.png" style="width: 130px; height: 105px"></image>
|
||||
<view style="color: #a5abbb">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{ isGroup }}" class="inspect_add_to" bindtap="skipAdd">
|
||||
<view style="padding-top: 22rpx">
|
||||
<image src="/images/new_add.png"></image>
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@
|
|||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{imgBaseUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
<text wx:if="{{item.endTime}}" class="color_purple">办结时间 {{item.endTime}}</text>
|
||||
</view>
|
||||
<view wx:if="{{showChecked && activeState=='dsh'}}" class="myIcon" data-set="{{item.procInsId}}" catchtap="selectItem">
|
||||
<image src="{{item.selected ? 'https://xiangguan.sxyanzhu.com/profile/static/images/choice.png' : '/images/unchoice.png'}}" />
|
||||
<image src="{{item.selected ? imgBaseUrl + '/profile/static/images/choice.png' : '/images/unchoice.png'}}" />
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -56,7 +56,7 @@
|
|||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{imgBaseUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,21 +1,14 @@
|
|||
import config from '../../config'
|
||||
import {
|
||||
getToken,
|
||||
getUserInfo
|
||||
} from '../../utils/auth'
|
||||
import {
|
||||
findProjectInfo,
|
||||
findProjectDepts
|
||||
} from '../../api/project'
|
||||
import config from "../../config";
|
||||
import { getToken, getUserInfo } from "../../utils/auth";
|
||||
import { findUserMenuList } from "../../api/publics";
|
||||
import { findProjectInfo, findProjectDepts } from "../../api/project";
|
||||
import {
|
||||
findSubDeptsUsers,
|
||||
findDaysAttendanceView,
|
||||
findUsersAttendanceView,
|
||||
findSubDeptsAttendanceView
|
||||
} from '../api/attendance'
|
||||
import {
|
||||
findMyTask
|
||||
} from '../api/flowable'
|
||||
findSubDeptsAttendanceView,
|
||||
} from "../api/attendance";
|
||||
import { findMyTask } from "../api/flowable";
|
||||
const app = getApp();
|
||||
Page({
|
||||
/**
|
||||
|
|
@ -27,101 +20,115 @@ Page({
|
|||
//项目信息
|
||||
projectInfo: {},
|
||||
projectDeptsList: [],
|
||||
deptTypes: [{
|
||||
"name": "建设单位",
|
||||
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_jsdw.png"
|
||||
}, {
|
||||
"name": "监理单位",
|
||||
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_jldw.png"
|
||||
}, {
|
||||
"name": "设计单位",
|
||||
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_sjdw.png"
|
||||
}, {
|
||||
"name": "检测单位",
|
||||
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/WEB_jcjg.png"
|
||||
}, {
|
||||
"name": "勘察单位",
|
||||
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/web_ktdw.png"
|
||||
}, {
|
||||
"name": "总包单位",
|
||||
"iconSrc": "https://xiangguan.sxyanzhu.com/profile/static/icon/web_zbdw.png"
|
||||
}],
|
||||
deptTypes: [
|
||||
{
|
||||
name: "建设单位",
|
||||
iconSrc: config.baseImgUrl + "/profile/static/icon/WEB_jsdw.png",
|
||||
},
|
||||
{
|
||||
name: "监理单位",
|
||||
iconSrc: config.baseImgUrl + "/profile/static/icon/WEB_jldw.png",
|
||||
},
|
||||
{
|
||||
name: "设计单位",
|
||||
iconSrc: config.baseImgUrl + "/profile/static/icon/WEB_sjdw.png",
|
||||
},
|
||||
{
|
||||
name: "检测单位",
|
||||
iconSrc: config.baseImgUrl + "/profile/static/icon/WEB_jcjg.png",
|
||||
},
|
||||
{
|
||||
name: "勘察单位",
|
||||
iconSrc: config.baseImgUrl + "/profile/static/icon/web_ktdw.png",
|
||||
},
|
||||
{
|
||||
name: "总包单位",
|
||||
iconSrc: config.baseImgUrl + "/profile/static/icon/web_zbdw.png",
|
||||
},
|
||||
],
|
||||
active: 0,
|
||||
projectId: '',
|
||||
projectName: '',
|
||||
projectId: "",
|
||||
projectName: "",
|
||||
initData: {},
|
||||
aqglDb: 0,
|
||||
zlglDb: 0,
|
||||
todoDb: 0,
|
||||
nactive: 0,
|
||||
labourData: [{
|
||||
name: "管理人员",
|
||||
total: 0,
|
||||
unit: "人",
|
||||
yesMonitor: 180
|
||||
},
|
||||
{
|
||||
name: "劳务人员",
|
||||
yesMonitor: 0,
|
||||
total: 0,
|
||||
unit: "人"
|
||||
},
|
||||
{
|
||||
name: "特殊工种",
|
||||
yesMonitor: 0,
|
||||
total: 0,
|
||||
unit: "人"
|
||||
},
|
||||
labourData: [
|
||||
{
|
||||
name: "管理人员",
|
||||
total: 0,
|
||||
unit: "人",
|
||||
yesMonitor: 180,
|
||||
},
|
||||
{
|
||||
name: "劳务人员",
|
||||
yesMonitor: 0,
|
||||
total: 0,
|
||||
unit: "人",
|
||||
},
|
||||
{
|
||||
name: "特殊工种",
|
||||
yesMonitor: 0,
|
||||
total: 0,
|
||||
unit: "人",
|
||||
},
|
||||
],
|
||||
labourDataList: [],
|
||||
labourDays: [{
|
||||
name: "管理人员",
|
||||
total: 0,
|
||||
unit: "人",
|
||||
yesMonitor: 180
|
||||
},
|
||||
{
|
||||
name: "劳务人员",
|
||||
yesMonitor: 0,
|
||||
total: 0,
|
||||
unit: "人"
|
||||
},
|
||||
{
|
||||
name: "特殊工种",
|
||||
yesMonitor: 0,
|
||||
total: 0,
|
||||
unit: "人"
|
||||
},
|
||||
labourDays: [
|
||||
{
|
||||
name: "管理人员",
|
||||
total: 0,
|
||||
unit: "人",
|
||||
yesMonitor: 180,
|
||||
},
|
||||
{
|
||||
name: "劳务人员",
|
||||
yesMonitor: 0,
|
||||
total: 0,
|
||||
unit: "人",
|
||||
},
|
||||
{
|
||||
name: "特殊工种",
|
||||
yesMonitor: 0,
|
||||
total: 0,
|
||||
unit: "人",
|
||||
},
|
||||
],
|
||||
labourDaysTotal: 0,
|
||||
labourImg: "https://szgcwx.jhncidg.com/staticFiles/icon/zgry.png",
|
||||
labourImg: config.baseImgUrl + "/cdn/appimgs/zgry.png",
|
||||
labourName: "在岗人员",
|
||||
labourTotal: 0,
|
||||
labourTypeList: [{
|
||||
name: "在岗人员",
|
||||
total: 0,
|
||||
img: "https://szgcwx.jhncidg.com/staticFiles/icon/zgry.png"
|
||||
}, {
|
||||
name: "离岗人员",
|
||||
total: 0,
|
||||
img: "https://szgcwx.jhncidg.com/staticFiles/icon/rylg.png"
|
||||
}],
|
||||
labourTypeList: [
|
||||
{
|
||||
name: "在岗人员",
|
||||
total: 0,
|
||||
img: config.baseImgUrl + "/cdn/appimgs/zgry.png",
|
||||
},
|
||||
{
|
||||
name: "离岗人员",
|
||||
total: 0,
|
||||
img: config.baseImgUrl + "/cdn/appimgs/rylg.png",
|
||||
},
|
||||
],
|
||||
animation: true,
|
||||
animationData: {},
|
||||
labourDatas: {
|
||||
unit: '人',
|
||||
legend: ['出勤人数', '当前在岗'],
|
||||
color: ['#2e6ed0', '#fb9300'],
|
||||
Xdata: ['01-01', '01-02', '01-03', '01-04', '01-05', '01-06', '01-07'],
|
||||
unit: "人",
|
||||
legend: ["出勤人数", "当前在岗"],
|
||||
color: ["#2e6ed0", "#fb9300"],
|
||||
Xdata: ["01-01", "01-02", "01-03", "01-04", "01-05", "01-06", "01-07"],
|
||||
Ydata: [
|
||||
[0, 0, 0, 0, 0, 0, 0],
|
||||
[0, 0, 0, 0, 0, 0, 0]
|
||||
]
|
||||
[0, 0, 0, 0, 0, 0, 0],
|
||||
],
|
||||
},
|
||||
switchChart: false,
|
||||
attendanceListData: [],
|
||||
subDeptUserInfo: {},
|
||||
imgBaseUrl: config.baseImgUrl
|
||||
imgBaseUrl: config.baseImgUrl,
|
||||
menuList: [],
|
||||
baseImgUrl: config.baseImgUrl,
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -130,10 +137,10 @@ Page({
|
|||
onLoad: function (options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: '../../pages/login/login',
|
||||
})
|
||||
url: "../../pages/login/login",
|
||||
});
|
||||
}
|
||||
wx.setStorageSync('nav-menu', "xmgk");
|
||||
wx.setStorageSync("nav-menu", "xmgk");
|
||||
const proUserInfo = getUserInfo();
|
||||
app.globalData.subDeptUserData = proUserInfo.projectUserInfo;
|
||||
this.initAnimationData();
|
||||
|
|
@ -145,7 +152,7 @@ Page({
|
|||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
subDeptUserInfo: proUserInfo.projectUserInfo
|
||||
subDeptUserInfo: proUserInfo.projectUserInfo,
|
||||
});
|
||||
//项目基本信息
|
||||
this.getProjectInfo(app.globalData.useProjectId);
|
||||
|
|
@ -153,19 +160,50 @@ Page({
|
|||
this.getProUserDatas();
|
||||
//项目建设单位
|
||||
this.getProjectDepts(app.globalData.useProjectId);
|
||||
this.getMenu();
|
||||
},
|
||||
getMenu() {
|
||||
let subDeptUserInfo = this.data.subDeptUserInfo;
|
||||
if (
|
||||
(subDeptUserInfo.subDeptType == "4" ||
|
||||
subDeptUserInfo.subDeptType == "5") &&
|
||||
(subDeptUserInfo.userPost == "4" || subDeptUserInfo.userPost == "5")
|
||||
) {
|
||||
let proId = app.globalData.useProjectId;
|
||||
findUserMenuList(proId, "gdgn").then((res) => {
|
||||
if (res.code == 200) {
|
||||
let menus = (res.data || []).filter(
|
||||
(it) => it.menuIdenti != "YDKQGL"
|
||||
);
|
||||
this.setData({
|
||||
menuList: menus,
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
goMenu: function (event) {
|
||||
let _url = event.currentTarget.dataset.url;
|
||||
if (!_url) {
|
||||
app.toast("正在建设中...");
|
||||
return false;
|
||||
}
|
||||
wx.setStorageSync("nav-menu", "prjInfo");
|
||||
wx.redirectTo({
|
||||
url: _url,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 统计劳务人员信息
|
||||
* @param {*} proId
|
||||
* @param {*} proId
|
||||
*/
|
||||
getSubDeptsUsers(proId) {
|
||||
findSubDeptsUsers(proId).then(res => {
|
||||
findSubDeptsUsers(proId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let zg = 0;
|
||||
let lg = 0;
|
||||
res.data.forEach(item => {
|
||||
if (item.useStatus == '0') {
|
||||
res.data.forEach((item) => {
|
||||
if (item.useStatus == "0") {
|
||||
zg += item.total;
|
||||
} else {
|
||||
lg += item.total;
|
||||
|
|
@ -175,8 +213,8 @@ Page({
|
|||
"labourTypeList[0].total": zg,
|
||||
"labourTypeList[1].total": lg,
|
||||
labourTotal: zg,
|
||||
labourDataList: res.data || []
|
||||
})
|
||||
labourDataList: res.data || [],
|
||||
});
|
||||
this.initSubDeptUsersCharts();
|
||||
}
|
||||
});
|
||||
|
|
@ -188,8 +226,8 @@ Page({
|
|||
initAnimationData() {
|
||||
var animation = wx.createAnimation({
|
||||
duration: 1000,
|
||||
timingFunction: 'linear',
|
||||
})
|
||||
timingFunction: "linear",
|
||||
});
|
||||
this.animation = animation;
|
||||
if (this.data.animation) {
|
||||
animation.translateY(-8).step();
|
||||
|
|
@ -198,11 +236,11 @@ Page({
|
|||
}
|
||||
this.setData({
|
||||
animation: this.data.animation ? false : true,
|
||||
animationData: animation.export()
|
||||
})
|
||||
animationData: animation.export(),
|
||||
});
|
||||
setTimeout(() => {
|
||||
this.initAnimationData();
|
||||
}, 1200)
|
||||
}, 1200);
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -214,22 +252,22 @@ Page({
|
|||
let gl = 0;
|
||||
let ts = 0;
|
||||
let lw = 0;
|
||||
labourDataList.forEach(item => {
|
||||
labourDataList.forEach((item) => {
|
||||
if (this.data.nactive == 0) {
|
||||
if (item.useStatus == '0') {
|
||||
if (item.craftType == '2') {
|
||||
if (item.useStatus == "0") {
|
||||
if (item.craftType == "2") {
|
||||
ts += item.total;
|
||||
} else if (item.craftType == '3') {
|
||||
} else if (item.craftType == "3") {
|
||||
gl += item.total;
|
||||
} else {
|
||||
lw += item.total;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (item.useStatus != '0') {
|
||||
if (item.craftType == '2') {
|
||||
if (item.useStatus != "0") {
|
||||
if (item.craftType == "2") {
|
||||
ts += item.total;
|
||||
} else if (item.craftType == '3') {
|
||||
} else if (item.craftType == "3") {
|
||||
gl += item.total;
|
||||
} else {
|
||||
lw += item.total;
|
||||
|
|
@ -244,8 +282,8 @@ Page({
|
|||
"labourData[1].yesMonitor": ts,
|
||||
"labourData[2].total": lw,
|
||||
"labourData[2].yesMonitor": lw,
|
||||
labourTotal: this.data.labourTypeList[this.data.nactive].total
|
||||
})
|
||||
labourTotal: this.data.labourTypeList[this.data.nactive].total,
|
||||
});
|
||||
if (this.data.switchChart) {
|
||||
let chats = this.selectComponent("#userChart");
|
||||
chats.initChart();
|
||||
|
|
@ -256,18 +294,18 @@ Page({
|
|||
/**
|
||||
* 初始化
|
||||
* 今日考勤
|
||||
* @param {*} proId
|
||||
* @param {*} proId
|
||||
*/
|
||||
initSubDeptDaysCharts(proId) {
|
||||
findDaysAttendanceView(proId).then(res => {
|
||||
findDaysAttendanceView(proId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let gl = 0;
|
||||
let ts = 0;
|
||||
let lw = 0;
|
||||
res.data.forEach(item => {
|
||||
if (item.craftType == '2') {
|
||||
res.data.forEach((item) => {
|
||||
if (item.craftType == "2") {
|
||||
ts += item.total;
|
||||
} else if (item.craftType == '3') {
|
||||
} else if (item.craftType == "3") {
|
||||
gl += item.total;
|
||||
} else {
|
||||
lw += item.total;
|
||||
|
|
@ -280,8 +318,8 @@ Page({
|
|||
"labourDays[1].yesMonitor": ts,
|
||||
"labourDays[2].total": lw,
|
||||
"labourDays[2].yesMonitor": lw,
|
||||
labourDaysTotal: gl + ts + lw
|
||||
})
|
||||
labourDaysTotal: gl + ts + lw,
|
||||
});
|
||||
if (this.data.switchChart) {
|
||||
let chats = this.selectComponent("#attsChart");
|
||||
chats.initChart();
|
||||
|
|
@ -293,22 +331,22 @@ Page({
|
|||
/**
|
||||
* 统计
|
||||
* 最近出勤信息
|
||||
* @param {*} proId
|
||||
* @param {*} proId
|
||||
*/
|
||||
getSubDeptsAttendanceView(proId) {
|
||||
findSubDeptsAttendanceView(proId).then(res => {
|
||||
findSubDeptsAttendanceView(proId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let xd = [];
|
||||
let yd1 = [];
|
||||
let yd2 = [];
|
||||
res.data.list.forEach(item => {
|
||||
res.data.list.forEach((item) => {
|
||||
xd.push(item.attendanceTime);
|
||||
yd1.push(item.total);
|
||||
});
|
||||
if (xd.length < 7) {
|
||||
let n = 7 - xd.length;
|
||||
for (let i = 0; i < n; i++) {
|
||||
xd.push('-');
|
||||
xd.push("-");
|
||||
yd1.push(0);
|
||||
}
|
||||
}
|
||||
|
|
@ -320,7 +358,7 @@ Page({
|
|||
yd.push(yd2);
|
||||
this.setData({
|
||||
"labourDatas.Xdata": xd,
|
||||
"labourDatas.Ydata": yd
|
||||
"labourDatas.Ydata": yd,
|
||||
});
|
||||
if (this.data.switchChart) {
|
||||
let chats = this.selectComponent("#chartBar");
|
||||
|
|
@ -332,36 +370,49 @@ Page({
|
|||
|
||||
/**
|
||||
* 查询用户考勤
|
||||
* @param {*} proId
|
||||
* @param {*} proId
|
||||
*/
|
||||
getUsersAttendanceView(proId) {
|
||||
findUsersAttendanceView(proId).then(res => {
|
||||
findUsersAttendanceView(proId).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
attendanceListData: res.data
|
||||
attendanceListData: res.data,
|
||||
});
|
||||
}
|
||||
})
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 单位人员信息
|
||||
* @param {*} proId
|
||||
* @param {*} proId
|
||||
*/
|
||||
getProUserDatas() {
|
||||
//劳务人员信息
|
||||
if ((app.globalData.subDeptUserData.subDeptType == '1' || app.globalData.subDeptUserData.subDeptType == '4' || app.globalData.subDeptUserData.subDeptType == '5') && app.globalData.subDeptUserData.userPost != '4' && app.globalData.subDeptUserData.userPost != '5' && app.globalData.subDeptUserData.userPost != '6' && app.globalData.subDeptUserData.userPost != '8') {
|
||||
if (
|
||||
(app.globalData.subDeptUserData.subDeptType == "1" ||
|
||||
app.globalData.subDeptUserData.subDeptType == "4" ||
|
||||
app.globalData.subDeptUserData.subDeptType == "5") &&
|
||||
app.globalData.subDeptUserData.userPost != "4" &&
|
||||
app.globalData.subDeptUserData.userPost != "5" &&
|
||||
app.globalData.subDeptUserData.userPost != "6" &&
|
||||
app.globalData.subDeptUserData.userPost != "8"
|
||||
) {
|
||||
//统计劳务人员信息
|
||||
this.getSubDeptsUsers(app.globalData.useProjectId);
|
||||
this.initSubDeptDaysCharts(app.globalData.useProjectId);
|
||||
}
|
||||
this.awaitTask();
|
||||
//今日出勤信息
|
||||
if (app.globalData.subDeptUserData.subDeptType == '1') {
|
||||
if (app.globalData.subDeptUserData.subDeptType == "1") {
|
||||
this.getSubDeptsAttendanceView(app.globalData.useProjectId);
|
||||
}
|
||||
//人员出勤信息
|
||||
if (app.globalData.subDeptUserData.userPost == '4' || app.globalData.subDeptUserData.userPost == '5' || app.globalData.subDeptUserData.userPost == '6' || app.globalData.subDeptUserData.userPost == '8') {
|
||||
if (
|
||||
app.globalData.subDeptUserData.userPost == "4" ||
|
||||
app.globalData.subDeptUserData.userPost == "5" ||
|
||||
app.globalData.subDeptUserData.userPost == "6" ||
|
||||
app.globalData.subDeptUserData.userPost == "8"
|
||||
) {
|
||||
//统计劳务人员信息
|
||||
this.getUsersAttendanceView(app.globalData.useProjectId);
|
||||
}
|
||||
|
|
@ -379,7 +430,7 @@ Page({
|
|||
onChange(event) {
|
||||
// event.detail 的值为当前选中项的索引
|
||||
this.setData({
|
||||
active: event.detail
|
||||
active: event.detail,
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -388,20 +439,20 @@ Page({
|
|||
*/
|
||||
initLabourDatas() {
|
||||
findGroupAllByDays({
|
||||
projectId: app.globalData.projectId
|
||||
}).then(res => {
|
||||
projectId: app.globalData.projectId,
|
||||
}).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let xd = [];
|
||||
let yd1 = [];
|
||||
let yd2 = [];
|
||||
res.data.list.forEach(item => {
|
||||
res.data.list.forEach((item) => {
|
||||
xd.push(item.attendanceTime);
|
||||
yd1.push(item.total);
|
||||
});
|
||||
if (xd.length < 7) {
|
||||
let n = 7 - xd.length;
|
||||
for (let i = 0; i < n; i++) {
|
||||
xd.push('');
|
||||
xd.push("");
|
||||
yd1.push(0);
|
||||
}
|
||||
}
|
||||
|
|
@ -413,7 +464,7 @@ Page({
|
|||
yd.push(yd2);
|
||||
this.setData({
|
||||
"labourDatas.Xdata": xd,
|
||||
"labourDatas.Ydata": yd
|
||||
"labourDatas.Ydata": yd,
|
||||
});
|
||||
if (this.data.switchChart) {
|
||||
let chats = this.selectComponent("#chartBar");
|
||||
|
|
@ -425,22 +476,24 @@ Page({
|
|||
|
||||
/**
|
||||
* 查询项目详情
|
||||
* @param {*} proId
|
||||
* @param {*} proId
|
||||
*/
|
||||
getProjectInfo: function (proId) {
|
||||
findProjectInfo(proId).then(res => {
|
||||
findProjectInfo(proId).then((res) => {
|
||||
if (res.data.scheduledStartTime) {
|
||||
res.data.scheduledStartTime = res.data.scheduledStartTime.split("T")[0];
|
||||
} else {
|
||||
res.data.scheduledStartTime = " - ";
|
||||
}
|
||||
if (res.data.actualOperatingTime) {
|
||||
res.data.actualOperatingTime = res.data.actualOperatingTime.split("T")[0];
|
||||
res.data.actualOperatingTime =
|
||||
res.data.actualOperatingTime.split("T")[0];
|
||||
} else {
|
||||
res.data.actualOperatingTime = " - ";
|
||||
}
|
||||
if (res.data.plannedCompletionTime) {
|
||||
res.data.plannedCompletionTime = res.data.plannedCompletionTime.split("T")[0];
|
||||
res.data.plannedCompletionTime =
|
||||
res.data.plannedCompletionTime.split("T")[0];
|
||||
} else {
|
||||
res.data.plannedCompletionTime = " - ";
|
||||
}
|
||||
|
|
@ -454,21 +507,21 @@ Page({
|
|||
// });
|
||||
this.setData({
|
||||
projectInfo: res.data,
|
||||
projectDeptsList: res.data.projectDeptsList
|
||||
})
|
||||
projectDeptsList: res.data.projectDeptsList,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询
|
||||
* 项目建设单位
|
||||
* @param {*} proId
|
||||
* @param {*} proId
|
||||
*/
|
||||
getProjectDepts: function (proId) {
|
||||
findProjectDepts(proId).then(res => {
|
||||
findProjectDepts(proId).then((res) => {
|
||||
this.setData({
|
||||
projectDeptsList: res.data
|
||||
})
|
||||
projectDeptsList: res.data,
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
|
|
@ -478,7 +531,7 @@ Page({
|
|||
this.setData({
|
||||
nactive: e.target.dataset.set,
|
||||
labourImg: this.data.labourTypeList[e.target.dataset.set].img,
|
||||
})
|
||||
});
|
||||
this.initSubDeptUsersCharts();
|
||||
}
|
||||
},
|
||||
|
|
@ -490,8 +543,8 @@ Page({
|
|||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.setData({
|
||||
switchChart: true
|
||||
})
|
||||
switchChart: true,
|
||||
});
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
|
|
@ -504,31 +557,31 @@ Page({
|
|||
|
||||
/**
|
||||
* 拨打电话
|
||||
* @param {*} event
|
||||
* @param {*} event
|
||||
*/
|
||||
calling: function (event) {
|
||||
let callPhone = event.currentTarget.dataset.phone;
|
||||
wx.makePhoneCall({
|
||||
phoneNumber: callPhone,
|
||||
success: function () {
|
||||
console.log("拨打电话成功!")
|
||||
console.log("拨打电话成功!");
|
||||
},
|
||||
fail: function () {
|
||||
console.log("拨打电话失败!")
|
||||
}
|
||||
})
|
||||
console.log("拨打电话失败!");
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
showImg: function (e) {
|
||||
let paths = e.target.dataset.set;
|
||||
let path = [];
|
||||
paths.split(',').forEach(url => {
|
||||
paths.split(",").forEach((url) => {
|
||||
path.push(config.baseImgUrl + url);
|
||||
});
|
||||
wx.previewImage({
|
||||
urls: path,
|
||||
current: path[0]
|
||||
})
|
||||
current: path[0],
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -537,8 +590,8 @@ Page({
|
|||
goLWGL: function () {
|
||||
if (this.data.nactive == 2) {
|
||||
wx.redirectTo({
|
||||
url: '../../pageage/project_attendance/project_attendanceData/list/index'
|
||||
})
|
||||
url: "../../pageage/project_attendance/project_attendanceData/list/index",
|
||||
});
|
||||
} else {
|
||||
let type;
|
||||
if (this.data.nactive == 0) {
|
||||
|
|
@ -547,8 +600,10 @@ Page({
|
|||
type = 2;
|
||||
}
|
||||
wx.redirectTo({
|
||||
url: '../../pageage/project_attendance/project_attendanceUser/list/index?type=' + type
|
||||
})
|
||||
url:
|
||||
"../../pageage/project_attendance/project_attendanceUser/list/index?type=" +
|
||||
type,
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
@ -557,47 +612,47 @@ Page({
|
|||
*/
|
||||
goZJCQ: function () {
|
||||
wx.redirectTo({
|
||||
url: '../../pageage/project_attendance/project_attendanceData/list/index'
|
||||
})
|
||||
url: "../../pageage/project_attendance/project_attendanceData/list/index",
|
||||
});
|
||||
},
|
||||
|
||||
//跳转到安全管控
|
||||
XMSP: function () {
|
||||
wx.setStorageSync('nav-menu', "aqgl");
|
||||
wx.setStorageSync("nav-menu", "aqgl");
|
||||
wx.redirectTo({
|
||||
url: '../project_safety/index'
|
||||
})
|
||||
url: "../project_safety/index",
|
||||
});
|
||||
},
|
||||
|
||||
//跳转到质量管理
|
||||
ZLGL: function () {
|
||||
wx.setStorageSync('nav-menu', "zlgl");
|
||||
wx.setStorageSync("nav-menu", "zlgl");
|
||||
wx.redirectTo({
|
||||
url: '../project_quality/index'
|
||||
})
|
||||
url: "../project_quality/index",
|
||||
});
|
||||
},
|
||||
|
||||
//跳转到进度管理
|
||||
JDGL: function () {
|
||||
wx.setStorageSync('nav-menu', "xmgk");
|
||||
wx.setStorageSync("nav-menu", "xmgk");
|
||||
wx.redirectTo({
|
||||
url: '../project_schedule/list/index'
|
||||
})
|
||||
url: "../project_schedule/list/index",
|
||||
});
|
||||
},
|
||||
|
||||
//跳转到项目管理
|
||||
XMGL: function () {
|
||||
wx.setStorageSync('nav-menu', "xmgl");
|
||||
wx.setStorageSync("nav-menu", "xmgl");
|
||||
wx.redirectTo({
|
||||
url: '../project_more/index'
|
||||
})
|
||||
url: "../project_more/index",
|
||||
});
|
||||
},
|
||||
|
||||
//跳转到项目列表
|
||||
XMLB: function () {
|
||||
wx.redirectTo({
|
||||
url: '../project_list/index'
|
||||
})
|
||||
url: "../project_list/index",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
@ -605,15 +660,18 @@ Page({
|
|||
*/
|
||||
awaitTask() {
|
||||
let param = "proId=" + app.globalData.useProjectId;
|
||||
findMyTask(param).then(res => {
|
||||
findMyTask(param).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let proUserInfo = this.data.subDeptUserInfo;
|
||||
this.setData({
|
||||
todoDb: proUserInfo.subDeptType == "1" ? (res.data.dwsh + res.data.rysh) : res.data.todo,
|
||||
todoDb:
|
||||
proUserInfo.subDeptType == "1"
|
||||
? res.data.dwsh + res.data.rysh
|
||||
: res.data.todo,
|
||||
aqglDb: proUserInfo.subDeptType == "1" ? res.data.aqgl : 0,
|
||||
zlglDb: proUserInfo.subDeptType == "1" ? res.data.zlgl : 0
|
||||
})
|
||||
zlglDb: proUserInfo.subDeptType == "1" ? res.data.zlgl : 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
})
|
||||
});
|
||||
|
|
|
|||
|
|
@ -26,51 +26,51 @@
|
|||
<van-collapse-item title="项目基本信息" name="base">
|
||||
<view class="gk_open_con">
|
||||
<view>
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_12.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_12.png"></image>
|
||||
项目单位:<text>{{projectInfo.comName}}</text>
|
||||
</view>
|
||||
<view wx:if="{{projectInfo.province && projectInfo.city}}">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_1.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_1.png"></image>
|
||||
所属区域:<text>{{projectInfo.province+' - '+projectInfo.city}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_2.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_2.png"></image>
|
||||
详细地址:<text>{{projectInfo.projectAddress}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_3.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_3.png"></image>
|
||||
项目类型:<text>{{projectInfo.projectTypeName}}</text>
|
||||
</view>
|
||||
<view wx:if="{{false}}">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_4.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_4.png"></image>
|
||||
总建筑面积:<text>{{projectInfo.totalBuildingArea}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_5.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_5.png"></image>
|
||||
计划开工日期:<text>{{projectInfo.scheduledStartTime}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_6.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_6.png"></image>
|
||||
实际开工日期:<text>{{projectInfo.actualOperatingTime}}</text>
|
||||
</view>
|
||||
<view>
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_7.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_7.png"></image>
|
||||
计划竣工日期:<text>{{projectInfo.plannedCompletionTime}}</text>
|
||||
</view>
|
||||
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_8.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_8.png"></image>
|
||||
总工期:<text>{{projectInfo.projectTimeLimit + ' 天'}}</text>
|
||||
</view>
|
||||
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_10.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_10.png"></image>
|
||||
项目负责人:<text>{{projectInfo.projectPerson}}</text>
|
||||
</view>
|
||||
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_11.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_11.png"></image>
|
||||
负责人手机号:<text>{{projectInfo.projectPersonPhone}}</text>
|
||||
</view>
|
||||
<view wx:if="{{subDeptUserInfo.subDeptType=='1'}}">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/s_15.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/s_15.png"></image>
|
||||
项目概述:<text>{{projectInfo.projectSummarize}}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -78,7 +78,7 @@
|
|||
<van-collapse-item wx:if="{{subDeptUserInfo.subDeptType=='1'}}" title="建设及管理单位信息" name="dept">
|
||||
<view class="construction_unit" wx:for="{{projectDeptsList}}" wx:key="index">
|
||||
<view class="construction_unit_image">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/icon/web_zbdw.png"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/icon/web_zbdw.png"></image>
|
||||
</view>
|
||||
<view class="construction_unit_list">
|
||||
<view class="construction_unit_title">{{item.deptType}}</view>
|
||||
|
|
@ -90,7 +90,22 @@
|
|||
</van-collapse-item>
|
||||
</van-collapse>
|
||||
</view>
|
||||
|
||||
<view class="gd_max" style="margin-top: 20rpx;"
|
||||
wx-if="{{(subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && (subDeptUserInfo.userPost=='4' || subDeptUserInfo.userPost=='5')}}">
|
||||
<van-row class="demo clearfix">
|
||||
<van-col span="8" wx:for="{{menuList}}" wx:key="unique">
|
||||
<view class="gd_min" data-id="{{item.menuIdenti}}" data-url="{{item.menuUrl}}" bindtap="goMenu">
|
||||
<span class="tabNum_active" wx:if="{{item.menuIdenti=='FBDWSH' && fbdwDB>0}}">{{fbdwDB}}</span>
|
||||
<span class="tabNum_active" wx:if="{{item.menuIdenti=='FBRYSH' && fbrtDB>0}}">{{fbrtDB}}</span>
|
||||
<span class="tabNum_active" wx:if="{{item.menuIdenti=='AQYHPC' && aqyhDB>0}}">{{aqyhDB}}</span>
|
||||
<span class="tabNum_active" wx:if="{{item.menuIdenti=='ZLYHPC' && zlyhDB>0}}">{{zlyhDB}}</span>
|
||||
<span class="tabNum_active" wx:if="{{item.menuIdenti=='JPYSGL' && checkDB>0}}">{{checkDB}}</span>
|
||||
<image src="{{format.httpImg(item.menuImg)}}"></image>
|
||||
<view>{{item.menuName}}</view>
|
||||
</view>
|
||||
</van-col>
|
||||
</van-row>
|
||||
</view>
|
||||
<view class="echarts_max"
|
||||
wx:if="{{(subDeptUserInfo.subDeptType=='1' || subDeptUserInfo.subDeptType=='4' || subDeptUserInfo.subDeptType=='5') && subDeptUserInfo.userPost!='4' && subDeptUserInfo.userPost!='6' && subDeptUserInfo.userPost!='8'}}">
|
||||
<view class="echarts_min">
|
||||
|
|
@ -142,7 +157,7 @@
|
|||
<van-col span="8">
|
||||
<view class="survey_content">
|
||||
<view class="survey_content_img">
|
||||
<image animation="{{animationData}}" src="https://szgcwx.jhncidg.com/staticFiles/icon/dw.png" />
|
||||
<image animation="{{animationData}}" src="{{baseImgUrl}}/cd/appimgs/dw.png" />
|
||||
</view>
|
||||
</view>
|
||||
<view class="survey_content_number labour-survey_content_number">
|
||||
|
|
@ -249,7 +264,7 @@
|
|||
</view>
|
||||
<view wx:if="{{attendanceListData.length==0}}">
|
||||
<view style="padding-top: 5px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;">
|
||||
<image src="{{baseImgUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;">
|
||||
</image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
|
|
@ -259,7 +274,6 @@
|
|||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 底部导航 -->
|
||||
<van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange"
|
||||
active-color="#ffffff" inactive-color="#7d95d6">
|
||||
|
|
|
|||
|
|
@ -252,4 +252,24 @@
|
|||
|
||||
.bt30{
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.gd_max {
|
||||
padding: 10rpx 50rpx 0;
|
||||
}
|
||||
|
||||
.gd_min {
|
||||
padding: 30rpx 0;
|
||||
text-align: center;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.gd_min image {
|
||||
width: 150rpx;
|
||||
height: 150rpx;
|
||||
}
|
||||
|
||||
.gd_min view {
|
||||
padding: 10rpx;
|
||||
color: #89a4eb;
|
||||
}
|
||||
|
|
@ -1,228 +1,226 @@
|
|||
import {
|
||||
getToken
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
subusersList,
|
||||
subusersCount
|
||||
} from '../../../api/project'
|
||||
const app = getApp()
|
||||
import config from "../../../config";
|
||||
import { getToken } from "../../../utils/auth";
|
||||
import { subusersList, subusersCount } from "../../../api/project";
|
||||
const app = getApp();
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
addFlag: false,
|
||||
initData: {},
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
total: 0,
|
||||
listData: [],
|
||||
activeState: "0",
|
||||
yrcCount: 0,
|
||||
ylcCount: 0,
|
||||
activeName: "0_0",
|
||||
imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
addFlag: false,
|
||||
initData: {},
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
total: 0,
|
||||
listData: [],
|
||||
activeState: "0",
|
||||
yrcCount: 0,
|
||||
ylcCount: 0,
|
||||
activeName: "0_0",
|
||||
},
|
||||
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: '../../../pages/login/login',
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
addFlag: true,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
listData: [],
|
||||
total: 0
|
||||
});
|
||||
//获取数据列表
|
||||
this.getListData();
|
||||
this.getListCount();
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加按钮
|
||||
*/
|
||||
skipAdd() {
|
||||
wx.redirectTo({
|
||||
url: `../add/index`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param {*} e
|
||||
*/
|
||||
getInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${_id}`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改按钮
|
||||
* @param {*} e
|
||||
*/
|
||||
editInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../add/index?id=${_id}`,
|
||||
})
|
||||
},
|
||||
|
||||
// 手风琴
|
||||
onChange(e) {
|
||||
this.setData({
|
||||
activeName: e.target.dataset.set
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
getListData() {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished&searchValue=magUsers";
|
||||
subusersList(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows)
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 统计数据列表
|
||||
*/
|
||||
getListCount() {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished&searchValue=magUsers";
|
||||
subusersCount(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
let _yrc = 0,
|
||||
_ylc = 0;
|
||||
res.data.forEach(item => {
|
||||
if (item.useStatus == "0") {
|
||||
_yrc = item.total;
|
||||
} else {
|
||||
_ylc = item.total;
|
||||
}
|
||||
});
|
||||
this.setData({
|
||||
yrcCount: _yrc,
|
||||
ylcCount: _ylc
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 标签切换
|
||||
*/
|
||||
trainJump(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let nav = "";
|
||||
if (index == 1) {
|
||||
nav = '0';
|
||||
} else {
|
||||
nav = '1';
|
||||
}
|
||||
this.setData({
|
||||
activeState: nav,
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
listData: [],
|
||||
});
|
||||
this.getListData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到其它页面。*/
|
||||
wx.redirectTo({
|
||||
url: '../../project_more/index',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到底部
|
||||
*/
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1
|
||||
});
|
||||
this.getListData();
|
||||
} else {
|
||||
console.log("已经到底了,没有数据可加载!!!");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: "../../../pages/login/login",
|
||||
});
|
||||
}
|
||||
})
|
||||
this.setData({
|
||||
addFlag: true,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
listData: [],
|
||||
total: 0,
|
||||
});
|
||||
//获取数据列表
|
||||
this.getListData();
|
||||
this.getListCount();
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加按钮
|
||||
*/
|
||||
skipAdd() {
|
||||
wx.redirectTo({
|
||||
url: `../add/index`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param {*} e
|
||||
*/
|
||||
getInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${_id}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改按钮
|
||||
* @param {*} e
|
||||
*/
|
||||
editInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../add/index?id=${_id}`,
|
||||
});
|
||||
},
|
||||
|
||||
// 手风琴
|
||||
onChange(e) {
|
||||
this.setData({
|
||||
activeName: e.target.dataset.set,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
getListData() {
|
||||
let params =
|
||||
"pageNum=" +
|
||||
this.data.pageNum +
|
||||
"&pageSize=" +
|
||||
this.data.pageSize +
|
||||
"&projectId=" +
|
||||
app.globalData.useProjectId +
|
||||
"&useStatus=" +
|
||||
this.data.activeState +
|
||||
"&activeTags=finished&searchValue=magUsers";
|
||||
subusersList(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows),
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 统计数据列表
|
||||
*/
|
||||
getListCount() {
|
||||
let params =
|
||||
"pageNum=" +
|
||||
this.data.pageNum +
|
||||
"&pageSize=" +
|
||||
this.data.pageSize +
|
||||
"&projectId=" +
|
||||
app.globalData.useProjectId +
|
||||
"&activeTags=finished&searchValue=magUsers";
|
||||
subusersCount(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let _yrc = 0,
|
||||
_ylc = 0;
|
||||
res.data.forEach((item) => {
|
||||
if (item.useStatus == "0") {
|
||||
_yrc = item.total;
|
||||
} else {
|
||||
_ylc = item.total;
|
||||
}
|
||||
});
|
||||
this.setData({
|
||||
yrcCount: _yrc,
|
||||
ylcCount: _ylc,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 标签切换
|
||||
*/
|
||||
trainJump(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let nav = "";
|
||||
if (index == 1) {
|
||||
nav = "0";
|
||||
} else {
|
||||
nav = "1";
|
||||
}
|
||||
this.setData({
|
||||
activeState: nav,
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
listData: [],
|
||||
});
|
||||
this.getListData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到其它页面。*/
|
||||
wx.redirectTo({
|
||||
url: "../../project_more/index",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到底部
|
||||
*/
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1,
|
||||
});
|
||||
this.getListData();
|
||||
} else {
|
||||
console.log("已经到底了,没有数据可加载!!!");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<van-row>
|
||||
<van-col span="4">
|
||||
<view class="header_img" bindtap="returnToPage">
|
||||
<image src="/images/left.png"></image>
|
||||
<image src="../../../images/left.png"></image>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="15">
|
||||
|
|
@ -47,13 +47,13 @@
|
|||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{imgBaseUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
|
||||
<view style="padding-top: 22rpx;">
|
||||
<image src="/images/new_add.png"></image>
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -61,19 +61,19 @@
|
|||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{imgBaseUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{addDraftFlag}}" class="inspect_add_to_darft" bindtap="skipAddDarft">
|
||||
<view style="padding-top: 22rpx;">
|
||||
<image src="/images/new_add.png"></image>
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>草稿</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
|
||||
<view style="padding-top: 22rpx;">
|
||||
<image src="/images/new_add.png"></image>
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<van-row>
|
||||
<van-col span="4">
|
||||
<view class="header_img" bindtap="XMGK">
|
||||
<image src="/images/left.png"></image>
|
||||
<image src="../../../images/left.png"></image>
|
||||
<text class="header_fh">返回</text>
|
||||
</view>
|
||||
</van-col>
|
||||
|
|
@ -49,13 +49,13 @@
|
|||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{imgBaseUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_add_to_copy" bindtap="skipAdd">
|
||||
<view style="padding-top: 22rpx;">
|
||||
<image src="/images/new_add.png"></image>
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -64,28 +64,28 @@
|
|||
|
||||
<van-tabbar wx:if="{{subDeptUserInfo.subDeptType=='1'}}" active="{{ active }}" bind:change="onChange" active-color="#ffffff" inactive-color="#7d95d6">
|
||||
<van-tabbar-item bindtap="XMGK">
|
||||
<image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon" src="../../../images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon-active" src="../../../images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
项目概况
|
||||
</van-tabbar-item>
|
||||
|
||||
<van-tabbar-item>
|
||||
<image slot="icon" src="/images/footer_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon-active" src="/images/foot_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon" src="../../../images/footer_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon-active" src="../../../images/foot_7.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
安全管理
|
||||
<span class="tabNum" wx:if="{{aqglDB>0}}">{{aqglDB}}</span>
|
||||
</van-tabbar-item>
|
||||
|
||||
<van-tabbar-item bindtap="ZLGL">
|
||||
<image slot="icon" src="/images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon-active" src="/images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon" src="../../../images/footer_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon-active" src="../../../images/foot_5.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
质量管理
|
||||
<span class="tabNum" wx:if="{{zlglDB>0}}">{{zlglDB}}</span>
|
||||
</van-tabbar-item>
|
||||
|
||||
<van-tabbar-item bindtap="JDGL">
|
||||
<image slot="icon" src="/images/footer_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon-active" src="/images/foot_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon" src="../../../images/footer_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
<image slot="icon-active" src="../../../images/foot_6.png" mode="aspectFit" style="width:40rpx; height: 40rpx;" />
|
||||
进度管理
|
||||
</van-tabbar-item>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,220 +1,218 @@
|
|||
import {
|
||||
getToken
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
subdeptsList,
|
||||
subdeptsCount
|
||||
} from '../../../api/project'
|
||||
const app = getApp()
|
||||
import config from "../../../config";
|
||||
import { getToken } from "../../../utils/auth";
|
||||
import { subdeptsList, subdeptsCount } from "../../../api/project";
|
||||
const app = getApp();
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
addFlag: false,
|
||||
initData: {},
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
listData: [],
|
||||
activeState: "0",
|
||||
yrcCount: 0,
|
||||
ylcCount: 0,
|
||||
imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
addFlag: false,
|
||||
initData: {},
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
total: 0,
|
||||
listData: [],
|
||||
activeState: "0",
|
||||
yrcCount: 0,
|
||||
ylcCount: 0
|
||||
},
|
||||
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: '../../../pages/login/login',
|
||||
})
|
||||
}
|
||||
this.setData({
|
||||
addFlag: true,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
listData: [],
|
||||
total: 0
|
||||
});
|
||||
//获取数据列表
|
||||
this.getListData();
|
||||
this.getListCount();
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加按钮
|
||||
*/
|
||||
skipAdd() {
|
||||
wx.redirectTo({
|
||||
url: `../add/index`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param {*} e
|
||||
*/
|
||||
getInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${_id}`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改按钮
|
||||
* @param {*} e
|
||||
*/
|
||||
editInfo(e){
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../add/index?id=${_id}`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
getListData() {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished";
|
||||
subdeptsList(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows)
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 统计数据列表
|
||||
*/
|
||||
getListCount() {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished";
|
||||
subdeptsCount(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
let _yrc = 0,
|
||||
_ylc = 0;
|
||||
res.data.forEach(item => {
|
||||
if (item.useStatus == "0") {
|
||||
_yrc = item.total;
|
||||
} else {
|
||||
_ylc = item.total;
|
||||
}
|
||||
});
|
||||
this.setData({
|
||||
yrcCount: _yrc,
|
||||
ylcCount: _ylc
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 标签切换
|
||||
*/
|
||||
trainJump(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let nav = "";
|
||||
if (index == 1) {
|
||||
nav = '0';
|
||||
} else {
|
||||
nav = '1';
|
||||
}
|
||||
this.setData({
|
||||
activeState: nav,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
listData: [],
|
||||
});
|
||||
this.getListData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到其它页面。*/
|
||||
wx.redirectTo({
|
||||
url: '../../project_more/index',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到底部
|
||||
*/
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1
|
||||
});
|
||||
this.getListData();
|
||||
} else {
|
||||
console.log("已经到底了,没有数据可加载!!!");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: "../../../pages/login/login",
|
||||
});
|
||||
}
|
||||
})
|
||||
this.setData({
|
||||
addFlag: true,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
listData: [],
|
||||
total: 0,
|
||||
});
|
||||
//获取数据列表
|
||||
this.getListData();
|
||||
this.getListCount();
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加按钮
|
||||
*/
|
||||
skipAdd() {
|
||||
wx.redirectTo({
|
||||
url: `../add/index`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param {*} e
|
||||
*/
|
||||
getInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${_id}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改按钮
|
||||
* @param {*} e
|
||||
*/
|
||||
editInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../add/index?id=${_id}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
getListData() {
|
||||
let params =
|
||||
"pageNum=" +
|
||||
this.data.pageNum +
|
||||
"&pageSize=" +
|
||||
this.data.pageSize +
|
||||
"&projectId=" +
|
||||
app.globalData.useProjectId +
|
||||
"&useStatus=" +
|
||||
this.data.activeState +
|
||||
"&activeTags=finished";
|
||||
subdeptsList(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows),
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 统计数据列表
|
||||
*/
|
||||
getListCount() {
|
||||
let params =
|
||||
"pageNum=" +
|
||||
this.data.pageNum +
|
||||
"&pageSize=" +
|
||||
this.data.pageSize +
|
||||
"&projectId=" +
|
||||
app.globalData.useProjectId +
|
||||
"&activeTags=finished";
|
||||
subdeptsCount(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let _yrc = 0,
|
||||
_ylc = 0;
|
||||
res.data.forEach((item) => {
|
||||
if (item.useStatus == "0") {
|
||||
_yrc = item.total;
|
||||
} else {
|
||||
_ylc = item.total;
|
||||
}
|
||||
});
|
||||
this.setData({
|
||||
yrcCount: _yrc,
|
||||
ylcCount: _ylc,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 标签切换
|
||||
*/
|
||||
trainJump(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let nav = "";
|
||||
if (index == 1) {
|
||||
nav = "0";
|
||||
} else {
|
||||
nav = "1";
|
||||
}
|
||||
this.setData({
|
||||
activeState: nav,
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
listData: [],
|
||||
});
|
||||
this.getListData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到其它页面。*/
|
||||
wx.redirectTo({
|
||||
url: "../../project_more/index",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到底部
|
||||
*/
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1,
|
||||
});
|
||||
this.getListData();
|
||||
} else {
|
||||
console.log("已经到底了,没有数据可加载!!!");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<van-row>
|
||||
<van-col span="4">
|
||||
<view class="header_img" bindtap="returnToPage">
|
||||
<image src="/images/left.png"></image>
|
||||
<image src="../../../images/left.png"></image>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="15">
|
||||
|
|
@ -44,13 +44,13 @@
|
|||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{imgBaseUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
|
||||
<view style="padding-top: 22rpx;">
|
||||
<image src="/images/new_add.png"></image>
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,230 +1,227 @@
|
|||
import {
|
||||
getToken,
|
||||
getUserInfo
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
subgroupsList,
|
||||
subgroupsCount
|
||||
} from '../../../api/project'
|
||||
const app = getApp()
|
||||
import config from "../../../config";
|
||||
import { getToken, getUserInfo } from "../../../utils/auth";
|
||||
import { subgroupsList, subgroupsCount } from "../../../api/project";
|
||||
const app = getApp();
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
addFlag: false,
|
||||
initData: {},
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
listData: [],
|
||||
activeState: "0",
|
||||
yrcCount: 0,
|
||||
ylcCount: 0,
|
||||
userInfo: {},
|
||||
imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
addFlag: false,
|
||||
initData: {},
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
total: 0,
|
||||
listData: [],
|
||||
activeState: "0",
|
||||
yrcCount: 0,
|
||||
ylcCount: 0,
|
||||
userInfo:{}
|
||||
},
|
||||
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: '../../../pages/login/login',
|
||||
})
|
||||
}
|
||||
const proUserInfo = getUserInfo();
|
||||
this.setData({
|
||||
addFlag: proUserInfo.projectUserInfo.subDeptType=='1'?true:false,
|
||||
userInfo: proUserInfo.projectUserInfo,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
listData: [],
|
||||
total: 0
|
||||
});
|
||||
//获取数据列表
|
||||
this.getListData(proUserInfo.projectUserInfo);
|
||||
this.getListCount(proUserInfo.projectUserInfo);
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加按钮
|
||||
*/
|
||||
skipAdd() {
|
||||
wx.redirectTo({
|
||||
url: `../add/index`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param {*} e
|
||||
*/
|
||||
getInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${_id}`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改按钮
|
||||
* @param {*} e
|
||||
*/
|
||||
editInfo(e){
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../add/index?id=${_id}`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
getListData(_userInfo) {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished";
|
||||
if(_userInfo.subDeptType && _userInfo.subDeptType!='1'){
|
||||
params += "&subDeptId="+_userInfo.subDeptId;
|
||||
}
|
||||
subgroupsList(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows)
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 统计数据列表
|
||||
*/
|
||||
getListCount(_userInfo) {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished";
|
||||
if(_userInfo.subDeptType && _userInfo.subDeptType!='1'){
|
||||
params += "&subDeptId="+_userInfo.subDeptId;
|
||||
}
|
||||
subgroupsCount(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
let _yrc = 0,
|
||||
_ylc = 0;
|
||||
res.data.forEach(item => {
|
||||
if (item.useStatus == "0") {
|
||||
_yrc = item.total;
|
||||
} else {
|
||||
_ylc = item.total;
|
||||
}
|
||||
});
|
||||
this.setData({
|
||||
yrcCount: _yrc,
|
||||
ylcCount: _ylc
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 标签切换
|
||||
*/
|
||||
trainJump(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let nav = "";
|
||||
if (index == 1) {
|
||||
nav = '0';
|
||||
} else {
|
||||
nav = '1';
|
||||
}
|
||||
this.setData({
|
||||
activeState: nav,
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
listData: [],
|
||||
});
|
||||
this.getListData(this.data.userInfo);
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到其它页面。*/
|
||||
wx.redirectTo({
|
||||
url: '../../project_more/index',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到底部
|
||||
*/
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1
|
||||
});
|
||||
this.getListData(this.data.userInfo);
|
||||
} else {
|
||||
console.log("已经到底了,没有数据可加载!!!");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: "../../../pages/login/login",
|
||||
});
|
||||
}
|
||||
})
|
||||
const proUserInfo = getUserInfo();
|
||||
this.setData({
|
||||
addFlag: proUserInfo.projectUserInfo.subDeptType == "1" ? true : false,
|
||||
userInfo: proUserInfo.projectUserInfo,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
listData: [],
|
||||
total: 0,
|
||||
});
|
||||
//获取数据列表
|
||||
this.getListData(proUserInfo.projectUserInfo);
|
||||
this.getListCount(proUserInfo.projectUserInfo);
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加按钮
|
||||
*/
|
||||
skipAdd() {
|
||||
wx.redirectTo({
|
||||
url: `../add/index`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param {*} e
|
||||
*/
|
||||
getInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${_id}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改按钮
|
||||
* @param {*} e
|
||||
*/
|
||||
editInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../add/index?id=${_id}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
getListData(_userInfo) {
|
||||
let params =
|
||||
"pageNum=" +
|
||||
this.data.pageNum +
|
||||
"&pageSize=" +
|
||||
this.data.pageSize +
|
||||
"&projectId=" +
|
||||
app.globalData.useProjectId +
|
||||
"&useStatus=" +
|
||||
this.data.activeState +
|
||||
"&activeTags=finished";
|
||||
if (_userInfo.subDeptType && _userInfo.subDeptType != "1") {
|
||||
params += "&subDeptId=" + _userInfo.subDeptId;
|
||||
}
|
||||
subgroupsList(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows),
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 统计数据列表
|
||||
*/
|
||||
getListCount(_userInfo) {
|
||||
let params =
|
||||
"pageNum=" +
|
||||
this.data.pageNum +
|
||||
"&pageSize=" +
|
||||
this.data.pageSize +
|
||||
"&projectId=" +
|
||||
app.globalData.useProjectId +
|
||||
"&activeTags=finished";
|
||||
if (_userInfo.subDeptType && _userInfo.subDeptType != "1") {
|
||||
params += "&subDeptId=" + _userInfo.subDeptId;
|
||||
}
|
||||
subgroupsCount(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let _yrc = 0,
|
||||
_ylc = 0;
|
||||
res.data.forEach((item) => {
|
||||
if (item.useStatus == "0") {
|
||||
_yrc = item.total;
|
||||
} else {
|
||||
_ylc = item.total;
|
||||
}
|
||||
});
|
||||
this.setData({
|
||||
yrcCount: _yrc,
|
||||
ylcCount: _ylc,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 标签切换
|
||||
*/
|
||||
trainJump(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let nav = "";
|
||||
if (index == 1) {
|
||||
nav = "0";
|
||||
} else {
|
||||
nav = "1";
|
||||
}
|
||||
this.setData({
|
||||
activeState: nav,
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
listData: [],
|
||||
});
|
||||
this.getListData(this.data.userInfo);
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到其它页面。*/
|
||||
wx.redirectTo({
|
||||
url: "../../project_more/index",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到底部
|
||||
*/
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1,
|
||||
});
|
||||
this.getListData(this.data.userInfo);
|
||||
} else {
|
||||
console.log("已经到底了,没有数据可加载!!!");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<van-row>
|
||||
<van-col span="4">
|
||||
<view class="header_img" bindtap="returnToPage">
|
||||
<image src="/images/left.png"></image>
|
||||
<image src="../../../images/left.png"></image>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="15">
|
||||
|
|
@ -41,13 +41,13 @@
|
|||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{imgBaseUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
|
||||
<view style="padding-top: 22rpx;">
|
||||
<image src="/images/new_add.png"></image>
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,238 +1,235 @@
|
|||
import {
|
||||
getToken,
|
||||
getUserInfo
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
subusersList,
|
||||
subusersCount
|
||||
} from '../../../api/project'
|
||||
const app = getApp()
|
||||
import config from "../../../config";
|
||||
import { getToken, getUserInfo } from "../../../utils/auth";
|
||||
import { subusersList, subusersCount } from "../../../api/project";
|
||||
const app = getApp();
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
addFlag: false,
|
||||
initData: {},
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
total: 0,
|
||||
listData: [],
|
||||
activeState: "0",
|
||||
yrcCount: 0,
|
||||
ylcCount: 0,
|
||||
activeName: "",
|
||||
userInfo: {},
|
||||
imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
addFlag: false,
|
||||
initData: {},
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
total: 0,
|
||||
listData: [],
|
||||
activeState: "0",
|
||||
yrcCount: 0,
|
||||
ylcCount: 0,
|
||||
activeName: "",
|
||||
userInfo:{}
|
||||
},
|
||||
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: '../../../pages/login/login',
|
||||
})
|
||||
}
|
||||
const proUserInfo = getUserInfo();
|
||||
this.setData({
|
||||
addFlag: proUserInfo.projectUserInfo.subDeptType=='1'?true:false,
|
||||
userInfo: proUserInfo.projectUserInfo,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
listData: [],
|
||||
total: 0
|
||||
});
|
||||
//获取数据列表
|
||||
this.getListData(proUserInfo.projectUserInfo);
|
||||
this.getListCount(proUserInfo.projectUserInfo);
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加按钮
|
||||
*/
|
||||
skipAdd() {
|
||||
wx.redirectTo({
|
||||
url: `../add/index`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param {*} e
|
||||
*/
|
||||
getInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${_id}`,
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改按钮
|
||||
* @param {*} e
|
||||
*/
|
||||
editInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../add/index?id=${_id}`,
|
||||
})
|
||||
},
|
||||
|
||||
// 手风琴
|
||||
onChange(e) {
|
||||
this.setData({
|
||||
activeName: e.target.dataset.set
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
getListData(_userInfo) {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&useStatus=" + this.data.activeState + "&activeTags=finished&searchValue=subUsers";
|
||||
if(_userInfo.subDeptType && _userInfo.subDeptType!='1'){
|
||||
params += "&subDeptId="+_userInfo.subDeptId;
|
||||
}
|
||||
subusersList(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows)
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 统计数据列表
|
||||
*/
|
||||
getListCount(_userInfo) {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId + "&activeTags=finished&searchValue=subUsers";
|
||||
if(_userInfo.subDeptType && _userInfo.subDeptType!='1'){
|
||||
params += "&subDeptId="+_userInfo.subDeptId;
|
||||
}
|
||||
subusersCount(params).then(res => {
|
||||
if (res.code == 200) {
|
||||
let _yrc = 0,
|
||||
_ylc = 0;
|
||||
res.data.forEach(item => {
|
||||
if (item.useStatus == "0") {
|
||||
_yrc = item.total;
|
||||
} else {
|
||||
_ylc = item.total;
|
||||
}
|
||||
});
|
||||
this.setData({
|
||||
yrcCount: _yrc,
|
||||
ylcCount: _ylc
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 标签切换
|
||||
*/
|
||||
trainJump(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let nav = "";
|
||||
if (index == 1) {
|
||||
nav = '0';
|
||||
} else {
|
||||
nav = '1';
|
||||
}
|
||||
this.setData({
|
||||
activeState: nav,
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
listData: [],
|
||||
});
|
||||
this.getListData(this.data.userInfo);
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到其它页面。*/
|
||||
wx.redirectTo({
|
||||
url: '../../project_more/index',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到底部
|
||||
*/
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1
|
||||
});
|
||||
this.getListData(this.data.userInfo);
|
||||
} else {
|
||||
console.log("已经到底了,没有数据可加载!!!");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: "../../../pages/login/login",
|
||||
});
|
||||
}
|
||||
})
|
||||
const proUserInfo = getUserInfo();
|
||||
this.setData({
|
||||
addFlag: proUserInfo.projectUserInfo.subDeptType == "1" ? true : false,
|
||||
userInfo: proUserInfo.projectUserInfo,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
listData: [],
|
||||
total: 0,
|
||||
});
|
||||
//获取数据列表
|
||||
this.getListData(proUserInfo.projectUserInfo);
|
||||
this.getListCount(proUserInfo.projectUserInfo);
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加按钮
|
||||
*/
|
||||
skipAdd() {
|
||||
wx.redirectTo({
|
||||
url: `../add/index`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取详情
|
||||
* @param {*} e
|
||||
*/
|
||||
getInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${_id}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改按钮
|
||||
* @param {*} e
|
||||
*/
|
||||
editInfo(e) {
|
||||
let _id = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../add/index?id=${_id}`,
|
||||
});
|
||||
},
|
||||
|
||||
// 手风琴
|
||||
onChange(e) {
|
||||
this.setData({
|
||||
activeName: e.target.dataset.set,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
getListData(_userInfo) {
|
||||
let params =
|
||||
"pageNum=" +
|
||||
this.data.pageNum +
|
||||
"&pageSize=" +
|
||||
this.data.pageSize +
|
||||
"&projectId=" +
|
||||
app.globalData.useProjectId +
|
||||
"&useStatus=" +
|
||||
this.data.activeState +
|
||||
"&activeTags=finished&searchValue=subUsers";
|
||||
if (_userInfo.subDeptType && _userInfo.subDeptType != "1") {
|
||||
params += "&subDeptId=" + _userInfo.subDeptId;
|
||||
}
|
||||
subusersList(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows),
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 统计数据列表
|
||||
*/
|
||||
getListCount(_userInfo) {
|
||||
let params =
|
||||
"pageNum=" +
|
||||
this.data.pageNum +
|
||||
"&pageSize=" +
|
||||
this.data.pageSize +
|
||||
"&projectId=" +
|
||||
app.globalData.useProjectId +
|
||||
"&activeTags=finished&searchValue=subUsers";
|
||||
if (_userInfo.subDeptType && _userInfo.subDeptType != "1") {
|
||||
params += "&subDeptId=" + _userInfo.subDeptId;
|
||||
}
|
||||
subusersCount(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
let _yrc = 0,
|
||||
_ylc = 0;
|
||||
res.data.forEach((item) => {
|
||||
if (item.useStatus == "0") {
|
||||
_yrc = item.total;
|
||||
} else {
|
||||
_ylc = item.total;
|
||||
}
|
||||
});
|
||||
this.setData({
|
||||
yrcCount: _yrc,
|
||||
ylcCount: _ylc,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 标签切换
|
||||
*/
|
||||
trainJump(e) {
|
||||
let index = e.currentTarget.dataset.index;
|
||||
let nav = "";
|
||||
if (index == 1) {
|
||||
nav = "0";
|
||||
} else {
|
||||
nav = "1";
|
||||
}
|
||||
this.setData({
|
||||
activeState: nav,
|
||||
pageNum: 1,
|
||||
pageSize: 10000,
|
||||
listData: [],
|
||||
});
|
||||
this.getListData(this.data.userInfo);
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {},
|
||||
|
||||
returnToPage: function () {
|
||||
/*关闭当前页面,跳转到其它页面。*/
|
||||
wx.redirectTo({
|
||||
url: "../../project_more/index",
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 滚动到底部
|
||||
*/
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1,
|
||||
});
|
||||
this.getListData(this.data.userInfo);
|
||||
} else {
|
||||
console.log("已经到底了,没有数据可加载!!!");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<van-row>
|
||||
<van-col span="4">
|
||||
<view class="header_img" bindtap="returnToPage">
|
||||
<image src="/images/left.png"></image>
|
||||
<image src="../../../images/left.png"></image>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="15">
|
||||
|
|
@ -47,13 +47,13 @@
|
|||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{imgBaseUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
<view wx:if="{{addFlag}}" class="inspect_add_to" bindtap="skipAdd">
|
||||
<view style="padding-top: 22rpx;">
|
||||
<image src="/images/new_add.png"></image>
|
||||
<image src="../../../images/new_add.png"></image>
|
||||
<view>新增</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,12 +1,8 @@
|
|||
import {
|
||||
getToken
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
proVideoList
|
||||
} from '../../../api/project'
|
||||
const app = getApp()
|
||||
import config from "../../../config";
|
||||
import { getToken } from "../../../utils/auth";
|
||||
import { proVideoList } from "../../../api/project";
|
||||
const app = getApp();
|
||||
Page({
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
|
|
@ -16,6 +12,7 @@ Page({
|
|||
pageSize: 10,
|
||||
total: 0,
|
||||
listData: [],
|
||||
imgBaseUrl: config.baseImgUrl, // 添加 imgBaseUrl
|
||||
},
|
||||
|
||||
//项目切换 返回值
|
||||
|
|
@ -33,8 +30,8 @@ Page({
|
|||
onLoad(options) {
|
||||
if (!getToken()) {
|
||||
wx.redirectTo({
|
||||
url: '../../../pages/login/login',
|
||||
})
|
||||
url: "../../../pages/login/login",
|
||||
});
|
||||
}
|
||||
this.setData({
|
||||
initData: {
|
||||
|
|
@ -44,37 +41,39 @@ Page({
|
|||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
listData: [],
|
||||
total: 0
|
||||
total: 0,
|
||||
});
|
||||
this.getListData();
|
||||
},
|
||||
|
||||
/**
|
||||
* 播放视频
|
||||
* @param {*} e
|
||||
* @param {*} e
|
||||
*/
|
||||
videoPlay(e) {
|
||||
let {
|
||||
id,
|
||||
url,
|
||||
secret
|
||||
} = e.currentTarget.dataset.set
|
||||
let { id, url, secret } = e.currentTarget.dataset.set;
|
||||
wx.redirectTo({
|
||||
url: `../info/index?id=${id}&url=${url}&token=${secret}`,
|
||||
})
|
||||
url: `../info/index?id=${id}&url=${url}&token=${secret}`,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 查询数据列表
|
||||
*/
|
||||
getListData() {
|
||||
let params = "pageNum=" + this.data.pageNum + "&pageSize=" + this.data.pageSize + "&projectId=" + app.globalData.useProjectId;
|
||||
proVideoList(params).then(res => {
|
||||
let params =
|
||||
"pageNum=" +
|
||||
this.data.pageNum +
|
||||
"&pageSize=" +
|
||||
this.data.pageSize +
|
||||
"&projectId=" +
|
||||
app.globalData.useProjectId;
|
||||
proVideoList(params).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
total: res.total,
|
||||
listData: this.data.listData.concat(res.rows)
|
||||
})
|
||||
listData: this.data.listData.concat(res.rows),
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
|
@ -82,28 +81,24 @@ Page({
|
|||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
onReady() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
onShow() {},
|
||||
|
||||
returnToPage: function () {
|
||||
wx.redirectTo({
|
||||
url: '../../project_safety/index',
|
||||
})
|
||||
url: "../../project_safety/index",
|
||||
});
|
||||
},
|
||||
|
||||
onScrollToLower() {
|
||||
let nal = Math.ceil(this.data.total / this.data.pageSize);
|
||||
if (this.data.pageNum < nal) {
|
||||
this.setData({
|
||||
pageNum: this.data.pageNum + 1
|
||||
pageNum: this.data.pageNum + 1,
|
||||
});
|
||||
this.getListData();
|
||||
} else {
|
||||
|
|
@ -114,35 +109,25 @@ Page({
|
|||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
onPullDownRefresh() {},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
}
|
||||
})
|
||||
onShareAppMessage() {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
<van-row>
|
||||
<van-col span="4">
|
||||
<view class="header_img" bindtap="returnToPage">
|
||||
<image src="/images/left.png"></image>
|
||||
<image src="../../../images/left.png"></image>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="15">
|
||||
|
|
@ -30,8 +30,8 @@
|
|||
<view class="inspect_list_info">
|
||||
<view class="inspect_list_info_details">
|
||||
<view class="video-imgage-container" data-set="{{item}}" bindtap="videoPlay">
|
||||
<image class="video-image" src="https://xiangguan.sxyanzhu.com/profile/static/images/video_bg.png"/>
|
||||
<image class="video-play" src="https://xiangguan.sxyanzhu.com/profile/static/images/home_play.png" alt="play"/>
|
||||
<image class="video-image" src="{{imgBaseUrl}}/profile/static/images/video_bg.png"/>
|
||||
<image class="video-play" src="{{imgBaseUrl}}/profile/static/images/home_play.png" alt="play"/>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
</view>
|
||||
<view wx:if="{{listData.length==0}}">
|
||||
<view style="padding-top: 70px;text-align: -webkit-center;">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<image src="{{imgBaseUrl}}/cdn/appimgs/nodata.png" style="width: 130px;height: 105px;"></image>
|
||||
<view style="color: #a5abbb;">暂无数据</view>
|
||||
</view>
|
||||
</view>
|
||||
|
|
|
|||
|
|
@ -1,181 +1,161 @@
|
|||
import config from '../../config'
|
||||
import {
|
||||
getToken
|
||||
} from '../../utils/auth'
|
||||
import {
|
||||
submitUserSign,
|
||||
findUserSignList
|
||||
} from '../../api/publics'
|
||||
import {
|
||||
securitySignFileUpload
|
||||
} from '../../utils/request'
|
||||
const app = getApp()
|
||||
import config from "../../config";
|
||||
import { getToken } from "../../utils/auth";
|
||||
import { submitUserSign, findUserSignList } from "../../api/publics";
|
||||
import { securitySignFileUpload } from "../../utils/request";
|
||||
const app = getApp();
|
||||
Page({
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
projectId: "",
|
||||
projectName: "",
|
||||
initData: {},
|
||||
signData: {
|
||||
id: null,
|
||||
signetPath: null,
|
||||
},
|
||||
signPath: "",
|
||||
imgBaseUrl: config.baseImgUrl,
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
projectId: '',
|
||||
projectName: '',
|
||||
initData: {},
|
||||
signData: {
|
||||
id: null,
|
||||
signetPath: null
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (getToken()) {
|
||||
this.setData({
|
||||
projectId: app.globalData.useProjectId,
|
||||
projectName: app.globalData.useProjectName,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
},
|
||||
signPath: '',
|
||||
imgBaseUrl: config.baseImgUrl
|
||||
},
|
||||
|
||||
//项目切换 返回值
|
||||
onProjectSelect(e) {
|
||||
let projectId = e.detail.id;
|
||||
let projectName = e.detail.text;
|
||||
app.globalData.useProjectId = projectId;
|
||||
app.globalData.useProjectName = projectName;
|
||||
this.onLoad();
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
if (getToken()) {
|
||||
this.setData({
|
||||
projectId: app.globalData.useProjectId,
|
||||
projectName: app.globalData.useProjectName,
|
||||
initData: {
|
||||
id: app.globalData.useProjectId,
|
||||
text: app.globalData.useProjectName,
|
||||
}
|
||||
});
|
||||
this.getUserSignList(app.globalData.useProjectId);
|
||||
} else {
|
||||
console.log("未查询到Token...{}...准备重新登录")
|
||||
wx.redirectTo({
|
||||
url: '../../pages/login/login',
|
||||
})
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取签名
|
||||
* @param {*} proId
|
||||
*/
|
||||
getUserSignList(proId) {
|
||||
findUserSignList(proId).then(res => {
|
||||
if (res.code == 200 && res.data.length > 0) {
|
||||
this.setData({
|
||||
signData: res.data[0]
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认签名
|
||||
*/
|
||||
sign(e) {
|
||||
let tempFilePath = e.detail
|
||||
securitySignFileUpload(tempFilePath).then(res => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
signPath: res.data.url
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认修改签名
|
||||
*/
|
||||
submitSign() {
|
||||
let {
|
||||
projectId,
|
||||
signPath,
|
||||
signData
|
||||
} = this.data;
|
||||
//数据效验
|
||||
if (!projectId) {
|
||||
app.toast("信息异常...请刷新后重试!");
|
||||
return false;
|
||||
}
|
||||
if (!signPath) {
|
||||
app.toast("还未完成签名或修改,请签名后再试!");
|
||||
return false;
|
||||
}
|
||||
let param = {
|
||||
id: signData.id,
|
||||
projectId: projectId,
|
||||
signetPath: signPath
|
||||
}
|
||||
submitUserSign(param).then(res => {
|
||||
if (res.code == 200) {
|
||||
app.toast("保存签名成功!")
|
||||
setTimeout(() => {
|
||||
wx.redirectTo({
|
||||
url: '../project_more/index',
|
||||
})
|
||||
}, 200)
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回上级页面
|
||||
*/
|
||||
BACK() {
|
||||
wx.redirectTo({
|
||||
url: '../project_more/index',
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {
|
||||
|
||||
},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
});
|
||||
this.getUserSignList(app.globalData.useProjectId);
|
||||
} else {
|
||||
console.log("未查询到Token...{}...准备重新登录");
|
||||
wx.redirectTo({
|
||||
url: "../../pages/login/login",
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 获取签名
|
||||
* @param {*} proId
|
||||
*/
|
||||
getUserSignList(proId) {
|
||||
findUserSignList(proId).then((res) => {
|
||||
if (res.code == 200 && res.data.length > 0) {
|
||||
this.setData({
|
||||
signData: res.data[0],
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认签名
|
||||
*/
|
||||
sign(e) {
|
||||
let tempFilePath = e.detail;
|
||||
securitySignFileUpload(tempFilePath).then((res) => {
|
||||
if (res.code == 200) {
|
||||
this.setData({
|
||||
signPath: res.data.url,
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 确认修改签名
|
||||
*/
|
||||
submitSign() {
|
||||
let { projectId, signPath, signData } = this.data;
|
||||
//数据效验
|
||||
if (!projectId) {
|
||||
app.toast("信息异常...请刷新后重试!");
|
||||
return false;
|
||||
}
|
||||
if (!signPath) {
|
||||
app.toast("还未完成签名或修改,请签名后再试!");
|
||||
return false;
|
||||
}
|
||||
let param = {
|
||||
id: signData.id,
|
||||
projectId: projectId,
|
||||
signetPath: signPath,
|
||||
};
|
||||
submitUserSign(param).then((res) => {
|
||||
if (res.code == 200) {
|
||||
app.toast("保存签名成功!");
|
||||
setTimeout(() => {
|
||||
wx.redirectTo({
|
||||
url: "../project_more/index",
|
||||
});
|
||||
}, 200);
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 返回上级页面
|
||||
*/
|
||||
BACK() {
|
||||
if (wx.getStorageSync("nav-menu") == "prjInfo") {
|
||||
wx.redirectTo({
|
||||
url: "../project_info/index",
|
||||
});
|
||||
} else {
|
||||
wx.redirectTo({
|
||||
url: "../project_more/index",
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
*/
|
||||
onReady() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
onHide() {},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面卸载
|
||||
*/
|
||||
onUnload() {},
|
||||
|
||||
/**
|
||||
* 页面相关事件处理函数--监听用户下拉动作
|
||||
*/
|
||||
onPullDownRefresh() {},
|
||||
|
||||
/**
|
||||
* 页面上拉触底事件的处理函数
|
||||
*/
|
||||
onReachBottom() {},
|
||||
|
||||
/**
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,210 +1,197 @@
|
|||
import {
|
||||
removeToken
|
||||
} from '../../../utils/auth'
|
||||
import {
|
||||
loginOut,
|
||||
updatePwd,
|
||||
findOpenUserMsgId
|
||||
} from '../../../api/login'
|
||||
|
||||
const app = getApp()
|
||||
import { removeToken } from "../../../utils/auth";
|
||||
import { loginOut, updatePwd, findOpenUserMsgId } from "../../../api/login";
|
||||
import cfg from "../../../config";
|
||||
const app = getApp();
|
||||
Component({
|
||||
/**数据监听 */
|
||||
observers: {},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
show: false,
|
||||
userData: {},
|
||||
resPas: false,
|
||||
oldPsw: '',
|
||||
newPsw: '',
|
||||
password: '',
|
||||
showOldPass: true,
|
||||
showNewPass: true,
|
||||
showPassWord: true,
|
||||
binding: false,
|
||||
msgOpenId: "",
|
||||
},
|
||||
/**数据监听 */
|
||||
observers: {},
|
||||
/**
|
||||
* 组件的初始数据
|
||||
*/
|
||||
data: {
|
||||
show: false,
|
||||
userData: {},
|
||||
resPas: false,
|
||||
oldPsw: "",
|
||||
newPsw: "",
|
||||
password: "",
|
||||
showOldPass: true,
|
||||
showNewPass: true,
|
||||
showPassWord: true,
|
||||
binding: false,
|
||||
msgOpenId: "",
|
||||
baseImgUrl: cfg.baseImgUrl,
|
||||
},
|
||||
|
||||
created() {
|
||||
this.setData({
|
||||
userData: app.globalData.userData,
|
||||
loginName: app.globalData.userData.userName,
|
||||
msgOpenId: "",
|
||||
})
|
||||
},
|
||||
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
loadUserInfo() {
|
||||
let that = this;
|
||||
//获取缓存数据
|
||||
wx.getStorage({
|
||||
key: 'userinfo',
|
||||
success: function (res) {
|
||||
findOpenUserMsgId(res.data.openId).then(vo => {
|
||||
if (vo.code == 200 && vo.data) {
|
||||
res.data.msgOpenId = vo.data.msgOpenId;
|
||||
wx.setStorage({
|
||||
key: 'userinfo',
|
||||
data: res.data
|
||||
});
|
||||
that.setData({
|
||||
show: true,
|
||||
userData: res.data,
|
||||
loginName: res.data.loginName,
|
||||
msgOpenId: res.data.msgOpenId || "",
|
||||
})
|
||||
}
|
||||
});
|
||||
}
|
||||
})
|
||||
},
|
||||
created() {
|
||||
this.setData({
|
||||
userData: app.globalData.userData,
|
||||
loginName: app.globalData.userData.userName,
|
||||
msgOpenId: "",
|
||||
});
|
||||
},
|
||||
|
||||
showPopup() {
|
||||
this.setData({
|
||||
show: true
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 组件的方法列表
|
||||
*/
|
||||
methods: {
|
||||
loadUserInfo() {
|
||||
let that = this;
|
||||
//获取缓存数据
|
||||
wx.getStorage({
|
||||
key: "userinfo",
|
||||
success: function (res) {
|
||||
findOpenUserMsgId(res.data.openId).then((vo) => {
|
||||
if (vo.code == 200 && vo.data) {
|
||||
res.data.msgOpenId = vo.data.msgOpenId;
|
||||
wx.setStorage({
|
||||
key: "userinfo",
|
||||
data: res.data,
|
||||
});
|
||||
that.setData({
|
||||
show: true,
|
||||
userData: res.data,
|
||||
loginName: res.data.loginName,
|
||||
msgOpenId: res.data.msgOpenId || "",
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 关闭用户详情
|
||||
*/
|
||||
closePopup() {
|
||||
this.setData({
|
||||
show: false
|
||||
});
|
||||
},
|
||||
showPopup() {
|
||||
this.setData({
|
||||
show: true,
|
||||
});
|
||||
},
|
||||
|
||||
//修改密码
|
||||
resPassword: function () {
|
||||
this.setData({
|
||||
resPas: true
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 关闭用户详情
|
||||
*/
|
||||
closePopup() {
|
||||
this.setData({
|
||||
show: false,
|
||||
});
|
||||
},
|
||||
|
||||
//绑定公众号
|
||||
binding: function () {
|
||||
app.initWxAuth();
|
||||
},
|
||||
//修改密码
|
||||
resPassword: function () {
|
||||
this.setData({
|
||||
resPas: true,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改密码返回
|
||||
*/
|
||||
closeResPas: function () {
|
||||
this.setData({
|
||||
resPas: false
|
||||
});
|
||||
},
|
||||
//绑定公众号
|
||||
binding: function () {
|
||||
app.initWxAuth();
|
||||
},
|
||||
|
||||
/**
|
||||
* 修改密码返回
|
||||
*/
|
||||
closeBinding: function () {
|
||||
this.setData({
|
||||
binding: false
|
||||
});
|
||||
},
|
||||
/**
|
||||
* 修改密码返回
|
||||
*/
|
||||
closeResPas: function () {
|
||||
this.setData({
|
||||
resPas: false,
|
||||
});
|
||||
},
|
||||
|
||||
bindingBuild: function () {
|
||||
wx.previewImage({
|
||||
urls: "https://szgcwx.jhncidg.com/staticFiles/qrv1.jpg".split(","),
|
||||
current: 0
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 修改密码返回
|
||||
*/
|
||||
closeBinding: function () {
|
||||
this.setData({
|
||||
binding: false,
|
||||
});
|
||||
},
|
||||
|
||||
//退出登录
|
||||
loginOut: function () {
|
||||
loginOut().then(res => {
|
||||
removeToken();
|
||||
wx.clearStorageSync();
|
||||
wx.navigateTo({
|
||||
url: '/pages/login/login'
|
||||
})
|
||||
});
|
||||
},
|
||||
bindingBuild: function () {
|
||||
wx.previewImage({
|
||||
urls: cfg.baseImgUrl + "/cdn/appimgs/qrv1.jpg".split(","),
|
||||
current: 0,
|
||||
});
|
||||
},
|
||||
|
||||
seeTap1() {
|
||||
let that = this;
|
||||
that.setData({
|
||||
// 切换图标
|
||||
showOldPass: !that.data.showOldPass
|
||||
})
|
||||
},
|
||||
//退出登录
|
||||
loginOut: function () {
|
||||
loginOut().then((res) => {
|
||||
removeToken();
|
||||
wx.clearStorageSync();
|
||||
wx.navigateTo({
|
||||
url: "/pages/login/login",
|
||||
});
|
||||
});
|
||||
},
|
||||
|
||||
seeTap2() {
|
||||
let that = this;
|
||||
that.setData({
|
||||
// 切换图标
|
||||
showNewPass: !that.data.showNewPass
|
||||
})
|
||||
},
|
||||
seeTap1() {
|
||||
let that = this;
|
||||
that.setData({
|
||||
// 切换图标
|
||||
showOldPass: !that.data.showOldPass,
|
||||
});
|
||||
},
|
||||
|
||||
seeTap3() {
|
||||
let that = this;
|
||||
that.setData({
|
||||
// 切换图标
|
||||
showPassWord: !that.data.showPassWord
|
||||
})
|
||||
if (that.data.newPsw != '' && that.data.newPsw != that.data.password) {
|
||||
app.toast("两次密码输入不一致!");
|
||||
}
|
||||
},
|
||||
seeTap2() {
|
||||
let that = this;
|
||||
that.setData({
|
||||
// 切换图标
|
||||
showNewPass: !that.data.showNewPass,
|
||||
});
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加预警信息
|
||||
*/
|
||||
submit: function () {
|
||||
var that = this;
|
||||
if (false && that.data.oldPsw == '') {
|
||||
app.toast("请输入旧密码!");
|
||||
return;
|
||||
}
|
||||
if (that.data.password == '') {
|
||||
app.toast("请确认新密码!");
|
||||
return;
|
||||
}
|
||||
if (that.data.newPsw != '' && that.data.newPsw != that.data.password) {
|
||||
app.toast("两次密码输入不一致!");
|
||||
return;
|
||||
}
|
||||
if (false && that.data.oldPsw.length < 6) {
|
||||
app.toast("请输入旧密码长度 [6-20]位字符!");
|
||||
return;
|
||||
}
|
||||
if (that.data.newPsw.length < 6) {
|
||||
app.toast("请输入新密码长度 [6-20]位字符!");
|
||||
return;
|
||||
}
|
||||
if (that.data.password.length < 6) {
|
||||
app.toast("请输入确认密码长度 [6-20]位字符!");
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
loginName: that.data.loginName,
|
||||
oldPass: that.data.oldPsw,
|
||||
password: that.data.newPsw,
|
||||
confPass: that.data.password,
|
||||
source: "u"
|
||||
}
|
||||
updatePwd(data).then(res => {
|
||||
if (res.code == 200) {
|
||||
app.toast("密码修改成功,请重新登录!", 800);
|
||||
loginOut().then(res => {
|
||||
removeToken();
|
||||
wx.clearStorageSync();
|
||||
setTimeout(() => {
|
||||
wx.redirectTo({
|
||||
url: '../login/login'
|
||||
});
|
||||
}, 500)
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
}
|
||||
})
|
||||
seeTap3() {
|
||||
let that = this;
|
||||
that.setData({
|
||||
// 切换图标
|
||||
showPassWord: !that.data.showPassWord,
|
||||
});
|
||||
if (that.data.newPsw != "" && that.data.newPsw != that.data.password) {
|
||||
app.toast("两次密码输入不一致!");
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 添加预警信息
|
||||
*/
|
||||
submit: function () {
|
||||
var that = this;
|
||||
if (that.data.password == "") {
|
||||
app.toast("请确认新密码!");
|
||||
return;
|
||||
}
|
||||
if (that.data.newPsw != "" && that.data.newPsw != that.data.password) {
|
||||
app.toast("两次密码输入不一致!");
|
||||
return;
|
||||
}
|
||||
if (that.data.newPsw.length < 6) {
|
||||
app.toast("请输入新密码长度 [6-20]位字符!");
|
||||
return;
|
||||
}
|
||||
if (that.data.password.length < 6) {
|
||||
app.toast("请输入确认密码长度 [6-20]位字符!");
|
||||
return;
|
||||
}
|
||||
let data = {
|
||||
loginName: that.data.loginName,
|
||||
oldPass: that.data.oldPsw,
|
||||
password: that.data.newPsw,
|
||||
confPass: that.data.password,
|
||||
source: "u",
|
||||
};
|
||||
updatePwd(data).then((res) => {
|
||||
if (res.code == 200) {
|
||||
app.toast("密码修改成功,请重新登录!", 800);
|
||||
loginOut().then((res) => {
|
||||
removeToken();
|
||||
wx.clearStorageSync();
|
||||
setTimeout(() => {
|
||||
wx.redirectTo({
|
||||
url: "../login/login",
|
||||
});
|
||||
}, 500);
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
<view class="header_img" bindtap="showPopup">
|
||||
<image src="/images/foot_3.png"></image>
|
||||
<image src="../../../images/foot_3.png"></image>
|
||||
</view>
|
||||
<!-- 左侧账号信息 -->
|
||||
<van-popup show="{{ show }}" position="left" custom-style="width: 70%;height:100%;background:#191d28" bind:close="closePopup">
|
||||
|
|
@ -10,7 +10,7 @@
|
|||
</van-col>
|
||||
<van-col span="10">
|
||||
<view class="left_head">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/images/user_avatar.png"></image>
|
||||
<image src="{{baseImgUrl}}/cdn/appimgs/user_avatar.png"></image>
|
||||
</view>
|
||||
</van-col>
|
||||
<van-col span="14">
|
||||
|
|
@ -28,56 +28,56 @@
|
|||
<button wx:if="{{false}}" type="default" size="default" style="margin-top: 40rpx;background-color: #513ea7;color: #FFF;" bindtap="bindingBuild">立即关注公众号</button>
|
||||
<view class="left_manage_min" wx:if="{{false}}">
|
||||
<view class="left_manage" bindtap="binding">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/img_1.png" class="left_icon"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/img_1.png" class="left_icon"></image>
|
||||
<text class="left_binding">授权消息通知</text>
|
||||
<image src="/images/right.png" class="left_flaot"></image>
|
||||
<image src="../../../images/right.png" class="left_flaot"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="left_manage_min">
|
||||
<view class="left_manage" bindtap="resPassword">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/img_5.png" class="left_icon"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/img_5.png" class="left_icon"></image>
|
||||
<text class="left_password">修改密码</text>
|
||||
<image src="/images/right.png" class="left_flaot"></image>
|
||||
<image src="../../../images/right.png" class="left_flaot"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="left_manage_min">
|
||||
<view class="left_manage" bindtap="loginOut">
|
||||
<image src="https://xiangguan.sxyanzhu.com/profile/static/images/set.png" class="left_icon"></image>
|
||||
<image src="{{baseImgUrl}}/profile/static/images/set.png" class="left_icon"></image>
|
||||
<text class="left_sign">退出登录</text>
|
||||
<image src="/images/right.png" class="left_flaot"></image>
|
||||
<image src="../../../images/right.png" class="left_flaot"></image>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</van-popup>
|
||||
|
||||
<!--修改密码-->
|
||||
<van-popup show="{{ resPas }}" position="left" class="passClass" custom-style="width: 100%;height:100%;background: #191d28 url(https://szgcwx.jhncidg.com/staticFiles/img/CORE_40247DD946964A15AA0D4000E1031E19.png) no-repeat bottom/100%;" bind:close="closeResPas">
|
||||
<van-popup show="{{ resPas }}" position="left" class="passClass" custom-style="width: 100%;height:100%;background: #191d28 url({{baseImgUrl}}/staticFiles/img/CORE_40247DD946964A15AA0D4000E1031E19.png) no-repeat bottom/100%;" bind:close="closeResPas">
|
||||
<view class="bg_bg">
|
||||
<image src="https://szgcwx.jhncidg.com/staticFiles/img/yanzhu_logo_blue.png"></image>
|
||||
<image src="{{baseImgUrl}}/staticFiles/img/yanzhu_logo_blue.png"></image>
|
||||
</view>
|
||||
<view class="inspect_info">
|
||||
<view class="inspect_info_list" wx:if="{{false}}">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">旧密码</view>
|
||||
<view class="inspect_info_content">
|
||||
<input placeholder="请输入旧密码" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" password="{{showOldPass}}" maxlength="20" model:value="{{oldPsw}}" />
|
||||
<image wx:if="{{showOldPass}}" class="password-icon" src="https://xiangguan.sxyanzhu.com/profile/static/images/biyan.png" bindtap="seeTap1"></image>
|
||||
<image wx:else class="password-icon" src="/images/yj_01.png" bindtap="seeTap1"></image>
|
||||
<image wx:if="{{showOldPass}}" class="password-icon" src="{{baseImgUrl}}/profile/static/images/biyan.png" bindtap="seeTap1"></image>
|
||||
<image wx:else class="password-icon" src="../../../images/yj_01.png" bindtap="seeTap1"></image>
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">新密码</view>
|
||||
<view class="inspect_info_content">
|
||||
<input placeholder="请输入新密码" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" password="{{showNewPass}}" maxlength="20" model:value="{{newPsw}}" />
|
||||
<image class="password-icon" src="https://xiangguan.sxyanzhu.com/profile/static/images/biyan.png" bindtap="seeTap2" wx:if="{{showNewPass}}" />
|
||||
<image class="password-icon" src="/images/yj_01.png" bindtap="seeTap2" wx:else />
|
||||
<image class="password-icon" src="{{baseImgUrl}}/profile/static/images/biyan.png" bindtap="seeTap2" wx:if="{{showNewPass}}" />
|
||||
<image class="password-icon" src="../../../images/yj_01.png" bindtap="seeTap2" wx:else />
|
||||
</view>
|
||||
</view>
|
||||
<view class="inspect_info_list">
|
||||
<view class="inspect_info_title" style="padding: 20rpx 0 10rpx;">确认密码</view>
|
||||
<view class="inspect_info_content">
|
||||
<input placeholder="请确认新密码" placeholder-style="color:#6777aa;" class="inspect_input_fill_in" password="{{showPassWord}}" maxlength="20" model:value="{{password}}" />
|
||||
<image class="password-icon" src="https://xiangguan.sxyanzhu.com/profile/static/images/biyan.png" bindtap="seeTap3" wx:if="{{showPassWord}}" />
|
||||
<image class="password-icon" src="/images/yj_01.png" bindtap="seeTap3" wx:else />
|
||||
<image class="password-icon" src="{{baseImgUrl}}/profile/static/images/biyan.png" bindtap="seeTap3" wx:if="{{showPassWord}}" />
|
||||
<image class="password-icon" src="../../../images/yj_01.png" bindtap="seeTap3" wx:else />
|
||||
</view>
|
||||
</view>
|
||||
<view class="problem_submit_to">
|
||||
|
|
|
|||
|
|
@ -30,7 +30,7 @@ Page({
|
|||
uuid: "",
|
||||
codeUrl: "",
|
||||
checked: true,
|
||||
logo: config.baseImgUrl + "/cdn/app_logo.png",
|
||||
logo: config.baseImgUrl + "/cdn/app_logo.png?v=20250922",
|
||||
},
|
||||
|
||||
//获取填写的账号信息
|
||||
|
|
|
|||
|
|
@ -1,43 +1,43 @@
|
|||
{
|
||||
"appid": "wx007a8fd50dc185b2",
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "3.8.9",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"setting": {
|
||||
"coverView": true,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"enhance": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"packNpmRelationList": [],
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
"appid": "wx46466c7828eede2b",
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "3.8.9",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"ignoreDevUnusedFiles": false,
|
||||
"ignoreUploadUnusedFiles": false,
|
||||
"condition": false,
|
||||
"compileWorklet": false,
|
||||
"uglifyFileName": false,
|
||||
"uploadWithSourceMap": true,
|
||||
"packNpmManually": false,
|
||||
"minifyWXSS": true,
|
||||
"minifyWXML": true,
|
||||
"localPlugins": false,
|
||||
"disableUseStrict": false,
|
||||
"useCompilerPlugins": false,
|
||||
"swc": false,
|
||||
"disableSWC": true
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "auto",
|
||||
"tabSize": 4
|
||||
},
|
||||
"simulatorPluginLibVersion": {}
|
||||
"setting": {
|
||||
"coverView": true,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"enhance": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"packNpmRelationList": [],
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
},
|
||||
"ignoreDevUnusedFiles": false,
|
||||
"ignoreUploadUnusedFiles": false,
|
||||
"condition": false,
|
||||
"compileWorklet": false,
|
||||
"uglifyFileName": false,
|
||||
"uploadWithSourceMap": true,
|
||||
"packNpmManually": false,
|
||||
"minifyWXSS": true,
|
||||
"minifyWXML": true,
|
||||
"localPlugins": false,
|
||||
"disableUseStrict": false,
|
||||
"useCompilerPlugins": false,
|
||||
"swc": false,
|
||||
"disableSWC": true
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "auto",
|
||||
"tabSize": 4
|
||||
},
|
||||
"simulatorPluginLibVersion": {}
|
||||
}
|
||||
|
|
@ -1,24 +1,24 @@
|
|||
{
|
||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||
"projectname": "miniprogram",
|
||||
"setting": {
|
||||
"compileHotReLoad": true,
|
||||
"urlCheck": false,
|
||||
"coverView": true,
|
||||
"lazyloadPlaceholderEnable": false,
|
||||
"skylineRenderEnable": false,
|
||||
"preloadBackgroundData": false,
|
||||
"autoAudits": false,
|
||||
"useApiHook": true,
|
||||
"useApiHostProcess": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"useStaticServer": false,
|
||||
"useLanDebug": false,
|
||||
"showES6CompileOption": false,
|
||||
"checkInvalidKey": true,
|
||||
"ignoreDevUnusedFiles": true,
|
||||
"bigPackageSizeSupport": false
|
||||
},
|
||||
"condition": {},
|
||||
"libVersion": "3.8.9"
|
||||
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档:https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
|
||||
"projectname": "miniprogram",
|
||||
"setting": {
|
||||
"compileHotReLoad": true,
|
||||
"urlCheck": false,
|
||||
"coverView": true,
|
||||
"lazyloadPlaceholderEnable": false,
|
||||
"skylineRenderEnable": false,
|
||||
"preloadBackgroundData": false,
|
||||
"autoAudits": false,
|
||||
"useApiHook": true,
|
||||
"useApiHostProcess": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"useStaticServer": false,
|
||||
"useLanDebug": false,
|
||||
"showES6CompileOption": false,
|
||||
"checkInvalidKey": true,
|
||||
"ignoreDevUnusedFiles": true,
|
||||
"bigPackageSizeSupport": false
|
||||
},
|
||||
"condition": {},
|
||||
"libVersion": "3.8.9"
|
||||
}
|
||||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('员工出入场记录', '2484', '1', 'userInOutRecord', 'manage/userInOutRecord/index', 1, 0, 'C', '0', '0', 'manage:userInOutRecord:list', '#', 'admin', sysdate(), '', null, '员工出入场记录菜单');
|
||||
values('员工出入场记录', '50', '1', 'userInOutRecord', 'manage/userInOutRecord/index', 1, 0, 'C', '0', '0', 'manage:userInOutRecord:list', '#', 'admin', sysdate(), '', null, '员工出入场记录菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
|
@ -24,3 +24,26 @@ values('员工出入场记录删除', @parentId, '4', '#', '', 1, 0, 'F', '0',
|
|||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('员工出入场记录导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'manage:userInOutRecord:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
--9.17 增加人员考勤记录
|
||||
-- 菜单 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录', '50', '1', 'mobileAttendanceData', 'manage/mobileAttendanceData/index', 1, 0, 'C', '0', '0', 'manage:mobileAttendanceData:list', '#', 'admin', sysdate(), '', null, '人员考勤记录菜单');
|
||||
|
||||
-- 按钮父菜单ID
|
||||
SELECT @parentId := LAST_INSERT_ID();
|
||||
|
||||
-- 按钮 SQL
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录查询', @parentId, '1', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:query', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录新增', @parentId, '2', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:add', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录修改', @parentId, '3', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:edit', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录删除', @parentId, '4', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:remove', '#', 'admin', sysdate(), '', null, '');
|
||||
|
||||
insert into sys_menu (menu_name, parent_id, order_num, path, component, is_frame, is_cache, menu_type, visible, status, perms, icon, create_by, create_time, update_by, update_time, remark)
|
||||
values('人员考勤记录导出', @parentId, '5', '#', '', 1, 0, 'F', '0', '0', 'manage:mobileAttendanceData:export', '#', 'admin', sysdate(), '', null, '');
|
||||
|
|
@ -41,7 +41,8 @@ config.forEach((item) => {
|
|||
const newData = data
|
||||
.replace(/数字建安施工/g, item.title)
|
||||
.replaceAll(`src="./`, `src = "/xd/`)
|
||||
.replaceAll(`href="./`, `href = "/xd/`);
|
||||
.replaceAll(`href="./`, `href = "/xd/`)
|
||||
.replaceAll(`/cdn/webcfg.js`,`/cdn/tmp.js`)
|
||||
|
||||
// 将替换后的内容写入目标文件
|
||||
fs.writeFile(targetFilePath, newData, "utf8", (err) => {
|
||||
|
|
|
|||
|
|
@ -0,0 +1,44 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
// 查询人员考勤记录列表
|
||||
export function listMobileAttendanceData(query) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
})
|
||||
}
|
||||
|
||||
// 查询人员考勤记录详细
|
||||
export function getMobileAttendanceData(id) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData/' + id,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
// 新增人员考勤记录
|
||||
export function addMobileAttendanceData(data) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 修改人员考勤记录
|
||||
export function updateMobileAttendanceData(data) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 删除人员考勤记录
|
||||
export function delMobileAttendanceData(id) {
|
||||
return request({
|
||||
url: '/manage/mobileAttendanceData/' + id,
|
||||
method: 'delete'
|
||||
})
|
||||
}
|
||||
|
|
@ -102,3 +102,11 @@ export function fileAllUsers(proId) {
|
|||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
export function updateBaiduFaceLibrary(projectId){
|
||||
return request({
|
||||
url: '/manage/proProjectInfoSubdeptsUsers/updateBaiduFaceLibrary/' + projectId,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
Before Width: | Height: | Size: 96 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 1.1 KiB |
|
Before Width: | Height: | Size: 509 KiB After Width: | Height: | Size: 54 KiB |
|
Before Width: | Height: | Size: 2.2 MiB After Width: | Height: | Size: 350 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 4.9 KiB |
|
Before Width: | Height: | Size: 131 KiB After Width: | Height: | Size: 33 KiB |
|
Before Width: | Height: | Size: 79 KiB |
|
After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 5.0 KiB |
|
|
@ -1,7 +1,7 @@
|
|||
import { login, logout, getInfo } from "@/api/login";
|
||||
import { findMyTasks } from "@/api/flowable/businessKey";
|
||||
import { getToken, setToken, removeToken } from "@/utils/auth";
|
||||
import defAva from "@/assets/images/profile.jpg";
|
||||
import defAva from "@/assets/images/profile.png";
|
||||
|
||||
const useUserStore = defineStore("user", {
|
||||
state: () => ({
|
||||
|
|
|
|||
|
|
@ -0,0 +1,283 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="用户名" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="用户手机" prop="userPhone">
|
||||
<el-input v-model="queryParams.userPhone" placeholder="请输入用户手机" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="考勤日期" style="width: 308px">
|
||||
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
|
||||
<!-- <el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd"
|
||||
v-hasPermi="['manage:mobileAttendanceData:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate"
|
||||
v-hasPermi="['manage:mobileAttendanceData:edit']">修改</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete"
|
||||
v-hasPermi="['manage:mobileAttendanceData:remove']">删除</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport"
|
||||
v-hasPermi="['manage:mobileAttendanceData:export']">导出</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row> -->
|
||||
|
||||
<el-table v-loading="loading" :data="mobileAttendanceDataList" @selection-change="handleSelectionChange">
|
||||
|
||||
<el-table-column label="用户名" align="center" prop="userName" />
|
||||
<el-table-column label="用户手机" align="center" prop="userPhone" />
|
||||
<el-table-column label="所属单位" align="center" prop="subDeptName" />
|
||||
<el-table-column label="班组" align="center" prop="subDeptGroupName" />
|
||||
<el-table-column label="进出标识" align="center" prop="inOut">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.inOut === 'in'" type="success">进</el-tag>
|
||||
<el-tag v-else type="primary">出</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="打卡设备" align="center" prop="inOut">
|
||||
<template #default="scope">
|
||||
<el-tag v-if="scope.row.attDevice === 'device'" type="success">人脸机</el-tag>
|
||||
<el-tag v-else type="primary">移动考勤</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考勤时间" align="center" prop="attDate" width="180">
|
||||
<template #default="scope">
|
||||
<span>{{ parseTime(scope.row.attDate, '{y}-{m}-{d} {h}:{i}:{s}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="考勤照片" align="center" prop="attImg">
|
||||
<template #default="scope">
|
||||
<el-image v-if="scope.row.attImg" :src="scope.row.attImg" style="height:60px;" :preview-teleported="true" :preview-src-list="[scope.row.attImg]"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 添加或修改人员考勤记录对话框 -->
|
||||
<el-dialog :title="title" v-model="open" width="500px" append-to-body>
|
||||
<el-form ref="mobileAttendanceDataRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用户ID" prop="userId">
|
||||
<el-input v-model="form.userId" placeholder="请输入用户ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="项目ID" prop="projectId">
|
||||
<el-input v-model="form.projectId" placeholder="请输入项目ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="配置ID" prop="cfgId">
|
||||
<el-input v-model="form.cfgId" placeholder="请输入配置ID" />
|
||||
</el-form-item>
|
||||
<el-form-item label="进还是出" prop="inOut">
|
||||
<el-input v-model="form.inOut" placeholder="请输入进还是出" />
|
||||
</el-form-item>
|
||||
<el-form-item label="经度" prop="longitude">
|
||||
<el-input v-model="form.longitude" placeholder="请输入经度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="纬度" prop="latitude">
|
||||
<el-input v-model="form.latitude" placeholder="请输入纬度" />
|
||||
</el-form-item>
|
||||
<el-form-item label="考勤时间" prop="attDate">
|
||||
<el-date-picker clearable v-model="form.attDate" type="date" value-format="YYYY-MM-DD" placeholder="请选择考勤时间">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item label="考勤照片" prop="attImg">
|
||||
<el-input v-model="form.attImg" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="isDel">
|
||||
<el-input v-model="form.isDel" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="remark">
|
||||
<el-input v-model="form.remark" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
<el-form-item label="${comment}" prop="state">
|
||||
<el-input v-model="form.state" placeholder="请输入${comment}" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="MobileAttendanceData">
|
||||
import { listMobileAttendanceData, getMobileAttendanceData, delMobileAttendanceData, addMobileAttendanceData, updateMobileAttendanceData } from "@/api/manage/mobileAttendanceData";
|
||||
import useUserStore from "@/store/modules/user";
|
||||
const { proxy } = getCurrentInstance();
|
||||
const userStore = useUserStore();
|
||||
const mobileAttendanceDataList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
const title = ref("");
|
||||
const dateRange = ref([]);
|
||||
const data = reactive({
|
||||
form: {},
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
userId: null,
|
||||
projectId: null,
|
||||
cfgId: null,
|
||||
inOut: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
attDate: null,
|
||||
attImg: null,
|
||||
isDel: null,
|
||||
state: null,
|
||||
},
|
||||
rules: {
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询人员考勤记录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
queryParams.value.projectId = userStore.currentPrjId;
|
||||
let postData={
|
||||
...queryParams.value
|
||||
};
|
||||
if(dateRange.value && dateRange.value.length>0){
|
||||
postData.startDate=dateRange.value[0];
|
||||
postData.endDate=dateRange.value[1];
|
||||
}
|
||||
listMobileAttendanceData(postData).then(response => {
|
||||
mobileAttendanceDataList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
});
|
||||
}
|
||||
|
||||
// 取消按钮
|
||||
function cancel() {
|
||||
open.value = false;
|
||||
reset();
|
||||
}
|
||||
|
||||
// 表单重置
|
||||
function reset() {
|
||||
form.value = {
|
||||
id: null,
|
||||
userId: null,
|
||||
projectId: null,
|
||||
cfgId: null,
|
||||
inOut: null,
|
||||
longitude: null,
|
||||
latitude: null,
|
||||
attDate: null,
|
||||
attImg: null,
|
||||
isDel: null,
|
||||
remark: null,
|
||||
state: null,
|
||||
createBy: null,
|
||||
createTime: null,
|
||||
updateBy: null,
|
||||
updateTime: null
|
||||
};
|
||||
proxy.resetForm("mobileAttendanceDataRef");
|
||||
}
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
function handleQuery() {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
}
|
||||
|
||||
/** 重置按钮操作 */
|
||||
function resetQuery() {
|
||||
proxy.resetForm("queryRef");
|
||||
handleQuery();
|
||||
}
|
||||
|
||||
// 多选框选中数据
|
||||
function handleSelectionChange(selection) {
|
||||
ids.value = selection.map(item => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
}
|
||||
|
||||
/** 新增按钮操作 */
|
||||
function handleAdd() {
|
||||
reset();
|
||||
open.value = true;
|
||||
title.value = "添加人员考勤记录";
|
||||
}
|
||||
|
||||
/** 修改按钮操作 */
|
||||
function handleUpdate(row) {
|
||||
reset();
|
||||
const _id = row.id || ids.value
|
||||
getMobileAttendanceData(_id).then(response => {
|
||||
form.value = response.data;
|
||||
open.value = true;
|
||||
title.value = "修改人员考勤记录";
|
||||
});
|
||||
}
|
||||
|
||||
/** 提交按钮 */
|
||||
function submitForm() {
|
||||
proxy.$refs["mobileAttendanceDataRef"].validate(valid => {
|
||||
if (valid) {
|
||||
if (form.value.id != null) {
|
||||
updateMobileAttendanceData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("修改成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
} else {
|
||||
addMobileAttendanceData(form.value).then(response => {
|
||||
proxy.$modal.msgSuccess("新增成功");
|
||||
open.value = false;
|
||||
getList();
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/** 删除按钮操作 */
|
||||
function handleDelete(row) {
|
||||
const _ids = row.id || ids.value;
|
||||
proxy.$modal.confirm('是否确认删除人员考勤记录编号为"' + _ids + '"的数据项?').then(function () {
|
||||
return delMobileAttendanceData(_ids);
|
||||
}).then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => { });
|
||||
}
|
||||
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download('manage/mobileAttendanceData/export', {
|
||||
...queryParams.value
|
||||
}, `mobileAttendanceData_${new Date().getTime()}.xlsx`)
|
||||
}
|
||||
|
||||
getList();
|
||||
</script>
|
||||
|
|
@ -55,6 +55,9 @@
|
|||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Download" @click="handleBatchEnterState(0)" v-hasPermi="['manage:proProjectInfoSubdeptsUsers:export']">批量入场</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="primary" icon="Refresh" :loading="data.baiduFaceLoading" @click="handleSyncFace()" v-if="data.isAdmin">同步百度人脸库</el-button>
|
||||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
|
|
@ -324,6 +327,7 @@ import {
|
|||
updateProProjectInfoSubdeptsUsers,
|
||||
editPhone,
|
||||
fileSign,
|
||||
updateBaiduFaceLibrary
|
||||
} from '@/api/manage/proProjectInfoSubdeptsUsers'
|
||||
import { listProProjectInfoSubdepts } from '@/api/manage/proProjectInfoSubdepts'
|
||||
import { listProProjectInfoSubdeptsGroup } from '@/api/manage/proProjectInfoSubdeptsGroup'
|
||||
|
|
@ -355,6 +359,7 @@ const total = ref(0)
|
|||
const title = ref('')
|
||||
const dateRange = ref([])
|
||||
|
||||
|
||||
const validatePhone = (rule, value, callback) => {
|
||||
if (!/^1\d{10}$/.test(value)) {
|
||||
callback(new Error('请输入有效手机号码!'))
|
||||
|
|
@ -423,10 +428,21 @@ const data = reactive({
|
|||
prjWorkTypeObj: {},
|
||||
prjWorkCategories: [], //项目人员岗位大类
|
||||
prjWorkTypes: [], //项目人员岗位类型
|
||||
isAdmin:userStore.isAdmin,
|
||||
baiduFaceLoading:false,
|
||||
})
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data)
|
||||
|
||||
//同步百度人脸库
|
||||
function handleSyncFace(){
|
||||
data.baiduFaceLoading = true
|
||||
updateBaiduFaceLibrary(queryParams.value.projectId).then(res=>{
|
||||
data.baiduFaceLoading = false
|
||||
proxy.$modal.msgSuccess('同步百度人脸库成功!')
|
||||
});
|
||||
}
|
||||
|
||||
//进场,离场
|
||||
function handleEnter(row) {
|
||||
let ids = [row.id]
|
||||
|
|
|
|||
|
|
@ -1,7 +1,6 @@
|
|||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryRef" :inline="true" v-show="showSearch" label-width="68px">
|
||||
|
||||
<el-form-item label="用户名" prop="userName">
|
||||
<el-input v-model="queryParams.userName" placeholder="请输入用户名" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
|
|
@ -9,10 +8,14 @@
|
|||
<el-input v-model="queryParams.userPhone" placeholder="请输入用户手机" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="类型" prop="useStatus">
|
||||
<el-select v-model="queryParams.useStatus" placeholder="请选择类型" clearable>
|
||||
<el-option label="进场" :value="0" />
|
||||
<el-option label="离场" :value="1" />
|
||||
</el-select>
|
||||
<el-select v-model="queryParams.useStatus" placeholder="请选择类型" clearable>
|
||||
<el-option label="进场" :value="0" />
|
||||
<el-option label="离场" :value="1" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="日期" style="width: 308px">
|
||||
<el-date-picker v-model="dateRange" value-format="YYYY-MM-DD" type="daterange" range-separator="-"
|
||||
start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
|
|
@ -39,33 +42,50 @@
|
|||
</el-col>
|
||||
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row> -->
|
||||
|
||||
<el-table v-loading="loading" :data="userInOutRecordList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="${comment}" align="center" prop="id" />
|
||||
<el-table-column label="${comment}" align="center" prop="projectId" />
|
||||
<el-table-column label="用户ID" align="center" prop="userId" />
|
||||
<el-table v-loading="loading" :data="userInOutRecordList">
|
||||
<el-table-column label="用户名" align="center" prop="userName" />
|
||||
<el-table-column label="用户手机" align="center" prop="userPhone" />
|
||||
<el-table-column label="用户图像" align="center" prop="userPicture" />
|
||||
<el-table-column label="用户性别" align="center" prop="userSex" />
|
||||
<el-table-column label="进场状态" align="center" prop="useStatus" />
|
||||
<el-table-column label="分包单位ID" align="center" prop="subDeptId" />
|
||||
<el-table-column label="分包单位" align="center" prop="subDeptName" />
|
||||
<el-table-column label="分包类型" align="center" prop="subDeptType" />
|
||||
<el-table-column label="班组编号" align="center" prop="subDeptGroup" />
|
||||
<el-table-column label="班组名称" align="center" prop="subDeptGroupName" />
|
||||
<el-table-column label="工种类型" align="center" prop="craftType" />
|
||||
<el-table-column label="工种岗位" align="center" prop="craftPost" />
|
||||
<el-table-column label="${comment}" align="center" prop="isDel" />
|
||||
<el-table-column label="${comment}" align="center" prop="remark" />
|
||||
<el-table-column label="${comment}" align="center" prop="state" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<el-table-column label="性别" align="center" prop="userSex">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)"
|
||||
v-hasPermi="['manage:userInOutRecord:edit']">修改</el-button>
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)"
|
||||
v-hasPermi="['manage:userInOutRecord:remove']">删除</el-button>
|
||||
<span v-if="!isNaN(scope.row.userSex)"><dict-tag :options="sys_user_sex" :value="scope.row.userSex" /></span>
|
||||
<span v-if="isNaN(scope.row.userSex)">{{
|
||||
scope.row.userSex == "女" ? "女" : "男"
|
||||
}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="所属单位" align="center" prop="subDeptName" />
|
||||
<el-table-column label="班组" align="center" prop="subDeptGroupName" />
|
||||
<el-table-column label="状态" align="center" prop="useStatus">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.useStatus == 0" style="color: green;">在场</span>
|
||||
<span v-else style="color: red">离场</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="工种类型" align="center" prop="craftType">
|
||||
<template #default="scope">
|
||||
<dict-tag :options="pro_craft_type" :value="scope.row.craftType" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工种岗位" align="center" prop="craftPost">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
<el-button v-if="scope.row.userPost == '3'" link type="warning" disabled>班组长</el-button>
|
||||
</div>
|
||||
<dict-tag :options="pro_craft_post" :value="scope.row.craftPost" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作时间" align="center">
|
||||
<template #default="scope">
|
||||
<div>
|
||||
{{ scope.row.createTime }}
|
||||
</div>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="头像" align="center">
|
||||
<template #default="scope">
|
||||
<el-image :src="scope.row.userPicture" style="height: 60px" :preview-teleported="true"
|
||||
:preview-src-list="[scope.row.userPicture]"></el-image>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
|
@ -135,8 +155,29 @@ import {
|
|||
updateUserInOutRecord,
|
||||
} from "@/api/manage/userInOutRecord";
|
||||
|
||||
import useUserStore from "@/store/modules/user";
|
||||
const { proxy } = getCurrentInstance();
|
||||
|
||||
const userStore = useUserStore();
|
||||
const {
|
||||
sys_use_status,
|
||||
pro_craft_type,
|
||||
sys_is_del,
|
||||
pro_craft_post,
|
||||
certificate_type,
|
||||
educational_type,
|
||||
sys_user_sex,
|
||||
user_work_type,
|
||||
} = proxy.useDict(
|
||||
"sys_use_status",
|
||||
"pro_craft_type",
|
||||
"sys_is_del",
|
||||
"pro_craft_post",
|
||||
"certificate_type",
|
||||
"educational_type",
|
||||
"sys_user_sex",
|
||||
"user_work_type"
|
||||
);
|
||||
const dateRange = ref([]);
|
||||
const userInOutRecordList = ref([]);
|
||||
const open = ref(false);
|
||||
const loading = ref(true);
|
||||
|
|
@ -177,7 +218,15 @@ const { queryParams, form, rules } = toRefs(data);
|
|||
/** 查询员工出入场记录列表 */
|
||||
function getList() {
|
||||
loading.value = true;
|
||||
listUserInOutRecord(queryParams.value).then((response) => {
|
||||
queryParams.value.projectId = userStore.currentPrjId;
|
||||
let postData={
|
||||
...queryParams.value
|
||||
};
|
||||
if(dateRange.value && dateRange.value.length>0){
|
||||
postData.startDate=dateRange.value[0];
|
||||
postData.endDate=dateRange.value[1];
|
||||
}
|
||||
listUserInOutRecord(postData).then((response) => {
|
||||
userInOutRecordList.value = response.rows;
|
||||
total.value = response.total;
|
||||
loading.value = false;
|
||||
|
|
|
|||
|
|
@ -39,8 +39,8 @@ export default defineConfig(({ mode, command }) => {
|
|||
},
|
||||
// https://cn.vitejs.dev/config/#server-proxy
|
||||
"/dev-api": {
|
||||
target: "http://localhost:8080",
|
||||
//target: "http://62.234.3.186",
|
||||
//target: "http://localhost:8080",
|
||||
target: "http://62.234.3.186",
|
||||
changeOrigin: true,
|
||||
rewrite: (p) => p.replace(/^\/dev-api/, ""),
|
||||
},
|
||||
|
|
|
|||