diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/AttendanceUbiDevice.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/AttendanceUbiDevice.java
index 60ec2233..9ea2c1be 100644
--- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/AttendanceUbiDevice.java
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/AttendanceUbiDevice.java
@@ -103,6 +103,25 @@ public class AttendanceUbiDevice extends BaseEntity
private String compName;
private String projectName;
+ private int direction;
+ private String channel;
+
+ public int getDirection() {
+ return direction;
+ }
+
+ public void setDirection(int direction) {
+ this.direction = direction;
+ }
+
+ public String getChannel() {
+ return channel;
+ }
+
+ public void setChannel(String channel) {
+ this.channel = channel;
+ }
+
public String getCompName() {
return compName;
}
diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/AttendanceUbiDeviceMapper.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/AttendanceUbiDeviceMapper.java
index 747bcfd9..f3586e95 100644
--- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/AttendanceUbiDeviceMapper.java
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/mapper/AttendanceUbiDeviceMapper.java
@@ -58,4 +58,6 @@ public interface AttendanceUbiDeviceMapper
* @return 结果
*/
public int deleteAttendanceUbiDeviceByIds(Long[] ids);
+
+ public AttendanceUbiDevice selectAttendanceUbiDeviceByNo(String no);
}
diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDeviceMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDeviceMapper.xml
index 476a9a27..7b50efb5 100644
--- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDeviceMapper.xml
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/AttendanceUbiDeviceMapper.xml
@@ -27,6 +27,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
+
@@ -38,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
select ud.id, ud.com_id, ud.project_id, ud.name, ud.tag, ud.scene_guid, ud.source, ud.device_no, ud.addition, ud.bind_default_scene, ud.force_empty_device,
+ ud.direction,ud.channel,
ud.device_model, ud.device_state, ud.rec_type, ud.online_state, ud.version_no, ud.last_active_time, ud.has_register, ud.state, ud.remark, ud.is_del,
ud.create_by, ud.create_time, ud.update_by, ud.update_time ,dp.`dept_name` comp_name,pp.`project_name`,dic.`dict_label` souce_name
from attendance_ubi_device ud
@@ -75,7 +78,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where ud.id = #{id}
-
+
+
insert into attendance_ubi_device
@@ -101,6 +108,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
state,
remark,
is_del,
+ direction,
+ channel,
create_by,
create_time,
update_by,
@@ -129,6 +138,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{state},
#{remark},
#{isDel},
+ #{direction},
+ #{channel},
#{createBy},
#{createTime},
#{updateBy},
@@ -160,6 +171,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
state = #{state},
remark = #{remark},
is_del = #{isDel},
+ direction = #{direction},
+ channel = #{channel},
create_by = #{createBy},
create_time = #{createTime},
update_by = #{updateBy},
diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml
index 6df65dcf..a6469354 100644
--- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml
+++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProProjectInfoSubdeptsUsersMapper.xml
@@ -24,13 +24,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-
+
@@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+
@@ -58,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
SELECT pi.project_name, psu.id, psu.com_id, psu.project_id, psu.sub_dept_id, psu.sub_dept_type, psu.sub_dept_name, psu.user_id, psu.sub_dept_group,
psu.sub_dept_group_name, psu.craft_type, psu.craft_post, psu.edu_status, psu.edu_file_path, psu.edu_sign_path, psu.edu_date, psu.approve_status,
psu.use_status, psu.sub_step, psu.illness_status, psu.sup_illness_status, psu.is_del, psu.create_by, psu.create_time, psu.update_by, psu.update_time,
- psu.remark,su.`user_name`,su.`nick_name`,su.`user_type`,su.`card_type`,su.`card_code`,
+ psu.remark,su.`user_name`,su.`nick_name`,su.`user_type`,su.`card_type`,su.`card_code`,su.admitGuid,su.admitGuid usAdmitGuid,
su.`user_picture`, su.`card_img_inv`,su.`card_img_pos`,su.`user_infos`,su.`email`,su.`phonenumber`,su.`sex`,su.`avatar`,su.`login_ip`,su.`login_date`
FROM pro_project_info_subdepts_users psu
LEFT JOIN sys_user su ON psu.user_id=su.user_id
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/UniCallBackController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/UniCallBackController.java
index 2f449257..6b95f42f 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/UniCallBackController.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/UniCallBackController.java
@@ -2,10 +2,14 @@ package com.yanzhu.manage.controller;
import com.alibaba.fastjson2.JSONObject;
import com.yanzhu.common.core.utils.DateUtils;
+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.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 org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
@@ -24,6 +28,9 @@ public class UniCallBackController {
@Autowired
private IProProjectInfoSubdeptsUsersService proProjectInfoSubdeptsUsersService;
+
+ @Autowired
+ private IAttendanceUbiDeviceService attendanceUbiDeviceService;
/**
* 识别回调
* @param jo
@@ -31,11 +38,71 @@ public class UniCallBackController {
*/
@PostMapping("/recognize")
public AjaxResult recognize(HttpServletRequest request){
+ String eventCode=request.getParameter("eventCode");
+ String eventGuid=request.getParameter("eventGuid");
String data=request.getParameter("eventMsg");
+ switch (eventCode){
+ case "101004"://上报识别记录
+ return doAddAttendance(eventGuid,data);
+ case "100002"://设备上线
+ return doDeviceOnLine(eventGuid,data);
+ case "100003"://设备下线
+ return doDeviceOffLine(eventGuid,data);
+ }
+ return AjaxResult.success();
+ }
+
+ /**
+ * 设备上线
+ * @param eventGuid
+ * @param data
+ * @return
+ */
+ private AjaxResult doDeviceOnLine(String eventGuid,String data){
+ JSONObject json=JSONObject.parseObject(data);
+ String deviceNo= json.getString("deviceNo");
+ if(StringUtils.isNotEmpty(deviceNo)){
+ AttendanceUbiDevice device=attendanceUbiDeviceService.selectAttendanceUbiDeviceByNo(deviceNo);
+ if(device!=null){
+ device.setOnlineState(1l);
+ attendanceUbiDeviceService.updateAttendanceUbiDevice(device);
+ return AjaxResult.success("同步成功");
+ }
+ }
+ return AjaxResult.error("同步失败");
+ }
+
+ /**
+ * 设备下线
+ * @param eventGuid
+ * @param data
+ * @return
+ */
+ private AjaxResult doDeviceOffLine(String eventGuid,String data){
+ JSONObject json=JSONObject.parseObject(data);
+ String deviceNo= json.getString("deviceNo");
+ if(StringUtils.isNotEmpty(deviceNo)){
+ AttendanceUbiDevice device=attendanceUbiDeviceService.selectAttendanceUbiDeviceByNo(deviceNo);
+ if(device!=null){
+ device.setOnlineState(0l);
+ attendanceUbiDeviceService.updateAttendanceUbiDevice(device);
+ return AjaxResult.success("同步成功");
+ }
+ }
+ return AjaxResult.error("同步失败");
+ }
+
+ /**
+ * 考勤记录同步
+ * @param eventGuid
+ * @param data
+ * @return
+ */
+ private AjaxResult doAddAttendance(String eventGuid,String data){
JSONObject json=JSONObject.parseObject(data);
int type=json.getInteger("type");
if(type==1){// 人员比对结果,1:比对成功 2:比对失败
- String eventGuid=request.getParameter("eventGuid");
+
String admitGuid=json.getString("admitGuid");
long projectId=Long.parseLong(json.getString("cardNo"));
String deviceNo=json.getString("deviceNo");
@@ -45,6 +112,10 @@ public class UniCallBackController {
where.setAdmitGuid(admitGuid);
where.setInTime(showTime);
List list= attendanceUbiDataService.queryAttendaceInfo(where);
+ AttendanceUbiDevice device=attendanceUbiDeviceService.selectAttendanceUbiDeviceByNo(deviceNo);
+ if(device==null){
+ return AjaxResult.error("没有查询到设备No");
+ }
if(list.size()==0){
//增加操作
ProProjectInfoSubdeptsUsers userWhere=new ProProjectInfoSubdeptsUsers();
@@ -67,9 +138,15 @@ public class UniCallBackController {
addData.setSubDeptGroupName(proUser.getSubDeptGroupName());
addData.setCraftPost(proUser.getCraftPost());
addData.setCraftType(proUser.getCraftType());
- addData.setInTime(showTime);
- addData.setInData(data);
- addData.setInPhoto(filePath);
+ if(device.getDirection()==0) {
+ addData.setInTime(showTime);
+ addData.setInData(data);
+ addData.setInPhoto(filePath);
+ }else{
+ addData.setOutPhoto(filePath);
+ addData.setOutData(data);
+ addData.setOutTime(showTime);
+ }
addData.setDeviceNo(deviceNo);
attendanceUbiDataService.insertAttendanceUbiData(addData);
return AjaxResult.success("增加成功");
@@ -83,30 +160,23 @@ public class UniCallBackController {
}
Date dt1=upData.getInTime();
Date dt2=upData.getOutTime();
- if(dt1!=null && dt2!=null){
- if(showTime.getTime()dt2.getTime()){
- upData.setOutData(data);
- upData.setOutPhoto(filePath);
- upData.setOutTime(showTime);
+ }else{
+ return AjaxResult.success();
}
}else{
- if(showTime.getTime()dt1.getTime()){
+ //出
+ if(dt2==null || showTime.getTime()>dt2.getTime()){
upData.setOutData(data);
upData.setOutPhoto(filePath);
upData.setOutTime(showTime);
+ }else {
+ return AjaxResult.success();
}
}
attendanceUbiDataService.updateAttendanceUbiData(upData);
@@ -116,44 +186,4 @@ public class UniCallBackController {
}
return AjaxResult.error("同步失败");
}
-
- /**
- * 授权回调
- * @param jo
- * @return
- */
- @PostMapping("/auth")
- public AjaxResult auth(@RequestBody JSONObject jo){
- return AjaxResult.success("--ok--");
- }
-
- /**
- * 销权回调
- * @param jo
- * @return
- */
- @PostMapping("/unauth")
- public AjaxResult unauth(@RequestBody JSONObject jo){
- return AjaxResult.success("--ok--");
- }
-
- /**
- * 警报回调
- * @param jo
- * @return
- */
- @PostMapping("/alarm")
- public AjaxResult alarm(@RequestBody JSONObject jo){
- return AjaxResult.success("--ok--");
- }
-
- /**
- * 设备删除回调
- * @param jo
- * @return
- */
- @PostMapping("/deviceDelete")
- public AjaxResult deviceDelete(@RequestBody JSONObject jo){
- return AjaxResult.success("--ok--");
- }
}
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IAttendanceUbiDeviceService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IAttendanceUbiDeviceService.java
index 97deed3c..151da484 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IAttendanceUbiDeviceService.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IAttendanceUbiDeviceService.java
@@ -18,7 +18,7 @@ public interface IAttendanceUbiDeviceService
* @return 宇泛的设备信息
*/
public AttendanceUbiDevice selectAttendanceUbiDeviceById(Long id);
-
+ public AttendanceUbiDevice selectAttendanceUbiDeviceByNo(String no);
/**
* 查询宇泛的设备信息列表
*
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IUniService.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IUniService.java
index fc567f74..4da5b401 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IUniService.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/IUniService.java
@@ -125,7 +125,7 @@ public interface IUniService {
* @param data
* @return
*/
- public JSONObject authDeviceRevoke(JSONObject data);
+ public String authDeviceRevoke(JSONObject data);
/**
@@ -150,4 +150,6 @@ public interface IUniService {
* @return
*/
public Long syncUniDeviceUser(Long deviceId,Long projectId);
+
+ public long syncUniDeviceDelete(Long[] ids);
}
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceUbiDeviceServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceUbiDeviceServiceImpl.java
index a7f5edf4..99a351d2 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceUbiDeviceServiceImpl.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/AttendanceUbiDeviceServiceImpl.java
@@ -37,6 +37,11 @@ public class AttendanceUbiDeviceServiceImpl implements IAttendanceUbiDeviceServi
return attendanceUbiDeviceMapper.selectAttendanceUbiDeviceById(id);
}
+ @Override
+ public AttendanceUbiDevice selectAttendanceUbiDeviceByNo(String no) {
+ return attendanceUbiDeviceMapper.selectAttendanceUbiDeviceByNo(no);
+ }
+
/**
* 查询宇泛的设备信息列表
*
@@ -91,6 +96,7 @@ public class AttendanceUbiDeviceServiceImpl implements IAttendanceUbiDeviceServi
@Override
public int deleteAttendanceUbiDeviceByIds(Long[] ids)
{
+ uniService.syncUniDeviceDelete(ids);
return attendanceUbiDeviceMapper.deleteAttendanceUbiDeviceByIds(ids);
}
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java
index b9508ccc..0b978b35 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/service/impl/UniServiceImpl.java
@@ -236,6 +236,21 @@ public class UniServiceImpl implements IUniService{
@Override
public JSONObject deviceDelete(JSONObject data) {
+ long projectId=data.getLong("projectId");
+ Request request=new Request.Builder()
+ .url(UniUtils.DEVICEDELETE)
+ .post(UniUtils.toJsonBody(data))
+ .headers(UniUtils.setHeaderParams(auth(projectId)))
+ .build();
+ String res=UniUtils.getResult(request);
+ JSONObject jo=JSON.parseObject(res);
+ if(jo.getLong("result").intValue()==1){
+ return jo.getJSONObject("data");
+ }
+ if("token is illegal".equals(jo.getString("msg"))){
+ clearAuthCache(projectId);
+ return deviceDelete(data);
+ }
return null;
}
@@ -285,8 +300,23 @@ public class UniServiceImpl implements IUniService{
}
@Override
- public JSONObject authDeviceRevoke(JSONObject data) {
- return null;
+ public String authDeviceRevoke(JSONObject data) {
+ long projectId=data.getLong("projectId");
+ Request request=new Request.Builder()
+ .url(UniUtils.AUTHDEVICEREVOKE)
+ .post(UniUtils.toJsonBody(data))
+ .headers(UniUtils.setHeaderParams(auth(projectId)))
+ .build();
+ String res=UniUtils.getResult(request);
+ JSONObject jo=JSON.parseObject(res);
+ if(jo.getLong("result").intValue()==1){
+ return "success";
+ }
+ if("token is illegal".equals(jo.getString("msg"))){
+ clearAuthCache(projectId);
+ return authDeviceRevoke(data);
+ }
+ return jo.getString("msg");
}
@Override
public Long syncUniDeviceUser(Long deviceId,Long projectId){
@@ -299,8 +329,7 @@ public class UniServiceImpl implements IUniService{
jo.put("deviceNo",device.getDeviceNo());
List admitGuidList=new ArrayList<>();
for(ProProjectInfoSubdeptsUsers u :userList){
- JSONObject json=JSON.parseObject(u.getUser().getUserInfos());
- String admitGuid=json.getString("admitGuid");
+ String admitGuid=u.getAdmitGuid();
if(StringUtils.isNotEmpty(admitGuid)){
admitGuidList.add(admitGuid);
}
@@ -318,6 +347,57 @@ public class UniServiceImpl implements IUniService{
}
return 1l;
}
+
+ /**
+ * 同步删除设备 1.删除设备人员关系 2.删除设备
+ * @param ids
+ * @return
+ */
+ @Override
+ public long syncUniDeviceDelete(Long[] ids) {
+ long cnt=0;
+ for(Long id :ids){
+ cnt+=deletDevice(id);
+ }
+ return cnt;
+ }
+
+ private Long deletDevice(Long id) {
+ AttendanceUbiDevice device=attendanceUbiDeviceMapper.selectAttendanceUbiDeviceById(id);
+ if(device==null){
+ return 0l;
+ }
+ Long projectId=device.getProjectId();
+ ProProjectInfoSubdeptsUsers userWhere=new ProProjectInfoSubdeptsUsers();
+ userWhere.setProjectId(projectId);
+ List userList=proProjectInfoSubdeptsUsersMapper.selectProProjectInfoSubdeptsUsersList(userWhere);
+ JSONObject jo=new JSONObject();
+ jo.put("projectId",projectId);
+ jo.put("deviceNo",device.getDeviceNo());
+ jo.put("source",device.getSource());
+ List admitGuidList=new ArrayList<>();
+ for(ProProjectInfoSubdeptsUsers u :userList){
+ String admitGuid=u.getAdmitGuid();
+ if(StringUtils.isNotEmpty(admitGuid)){
+ admitGuidList.add(admitGuid);
+ }
+ }
+ for(int i=0;i0){
+ admitGuids=admitGuids.substring(0,admitGuids.length()-1);
+ }
+ jo.put("admitGuids",admitGuids);
+ authDeviceRevoke(jo);
+ }
+
+ deviceDelete(jo);
+ return 1l;
+ }
+
@Override
public Long syncUniDevice(Long deviceId,Long projectId){
AttendanceUbiDevice device=attendanceUbiDeviceMapper.selectAttendanceUbiDeviceById(deviceId);
@@ -366,6 +446,7 @@ public class UniServiceImpl implements IUniService{
if(StringUtils.isEmpty(admitGuid)){
//未注册人员
admitGuid=admitCreate(userJo);
+ user.setAdmitGuid(admitGuid);
jo.put("admitGuid",admitGuid);
hasUpdate=true;
}else{
diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/UniUtils.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/UniUtils.java
index 5c576cad..b43e4d0c 100644
--- a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/UniUtils.java
+++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/utils/UniUtils.java
@@ -25,6 +25,7 @@ public class UniUtils {
public static final String AUTHDEVICE=UNIBASE+"v2/auth/device";
public static final String AUTHDEVICEUPDATE=UNIBASE+"v2/auth/device/update";
+ public static final String AUTHDEVICEREVOKE=UNIBASE+"v2/auth/device/revoke";
public static String getAuthUrl(String projectGuid){
return UNIBASE+ "/v1/"+projectGuid+"/auth";
}
diff --git a/yanzhu-ui-vue3/src/views/manage/attendance_cfg/index.vue b/yanzhu-ui-vue3/src/views/manage/attendance_cfg/index.vue
index 3c27e943..20ffbcdb 100644
--- a/yanzhu-ui-vue3/src/views/manage/attendance_cfg/index.vue
+++ b/yanzhu-ui-vue3/src/views/manage/attendance_cfg/index.vue
@@ -55,14 +55,29 @@
-
+
+
+ {{scope.row.vendorsName }}
+
+
+
+
+
-
+
+
+ {{ parseTime(scope.row.createTime) }}
+
+
+
+
+ 设备列表
修改
-
+
@@ -113,6 +128,7 @@
+
@@ -120,6 +136,7 @@
import { listAttendance_cfg, getAttendance_cfg, delAttendance_cfg, addAttendance_cfg, updateAttendance_cfg } from "@/api/manage/attendanceCfg";
import { findMyProjectList } from "@/api/publics";
import useUserStore from '@/store/modules/user'
+import ubiDeviceDrawer from '../attendance_ubi_device/ubiDeviceDrawer.vue'
const userStore = useUserStore()
const { proxy } = getCurrentInstance();
const { attendance_vendors } = proxy.useDict('attendance_vendors');
@@ -134,7 +151,7 @@ const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const title = ref("");
-
+const deviceDrawer=ref();
const data = reactive({
form: {},
queryParams: {
@@ -167,6 +184,11 @@ function doUpdateRow(row){
proxy.$modal.msgSuccess("修改成功");
});
}
+
+/**设备列表 */
+function handleDeviceList(row){
+ deviceDrawer.value.showDrawer(row);
+}
/** 查询项目列表 */
function getProjectList() {
findMyProjectList({ pageNum: 1, pageSize: 100 }).then(response => {
@@ -182,7 +204,10 @@ function getProjectList() {
function getList() {
loading.value = true;
listAttendance_cfg(queryParams.value).then(response => {
- attendance_cfgList.value = response.rows;
+ attendance_cfgList.value = (response.rows||[]).map(it=>{
+ it.info=proxy.$tryToJson(it.vendorsParameter);
+ return it;
+ });
total.value = response.total;
loading.value = false;
});
@@ -265,6 +290,8 @@ function handleUpdate(row) {
function submitForm() {
proxy.$refs["attendance_cfgRef"].validate(valid => {
if (valid) {
+ let objs=data.projects.filter(d=>d.id==form.value.projectId);
+ form.value.comId=objs.length>0?objs[0].comId:userStore.currentComId;
form.value.vendorsParameter = JSON.stringify({
AppKey: form.value.AppKey,
AppSecret: form.value.AppSecret,
diff --git a/yanzhu-ui-vue3/src/views/manage/attendance_ubi_device/ubiDeviceDrawer.vue b/yanzhu-ui-vue3/src/views/manage/attendance_ubi_device/ubiDeviceDrawer.vue
new file mode 100644
index 00000000..b16d0215
--- /dev/null
+++ b/yanzhu-ui-vue3/src/views/manage/attendance_ubi_device/ubiDeviceDrawer.vue
@@ -0,0 +1,315 @@
+
+
+
+
+ 新增
+
+
+
+
+
+
+
+
+ {{scope.row.deviceNo}}
+
+
+
+
+ {{ scope.row.direction==0?'进':'出' }}
+
+
+
+
+
+
+ 未绑定
+ 已绑定
+ 已禁用
+
+
+
+
+ 本地识别
+ 云端识别
+
+
+
+
+
+
+ 在线
+
+ 离线
+
+
+
+
+
+ {{ parseTime(scope.row.lastActiveTime, '{y}-{m}-{d}') }}
+
+
+
+
+ 已注册
+ 未注册
+
+
+
+
+ 同步
+ 修改
+ 删除
+
+
+
+
+
+
+
+
+
+
+ {{ form.projectName }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 进
+ 出
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue
index 2598afac..65630379 100644
--- a/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue
+++ b/yanzhu-ui-vue3/src/views/manage/proProjectInfoSubdeptsUsers/index.vue
@@ -41,19 +41,27 @@
新增
+ v-hasPermi="['manage:proProjectInfoSubdeptsUsers:add']">新增人员
-
+
修改
-
+
删除
导出
+ v-hasPermi="['manage:proProjectInfoSubdeptsUsers:export']">导出花名册
+
+
+ 批量离场
+
+
+ 批量入场