diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProUserInoutRecord.java b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProUserInoutRecord.java index 9b2329d0..13096001 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProUserInoutRecord.java +++ b/yanzhu-common/yanzhu-common-mapper/src/main/java/com/yanzhu/manage/domain/ProUserInoutRecord.java @@ -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; } diff --git a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProUserInoutRecordMapper.xml b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProUserInoutRecordMapper.xml index 6b356408..ff7ae438 100644 --- a/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProUserInoutRecordMapper.xml +++ b/yanzhu-common/yanzhu-common-mapper/src/main/resources/mapper/manage/ProUserInoutRecordMapper.xml @@ -28,37 +28,47 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + + - 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' - and project_id = #{projectId} - and user_id = #{userId} - and user_name like concat('%', #{userName}, '%') - and user_phone = #{userPhone} - and user_picture = #{userPicture} - and user_sex = #{userSex} - and use_status = #{useStatus} - and sub_dept_id = #{subDeptId} - and sub_dept_name like concat('%', #{subDeptName}, '%') - and sub_dept_type = #{subDeptType} - and sub_dept_group = #{subDeptGroup} - and sub_dept_group_name like concat('%', #{subDeptGroupName}, '%') - and craft_type = #{craftType} - and craft_post = #{craftPost} - and is_del = #{isDel} - and state = #{state} + and pur.project_id = #{projectId} + and pur.user_id = #{userId} + and pur.user_name like concat('%', #{userName}, '%') + and pur.user_phone = #{userPhone} + and pur.user_picture = #{userPicture} + and pur.user_sex = #{userSex} + and pur.use_status = #{useStatus} + and pur.sub_dept_id = #{subDeptId} + and pur.sub_dept_name like concat('%', #{subDeptName}, '%') + and pur.sub_dept_type = #{subDeptType} + and pur.sub_dept_group = #{subDeptGroup} + and pur.sub_dept_group_name like concat('%', #{subDeptGroupName}, '%') + and pur.craft_type = #{craftType} + and pur.craft_post = #{craftPost} + and pur.is_del = #{isDel} + and pur.state = #{state} + and date(pur.create_time) >= date(#{startDate}) + and date(pur.create_time) <= date(#{endDate}) - where id = #{id} + where pur.id = #{id} diff --git a/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProMobileAttendanceDataController.java b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProMobileAttendanceDataController.java new file mode 100644 index 00000000..6bbf9360 --- /dev/null +++ b/yanzhu-modules/yanzhu-manage/src/main/java/com/yanzhu/manage/controller/ProMobileAttendanceDataController.java @@ -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 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 list = proMobileAttendanceDataService.selectProMobileAttendanceDataList(proMobileAttendanceData); + ExcelUtil util = new ExcelUtil(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)); + } +} diff --git a/yanzhu-ui-vue3/README.md b/yanzhu-ui-vue3/README.md index 59d4e131..6366228c 100644 --- a/yanzhu-ui-vue3/README.md +++ b/yanzhu-ui-vue3/README.md @@ -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, ''); \ No newline at end of file diff --git a/yanzhu-ui-vue3/src/api/manage/mobileAttendanceData.js b/yanzhu-ui-vue3/src/api/manage/mobileAttendanceData.js new file mode 100644 index 00000000..fd2bd8aa --- /dev/null +++ b/yanzhu-ui-vue3/src/api/manage/mobileAttendanceData.js @@ -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' + }) +} diff --git a/yanzhu-ui-vue3/src/views/manage/mobileAttendanceData/index.vue b/yanzhu-ui-vue3/src/views/manage/mobileAttendanceData/index.vue new file mode 100644 index 00000000..82cf4582 --- /dev/null +++ b/yanzhu-ui-vue3/src/views/manage/mobileAttendanceData/index.vue @@ -0,0 +1,363 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 搜索 + 重置 + + + + + + 新增 + + + 修改 + + + 删除 + + + 导出 + + + + + + + + + + + + + + + + {{ parseTime(scope.row.attDate, '{y}-{m}-{d}') }} + + + + + + + + + 修改 + 删除 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/yanzhu-ui-vue3/src/views/manage/userInOutRecord/index.vue b/yanzhu-ui-vue3/src/views/manage/userInOutRecord/index.vue index 9fda35b8..a6a0bf22 100644 --- a/yanzhu-ui-vue3/src/views/manage/userInOutRecord/index.vue +++ b/yanzhu-ui-vue3/src/views/manage/userInOutRecord/index.vue @@ -1,7 +1,6 @@ - @@ -9,10 +8,14 @@ - - - - + + + + + + + 搜索 @@ -39,33 +42,50 @@ --> - - - - - - + - - - - - - - - - - - - - - + - 修改 - 删除 + + {{ + scope.row.userSex == "女" ? "女" : "男" + }} + + + + + + + 在场 + 离场 + + + + + + + + + + + + 班组长 + + + + + + + + {{ scope.row.createTime }} + + + + + + @@ -136,7 +156,26 @@ import { } from "@/api/manage/userInOutRecord"; const { proxy } = getCurrentInstance(); - +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 +216,15 @@ const { queryParams, form, rules } = toRefs(data); /** 查询员工出入场记录列表 */ function getList() { loading.value = true; - listUserInOutRecord(queryParams.value).then((response) => { + console.log(dateRange) + let postData={ + ...queryParams.value + }; + if(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;