This commit is contained in:
jhd
2026-05-15 16:59:49 +08:00
60 changed files with 5843 additions and 16 deletions

View File

@@ -0,0 +1,99 @@
package com.klp.mes.qc.controller;
import java.util.List;
import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.klp.common.annotation.RepeatSubmit;
import com.klp.common.annotation.Log;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.validate.AddGroup;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.common.utils.poi.ExcelUtil;
import com.klp.mes.qc.domain.vo.QcCertificateVo;
import com.klp.mes.qc.domain.bo.QcCertificateBo;
import com.klp.mes.qc.service.IQcCertificateService;
import com.klp.common.core.page.TableDataInfo;
/**
* 质量证明书主
*
* @author klp
* @date 2026-05-15
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/qc/certificate")
public class QcCertificateController extends BaseController {
private final IQcCertificateService iQcCertificateService;
/**
* 查询质量证明书主列表
*/
@GetMapping("/list")
public TableDataInfo<QcCertificateVo> list(QcCertificateBo bo, PageQuery pageQuery) {
return iQcCertificateService.queryPageList(bo, pageQuery);
}
/**
* 导出质量证明书主列表
*/
@Log(title = "质量证明书主", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(QcCertificateBo bo, HttpServletResponse response) {
List<QcCertificateVo> list = iQcCertificateService.queryList(bo);
ExcelUtil.exportExcel(list, "质量证明书主", QcCertificateVo.class, response);
}
/**
* 获取质量证明书主详细信息
*
* @param certificateId 主键
*/
@GetMapping("/{certificateId}")
public R<QcCertificateVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long certificateId) {
return R.ok(iQcCertificateService.queryById(certificateId));
}
/**
* 新增质量证明书主
*/
@Log(title = "质量证明书主", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody QcCertificateBo bo) {
return toAjax(iQcCertificateService.insertByBo(bo));
}
/**
* 修改质量证明书主
*/
@Log(title = "质量证明书主", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody QcCertificateBo bo) {
return toAjax(iQcCertificateService.updateByBo(bo));
}
/**
* 删除质量证明书主
*
* @param certificateIds 主键串
*/
@Log(title = "质量证明书主", businessType = BusinessType.DELETE)
@DeleteMapping("/{certificateIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] certificateIds) {
return toAjax(iQcCertificateService.deleteWithValidByIds(Arrays.asList(certificateIds), true));
}
}

View File

@@ -0,0 +1,99 @@
package com.klp.mes.qc.controller;
import java.util.List;
import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.klp.common.annotation.RepeatSubmit;
import com.klp.common.annotation.Log;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.validate.AddGroup;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.common.utils.poi.ExcelUtil;
import com.klp.mes.qc.domain.vo.QcCertificateItemVo;
import com.klp.mes.qc.domain.bo.QcCertificateItemBo;
import com.klp.mes.qc.service.IQcCertificateItemService;
import com.klp.common.core.page.TableDataInfo;
/**
* 质量证明书明细
*
* @author klp
* @date 2026-05-15
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/qc/certificateItem")
public class QcCertificateItemController extends BaseController {
private final IQcCertificateItemService iQcCertificateItemService;
/**
* 查询质量证明书明细列表
*/
@GetMapping("/list")
public TableDataInfo<QcCertificateItemVo> list(QcCertificateItemBo bo, PageQuery pageQuery) {
return iQcCertificateItemService.queryPageList(bo, pageQuery);
}
/**
* 导出质量证明书明细列表
*/
@Log(title = "质量证明书明细", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(QcCertificateItemBo bo, HttpServletResponse response) {
List<QcCertificateItemVo> list = iQcCertificateItemService.queryList(bo);
ExcelUtil.exportExcel(list, "质量证明书明细", QcCertificateItemVo.class, response);
}
/**
* 获取质量证明书明细详细信息
*
* @param itemId 主键
*/
@GetMapping("/{itemId}")
public R<QcCertificateItemVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long itemId) {
return R.ok(iQcCertificateItemService.queryById(itemId));
}
/**
* 新增质量证明书明细
*/
@Log(title = "质量证明书明细", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody QcCertificateItemBo bo) {
return toAjax(iQcCertificateItemService.insertByBo(bo));
}
/**
* 修改质量证明书明细
*/
@Log(title = "质量证明书明细", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody QcCertificateItemBo bo) {
return toAjax(iQcCertificateItemService.updateByBo(bo));
}
/**
* 删除质量证明书明细
*
* @param itemIds 主键串
*/
@Log(title = "质量证明书明细", businessType = BusinessType.DELETE)
@DeleteMapping("/{itemIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] itemIds) {
return toAjax(iQcCertificateItemService.deleteWithValidByIds(Arrays.asList(itemIds), true));
}
}

View File

@@ -0,0 +1,99 @@
package com.klp.mes.qc.controller;
import java.util.List;
import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.klp.common.annotation.RepeatSubmit;
import com.klp.common.annotation.Log;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.validate.AddGroup;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.common.utils.poi.ExcelUtil;
import com.klp.mes.qc.domain.vo.QcInspectionItemVo;
import com.klp.mes.qc.domain.bo.QcInspectionItemBo;
import com.klp.mes.qc.service.IQcInspectionItemService;
import com.klp.common.core.page.TableDataInfo;
/**
* 检验任务项目+结果
*
* @author klp
* @date 2026-05-15
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/qc/inspectionItem")
public class QcInspectionItemController extends BaseController {
private final IQcInspectionItemService iQcInspectionItemService;
/**
* 查询检验任务项目+结果列表
*/
@GetMapping("/list")
public TableDataInfo<QcInspectionItemVo> list(QcInspectionItemBo bo, PageQuery pageQuery) {
return iQcInspectionItemService.queryPageList(bo, pageQuery);
}
/**
* 导出检验任务项目+结果列表
*/
@Log(title = "检验任务项目+结果", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(QcInspectionItemBo bo, HttpServletResponse response) {
List<QcInspectionItemVo> list = iQcInspectionItemService.queryList(bo);
ExcelUtil.exportExcel(list, "检验任务项目+结果", QcInspectionItemVo.class, response);
}
/**
* 获取检验任务项目+结果详细信息
*
* @param itemId 主键
*/
@GetMapping("/{itemId}")
public R<QcInspectionItemVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long itemId) {
return R.ok(iQcInspectionItemService.queryById(itemId));
}
/**
* 新增检验任务项目+结果
*/
@Log(title = "检验任务项目+结果", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody QcInspectionItemBo bo) {
return toAjax(iQcInspectionItemService.insertByBo(bo));
}
/**
* 修改检验任务项目+结果
*/
@Log(title = "检验任务项目+结果", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody QcInspectionItemBo bo) {
return toAjax(iQcInspectionItemService.updateByBo(bo));
}
/**
* 删除检验任务项目+结果
*
* @param itemIds 主键串
*/
@Log(title = "检验任务项目+结果", businessType = BusinessType.DELETE)
@DeleteMapping("/{itemIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] itemIds) {
return toAjax(iQcInspectionItemService.deleteWithValidByIds(Arrays.asList(itemIds), true));
}
}

View File

@@ -0,0 +1,99 @@
package com.klp.mes.qc.controller;
import java.util.List;
import java.util.Arrays;
import lombok.RequiredArgsConstructor;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.*;
import org.springframework.web.bind.annotation.*;
import org.springframework.validation.annotation.Validated;
import com.klp.common.annotation.RepeatSubmit;
import com.klp.common.annotation.Log;
import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.validate.AddGroup;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.common.utils.poi.ExcelUtil;
import com.klp.mes.qc.domain.vo.QcInspectionTaskVo;
import com.klp.mes.qc.domain.bo.QcInspectionTaskBo;
import com.klp.mes.qc.service.IQcInspectionTaskService;
import com.klp.common.core.page.TableDataInfo;
/**
* 检验任务主
*
* @author klp
* @date 2026-05-15
*/
@Validated
@RequiredArgsConstructor
@RestController
@RequestMapping("/qc/inspectionTask")
public class QcInspectionTaskController extends BaseController {
private final IQcInspectionTaskService iQcInspectionTaskService;
/**
* 查询检验任务主列表
*/
@GetMapping("/list")
public TableDataInfo<QcInspectionTaskVo> list(QcInspectionTaskBo bo, PageQuery pageQuery) {
return iQcInspectionTaskService.queryPageList(bo, pageQuery);
}
/**
* 导出检验任务主列表
*/
@Log(title = "检验任务主", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(QcInspectionTaskBo bo, HttpServletResponse response) {
List<QcInspectionTaskVo> list = iQcInspectionTaskService.queryList(bo);
ExcelUtil.exportExcel(list, "检验任务主", QcInspectionTaskVo.class, response);
}
/**
* 获取检验任务主详细信息
*
* @param taskId 主键
*/
@GetMapping("/{taskId}")
public R<QcInspectionTaskVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable Long taskId) {
return R.ok(iQcInspectionTaskService.queryById(taskId));
}
/**
* 新增检验任务主
*/
@Log(title = "检验任务主", businessType = BusinessType.INSERT)
@RepeatSubmit()
@PostMapping()
public R<Void> add(@Validated(AddGroup.class) @RequestBody QcInspectionTaskBo bo) {
return toAjax(iQcInspectionTaskService.insertByBo(bo));
}
/**
* 修改检验任务主
*/
@Log(title = "检验任务主", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody QcInspectionTaskBo bo) {
return toAjax(iQcInspectionTaskService.updateByBo(bo));
}
/**
* 删除检验任务主
*
* @param taskIds 主键串
*/
@Log(title = "检验任务主", businessType = BusinessType.DELETE)
@DeleteMapping("/{taskIds}")
public R<Void> remove(@NotEmpty(message = "主键不能为空")
@PathVariable Long[] taskIds) {
return toAjax(iQcInspectionTaskService.deleteWithValidByIds(Arrays.asList(taskIds), true));
}
}

View File

@@ -0,0 +1,71 @@
package com.klp.mes.qc.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.klp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 质量证明书主对象 qc_certificate
*
* @author klp
* @date 2026-05-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("qc_certificate")
public class QcCertificate extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* 证书ID
*/
@TableId(value = "certificate_id")
private Long certificateId;
/**
* 证明书号
*/
private String certificateNo;
/**
* 合同号
*/
private String contractNo;
/**
* 产品名称
*/
private String productName;
/**
* 执行标准
*/
private String standard;
/**
* 收货单位
*/
private String consignee;
/**
* 生产厂家
*/
private String manufacturer;
/**
* 签发日期
*/
private Date issueDate;
/**
* 质保证明说明(注释)
*/
private String note;
/**
* 备注
*/
private String remark;
/**
* 删除标志0=正常1=已删除)
*/
@TableLogic
private Integer delFlag;
}

View File

@@ -0,0 +1,122 @@
package com.klp.mes.qc.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.klp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
/**
* 质量证明书明细对象 qc_certificate_item
*
* @author klp
* @date 2026-05-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("qc_certificate_item")
public class QcCertificateItem extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* 明细ID
*/
@TableId(value = "item_id")
private Long itemId;
/**
* 证书ID
*/
private Long certificateId;
/**
* 钢卷号
*/
private String coilNo;
/**
* 炉号
*/
private String heatNo;
/**
* 材质
*/
private String materialType;
/**
* 规格(mm)
*/
private String size;
/**
* 件数
*/
private Long pieces;
/**
* 重量(t)
*/
private BigDecimal weight;
/**
* C
*/
private BigDecimal c;
/**
* Si
*/
private BigDecimal si;
/**
* Mn
*/
private BigDecimal mn;
/**
* P
*/
private BigDecimal p;
/**
* S
*/
private BigDecimal s;
/**
* Als
*/
private BigDecimal als;
/**
* 拉伸试验-屈服强度(MPa)
*/
private BigDecimal yieldStrength;
/**
* 拉伸试验-抗拉强度(MPa)
*/
private BigDecimal tensileStrength;
/**
* 拉伸试验-伸长率(%)
*/
private BigDecimal elongation;
/**
* 硬度实验(HRB)
*/
private BigDecimal hardness;
/**
* 弯曲试验
*/
private String bendingTest;
/**
* 表面质量
*/
private String surfaceQuality;
/**
* 表面结构
*/
private String surfaceStructure;
/**
* 边缘状态
*/
private String edgeStatus;
/**
* 备注
*/
private String remark;
/**
* 删除标志0=正常1=已删除)
*/
@TableLogic
private Integer delFlag;
}

View File

@@ -0,0 +1,88 @@
package com.klp.mes.qc.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.klp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 检验任务项目+结果对象 qc_inspection_item
*
* @author klp
* @date 2026-05-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("qc_inspection_item")
public class QcInspectionItem extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* 明细ID
*/
@TableId(value = "item_id")
private Long itemId;
/**
* 任务ID
*/
private Long taskId;
/**
* 检验项目名称
*/
private String itemName;
/**
* 标准值
*/
private String standardValue;
/**
* 上限
*/
private BigDecimal upperLimit;
/**
* 下限
*/
private BigDecimal lowerLimit;
/**
* 单位
*/
private String unit;
/**
* 定性/定量
*/
private String itemType;
/**
* 检验值
*/
private String inspectValue;
/**
* 是否合格0不合格 1合格
*/
private Integer isQualified;
/**
* 判定结果
*/
private String judgeResult;
/**
* 检验人
*/
private String inspectUser;
/**
* 检验时间
*/
private Date inspectTime;
/**
* 备注
*/
private String remark;
/**
* 删除标志0=正常1=已删除)
*/
@TableLogic
private Integer delFlag;
}

View File

@@ -0,0 +1,87 @@
package com.klp.mes.qc.domain;
import com.baomidou.mybatisplus.annotation.*;
import com.klp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 检验任务主对象 qc_inspection_task
*
* @author klp
* @date 2026-05-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("qc_inspection_task")
public class QcInspectionTask extends BaseEntity {
private static final long serialVersionUID=1L;
/**
* 任务ID
*/
@TableId(value = "task_id")
private Long taskId;
/**
* 任务编号
*/
private String taskCode;
/**
* 任务类型(内控/产品检验)
*/
private String taskType;
/**
* 来源类型(生产/采购/库存)
*/
private String sourceType;
/**
* 来源单据ID工单/入库单等)
*/
private Long sourceId;
/**
* 检验方案ID
*/
private Long schemeId;
/**
* 检验方案名称
*/
private String schemeName;
/**
* 状态0待检验 1检验中 2待审核 3已完成 4已驳回
*/
private Integer status;
/**
* 检验人
*/
private String inspectUser;
/**
* 检验时间
*/
private Date inspectTime;
/**
* 审核人
*/
private String auditUser;
/**
* 审核时间
*/
private Date auditTime;
/**
* 最终结果(合格/不合格)
*/
private String result;
/**
* 备注
*/
private String remark;
/**
* 删除标志0=正常1=已删除)
*/
@TableLogic
private Integer delFlag;
}

