From df167fbb8fb0418b9b275395558fccb4027c6120 Mon Sep 17 00:00:00 2001 From: yinq Date: Mon, 1 Jul 2024 16:26:53 +0800 Subject: [PATCH] =?UTF-8?q?change=20-=20add=E5=91=98=E5=B7=A5=E4=B8=8A?= =?UTF-8?q?=E4=B8=8B=E7=8F=AD=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/BaseProcessInfoController.java | 9 + .../os/mes/base/domain/BaseTeamMembers.java | 28 +++ .../RecordStaffCommuteController.java | 100 +++++++++ .../RecordStaffSalaryController.java | 4 +- .../mes/record/domain/RecordStaffCommute.java | 195 ++++++++++++++++++ .../mapper/RecordStaffCommuteMapper.java | 61 ++++++ .../service/IRecordStaffCommuteService.java | 61 ++++++ .../impl/RecordStaffCommuteServiceImpl.java | 90 ++++++++ .../mapper/mes/base/BaseTeamMembersMapper.xml | 11 +- .../mes/record/RecordStaffCommuteMapper.xml | 138 +++++++++++++ 10 files changed, 695 insertions(+), 2 deletions(-) create mode 100644 os-mes/src/main/java/com/os/mes/record/controller/RecordStaffCommuteController.java create mode 100644 os-mes/src/main/java/com/os/mes/record/domain/RecordStaffCommute.java create mode 100644 os-mes/src/main/java/com/os/mes/record/mapper/RecordStaffCommuteMapper.java create mode 100644 os-mes/src/main/java/com/os/mes/record/service/IRecordStaffCommuteService.java create mode 100644 os-mes/src/main/java/com/os/mes/record/service/impl/RecordStaffCommuteServiceImpl.java create mode 100644 os-mes/src/main/resources/mapper/mes/record/RecordStaffCommuteMapper.xml diff --git a/os-mes/src/main/java/com/os/mes/base/controller/BaseProcessInfoController.java b/os-mes/src/main/java/com/os/mes/base/controller/BaseProcessInfoController.java index aacb8c6..def288a 100644 --- a/os-mes/src/main/java/com/os/mes/base/controller/BaseProcessInfoController.java +++ b/os-mes/src/main/java/com/os/mes/base/controller/BaseProcessInfoController.java @@ -45,6 +45,15 @@ public class BaseProcessInfoController extends BaseController { return getDataTable(list); } + /** + * 查询工序信息下拉框列表 + */ + @GetMapping("/processInfoList") + public AjaxResult processInfoList(BaseProcessInfo baseProcessInfo) { + List list = baseProcessInfoService.selectBaseProcessInfoList(baseProcessInfo); + return success(list); + } + /** * 导出工序信息列表 */ diff --git a/os-mes/src/main/java/com/os/mes/base/domain/BaseTeamMembers.java b/os-mes/src/main/java/com/os/mes/base/domain/BaseTeamMembers.java index 06f10ed..71ef833 100644 --- a/os-mes/src/main/java/com/os/mes/base/domain/BaseTeamMembers.java +++ b/os-mes/src/main/java/com/os/mes/base/domain/BaseTeamMembers.java @@ -91,6 +91,34 @@ public class BaseTeamMembers extends BaseEntity { @Excel(name = "机台名称") private String machineName; + /** + * 工序编号 + */ + @Excel(name = "工序编号") + private String processCode; + + /** + * 工序名称 + */ + @Excel(name = "工序名称") + private String processName; + + public String getProcessCode() { + return processCode; + } + + public void setProcessCode(String processCode) { + this.processCode = processCode; + } + + public String getProcessName() { + return processName; + } + + public void setProcessName(String processName) { + this.processName = processName; + } + public String getStationName() { return stationName; } diff --git a/os-mes/src/main/java/com/os/mes/record/controller/RecordStaffCommuteController.java b/os-mes/src/main/java/com/os/mes/record/controller/RecordStaffCommuteController.java new file mode 100644 index 0000000..f57dede --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/record/controller/RecordStaffCommuteController.java @@ -0,0 +1,100 @@ +package com.os.mes.record.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import org.springframework.security.access.prepost.PreAuthorize; +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.os.common.annotation.Log; +import com.os.common.core.controller.BaseController; +import com.os.common.core.domain.AjaxResult; +import com.os.common.enums.BusinessType; +import com.os.mes.record.domain.RecordStaffCommute; +import com.os.mes.record.service.IRecordStaffCommuteService; +import com.os.common.utils.poi.ExcelUtil; +import com.os.common.core.page.TableDataInfo; + +/** + * 员工上下班记录Controller + * + * @author Yinq + * @date 2024-07-01 + */ +@RestController +@RequestMapping("/mes/record/recordStaffCommute") +public class RecordStaffCommuteController extends BaseController { + @Autowired + private IRecordStaffCommuteService recordStaffCommuteService; + + /** + * 查询员工上下班记录列表 + */ + @PreAuthorize("@ss.hasPermi('mes/record:recordStaffCommute:list')") + @GetMapping("/list") + public TableDataInfo list(RecordStaffCommute recordStaffCommute) { + startPage(); + List list = recordStaffCommuteService.selectRecordStaffCommuteList(recordStaffCommute); + return getDataTable(list); + } + + /** + * 导出员工上下班记录列表 + */ + @PreAuthorize("@ss.hasPermi('mes/record:recordStaffCommute:export')") + @Log(title = "员工上下班记录", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, RecordStaffCommute recordStaffCommute) { + List list = recordStaffCommuteService.selectRecordStaffCommuteList(recordStaffCommute); + ExcelUtil util = new ExcelUtil(RecordStaffCommute.class); + util.exportExcel(response, list, "员工上下班记录数据"); + } + + /** + * 获取员工上下班记录详细信息 + */ + @PreAuthorize("@ss.hasPermi('mes/record:recordStaffCommute:query')") + @GetMapping(value = "/{objId}") + public AjaxResult getInfo(@PathVariable("objId") Long objId) { + return success(recordStaffCommuteService.selectRecordStaffCommuteByObjId(objId)); + } + + /** + * 新增员工上下班记录 + */ + @PreAuthorize("@ss.hasPermi('mes/record:recordStaffCommute:add')") + @Log(title = "员工上下班记录", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody RecordStaffCommute recordStaffCommute) { + recordStaffCommute.setCreateBy(getUsername()); + return toAjax(recordStaffCommuteService.insertRecordStaffCommute(recordStaffCommute)); + } + + /** + * 修改员工上下班记录 + */ + @PreAuthorize("@ss.hasPermi('mes/record:recordStaffCommute:edit')") + @Log(title = "员工上下班记录", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody RecordStaffCommute recordStaffCommute) { + recordStaffCommute.setUpdateBy(getUsername()); + return toAjax(recordStaffCommuteService.updateRecordStaffCommute(recordStaffCommute)); + } + + /** + * 删除员工上下班记录 + */ + @PreAuthorize("@ss.hasPermi('mes/record:recordStaffCommute:remove')") + @Log(title = "员工上下班记录", businessType = BusinessType.DELETE) + @DeleteMapping("/{objIds}") + public AjaxResult remove(@PathVariable Long[] objIds) { + return toAjax(recordStaffCommuteService.deleteRecordStaffCommuteByObjIds(objIds)); + } +} diff --git a/os-mes/src/main/java/com/os/mes/record/controller/RecordStaffSalaryController.java b/os-mes/src/main/java/com/os/mes/record/controller/RecordStaffSalaryController.java index 33ec523..2477208 100644 --- a/os-mes/src/main/java/com/os/mes/record/controller/RecordStaffSalaryController.java +++ b/os-mes/src/main/java/com/os/mes/record/controller/RecordStaffSalaryController.java @@ -30,7 +30,7 @@ public class RecordStaffSalaryController extends BaseController { /** - * 班组员工工资 + * 生成班组员工工资 * @param recordStaffSalary * @return */ @@ -40,4 +40,6 @@ public class RecordStaffSalaryController extends BaseController { return success(list); } + + } diff --git a/os-mes/src/main/java/com/os/mes/record/domain/RecordStaffCommute.java b/os-mes/src/main/java/com/os/mes/record/domain/RecordStaffCommute.java new file mode 100644 index 0000000..feb0587 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/record/domain/RecordStaffCommute.java @@ -0,0 +1,195 @@ +package com.os.mes.record.domain; + +import java.math.BigDecimal; +import java.util.Date; + +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.os.common.annotation.Excel; +import com.os.common.core.domain.BaseEntity; + +/** + * 员工上下班记录对象 record_staff_commute + * + * @author Yinq + * @date 2024-07-01 + */ +public class RecordStaffCommute extends BaseEntity { + private static final long serialVersionUID = 1L; + + /** + * 主键标识 + */ + private Long objId; + + /** + * 员工ID + */ + @Excel(name = "员工ID") + private String staffId; + + /** + * 员工名称 + */ + @Excel(name = "员工名称") + private String staffName; + + /** + * 班组编号 + */ + @Excel(name = "班组编号") + private String teamCode; + + /** + * 班组名称 + */ + @Excel(name = "班组名称") + private String teamName; + + /** + * 班次(1早班 2小夜 3大夜) + */ + @Excel(name = "班次", readConverterExp = "1=早班,2=小夜,3=大夜") + private String classes; + + /** + * 上班打卡时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "上班打卡时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date startWorkTime; + + /** + * 下班打卡时间 + */ + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @Excel(name = "下班打卡时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss") + private Date endWorkTime; + + /** + * 在班时长率 + */ + @Excel(name = "在班时长率") + private BigDecimal clockingRatio; + + /** + * 是否标识 + */ + @Excel(name = "是否标识") + private String isFlag; + + /** + * 机台编号 + */ + @Excel(name = "机台编号") + private String machineCode; + + public String getStaffName() { + return staffName; + } + + public void setStaffName(String staffName) { + this.staffName = staffName; + } + + public String getTeamName() { + return teamName; + } + + public void setTeamName(String teamName) { + this.teamName = teamName; + } + + public void setObjId(Long objId) { + this.objId = objId; + } + + public Long getObjId() { + return objId; + } + + public void setStaffId(String staffId) { + this.staffId = staffId; + } + + public String getStaffId() { + return staffId; + } + + public void setTeamCode(String teamCode) { + this.teamCode = teamCode; + } + + public String getTeamCode() { + return teamCode; + } + + public void setClasses(String classes) { + this.classes = classes; + } + + public String getClasses() { + return classes; + } + + public void setStartWorkTime(Date startWorkTime) { + this.startWorkTime = startWorkTime; + } + + public Date getStartWorkTime() { + return startWorkTime; + } + + public void setEndWorkTime(Date endWorkTime) { + this.endWorkTime = endWorkTime; + } + + public Date getEndWorkTime() { + return endWorkTime; + } + + public void setClockingRatio(BigDecimal clockingRatio) { + this.clockingRatio = clockingRatio; + } + + public BigDecimal getClockingRatio() { + return clockingRatio; + } + + public void setIsFlag(String isFlag) { + this.isFlag = isFlag; + } + + public String getIsFlag() { + return isFlag; + } + + public void setMachineCode(String machineCode) { + this.machineCode = machineCode; + } + + public String getMachineCode() { + return machineCode; + } + + @Override + public String toString() { + return new ToStringBuilder(this, ToStringStyle.MULTI_LINE_STYLE) + .append("objId", getObjId()) + .append("staffId", getStaffId()) + .append("teamCode", getTeamCode()) + .append("classes", getClasses()) + .append("startWorkTime", getStartWorkTime()) + .append("endWorkTime", getEndWorkTime()) + .append("clockingRatio", getClockingRatio()) + .append("remark", getRemark()) + .append("isFlag", getIsFlag()) + .append("createBy", getCreateBy()) + .append("createTime", getCreateTime()) + .append("updateBy", getUpdateBy()) + .append("updateTime", getUpdateTime()) + .append("machineCode", getMachineCode()) + .toString(); + } +} diff --git a/os-mes/src/main/java/com/os/mes/record/mapper/RecordStaffCommuteMapper.java b/os-mes/src/main/java/com/os/mes/record/mapper/RecordStaffCommuteMapper.java new file mode 100644 index 0000000..549dcca --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/record/mapper/RecordStaffCommuteMapper.java @@ -0,0 +1,61 @@ +package com.os.mes.record.mapper; + +import java.util.List; + +import com.os.mes.record.domain.RecordStaffCommute; + +/** + * 员工上下班记录Mapper接口 + * + * @author Yinq + * @date 2024-07-01 + */ +public interface RecordStaffCommuteMapper { + /** + * 查询员工上下班记录 + * + * @param objId 员工上下班记录主键 + * @return 员工上下班记录 + */ + public RecordStaffCommute selectRecordStaffCommuteByObjId(Long objId); + + /** + * 查询员工上下班记录列表 + * + * @param recordStaffCommute 员工上下班记录 + * @return 员工上下班记录集合 + */ + public List selectRecordStaffCommuteList(RecordStaffCommute recordStaffCommute); + + /** + * 新增员工上下班记录 + * + * @param recordStaffCommute 员工上下班记录 + * @return 结果 + */ + public int insertRecordStaffCommute(RecordStaffCommute recordStaffCommute); + + /** + * 修改员工上下班记录 + * + * @param recordStaffCommute 员工上下班记录 + * @return 结果 + */ + public int updateRecordStaffCommute(RecordStaffCommute recordStaffCommute); + + /** + * 删除员工上下班记录 + * + * @param objId 员工上下班记录主键 + * @return 结果 + */ + public int deleteRecordStaffCommuteByObjId(Long objId); + + /** + * 批量删除员工上下班记录 + * + * @param objIds 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteRecordStaffCommuteByObjIds(Long[] objIds); +} diff --git a/os-mes/src/main/java/com/os/mes/record/service/IRecordStaffCommuteService.java b/os-mes/src/main/java/com/os/mes/record/service/IRecordStaffCommuteService.java new file mode 100644 index 0000000..ec40772 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/record/service/IRecordStaffCommuteService.java @@ -0,0 +1,61 @@ +package com.os.mes.record.service; + +import java.util.List; + +import com.os.mes.record.domain.RecordStaffCommute; + +/** + * 员工上下班记录Service接口 + * + * @author Yinq + * @date 2024-07-01 + */ +public interface IRecordStaffCommuteService { + /** + * 查询员工上下班记录 + * + * @param objId 员工上下班记录主键 + * @return 员工上下班记录 + */ + public RecordStaffCommute selectRecordStaffCommuteByObjId(Long objId); + + /** + * 查询员工上下班记录列表 + * + * @param recordStaffCommute 员工上下班记录 + * @return 员工上下班记录集合 + */ + public List selectRecordStaffCommuteList(RecordStaffCommute recordStaffCommute); + + /** + * 新增员工上下班记录 + * + * @param recordStaffCommute 员工上下班记录 + * @return 结果 + */ + public int insertRecordStaffCommute(RecordStaffCommute recordStaffCommute); + + /** + * 修改员工上下班记录 + * + * @param recordStaffCommute 员工上下班记录 + * @return 结果 + */ + public int updateRecordStaffCommute(RecordStaffCommute recordStaffCommute); + + /** + * 批量删除员工上下班记录 + * + * @param objIds 需要删除的员工上下班记录主键集合 + * @return 结果 + */ + public int deleteRecordStaffCommuteByObjIds(Long[] objIds); + + /** + * 删除员工上下班记录信息 + * + * @param objId 员工上下班记录主键 + * @return 结果 + */ + public int deleteRecordStaffCommuteByObjId(Long objId); +} diff --git a/os-mes/src/main/java/com/os/mes/record/service/impl/RecordStaffCommuteServiceImpl.java b/os-mes/src/main/java/com/os/mes/record/service/impl/RecordStaffCommuteServiceImpl.java new file mode 100644 index 0000000..5db2068 --- /dev/null +++ b/os-mes/src/main/java/com/os/mes/record/service/impl/RecordStaffCommuteServiceImpl.java @@ -0,0 +1,90 @@ +package com.os.mes.record.service.impl; + +import java.util.List; + +import com.os.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.os.mes.record.mapper.RecordStaffCommuteMapper; +import com.os.mes.record.domain.RecordStaffCommute; +import com.os.mes.record.service.IRecordStaffCommuteService; + +/** + * 员工上下班记录Service业务层处理 + * + * @author Yinq + * @date 2024-07-01 + */ +@Service +public class RecordStaffCommuteServiceImpl implements IRecordStaffCommuteService { + @Autowired + private RecordStaffCommuteMapper recordStaffCommuteMapper; + + /** + * 查询员工上下班记录 + * + * @param objId 员工上下班记录主键 + * @return 员工上下班记录 + */ + @Override + public RecordStaffCommute selectRecordStaffCommuteByObjId(Long objId) { + return recordStaffCommuteMapper.selectRecordStaffCommuteByObjId(objId); + } + + /** + * 查询员工上下班记录列表 + * + * @param recordStaffCommute 员工上下班记录 + * @return 员工上下班记录 + */ + @Override + public List selectRecordStaffCommuteList(RecordStaffCommute recordStaffCommute) { + return recordStaffCommuteMapper.selectRecordStaffCommuteList(recordStaffCommute); + } + + /** + * 新增员工上下班记录 + * + * @param recordStaffCommute 员工上下班记录 + * @return 结果 + */ + @Override + public int insertRecordStaffCommute(RecordStaffCommute recordStaffCommute) { + recordStaffCommute.setCreateTime(DateUtils.getNowDate()); + return recordStaffCommuteMapper.insertRecordStaffCommute(recordStaffCommute); + } + + /** + * 修改员工上下班记录 + * + * @param recordStaffCommute 员工上下班记录 + * @return 结果 + */ + @Override + public int updateRecordStaffCommute(RecordStaffCommute recordStaffCommute) { + recordStaffCommute.setUpdateTime(DateUtils.getNowDate()); + return recordStaffCommuteMapper.updateRecordStaffCommute(recordStaffCommute); + } + + /** + * 批量删除员工上下班记录 + * + * @param objIds 需要删除的员工上下班记录主键 + * @return 结果 + */ + @Override + public int deleteRecordStaffCommuteByObjIds(Long[] objIds) { + return recordStaffCommuteMapper.deleteRecordStaffCommuteByObjIds(objIds); + } + + /** + * 删除员工上下班记录信息 + * + * @param objId 员工上下班记录主键 + * @return 结果 + */ + @Override + public int deleteRecordStaffCommuteByObjId(Long objId) { + return recordStaffCommuteMapper.deleteRecordStaffCommuteByObjId(objId); + } +} diff --git a/os-mes/src/main/resources/mapper/mes/base/BaseTeamMembersMapper.xml b/os-mes/src/main/resources/mapper/mes/base/BaseTeamMembersMapper.xml index d154457..95edd99 100644 --- a/os-mes/src/main/resources/mapper/mes/base/BaseTeamMembersMapper.xml +++ b/os-mes/src/main/resources/mapper/mes/base/BaseTeamMembersMapper.xml @@ -22,6 +22,8 @@ + + @@ -41,10 +43,13 @@ btm.update_by, btm.update_time, btm.machine_code, - bdl.device_name machine_name + bdl.device_name machine_name, + btm.process_code, + bpi.process_name from base_team_members btm left join base_product_line bpl on bpl.product_line_code = btm.station_code left join base_device_ledger bdl on bdl.device_code = btm.machine_code + left join base_process_info bpi on btm.process_code = bpi.process_code + + + and rsc.staff_id = #{staffId} + and rsc.team_code = #{teamCode} + and rsc.classes = #{classes} + + and rsc.start_work_time between #{params.beginStartWorkTime} and #{params.endStartWorkTime} + + + and rsc.end_work_time between #{params.beginEndWorkTime} and #{params.endEndWorkTime} + + and rsc.clocking_ratio = #{clockingRatio} + and rsc.is_flag = #{isFlag} + and rsc.machine_code = #{machineCode} + + + + + + + insert into record_staff_commute + + staff_id, + team_code, + classes, + start_work_time, + end_work_time, + clocking_ratio, + remark, + is_flag, + create_by, + create_time, + update_by, + update_time, + machine_code, + + + #{staffId}, + #{teamCode}, + #{classes}, + #{startWorkTime}, + #{endWorkTime}, + #{clockingRatio}, + #{remark}, + #{isFlag}, + #{createBy}, + #{createTime}, + #{updateBy}, + #{updateTime}, + #{machineCode}, + + + + + update record_staff_commute + + staff_id = #{staffId}, + team_code = #{teamCode}, + classes = #{classes}, + start_work_time = #{startWorkTime}, + end_work_time = #{endWorkTime}, + clocking_ratio = #{clockingRatio}, + remark = #{remark}, + is_flag = #{isFlag}, + create_by = #{createBy}, + create_time = #{createTime}, + update_by = #{updateBy}, + update_time = #{updateTime}, + machine_code = #{machineCode}, + + where obj_id = #{objId} + + + + delete + from record_staff_commute + where obj_id = #{objId} + + + + delete from record_staff_commute where obj_id in + + #{objId} + + + \ No newline at end of file