6 changed files with 1018 additions and 0 deletions
@ -0,0 +1,192 @@ |
|||||
|
package com.ruoyi.system.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.ruoyi.system.domain.BaseReturnOrderDetail; |
||||
|
import com.ruoyi.system.domain.OutsourceRequisition; |
||||
|
import com.ruoyi.system.service.IBaseReturnOrderDetailService; |
||||
|
import com.ruoyi.system.service.IOutsourceRequisitionService; |
||||
|
import org.apache.shiro.authz.annotation.RequiresPermissions; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Controller; |
||||
|
import org.springframework.ui.ModelMap; |
||||
|
import org.springframework.web.bind.annotation.*; |
||||
|
import com.ruoyi.common.annotation.Log; |
||||
|
import com.ruoyi.common.enums.BusinessType; |
||||
|
import com.ruoyi.system.domain.BaseReturnOrder; |
||||
|
import com.ruoyi.system.service.IBaseReturnOrderService; |
||||
|
import com.ruoyi.common.core.controller.BaseController; |
||||
|
import com.ruoyi.common.core.domain.AjaxResult; |
||||
|
import com.ruoyi.common.utils.poi.ExcelUtil; |
||||
|
import com.ruoyi.common.core.page.TableDataInfo; |
||||
|
|
||||
|
/** |
||||
|
* 员工退料Controller |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-12-24 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/system/baseReturnOrder") |
||||
|
public class BaseReturnOrderController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "system/baseReturnOrder"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IBaseReturnOrderService baseReturnOrderService; |
||||
|
|
||||
|
@Autowired |
||||
|
private IBaseReturnOrderDetailService returnOrderDetailService; |
||||
|
|
||||
|
@Autowired |
||||
|
private IOutsourceRequisitionService requisitionService; |
||||
|
|
||||
|
@RequiresPermissions("system:baseReturnOrder:view") |
||||
|
@GetMapping() |
||||
|
public String baseReturnOrder() |
||||
|
{ |
||||
|
return prefix + "/baseReturnOrder"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:baseReturnOrder:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(BaseReturnOrder baseReturnOrder) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<BaseReturnOrder> list = baseReturnOrderService.selectBaseReturnOrderList(baseReturnOrder); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出员工退料列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:baseReturnOrder:export") |
||||
|
@Log(title = "员工退料", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
@ResponseBody |
||||
|
public AjaxResult export(BaseReturnOrder baseReturnOrder) |
||||
|
{ |
||||
|
List<BaseReturnOrder> list = baseReturnOrderService.selectBaseReturnOrderList(baseReturnOrder); |
||||
|
ExcelUtil<BaseReturnOrder> util = new ExcelUtil<BaseReturnOrder>(BaseReturnOrder.class); |
||||
|
return util.exportExcel(list, "员工退料数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增员工退料 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存员工退料 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:baseReturnOrder:add") |
||||
|
@Log(title = "员工退料", businessType = BusinessType.INSERT) |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public AjaxResult addSave(@RequestBody BaseReturnOrder baseReturnOrder) |
||||
|
{ |
||||
|
return toAjax(baseReturnOrderService.insertBaseReturnOrder(baseReturnOrder)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改员工退料 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") Long id, ModelMap mmap) |
||||
|
{ |
||||
|
BaseReturnOrder baseReturnOrder = baseReturnOrderService.selectBaseReturnOrderById(id); |
||||
|
mmap.put("baseReturnOrder", baseReturnOrder); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存员工退料 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:baseReturnOrder:edit") |
||||
|
@Log(title = "员工退料", businessType = BusinessType.UPDATE) |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public AjaxResult editSave(BaseReturnOrder baseReturnOrder) |
||||
|
{ |
||||
|
return toAjax(baseReturnOrderService.updateBaseReturnOrder(baseReturnOrder)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:baseReturnOrder:remove") |
||||
|
@Log(title = "员工退料", businessType = BusinessType.DELETE) |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public AjaxResult remove(String ids) |
||||
|
{ |
||||
|
return toAjax(baseReturnOrderService.deleteBaseReturnOrderByIds(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废员工退料 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:baseReturnOrder:cancel") |
||||
|
@Log(title = "员工退料", businessType = BusinessType.CANCEL) |
||||
|
@GetMapping( "/cancel/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult cancel(@PathVariable("id") Long id){ |
||||
|
return toAjax(baseReturnOrderService.cancelBaseReturnOrderById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复员工退料 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:baseReturnOrder:restore") |
||||
|
@Log(title = "员工退料", businessType = BusinessType.RESTORE) |
||||
|
@GetMapping( "/restore/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult restore(@PathVariable("id")Long id) |
||||
|
{ |
||||
|
return toAjax(baseReturnOrderService.restoreBaseReturnOrderById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改员工退料 |
||||
|
*/ |
||||
|
@GetMapping("/getMaterialList") |
||||
|
public String getMaterialList(@RequestParam("pickNo") String pickNo, ModelMap mmap) |
||||
|
{ |
||||
|
OutsourceRequisition requisition = requisitionService.selectOutsourceRequisitionByNo(pickNo); |
||||
|
String pickUser = requisition.getApplyUser(); |
||||
|
mmap.put("pickUser", pickUser); |
||||
|
mmap.put("pickNo", pickNo); |
||||
|
return prefix + "/materialSelect"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询关联领料单物料列表 |
||||
|
*/ |
||||
|
@PostMapping("/relatedMaterialList") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo relatedOrderList(BaseReturnOrder baseReturnOrder) |
||||
|
{ |
||||
|
List<BaseReturnOrderDetail> list = returnOrderDetailService.getRelatedMaterialList(baseReturnOrder.getPickNo()); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 员工退料详情 |
||||
|
*/ |
||||
|
@GetMapping("/detail/{id}") |
||||
|
public String detail(@PathVariable("id") Long id, ModelMap mmap) |
||||
|
{ |
||||
|
BaseReturnOrder baseReturnOrder = baseReturnOrderService.selectBaseReturnOrderById(id); |
||||
|
mmap.put("baseReturnOrder", baseReturnOrder); |
||||
|
return prefix + "/detail"; |
||||
|
} |
||||
|
|
||||
|
} |
@ -0,0 +1,325 @@ |
|||||
|
package com.ruoyi.system.domain; |
||||
|
|
||||
|
import java.util.Date; |
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.fasterxml.jackson.annotation.JsonFormat; |
||||
|
import org.apache.commons.lang3.builder.ToStringBuilder; |
||||
|
import org.apache.commons.lang3.builder.ToStringStyle; |
||||
|
import com.ruoyi.common.annotation.Excel; |
||||
|
import com.ruoyi.common.core.domain.BaseEntity; |
||||
|
|
||||
|
/** |
||||
|
* 员工退料对象 base_return_order |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-12-24 |
||||
|
*/ |
||||
|
public class BaseReturnOrder extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** id */ |
||||
|
private Long id; |
||||
|
|
||||
|
/** 退料单号 */ |
||||
|
@Excel(name = "退料单号") |
||||
|
private String baseReturnOrderCode; |
||||
|
|
||||
|
/** 关联领料单号 */ |
||||
|
@Excel(name = "关联领料单号") |
||||
|
private String pickNo; |
||||
|
|
||||
|
/** 退料状态(0待退料,1部分退料,2全部退料) */ |
||||
|
@Excel(name = "退料状态", readConverterExp = "0=待退料,1部分退料,2全部退料") |
||||
|
private String returnStatus; |
||||
|
|
||||
|
/** 物料合计 */ |
||||
|
@Excel(name = "物料合计") |
||||
|
private Integer materialSum; |
||||
|
|
||||
|
/** 退料数量合计 */ |
||||
|
@Excel(name = "退料数量合计") |
||||
|
private Integer returnSum; |
||||
|
|
||||
|
/** 合格数 */ |
||||
|
@Excel(name = "合格数") |
||||
|
private Integer qualifiedNum; |
||||
|
|
||||
|
/** 不良数 */ |
||||
|
@Excel(name = "不良数") |
||||
|
private Integer unqualifiedNum; |
||||
|
|
||||
|
/** 入库数 */ |
||||
|
@Excel(name = "入库数") |
||||
|
private Integer storageNum; |
||||
|
|
||||
|
/** 审核状态(0待审核,1审核通过,2审核拒绝) */ |
||||
|
@Excel(name = "审核状态", readConverterExp = "0=待审核,1审核通过,2审核拒绝") |
||||
|
private String auditStatus; |
||||
|
|
||||
|
/** 使用状态 */ |
||||
|
@Excel(name = "使用状态") |
||||
|
private String useStatus; |
||||
|
|
||||
|
/** 退料单类型*/ |
||||
|
private String returnOrderType; |
||||
|
|
||||
|
/** 退料单详情*/ |
||||
|
private List<BaseReturnOrderDetail> returnOrderDetails; |
||||
|
|
||||
|
/** 流程实例ID */ |
||||
|
private String instanceId; |
||||
|
|
||||
|
/** 流程实例类型 */ |
||||
|
private String instanceType; |
||||
|
|
||||
|
/** 流程提交实例ID */ |
||||
|
private String submitInstanceId; |
||||
|
|
||||
|
/** 流程作废实例ID */ |
||||
|
private String cancelInstanceId; |
||||
|
|
||||
|
/** 流程恢复实例ID */ |
||||
|
private String restoreInstanceId; |
||||
|
|
||||
|
/** 申请标题 */ |
||||
|
private String applyTitle; |
||||
|
|
||||
|
/** 申请人 */ |
||||
|
@Excel(name = "申请人") |
||||
|
private String applyUser; |
||||
|
|
||||
|
/** 申请时间 */ |
||||
|
@JsonFormat(pattern = "yyyy-MM-dd") |
||||
|
@Excel(name = "申请时间", width = 30, dateFormat = "yyyy-MM-dd") |
||||
|
private Date applyTime; |
||||
|
|
||||
|
/** 领料员 */ |
||||
|
private String pickUser; |
||||
|
|
||||
|
public void setId(Long id) |
||||
|
{ |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getId() |
||||
|
{ |
||||
|
return id; |
||||
|
} |
||||
|
public void setBaseReturnOrderCode(String baseReturnOrderCode) |
||||
|
{ |
||||
|
this.baseReturnOrderCode = baseReturnOrderCode; |
||||
|
} |
||||
|
|
||||
|
public String getBaseReturnOrderCode() |
||||
|
{ |
||||
|
return baseReturnOrderCode; |
||||
|
} |
||||
|
public void setPickNo(String pickNo) |
||||
|
{ |
||||
|
this.pickNo = pickNo; |
||||
|
} |
||||
|
|
||||
|
public String getPickNo() |
||||
|
{ |
||||
|
return pickNo; |
||||
|
} |
||||
|
public void setReturnStatus(String returnStatus) |
||||
|
{ |
||||
|
this.returnStatus = returnStatus; |
||||
|
} |
||||
|
|
||||
|
public String getReturnStatus() |
||||
|
{ |
||||
|
return returnStatus; |
||||
|
} |
||||
|
public void setMaterialSum(Integer materialSum) |
||||
|
{ |
||||
|
this.materialSum = materialSum; |
||||
|
} |
||||
|
|
||||
|
public Integer getMaterialSum() |
||||
|
{ |
||||
|
return materialSum; |
||||
|
} |
||||
|
public void setReturnSum(Integer returnSum) |
||||
|
{ |
||||
|
this.returnSum = returnSum; |
||||
|
} |
||||
|
|
||||
|
public Integer getReturnSum() |
||||
|
{ |
||||
|
return returnSum; |
||||
|
} |
||||
|
public void setQualifiedNum(Integer qualifiedNum) |
||||
|
{ |
||||
|
this.qualifiedNum = qualifiedNum; |
||||
|
} |
||||
|
|
||||
|
public Integer getQualifiedNum() |
||||
|
{ |
||||
|
return qualifiedNum; |
||||
|
} |
||||
|
public void setUnqualifiedNum(Integer unqualifiedNum) |
||||
|
{ |
||||
|
this.unqualifiedNum = unqualifiedNum; |
||||
|
} |
||||
|
|
||||
|
public Integer getUnqualifiedNum() |
||||
|
{ |
||||
|
return unqualifiedNum; |
||||
|
} |
||||
|
public void setStorageNum(Integer storageNum) |
||||
|
{ |
||||
|
this.storageNum = storageNum; |
||||
|
} |
||||
|
|
||||
|
public Integer getStorageNum() |
||||
|
{ |
||||
|
return storageNum; |
||||
|
} |
||||
|
public void setAuditStatus(String auditStatus) |
||||
|
{ |
||||
|
this.auditStatus = auditStatus; |
||||
|
} |
||||
|
|
||||
|
public String getAuditStatus() |
||||
|
{ |
||||
|
return auditStatus; |
||||
|
} |
||||
|
public void setUseStatus(String useStatus) |
||||
|
{ |
||||
|
this.useStatus = useStatus; |
||||
|
} |
||||
|
|
||||
|
public String getUseStatus() |
||||
|
{ |
||||
|
return useStatus; |
||||
|
} |
||||
|
public void setInstanceId(String instanceId) |
||||
|
{ |
||||
|
this.instanceId = instanceId; |
||||
|
} |
||||
|
|
||||
|
public String getInstanceId() |
||||
|
{ |
||||
|
return instanceId; |
||||
|
} |
||||
|
public void setInstanceType(String instanceType) |
||||
|
{ |
||||
|
this.instanceType = instanceType; |
||||
|
} |
||||
|
|
||||
|
public String getInstanceType() |
||||
|
{ |
||||
|
return instanceType; |
||||
|
} |
||||
|
public void setSubmitInstanceId(String submitInstanceId) |
||||
|
{ |
||||
|
this.submitInstanceId = submitInstanceId; |
||||
|
} |
||||
|
|
||||
|
public String getSubmitInstanceId() |
||||
|
{ |
||||
|
return submitInstanceId; |
||||
|
} |
||||
|
public void setCancelInstanceId(String cancelInstanceId) |
||||
|
{ |
||||
|
this.cancelInstanceId = cancelInstanceId; |
||||
|
} |
||||
|
|
||||
|
public String getCancelInstanceId() |
||||
|
{ |
||||
|
return cancelInstanceId; |
||||
|
} |
||||
|
public void setRestoreInstanceId(String restoreInstanceId) |
||||
|
{ |
||||
|
this.restoreInstanceId = restoreInstanceId; |
||||
|
} |
||||
|
|
||||
|
public String getRestoreInstanceId() |
||||
|
{ |
||||
|
return restoreInstanceId; |
||||
|
} |
||||
|
public void setApplyTitle(String applyTitle) |
||||
|
{ |
||||
|
this.applyTitle = applyTitle; |
||||
|
} |
||||
|
|
||||
|
public String getApplyTitle() |
||||
|
{ |
||||
|
return applyTitle; |
||||
|
} |
||||
|
public void setApplyUser(String applyUser) |
||||
|
{ |
||||
|
this.applyUser = applyUser; |
||||
|
} |
||||
|
|
||||
|
public String getApplyUser() |
||||
|
{ |
||||
|
return applyUser; |
||||
|
} |
||||
|
public void setApplyTime(Date applyTime) |
||||
|
{ |
||||
|
this.applyTime = applyTime; |
||||
|
} |
||||
|
|
||||
|
public Date getApplyTime() |
||||
|
{ |
||||
|
return applyTime; |
||||
|
} |
||||
|
|
||||
|
public String getPickUser() { |
||||
|
return pickUser; |
||||
|
} |
||||
|
|
||||
|
public void setPickUser(String pickUser) { |
||||
|
this.pickUser = pickUser; |
||||
|
} |
||||
|
|
||||
|
public String getReturnOrderType() { |
||||
|
return returnOrderType; |
||||
|
} |
||||
|
|
||||
|
public void setReturnOrderType(String returnOrderType) { |
||||
|
this.returnOrderType = returnOrderType; |
||||
|
} |
||||
|
|
||||
|
public List<BaseReturnOrderDetail> getReturnOrderDetails() { |
||||
|
return returnOrderDetails; |
||||
|
} |
||||
|
|
||||
|
public void setReturnOrderDetails(List<BaseReturnOrderDetail> returnOrderDetails) { |
||||
|
this.returnOrderDetails = returnOrderDetails; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("id", getId()) |
||||
|
.append("baseReturnOrderCode", getBaseReturnOrderCode()) |
||||
|
.append("pickNo", getPickNo()) |
||||
|
.append("returnStatus", getReturnStatus()) |
||||
|
.append("materialSum", getMaterialSum()) |
||||
|
.append("returnSum", getReturnSum()) |
||||
|
.append("qualifiedNum", getQualifiedNum()) |
||||
|
.append("unqualifiedNum", getUnqualifiedNum()) |
||||
|
.append("storageNum", getStorageNum()) |
||||
|
.append("createBy", getCreateBy()) |
||||
|
.append("createTime", getCreateTime()) |
||||
|
.append("updateBy", getUpdateBy()) |
||||
|
.append("updateTime", getUpdateTime()) |
||||
|
.append("auditStatus", getAuditStatus()) |
||||
|
.append("useStatus", getUseStatus()) |
||||
|
.append("instanceId", getInstanceId()) |
||||
|
.append("instanceType", getInstanceType()) |
||||
|
.append("submitInstanceId", getSubmitInstanceId()) |
||||
|
.append("cancelInstanceId", getCancelInstanceId()) |
||||
|
.append("restoreInstanceId", getRestoreInstanceId()) |
||||
|
.append("applyTitle", getApplyTitle()) |
||||
|
.append("applyUser", getApplyUser()) |
||||
|
.append("applyTime", getApplyTime()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.ruoyi.system.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.system.domain.BaseReturnOrder; |
||||
|
|
||||
|
/** |
||||
|
* 员工退料Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-12-24 |
||||
|
*/ |
||||
|
public interface BaseReturnOrderMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询员工退料 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 员工退料 |
||||
|
*/ |
||||
|
public BaseReturnOrder selectBaseReturnOrderById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料列表 |
||||
|
* |
||||
|
* @param baseReturnOrder 员工退料 |
||||
|
* @return 员工退料集合 |
||||
|
*/ |
||||
|
public List<BaseReturnOrder> selectBaseReturnOrderList(BaseReturnOrder baseReturnOrder); |
||||
|
|
||||
|
/** |
||||
|
* 新增员工退料 |
||||
|
* |
||||
|
* @param baseReturnOrder 员工退料 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertBaseReturnOrder(BaseReturnOrder baseReturnOrder); |
||||
|
|
||||
|
/** |
||||
|
* 修改员工退料 |
||||
|
* |
||||
|
* @param baseReturnOrder 员工退料 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateBaseReturnOrder(BaseReturnOrder baseReturnOrder); |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteBaseReturnOrderById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除员工退料 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteBaseReturnOrderByIds(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 作废员工退料 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int cancelBaseReturnOrderById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 恢复员工退料 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int restoreBaseReturnOrderById(Long id); |
||||
|
} |
@ -0,0 +1,75 @@ |
|||||
|
package com.ruoyi.system.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.system.domain.BaseReturnOrder; |
||||
|
|
||||
|
/** |
||||
|
* 员工退料Service接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-12-24 |
||||
|
*/ |
||||
|
public interface IBaseReturnOrderService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询员工退料 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 员工退料 |
||||
|
*/ |
||||
|
public BaseReturnOrder selectBaseReturnOrderById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料列表 |
||||
|
* |
||||
|
* @param baseReturnOrder 员工退料 |
||||
|
* @return 员工退料集合 |
||||
|
*/ |
||||
|
public List<BaseReturnOrder> selectBaseReturnOrderList(BaseReturnOrder baseReturnOrder); |
||||
|
|
||||
|
/** |
||||
|
* 新增员工退料 |
||||
|
* |
||||
|
* @param baseReturnOrder 员工退料 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertBaseReturnOrder(BaseReturnOrder baseReturnOrder); |
||||
|
|
||||
|
/** |
||||
|
* 修改员工退料 |
||||
|
* |
||||
|
* @param baseReturnOrder 员工退料 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateBaseReturnOrder(BaseReturnOrder baseReturnOrder); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除员工退料 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteBaseReturnOrderByIds(String ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料信息 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteBaseReturnOrderById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 作废员工退料 |
||||
|
* @param id 员工退料ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int cancelBaseReturnOrderById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 恢复员工退料 |
||||
|
* @param id 员工退料ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int restoreBaseReturnOrderById(Long id); |
||||
|
} |
@ -0,0 +1,174 @@ |
|||||
|
package com.ruoyi.system.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
import com.ruoyi.common.core.redis.RedisCache; |
||||
|
import com.ruoyi.common.exception.BusinessException; |
||||
|
import com.ruoyi.common.utils.DateUtils; |
||||
|
import com.ruoyi.common.utils.ShiroUtils; |
||||
|
import com.ruoyi.common.utils.StringUtils; |
||||
|
import com.ruoyi.system.domain.BaseReturnOrderDetail; |
||||
|
import com.ruoyi.system.domain.MakeReturnOrderDetail; |
||||
|
import com.ruoyi.system.mapper.BaseReturnOrderDetailMapper; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.ruoyi.system.mapper.BaseReturnOrderMapper; |
||||
|
import com.ruoyi.system.domain.BaseReturnOrder; |
||||
|
import com.ruoyi.system.service.IBaseReturnOrderService; |
||||
|
import com.ruoyi.common.core.text.Convert; |
||||
|
|
||||
|
/** |
||||
|
* 员工退料Service业务层处理 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-12-24 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class BaseReturnOrderServiceImpl implements IBaseReturnOrderService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private BaseReturnOrderMapper baseReturnOrderMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
private RedisCache redisCache; |
||||
|
|
||||
|
@Autowired |
||||
|
private BaseReturnOrderDetailMapper returnOrderDetailMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 员工退料 |
||||
|
*/ |
||||
|
@Override |
||||
|
public BaseReturnOrder selectBaseReturnOrderById(Long id) |
||||
|
{ |
||||
|
return baseReturnOrderMapper.selectBaseReturnOrderById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料列表 |
||||
|
* |
||||
|
* @param baseReturnOrder 员工退料 |
||||
|
* @return 员工退料 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<BaseReturnOrder> selectBaseReturnOrderList(BaseReturnOrder baseReturnOrder) |
||||
|
{ |
||||
|
return baseReturnOrderMapper.selectBaseReturnOrderList(baseReturnOrder); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增员工退料 |
||||
|
* |
||||
|
* @param baseReturnOrder 员工退料 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertBaseReturnOrder(BaseReturnOrder baseReturnOrder) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
int returnSum = 0; |
||||
|
String code = redisCache.generateBillNo("YGTL"); |
||||
|
String pickNo = baseReturnOrder.getPickNo(); |
||||
|
baseReturnOrder.setBaseReturnOrderCode(code); |
||||
|
|
||||
|
List<BaseReturnOrderDetail> returnOrderDetails = baseReturnOrder.getReturnOrderDetails(); |
||||
|
if(StringUtils.isEmpty(returnOrderDetails)){ |
||||
|
throw new BusinessException("退料详情为空!"); |
||||
|
} |
||||
|
for (BaseReturnOrderDetail detail: returnOrderDetails) { |
||||
|
int hasReturnNum = detail.getHasReturnNum()==null?0:detail.getHasReturnNum(); |
||||
|
int returnNum = detail.getReturnNum() + hasReturnNum; |
||||
|
int hasPickNum = detail.getHasPickNum(); |
||||
|
if(returnNum>hasPickNum){ |
||||
|
throw new BusinessException("物料" +detail.getMaterialNo()+"总退料数超出已领料数,请检查"); |
||||
|
} |
||||
|
detail.setBaseReturnOrderCode(code); |
||||
|
detail.setPickNo(pickNo); |
||||
|
detail.setAuditStatus("0"); |
||||
|
detail.setHasReturnNum(0); |
||||
|
detail.setCreateBy(loginName); |
||||
|
detail.setCreateTime(DateUtils.getNowDate()); |
||||
|
int insertResult = returnOrderDetailMapper.insertBaseReturnOrderDetail(detail); |
||||
|
if(insertResult<=0){ |
||||
|
throw new BusinessException("新增退料单详情失败"); |
||||
|
} |
||||
|
returnSum = returnSum + detail.getReturnNum(); |
||||
|
} |
||||
|
baseReturnOrder.setMaterialSum(returnOrderDetails.size()); |
||||
|
baseReturnOrder.setReturnSum(returnSum); |
||||
|
baseReturnOrder.setReturnStatus("0"); |
||||
|
baseReturnOrder.setAuditStatus("0"); |
||||
|
baseReturnOrder.setQualifiedNum(0); |
||||
|
baseReturnOrder.setUnqualifiedNum(0); |
||||
|
baseReturnOrder.setStorageNum(0); |
||||
|
baseReturnOrder.setCreateBy(loginName); |
||||
|
baseReturnOrder.setCreateTime(DateUtils.getNowDate()); |
||||
|
return baseReturnOrderMapper.insertBaseReturnOrder(baseReturnOrder); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改员工退料 |
||||
|
* |
||||
|
* @param baseReturnOrder 员工退料 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateBaseReturnOrder(BaseReturnOrder baseReturnOrder) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
baseReturnOrder.setUpdateBy(loginName); |
||||
|
baseReturnOrder.setUpdateTime(DateUtils.getNowDate()); |
||||
|
return baseReturnOrderMapper.updateBaseReturnOrder(baseReturnOrder); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料对象 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteBaseReturnOrderByIds(String ids) |
||||
|
{ |
||||
|
return baseReturnOrderMapper.deleteBaseReturnOrderByIds(Convert.toStrArray(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料信息 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteBaseReturnOrderById(Long id) |
||||
|
{ |
||||
|
return baseReturnOrderMapper.deleteBaseReturnOrderById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废员工退料 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int cancelBaseReturnOrderById(Long id) |
||||
|
{ |
||||
|
return baseReturnOrderMapper.cancelBaseReturnOrderById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复员工退料信息 |
||||
|
* |
||||
|
* @param id 员工退料ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int restoreBaseReturnOrderById(Long id) |
||||
|
{ |
||||
|
return baseReturnOrderMapper.restoreBaseReturnOrderById(id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,175 @@ |
|||||
|
<?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.ruoyi.system.mapper.BaseReturnOrderMapper"> |
||||
|
|
||||
|
<resultMap type="BaseReturnOrder" id="BaseReturnOrderResult"> |
||||
|
<result property="id" column="id" /> |
||||
|
<result property="baseReturnOrderCode" column="base_return_order_code" /> |
||||
|
<result property="pickNo" column="pick_no" /> |
||||
|
<result property="returnStatus" column="return_status" /> |
||||
|
<result property="materialSum" column="material_sum" /> |
||||
|
<result property="returnSum" column="return_sum" /> |
||||
|
<result property="qualifiedNum" column="qualified_num" /> |
||||
|
<result property="unqualifiedNum" column="unqualified_num" /> |
||||
|
<result property="storageNum" column="storage_num" /> |
||||
|
<result property="pickUser" column="pick_user" /> |
||||
|
<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="auditStatus" column="audit_status" /> |
||||
|
<result property="useStatus" column="use_status" /> |
||||
|
<result property="instanceId" column="instance_id" /> |
||||
|
<result property="instanceType" column="instance_type" /> |
||||
|
<result property="submitInstanceId" column="submit_instance_id" /> |
||||
|
<result property="cancelInstanceId" column="cancel_instance_id" /> |
||||
|
<result property="restoreInstanceId" column="restore_instance_id" /> |
||||
|
<result property="applyTitle" column="apply_title" /> |
||||
|
<result property="applyUser" column="apply_user" /> |
||||
|
<result property="applyTime" column="apply_time" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectBaseReturnOrderVo"> |
||||
|
select id, base_return_order_code, pick_no, return_status, material_sum, |
||||
|
return_sum, qualified_num, unqualified_num, storage_num, pick_user, |
||||
|
create_by, create_time, update_by, update_time, audit_status, use_status, |
||||
|
instance_id, instance_type, submit_instance_id, cancel_instance_id, |
||||
|
restore_instance_id, apply_title, apply_user, apply_time |
||||
|
from base_return_order |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectBaseReturnOrderList" parameterType="BaseReturnOrder" resultMap="BaseReturnOrderResult"> |
||||
|
<include refid="selectBaseReturnOrderVo"/> |
||||
|
<where> |
||||
|
<if test="baseReturnOrderCode != null and baseReturnOrderCode != ''"> and base_return_order_code = #{baseReturnOrderCode}</if> |
||||
|
<if test="pickNo != null and pickNo != ''"> and pick_no = #{pickNo}</if> |
||||
|
<if test="returnStatus != null and returnStatus != ''"> and return_status = #{returnStatus}</if> |
||||
|
<if test="materialSum != null "> and material_sum = #{materialSum}</if> |
||||
|
<if test="returnSum != null "> and return_sum = #{returnSum}</if> |
||||
|
<if test="qualifiedNum != null "> and qualified_num = #{qualifiedNum}</if> |
||||
|
<if test="unqualifiedNum != null "> and unqualified_num = #{unqualifiedNum}</if> |
||||
|
<if test="storageNum != null "> and storage_num = #{storageNum}</if> |
||||
|
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if> |
||||
|
<if test="useStatus != null and useStatus != ''"> and use_status = #{useStatus}</if> |
||||
|
<if test="instanceId != null and instanceId != ''"> and instance_id = #{instanceId}</if> |
||||
|
<if test="instanceType != null and instanceType != ''"> and instance_type = #{instanceType}</if> |
||||
|
<if test="submitInstanceId != null and submitInstanceId != ''"> and submit_instance_id = #{submitInstanceId}</if> |
||||
|
<if test="cancelInstanceId != null and cancelInstanceId != ''"> and cancel_instance_id = #{cancelInstanceId}</if> |
||||
|
<if test="restoreInstanceId != null and restoreInstanceId != ''"> and restore_instance_id = #{restoreInstanceId}</if> |
||||
|
<if test="applyTitle != null and applyTitle != ''"> and apply_title = #{applyTitle}</if> |
||||
|
<if test="applyUser != null and applyUser != ''"> and apply_user = #{applyUser}</if> |
||||
|
<if test="applyTime != null "> and apply_time = #{applyTime}</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectBaseReturnOrderById" parameterType="Long" resultMap="BaseReturnOrderResult"> |
||||
|
<include refid="selectBaseReturnOrderVo"/> |
||||
|
where id = #{id} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertBaseReturnOrder" parameterType="BaseReturnOrder" useGeneratedKeys="true" keyProperty="id"> |
||||
|
insert into base_return_order |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="baseReturnOrderCode != null and baseReturnOrderCode != ''">base_return_order_code,</if> |
||||
|
<if test="pickNo != null">pick_no,</if> |
||||
|
<if test="returnStatus != null">return_status,</if> |
||||
|
<if test="materialSum != null">material_sum,</if> |
||||
|
<if test="returnSum != null">return_sum,</if> |
||||
|
<if test="qualifiedNum != null">qualified_num,</if> |
||||
|
<if test="unqualifiedNum != null">unqualified_num,</if> |
||||
|
<if test="storageNum != null">storage_num,</if> |
||||
|
<if test="pickUser != null">pick_user,</if> |
||||
|
<if test="createBy != null">create_by,</if> |
||||
|
<if test="createTime != null">create_time,</if> |
||||
|
<if test="updateBy != null">update_by,</if> |
||||
|
<if test="updateTime != null">update_time,</if> |
||||
|
<if test="auditStatus != null">audit_status,</if> |
||||
|
<if test="useStatus != null">use_status,</if> |
||||
|
<if test="instanceId != null">instance_id,</if> |
||||
|
<if test="instanceType != null">instance_type,</if> |
||||
|
<if test="submitInstanceId != null">submit_instance_id,</if> |
||||
|
<if test="cancelInstanceId != null">cancel_instance_id,</if> |
||||
|
<if test="restoreInstanceId != null">restore_instance_id,</if> |
||||
|
<if test="applyTitle != null">apply_title,</if> |
||||
|
<if test="applyUser != null">apply_user,</if> |
||||
|
<if test="applyTime != null">apply_time,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="baseReturnOrderCode != null and baseReturnOrderCode != ''">#{baseReturnOrderCode},</if> |
||||
|
<if test="pickNo != null">#{pickNo},</if> |
||||
|
<if test="returnStatus != null">#{returnStatus},</if> |
||||
|
<if test="materialSum != null">#{materialSum},</if> |
||||
|
<if test="returnSum != null">#{returnSum},</if> |
||||
|
<if test="qualifiedNum != null">#{qualifiedNum},</if> |
||||
|
<if test="unqualifiedNum != null">#{unqualifiedNum},</if> |
||||
|
<if test="storageNum != null">#{storageNum},</if> |
||||
|
<if test="pickUser != null">#{pickUser},</if> |
||||
|
<if test="createBy != null">#{createBy},</if> |
||||
|
<if test="createTime != null">#{createTime},</if> |
||||
|
<if test="updateBy != null">#{updateBy},</if> |
||||
|
<if test="updateTime != null">#{updateTime},</if> |
||||
|
<if test="auditStatus != null">#{auditStatus},</if> |
||||
|
<if test="useStatus != null">#{useStatus},</if> |
||||
|
<if test="instanceId != null">#{instanceId},</if> |
||||
|
<if test="instanceType != null">#{instanceType},</if> |
||||
|
<if test="submitInstanceId != null">#{submitInstanceId},</if> |
||||
|
<if test="cancelInstanceId != null">#{cancelInstanceId},</if> |
||||
|
<if test="restoreInstanceId != null">#{restoreInstanceId},</if> |
||||
|
<if test="applyTitle != null">#{applyTitle},</if> |
||||
|
<if test="applyUser != null">#{applyUser},</if> |
||||
|
<if test="applyTime != null">#{applyTime},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateBaseReturnOrder" parameterType="BaseReturnOrder"> |
||||
|
update base_return_order |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="baseReturnOrderCode != null and baseReturnOrderCode != ''">base_return_order_code = #{baseReturnOrderCode},</if> |
||||
|
<if test="pickNo != null">pick_no = #{pickNo},</if> |
||||
|
<if test="returnStatus != null">return_status = #{returnStatus},</if> |
||||
|
<if test="materialSum != null">material_sum = #{materialSum},</if> |
||||
|
<if test="returnSum != null">return_sum = #{returnSum},</if> |
||||
|
<if test="qualifiedNum != null">qualified_num = #{qualifiedNum},</if> |
||||
|
<if test="unqualifiedNum != null">unqualified_num = #{unqualifiedNum},</if> |
||||
|
<if test="storageNum != null">storage_num = #{storageNum},</if> |
||||
|
<if test="pickUser != null">pick_user = #{pickUser},</if> |
||||
|
<if test="createBy != null">create_by = #{createBy},</if> |
||||
|
<if test="createTime != null">create_time = #{createTime},</if> |
||||
|
<if test="updateBy != null">update_by = #{updateBy},</if> |
||||
|
<if test="updateTime != null">update_time = #{updateTime},</if> |
||||
|
<if test="auditStatus != null">audit_status = #{auditStatus},</if> |
||||
|
<if test="useStatus != null">use_status = #{useStatus},</if> |
||||
|
<if test="instanceId != null">instance_id = #{instanceId},</if> |
||||
|
<if test="instanceType != null">instance_type = #{instanceType},</if> |
||||
|
<if test="submitInstanceId != null">submit_instance_id = #{submitInstanceId},</if> |
||||
|
<if test="cancelInstanceId != null">cancel_instance_id = #{cancelInstanceId},</if> |
||||
|
<if test="restoreInstanceId != null">restore_instance_id = #{restoreInstanceId},</if> |
||||
|
<if test="applyTitle != null">apply_title = #{applyTitle},</if> |
||||
|
<if test="applyUser != null">apply_user = #{applyUser},</if> |
||||
|
<if test="applyTime != null">apply_time = #{applyTime},</if> |
||||
|
</trim> |
||||
|
where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteBaseReturnOrderById" parameterType="Long"> |
||||
|
delete from base_return_order where id = #{id} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteBaseReturnOrderByIds" parameterType="String"> |
||||
|
delete from base_return_order where id in |
||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
<update id="cancelBaseReturnOrderById" parameterType="Long"> |
||||
|
update base_return_order set del_flag = '1' where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<update id="restoreBaseReturnOrderById" parameterType="Long"> |
||||
|
update base_return_order set del_flag = '0' where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue