From 9a583337f4420e14ed42a13dabcb5d35c931c3a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BC=82=E6=B3=8A?= <1913856125@qq.com> Date: Tue, 9 Dec 2025 18:17:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B4=BE=E5=B7=A5=E5=8D=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../work/controller/WorkOrderController.java | 105 +++++ .../zhyc/module/work/domain/WorkOrder.java | 375 ++++++++++++++++++ .../module/work/mapper/WorkOrderMapper.java | 61 +++ .../work/service/IWorkOrderService.java | 61 +++ .../service/impl/WorkOrderServiceImpl.java | 96 +++++ .../resources/mapper/work/WorkOrderMapper.xml | 172 ++++++++ 6 files changed, 870 insertions(+) create mode 100644 zhyc-module/src/main/java/com/zhyc/module/work/controller/WorkOrderController.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/work/domain/WorkOrder.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/work/mapper/WorkOrderMapper.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/work/service/IWorkOrderService.java create mode 100644 zhyc-module/src/main/java/com/zhyc/module/work/service/impl/WorkOrderServiceImpl.java create mode 100644 zhyc-module/src/main/resources/mapper/work/WorkOrderMapper.xml diff --git a/zhyc-module/src/main/java/com/zhyc/module/work/controller/WorkOrderController.java b/zhyc-module/src/main/java/com/zhyc/module/work/controller/WorkOrderController.java new file mode 100644 index 0000000..e50ad0a --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/work/controller/WorkOrderController.java @@ -0,0 +1,105 @@ +package com.zhyc.module.work.controller; + +import java.util.List; +import javax.servlet.http.HttpServletResponse; + +import com.zhyc.module.work.domain.WorkOrder; +import com.zhyc.module.work.service.IWorkOrderService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import com.zhyc.common.annotation.Log; +import com.zhyc.common.core.controller.BaseController; +import com.zhyc.common.core.domain.AjaxResult; +import com.zhyc.common.enums.BusinessType; +import com.zhyc.common.utils.poi.ExcelUtil; +import com.zhyc.common.core.page.TableDataInfo; + +/** + * 派工单Controller + * + * @author piaobo + * @date 2025-12-07 + */ +@RestController +@RequestMapping("/work/work") +public class WorkOrderController extends BaseController +{ + @Autowired + private IWorkOrderService workOrderService; + + /** + * 查询派工单列表 + */ + @PreAuthorize("@ss.hasPermi('work:work:list')") + @GetMapping("/list") + public TableDataInfo list(WorkOrder workOrder) + { + startPage(); + List list = workOrderService.selectWorkOrderList(workOrder); + return getDataTable(list); + } + + /** + * 导出派工单列表 + */ + @PreAuthorize("@ss.hasPermi('work:work:export')") + @Log(title = "派工单", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, WorkOrder workOrder) + { + List list = workOrderService.selectWorkOrderList(workOrder); + ExcelUtil util = new ExcelUtil(WorkOrder.class); + util.exportExcel(response, list, "派工单数据"); + } + + /** + * 获取派工单详细信息 + */ + @PreAuthorize("@ss.hasPermi('work:work:query')") + @GetMapping(value = "/{id}") + public AjaxResult getInfo(@PathVariable("id") Long id) + { + return success(workOrderService.selectWorkOrderById(id)); + } + + /** + * 新增派工单 + */ + @PreAuthorize("@ss.hasPermi('work:work:add')") + @Log(title = "派工单", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody WorkOrder workOrder) + { + return toAjax(workOrderService.insertWorkOrder(workOrder)); + } + + /** + * 修改派工单 + */ + @PreAuthorize("@ss.hasPermi('work:work:edit')") + @Log(title = "派工单", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody WorkOrder workOrder) + { + return toAjax(workOrderService.updateWorkOrder(workOrder)); + } + + /** + * 删除派工单 + */ + @PreAuthorize("@ss.hasPermi('work:work:remove')") + @Log(title = "派工单", businessType = BusinessType.DELETE) + @DeleteMapping("/{ids}") + public AjaxResult remove(@PathVariable Long[] ids) + { + return toAjax(workOrderService.deleteWorkOrderByIds(ids)); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/work/domain/WorkOrder.java b/zhyc-module/src/main/java/com/zhyc/module/work/domain/WorkOrder.java new file mode 100644 index 0000000..5d50db1 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/work/domain/WorkOrder.java @@ -0,0 +1,375 @@ +package com.zhyc.module.work.domain; + +import java.util.Date; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.apache.commons.lang3.builder.ToStringBuilder; +import org.apache.commons.lang3.builder.ToStringStyle; +import com.zhyc.common.annotation.Excel; +import com.zhyc.common.core.domain.BaseEntity; + +/** + * 派工单对象 work_order + * + * @author piaobo + * @date 2025-12-07 + */ +public class WorkOrder extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 派工单唯一主键,自增整数 */ + private Long id; + + /** 业务单号 */ + @Excel(name = "业务单号") + private String orderNo; + + /** 关联生产/免疫计划ID,无计划可空 */ + @Excel(name = "关联生产/免疫计划ID,无计划可空") + private Long planId; + + /** 业务类型:1免疫 2保健 3转群 4称重 5配种 6干奶 7淘汰 8消毒 9饲喂,必填 */ + @Excel(name = "业务类型:1免疫 2保健 3转群 4称重 5配种 6干奶 7淘汰 8消毒 9饲喂,必填") + private Integer bizType; + + /** 简短任务标 */ + @Excel(name = "简短任务标") + private String title; + + /** 任务详细要求及注意事项,可空 */ + @Excel(name = "任务详细要求及注意事项,可空") + private String content; + + /** 执行部门/班组,下拉选择,必填 */ + @Excel(name = "执行部门/班组,下拉选择,必填") + private String department; + + /** 执行人ID(多人用英文逗号),必填 */ + @Excel(name = "执行人ID", readConverterExp = "多=人用英文逗号") + private String executorIds; + + /** 计划执行日期,必填 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "计划执行日期,必填", width = 30, dateFormat = "yyyy-MM-dd") + private Date executeDate; + + /** 计划执行时段,可空 */ + @Excel(name = "计划执行时段,可空") + private String executeTime; + + /** 涉及羊只范围 */ + @Excel(name = "涉及羊只范围") + private String sheepScope; + + /** 执行地点/栏舍 */ + @Excel(name = "执行地点/栏舍") + private String location; + + /** 需领物料 */ + @Excel(name = "需领物料") + private String materialList; + + /** 需用设备 */ + @Excel(name = "需用设备") + private String toolList; + + /** 状态:0待派工 1已派工 2执行中 3已完成 4已取消 5异常,必填 */ + @Excel(name = "状态:0待派工 1已派工 2执行中 3已完成 4已取消 5异常,必填") + private Integer status; + + /** 优先级:1普通 2重要 3紧急,必填 */ + @Excel(name = "优先级:1普通 2重要 3紧急,必填") + private Integer priority; + + /** 派工人用户 */ + @Excel(name = "派工人用户") + private Long issuerId; + + /** 派工时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "派工时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date issueTime; + + /** 接工人用户 */ + @Excel(name = "接工人用户") + private Long receiverId; + + /** 接工时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "接工时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date receiveTime; + + /** 实际完成时间,可空 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "实际完成时间,可空", width = 30, dateFormat = "yyyy-MM-dd") + private Date finishTime; + + /** 执行结果填报,可空 */ + @Excel(name = "执行结果填报,可空") + private String result; + + /** 逻辑删除:0正常 1已删除,必填 */ + private Integer deleted; + + public void setId(Long id) + { + this.id = id; + } + + public Long getId() + { + return id; + } + + public void setOrderNo(String orderNo) + { + this.orderNo = orderNo; + } + + public String getOrderNo() + { + return orderNo; + } + + public void setPlanId(Long planId) + { + this.planId = planId; + } + + public Long getPlanId() + { + return planId; + } + + public void setBizType(Integer bizType) + { + this.bizType = bizType; + } + + public Integer getBizType() + { + return bizType; + } + + public void setTitle(String title) + { + this.title = title; + } + + public String getTitle() + { + return title; + } + + public void setContent(String content) + { + this.content = content; + } + + public String getContent() + { + return content; + } + + public void setDepartment(String department) + { + this.department = department; + } + + public String getDepartment() + { + return department; + } + + public void setExecutorIds(String executorIds) + { + this.executorIds = executorIds; + } + + public String getExecutorIds() + { + return executorIds; + } + + public void setExecuteDate(Date executeDate) + { + this.executeDate = executeDate; + } + + public Date getExecuteDate() + { + return executeDate; + } + + public void setExecuteTime(String executeTime) + { + this.executeTime = executeTime; + } + + public String getExecuteTime() + { + return executeTime; + } + + public void setSheepScope(String sheepScope) + { + this.sheepScope = sheepScope; + } + + public String getSheepScope() + { + return sheepScope; + } + + public void setLocation(String location) + { + this.location = location; + } + + public String getLocation() + { + return location; + } + + public void setMaterialList(String materialList) + { + this.materialList = materialList; + } + + public String getMaterialList() + { + return materialList; + } + + public void setToolList(String toolList) + { + this.toolList = toolList; + } + + public String getToolList() + { + return toolList; + } + + public void setStatus(Integer status) + { + this.status = status; + } + + public Integer getStatus() + { + return status; + } + + public void setPriority(Integer priority) + { + this.priority = priority; + } + + public Integer getPriority() + { + return priority; + } + + public void setIssuerId(Long issuerId) + { + this.issuerId = issuerId; + } + + public Long getIssuerId() + { + return issuerId; + } + + public void setIssueTime(Date issueTime) + { + this.issueTime = issueTime; + } + + public Date getIssueTime() + { + return issueTime; + } + + public void setReceiverId(Long receiverId) + { + this.receiverId = receiverId; + } + + public Long getReceiverId() + { + return receiverId; + } + + public void setReceiveTime(Date receiveTime) + { + this.receiveTime = receiveTime; + } + + public Date getReceiveTime() + { + return receiveTime; + } + + public void setFinishTime(Date finishTime) + { + this.finishTime = finishTime; + } + + public Date getFinishTime() + { + return finishTime; + } + + public void setResult(String result) + { + this.result = result; + } + + public String getResult() + { + return result; + } + + public void setDeleted(Integer deleted) + { + this.deleted = deleted; + } + + public Integer getDeleted() + { + return deleted; + } + + @Override + public String toString() { + return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) + .append("id", getId()) + .append("orderNo", getOrderNo()) + .append("planId", getPlanId()) + .append("bizType", getBizType()) + .append("title", getTitle()) + .append("content", getContent()) + .append("department", getDepartment()) + .append("executorIds", getExecutorIds()) + .append("executeDate", getExecuteDate()) + .append("executeTime", getExecuteTime()) + .append("sheepScope", getSheepScope()) + .append("location", getLocation()) + .append("materialList", getMaterialList()) + .append("toolList", getToolList()) + .append("status", getStatus()) + .append("priority", getPriority()) + .append("issuerId", getIssuerId()) + .append("issueTime", getIssueTime()) + .append("receiverId", getReceiverId()) + .append("receiveTime", getReceiveTime()) + .append("finishTime", getFinishTime()) + .append("result", getResult()) + .append("remark", getRemark()) + .append("createTime", getCreateTime()) + .append("updateTime", getUpdateTime()) + .append("deleted", getDeleted()) + .toString(); + } +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/work/mapper/WorkOrderMapper.java b/zhyc-module/src/main/java/com/zhyc/module/work/mapper/WorkOrderMapper.java new file mode 100644 index 0000000..3ddb4ac --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/work/mapper/WorkOrderMapper.java @@ -0,0 +1,61 @@ +package com.zhyc.module.work.mapper; + +import java.util.List; +import com.zhyc.module.work.domain.WorkOrder; + +/** + * 派工单Mapper接口 + * + * @author piaobo + * @date 2025-12-07 + */ +public interface WorkOrderMapper +{ + /** + * 查询派工单 + * + * @param id 派工单主键 + * @return 派工单 + */ + public WorkOrder selectWorkOrderById(Long id); + + /** + * 查询派工单列表 + * + * @param workOrder 派工单 + * @return 派工单集合 + */ + public List selectWorkOrderList(WorkOrder workOrder); + + /** + * 新增派工单 + * + * @param workOrder 派工单 + * @return 结果 + */ + public int insertWorkOrder(WorkOrder workOrder); + + /** + * 修改派工单 + * + * @param workOrder 派工单 + * @return 结果 + */ + public int updateWorkOrder(WorkOrder workOrder); + + /** + * 删除派工单 + * + * @param id 派工单主键 + * @return 结果 + */ + public int deleteWorkOrderById(Long id); + + /** + * 批量删除派工单 + * + * @param ids 需要删除的数据主键集合 + * @return 结果 + */ + public int deleteWorkOrderByIds(Long[] ids); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/work/service/IWorkOrderService.java b/zhyc-module/src/main/java/com/zhyc/module/work/service/IWorkOrderService.java new file mode 100644 index 0000000..8cd6054 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/work/service/IWorkOrderService.java @@ -0,0 +1,61 @@ +package com.zhyc.module.work.service; + +import java.util.List; +import com.zhyc.module.work.domain.WorkOrder; + +/** + * 派工单Service接口 + * + * @author piaobo + * @date 2025-12-07 + */ +public interface IWorkOrderService +{ + /** + * 查询派工单 + * + * @param id 派工单主键 + * @return 派工单 + */ + public WorkOrder selectWorkOrderById(Long id); + + /** + * 查询派工单列表 + * + * @param workOrder 派工单 + * @return 派工单集合 + */ + public List selectWorkOrderList(WorkOrder workOrder); + + /** + * 新增派工单 + * + * @param workOrder 派工单 + * @return 结果 + */ + public int insertWorkOrder(WorkOrder workOrder); + + /** + * 修改派工单 + * + * @param workOrder 派工单 + * @return 结果 + */ + public int updateWorkOrder(WorkOrder workOrder); + + /** + * 批量删除派工单 + * + * @param ids 需要删除的派工单主键集合 + * @return 结果 + */ + public int deleteWorkOrderByIds(Long[] ids); + + /** + * 删除派工单信息 + * + * @param id 派工单主键 + * @return 结果 + */ + public int deleteWorkOrderById(Long id); +} diff --git a/zhyc-module/src/main/java/com/zhyc/module/work/service/impl/WorkOrderServiceImpl.java b/zhyc-module/src/main/java/com/zhyc/module/work/service/impl/WorkOrderServiceImpl.java new file mode 100644 index 0000000..3661019 --- /dev/null +++ b/zhyc-module/src/main/java/com/zhyc/module/work/service/impl/WorkOrderServiceImpl.java @@ -0,0 +1,96 @@ +package com.zhyc.module.work.service.impl; + +import java.util.List; +import com.zhyc.common.utils.DateUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import com.zhyc.module.work.mapper.WorkOrderMapper; +import com.zhyc.module.work.domain.WorkOrder; +import com.zhyc.module.work.service.IWorkOrderService; + +/** + * 派工单Service业务层处理 + * + * @author piaobo + * @date 2025-12-07 + */ +@Service +public class WorkOrderServiceImpl implements IWorkOrderService +{ + @Autowired + private WorkOrderMapper workOrderMapper; + + /** + * 查询派工单 + * + * @param id 派工单主键 + * @return 派工单 + */ + @Override + public WorkOrder selectWorkOrderById(Long id) + { + return workOrderMapper.selectWorkOrderById(id); + } + + /** + * 查询派工单列表 + * + * @param workOrder 派工单 + * @return 派工单 + */ + @Override + public List selectWorkOrderList(WorkOrder workOrder) + { + return workOrderMapper.selectWorkOrderList(workOrder); + } + + /** + * 新增派工单 + * + * @param workOrder 派工单 + * @return 结果 + */ + @Override + public int insertWorkOrder(WorkOrder workOrder) + { + workOrder.setCreateTime(DateUtils.getNowDate()); + return workOrderMapper.insertWorkOrder(workOrder); + } + + /** + * 修改派工单 + * + * @param workOrder 派工单 + * @return 结果 + */ + @Override + public int updateWorkOrder(WorkOrder workOrder) + { + workOrder.setUpdateTime(DateUtils.getNowDate()); + return workOrderMapper.updateWorkOrder(workOrder); + } + + /** + * 批量删除派工单 + * + * @param ids 需要删除的派工单主键 + * @return 结果 + */ + @Override + public int deleteWorkOrderByIds(Long[] ids) + { + return workOrderMapper.deleteWorkOrderByIds(ids); + } + + /** + * 删除派工单信息 + * + * @param id 派工单主键 + * @return 结果 + */ + @Override + public int deleteWorkOrderById(Long id) + { + return workOrderMapper.deleteWorkOrderById(id); + } +} diff --git a/zhyc-module/src/main/resources/mapper/work/WorkOrderMapper.xml b/zhyc-module/src/main/resources/mapper/work/WorkOrderMapper.xml new file mode 100644 index 0000000..e338c39 --- /dev/null +++ b/zhyc-module/src/main/resources/mapper/work/WorkOrderMapper.xml @@ -0,0 +1,172 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + select id, order_no, plan_id, biz_type, title, content, department, executor_ids, execute_date, execute_time, sheep_scope, location, material_list, tool_list, status, priority, issuer_id, issue_time, receiver_id, receive_time, finish_time, result, remark, create_time, update_time, deleted from work_order + + + + + + + + insert into work_order + + order_no, + plan_id, + biz_type, + title, + content, + department, + executor_ids, + execute_date, + execute_time, + sheep_scope, + location, + material_list, + tool_list, + status, + priority, + issuer_id, + issue_time, + receiver_id, + receive_time, + finish_time, + result, + remark, + create_time, + update_time, + deleted, + + + #{orderNo}, + #{planId}, + #{bizType}, + #{title}, + #{content}, + #{department}, + #{executorIds}, + #{executeDate}, + #{executeTime}, + #{sheepScope}, + #{location}, + #{materialList}, + #{toolList}, + #{status}, + #{priority}, + #{issuerId}, + #{issueTime}, + #{receiverId}, + #{receiveTime}, + #{finishTime}, + #{result}, + #{remark}, + #{createTime}, + #{updateTime}, + #{deleted}, + + + + + update work_order + + order_no = #{orderNo}, + plan_id = #{planId}, + biz_type = #{bizType}, + title = #{title}, + content = #{content}, + department = #{department}, + executor_ids = #{executorIds}, + execute_date = #{executeDate}, + execute_time = #{executeTime}, + sheep_scope = #{sheepScope}, + location = #{location}, + material_list = #{materialList}, + tool_list = #{toolList}, + status = #{status}, + priority = #{priority}, + issuer_id = #{issuerId}, + issue_time = #{issueTime}, + receiver_id = #{receiverId}, + receive_time = #{receiveTime}, + finish_time = #{finishTime}, + result = #{result}, + remark = #{remark}, + create_time = #{createTime}, + update_time = #{updateTime}, + deleted = #{deleted}, + + where id = #{id} + + + + delete from work_order where id = #{id} + + + + delete from work_order where id in + + #{id} + + + \ No newline at end of file