Merge branch '0.8.X' of http://49.232.154.205:10100/DeXun/klp-oa into 0.8.X
This commit is contained in:
@@ -0,0 +1,99 @@
|
|||||||
|
package com.klp.flow.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.flow.domain.vo.SchProdProcessVo;
|
||||||
|
import com.klp.flow.domain.bo.SchProdProcessBo;
|
||||||
|
import com.klp.flow.service.ISchProdProcessService;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序定义主
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/flow/prodProcess")
|
||||||
|
public class SchProdProcessController extends BaseController {
|
||||||
|
|
||||||
|
private final ISchProdProcessService iSchProdProcessService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序定义主列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SchProdProcessVo> list(SchProdProcessBo bo, PageQuery pageQuery) {
|
||||||
|
return iSchProdProcessService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出工序定义主列表
|
||||||
|
*/
|
||||||
|
@Log(title = "工序定义主", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SchProdProcessBo bo, HttpServletResponse response) {
|
||||||
|
List<SchProdProcessVo> list = iSchProdProcessService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "工序定义主", SchProdProcessVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工序定义主详细信息
|
||||||
|
*
|
||||||
|
* @param processId 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/{processId}")
|
||||||
|
public R<SchProdProcessVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long processId) {
|
||||||
|
return R.ok(iSchProdProcessService.queryById(processId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工序定义主
|
||||||
|
*/
|
||||||
|
@Log(title = "工序定义主", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SchProdProcessBo bo) {
|
||||||
|
return toAjax(iSchProdProcessService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工序定义主
|
||||||
|
*/
|
||||||
|
@Log(title = "工序定义主", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SchProdProcessBo bo) {
|
||||||
|
return toAjax(iSchProdProcessService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工序定义主
|
||||||
|
*
|
||||||
|
* @param processIds 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "工序定义主", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{processIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] processIds) {
|
||||||
|
return toAjax(iSchProdProcessService.deleteWithValidByIds(Arrays.asList(processIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,99 @@
|
|||||||
|
package com.klp.flow.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.flow.domain.vo.SchProdProcessStepVo;
|
||||||
|
import com.klp.flow.domain.bo.SchProdProcessStepBo;
|
||||||
|
import com.klp.flow.service.ISchProdProcessStepService;
|
||||||
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序步骤明细
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
@Validated
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/flow/prodProcessStep")
|
||||||
|
public class SchProdProcessStepController extends BaseController {
|
||||||
|
|
||||||
|
private final ISchProdProcessStepService iSchProdProcessStepService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序步骤明细列表
|
||||||
|
*/
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo<SchProdProcessStepVo> list(SchProdProcessStepBo bo, PageQuery pageQuery) {
|
||||||
|
return iSchProdProcessStepService.queryPageList(bo, pageQuery);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出工序步骤明细列表
|
||||||
|
*/
|
||||||
|
@Log(title = "工序步骤明细", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(SchProdProcessStepBo bo, HttpServletResponse response) {
|
||||||
|
List<SchProdProcessStepVo> list = iSchProdProcessStepService.queryList(bo);
|
||||||
|
ExcelUtil.exportExcel(list, "工序步骤明细", SchProdProcessStepVo.class, response);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取工序步骤明细详细信息
|
||||||
|
*
|
||||||
|
* @param stepId 主键
|
||||||
|
*/
|
||||||
|
@GetMapping("/{stepId}")
|
||||||
|
public R<SchProdProcessStepVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
|
@PathVariable Long stepId) {
|
||||||
|
return R.ok(iSchProdProcessStepService.queryById(stepId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工序步骤明细
|
||||||
|
*/
|
||||||
|
@Log(title = "工序步骤明细", businessType = BusinessType.INSERT)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PostMapping()
|
||||||
|
public R<Void> add(@Validated(AddGroup.class) @RequestBody SchProdProcessStepBo bo) {
|
||||||
|
return toAjax(iSchProdProcessStepService.insertByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工序步骤明细
|
||||||
|
*/
|
||||||
|
@Log(title = "工序步骤明细", businessType = BusinessType.UPDATE)
|
||||||
|
@RepeatSubmit()
|
||||||
|
@PutMapping()
|
||||||
|
public R<Void> edit(@Validated(EditGroup.class) @RequestBody SchProdProcessStepBo bo) {
|
||||||
|
return toAjax(iSchProdProcessStepService.updateByBo(bo));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除工序步骤明细
|
||||||
|
*
|
||||||
|
* @param stepIds 主键串
|
||||||
|
*/
|
||||||
|
@Log(title = "工序步骤明细", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{stepIds}")
|
||||||
|
public R<Void> remove(@NotEmpty(message = "主键不能为空")
|
||||||
|
@PathVariable Long[] stepIds) {
|
||||||
|
return toAjax(iSchProdProcessStepService.deleteWithValidByIds(Arrays.asList(stepIds), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,45 @@
|
|||||||
|
package com.klp.flow.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序定义主对象 sch_prod_process
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("sch_prod_process")
|
||||||
|
public class SchProdProcess extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "process_id")
|
||||||
|
private Long processId;
|
||||||
|
/**
|
||||||
|
* 工序名称(如:酸扎镀锌毛化流程)
|
||||||
|
*/
|
||||||
|
private String processName;
|
||||||
|
/**
|
||||||
|
* 工序描述
|
||||||
|
*/
|
||||||
|
private String processDesc;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 删除标识 0正常 2删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.klp.flow.domain;
|
||||||
|
|
||||||
|
import com.baomidou.mybatisplus.annotation.*;
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序步骤明细对象 sch_prod_process_step
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
@TableName("sch_prod_process_step")
|
||||||
|
public class SchProdProcessStep extends BaseEntity {
|
||||||
|
|
||||||
|
private static final long serialVersionUID=1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤主键ID
|
||||||
|
*/
|
||||||
|
@TableId(value = "step_id")
|
||||||
|
private Long stepId;
|
||||||
|
/**
|
||||||
|
* 关联工序主表ID(sch_prod_process.process_id)
|
||||||
|
*/
|
||||||
|
private Long processId;
|
||||||
|
/**
|
||||||
|
* 步骤顺序号(1,2,3...)
|
||||||
|
*/
|
||||||
|
private Long stepOrder;
|
||||||
|
/**
|
||||||
|
* 步骤名称(如:酸扎、镀锌、毛化辊、毛化镀锌卷)
|
||||||
|
*/
|
||||||
|
private String stepName;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
/**
|
||||||
|
* 删除标识 0正常 2删除
|
||||||
|
*/
|
||||||
|
@TableLogic
|
||||||
|
private Long delFlag;
|
||||||
|
|
||||||
|
}
|
||||||
@@ -33,6 +33,10 @@ public class SchProdScheduleDetail extends BaseEntity {
|
|||||||
* 来源销售订单明细ID(溯源原始订单规格)
|
* 来源销售订单明细ID(溯源原始订单规格)
|
||||||
*/
|
*/
|
||||||
private Long orderDetailId;
|
private Long orderDetailId;
|
||||||
|
/**
|
||||||
|
* 关联工序主表ID(sch_prod_process.process_id),表示该明细使用的工序配置
|
||||||
|
*/
|
||||||
|
private Long processId;
|
||||||
/**
|
/**
|
||||||
* 规格 例:1.0X1250
|
* 规格 例:1.0X1250
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -132,9 +132,9 @@ public class SchProdScheduleItem extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private String scheduleDetailIds;
|
private String scheduleDetailIds;
|
||||||
/**
|
/**
|
||||||
* 工序类型
|
* 工序ID
|
||||||
*/
|
*/
|
||||||
private String actionType;
|
private Long actionId;
|
||||||
/**
|
/**
|
||||||
* 规格 例:1.0X1250
|
* 规格 例:1.0X1250
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -0,0 +1,41 @@
|
|||||||
|
package com.klp.flow.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序定义主业务对象 sch_prod_process
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SchProdProcessBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序主键ID
|
||||||
|
*/
|
||||||
|
private Long processId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序名称(如:酸扎镀锌毛化流程)
|
||||||
|
*/
|
||||||
|
private String processName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序描述
|
||||||
|
*/
|
||||||
|
private String processDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,46 @@
|
|||||||
|
package com.klp.flow.domain.bo;
|
||||||
|
|
||||||
|
import com.klp.common.core.domain.BaseEntity;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import javax.validation.constraints.*;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序步骤明细业务对象 sch_prod_process_step
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
|
||||||
|
@Data
|
||||||
|
@EqualsAndHashCode(callSuper = true)
|
||||||
|
public class SchProdProcessStepBo extends BaseEntity {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤主键ID
|
||||||
|
*/
|
||||||
|
private Long stepId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联工序主表ID(sch_prod_process.process_id)
|
||||||
|
*/
|
||||||
|
private Long processId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤顺序号(1,2,3...)
|
||||||
|
*/
|
||||||
|
private Long stepOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤名称(如:酸扎、镀锌、毛化辊、毛化镀锌卷)
|
||||||
|
*/
|
||||||
|
private String stepName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -33,6 +33,11 @@ public class SchProdScheduleDetailBo extends BaseEntity {
|
|||||||
*/
|
*/
|
||||||
private Long orderDetailId;
|
private Long orderDetailId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联工序主表ID(sch_prod_process.process_id),表示该明细使用的工序配置
|
||||||
|
*/
|
||||||
|
private Long processId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格 例:1.0X1250
|
* 规格 例:1.0X1250
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -159,9 +159,9 @@ public class SchProdScheduleItemBo extends BaseEntity {
|
|||||||
private String scheduleDetailIds;
|
private String scheduleDetailIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序类型
|
* 工序ID
|
||||||
*/
|
*/
|
||||||
private String actionType;
|
private Long actionId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格 例:1.0X1250
|
* 规格 例:1.0X1250
|
||||||
|
|||||||
@@ -0,0 +1,56 @@
|
|||||||
|
package com.klp.flow.domain.vo;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序步骤明细视图对象 sch_prod_process_step
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SchProdProcessStepVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤主键ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "步骤主键ID")
|
||||||
|
private Long stepId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联工序主表ID(sch_prod_process.process_id)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "关联工序主表ID", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "s=ch_prod_process.process_id")
|
||||||
|
private Long processId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤顺序号(1,2,3...)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "步骤顺序号", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "1=,2,3...")
|
||||||
|
private Long stepOrder;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 步骤名称(如:酸扎、镀锌、毛化辊、毛化镀锌卷)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "步骤名称", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "如=:酸扎、镀锌、毛化辊、毛化镀锌卷")
|
||||||
|
private String stepName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,48 @@
|
|||||||
|
package com.klp.flow.domain.vo;
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序定义主视图对象 sch_prod_process
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
@Data
|
||||||
|
@ExcelIgnoreUnannotated
|
||||||
|
public class SchProdProcessVo {
|
||||||
|
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序主键ID
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工序主键ID")
|
||||||
|
private Long processId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序名称(如:酸扎镀锌毛化流程)
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工序名称", converter = ExcelDictConvert.class)
|
||||||
|
@ExcelDictFormat(readConverterExp = "如=:酸扎镀锌毛化流程")
|
||||||
|
private String processName;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序描述
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "工序描述")
|
||||||
|
private String processDesc;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "备注")
|
||||||
|
private String remark;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
@@ -40,6 +40,12 @@ public class SchProdScheduleDetailVo {
|
|||||||
@ExcelDictFormat(readConverterExp = "溯=源原始订单规格")
|
@ExcelDictFormat(readConverterExp = "溯=源原始订单规格")
|
||||||
private Long orderDetailId;
|
private Long orderDetailId;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 关联工序主表ID(sch_prod_process.process_id),表示该明细使用的工序配置
|
||||||
|
*/
|
||||||
|
@ExcelProperty(value = "关联工序主表ID")
|
||||||
|
private Long processId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格 例:1.0X1250
|
* 规格 例:1.0X1250
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -190,10 +190,10 @@ public class SchProdScheduleItemVo {
|
|||||||
private String scheduleDetailIds;
|
private String scheduleDetailIds;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 工序类型
|
* 工序ID
|
||||||
*/
|
*/
|
||||||
@ExcelProperty(value = "工序类型")
|
@ExcelProperty(value = "工序ID")
|
||||||
private String actionType;
|
private Long actionId;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 规格 例:1.0X1250
|
* 规格 例:1.0X1250
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.klp.flow.mapper;
|
||||||
|
|
||||||
|
import com.klp.flow.domain.SchProdProcess;
|
||||||
|
import com.klp.flow.domain.vo.SchProdProcessVo;
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序定义主Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
public interface SchProdProcessMapper extends BaseMapperPlus<SchProdProcessMapper, SchProdProcess, SchProdProcessVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,15 @@
|
|||||||
|
package com.klp.flow.mapper;
|
||||||
|
|
||||||
|
import com.klp.flow.domain.SchProdProcessStep;
|
||||||
|
import com.klp.flow.domain.vo.SchProdProcessStepVo;
|
||||||
|
import com.klp.common.core.mapper.BaseMapperPlus;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序步骤明细Mapper接口
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
public interface SchProdProcessStepMapper extends BaseMapperPlus<SchProdProcessStepMapper, SchProdProcessStep, SchProdProcessStepVo> {
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.klp.flow.service;
|
||||||
|
|
||||||
|
import com.klp.flow.domain.SchProdProcess;
|
||||||
|
import com.klp.flow.domain.vo.SchProdProcessVo;
|
||||||
|
import com.klp.flow.domain.bo.SchProdProcessBo;
|
||||||
|
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-07-03
|
||||||
|
*/
|
||||||
|
public interface ISchProdProcessService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序定义主
|
||||||
|
*/
|
||||||
|
SchProdProcessVo queryById(Long processId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序定义主列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<SchProdProcessVo> queryPageList(SchProdProcessBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序定义主列表
|
||||||
|
*/
|
||||||
|
List<SchProdProcessVo> queryList(SchProdProcessBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工序定义主
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(SchProdProcessBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工序定义主
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(SchProdProcessBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除工序定义主信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,49 @@
|
|||||||
|
package com.klp.flow.service;
|
||||||
|
|
||||||
|
import com.klp.flow.domain.SchProdProcessStep;
|
||||||
|
import com.klp.flow.domain.vo.SchProdProcessStepVo;
|
||||||
|
import com.klp.flow.domain.bo.SchProdProcessStepBo;
|
||||||
|
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-07-03
|
||||||
|
*/
|
||||||
|
public interface ISchProdProcessStepService {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序步骤明细
|
||||||
|
*/
|
||||||
|
SchProdProcessStepVo queryById(Long stepId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序步骤明细列表
|
||||||
|
*/
|
||||||
|
TableDataInfo<SchProdProcessStepVo> queryPageList(SchProdProcessStepBo bo, PageQuery pageQuery);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序步骤明细列表
|
||||||
|
*/
|
||||||
|
List<SchProdProcessStepVo> queryList(SchProdProcessStepBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工序步骤明细
|
||||||
|
*/
|
||||||
|
Boolean insertByBo(SchProdProcessStepBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工序步骤明细
|
||||||
|
*/
|
||||||
|
Boolean updateByBo(SchProdProcessStepBo bo);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 校验并批量删除工序步骤明细信息
|
||||||
|
*/
|
||||||
|
Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid);
|
||||||
|
}
|
||||||
@@ -0,0 +1,110 @@
|
|||||||
|
package com.klp.flow.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.flow.domain.bo.SchProdProcessBo;
|
||||||
|
import com.klp.flow.domain.vo.SchProdProcessVo;
|
||||||
|
import com.klp.flow.domain.SchProdProcess;
|
||||||
|
import com.klp.flow.mapper.SchProdProcessMapper;
|
||||||
|
import com.klp.flow.service.ISchProdProcessService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序定义主Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class SchProdProcessServiceImpl implements ISchProdProcessService {
|
||||||
|
|
||||||
|
private final SchProdProcessMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序定义主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SchProdProcessVo queryById(Long processId){
|
||||||
|
return baseMapper.selectVoById(processId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序定义主列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<SchProdProcessVo> queryPageList(SchProdProcessBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<SchProdProcess> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<SchProdProcessVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序定义主列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SchProdProcessVo> queryList(SchProdProcessBo bo) {
|
||||||
|
LambdaQueryWrapper<SchProdProcess> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<SchProdProcess> buildQueryWrapper(SchProdProcessBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<SchProdProcess> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getProcessName()), SchProdProcess::getProcessName, bo.getProcessName());
|
||||||
|
lqw.eq(StringUtils.isNotBlank(bo.getProcessDesc()), SchProdProcess::getProcessDesc, bo.getProcessDesc());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工序定义主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(SchProdProcessBo bo) {
|
||||||
|
SchProdProcess add = BeanUtil.toBean(bo, SchProdProcess.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setProcessId(add.getProcessId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工序定义主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(SchProdProcessBo bo) {
|
||||||
|
SchProdProcess update = BeanUtil.toBean(bo, SchProdProcess.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(SchProdProcess entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除工序定义主
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,111 @@
|
|||||||
|
package com.klp.flow.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.flow.domain.bo.SchProdProcessStepBo;
|
||||||
|
import com.klp.flow.domain.vo.SchProdProcessStepVo;
|
||||||
|
import com.klp.flow.domain.SchProdProcessStep;
|
||||||
|
import com.klp.flow.mapper.SchProdProcessStepMapper;
|
||||||
|
import com.klp.flow.service.ISchProdProcessStepService;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 工序步骤明细Service业务层处理
|
||||||
|
*
|
||||||
|
* @author klp
|
||||||
|
* @date 2026-07-03
|
||||||
|
*/
|
||||||
|
@RequiredArgsConstructor
|
||||||
|
@Service
|
||||||
|
public class SchProdProcessStepServiceImpl implements ISchProdProcessStepService {
|
||||||
|
|
||||||
|
private final SchProdProcessStepMapper baseMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序步骤明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public SchProdProcessStepVo queryById(Long stepId){
|
||||||
|
return baseMapper.selectVoById(stepId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序步骤明细列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public TableDataInfo<SchProdProcessStepVo> queryPageList(SchProdProcessStepBo bo, PageQuery pageQuery) {
|
||||||
|
LambdaQueryWrapper<SchProdProcessStep> lqw = buildQueryWrapper(bo);
|
||||||
|
Page<SchProdProcessStepVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
|
||||||
|
return TableDataInfo.build(result);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询工序步骤明细列表
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<SchProdProcessStepVo> queryList(SchProdProcessStepBo bo) {
|
||||||
|
LambdaQueryWrapper<SchProdProcessStep> lqw = buildQueryWrapper(bo);
|
||||||
|
return baseMapper.selectVoList(lqw);
|
||||||
|
}
|
||||||
|
|
||||||
|
private LambdaQueryWrapper<SchProdProcessStep> buildQueryWrapper(SchProdProcessStepBo bo) {
|
||||||
|
Map<String, Object> params = bo.getParams();
|
||||||
|
LambdaQueryWrapper<SchProdProcessStep> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.eq(bo.getProcessId() != null, SchProdProcessStep::getProcessId, bo.getProcessId());
|
||||||
|
lqw.eq(bo.getStepOrder() != null, SchProdProcessStep::getStepOrder, bo.getStepOrder());
|
||||||
|
lqw.like(StringUtils.isNotBlank(bo.getStepName()), SchProdProcessStep::getStepName, bo.getStepName());
|
||||||
|
return lqw;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增工序步骤明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean insertByBo(SchProdProcessStepBo bo) {
|
||||||
|
SchProdProcessStep add = BeanUtil.toBean(bo, SchProdProcessStep.class);
|
||||||
|
validEntityBeforeSave(add);
|
||||||
|
boolean flag = baseMapper.insert(add) > 0;
|
||||||
|
if (flag) {
|
||||||
|
bo.setStepId(add.getStepId());
|
||||||
|
}
|
||||||
|
return flag;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改工序步骤明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean updateByBo(SchProdProcessStepBo bo) {
|
||||||
|
SchProdProcessStep update = BeanUtil.toBean(bo, SchProdProcessStep.class);
|
||||||
|
validEntityBeforeSave(update);
|
||||||
|
return baseMapper.updateById(update) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 保存前的数据校验
|
||||||
|
*/
|
||||||
|
private void validEntityBeforeSave(SchProdProcessStep entity){
|
||||||
|
//TODO 做一些数据校验,如唯一约束
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除工序步骤明细
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public Boolean deleteWithValidByIds(Collection<Long> ids, Boolean isValid) {
|
||||||
|
if(isValid){
|
||||||
|
//TODO 做一些业务上的校验,判断是否需要校验
|
||||||
|
}
|
||||||
|
return baseMapper.deleteBatchIds(ids) > 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -99,6 +99,7 @@ public class SchProdScheduleDetailServiceImpl implements ISchProdScheduleDetailS
|
|||||||
LambdaQueryWrapper<SchProdScheduleDetail> lqw = Wrappers.lambdaQuery();
|
LambdaQueryWrapper<SchProdScheduleDetail> lqw = Wrappers.lambdaQuery();
|
||||||
lqw.eq(bo.getScheduleId() != null, SchProdScheduleDetail::getScheduleId, bo.getScheduleId());
|
lqw.eq(bo.getScheduleId() != null, SchProdScheduleDetail::getScheduleId, bo.getScheduleId());
|
||||||
lqw.eq(bo.getOrderDetailId() != null, SchProdScheduleDetail::getOrderDetailId, bo.getOrderDetailId());
|
lqw.eq(bo.getOrderDetailId() != null, SchProdScheduleDetail::getOrderDetailId, bo.getOrderDetailId());
|
||||||
|
lqw.eq(bo.getProcessId() != null, SchProdScheduleDetail::getProcessId, bo.getProcessId());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getSpec()), SchProdScheduleDetail::getSpec, bo.getSpec());
|
lqw.eq(StringUtils.isNotBlank(bo.getSpec()), SchProdScheduleDetail::getSpec, bo.getSpec());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getMaterial()), SchProdScheduleDetail::getMaterial, bo.getMaterial());
|
lqw.eq(StringUtils.isNotBlank(bo.getMaterial()), SchProdScheduleDetail::getMaterial, bo.getMaterial());
|
||||||
lqw.eq(bo.getScheduleWeight() != null, SchProdScheduleDetail::getScheduleWeight, bo.getScheduleWeight());
|
lqw.eq(bo.getScheduleWeight() != null, SchProdScheduleDetail::getScheduleWeight, bo.getScheduleWeight());
|
||||||
|
|||||||
@@ -108,8 +108,8 @@ public class SchProdScheduleItemServiceImpl implements ISchProdScheduleItemServi
|
|||||||
lqw.eq(bo.getScheduleWeight() != null, SchProdScheduleItem::getScheduleWeight, bo.getScheduleWeight());
|
lqw.eq(bo.getScheduleWeight() != null, SchProdScheduleItem::getScheduleWeight, bo.getScheduleWeight());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getProductItem()), SchProdScheduleItem::getProductItem, bo.getProductItem());
|
lqw.eq(StringUtils.isNotBlank(bo.getProductItem()), SchProdScheduleItem::getProductItem, bo.getProductItem());
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getRowRemark()), SchProdScheduleItem::getRowRemark, bo.getRowRemark());
|
lqw.eq(StringUtils.isNotBlank(bo.getRowRemark()), SchProdScheduleItem::getRowRemark, bo.getRowRemark());
|
||||||
// actionType
|
// actionId
|
||||||
lqw.eq(StringUtils.isNotBlank(bo.getActionType()), SchProdScheduleItem::getActionType, bo.getActionType());
|
lqw.eq(bo.getActionId() != null, SchProdScheduleItem::getActionId, bo.getActionId());
|
||||||
return lqw;
|
return lqw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
<?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.flow.mapper.SchProdProcessMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.flow.domain.SchProdProcess" id="SchProdProcessResult">
|
||||||
|
<result property="processId" column="process_id"/>
|
||||||
|
<result property="processName" column="process_name"/>
|
||||||
|
<result property="processDesc" column="process_desc"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
<?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.flow.mapper.SchProdProcessStepMapper">
|
||||||
|
|
||||||
|
<resultMap type="com.klp.flow.domain.SchProdProcessStep" id="SchProdProcessStepResult">
|
||||||
|
<result property="stepId" column="step_id"/>
|
||||||
|
<result property="processId" column="process_id"/>
|
||||||
|
<result property="stepOrder" column="step_order"/>
|
||||||
|
<result property="stepName" column="step_name"/>
|
||||||
|
<result property="remark" column="remark"/>
|
||||||
|
<result property="createBy" column="create_by"/>
|
||||||
|
<result property="createTime" column="create_time"/>
|
||||||
|
<result property="updateBy" column="update_by"/>
|
||||||
|
<result property="updateTime" column="update_time"/>
|
||||||
|
<result property="delFlag" column="del_flag"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
|
||||||
|
</mapper>
|
||||||
@@ -8,6 +8,7 @@
|
|||||||
<result property="scheduleDetailId" column="schedule_detail_id"/>
|
<result property="scheduleDetailId" column="schedule_detail_id"/>
|
||||||
<result property="scheduleId" column="schedule_id"/>
|
<result property="scheduleId" column="schedule_id"/>
|
||||||
<result property="orderDetailId" column="order_detail_id"/>
|
<result property="orderDetailId" column="order_detail_id"/>
|
||||||
|
<result property="processId" column="process_id"/>
|
||||||
<result property="spec" column="spec"/>
|
<result property="spec" column="spec"/>
|
||||||
<result property="material" column="material"/>
|
<result property="material" column="material"/>
|
||||||
<result property="scheduleWeight" column="schedule_weight"/>
|
<result property="scheduleWeight" column="schedule_weight"/>
|
||||||
|
|||||||
@@ -31,8 +31,8 @@
|
|||||||
<result property="otherTechReq" column="other_tech_req"/>
|
<result property="otherTechReq" column="other_tech_req"/>
|
||||||
<result property="paymentDesc" column="payment_desc"/>
|
<result property="paymentDesc" column="payment_desc"/>
|
||||||
<result property="returnReason" column="return_reason"/>
|
<result property="returnReason" column="return_reason"/>
|
||||||
<result property="scheduleIds" column="schedule_ids"/>
|
<result property="scheduleDetailIds" column="schedule_detail_ids"/>
|
||||||
<result property="orderDetailIds" column="order_detail_ids"/>
|
<result property="actionId" column="action_id"/>
|
||||||
<result property="spec" column="spec"/>
|
<result property="spec" column="spec"/>
|
||||||
<result property="material" column="material"/>
|
<result property="material" column="material"/>
|
||||||
<result property="scheduleWeight" column="schedule_weight"/>
|
<result property="scheduleWeight" column="schedule_weight"/>
|
||||||
|
|||||||
@@ -56,3 +56,13 @@ export function syncRecords({ starttime, endtime }) {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 导出考勤记录表
|
||||||
|
export function exportAttendanceReport(params) {
|
||||||
|
return request({
|
||||||
|
url: '/wms/attendanceRecords/exportReport',
|
||||||
|
method: 'post',
|
||||||
|
params: params,
|
||||||
|
responseType: 'blob'
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,26 +1,26 @@
|
|||||||
// lockValue: 锁值,用于防止并发操作,不同的lockValue对应不同的锁
|
// lockValue: 锁值,用于防止并发操作,不同的lockValue对应不同的锁
|
||||||
// 1:分步加工 2. 退火 3. 酸轧 4. 酸轧分条 4. 合卷
|
// 1:分步加工 2. 退火 3. 酸轧 4. 酸轧分条 4. 合卷
|
||||||
export const PROCESSES = [
|
export const PROCESSES = [
|
||||||
{ name: '酸连轧工序', actionType: 11, api: 'pendingAction', lockValue: 3 },
|
{ name: '酸连轧工序', actionId: 11, api: 'pendingAction', lockValue: 3 },
|
||||||
{ name: '酸轧分条工序', actionType: 120, api: 'pendingAction', lockValue: 4 },
|
{ name: '酸轧分条工序', actionId: 120, api: 'pendingAction', lockValue: 4 },
|
||||||
{ name: '酸轧合卷', actionType: 201, api: 'pendingAction', lockValue: 5 },
|
{ name: '酸轧合卷', actionId: 201, api: 'pendingAction', lockValue: 5 },
|
||||||
{ name: '镀锌合卷', actionType: 202, api: 'pendingAction', lockValue: 5 },
|
{ name: '镀锌合卷', actionId: 202, api: 'pendingAction', lockValue: 5 },
|
||||||
{ name: '脱脂合卷', actionType: 203, api: 'pendingAction', lockValue: 5 },
|
{ name: '脱脂合卷', actionId: 203, api: 'pendingAction', lockValue: 5 },
|
||||||
{ name: '拉矫平整合卷', actionType: 204, api: 'pendingAction', lockValue: 5 },
|
{ name: '拉矫平整合卷', actionId: 204, api: 'pendingAction', lockValue: 5 },
|
||||||
{ name: '双机架合卷', actionType: 205, api: 'pendingAction', lockValue: 5 },
|
{ name: '双机架合卷', actionId: 205, api: 'pendingAction', lockValue: 5 },
|
||||||
{ name: '镀铬合卷', actionType: 206, api: 'pendingAction', lockValue: 5 },
|
{ name: '镀铬合卷', actionId: 206, api: 'pendingAction', lockValue: 5 },
|
||||||
{ name: '镀锌工序', actionType: 501, api: 'specialSplit', lockValue: 1 },
|
{ name: '镀锌工序', actionId: 501, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '脱脂工序', actionType: 502, api: 'specialSplit', lockValue: 1 },
|
{ name: '脱脂工序', actionId: 502, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '拉矫平整工序', actionType: 503, api: 'specialSplit', lockValue: 1 },
|
{ name: '拉矫平整工序', actionId: 503, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '双机架工序', actionType: 504, api: 'specialSplit', lockValue: 1 },
|
{ name: '双机架工序', actionId: 504, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '镀铬工序', actionType: 505, api: 'specialSplit', lockValue: 1 },
|
{ name: '镀铬工序', actionId: 505, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '纵剪分条工序', actionType: 506, api: 'specialSplit', lockValue: 1 },
|
{ name: '纵剪分条工序', actionId: 506, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '酸轧修复工序', actionType: 520, api: 'specialSplit', lockValue: 1 },
|
{ name: '酸轧修复工序', actionId: 520, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '镀锌修复工序', actionType: 521, api: 'specialSplit', lockValue: 1 },
|
{ name: '镀锌修复工序', actionId: 521, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '脱脂修复工序', actionType: 522, api: 'specialSplit', lockValue: 1 },
|
{ name: '脱脂修复工序', actionId: 522, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '拉矫修复工序', actionType: 523, api: 'specialSplit', lockValue: 1 },
|
{ name: '拉矫修复工序', actionId: 523, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '双机架修复工序', actionType: 524, api: 'specialSplit', lockValue: 1 },
|
{ name: '双机架修复工序', actionId: 524, api: 'specialSplit', lockValue: 1 },
|
||||||
{ name: '镀铬修复工序', actionType: 525, api: 'specialSplit', lockValue: 1 },
|
{ name: '镀铬修复工序', actionId: 525, api: 'specialSplit', lockValue: 1 },
|
||||||
]
|
]
|
||||||
|
|
||||||
export const PRODUCTION_LINES = [
|
export const PRODUCTION_LINES = [
|
||||||
|
|||||||
@@ -69,6 +69,7 @@
|
|||||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<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-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||||
<el-button type="warning" icon="el-icon-upload" size="mini" @click="handleSync">同步</el-button>
|
<el-button type="warning" icon="el-icon-upload" size="mini" @click="handleSync">同步</el-button>
|
||||||
|
<el-button type="success" icon="el-icon-download" size="mini" @click="handleExportReport">导出考勤表</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
@@ -187,11 +188,42 @@
|
|||||||
<el-button @click="syncDialogVisible = false">取消</el-button>
|
<el-button @click="syncDialogVisible = false">取消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
|
<!-- 导出考勤表对话框 -->
|
||||||
|
<el-dialog title="导出考勤记录表" :visible.sync="exportDialogVisible" width="480px" append-to-body>
|
||||||
|
<el-form ref="exportForm" :model="exportFormData" :rules="exportRules" label-width="90px">
|
||||||
|
<el-form-item label="考勤时间" prop="dateRange">
|
||||||
|
<el-date-picker
|
||||||
|
v-model="exportFormData.dateRange"
|
||||||
|
type="daterange"
|
||||||
|
range-separator="~"
|
||||||
|
start-placeholder="开始日期"
|
||||||
|
end-placeholder="结束日期"
|
||||||
|
value-format="yyyy-MM-dd"
|
||||||
|
:picker-options="pickerOptions"
|
||||||
|
style="width: 100%">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="员工编号" prop="pin">
|
||||||
|
<el-input v-model="exportFormData.pin" placeholder="请输入员工编号(可选)" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="姓名" prop="ename">
|
||||||
|
<el-input v-model="exportFormData.ename" placeholder="请输入姓名(可选)" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
<el-form-item label="部门" prop="deptname">
|
||||||
|
<el-input v-model="exportFormData.deptname" placeholder="请输入部门(可选)" clearable />
|
||||||
|
</el-form-item>
|
||||||
|
</el-form>
|
||||||
|
<div slot="footer" class="dialog-footer">
|
||||||
|
<el-button :loading="exportLoading" type="primary" @click="doExportReport">确定导出</el-button>
|
||||||
|
<el-button @click="exportDialogVisible = false">取消</el-button>
|
||||||
|
</div>
|
||||||
|
</el-dialog>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { listRecords, getRecords, delRecords, addRecords, updateRecords, syncRecords } from "@/api/wms/attendance";
|
import { listRecords, getRecords, delRecords, addRecords, updateRecords, syncRecords, exportAttendanceReport } from "@/api/wms/attendance";
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: "Records",
|
name: "Records",
|
||||||
@@ -211,6 +243,41 @@ export default {
|
|||||||
syncRules: {
|
syncRules: {
|
||||||
syncMonth: [{ required: true, message: "请选择同步月份", trigger: "change" }]
|
syncMonth: [{ required: true, message: "请选择同步月份", trigger: "change" }]
|
||||||
},
|
},
|
||||||
|
// 导出弹窗
|
||||||
|
exportDialogVisible: false,
|
||||||
|
// 导出loading
|
||||||
|
exportLoading: false,
|
||||||
|
// 导出表单
|
||||||
|
exportFormData: {
|
||||||
|
dateRange: [],
|
||||||
|
pin: "",
|
||||||
|
ename: "",
|
||||||
|
deptname: ""
|
||||||
|
},
|
||||||
|
// 导出表单校验
|
||||||
|
exportRules: {
|
||||||
|
dateRange: [{ required: true, message: "请选择考勤时间范围", trigger: "change" }]
|
||||||
|
},
|
||||||
|
// 日期选择器快捷选项
|
||||||
|
pickerOptions: {
|
||||||
|
shortcuts: [{
|
||||||
|
text: '本月',
|
||||||
|
onClick(picker) {
|
||||||
|
const now = new Date();
|
||||||
|
const start = new Date(now.getFullYear(), now.getMonth(), 1);
|
||||||
|
const end = new Date(now.getFullYear(), now.getMonth() + 1, 0);
|
||||||
|
picker.$emit('pick', [start, end]);
|
||||||
|
}
|
||||||
|
}, {
|
||||||
|
text: '上月',
|
||||||
|
onClick(picker) {
|
||||||
|
const now = new Date();
|
||||||
|
const start = new Date(now.getFullYear(), now.getMonth() - 1, 1);
|
||||||
|
const end = new Date(now.getFullYear(), now.getMonth(), 0);
|
||||||
|
picker.$emit('pick', [start, end]);
|
||||||
|
}
|
||||||
|
}]
|
||||||
|
},
|
||||||
// 遮罩层
|
// 遮罩层
|
||||||
loading: true,
|
loading: true,
|
||||||
// 选中数组
|
// 选中数组
|
||||||
@@ -391,6 +458,61 @@ export default {
|
|||||||
this.download('wms/records/export', {
|
this.download('wms/records/export', {
|
||||||
...this.queryParams
|
...this.queryParams
|
||||||
}, `records_${new Date().getTime()}.xlsx`)
|
}, `records_${new Date().getTime()}.xlsx`)
|
||||||
|
},
|
||||||
|
/** 导出考勤记录表 */
|
||||||
|
handleExportReport() {
|
||||||
|
this.$modal.confirm(
|
||||||
|
'导出前请先确保已同步最新的考勤数据,是否继续导出?',
|
||||||
|
'提示',
|
||||||
|
{
|
||||||
|
confirmButtonText: '已同步,继续导出',
|
||||||
|
cancelButtonText: '去同步',
|
||||||
|
type: 'info'
|
||||||
|
}
|
||||||
|
).then(() => {
|
||||||
|
this.exportFormData.dateRange = [];
|
||||||
|
this.exportFormData.pin = "";
|
||||||
|
this.exportFormData.ename = "";
|
||||||
|
this.exportFormData.deptname = "";
|
||||||
|
this.exportDialogVisible = true;
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.exportForm && this.$refs.exportForm.clearValidate();
|
||||||
|
});
|
||||||
|
}).catch(action => {
|
||||||
|
if (action === 'cancel') {
|
||||||
|
this.handleSync();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
/** 执行导出考勤记录表 */
|
||||||
|
doExportReport() {
|
||||||
|
this.$refs.exportForm.validate(valid => {
|
||||||
|
if (!valid) return;
|
||||||
|
const [startDate, endDate] = this.exportFormData.dateRange;
|
||||||
|
this.exportLoading = true;
|
||||||
|
exportAttendanceReport({
|
||||||
|
startTime: startDate,
|
||||||
|
endTime: endDate,
|
||||||
|
pin: this.exportFormData.pin || undefined,
|
||||||
|
ename: this.exportFormData.ename || undefined,
|
||||||
|
deptname: this.exportFormData.deptname || undefined
|
||||||
|
}).then(res => {
|
||||||
|
const blob = new Blob([res], { type: 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' });
|
||||||
|
const url = window.URL.createObjectURL(blob);
|
||||||
|
const link = document.createElement('a');
|
||||||
|
link.href = url;
|
||||||
|
link.download = `考勤记录表_${startDate}_${endDate}.xlsx`;
|
||||||
|
document.body.appendChild(link);
|
||||||
|
link.click();
|
||||||
|
document.body.removeChild(link);
|
||||||
|
window.URL.revokeObjectURL(url);
|
||||||
|
this.$modal.msgSuccess("导出成功");
|
||||||
|
this.exportLoading = false;
|
||||||
|
this.exportDialogVisible = false;
|
||||||
|
}).catch(() => {
|
||||||
|
this.exportLoading = false;
|
||||||
|
});
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -205,9 +205,9 @@
|
|||||||
<el-table-column type="selection" width="45" align="center" />
|
<el-table-column type="selection" width="45" align="center" />
|
||||||
<el-table-column label="排产单号" prop="scheduleNo" min-width="140" show-overflow-tooltip />
|
<el-table-column label="排产单号" prop="scheduleNo" min-width="140" show-overflow-tooltip />
|
||||||
<el-table-column label="生产日期" prop="prodDate" width="110" align="center" show-overflow-tooltip />
|
<el-table-column label="生产日期" prop="prodDate" width="110" align="center" show-overflow-tooltip />
|
||||||
<el-table-column label="工序类型" prop="actionType" width="100" align="center" show-overflow-tooltip>
|
<el-table-column label="工序类型" prop="actionId" width="100" align="center" show-overflow-tooltip>
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
{{ getActionTypeName(scope.row.actionType) }}
|
{{ getActionIdName(scope.row.actionId) }}
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="排产状态" prop="scheduleStatus" width="90" align="center">
|
<el-table-column label="排产状态" prop="scheduleStatus" width="90" align="center">
|
||||||
@@ -317,8 +317,8 @@
|
|||||||
<el-row :gutter="16">
|
<el-row :gutter="16">
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="工序类型">
|
<el-form-item label="工序类型">
|
||||||
<el-select v-model="editForm.actionType" placeholder="请选择工序类型" clearable filterable style="width:100%">
|
<el-select v-model="editForm.actionId" placeholder="请选择工序类型" clearable filterable style="width:100%">
|
||||||
<el-option v-for="p in processOptions" :key="p.actionType" :label="p.name" :value="p.actionType" />
|
<el-option v-for="p in processOptions" :key="p.actionId" :label="p.name" :value="p.actionId" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -528,8 +528,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :span="12">
|
<el-col :span="12">
|
||||||
<el-form-item label="工序类型">
|
<el-form-item label="工序类型">
|
||||||
<el-select v-model="mergeForm.actionType" placeholder="请选择工序类型" clearable filterable style="width:100%">
|
<el-select v-model="mergeForm.actionId" placeholder="请选择工序类型" clearable filterable style="width:100%">
|
||||||
<el-option v-for="p in processOptions" :key="p.actionType" :label="p.name" :value="p.actionType" />
|
<el-option v-for="p in processOptions" :key="p.actionId" :label="p.name" :value="p.actionId" />
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
@@ -687,7 +687,7 @@ export default {
|
|||||||
mergeTemplateIndex: 0,
|
mergeTemplateIndex: 0,
|
||||||
mergeSourceRows: [],
|
mergeSourceRows: [],
|
||||||
mergeForm: {
|
mergeForm: {
|
||||||
itemCount: 0, scheduleNo: '', actionType: '', customerName: '', spec: '', material: '',
|
itemCount: 0, scheduleNo: '', actionId: '', customerName: '', spec: '', material: '',
|
||||||
scheduleWeight: 0, productType: '', productItem: '', businessUser: '',
|
scheduleWeight: 0, productType: '', productItem: '', businessUser: '',
|
||||||
businessPhone: '', deliveryCycle: undefined, usePurpose: '',
|
businessPhone: '', deliveryCycle: undefined, usePurpose: '',
|
||||||
thicknessTolerance: '', widthTolerance: '', surfaceQuality: '',
|
thicknessTolerance: '', widthTolerance: '', surfaceQuality: '',
|
||||||
@@ -730,7 +730,7 @@ export default {
|
|||||||
return {
|
return {
|
||||||
scheduleId: undefined,
|
scheduleId: undefined,
|
||||||
scheduleNo: '',
|
scheduleNo: '',
|
||||||
actionType: '',
|
actionId: '',
|
||||||
prodDate: '',
|
prodDate: '',
|
||||||
scheduleStatus: undefined,
|
scheduleStatus: undefined,
|
||||||
totalPlanWeight: undefined,
|
totalPlanWeight: undefined,
|
||||||
@@ -891,9 +891,9 @@ export default {
|
|||||||
|
|
||||||
handleEditScheduled(row) {
|
handleEditScheduled(row) {
|
||||||
this.editForm = { ...this.getEmptyEditForm(), ...row }
|
this.editForm = { ...this.getEmptyEditForm(), ...row }
|
||||||
// 确保 actionType 为数字类型以匹配下拉选项
|
// 确保 actionId 为数字类型以匹配下拉选项
|
||||||
if (this.editForm.actionType != null && typeof this.editForm.actionType !== 'number') {
|
if (this.editForm.actionId != null && typeof this.editForm.actionId !== 'number') {
|
||||||
this.editForm.actionType = Number(this.editForm.actionType)
|
this.editForm.actionId = Number(this.editForm.actionId)
|
||||||
}
|
}
|
||||||
// 确保 scheduleStatus 为数字类型以匹配下拉选项
|
// 确保 scheduleStatus 为数字类型以匹配下拉选项
|
||||||
if (this.editForm.scheduleStatus != null && typeof this.editForm.scheduleStatus !== 'number') {
|
if (this.editForm.scheduleStatus != null && typeof this.editForm.scheduleStatus !== 'number') {
|
||||||
@@ -977,7 +977,7 @@ export default {
|
|||||||
this.mergeForm = {
|
this.mergeForm = {
|
||||||
itemCount: this.mergeSourceRows.length,
|
itemCount: this.mergeSourceRows.length,
|
||||||
scheduleNo: row.scheduleNo || '',
|
scheduleNo: row.scheduleNo || '',
|
||||||
actionType: row.actionType != null ? Number(row.actionType) : '',
|
actionId: row.actionId != null ? Number(row.actionId) : '',
|
||||||
customerName: row.customerName || '',
|
customerName: row.customerName || '',
|
||||||
spec: row.spec || '',
|
spec: row.spec || '',
|
||||||
material: row.material || '',
|
material: row.material || '',
|
||||||
@@ -1033,9 +1033,9 @@ export default {
|
|||||||
return total.toFixed(3)
|
return total.toFixed(3)
|
||||||
},
|
},
|
||||||
|
|
||||||
getActionTypeName(actionType) {
|
getActionIdName(actionId) {
|
||||||
const p = this.processOptions.find(item => String(item.actionType) === String(actionType))
|
const p = this.processOptions.find(item => String(item.actionId) === String(actionId))
|
||||||
return p ? p.name : (actionType || '')
|
return p ? p.name : (actionId || '')
|
||||||
},
|
},
|
||||||
|
|
||||||
handleDetailClick(sch, detail) {
|
handleDetailClick(sch, detail) {
|
||||||
|
|||||||
@@ -42,6 +42,17 @@ public class AttendanceRecordsController extends BaseController {
|
|||||||
ExcelUtil.exportExcel(list, "打卡记录", AttendanceRecordsVo.class, response);
|
ExcelUtil.exportExcel(list, "打卡记录", AttendanceRecordsVo.class, response);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Log(title = "考勤记录表导出", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/exportReport")
|
||||||
|
public void exportReport(@RequestParam String startTime,
|
||||||
|
@RequestParam String endTime,
|
||||||
|
@RequestParam(required = false) String pin,
|
||||||
|
@RequestParam(required = false) String ename,
|
||||||
|
@RequestParam(required = false) String deptname,
|
||||||
|
HttpServletResponse response) {
|
||||||
|
iAttendanceRecordsService.exportReport(startTime, endTime, pin, ename, deptname, response);
|
||||||
|
}
|
||||||
|
|
||||||
@GetMapping("/{id}")
|
@GetMapping("/{id}")
|
||||||
public R<AttendanceRecordsVo> getInfo(@NotNull(message = "主键不能为空")
|
public R<AttendanceRecordsVo> getInfo(@NotNull(message = "主键不能为空")
|
||||||
@PathVariable Integer id) {
|
@PathVariable Integer id) {
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ import com.klp.domain.bo.AttendanceRecordsBo;
|
|||||||
import com.klp.common.core.page.TableDataInfo;
|
import com.klp.common.core.page.TableDataInfo;
|
||||||
import com.klp.common.core.domain.PageQuery;
|
import com.klp.common.core.domain.PageQuery;
|
||||||
|
|
||||||
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -28,4 +29,9 @@ public interface IAttendanceRecordsService {
|
|||||||
* 按员工姓名集合 + 时间范围精确查询打卡记录(eq/in,走索引)
|
* 按员工姓名集合 + 时间范围精确查询打卡记录(eq/in,走索引)
|
||||||
*/
|
*/
|
||||||
List<AttendanceRecords> queryListByEnamesAndDateRange(List<String> enames, Date startTime, Date endTime);
|
List<AttendanceRecords> queryListByEnamesAndDateRange(List<String> enames, Date startTime, Date endTime);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出考勤记录表(复杂格式)
|
||||||
|
*/
|
||||||
|
void exportReport(String startTime, String endTime, String pin, String ename, String deptname, HttpServletResponse response);
|
||||||
}
|
}
|
||||||
@@ -8,6 +8,8 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import com.klp.common.utils.StringUtils;
|
import com.klp.common.utils.StringUtils;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import com.klp.domain.bo.AttendanceRecordsBo;
|
import com.klp.domain.bo.AttendanceRecordsBo;
|
||||||
import com.klp.domain.vo.AttendanceRecordsVo;
|
import com.klp.domain.vo.AttendanceRecordsVo;
|
||||||
@@ -15,14 +17,23 @@ import com.klp.domain.AttendanceRecords;
|
|||||||
import com.klp.mapper.AttendanceRecordsMapper;
|
import com.klp.mapper.AttendanceRecordsMapper;
|
||||||
import com.klp.service.IAttendanceRecordsService;
|
import com.klp.service.IAttendanceRecordsService;
|
||||||
|
|
||||||
import java.util.Date;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.util.List;
|
import java.io.OutputStream;
|
||||||
import java.util.Collection;
|
import java.text.SimpleDateFormat;
|
||||||
|
import java.time.LocalDate;
|
||||||
|
import java.time.format.DateTimeFormatter;
|
||||||
|
import java.util.*;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import org.apache.poi.ss.usermodel.*;
|
||||||
|
import org.apache.poi.ss.util.CellRangeAddress;
|
||||||
|
import org.apache.poi.xssf.streaming.SXSSFWorkbook;
|
||||||
|
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
@Service
|
@Service
|
||||||
public class AttendanceRecordsServiceImpl implements IAttendanceRecordsService {
|
public class AttendanceRecordsServiceImpl implements IAttendanceRecordsService {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(AttendanceRecordsServiceImpl.class);
|
||||||
private final AttendanceRecordsMapper baseMapper;
|
private final AttendanceRecordsMapper baseMapper;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -91,4 +102,246 @@ public class AttendanceRecordsServiceImpl implements IAttendanceRecordsService {
|
|||||||
.ge(AttendanceRecords::getChecktime, startTime)
|
.ge(AttendanceRecords::getChecktime, startTime)
|
||||||
.le(AttendanceRecords::getChecktime, endTime));
|
.le(AttendanceRecords::getChecktime, endTime));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void exportReport(String startTime, String endTime, String pin, String ename, String deptname, HttpServletResponse response) {
|
||||||
|
try {
|
||||||
|
// 1. 解析时间范围
|
||||||
|
DateTimeFormatter fmt = DateTimeFormatter.ofPattern("yyyy-MM-dd");
|
||||||
|
LocalDate startDate = LocalDate.parse(startTime, fmt);
|
||||||
|
LocalDate endDate = LocalDate.parse(endTime, fmt);
|
||||||
|
int totalDays = startDate.lengthOfMonth();
|
||||||
|
|
||||||
|
Date startDatetime = java.sql.Timestamp.valueOf(startDate.atStartOfDay());
|
||||||
|
Date endDatetime = java.sql.Timestamp.valueOf(endDate.plusDays(1).atStartOfDay().minusNanos(1));
|
||||||
|
|
||||||
|
// 2. 构建查询
|
||||||
|
LambdaQueryWrapper<AttendanceRecords> lqw = Wrappers.lambdaQuery();
|
||||||
|
lqw.ge(AttendanceRecords::getChecktime, startDatetime);
|
||||||
|
lqw.le(AttendanceRecords::getChecktime, endDatetime);
|
||||||
|
if (StringUtils.isNotBlank(pin)) {
|
||||||
|
lqw.eq(AttendanceRecords::getPin, pin);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(ename)) {
|
||||||
|
lqw.like(AttendanceRecords::getEname, ename);
|
||||||
|
}
|
||||||
|
if (StringUtils.isNotBlank(deptname)) {
|
||||||
|
lqw.eq(AttendanceRecords::getDeptname, deptname);
|
||||||
|
}
|
||||||
|
lqw.orderByAsc(AttendanceRecords::getPin).orderByAsc(AttendanceRecords::getChecktime);
|
||||||
|
List<AttendanceRecords> records = baseMapper.selectList(lqw);
|
||||||
|
|
||||||
|
// 3. 按员工分组,再按日期分组
|
||||||
|
// key: pin, value: 员工信息 + 按天分组的打卡记录
|
||||||
|
LinkedHashMap<String, EmployeeAttendance> employeeMap = new LinkedHashMap<>();
|
||||||
|
SimpleDateFormat timeFmt = new SimpleDateFormat("HH:mm");
|
||||||
|
|
||||||
|
for (AttendanceRecords r : records) {
|
||||||
|
String pinKey = r.getPin();
|
||||||
|
EmployeeAttendance ea = employeeMap.computeIfAbsent(pinKey, k -> {
|
||||||
|
EmployeeAttendance e = new EmployeeAttendance();
|
||||||
|
e.pin = r.getPin();
|
||||||
|
e.ename = r.getEname();
|
||||||
|
e.deptname = r.getDeptname();
|
||||||
|
e.dailyRecords = new TreeMap<>();
|
||||||
|
return e;
|
||||||
|
});
|
||||||
|
LocalDate checkDate = r.getChecktime().toInstant().atZone(java.time.ZoneId.systemDefault()).toLocalDate();
|
||||||
|
int dayOfMonth = checkDate.getDayOfMonth();
|
||||||
|
String timeStr = timeFmt.format(r.getChecktime());
|
||||||
|
ea.dailyRecords.merge(dayOfMonth, new ArrayList<>(Collections.singletonList(timeStr)), (old, nw) -> {
|
||||||
|
old.addAll(nw);
|
||||||
|
return old;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
// 4. 创建 Excel
|
||||||
|
SXSSFWorkbook wb = new SXSSFWorkbook(500);
|
||||||
|
Sheet sheet = wb.createSheet("考勤记录");
|
||||||
|
int currentRow = 0;
|
||||||
|
|
||||||
|
// 样式
|
||||||
|
CellStyle titleStyle = createTitleStyle(wb);
|
||||||
|
CellStyle headerStyle = createHeaderStyle(wb);
|
||||||
|
CellStyle dayHeaderStyle = createDayHeaderStyle(wb);
|
||||||
|
CellStyle infoStyle = createInfoStyle(wb);
|
||||||
|
CellStyle detailStyle = createDetailStyle(wb);
|
||||||
|
|
||||||
|
// --- Row 0: 考勤记录表 ---
|
||||||
|
Row titleRow = sheet.createRow(currentRow++);
|
||||||
|
titleRow.setHeightInPoints(36);
|
||||||
|
Cell titleCell = titleRow.createCell(0);
|
||||||
|
titleCell.setCellValue("考勤记录表");
|
||||||
|
titleCell.setCellStyle(titleStyle);
|
||||||
|
sheet.addMergedRegion(new CellRangeAddress(0, 0, 0, totalDays + 2));
|
||||||
|
|
||||||
|
// --- Row 1: 考勤时间 + 制表时间 ---
|
||||||
|
Row timeRow = sheet.createRow(currentRow++);
|
||||||
|
timeRow.setHeightInPoints(22);
|
||||||
|
Cell timeLabelCell = timeRow.createCell(0);
|
||||||
|
timeLabelCell.setCellValue("考勤时间");
|
||||||
|
timeLabelCell.setCellStyle(infoStyle);
|
||||||
|
Cell timeValueCell = timeRow.createCell(1);
|
||||||
|
String periodStr = startDate.format(fmt) + " ~ " + endDate.format(fmt);
|
||||||
|
timeValueCell.setCellValue(periodStr);
|
||||||
|
timeValueCell.setCellStyle(infoStyle);
|
||||||
|
|
||||||
|
Cell makeLabelCell = timeRow.createCell(totalDays / 2 + 1);
|
||||||
|
makeLabelCell.setCellValue("制表时间");
|
||||||
|
makeLabelCell.setCellStyle(infoStyle);
|
||||||
|
Cell makeValueCell = timeRow.createCell(totalDays / 2 + 2);
|
||||||
|
makeValueCell.setCellValue(LocalDate.now().format(fmt));
|
||||||
|
makeValueCell.setCellStyle(infoStyle);
|
||||||
|
|
||||||
|
// --- Row 2: 日期列头 1,2,3,... ---
|
||||||
|
Row dayHeaderRow = sheet.createRow(currentRow++);
|
||||||
|
dayHeaderRow.setHeightInPoints(20);
|
||||||
|
Cell dayCell = dayHeaderRow.createCell(0);
|
||||||
|
dayCell.setCellStyle(dayHeaderStyle);
|
||||||
|
for (int d = 1; d <= totalDays; d++) {
|
||||||
|
Cell c = dayHeaderRow.createCell(d);
|
||||||
|
c.setCellValue(d);
|
||||||
|
c.setCellStyle(dayHeaderStyle);
|
||||||
|
}
|
||||||
|
|
||||||
|
// --- 员工循环 ---
|
||||||
|
int dataColCount = totalDays + 1;
|
||||||
|
for (EmployeeAttendance ea : employeeMap.values()) {
|
||||||
|
// 员工信息行
|
||||||
|
Row infoRow = sheet.createRow(currentRow++);
|
||||||
|
infoRow.setHeightInPoints(22);
|
||||||
|
Cell pinLabel = infoRow.createCell(0);
|
||||||
|
pinLabel.setCellValue("工号:");
|
||||||
|
pinLabel.setCellStyle(infoStyle);
|
||||||
|
Cell pinValue = infoRow.createCell(1);
|
||||||
|
pinValue.setCellValue(ea.pin != null ? ea.pin : "");
|
||||||
|
pinValue.setCellStyle(infoStyle);
|
||||||
|
|
||||||
|
int nameCol = Math.max(3, totalDays / 4);
|
||||||
|
Cell nameLabel = infoRow.createCell(nameCol);
|
||||||
|
nameLabel.setCellValue("姓 名:");
|
||||||
|
nameLabel.setCellStyle(infoStyle);
|
||||||
|
Cell nameValue = infoRow.createCell(nameCol + 1);
|
||||||
|
nameValue.setCellValue(ea.ename != null ? ea.ename : "");
|
||||||
|
nameValue.setCellStyle(infoStyle);
|
||||||
|
|
||||||
|
int deptCol = Math.max(nameCol + 3, totalDays / 2);
|
||||||
|
Cell deptLabel = infoRow.createCell(deptCol);
|
||||||
|
deptLabel.setCellValue("部 门:");
|
||||||
|
deptLabel.setCellStyle(infoStyle);
|
||||||
|
Cell deptValue = infoRow.createCell(deptCol + 1);
|
||||||
|
deptValue.setCellValue(ea.deptname != null ? ea.deptname : "");
|
||||||
|
deptValue.setCellStyle(infoStyle);
|
||||||
|
|
||||||
|
// 打卡明细行
|
||||||
|
Row detailRow = sheet.createRow(currentRow++);
|
||||||
|
detailRow.setHeightInPoints(18 * 4);
|
||||||
|
for (int d = 1; d <= totalDays; d++) {
|
||||||
|
Cell c = detailRow.createCell(d);
|
||||||
|
List<String> times = ea.dailyRecords.get(d);
|
||||||
|
if (times != null && !times.isEmpty()) {
|
||||||
|
c.setCellValue(String.join("\n", times));
|
||||||
|
}
|
||||||
|
c.setCellStyle(detailStyle);
|
||||||
|
}
|
||||||
|
// 最后一行不设边框(区分下一个员工),但保留整体边框
|
||||||
|
}
|
||||||
|
|
||||||
|
// 设置列宽
|
||||||
|
sheet.setColumnWidth(0, 2000);
|
||||||
|
for (int d = 1; d <= totalDays; d++) {
|
||||||
|
sheet.setColumnWidth(d, 2400);
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 输出
|
||||||
|
response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
|
||||||
|
response.setCharacterEncoding("utf-8");
|
||||||
|
String fileName = "考勤记录表_" + startTime + "_" + endTime;
|
||||||
|
String encodedFileName = java.net.URLEncoder.encode(fileName, "UTF-8").replaceAll("\\+", "%20");
|
||||||
|
response.setHeader("Content-Disposition", "attachment;filename=" + encodedFileName + ".xlsx");
|
||||||
|
|
||||||
|
OutputStream out = response.getOutputStream();
|
||||||
|
wb.write(out);
|
||||||
|
out.flush();
|
||||||
|
wb.close();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error("导出考勤记录表失败", e);
|
||||||
|
throw new RuntimeException("导出考勤记录表失败: " + e.getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private CellStyle createTitleStyle(SXSSFWorkbook wb) {
|
||||||
|
CellStyle style = wb.createCellStyle();
|
||||||
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
Font font = wb.createFont();
|
||||||
|
font.setFontName("宋体");
|
||||||
|
font.setFontHeightInPoints((short) 18);
|
||||||
|
font.setBold(true);
|
||||||
|
style.setFont(font);
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
private CellStyle createHeaderStyle(SXSSFWorkbook wb) {
|
||||||
|
CellStyle style = wb.createCellStyle();
|
||||||
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
style.setBorderBottom(BorderStyle.THIN);
|
||||||
|
Font font = wb.createFont();
|
||||||
|
font.setFontName("宋体");
|
||||||
|
font.setFontHeightInPoints((short) 10);
|
||||||
|
style.setFont(font);
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
private CellStyle createDayHeaderStyle(SXSSFWorkbook wb) {
|
||||||
|
CellStyle style = wb.createCellStyle();
|
||||||
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
style.setBorderBottom(BorderStyle.THIN);
|
||||||
|
style.setBorderTop(BorderStyle.THIN);
|
||||||
|
style.setBorderLeft(BorderStyle.THIN);
|
||||||
|
style.setBorderRight(BorderStyle.THIN);
|
||||||
|
Font font = wb.createFont();
|
||||||
|
font.setFontName("宋体");
|
||||||
|
font.setFontHeightInPoints((short) 10);
|
||||||
|
style.setFont(font);
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
private CellStyle createInfoStyle(SXSSFWorkbook wb) {
|
||||||
|
CellStyle style = wb.createCellStyle();
|
||||||
|
style.setAlignment(HorizontalAlignment.LEFT);
|
||||||
|
style.setVerticalAlignment(VerticalAlignment.CENTER);
|
||||||
|
style.setBorderBottom(BorderStyle.THIN);
|
||||||
|
Font font = wb.createFont();
|
||||||
|
font.setFontName("宋体");
|
||||||
|
font.setFontHeightInPoints((short) 10);
|
||||||
|
style.setFont(font);
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
private CellStyle createDetailStyle(SXSSFWorkbook wb) {
|
||||||
|
CellStyle style = wb.createCellStyle();
|
||||||
|
style.setAlignment(HorizontalAlignment.CENTER);
|
||||||
|
style.setVerticalAlignment(VerticalAlignment.TOP);
|
||||||
|
style.setBorderBottom(BorderStyle.THIN);
|
||||||
|
style.setBorderTop(BorderStyle.THIN);
|
||||||
|
style.setBorderLeft(BorderStyle.THIN);
|
||||||
|
style.setBorderRight(BorderStyle.THIN);
|
||||||
|
style.setWrapText(true);
|
||||||
|
Font font = wb.createFont();
|
||||||
|
font.setFontName("宋体");
|
||||||
|
font.setFontHeightInPoints((short) 9);
|
||||||
|
style.setFont(font);
|
||||||
|
return style;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static class EmployeeAttendance {
|
||||||
|
String pin;
|
||||||
|
String ename;
|
||||||
|
String deptname;
|
||||||
|
// key: dayOfMonth(1~31), value: 当天打卡时间列表
|
||||||
|
TreeMap<Integer, List<String>> dailyRecords;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user