View File

@@ -0,0 +1,73 @@
package com.klp.mes.qc.domain.bo;
import com.klp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 质量证明书主业务对象 qc_certificate
*
* @author klp
* @date 2026-05-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class QcCertificateBo extends BaseEntity {
/**
* 证书ID
*/
private Long certificateId;
/**
* 证明书号
*/
private String certificateNo;
/**
* 合同号
*/
private String contractNo;
/**
* 产品名称
*/
private String productName;
/**
* 执行标准
*/
private String standard;
/**
* 收货单位
*/
private String consignee;
/**
* 生产厂家
*/
private String manufacturer;
/**
* 签发日期
*/
private Date issueDate;
/**
* 质保证明说明(注释)
*/
private String note;
/**
* 备注
*/
private String remark;
}

View File

@@ -0,0 +1,137 @@
package com.klp.mes.qc.domain.bo;
import com.klp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.math.BigDecimal;
/**
* 质量证明书明细业务对象 qc_certificate_item
*
* @author klp
* @date 2026-05-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class QcCertificateItemBo extends BaseEntity {
/**
* 明细ID
*/
private Long itemId;
/**
* 证书ID
*/
private Long certificateId;
/**
* 钢卷号
*/
private String coilNo;
/**
* 炉号
*/
private String heatNo;
/**
* 材质
*/
private String materialType;
/**
* 规格(mm)
*/
private String size;
/**
* 件数
*/
private Long pieces;
/**
* 重量(t)
*/
private BigDecimal weight;
/**
* C
*/
private BigDecimal c;
/**
* Si
*/
private BigDecimal si;
/**
* Mn
*/
private BigDecimal mn;
/**
* P
*/
private BigDecimal p;
/**
* S
*/
private BigDecimal s;
/**
* Als
*/
private BigDecimal als;
/**
* 拉伸试验-屈服强度(MPa)
*/
private BigDecimal yieldStrength;
/**
* 拉伸试验-抗拉强度(MPa)
*/
private BigDecimal tensileStrength;
/**
* 拉伸试验-伸长率(%)
*/
private BigDecimal elongation;
/**
* 硬度实验(HRB)
*/
private BigDecimal hardness;
/**
* 弯曲试验
*/
private String bendingTest;
/**
* 表面质量
*/
private String surfaceQuality;
/**
* 表面结构
*/
private String surfaceStructure;
/**
* 边缘状态
*/
private String edgeStatus;
/**
* 备注
*/
private String remark;
}

View File

@@ -0,0 +1,94 @@
package com.klp.mes.qc.domain.bo;
import com.klp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 检验任务项目+结果业务对象 qc_inspection_item
*
* @author klp
* @date 2026-05-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class QcInspectionItemBo extends BaseEntity {
/**
* 明细ID
*/
private Long itemId;
/**
* 任务ID
*/
private Long taskId;
/**
* 检验项目名称
*/
private String itemName;
/**
* 标准值
*/
private String standardValue;
/**
* 上限
*/
private BigDecimal upperLimit;
/**
* 下限
*/
private BigDecimal lowerLimit;
/**
* 单位
*/
private String unit;
/**
* 定性/定量
*/
private String itemType;
/**
* 检验值
*/
private String inspectValue;
/**
* 是否合格0不合格 1合格
*/
private Integer isQualified;
/**
* 判定结果
*/
private String judgeResult;
/**
* 检验人
*/
private String inspectUser;
/**
* 检验时间
*/
private Date inspectTime;
/**
* 备注
*/
private String remark;
}

View File

@@ -0,0 +1,93 @@
package com.klp.mes.qc.domain.bo;
import com.klp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import javax.validation.constraints.*;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
/**
* 检验任务主业务对象 qc_inspection_task
*
* @author klp
* @date 2026-05-15
*/
@Data
@EqualsAndHashCode(callSuper = true)
public class QcInspectionTaskBo extends BaseEntity {
/**
* 任务ID
*/
private Long taskId;
/**
* 任务编号
*/
private String taskCode;
/**
* 任务类型(内控/产品检验)
*/
private String taskType;
/**
* 来源类型(生产/采购/库存)
*/
private String sourceType;
/**
* 来源单据ID工单/入库单等)
*/
private Long sourceId;
/**
* 检验方案ID
*/
private Long schemeId;
/**
* 检验方案名称
*/
private String schemeName;
/**
* 状态0待检验 1检验中 2待审核 3已完成 4已驳回
*/
private Integer status;
/**
* 检验人
*/
private String inspectUser;
/**
* 检验时间
*/
private Date inspectTime;
/**
* 审核人
*/
private String auditUser;
/**
* 审核时间
*/
private Date auditTime;
/**
* 最终结果(合格/不合格)
*/
private String result;
/**
* 备注
*/
private String remark;
}

View File

@@ -0,0 +1,162 @@
package com.klp.mes.qc.domain.vo;
import java.math.BigDecimal;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.klp.common.annotation.ExcelDictFormat;
import com.klp.common.convert.ExcelDictConvert;
import lombok.Data;
/**
* 质量证明书明细视图对象 qc_certificate_item
*
* @author klp
* @date 2026-05-15
*/
@Data
@ExcelIgnoreUnannotated
public class QcCertificateItemVo {
private static final long serialVersionUID = 1L;
/**
* 明细ID
*/
@ExcelProperty(value = "明细ID")
private Long itemId;
/**
* 证书ID
*/
@ExcelProperty(value = "证书ID")
private Long certificateId;
/**
* 钢卷号
*/
@ExcelProperty(value = "钢卷号")
private String coilNo;
/**
* 炉号
*/
@ExcelProperty(value = "炉号")
private String heatNo;
/**
* 材质
*/
@ExcelProperty(value = "材质")
private String materialType;
/**
* 规格(mm)
*/
@ExcelProperty(value = "规格(mm)")
private String size;
/**
* 件数
*/
@ExcelProperty(value = "件数")
private Long pieces;
/**
* 重量(t)
*/
@ExcelProperty(value = "重量(t)")
private BigDecimal weight;
/**
* C
*/
@ExcelProperty(value = "C")
private BigDecimal c;
/**
* Si
*/
@ExcelProperty(value = "Si")
private BigDecimal si;
/**
* Mn
*/
@ExcelProperty(value = "Mn")
private BigDecimal mn;
/**
* P
*/
@ExcelProperty(value = "P")
private BigDecimal p;
/**
* S
*/
@ExcelProperty(value = "S")
private BigDecimal s;
/**
* Als
*/
@ExcelProperty(value = "Als")
private BigDecimal als;
/**
* 拉伸试验-屈服强度(MPa)
*/
@ExcelProperty(value = "拉伸试验-屈服强度(MPa)")
private BigDecimal yieldStrength;
/**
* 拉伸试验-抗拉强度(MPa)
*/
@ExcelProperty(value = "拉伸试验-抗拉强度(MPa)")
private BigDecimal tensileStrength;
/**
* 拉伸试验-伸长率(%)
*/
@ExcelProperty(value = "拉伸试验-伸长率(%)")
private BigDecimal elongation;
/**
* 硬度实验(HRB)
*/
@ExcelProperty(value = "硬度实验(HRB)")
private BigDecimal hardness;
/**
* 弯曲试验
*/
@ExcelProperty(value = "弯曲试验")
private String bendingTest;
/**
* 表面质量
*/
@ExcelProperty(value = "表面质量")
private String surfaceQuality;
/**
* 表面结构
*/
@ExcelProperty(value = "表面结构")
private String surfaceStructure;
/**
* 边缘状态
*/
@ExcelProperty(value = "边缘状态")
private String edgeStatus;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

View File

@@ -0,0 +1,86 @@
package com.klp.mes.qc.domain.vo;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.klp.common.annotation.ExcelDictFormat;
import com.klp.common.convert.ExcelDictConvert;
import lombok.Data;
/**
* 质量证明书主视图对象 qc_certificate
*
* @author klp
* @date 2026-05-15
*/
@Data
@ExcelIgnoreUnannotated
public class QcCertificateVo {
private static final long serialVersionUID = 1L;
/**
* 证书ID
*/
@ExcelProperty(value = "证书ID")
private Long certificateId;
/**
* 证明书号
*/
@ExcelProperty(value = "证明书号")
private String certificateNo;
/**
* 合同号
*/
@ExcelProperty(value = "合同号")
private String contractNo;
/**
* 产品名称
*/
@ExcelProperty(value = "产品名称")
private String productName;
/**
* 执行标准
*/
@ExcelProperty(value = "执行标准")
private String standard;
/**
* 收货单位
*/
@ExcelProperty(value = "收货单位")
private String consignee;
/**
* 生产厂家
*/
@ExcelProperty(value = "生产厂家")
private String manufacturer;
/**
* 签发日期
*/
@ExcelProperty(value = "签发日期")
private Date issueDate;
/**
* 质保证明说明(注释)
*/
@ExcelProperty(value = "质保证明说明", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "注=释")
private String note;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

View File

@@ -0,0 +1,111 @@
package com.klp.mes.qc.domain.vo;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.klp.common.annotation.ExcelDictFormat;
import com.klp.common.convert.ExcelDictConvert;
import lombok.Data;
/**
* 检验任务项目+结果视图对象 qc_inspection_item
*
* @author klp
* @date 2026-05-15
*/
@Data
@ExcelIgnoreUnannotated
public class QcInspectionItemVo {
private static final long serialVersionUID = 1L;
/**
* 明细ID
*/
@ExcelProperty(value = "明细ID")
private Long itemId;
/**
* 任务ID
*/
@ExcelProperty(value = "任务ID")
private Long taskId;
/**
* 检验项目名称
*/
@ExcelProperty(value = "检验项目名称")
private String itemName;
/**
* 标准值
*/
@ExcelProperty(value = "标准值")
private String standardValue;
/**
* 上限
*/
@ExcelProperty(value = "上限")
private BigDecimal upperLimit;
/**
* 下限
*/
@ExcelProperty(value = "下限")
private BigDecimal lowerLimit;
/**
* 单位
*/
@ExcelProperty(value = "单位")
private String unit;
/**
* 定性/定量
*/
@ExcelProperty(value = "定性/定量")
private String itemType;
/**
* 检验值
*/
@ExcelProperty(value = "检验值")
private String inspectValue;
/**
* 是否合格0不合格 1合格
*/
@ExcelProperty(value = "是否合格", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "0=不合格,1=合格")
private Integer isQualified;
/**
* 判定结果
*/
@ExcelProperty(value = "判定结果")
private String judgeResult;
/**
* 检验人
*/
@ExcelProperty(value = "检验人")
private String inspectUser;
/**
* 检验时间
*/
@ExcelProperty(value = "检验时间")
private Date inspectTime;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

View File

@@ -0,0 +1,114 @@
package com.klp.mes.qc.domain.vo;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty;
import com.klp.common.annotation.ExcelDictFormat;
import com.klp.common.convert.ExcelDictConvert;
import lombok.Data;
/**
* 检验任务主视图对象 qc_inspection_task
*
* @author klp
* @date 2026-05-15
*/
@Data
@ExcelIgnoreUnannotated
public class QcInspectionTaskVo {
private static final long serialVersionUID = 1L;
/**
* 任务ID
*/
@ExcelProperty(value = "任务ID")
private Long taskId;
/**
* 任务编号
*/
@ExcelProperty(value = "任务编号")
private String taskCode;
/**
* 任务类型(内控/产品检验)
*/
@ExcelProperty(value = "任务类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "内=控/产品检验")
private String taskType;
/**
* 来源类型(生产/采购/库存)
*/
@ExcelProperty(value = "来源类型", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "生=产/采购/库存")
private String sourceType;
/**
* 来源单据ID工单/入库单等)
*/
@ExcelProperty(value = "来源单据ID", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "工=单/入库单等")
private Long sourceId;
/**
* 检验方案ID
*/
@ExcelProperty(value = "检验方案ID")
private Long schemeId;
/**
* 检验方案名称
*/
@ExcelProperty(value = "检验方案名称")
private String schemeName;
/**
* 状态0待检验 1检验中 2待审核 3已完成 4已驳回
*/
@ExcelProperty(value = "状态", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "0=待检验,1=检验中,2=待审核,3=已完成,4=已驳回")
private Integer status;
/**
* 检验人
*/
@ExcelProperty(value = "检验人")
private String inspectUser;
/**
* 检验时间
*/
@ExcelProperty(value = "检验时间")
private Date inspectTime;
/**
* 审核人
*/
@ExcelProperty(value = "审核人")
private String auditUser;
/**
* 审核时间
*/
@ExcelProperty(value = "审核时间")
private Date auditTime;
/**
* 最终结果(合格/不合格)
*/
@ExcelProperty(value = "最终结果", converter = ExcelDictConvert.class)
@ExcelDictFormat(readConverterExp = "合=格/不合格")
private String result;
/**
* 备注
*/
@ExcelProperty(value = "备注")
private String remark;
}

View File

@@ -0,0 +1,15 @@
package com.klp.mes.qc.mapper;
import com.klp.mes.qc.domain.QcCertificateItem;
import com.klp.mes.qc.domain.vo.QcCertificateItemVo;
import com.klp.common.core.mapper.BaseMapperPlus;
/**
* 质量证明书明细Mapper接口
*
* @author klp
* @date 2026-05-15
*/
public interface QcCertificateItemMapper extends BaseMapperPlus<QcCertificateItemMapper, QcCertificateItem, QcCertificateItemVo> {
}

View File

@@ -0,0 +1,15 @@
package com.klp.mes.qc.mapper;
import com.klp.mes.qc.domain.QcCertificate;
import com.klp.mes.qc.domain.vo.QcCertificateVo;
import com.klp.common.core.mapper.BaseMapperPlus;
/**
* 质量证明书主Mapper接口
*
* @author klp
* @date 2026-05-15
*/
public interface QcCertificateMapper extends BaseMapperPlus<QcCertificateMapper, QcCertificate, QcCertificateVo> {
}

View File

@@ -0,0 +1,15 @@
package com.klp.mes.qc.mapper;
import com.klp.mes.qc.domain.QcInspectionItem;
import com.klp.mes.qc.domain.vo.QcInspectionItemVo;
import com.klp.common.core.mapper.BaseMapperPlus;
/**
* 检验任务项目+结果Mapper接口
*
* @author klp
* @date 2026-05-15
*/
public interface QcInspectionItemMapper extends BaseMapperPlus<QcInspectionItemMapper, QcInspectionItem, QcInspectionItemVo> {
}

View File

@@ -0,0 +1,15 @@
package com.klp.mes.qc.mapper;
import com.klp.mes.qc.domain.QcInspectionTask;
import com.klp.mes.qc.domain.vo.QcInspectionTaskVo;
import com.klp.common.core.mapper.BaseMapperPlus;
/**
* 检验任务主Mapper接口
*
* @author klp
* @date 2026-05-15
*/
public interface QcInspectionTaskMapper extends BaseMapperPlus<QcInspectionTaskMapper, QcInspectionTask, QcInspectionTaskVo> {
}

View File

@@ -0,0 +1,49 @@
package com.klp.mes.qc.service;
import com.klp.mes.qc.domain.QcCertificateItem;
import com.klp.mes.qc.domain.vo.QcCertificateItemVo;
import com.klp.mes.qc.domain.bo.QcCertificateItemBo;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* 质量证明书明细Service接口
*
* @author klp
* @date 2026-05-15
*/
public interface IQcCertificateItemService {
/**
* 查询质量证明书明细
*/
QcCertificateItemVo queryById(Long itemId);
/**
* 查询质量证明书明细列表
*/
TableDataInfo<QcCertificateItemVo> queryPageList(QcCertificateItemBo bo, PageQuery pageQuery);
/**
* 查询质量证明书明细列表
*/
List<QcCertificateItemVo> queryList(QcCertificateItemBo bo);
/**
* 新增质量证明书明细
*/
Boolean insertByBo(QcCertificateItemBo bo);
/**
* 修改质量证明书明细
*/
Boolean updateByBo(QcCertificateItemBo bo);
/**
* 校验并批量删除质量证明书明细信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@@ -0,0 +1,49 @@
package com.klp.mes.qc.service;
import com.klp.mes.qc.domain.QcCertificate;
import com.klp.mes.qc.domain.vo.QcCertificateVo;
import com.klp.mes.qc.domain.bo.QcCertificateBo;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* 质量证明书主Service接口
*
* @author klp
* @date 2026-05-15
*/
public interface IQcCertificateService {
/**
* 查询质量证明书主
*/
QcCertificateVo queryById(Long certificateId);
/**
* 查询质量证明书主列表
*/
TableDataInfo<QcCertificateVo> queryPageList(QcCertificateBo bo, PageQuery pageQuery);
/**
* 查询质量证明书主列表
*/
List<QcCertificateVo> queryList(QcCertificateBo bo);
/**
* 新增质量证明书主
*/
Boolean insertByBo(QcCertificateBo bo);
/**
* 修改质量证明书主
*/
Boolean updateByBo(QcCertificateBo bo);
/**
* 校验并批量删除质量证明书主信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@@ -0,0 +1,49 @@
package com.klp.mes.qc.service;
import com.klp.mes.qc.domain.QcInspectionItem;
import com.klp.mes.qc.domain.vo.QcInspectionItemVo;
import com.klp.mes.qc.domain.bo.QcInspectionItemBo;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* 检验任务项目+结果Service接口
*
* @author klp
* @date 2026-05-15
*/
public interface IQcInspectionItemService {
/**
* 查询检验任务项目+结果
*/
QcInspectionItemVo queryById(Long itemId);
/**
* 查询检验任务项目+结果列表
*/
TableDataInfo<QcInspectionItemVo> queryPageList(QcInspectionItemBo bo, PageQuery pageQuery);
/**
* 查询检验任务项目+结果列表
*/
List<QcInspectionItemVo> queryList(QcInspectionItemBo bo);
/**
* 新增检验任务项目+结果
*/
Boolean insertByBo(QcInspectionItemBo bo);
/**
* 修改检验任务项目+结果
*/
Boolean updateByBo(QcInspectionItemBo bo);
/**
* 校验并批量删除检验任务项目+结果信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@@ -0,0 +1,49 @@
package com.klp.mes.qc.service;
import com.klp.mes.qc.domain.QcInspectionTask;
import com.klp.mes.qc.domain.vo.QcInspectionTaskVo;
import com.klp.mes.qc.domain.bo.QcInspectionTaskBo;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery;
import java.util.Collection;
import java.util.List;
/**
* 检验任务主Service接口
*
* @author klp
* @date 2026-05-15
*/
public interface IQcInspectionTaskService {
/**
* 查询检验任务主
*/
QcInspectionTaskVo queryById(Long taskId);
/**
* 查询检验任务主列表
*/
TableDataInfo<QcInspectionTaskVo> queryPageList(QcInspectionTaskBo bo, PageQuery pageQuery);
/**
* 查询检验任务主列表
*/
List<QcInspectionTaskVo> queryList(QcInspectionTaskBo bo);
/**
* 新增检验任务主
*/
Boolean insertByBo(QcInspectionTaskBo bo);
/**
* 修改检验任务主
*/
Boolean updateByBo(QcInspectionTaskBo bo);
/**
* 校验并批量删除检验任务主信息
*/
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
}

View File

@@ -0,0 +1,129 @@
package com.klp.mes.qc.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.klp.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.klp.mes.qc.domain.bo.QcCertificateItemBo;
import com.klp.mes.qc.domain.vo.QcCertificateItemVo;
import com.klp.mes.qc.domain.QcCertificateItem;
import com.klp.mes.qc.mapper.QcCertificateItemMapper;
import com.klp.mes.qc.service.IQcCertificateItemService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 质量证明书明细Service业务层处理
*
* @author klp
* @date 2026-05-15
*/
@RequiredArgsConstructor
@Service
public class QcCertificateItemServiceImpl implements IQcCertificateItemService {
private final QcCertificateItemMapper baseMapper;
/**
* 查询质量证明书明细
*/
@Override
public QcCertificateItemVo queryById(Long itemId){
return baseMapper.selectVoById(itemId);
}
/**
* 查询质量证明书明细列表
*/
@Override
public TableDataInfo<QcCertificateItemVo> queryPageList(QcCertificateItemBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<QcCertificateItem> lqw = buildQueryWrapper(bo);
Page<QcCertificateItemVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询质量证明书明细列表
*/
@Override
public List<QcCertificateItemVo> queryList(QcCertificateItemBo bo) {
LambdaQueryWrapper<QcCertificateItem> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<QcCertificateItem> buildQueryWrapper(QcCertificateItemBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<QcCertificateItem> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getCertificateId() != null, QcCertificateItem::getCertificateId, bo.getCertificateId());
lqw.eq(StringUtils.isNotBlank(bo.getCoilNo()), QcCertificateItem::getCoilNo, bo.getCoilNo());
lqw.eq(StringUtils.isNotBlank(bo.getHeatNo()), QcCertificateItem::getHeatNo, bo.getHeatNo());
lqw.eq(StringUtils.isNotBlank(bo.getMaterialType()), QcCertificateItem::getMaterialType, bo.getMaterialType());
lqw.eq(StringUtils.isNotBlank(bo.getSize()), QcCertificateItem::getSize, bo.getSize());
lqw.eq(bo.getPieces() != null, QcCertificateItem::getPieces, bo.getPieces());
lqw.eq(bo.getWeight() != null, QcCertificateItem::getWeight, bo.getWeight());
lqw.eq(bo.getC() != null, QcCertificateItem::getC, bo.getC());
lqw.eq(bo.getSi() != null, QcCertificateItem::getSi, bo.getSi());
lqw.eq(bo.getMn() != null, QcCertificateItem::getMn, bo.getMn());
lqw.eq(bo.getP() != null, QcCertificateItem::getP, bo.getP());
lqw.eq(bo.getS() != null, QcCertificateItem::getS, bo.getS());
lqw.eq(bo.getAls() != null, QcCertificateItem::getAls, bo.getAls());
lqw.eq(bo.getYieldStrength() != null, QcCertificateItem::getYieldStrength, bo.getYieldStrength());
lqw.eq(bo.getTensileStrength() != null, QcCertificateItem::getTensileStrength, bo.getTensileStrength());
lqw.eq(bo.getElongation() != null, QcCertificateItem::getElongation, bo.getElongation());
lqw.eq(bo.getHardness() != null, QcCertificateItem::getHardness, bo.getHardness());
lqw.eq(StringUtils.isNotBlank(bo.getBendingTest()), QcCertificateItem::getBendingTest, bo.getBendingTest());
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceQuality()), QcCertificateItem::getSurfaceQuality, bo.getSurfaceQuality());
lqw.eq(StringUtils.isNotBlank(bo.getSurfaceStructure()), QcCertificateItem::getSurfaceStructure, bo.getSurfaceStructure());
lqw.eq(StringUtils.isNotBlank(bo.getEdgeStatus()), QcCertificateItem::getEdgeStatus, bo.getEdgeStatus());
return lqw;
}
/**
* 新增质量证明书明细
*/
@Override
public Boolean insertByBo(QcCertificateItemBo bo) {
QcCertificateItem add = BeanUtil.toBean(bo, QcCertificateItem.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setItemId(add.getItemId());
}
return flag;
}
/**
* 修改质量证明书明细
*/
@Override
public Boolean updateByBo(QcCertificateItemBo bo) {
QcCertificateItem update = BeanUtil.toBean(bo, QcCertificateItem.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(QcCertificateItem entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 批量删除质量证明书明细
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
}

View File

@@ -0,0 +1,116 @@
package com.klp.mes.qc.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.klp.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.klp.mes.qc.domain.bo.QcCertificateBo;
import com.klp.mes.qc.domain.vo.QcCertificateVo;
import com.klp.mes.qc.domain.QcCertificate;
import com.klp.mes.qc.mapper.QcCertificateMapper;
import com.klp.mes.qc.service.IQcCertificateService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 质量证明书主Service业务层处理
*
* @author klp
* @date 2026-05-15
*/
@RequiredArgsConstructor
@Service
public class QcCertificateServiceImpl implements IQcCertificateService {
private final QcCertificateMapper baseMapper;
/**
* 查询质量证明书主
*/
@Override
public QcCertificateVo queryById(Long certificateId){
return baseMapper.selectVoById(certificateId);
}
/**
* 查询质量证明书主列表
*/
@Override
public TableDataInfo<QcCertificateVo> queryPageList(QcCertificateBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<QcCertificate> lqw = buildQueryWrapper(bo);
Page<QcCertificateVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询质量证明书主列表
*/
@Override
public List<QcCertificateVo> queryList(QcCertificateBo bo) {
LambdaQueryWrapper<QcCertificate> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<QcCertificate> buildQueryWrapper(QcCertificateBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<QcCertificate> lqw = Wrappers.lambdaQuery();
lqw.eq(StringUtils.isNotBlank(bo.getCertificateNo()), QcCertificate::getCertificateNo, bo.getCertificateNo());
lqw.eq(StringUtils.isNotBlank(bo.getContractNo()), QcCertificate::getContractNo, bo.getContractNo());
lqw.like(StringUtils.isNotBlank(bo.getProductName()), QcCertificate::getProductName, bo.getProductName());
lqw.eq(StringUtils.isNotBlank(bo.getStandard()), QcCertificate::getStandard, bo.getStandard());
lqw.eq(StringUtils.isNotBlank(bo.getConsignee()), QcCertificate::getConsignee, bo.getConsignee());
lqw.eq(StringUtils.isNotBlank(bo.getManufacturer()), QcCertificate::getManufacturer, bo.getManufacturer());
lqw.eq(bo.getIssueDate() != null, QcCertificate::getIssueDate, bo.getIssueDate());
lqw.eq(StringUtils.isNotBlank(bo.getNote()), QcCertificate::getNote, bo.getNote());
return lqw;
}
/**
* 新增质量证明书主
*/
@Override
public Boolean insertByBo(QcCertificateBo bo) {
QcCertificate add = BeanUtil.toBean(bo, QcCertificate.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setCertificateId(add.getCertificateId());
}
return flag;
}
/**
* 修改质量证明书主
*/
@Override
public Boolean updateByBo(QcCertificateBo bo) {
QcCertificate update = BeanUtil.toBean(bo, QcCertificate.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(QcCertificate entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 批量删除质量证明书主
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
}

View File

@@ -0,0 +1,120 @@
package com.klp.mes.qc.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.klp.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.klp.mes.qc.domain.bo.QcInspectionItemBo;
import com.klp.mes.qc.domain.vo.QcInspectionItemVo;
import com.klp.mes.qc.domain.QcInspectionItem;
import com.klp.mes.qc.mapper.QcInspectionItemMapper;
import com.klp.mes.qc.service.IQcInspectionItemService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 检验任务项目+结果Service业务层处理
*
* @author klp
* @date 2026-05-15
*/
@RequiredArgsConstructor
@Service
public class QcInspectionItemServiceImpl implements IQcInspectionItemService {
private final QcInspectionItemMapper baseMapper;
/**
* 查询检验任务项目+结果
*/
@Override
public QcInspectionItemVo queryById(Long itemId){
return baseMapper.selectVoById(itemId);
}
/**
* 查询检验任务项目+结果列表
*/
@Override
public TableDataInfo<QcInspectionItemVo> queryPageList(QcInspectionItemBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<QcInspectionItem> lqw = buildQueryWrapper(bo);
Page<QcInspectionItemVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询检验任务项目+结果列表
*/
@Override
public List<QcInspectionItemVo> queryList(QcInspectionItemBo bo) {
LambdaQueryWrapper<QcInspectionItem> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<QcInspectionItem> buildQueryWrapper(QcInspectionItemBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<QcInspectionItem> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getTaskId() != null, QcInspectionItem::getTaskId, bo.getTaskId());
lqw.like(StringUtils.isNotBlank(bo.getItemName()), QcInspectionItem::getItemName, bo.getItemName());
lqw.eq(StringUtils.isNotBlank(bo.getStandardValue()), QcInspectionItem::getStandardValue, bo.getStandardValue());
lqw.eq(bo.getUpperLimit() != null, QcInspectionItem::getUpperLimit, bo.getUpperLimit());
lqw.eq(bo.getLowerLimit() != null, QcInspectionItem::getLowerLimit, bo.getLowerLimit());
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), QcInspectionItem::getUnit, bo.getUnit());
lqw.eq(StringUtils.isNotBlank(bo.getItemType()), QcInspectionItem::getItemType, bo.getItemType());
lqw.eq(StringUtils.isNotBlank(bo.getInspectValue()), QcInspectionItem::getInspectValue, bo.getInspectValue());
lqw.eq(bo.getIsQualified() != null, QcInspectionItem::getIsQualified, bo.getIsQualified());
lqw.eq(StringUtils.isNotBlank(bo.getJudgeResult()), QcInspectionItem::getJudgeResult, bo.getJudgeResult());
lqw.eq(StringUtils.isNotBlank(bo.getInspectUser()), QcInspectionItem::getInspectUser, bo.getInspectUser());
lqw.eq(bo.getInspectTime() != null, QcInspectionItem::getInspectTime, bo.getInspectTime());
return lqw;
}
/**
* 新增检验任务项目+结果
*/
@Override
public Boolean insertByBo(QcInspectionItemBo bo) {
QcInspectionItem add = BeanUtil.toBean(bo, QcInspectionItem.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setItemId(add.getItemId());
}
return flag;
}
/**
* 修改检验任务项目+结果
*/
@Override
public Boolean updateByBo(QcInspectionItemBo bo) {
QcInspectionItem update = BeanUtil.toBean(bo, QcInspectionItem.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(QcInspectionItem entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 批量删除检验任务项目+结果
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
}

View File

@@ -0,0 +1,120 @@
package com.klp.mes.qc.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.domain.PageQuery;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.klp.common.utils.StringUtils;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
import com.klp.mes.qc.domain.bo.QcInspectionTaskBo;
import com.klp.mes.qc.domain.vo.QcInspectionTaskVo;
import com.klp.mes.qc.domain.QcInspectionTask;
import com.klp.mes.qc.mapper.QcInspectionTaskMapper;
import com.klp.mes.qc.service.IQcInspectionTaskService;
import java.util.List;
import java.util.Map;
import java.util.Collection;
/**
* 检验任务主Service业务层处理
*
* @author klp
* @date 2026-05-15
*/
@RequiredArgsConstructor
@Service
public class QcInspectionTaskServiceImpl implements IQcInspectionTaskService {
private final QcInspectionTaskMapper baseMapper;
/**
* 查询检验任务主
*/
@Override
public QcInspectionTaskVo queryById(Long taskId){
return baseMapper.selectVoById(taskId);
}
/**
* 查询检验任务主列表
*/
@Override
public TableDataInfo<QcInspectionTaskVo> queryPageList(QcInspectionTaskBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<QcInspectionTask> lqw = buildQueryWrapper(bo);
Page<QcInspectionTaskVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
return TableDataInfo.build(result);
}
/**
* 查询检验任务主列表
*/
@Override
public List<QcInspectionTaskVo> queryList(QcInspectionTaskBo bo) {
LambdaQueryWrapper<QcInspectionTask> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw);
}
private LambdaQueryWrapper<QcInspectionTask> buildQueryWrapper(QcInspectionTaskBo bo) {
Map<String, Object> params = bo.getParams();
LambdaQueryWrapper<QcInspectionTask> lqw = Wrappers.lambdaQuery();
lqw.eq(StringUtils.isNotBlank(bo.getTaskCode()), QcInspectionTask::getTaskCode, bo.getTaskCode());
lqw.eq(StringUtils.isNotBlank(bo.getTaskType()), QcInspectionTask::getTaskType, bo.getTaskType());
lqw.eq(StringUtils.isNotBlank(bo.getSourceType()), QcInspectionTask::getSourceType, bo.getSourceType());
lqw.eq(bo.getSourceId() != null, QcInspectionTask::getSourceId, bo.getSourceId());
lqw.eq(bo.getSchemeId() != null, QcInspectionTask::getSchemeId, bo.getSchemeId());
lqw.like(StringUtils.isNotBlank(bo.getSchemeName()), QcInspectionTask::getSchemeName, bo.getSchemeName());
lqw.eq(bo.getStatus() != null, QcInspectionTask::getStatus, bo.getStatus());
lqw.eq(StringUtils.isNotBlank(bo.getInspectUser()), QcInspectionTask::getInspectUser, bo.getInspectUser());
lqw.eq(bo.getInspectTime() != null, QcInspectionTask::getInspectTime, bo.getInspectTime());
lqw.eq(StringUtils.isNotBlank(bo.getAuditUser()), QcInspectionTask::getAuditUser, bo.getAuditUser());
lqw.eq(bo.getAuditTime() != null, QcInspectionTask::getAuditTime, bo.getAuditTime());
lqw.eq(StringUtils.isNotBlank(bo.getResult()), QcInspectionTask::getResult, bo.getResult());
return lqw;
}
/**
* 新增检验任务主
*/
@Override
public Boolean insertByBo(QcInspectionTaskBo bo) {
QcInspectionTask add = BeanUtil.toBean(bo, QcInspectionTask.class);
validEntityBeforeSave(add);
boolean flag = baseMapper.insert(add) > 0;
if (flag) {
bo.setTaskId(add.getTaskId());
}
return flag;
}
/**
* 修改检验任务主
*/
@Override
public Boolean updateByBo(QcInspectionTaskBo bo) {
QcInspectionTask update = BeanUtil.toBean(bo, QcInspectionTask.class);
validEntityBeforeSave(update);
return baseMapper.updateById(update) > 0;
}
/**
* 保存前的数据校验
*/
private void validEntityBeforeSave(QcInspectionTask entity){
//TODO 做一些数据校验,如唯一约束
}
/**
* 批量删除检验任务主
*/
@Override
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
if(isValid){
//TODO 做一些业务上的校验,判断是否需要校验
}
return baseMapper.deleteBatchIds(ids) > 0;
}
}

View File

@@ -0,0 +1,39 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.klp.mes.qc.mapper.QcCertificateItemMapper">
<resultMap type="com.klp.mes.qc.domain.QcCertificateItem" id="QcCertificateItemResult">
<result property="itemId" column="item_id"/>
<result property="certificateId" column="certificate_id"/>
<result property="coilNo" column="coil_no"/>
<result property="heatNo" column="heat_no"/>
<result property="materialType" column="material_type"/>
<result property="size" column="size"/>
<result property="pieces" column="pieces"/>
<result property="weight" column="weight"/>
<result property="c" column="c"/>
<result property="si" column="si"/>
<result property="mn" column="mn"/>
<result property="p" column="p"/>
<result property="s" column="s"/>
<result property="als" column="als"/>
<result property="yieldStrength" column="yield_strength"/>
<result property="tensileStrength" column="tensile_strength"/>
<result property="elongation" column="elongation"/>
<result property="hardness" column="hardness"/>
<result property="bendingTest" column="bending_test"/>
<result property="surfaceQuality" column="surface_quality"/>
<result property="surfaceStructure" column="surface_structure"/>
<result property="edgeStatus" column="edge_status"/>
<result property="remark" column="remark"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,26 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.klp.mes.qc.mapper.QcCertificateMapper">
<resultMap type="com.klp.mes.qc.domain.QcCertificate" id="QcCertificateResult">
<result property="certificateId" column="certificate_id"/>
<result property="certificateNo" column="certificate_no"/>
<result property="contractNo" column="contract_no"/>
<result property="productName" column="product_name"/>
<result property="standard" column="standard"/>
<result property="consignee" column="consignee"/>
<result property="manufacturer" column="manufacturer"/>
<result property="issueDate" column="issue_date"/>
<result property="note" column="note"/>
<result property="remark" column="remark"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.klp.mes.qc.mapper.QcInspectionItemMapper">
<resultMap type="com.klp.mes.qc.domain.QcInspectionItem" id="QcInspectionItemResult">
<result property="itemId" column="item_id"/>
<result property="taskId" column="task_id"/>
<result property="itemName" column="item_name"/>
<result property="standardValue" column="standard_value"/>
<result property="upperLimit" column="upper_limit"/>
<result property="lowerLimit" column="lower_limit"/>
<result property="unit" column="unit"/>
<result property="itemType" column="item_type"/>
<result property="inspectValue" column="inspect_value"/>
<result property="isQualified" column="is_qualified"/>
<result property="judgeResult" column="judge_result"/>
<result property="inspectUser" column="inspect_user"/>
<result property="inspectTime" column="inspect_time"/>
<result property="remark" column="remark"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.klp.mes.qc.mapper.QcInspectionTaskMapper">
<resultMap type="com.klp.mes.qc.domain.QcInspectionTask" id="QcInspectionTaskResult">
<result property="taskId" column="task_id"/>
<result property="taskCode" column="task_code"/>
<result property="taskType" column="task_type"/>
<result property="sourceType" column="source_type"/>
<result property="sourceId" column="source_id"/>
<result property="schemeId" column="scheme_id"/>
<result property="schemeName" column="scheme_name"/>
<result property="status" column="status"/>
<result property="inspectUser" column="inspect_user"/>
<result property="inspectTime" column="inspect_time"/>
<result property="auditUser" column="audit_user"/>
<result property="auditTime" column="audit_time"/>
<result property="result" column="result"/>
<result property="remark" column="remark"/>
<result property="delFlag" column="del_flag"/>
<result property="createTime" column="create_time"/>
<result property="createBy" column="create_by"/>
<result property="updateTime" column="update_time"/>
<result property="updateBy" column="update_by"/>
</resultMap>
</mapper>

View File

@@ -0,0 +1,53 @@
import request from '@/utils/request'
// 查询考勤比对结果(排班与打卡比对)列表
export function listAttendanceCheck(query) {
return request({
url: '/wms/attendanceCheck/list',
method: 'get',
params: query
})
}
// 查询考勤比对结果(排班与打卡比对)详细
export function getAttendanceCheck(checkId) {
return request({
url: '/wms/attendanceCheck/' + checkId,
method: 'get'
})
}
// 新增考勤比对结果(排班与打卡比对)
export function addAttendanceCheck(data) {
return request({
url: '/wms/attendanceCheck',
method: 'post',
data: data
})
}
// 修改考勤比对结果(排班与打卡比对)
export function updateAttendanceCheck(data) {
return request({
url: '/wms/attendanceCheck',
method: 'put',
data: data
})
}
// 删除考勤比对结果(排班与打卡比对)
export function delAttendanceCheck(checkId) {
return request({
url: '/wms/attendanceCheck/' + checkId,
method: 'delete'
})
}
// 一键生成考勤对比结果
export function generateAttendanceCheck(data) {
return request({
url: '/wms/attendanceCheck/check',
method: 'post',
data: data
})
}

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询考勤规则列表
export function listAttendanceRule(query) {
return request({
url: '/wms/attendanceRule/list',
method: 'get',
params: query
})
}
// 查询考勤规则详细
export function getAttendanceRule(ruleId) {
return request({
url: '/wms/attendanceRule/' + ruleId,
method: 'get'
})
}
// 新增考勤规则
export function addAttendanceRule(data) {
return request({
url: '/wms/attendanceRule',
method: 'post',
data: data
})
}
// 修改考勤规则
export function updateAttendanceRule(data) {
return request({
url: '/wms/attendanceRule',
method: 'put',
data: data
})
}
// 删除考勤规则
export function delAttendanceRule(ruleId) {
return request({
url: '/wms/attendanceRule/' + ruleId,
method: 'delete'
})
}

View File

@@ -0,0 +1,62 @@
import request from '@/utils/request'
// 查询排班记录列表
export function listAttendanceSchedule(query) {
return request({
url: '/wms/attendanceSchedule/list',
method: 'get',
params: query
})
}
// 查询排班记录详细
export function getAttendanceSchedule(id) {
return request({
url: '/wms/attendanceSchedule/' + id,
method: 'get'
})
}
// 新增排班记录
export function addAttendanceSchedule(data) {
return request({
url: '/wms/attendanceSchedule',
method: 'post',
data: data
})
}
// 修改排班记录
export function updateAttendanceSchedule(data) {
return request({
url: '/wms/attendanceSchedule',
method: 'put',
data: data
})
}
// 删除排班记录(支持批量删除传递csv格式字符串如1,2,3)
export function delAttendanceSchedule(ids) {
return request({
url: '/wms/attendanceSchedule/' + ids,
method: 'delete'
})
}
// 生成单个人的排班记录(批量)
export function generateenerateSchedule(data) {
return request({
url: '/wms/attendanceSchedule/generate',
method: 'post',
data: data
})
}
// 批量生成排班记录
export function batchGenerateSchedule(data) {
return request({
url: '/wms/attendanceSchedule/batchGenerate',
method: 'post',
data: data
})
}

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询班次列表
export function listShift(query) {
return request({
url: '/wms/attendanceShift/list',
method: 'get',
params: query
})
}
// 查询班次详细
export function getShift(id) {
return request({
url: '/wms/attendanceShift/' + id,
method: 'get'
})
}
// 新增班次
export function addShift(data) {
return request({
url: '/wms/attendanceShift',
method: 'post',
data: data
})
}
// 修改班次
export function updateShift(data) {
return request({
url: '/wms/attendanceShift',
method: 'put',
data: data
})
}
// 删除班次
export function delShift(id) {
return request({
url: '/wms/attendanceShift/' + id,
method: 'delete'
})
}

View File

@@ -0,0 +1,44 @@
import request from '@/utils/request'
// 查询倒班规则列表
export function listAttendanceShiftRule(query) {
return request({
url: '/wms/attendanceShiftRule/list',
method: 'get',
params: query
})
}
// 查询倒班规则详细
export function getAttendanceShiftRule(ruleId) {
return request({
url: '/wms/attendanceShiftRule/' + ruleId,
method: 'get'
})
}
// 新增倒班规则
export function addAttendanceShiftRule(data) {
return request({
url: '/wms/attendanceShiftRule',
method: 'post',
data: data
})
}
// 修改倒班规则
export function updateAttendanceShiftRule(data) {
return request({
url: '/wms/attendanceShiftRule',
method: 'put',
data: data
})
}
// 删除倒班规则
export function delAttendanceShiftRule(ruleId) {
return request({
url: '/wms/attendanceShiftRule/' + ruleId,
method: 'delete'
})
}

View File

@@ -85,7 +85,7 @@
</el-form-item>
<el-form-item v-if="showWaybill" label="发货单时间">
<el-date-picker v-model="queryParams.shipmentTime" type="daterange" value-format="yyyy-MM-dd HH:mm:ss"
<el-date-picker v-model="queryParams.shipmentTime" type="daterange" value-format="yyyy-MM-dd"
range-separator="" start-placeholder="开始日期" end-placeholder="结束日期" />
</el-form-item>
@@ -1747,8 +1747,8 @@ export default {
...this.queryParams,
exportTimeBy: true,
selectType: this.querys.materialType === '原料' ? 'raw_material' : 'product',
startTime: this.queryParams.shipmentTime?.[0],
endTime: this.queryParams.shipmentTime?.[1],
startTime: this.queryParams.shipmentTime?.[0] && this.queryParams.shipmentTime?.[0] + ' 00:00:00',
endTime: this.queryParams.shipmentTime?.[1] && this.queryParams.shipmentTime?.[1] + ' 23:59:59',
}
listBoundCoil(query).then(res => {
this.materialCoilList = res.rows || [];

View File

@@ -6,6 +6,7 @@
import BasePage from './panels/base.vue';
export default {
name: "Exp-Coil",
components: {
BasePage
},

View File

@@ -10,6 +10,7 @@
import BasePage from './panels/base.vue';
export default {
name: 'Exp-Bind',
components: {
BasePage
},

View File

@@ -70,6 +70,7 @@ import { listCoilByIds } from "@/api/wms/coil";
import WayBill from "../components/wayBill.vue";
export default {
name: "Exp-Bills",
data() {
return {
deliveryWaybillList: [],

View File

@@ -15,6 +15,7 @@
import BasePage from '@/views/wms/coil/panels/base.vue';
export default {
name: "Exp-Canuse",
components: {
BasePage
},

View File

@@ -248,7 +248,7 @@ import PlanSelector from "../components/planSelector.vue";
import DragResizePanel from "@/components/DragResizePanel";
export default {
name: "DeliveryWaybill",
name: "Exp-Waybill",
components: {
MemoInput,
DeliveryWaybillDetail,

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,308 @@
<template>
<div class="app-container">
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button
type="primary"
plain
icon="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="attendanceRuleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="ruleId" v-if="false"/>
<el-table-column label="迟到警告阈值" align="center" prop="lateWarn" />
<el-table-column label="迟到一级阈值" align="center" prop="lateOne" />
<el-table-column label="迟到二级阈值" align="center" prop="lateTwo" />
<el-table-column label="迟到一级扣款" align="center" prop="deductOne" />
<el-table-column label="迟到二级扣款" align="center" prop="deductTwo" />
<el-table-column label="超过多少分钟按旷工半天处理" align="center" prop="absentHalfDay" />
<el-table-column label="连续旷工多少天自动离职" align="center" prop="continuousAbsentDays" />
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改考勤规则对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="迟到警告阈值" prop="lateWarn">
<el-input v-model="form.lateWarn" placeholder="请输入迟到警告阈值" />
</el-form-item>
<el-form-item label="迟到一级阈值" prop="lateOne">
<el-input v-model="form.lateOne" placeholder="请输入迟到一级阈值" />
</el-form-item>
<el-form-item label="迟到二级阈值" prop="lateTwo">
<el-input v-model="form.lateTwo" placeholder="请输入迟到二级阈值" />
</el-form-item>
<el-form-item label="迟到一级扣款" prop="deductOne">
<el-input v-model="form.deductOne" placeholder="请输入迟到一级扣款" />
</el-form-item>
<el-form-item label="迟到二级扣款" prop="deductTwo">
<el-input v-model="form.deductTwo" placeholder="请输入迟到二级扣款" />
</el-form-item>
<el-form-item label="超过多少分钟按旷工半天处理" prop="absentHalfDay">
<el-input v-model="form.absentHalfDay" placeholder="请输入超过多少分钟按旷工半天处理" />
</el-form-item>
<el-form-item label="连续旷工多少天自动离职" prop="continuousAbsentDays">
<el-input v-model="form.continuousAbsentDays" placeholder="请输入连续旷工多少天自动离职" />
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listAttendanceRule, getAttendanceRule, delAttendanceRule, addAttendanceRule, updateAttendanceRule } from "@/api/wms/attendanceRule";
export default {
name: "AttendanceRule",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 考勤规则表格数据
attendanceRuleList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
lateWarn: undefined,
lateOne: undefined,
lateTwo: undefined,
deductOne: undefined,
deductTwo: undefined,
absentHalfDay: undefined,
continuousAbsentDays: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {
lateWarn: [
{ required: true, message: "迟到警告阈值不能为空", trigger: "blur" }
],
lateOne: [
{ required: true, message: "迟到一级阈值不能为空", trigger: "blur" }
],
lateTwo: [
{ required: true, message: "迟到二级阈值不能为空", trigger: "blur" }
],
deductOne: [
{ required: true, message: "迟到一级扣款不能为空", trigger: "blur" }
],
deductTwo: [
{ required: true, message: "迟到二级扣款不能为空", trigger: "blur" }
],
absentHalfDay: [
{ required: true, message: "超过多少分钟按旷工半天处理不能为空", trigger: "blur" }
],
continuousAbsentDays: [
{ required: true, message: "连续旷工多少天自动离职不能为空", trigger: "blur" }
],
remark: [
{ required: true, message: "备注不能为空", trigger: "blur" }
],
}
};
},
created() {
this.getList();
},
methods: {
/** 查询考勤规则列表 */
getList() {
this.loading = true;
listAttendanceRule(this.queryParams).then(response => {
this.attendanceRuleList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
ruleId: undefined,
lateWarn: undefined,
lateOne: undefined,
lateTwo: undefined,
deductOne: undefined,
deductTwo: undefined,
absentHalfDay: undefined,
continuousAbsentDays: undefined,
remark: undefined,
delFlag: undefined,
createBy: undefined,
updateBy: undefined,
createTime: undefined,
updateTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.ruleId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加考勤规则";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const ruleId = row.ruleId || this.ids
getAttendanceRule(ruleId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改考勤规则";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.ruleId != null) {
updateAttendanceRule(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addAttendanceRule(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ruleIds = row.ruleId || this.ids;
this.$modal.confirm('是否确认删除考勤规则编号为"' + ruleIds + '"的数据项?').then(() => {
this.loading = true;
return delAttendanceRule(ruleIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('wms/attendanceRule/export', {
...this.queryParams
}, `attendanceRule_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -0,0 +1,719 @@
<template>
<div class="app-container">
<!-- 日期范围选择 -->
<div class="date-range-section">
<TimeRangePicker v-model="dateRangeParams" startKey="scheduleDateStart" endKey="scheduleDateEnd"
:defaultStartTime="defaultStartTime" :defaultEndTime="defaultEndTime" @change="handleDateRangeChange"
@quick-select="getScheduleList" />
</div>
<!-- 操作栏 -->
<div class="operation-bar">
<el-button plain type="primary" icon="el-icon-plus" @click="handleCreate">创建排班</el-button>
<el-button plain type="info" icon="el-icon-refresh" @click="handleRefresh">刷新</el-button>
</div>
<el-alert type="info" title="提示:双击排班单元格可编辑排班"></el-alert>
<!-- 排班表格 -->
<div class="schedule-table-wrapper">
<el-table v-loading="loading" :data="scheduleData" border stripe>
<!-- 员工列 -->
<el-table-column prop="employeeName" label="员工" width="120" fixed="left" />
<!-- 操作列 -->
<el-table-column label="操作" width="120" fixed="right">
<template slot-scope="scope">
<el-button size="mini" type="danger" @click="handleDeleteRow(scope.row)">删除整行</el-button>
</template>
</el-table-column>
<!-- 动态日期列 -->
<el-table-column v-for="date in dateList" :key="date" :label="formatDateLabel(date)" width="150" align="center">
<template slot-scope="scope">
<div class="schedule-cell" :class="{ 'has-data': scope.row[date], 'empty-cell': !scope.row[date] }"
@dblclick="handleCellDoubleClick(scope.row, date)">
<template v-if="scope.row[date]">
<div class="shift-name" :class="getShiftTypeClass(scope.row[date].shiftType)">
{{ scope.row[date].shiftName }}
</div>
<div class="shift-time-info">
<span v-if="scope.row[date].shiftStartTime">{{ scope.row[date].shiftStartTime }}-{{
scope.row[date].shiftEndTime }}</span>
<span v-if="scope.row[date].shiftStartTime2" class="second-shift">
{{ scope.row[date].shiftStartTime2 }}-{{ scope.row[date].shiftEndTime2 }}
</span>
</div>
</template>
<template v-else>
<span class="empty-hint">双击排班</span>
</template>
</div>
</template>
</el-table-column>
</el-table>
</div>
<!-- 创建排班弹窗 -->
<el-dialog title="创建排班" :visible.sync="dialogVisible" width="800px">
<el-form ref="form" :model="form" :rules="rules" label-width="100px">
<el-form-item label="时间段" prop="dateRange">
<el-date-picker v-model="form.dateRange" type="daterange" range-separator="至" start-placeholder="开始日期"
end-placeholder="结束日期" value-format="yyyy-MM-dd" style="width: 100%;" />
</el-form-item>
<el-form-item label="选择员工" prop="selectedEmployees">
<EmployeeSelector v-model="form.selectedEmployees" :multiple="true" placeholder="请点击选择员工" title="选择排班员工"
@change="handleEmployeeSelect" />
</el-form-item>
<el-form-item label="排班配置" v-if="form.shiftConfig.length > 0">
<div class="shift-config">
<div v-for="(item, index) in form.shiftConfig" :key="index" class="shift-config-item">
<div class="employee-info">
<el-button icon="el-icon-delete" type="default" size="mini" @click="handleDeleteEmployee(index)"></el-button>
<el-tag type="info">{{ item.employeeName || '员工' + (index + 1) }}</el-tag>
</div>
<template>
<el-select clearable v-model="item.shiftId" placeholder="选择班次" style="width: 150px;">
<el-option v-for="shift in shiftList" :key="shift.shiftId" :label="shift.shiftName"
:value="shift.shiftId" />
</el-select>
<div class="shift-time" v-if="item.shiftId">
<span class="time-label">工作时间</span>
<span class="time-value">{{ getShiftTime(item.shiftId) }}</span>
</div>
<el-select clearable v-model="item.shiftRuleId" placeholder="选择倒班规则(不倒班则不填)" style="width: 200px;">
<el-option v-for="rule in shiftRuleList" :key="rule.ruleId" :label="rule.ruleName"
:value="rule.ruleId" />
</el-select>
</template>
</div>
</div>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancel">取消</el-button>
<el-button type="primary" @click="submitForm" :loading="buttonLoading" :disabled="!canSubmit">确定</el-button>
</div>
</el-dialog>
<!-- 编辑班次弹窗 -->
<el-dialog title="编辑班次" :visible.sync="editDialogVisible" width="400px">
<el-form ref="editForm" :model="editForm" label-width="80px">
<el-form-item label="班次">
<el-select v-model="editForm.shiftId" placeholder="选择班次" style="width: 100%;">
<el-option v-for="shift in shiftList" :key="shift.shiftId" :label="shift.shiftName"
:value="shift.shiftId" />
</el-select>
</el-form-item>
<el-form-item label="工作时间">
<div v-if="currentShift" class="shift-detail">
<div>
<span class="time-label">时段一</span>
<span class="time-value">{{ currentShift.startTime }} - {{ currentShift.endTime }}</span>
</div>
<div v-if="currentShift.startTime2">
<span class="time-label">时段二</span>
<span class="time-value">{{ currentShift.startTime2 }} - {{ currentShift.endTime2 }}</span>
</div>
</div>
<span v-else>请选择班次</span>
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button @click="cancelEdit">取消</el-button>
<el-button type="danger"
v-if="currentEditRow && currentEditRow[currentEditDate] && currentEditRow[currentEditDate].scheduleId"
@click="handleDelete">删除排班</el-button>
<el-button type="primary" @click="submitEdit" :disabled="!editForm.shiftId">确定</el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import TimeRangePicker from '@/views/wms/report/components/timeRangePicker.vue'
import EmployeeSelector from '@/components/EmployeeSelector/index.vue'
import { listAttendanceSchedule, generateenerateSchedule, updateAttendanceSchedule, addAttendanceSchedule, delAttendanceSchedule } from '@/api/wms/attendanceSchedule'
import { listShift } from '@/api/wms/attendanceShift'
import { listAttendanceShiftRule } from '@/api/wms/attendanceShiftRule'
export default {
name: 'AttendanceSchedule',
components: { TimeRangePicker, EmployeeSelector },
data() {
return {
loading: false,
buttonLoading: false,
dateRangeParams: {},
defaultStartTime: '',
defaultEndTime: '',
dateList: [],
scheduleData: [],
shiftList: [],
shiftRuleList: [],
dialogVisible: false,
editDialogVisible: false,
scheduleMode: 'single', // single: 普通排班, rotate: 倒班排班
form: {
dateRange: [],
selectedEmployees: '',
shiftConfig: []
},
editForm: {
shiftId: ''
},
currentEditRow: null,
currentEditDate: '',
rules: {
dateRange: [
{ required: true, message: '请选择时间段', trigger: 'change' }
],
selectedEmployees: [
{ required: true, message: '请选择员工', trigger: 'change' }
]
}
}
},
computed: {
canSubmit() {
if (!this.form.dateRange || this.form.dateRange.length === 0) {
return false
}
if (!this.form.selectedEmployees) {
return false
}
if (this.form.shiftConfig.length === 0) {
return false
}
if (this.scheduleMode === 'single') {
return this.form.shiftConfig.every(item => item.shiftId)
} else {
return this.form.shiftConfig.every(item => item.shiftRuleId)
}
},
currentShift() {
if (!this.editForm.shiftId) {
return null
}
return this.shiftList.find(s => s.shiftId === this.editForm.shiftId)
}
},
created() {
this.initDateRange()
this.getShiftList()
this.getShiftRuleList()
},
methods: {
// 刷新排班
handleRefresh() {
this.getScheduleList()
},
// 初始化日期范围为当前月份
initDateRange() {
const now = new Date()
const firstDay = new Date(now.getFullYear(), now.getMonth(), 1)
const lastDay = new Date(now.getFullYear(), now.getMonth() + 1, 0)
this.defaultStartTime = this.formatDate(firstDay) + ' 00:00:00'
this.defaultEndTime = this.formatDate(lastDay) + ' 23:59:59'
this.dateRangeParams = {
scheduleDateStart: this.defaultStartTime,
scheduleDateEnd: this.defaultEndTime
}
this.generateDateList(firstDay, lastDay)
this.getScheduleList()
},
// 格式化日期
formatDate(date) {
const year = date.getFullYear()
const month = (date.getMonth() + 1).toString().padStart(2, '0')
const day = date.getDate().toString().padStart(2, '0')
return `${year}-${month}-${day}`
},
// 生成日期列表
generateDateList(startDate, endDate) {
this.dateList = []
let currentDate = new Date(startDate)
while (currentDate <= endDate) {
this.dateList.push(this.formatDate(currentDate))
currentDate.setDate(currentDate.getDate() + 1)
}
},
handleDeleteEmployee(index) {
this.form.shiftConfig.splice(index, 1)
},
// 格式化日期标签
formatDateLabel(date) {
const dateObj = new Date(date)
const weekDays = ['日', '一', '二', '三', '四', '五', '六']
const month = dateObj.getMonth() + 1
const day = dateObj.getDate()
const weekDay = weekDays[dateObj.getDay()]
return `${month}${day}日 周${weekDay}`
},
// 日期范围变化
handleDateRangeChange() {
if (this.dateRangeParams.scheduleDateStart && this.dateRangeParams.scheduleDateEnd) {
const startDate = new Date(this.dateRangeParams.scheduleDateStart.split(' ')[0])
const endDate = new Date(this.dateRangeParams.scheduleDateEnd.split(' ')[0])
this.generateDateList(startDate, endDate)
this.getScheduleList()
}
},
// 获取排班列表
getScheduleList() {
this.loading = true
listAttendanceSchedule(this.dateRangeParams).then(response => {
this.scheduleData = this.transformScheduleData(response.rows || [])
this.loading = false
}).catch(() => {
this.loading = false
})
},
// 转换排班数据
transformScheduleData(rows) {
const dataMap = {}
rows.forEach(record => {
if (!dataMap[record.userId]) {
dataMap[record.userId] = {
employeeName: record.employeeName,
employeeId: record.userId
}
}
if (record.workDate) {
const dateKey = record.workDate.split(' ')[0]
dataMap[record.userId][dateKey] = {
scheduleId: record.scheduleId,
shiftId: record.shiftId,
shiftName: record.shiftName,
shiftType: record.shiftType,
shiftStartTime: record.shiftStartTime,
shiftEndTime: record.shiftEndTime,
shiftStartTime2: record.shiftStartTime2,
shiftEndTime2: record.shiftEndTime2
}
}
})
return Object.values(dataMap)
},
// 获取班次列表
getShiftList() {
listShift().then(response => {
this.shiftList = response.rows || []
})
},
// 获取倒班规则列表
getShiftRuleList() {
listAttendanceShiftRule().then(response => {
this.shiftRuleList = response.rows || []
})
},
// 获取班次时间显示
getShiftTime(shiftId) {
const shift = this.shiftList.find(s => s.shiftId === shiftId)
if (!shift) return ''
const startTime = shift.startTime ? shift.startTime.substring(0, 5) : ''
const endTime = shift.endTime ? shift.endTime.substring(0, 5) : ''
if (shift.isCrossDay) {
return `${startTime} - 次日${endTime}`
}
return `${startTime} - ${endTime}`
},
// 获取班次类型样式
getShiftTypeClass(shiftType) {
return shiftType === '夜班' ? 'night-shift' : 'day-shift'
},
// 双击单元格处理
handleCellDoubleClick(row, date) {
this.currentEditRow = row
this.currentEditDate = date
if (row[date]) {
this.editForm.shiftId = row[date].shiftId
} else {
this.editForm.shiftId = ''
}
this.editDialogVisible = true
},
// 取消编辑
cancelEdit() {
this.editDialogVisible = false
this.editForm.shiftId = ''
this.currentEditRow = null
this.currentEditDate = ''
},
// 提交编辑
submitEdit() {
if (!this.editForm.shiftId || !this.currentEditRow) {
return
}
const shift = this.shiftList.find(s => s.shiftId === this.editForm.shiftId)
if (!shift) {
return
}
const date = this.currentEditDate
const employeeId = this.currentEditRow.employeeId
if (this.currentEditRow[date]) {
updateAttendanceSchedule({
scheduleId: this.currentEditRow[date].scheduleId,
userId: employeeId,
workDate: date,
shiftId: shift.shiftId,
shiftName: shift.shiftName,
}).then(_ => {
this.$message.success('修改成功')
this.getScheduleList()
}).catch(() => {
this.$message.error('修改失败')
this.getScheduleList()
})
} else {
addAttendanceSchedule({
shiftId: shift.shiftId,
userId: employeeId,
workDate: date,
shiftName: shift.shiftName,
}).then(_ => {
this.$message.success('添加成功')
this.getScheduleList()
}).catch(() => {
this.$message.error('添加失败')
this.getScheduleList()
})
}
// this.currentEditRow[date] = {
// scheduleId: this.currentEditRow[date]?.scheduleId,
// shiftId: shift.shiftId,
// shiftName: shift.shiftName,
// shiftType: shift.shiftType,
// shiftStartTime: shift.startTime,
// shiftEndTime: shift.endTime,
// shiftStartTime2: shift.startTime2,
// shiftEndTime2: shift.endTime2
// }
this.cancelEdit()
},
// 删除排班
handleDelete() {
const scheduleId = this.currentEditRow[this.currentEditDate]?.scheduleId
if (!scheduleId) {
return
}
this.$confirm('确定要删除该排班吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delAttendanceSchedule(scheduleId).then(() => {
this.$message.success('删除成功')
delete this.currentEditRow[this.currentEditDate]
this.cancelEdit()
}).catch(() => {
this.$message.error('删除失败,正在重新获取数据')
this.getScheduleList()
this.cancelEdit()
})
}).catch(() => {
this.$message.info('已取消删除')
})
},
// 删除整行排班
handleDeleteRow(row) {
const scheduleIds = []
this.dateList.forEach(date => {
if (row[date] && row[date].scheduleId) {
scheduleIds.push(row[date].scheduleId)
}
})
if (scheduleIds.length === 0) {
this.$message.info('该行没有排班记录')
return
}
this.$confirm(`确定要删除该员工的 ${scheduleIds.length} 条排班记录吗?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
delAttendanceSchedule(scheduleIds.join(',')).then(() => {
this.$message.success('删除成功')
this.getScheduleList()
}).catch(() => {
this.$message.error('删除失败,正在重新获取数据')
this.getScheduleList()
})
}).catch(() => {
this.$message.info('已取消删除')
})
},
// 处理班次变更
handleShiftChange(employeeId, date, shiftId) {
if (!shiftId) {
return
}
const shift = this.shiftList.find(s => s.shiftId === shiftId)
if (!shift) {
return
}
const scheduleItem = this.scheduleData.find(item => item.employeeId === employeeId)
if (scheduleItem && scheduleItem[date]) {
updateAttendanceSchedule({
...scheduleItem[date],
shiftId: scheduleItem.shiftId
}).then(_ => {
this.$message.success('修改成功')
}).catch(() => {
this.$message.success('修改成功')
this.getScheduleList()
})
scheduleItem[date].shiftId = shift.shiftId
scheduleItem[date].shiftName = shift.shiftName
scheduleItem[date].shiftType = shift.shiftType
scheduleItem[date].shiftStartTime = shift.startTime
scheduleItem[date].shiftEndTime = shift.endTime
scheduleItem[date].shiftStartTime2 = shift.startTime2
scheduleItem[date].shiftEndTime2 = shift.endTime2
} else if (scheduleItem) {
scheduleItem[date] = {
shiftId: shift.shiftId,
shiftName: shift.shiftName,
shiftType: shift.shiftType,
shiftStartTime: shift.startTime,
shiftEndTime: shift.endTime,
shiftStartTime2: shift.startTime2,
shiftEndTime2: shift.endTime2
}
}
},
// 创建排班
handleCreate() {
this.reset()
this.dialogVisible = true
},
// 重置表单
reset() {
this.scheduleMode = 'single'
this.form = {
dateRange: [],
selectedEmployees: '',
shiftConfig: []
}
this.resetForm('form')
},
// 员工选择变化时自动生成配置项
handleEmployeeSelect(employees) {
if (!employees || employees.length === 0) {
this.form.shiftConfig = []
return
}
// 为每个选中的员工生成配置项
if (this.scheduleMode === 'single') {
this.form.shiftConfig = employees.map(employee => ({
employeeId: employee.infoId,
employeeName: employee.name,
shiftId: null
}))
} else {
this.form.shiftConfig = employees.map(employee => ({
employeeId: employee.infoId,
employeeName: employee.name,
shiftRuleId: null
}))
}
},
// 排班模式切换
handleScheduleModeChange() {
// 模式切换时重新生成配置项
if (this.form.selectedEmployees && this.form.selectedEmployees.length > 0) {
this.handleEmployeeSelect(this.form.selectedEmployees)
}
},
// 提交表单
submitForm() {
this.$refs['form'].validate(valid => {
if (valid) {
this.loading = true;
this.buttonLoading = true;
// 构建提交数据
const list = []
for (const item of this.form.shiftConfig) {
const payload = {
userId: item.employeeId,
shiftId: item.shiftId,
ruleId: item.shiftRuleId,
startDate: this.dateRangeParams.scheduleDateStart.split(' ')[0],
endDate: this.dateRangeParams.scheduleDateEnd.split(' ')[0]
}
list.push(payload)
}
// 调用API
generateenerateSchedule(list).then(response => {
this.$modal.msgSuccess('生成成功')
this.dialogVisible = false
this.loading = false;
this.buttonLoading = false;
this.getScheduleList()
})
}
})
},
// 取消
cancel() {
this.dialogVisible = false
this.reset()
}
}
}
</script>
<style scoped>
.app-container {
padding: 20px;
}
.date-range-section {
margin-bottom: 20px;
}
.operation-bar {
margin-bottom: 20px;
}
.schedule-table-wrapper {
overflow-x: auto;
}
.schedule-cell {
padding: 4px;
min-height: 60px;
cursor: pointer;
transition: background-color 0.2s;
}
.schedule-cell:hover {
background-color: #f5f7fa;
}
.has-data {
padding: 8px 4px;
}
.empty-cell {
display: flex;
align-items: center;
justify-content: center;
}
.empty-hint {
font-size: 12px;
color: #c0c4cc;
}
.shift-info {
text-align: center;
}
.shift-name {
display: inline-block;
padding: 2px 6px;
border-radius: 4px;
font-size: 11px;
color: #fff;
margin-bottom: 2px;
}
.day-shift {
background-color: #67c23a;
}
.night-shift {
background-color: #409eff;
}
.shift-time-info {
font-size: 10px;
color: #606266;
line-height: 1.4;
}
.second-shift {
display: block;
margin-top: 2px;
}
.shift-config {
width: 100%;
}
.shift-config-item {
margin-bottom: 12px;
padding: 12px;
background-color: #f5f7fa;
border-radius: 4px;
display: flex;
align-items: center;
gap: 12px;
}
.employee-info {
min-width: 100px;
}
.shift-time {
flex: 1;
margin-left: 12px;
}
.time-label {
font-size: 12px;
color: #909399;
}
.time-value {
font-size: 12px;
color: #606266;
}
</style>

View File

@@ -0,0 +1,519 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="班次名称" prop="shiftName">
<el-input
v-model="queryParams.shiftName"
placeholder="请输入班次名称"
clearable
style="width: 200px"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="班次类型" prop="shiftType">
<el-select
v-model="queryParams.shiftType"
placeholder="请选择班次类型"
clearable
style="width: 200px"
allow-create
filterable
>
<el-option label="白班" value="白班" />
<el-option label="夜班" value="夜班" />
</el-select>
</el-form-item>
<el-form-item label="季节" prop="season">
<el-select
v-model="queryParams.season"
placeholder="请选择季节"
clearable
style="width: 200px"
allow-create
filterable
>
<el-option label="夏季" value="夏季" />
<el-option label="冬季" value="冬季" />
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @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="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<KLPTable v-loading="loading" :data="shiftList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="班次名称" align="center" prop="shiftName" :show-overflow-tooltip="true" />
<el-table-column label="班次类型" align="center" prop="shiftType">
<template slot-scope="scope">
<el-tag :type="scope.row.shiftType === '白班' ? 'success' : 'info'">{{ scope.row.shiftType }}</el-tag>
</template>
</el-table-column>
<el-table-column label="季节" align="center" prop="season">
<template slot-scope="scope">
<el-tag :type="scope.row.season === '夏季' ? 'warning' : 'primary'">{{ scope.row.season }}</el-tag>
</template>
</el-table-column>
<el-table-column label="上班1" align="center" prop="startTime" />
<el-table-column label="下班1" align="center" prop="endTime" />
<el-table-column label="上班2" align="center" prop="startTime2" />
<el-table-column label="下班2" align="center" prop="endTime2" />
<el-table-column label="是否跨天" align="center" prop="isCrossDay">
<template slot-scope="scope">
<el-tag :type="scope.row.isCrossDay === 1 ? 'danger' : 'success'">{{ scope.row.isCrossDay === 1 ? '是' : '否' }}</el-tag>
</template>
</el-table-column>
<el-table-column label="工时" align="center" prop="workHours" />
<el-table-column label="备注" align="center" prop="remark" :show-overflow-tooltip="true" />
<el-table-column label="创建时间" align="center" prop="createTime" width="180">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-document-copy"
@click="handleCopy(scope.row)"
>变更</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</KLPTable>
<pagination
v-show="total>0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改班次对话框 -->
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
<el-alert
v-if="title === '变更班次'"
title="变更是在当前班次规则的基础上进行调整生成一个新的班次规则"
type="warning"
:closable="false"
show-icon
style="margin-bottom: 15px;"
/>
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="班次名称" prop="shiftName">
<el-input v-model="form.shiftName" placeholder="请输入班次名称" />
</el-form-item>
<el-form-item label="班次类型" prop="shiftType">
<el-select v-model="form.shiftType" placeholder="请选择班次类型" filterable style="width: 100%" allow-create>
<el-option label="白班" value="白班" />
<el-option label="夜班" value="夜班" />
</el-select>
</el-form-item>
<el-form-item label="季节" prop="season">
<el-select v-model="form.season" placeholder="请选择季节" filterable style="width: 100%" allow-create>
<el-option label="夏季" value="夏季" />
<el-option label="冬季" value="冬季" />
</el-select>
</el-form-item>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="上班1" prop="startTime">
<el-input
v-model="form.startTime"
placeholder="例如: 08:30"
style="width: 100%"
@blur="formatTime('startTime')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="下班1" prop="endTime">
<el-input
v-model="form.endTime"
placeholder="例如: 17:30"
style="width: 100%"
@blur="formatTime('endTime')"
/>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="上班2" prop="startTime2">
<el-input
v-model="form.startTime2"
placeholder="例如: 08:30"
style="width: 100%"
@blur="formatTime('startTime2')"
/>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="下班2" prop="endTime2">
<el-input
v-model="form.endTime2"
placeholder="例如: 17:30"
style="width: 100%"
@blur="formatTime('endTime2')"
/>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="是否跨天" prop="isCrossDay">
<el-radio-group v-model="form.isCrossDay">
<el-radio :label="0"></el-radio>
<el-radio :label="1"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listShift, getShift, addShift, updateShift, delShift } from "@/api/wms/attendanceShift";
export default {
name: "AttendanceShift",
data() {
return {
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 班次表格数据
shiftList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 20,
shiftName: undefined,
shiftType: undefined,
season: undefined
},
// 表单参数
form: {},
// 表单校验
rules: {
shiftName: [
{ required: true, message: "班次名称不能为空", trigger: "blur" }
],
shiftType: [
{ required: true, message: "班次类型不能为空", trigger: "change" }
],
season: [
{ required: true, message: "季节不能为空", trigger: "change" }
],
// startTime: [
// { required: true, message: "上班1时间不能为空", trigger: "blur" },
// { pattern: /^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/, message: "请输入正确的时间格式,例如 08:30", trigger: "blur" }
// ],
// endTime: [
// { required: true, message: "下班1时间不能为空", trigger: "blur" },
// { pattern: /^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/, message: "请输入正确的时间格式,例如 17:30", trigger: "blur" }
// ],
// startTime2: [
// {
// validator: (rule, value, callback) => {
// if (this.form.endTime2 && !value) {
// callback(new Error("请输入上班2时间"));
// } else if (value && !/^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/.test(value)) {
// callback(new Error("请输入正确的时间格式,例如 08:30"));
// } else {
// callback();
// }
// },
// trigger: "blur"
// }
// ],
// endTime2: [
// {
// validator: (rule, value, callback) => {
// if (this.form.startTime2 && !value) {
// callback(new Error("请输入下班2时间"));
// } else if (value && !/^([01]\d|2[0-3]):([0-5]\d):([0-5]\d)$/.test(value)) {
// callback(new Error("请输入正确的时间格式,例如 17:30"));
// } else {
// callback();
// }
// },
// trigger: "blur"
// }
// ]
}
};
},
created() {
this.getList();
},
watch: {
"form.startTime": {
handler() {
this.calculateWorkHours();
}
},
"form.endTime": {
handler() {
this.calculateWorkHours();
}
},
"form.startTime2": {
handler() {
this.calculateWorkHours();
}
},
"form.endTime2": {
handler() {
this.calculateWorkHours();
}
},
"form.isCrossDay": {
handler() {
this.calculateWorkHours();
}
}
},
methods: {
/** 格式化时间为 hh:mm:ss */
formatTime(field) {
let time = this.form[field];
if (!time) return;
// 移除非数字和冒号的字符
time = time.replace(/[^\d:]/g, '');
let hours, minutes, seconds = '00';
// 处理输入格式
if (time.includes(':')) {
const parts = time.split(':');
hours = parts[0].padStart(2, '0');
minutes = parts[1] ? parts[1].padStart(2, '0') : '00';
seconds = parts[2] ? parts[2].padStart(2, '0') : '00';
} else if (time.length >= 4) {
// 直接输入数字,如 0830 或 830
hours = time.substring(0, 2).padStart(2, '0');
minutes = time.substring(2, 4).padStart(2, '0');
} else if (time.length === 3) {
// 如 830
hours = '0' + time.substring(0, 1);
minutes = time.substring(1, 3).padStart(2, '0');
} else if (time.length === 2) {
// 如 08默认分钟为00
hours = time.padStart(2, '0');
minutes = '00';
} else if (time.length === 1) {
// 如 8默认分钟为00
hours = '0' + time;
minutes = '00';
}
// 验证并限制范围
hours = Math.min(23, Math.max(0, parseInt(hours || 0))).toString().padStart(2, '0');
minutes = Math.min(59, Math.max(0, parseInt(minutes || 0))).toString().padStart(2, '0');
seconds = Math.min(59, Math.max(0, parseInt(seconds || 0))).toString().padStart(2, '0');
this.form[field] = `${hours}:${minutes}:${seconds}`;
this.calculateWorkHours();
},
/** 计算工时 */
calculateWorkHours() {
if (!this.form.startTime || !this.form.endTime) {
this.form.workHours = undefined;
return;
}
const parseTime = (timeStr) => {
if (!timeStr) return null;
const [hours, minutes, seconds] = timeStr.split(":").map(Number);
return hours * 3600 + minutes * 60 + (seconds || 0);
};
let totalSeconds = 0;
// 计算第一段工作时间
const start1 = parseTime(this.form.startTime);
const end1 = parseTime(this.form.endTime);
if (start1 !== null && end1 !== null) {
let diff1 = end1 - start1;
if (diff1 < 0) {
diff1 += 24 * 3600; // 跨天
}
totalSeconds += diff1;
}
// 计算第二段工作时间(如果有)
if (this.form.startTime2 && this.form.endTime2) {
const start2 = parseTime(this.form.startTime2);
const end2 = parseTime(this.form.endTime2);
if (start2 !== null && end2 !== null) {
let diff2 = end2 - start2;
if (diff2 < 0) {
diff2 += 24 * 3600; // 跨天
}
totalSeconds += diff2;
}
}
// 转换为小时,保留两位小数
this.form.workHours = parseFloat((totalSeconds / 3600).toFixed(2));
},
/** 查询班次列表 */
getList() {
this.loading = true;
listShift(this.queryParams).then(response => {
this.shiftList = response.rows;
this.total = response.total;
this.loading = false;
});
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
shiftId: undefined,
shiftName: undefined,
shiftType: undefined,
season: undefined,
startTime: undefined,
endTime: undefined,
startTime2: undefined,
endTime2: undefined,
isCrossDay: 0,
workHours: undefined,
remark: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "新增班次";
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.shiftId);
},
/** 修改按钮操作 */
handleUpdate(row) {
this.reset();
// 获取详细数据
getShift(row.shiftId).then(response => {
this.form = response.data;
this.open = true;
this.title = "修改班次";
});
},
/** 变更按钮操作(复制当前数据新增) */
handleCopy(row) {
this.reset();
// 复制当前数据但不包含id
this.form = {
shiftName: row.shiftName,
shiftType: row.shiftType,
season: row.season,
startTime: row.startTime,
endTime: row.endTime,
startTime2: row.startTime2,
endTime2: row.endTime2,
isCrossDay: row.isCrossDay,
workHours: row.workHours,
remark: row.remark
};
// 重新计算工时
this.calculateWorkHours();
this.open = true;
this.title = "变更班次";
},
/** 提交按钮 */
submitForm: function() {
this.$refs["form"].validate(valid => {
if (valid) {
if (this.form.shiftId) {
updateShift(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
});
} else {
addShift(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
this.$modal.confirm('是否确认删除班次"' + row.shiftName + '"? 如果使用该班次进行过排班,可能会导致排班异常。').then(() => {
return delShift(row.shiftId);
}).then(() => {
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {});
}
}
};
</script>

View File

@@ -0,0 +1,399 @@
<template>
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="倒班日期" prop="changeDays">
<el-input
v-model="queryParams.changeDays"
placeholder="请输入倒班日期"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="周期天数" prop="cycleDays">
<el-input
v-model="queryParams.cycleDays"
placeholder="请输入周期天数"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="班次A" prop="shiftA">
<el-input
v-model="queryParams.shiftA"
placeholder="请输入班次A"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="班次B" prop="shiftB">
<el-input
v-model="queryParams.shiftB"
placeholder="请输入班次B"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
<el-button icon="el-icon-refresh" size="mini" @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="el-icon-plus"
size="mini"
@click="handleAdd"
>新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="success"
plain
icon="el-icon-edit"
size="mini"
:disabled="single"
@click="handleUpdate"
>修改</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="danger"
plain
icon="el-icon-delete"
size="mini"
:disabled="multiple"
@click="handleDelete"
>删除</el-button>
</el-col>
<el-col :span="1.5">
<el-button
type="warning"
plain
icon="el-icon-download"
size="mini"
@click="handleExport"
>导出</el-button>
</el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
<el-table v-loading="loading" :data="attendanceShiftRuleList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键ID" align="center" prop="ruleId" v-if="true"/>
<el-table-column label="规则类型" align="center" prop="ruleType" />
<el-table-column label="倒班日期" align="center" prop="changeDays" />
<el-table-column label="周期天数" align="center" prop="cycleDays" />
<el-table-column label="班次A" align="center" prop="shiftA">
<template slot-scope="scope">
{{ getShiftName(scope.row.shiftA) }}
</template>
</el-table-column>
<el-table-column label="班次B" align="center" prop="shiftB">
<template slot-scope="scope">
{{ getShiftName(scope.row.shiftB) }}
</template>
</el-table-column>
<el-table-column label="倒班日班次(白转夜)" align="center" prop="changeShiftBId">
<template slot-scope="scope">
{{ getShiftName(scope.row.changeShiftBId) }}
</template>
</el-table-column>
<el-table-column label="倒班日班次(夜转白)" align="center" prop="changeShiftAId">
<template slot-scope="scope">
{{ getShiftName(scope.row.changeShiftAId) }}
</template>
</el-table-column>
<el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-delete"
@click="handleDelete(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
<pagination
v-show="total > 0"
:total="total"
:page.sync="queryParams.pageNum"
:limit.sync="queryParams.pageSize"
@pagination="getList"
/>
<!-- 添加或修改倒班规则对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
<el-form-item label="倒班日期" prop="changeDays">
<el-input v-model="form.changeDays" placeholder="请输入倒班日期" />
</el-form-item>
<el-form-item label="周期天数" prop="cycleDays">
<el-input v-model="form.cycleDays" placeholder="请输入周期天数" />
</el-form-item>
<el-form-item label="班次A" prop="shiftA">
<el-select v-model="form.shiftA" placeholder="请选择班次A" style="width: 100%;">
<el-option
v-for="item in shiftList"
:key="item.shiftId"
:label="item.shiftName"
:value="item.shiftId"
/>
</el-select>
</el-form-item>
<el-form-item label="班次B" prop="shiftB">
<el-select v-model="form.shiftB" placeholder="请选择班次B" style="width: 100%;">
<el-option
v-for="item in shiftList"
:key="item.shiftId"
:label="item.shiftName"
:value="item.shiftId"
/>
</el-select>
</el-form-item>
<el-form-item label="倒班日班次(白转夜)" prop="changeShiftBId">
<el-select v-model="form.changeShiftBId" placeholder="请选择倒班日班次(白转夜)" style="width: 100%;">
<el-option
v-for="item in shiftList"
:key="item.shiftId"
:label="item.shiftName"
:value="item.shiftId"
/>
</el-select>
</el-form-item>
<el-form-item label="倒班日班次(夜转白)" prop="changeShiftAId">
<el-select v-model="form.changeShiftAId" placeholder="请选择倒班日班次(夜转白)" style="width: 100%;">
<el-option
v-for="item in shiftList"
:key="item.shiftId"
:label="item.shiftName"
:value="item.shiftId"
/>
</el-select>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item>
</el-form>
<div slot="footer" class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</el-dialog>
</div>
</template>
<script>
import { listAttendanceShiftRule, getAttendanceShiftRule, delAttendanceShiftRule, addAttendanceShiftRule, updateAttendanceShiftRule } from "@/api/wms/attendanceShiftRule";
import { listShift } from "@/api/wms/attendanceShift";
export default {
name: "AttendanceShiftRule",
data() {
return {
// 按钮loading
buttonLoading: false,
// 遮罩层
loading: true,
// 选中数组
ids: [],
// 非单个禁用
single: true,
// 非多个禁用
multiple: true,
// 显示搜索条件
showSearch: true,
// 总条数
total: 0,
// 倒班规则表格数据
attendanceShiftRuleList: [],
// 弹出层标题
title: "",
// 是否显示弹出层
open: false,
// 班次列表
shiftList: [],
// 查询参数
queryParams: {
pageNum: 1,
pageSize: 10,
ruleType: undefined,
changeDays: undefined,
cycleDays: undefined,
shiftA: undefined,
shiftB: undefined,
},
// 表单参数
form: {},
// 表单校验
rules: {
shiftA: [
{ required: true, message: "班次A不能为空", trigger: "change" }
],
shiftB: [
{ required: true, message: "班次B不能为空", trigger: "change" }
],
changeShiftBId: [
{ required: true, message: "倒班日班次(白转夜)不能为空", trigger: "change" }
],
changeShiftAId: [
{ required: true, message: "倒班日班次(夜转白)不能为空", trigger: "change" }
],
}
};
},
created() {
this.getList();
this.getShiftList();
},
methods: {
/** 查询倒班规则列表 */
getList() {
this.loading = true;
listAttendanceShiftRule(this.queryParams).then(response => {
this.attendanceShiftRuleList = response.rows;
this.total = response.total;
this.loading = false;
});
},
/** 获取班次列表 */
getShiftList() {
listShift().then(response => {
this.shiftList = response.rows || [];
});
},
/** 获取班次名称和理论打卡时间 */
getShiftName(shiftId) {
if (!shiftId) return '';
const shift = this.shiftList.find(item => item.shiftId === shiftId);
if (!shift) return shiftId;
let timeStr = '';
if (shift.startTime && shift.endTime) {
timeStr = `(${shift.startTime.slice(0, 5)}-${shift.endTime.slice(0, 5)}`;
if (shift.startTime2 && shift.endTime2) {
timeStr += `, ${shift.startTime2.slice(0, 5)}-${shift.endTime2.slice(0, 5)}`;
}
timeStr += ')';
}
return `${shift.shiftName} ${timeStr}`;
},
// 取消按钮
cancel() {
this.open = false;
this.reset();
},
// 表单重置
reset() {
this.form = {
ruleId: undefined,
ruleType: undefined,
changeDays: undefined,
cycleDays: undefined,
shiftA: undefined,
shiftB: undefined,
changeShiftBId: undefined,
changeShiftAId: undefined,
remark: undefined,
delFlag: undefined,
createBy: undefined,
updateBy: undefined,
createTime: undefined,
updateTime: undefined
};
this.resetForm("form");
},
/** 搜索按钮操作 */
handleQuery() {
this.queryParams.pageNum = 1;
this.getList();
},
/** 重置按钮操作 */
resetQuery() {
this.resetForm("queryForm");
this.handleQuery();
},
// 多选框选中数据
handleSelectionChange(selection) {
this.ids = selection.map(item => item.ruleId)
this.single = selection.length!==1
this.multiple = !selection.length
},
/** 新增按钮操作 */
handleAdd() {
this.reset();
this.open = true;
this.title = "添加倒班规则";
},
/** 修改按钮操作 */
handleUpdate(row) {
this.loading = true;
this.reset();
const ruleId = row.ruleId || this.ids
getAttendanceShiftRule(ruleId).then(response => {
this.loading = false;
this.form = response.data;
this.open = true;
this.title = "修改倒班规则";
});
},
/** 提交按钮 */
submitForm() {
this.$refs["form"].validate(valid => {
if (valid) {
this.buttonLoading = true;
if (this.form.ruleId != null) {
updateAttendanceShiftRule(this.form).then(response => {
this.$modal.msgSuccess("修改成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
} else {
addAttendanceShiftRule(this.form).then(response => {
this.$modal.msgSuccess("新增成功");
this.open = false;
this.getList();
}).finally(() => {
this.buttonLoading = false;
});
}
}
});
},
/** 删除按钮操作 */
handleDelete(row) {
const ruleIds = row.ruleId || this.ids;
this.$modal.confirm('是否确认删除倒班规则编号为"' + ruleIds + '"的数据项?').then(() => {
this.loading = true;
return delAttendanceShiftRule(ruleIds);
}).then(() => {
this.loading = false;
this.getList();
this.$modal.msgSuccess("删除成功");
}).catch(() => {
}).finally(() => {
this.loading = false;
});
},
/** 导出按钮操作 */
handleExport() {
this.download('wms/attendanceShiftRule/export', {
...this.queryParams
}, `attendanceShiftRule_${new Date().getTime()}.xlsx`)
}
}
};
</script>

View File

@@ -4,18 +4,18 @@
<el-date-picker
style="width: 200px;"
v-model="startTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择开始时间"
:type="pickerType"
:value-format="format"
:placeholder="isDateType ? '选择开始日期' : '选择开始时间'"
@change="handleTimeChange"
/>
<span class="separator"></span>
<el-date-picker
style="width: 200px;"
v-model="endTime"
type="datetime"
value-format="yyyy-MM-dd HH:mm:ss"
placeholder="选择结束时间"
:type="pickerType"
:value-format="format"
:placeholder="isDateType ? '选择结束日期' : '选择结束时间'"
@change="handleTimeChange"
/>
</div>
@@ -55,6 +55,18 @@ export default {
defaultEndTime: {
type: String,
default: ''
},
format: {
type: String,
default: 'yyyy-MM-dd HH:mm:ss'
}
},
computed: {
pickerType() {
return this.isDateType ? 'date' : 'datetime'
},
isDateType() {
return this.format === 'yyyy-MM-dd'
}
},
data() {
@@ -94,12 +106,14 @@ export default {
},
// 从时间字符串中提取时分秒部分
getTimePart(timeStr) {
if (this.isDateType) return ''
if (!timeStr) return '07:00:00'
const parts = timeStr.split(' ')
return parts.length > 1 ? parts[1] : '07:00:00'
},
// 将日期和时间组合
combineDateTime(dateStr, timeStr) {
if (this.isDateType) return dateStr
return `${dateStr} ${timeStr}`
},
handleTimeChange() {

View File

@@ -5,6 +5,7 @@ import com.klp.common.core.controller.BaseController;
import com.klp.common.core.domain.PageQuery;
import com.klp.common.core.domain.R;
import com.klp.common.core.page.TableDataInfo;
import com.klp.common.core.validate.EditGroup;
import com.klp.common.enums.BusinessType;
import com.klp.domain.bo.AttendanceCheckBo;
import com.klp.domain.bo.WmsAttendanceCheckBo;
@@ -16,6 +17,7 @@ import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -55,4 +57,10 @@ public class WmsAttendanceCheckController extends BaseController {
iWmsAttendanceCheckService.checkAttendance(bo);
return R.ok();
}
@Log(title = "考勤比对", businessType = BusinessType.UPDATE)
@PutMapping
public R<Void> edit(@Validated(EditGroup.class) @RequestBody WmsAttendanceCheckBo bo) {
return toAjax(iWmsAttendanceCheckService.updateByBo(bo));
}
}

View File

@@ -1,14 +1,19 @@
package com.klp.domain.bo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.klp.common.core.domain.BaseEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;
import java.math.BigDecimal;
import java.util.Date;
@Data
public class WmsAttendanceCheckBo {
@EqualsAndHashCode(callSuper = true)
public class WmsAttendanceCheckBo extends BaseEntity {
private Long checkId;
private Long userId;
private String employeeName;
private Long shiftId;
@@ -20,4 +25,20 @@ public class WmsAttendanceCheckBo {
@JsonFormat(pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern = "yyyy-MM-dd")
private Date endDate;
private Integer p1LateMinutes;
private Integer p1EarlyMinutes;
private String p1Status;
private BigDecimal p1Deduct;
private Integer p2LateMinutes;
private Integer p2EarlyMinutes;
private String p2Status;
private BigDecimal p2Deduct;
private String absentType;
private Integer continuousAbsentDays;
private BigDecimal totalDeduct;
private String overallStatus;
private String remark;
}

View File

@@ -33,6 +33,8 @@ public class WmsAttendanceScheduleBo extends BaseEntity {
/**
* 日期
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date workDate;
/**

View File

@@ -8,6 +8,7 @@ import javax.validation.constraints.*;
import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
/**
* 员工外出申请业务对象 wms_out_request
@@ -43,11 +44,15 @@ public class WmsOutRequestBo extends BaseEntity {
/**
* 外出开始时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date startTime;
/**
* 外出结束时间
*/
@DateTimeFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd")
private Date endTime;
/**

View File

@@ -95,5 +95,19 @@ public class WmsLeaveRequestVo extends BaseEntity {
private String createByName;
/**
* 审批状态(待审批/已同意/已驳回/已撤销)
*/
private String approvalStatus;
/**
* 审批类型single=单人审批multi=多级审批)
*/
private String approvalType;
/**
* 审批人姓名
*/
private String approverName;
}

View File

@@ -94,5 +94,19 @@ public class WmsOutRequestVo extends BaseEntity {
private String createByName;
/**
* 审批状态(待审批/已同意/已驳回/已撤销)
*/
private String approvalStatus;
/**
* 审批类型single=单人审批multi=多级审批)
*/
private String approvalType;
/**
* 审批人姓名
*/
private String approverName;
}

View File

@@ -20,4 +20,6 @@ public interface IWmsAttendanceCheckService {
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
void checkAttendance(AttendanceCheckBo bo);
Boolean updateByBo(WmsAttendanceCheckBo bo);
}

View File

@@ -1,5 +1,6 @@
package com.klp.service.impl;
import cn.hutool.core.bean.BeanUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@@ -77,6 +78,13 @@ public class WmsAttendanceCheckServiceImpl implements IWmsAttendanceCheckService
return baseMapper.deleteBatchIds(ids) > 0;
}
@Override
@Transactional(rollbackFor = Exception.class)
public Boolean updateByBo(WmsAttendanceCheckBo bo) {
WmsAttendanceCheck update = BeanUtil.toBean(bo, WmsAttendanceCheck.class);
return baseMapper.updateById(update) > 0;
}
private LambdaQueryWrapper<WmsAttendanceCheck> buildQueryWrapper(WmsAttendanceCheckBo bo) {
LambdaQueryWrapper<WmsAttendanceCheck> lqw = Wrappers.lambdaQuery();
lqw.eq(bo.getUserId() != null, WmsAttendanceCheck::getUserId, bo.getUserId());

View File

@@ -8,6 +8,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.klp.common.utils.StringUtils;
import com.klp.domain.bo.WmsApprovalBo;
import com.klp.domain.vo.WmsApprovalVo;
import com.klp.service.IWmsApprovalService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -51,6 +52,19 @@ public class WmsLeaveRequestServiceImpl implements IWmsLeaveRequestService {
public TableDataInfo<WmsLeaveRequestVo> queryPageList(WmsLeaveRequestBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WmsLeaveRequest> lqw = buildQueryWrapper(bo);
Page<WmsLeaveRequestVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
result.getRecords().forEach(row -> {
// 获取审批信息
WmsApprovalBo approval = new WmsApprovalBo();
approval.setApplyId(row.getLeaveId());
approval.setApplyType("leave");
List<WmsApprovalVo> approvals = approvalService.queryList(approval);
if (!approvals.isEmpty()) {
WmsApprovalVo approvalVo = approvals.get(0);
row.setApprovalStatus(approvalVo.getApprovalStatus());
row.setApprovalType(approvalVo.getApprovalType());
row.setApproverName(approvalVo.getApproverName());
}
});
return TableDataInfo.build(result);
}
@@ -100,9 +114,6 @@ public class WmsLeaveRequestServiceImpl implements IWmsLeaveRequestService {
} else if (bo.getEndTime() != null) {
lqw.le(WmsLeaveRequest::getStartTime, bo.getEndTime());
}
lqw.eq(bo.getStartTime() != null, WmsLeaveRequest::getStartTime, bo.getStartTime());
lqw.eq(bo.getEndTime() != null, WmsLeaveRequest::getEndTime, bo.getEndTime());
lqw.eq(StringUtils.isNotBlank(bo.getLeaveShift()), WmsLeaveRequest::getLeaveShift, bo.getLeaveShift());
lqw.eq(bo.getLeaveDays() != null, WmsLeaveRequest::getLeaveDays, bo.getLeaveDays());
lqw.eq(StringUtils.isNotBlank(bo.getLeaveReason()), WmsLeaveRequest::getLeaveReason, bo.getLeaveReason());

View File

@@ -7,7 +7,9 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.klp.common.utils.StringUtils;
import com.klp.domain.WmsLeaveRequest;
import com.klp.domain.bo.WmsApprovalBo;
import com.klp.domain.vo.WmsApprovalVo;
import com.klp.service.IWmsApprovalService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;
@@ -52,6 +54,19 @@ public class WmsOutRequestServiceImpl implements IWmsOutRequestService {
public TableDataInfo<WmsOutRequestVo> queryPageList(WmsOutRequestBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<WmsOutRequest> lqw = buildQueryWrapper(bo);
Page<WmsOutRequestVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
result.getRecords().forEach(row -> {
// 获取审批信息
WmsApprovalBo approval = new WmsApprovalBo();
approval.setApplyId(row.getOutId());
approval.setApplyType("out");
List<WmsApprovalVo> approvals = approvalService.queryList(approval);
if (!approvals.isEmpty()) {
WmsApprovalVo approvalVo = approvals.get(0);
row.setApprovalStatus(approvalVo.getApprovalStatus());
row.setApprovalType(approvalVo.getApprovalType());
row.setApproverName(approvalVo.getApproverName());
}
});
return TableDataInfo.build(result);
}
@@ -70,8 +85,16 @@ public class WmsOutRequestServiceImpl implements IWmsOutRequestService {
lqw.eq(StringUtils.isNotBlank(bo.getOutType()), WmsOutRequest::getOutType, bo.getOutType());
lqw.like(StringUtils.isNotBlank(bo.getApplicantName()), WmsOutRequest::getApplicantName, bo.getApplicantName());
lqw.like(StringUtils.isNotBlank(bo.getApplicantDeptName()), WmsOutRequest::getApplicantDeptName, bo.getApplicantDeptName());
lqw.eq(bo.getStartTime() != null, WmsOutRequest::getStartTime, bo.getStartTime());
lqw.eq(bo.getEndTime() != null, WmsOutRequest::getEndTime, bo.getEndTime());
// 请假时间范围筛选:筛选出请假时间与查询时间范围有交集的记录
// 条件:(start_time <= endTime AND end_time >= startTime)
if (bo.getStartTime() != null && bo.getEndTime() != null) {
lqw.le(WmsOutRequest::getStartTime, bo.getEndTime())
.ge(WmsOutRequest::getEndTime, bo.getStartTime());
} else if (bo.getStartTime() != null) {
lqw.ge(WmsOutRequest::getEndTime, bo.getStartTime());
} else if (bo.getEndTime() != null) {
lqw.le(WmsOutRequest::getStartTime, bo.getEndTime());
}
lqw.eq(bo.getOutHours() != null, WmsOutRequest::getOutHours, bo.getOutHours());
lqw.eq(StringUtils.isNotBlank(bo.getOutPlace()), WmsOutRequest::getOutPlace, bo.getOutPlace());
lqw.eq(StringUtils.isNotBlank(bo.getOutReason()), WmsOutRequest::getOutReason, bo.getOutReason());