6 changed files with 907 additions and 0 deletions
@ -0,0 +1,151 @@ |
|||||
|
package com.ruoyi.system.controller; |
||||
|
|
||||
|
import java.util.List; |
||||
|
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.GetMapping; |
||||
|
import org.springframework.web.bind.annotation.PathVariable; |
||||
|
import org.springframework.web.bind.annotation.PostMapping; |
||||
|
import org.springframework.web.bind.annotation.RequestMapping; |
||||
|
import org.springframework.web.bind.annotation.ResponseBody; |
||||
|
import com.ruoyi.common.annotation.Log; |
||||
|
import com.ruoyi.common.enums.BusinessType; |
||||
|
import com.ruoyi.system.domain.BaseReturnOrderDetail; |
||||
|
import com.ruoyi.system.service.IBaseReturnOrderDetailService; |
||||
|
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/baseReturnOrderDetail") |
||||
|
public class BaseReturnOrderDetailController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "system/baseReturnOrderDetail"; |
||||
|
|
||||
|
@Autowired |
||||
|
private IBaseReturnOrderDetailService baseReturnOrderDetailService; |
||||
|
|
||||
|
@RequiresPermissions("system:detail:view") |
||||
|
@GetMapping() |
||||
|
public String detail() |
||||
|
{ |
||||
|
return prefix + "/detail"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料详情列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:detail:list") |
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(BaseReturnOrderDetail baseReturnOrderDetail) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<BaseReturnOrderDetail> list = baseReturnOrderDetailService.selectBaseReturnOrderDetailList(baseReturnOrderDetail); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出员工退料详情列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:detail:export") |
||||
|
@Log(title = "员工退料详情", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
@ResponseBody |
||||
|
public AjaxResult export(BaseReturnOrderDetail baseReturnOrderDetail) |
||||
|
{ |
||||
|
List<BaseReturnOrderDetail> list = baseReturnOrderDetailService.selectBaseReturnOrderDetailList(baseReturnOrderDetail); |
||||
|
ExcelUtil<BaseReturnOrderDetail> util = new ExcelUtil<BaseReturnOrderDetail>(BaseReturnOrderDetail.class); |
||||
|
return util.exportExcel(list, "员工退料详情数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增员工退料详情 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存员工退料详情 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:detail:add") |
||||
|
@Log(title = "员工退料详情", businessType = BusinessType.INSERT) |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public AjaxResult addSave(BaseReturnOrderDetail baseReturnOrderDetail) |
||||
|
{ |
||||
|
return toAjax(baseReturnOrderDetailService.insertBaseReturnOrderDetail(baseReturnOrderDetail)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改员工退料详情 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") Long id, ModelMap mmap) |
||||
|
{ |
||||
|
BaseReturnOrderDetail baseReturnOrderDetail = baseReturnOrderDetailService.selectBaseReturnOrderDetailById(id); |
||||
|
mmap.put("baseReturnOrderDetail", baseReturnOrderDetail); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存员工退料详情 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:detail:edit") |
||||
|
@Log(title = "员工退料详情", businessType = BusinessType.UPDATE) |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public AjaxResult editSave(BaseReturnOrderDetail baseReturnOrderDetail) |
||||
|
{ |
||||
|
return toAjax(baseReturnOrderDetailService.updateBaseReturnOrderDetail(baseReturnOrderDetail)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料详情 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:detail:remove") |
||||
|
@Log(title = "员工退料详情", businessType = BusinessType.DELETE) |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public AjaxResult remove(String ids) |
||||
|
{ |
||||
|
return toAjax(baseReturnOrderDetailService.deleteBaseReturnOrderDetailByIds(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废员工退料详情 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:detail:cancel") |
||||
|
@Log(title = "员工退料详情", businessType = BusinessType.CANCEL) |
||||
|
@GetMapping( "/cancel/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult cancel(@PathVariable("id") Long id){ |
||||
|
return toAjax(baseReturnOrderDetailService.cancelBaseReturnOrderDetailById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复员工退料详情 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:detail:restore") |
||||
|
@Log(title = "员工退料详情", businessType = BusinessType.RESTORE) |
||||
|
@GetMapping( "/restore/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult restore(@PathVariable("id")Long id) |
||||
|
{ |
||||
|
return toAjax(baseReturnOrderDetailService.restoreBaseReturnOrderDetailById(id)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,251 @@ |
|||||
|
package com.ruoyi.system.domain; |
||||
|
|
||||
|
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_detail |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-12-24 |
||||
|
*/ |
||||
|
public class BaseReturnOrderDetail extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 主键id */ |
||||
|
private Long id; |
||||
|
|
||||
|
/** 员工退料单号 */ |
||||
|
@Excel(name = "员工退料单号") |
||||
|
private String baseReturnOrderCode; |
||||
|
|
||||
|
/** 关联领料单号 */ |
||||
|
@Excel(name = "关联领料单号") |
||||
|
private String pickNo; |
||||
|
|
||||
|
/** 料号 */ |
||||
|
@Excel(name = "料号") |
||||
|
private String materialNo; |
||||
|
|
||||
|
/** 物料名称 */ |
||||
|
@Excel(name = "物料名称") |
||||
|
private String materialName; |
||||
|
|
||||
|
/** 图片 */ |
||||
|
@Excel(name = "图片") |
||||
|
private String photoUrl; |
||||
|
|
||||
|
/** 物料型号 */ |
||||
|
@Excel(name = "物料型号") |
||||
|
private String materialModel; |
||||
|
|
||||
|
/** 加工方式 */ |
||||
|
@Excel(name = "加工方式") |
||||
|
private String processMethod; |
||||
|
|
||||
|
/** 品牌 */ |
||||
|
@Excel(name = "品牌") |
||||
|
private String brand; |
||||
|
|
||||
|
/** 单位 */ |
||||
|
@Excel(name = "单位") |
||||
|
private String unit; |
||||
|
|
||||
|
/** 描述 */ |
||||
|
@Excel(name = "描述") |
||||
|
private String describe; |
||||
|
|
||||
|
/** 已领料数 */ |
||||
|
@Excel(name = "已领料数") |
||||
|
private Integer hasPickNum; |
||||
|
|
||||
|
/** 已退料数 */ |
||||
|
@Excel(name = "已退料数") |
||||
|
private Integer hasReturnNum; |
||||
|
|
||||
|
/** 本次退料数 */ |
||||
|
@Excel(name = "本次退料数") |
||||
|
private Integer returnNum; |
||||
|
|
||||
|
/** 用量 */ |
||||
|
@Excel(name = "用量") |
||||
|
private Integer useNum; |
||||
|
|
||||
|
/** 审核状态(0待审核,1审核通过,2审核拒绝) */ |
||||
|
@Excel(name = "审核状态", readConverterExp = "0=待审核,1审核通过,2审核拒绝") |
||||
|
private String auditStatus; |
||||
|
|
||||
|
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 setMaterialNo(String materialNo) |
||||
|
{ |
||||
|
this.materialNo = materialNo; |
||||
|
} |
||||
|
|
||||
|
public String getMaterialNo() |
||||
|
{ |
||||
|
return materialNo; |
||||
|
} |
||||
|
public void setMaterialName(String materialName) |
||||
|
{ |
||||
|
this.materialName = materialName; |
||||
|
} |
||||
|
|
||||
|
public String getMaterialName() |
||||
|
{ |
||||
|
return materialName; |
||||
|
} |
||||
|
public void setPhotoUrl(String photoUrl) |
||||
|
{ |
||||
|
this.photoUrl = photoUrl; |
||||
|
} |
||||
|
|
||||
|
public String getPhotoUrl() |
||||
|
{ |
||||
|
return photoUrl; |
||||
|
} |
||||
|
public void setMaterialModel(String materialModel) |
||||
|
{ |
||||
|
this.materialModel = materialModel; |
||||
|
} |
||||
|
|
||||
|
public String getMaterialModel() |
||||
|
{ |
||||
|
return materialModel; |
||||
|
} |
||||
|
public void setProcessMethod(String processMethod) |
||||
|
{ |
||||
|
this.processMethod = processMethod; |
||||
|
} |
||||
|
|
||||
|
public String getProcessMethod() |
||||
|
{ |
||||
|
return processMethod; |
||||
|
} |
||||
|
public void setBrand(String brand) |
||||
|
{ |
||||
|
this.brand = brand; |
||||
|
} |
||||
|
|
||||
|
public String getBrand() |
||||
|
{ |
||||
|
return brand; |
||||
|
} |
||||
|
public void setUnit(String unit) |
||||
|
{ |
||||
|
this.unit = unit; |
||||
|
} |
||||
|
|
||||
|
public String getUnit() |
||||
|
{ |
||||
|
return unit; |
||||
|
} |
||||
|
public void setDescribe(String describe) |
||||
|
{ |
||||
|
this.describe = describe; |
||||
|
} |
||||
|
|
||||
|
public String getDescribe() |
||||
|
{ |
||||
|
return describe; |
||||
|
} |
||||
|
public void setHasPickNum(Integer hasPickNum) |
||||
|
{ |
||||
|
this.hasPickNum = hasPickNum; |
||||
|
} |
||||
|
|
||||
|
public Integer getHasPickNum() |
||||
|
{ |
||||
|
return hasPickNum; |
||||
|
} |
||||
|
public void setHasReturnNum(Integer hasReturnNum) |
||||
|
{ |
||||
|
this.hasReturnNum = hasReturnNum; |
||||
|
} |
||||
|
|
||||
|
public Integer getHasReturnNum() |
||||
|
{ |
||||
|
return hasReturnNum; |
||||
|
} |
||||
|
public void setReturnNum(Integer returnNum) |
||||
|
{ |
||||
|
this.returnNum = returnNum; |
||||
|
} |
||||
|
|
||||
|
public Integer getReturnNum() |
||||
|
{ |
||||
|
return returnNum; |
||||
|
} |
||||
|
public void setUseNum(Integer useNum) |
||||
|
{ |
||||
|
this.useNum = useNum; |
||||
|
} |
||||
|
|
||||
|
public Integer getUseNum() |
||||
|
{ |
||||
|
return useNum; |
||||
|
} |
||||
|
public void setAuditStatus(String auditStatus) |
||||
|
{ |
||||
|
this.auditStatus = auditStatus; |
||||
|
} |
||||
|
|
||||
|
public String getAuditStatus() |
||||
|
{ |
||||
|
return auditStatus; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("id", getId()) |
||||
|
.append("baseReturnOrderCode", getBaseReturnOrderCode()) |
||||
|
.append("pickNo", getPickNo()) |
||||
|
.append("materialNo", getMaterialNo()) |
||||
|
.append("materialName", getMaterialName()) |
||||
|
.append("photoUrl", getPhotoUrl()) |
||||
|
.append("materialModel", getMaterialModel()) |
||||
|
.append("processMethod", getProcessMethod()) |
||||
|
.append("brand", getBrand()) |
||||
|
.append("unit", getUnit()) |
||||
|
.append("describe", getDescribe()) |
||||
|
.append("hasPickNum", getHasPickNum()) |
||||
|
.append("hasReturnNum", getHasReturnNum()) |
||||
|
.append("returnNum", getReturnNum()) |
||||
|
.append("useNum", getUseNum()) |
||||
|
.append("auditStatus", getAuditStatus()) |
||||
|
.append("createBy", getCreateBy()) |
||||
|
.append("createTime", getCreateTime()) |
||||
|
.append("updateBy", getUpdateBy()) |
||||
|
.append("updateTime", getUpdateTime()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.ruoyi.system.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.system.domain.BaseReturnOrderDetail; |
||||
|
|
||||
|
/** |
||||
|
* 员工退料详情Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-12-24 |
||||
|
*/ |
||||
|
public interface BaseReturnOrderDetailMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询员工退料详情 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 员工退料详情 |
||||
|
*/ |
||||
|
public BaseReturnOrderDetail selectBaseReturnOrderDetailById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料详情列表 |
||||
|
* |
||||
|
* @param baseReturnOrderDetail 员工退料详情 |
||||
|
* @return 员工退料详情集合 |
||||
|
*/ |
||||
|
public List<BaseReturnOrderDetail> selectBaseReturnOrderDetailList(BaseReturnOrderDetail baseReturnOrderDetail); |
||||
|
|
||||
|
/** |
||||
|
* 新增员工退料详情 |
||||
|
* |
||||
|
* @param baseReturnOrderDetail 员工退料详情 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertBaseReturnOrderDetail(BaseReturnOrderDetail baseReturnOrderDetail); |
||||
|
|
||||
|
/** |
||||
|
* 修改员工退料详情 |
||||
|
* |
||||
|
* @param baseReturnOrderDetail 员工退料详情 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateBaseReturnOrderDetail(BaseReturnOrderDetail baseReturnOrderDetail); |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料详情 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteBaseReturnOrderDetailById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除员工退料详情 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteBaseReturnOrderDetailByIds(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 作废员工退料详情 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int cancelBaseReturnOrderDetailById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 恢复员工退料详情 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int restoreBaseReturnOrderDetailById(Long id); |
||||
|
} |
@ -0,0 +1,78 @@ |
|||||
|
package com.ruoyi.system.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.system.domain.BaseReturnOrderDetail; |
||||
|
|
||||
|
/** |
||||
|
* 员工退料详情Service接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-12-24 |
||||
|
*/ |
||||
|
public interface IBaseReturnOrderDetailService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询员工退料详情 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 员工退料详情 |
||||
|
*/ |
||||
|
public BaseReturnOrderDetail selectBaseReturnOrderDetailById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料详情列表 |
||||
|
* |
||||
|
* @param baseReturnOrderDetail 员工退料详情 |
||||
|
* @return 员工退料详情集合 |
||||
|
*/ |
||||
|
public List<BaseReturnOrderDetail> selectBaseReturnOrderDetailList(BaseReturnOrderDetail baseReturnOrderDetail); |
||||
|
|
||||
|
/** |
||||
|
* 新增员工退料详情 |
||||
|
* |
||||
|
* @param baseReturnOrderDetail 员工退料详情 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertBaseReturnOrderDetail(BaseReturnOrderDetail baseReturnOrderDetail); |
||||
|
|
||||
|
/** |
||||
|
* 修改员工退料详情 |
||||
|
* |
||||
|
* @param baseReturnOrderDetail 员工退料详情 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateBaseReturnOrderDetail(BaseReturnOrderDetail baseReturnOrderDetail); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除员工退料详情 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteBaseReturnOrderDetailByIds(String ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料详情信息 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteBaseReturnOrderDetailById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 作废员工退料详情 |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int cancelBaseReturnOrderDetailById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 恢复员工退料详情 |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int restoreBaseReturnOrderDetailById(Long id); |
||||
|
|
||||
|
/** 查询关联领料单物料信息*/ |
||||
|
List<BaseReturnOrderDetail> getRelatedMaterialList(String pickNo); |
||||
|
} |
@ -0,0 +1,197 @@ |
|||||
|
package com.ruoyi.system.service.impl; |
||||
|
|
||||
|
import java.util.ArrayList; |
||||
|
import java.util.List; |
||||
|
import java.util.stream.Collectors; |
||||
|
|
||||
|
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.OutsourceRequisition; |
||||
|
import com.ruoyi.system.domain.OutsourceRequisitionDetail; |
||||
|
import com.ruoyi.system.mapper.OutsourceRequisitionMapper; |
||||
|
import org.apache.poi.util.StringUtil; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.ruoyi.system.mapper.BaseReturnOrderDetailMapper; |
||||
|
import com.ruoyi.system.domain.BaseReturnOrderDetail; |
||||
|
import com.ruoyi.system.service.IBaseReturnOrderDetailService; |
||||
|
import com.ruoyi.common.core.text.Convert; |
||||
|
import org.springframework.transaction.annotation.Transactional; |
||||
|
|
||||
|
/** |
||||
|
* 员工退料详情Service业务层处理 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-12-24 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class BaseReturnOrderDetailServiceImpl implements IBaseReturnOrderDetailService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private BaseReturnOrderDetailMapper baseReturnOrderDetailMapper; |
||||
|
|
||||
|
@Autowired |
||||
|
private OutsourceRequisitionMapper outRequisitionMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料详情 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 员工退料详情 |
||||
|
*/ |
||||
|
@Override |
||||
|
public BaseReturnOrderDetail selectBaseReturnOrderDetailById(Long id) |
||||
|
{ |
||||
|
return baseReturnOrderDetailMapper.selectBaseReturnOrderDetailById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询员工退料详情列表 |
||||
|
* |
||||
|
* @param baseReturnOrderDetail 员工退料详情 |
||||
|
* @return 员工退料详情 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<BaseReturnOrderDetail> selectBaseReturnOrderDetailList(BaseReturnOrderDetail baseReturnOrderDetail) |
||||
|
{ |
||||
|
return baseReturnOrderDetailMapper.selectBaseReturnOrderDetailList(baseReturnOrderDetail); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增员工退料详情 |
||||
|
* |
||||
|
* @param baseReturnOrderDetail 员工退料详情 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertBaseReturnOrderDetail(BaseReturnOrderDetail baseReturnOrderDetail) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
baseReturnOrderDetail.setCreateBy(loginName); |
||||
|
baseReturnOrderDetail.setCreateTime(DateUtils.getNowDate()); |
||||
|
return baseReturnOrderDetailMapper.insertBaseReturnOrderDetail(baseReturnOrderDetail); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改员工退料详情 |
||||
|
* |
||||
|
* @param baseReturnOrderDetail 员工退料详情 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateBaseReturnOrderDetail(BaseReturnOrderDetail baseReturnOrderDetail) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
baseReturnOrderDetail.setUpdateBy(loginName); |
||||
|
baseReturnOrderDetail.setUpdateTime(DateUtils.getNowDate()); |
||||
|
return baseReturnOrderDetailMapper.updateBaseReturnOrderDetail(baseReturnOrderDetail); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料详情对象 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteBaseReturnOrderDetailByIds(String ids) |
||||
|
{ |
||||
|
return baseReturnOrderDetailMapper.deleteBaseReturnOrderDetailByIds(Convert.toStrArray(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除员工退料详情信息 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteBaseReturnOrderDetailById(Long id) |
||||
|
{ |
||||
|
return baseReturnOrderDetailMapper.deleteBaseReturnOrderDetailById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废员工退料详情 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int cancelBaseReturnOrderDetailById(Long id) |
||||
|
{ |
||||
|
return baseReturnOrderDetailMapper.cancelBaseReturnOrderDetailById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复员工退料详情信息 |
||||
|
* |
||||
|
* @param id 员工退料详情ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int restoreBaseReturnOrderDetailById(Long id) |
||||
|
{ |
||||
|
return baseReturnOrderDetailMapper.restoreBaseReturnOrderDetailById(id); |
||||
|
} |
||||
|
|
||||
|
/** 查询关联领料单物料信息*/ |
||||
|
@Transactional(rollbackFor = Exception.class) |
||||
|
@Override |
||||
|
public List<BaseReturnOrderDetail> getRelatedMaterialList(String pickNo){ |
||||
|
List<BaseReturnOrderDetail> returnOrderDetails = new ArrayList<>(); |
||||
|
if(pickNo.startsWith("WWLL")){ |
||||
|
OutsourceRequisition outRequisition = outRequisitionMapper.selectOutsourceRequisitionByNo(pickNo); |
||||
|
if(outRequisition == null){ |
||||
|
throw new BusinessException("关联委外领料单不存在,请检查"); |
||||
|
} |
||||
|
OutsourceRequisitionDetail tempOutDetail = new OutsourceRequisitionDetail(); |
||||
|
tempOutDetail.setOutsourceRequisitionNo(pickNo); |
||||
|
tempOutDetail.setLevel(1); |
||||
|
List<OutsourceRequisitionDetail> details = outRequisitionMapper.selectOutsourceRequisitionDetailList(tempOutDetail); |
||||
|
|
||||
|
if(StringUtils.isNotEmpty(details)){ |
||||
|
for (OutsourceRequisitionDetail detail: details) { |
||||
|
BaseReturnOrderDetail returnOrderDetail = createReturnOrderDetailByOutDetail(detail); |
||||
|
returnOrderDetails.add(returnOrderDetail); |
||||
|
} |
||||
|
} |
||||
|
}else if(pickNo.startsWith("YGLL")){ |
||||
|
|
||||
|
}else{ |
||||
|
throw new BusinessException("领料号不存在"); |
||||
|
} |
||||
|
return returnOrderDetails; |
||||
|
} |
||||
|
|
||||
|
public BaseReturnOrderDetail createReturnOrderDetailByOutDetail(OutsourceRequisitionDetail detail){ |
||||
|
BaseReturnOrderDetail returnOrderDetail = new BaseReturnOrderDetail(); |
||||
|
returnOrderDetail.setMaterialNo(detail.getMaterialNo()); |
||||
|
returnOrderDetail.setMaterialName(detail.getMaterialName()); |
||||
|
returnOrderDetail.setPhotoUrl(detail.getMaterialPhotoUrl()); |
||||
|
returnOrderDetail.setProcessMethod(detail.getProcessMethod()); |
||||
|
returnOrderDetail.setBrand(detail.getBrand()); |
||||
|
returnOrderDetail.setUnit(detail.getUnit()); |
||||
|
returnOrderDetail.setDescribe(detail.getDescription()); |
||||
|
returnOrderDetail.setHasPickNum(detail.getTakingMaterial()); |
||||
|
returnOrderDetail.setReturnNum(0); |
||||
|
|
||||
|
BaseReturnOrderDetail tempDetail = new BaseReturnOrderDetail(); |
||||
|
tempDetail.setPickNo(detail.getOutsourceRequisitionNo()); |
||||
|
tempDetail.setMaterialNo(detail.getMaterialNo()); |
||||
|
List<BaseReturnOrderDetail> returnList = baseReturnOrderDetailMapper.selectBaseReturnOrderDetailList(tempDetail); |
||||
|
List<BaseReturnOrderDetail> filtList = returnList.stream() |
||||
|
.filter(item ->item.getAuditStatus().equals("0") |
||||
|
||item.getAuditStatus().equals("1")).collect(Collectors.toList()); |
||||
|
|
||||
|
if(StringUtils.isEmpty(filtList)){ |
||||
|
returnOrderDetail.setHasReturnNum(0); |
||||
|
}else{ |
||||
|
int hasReturnNum = filtList.stream().mapToInt(item ->item.getReturnNum()).sum(); |
||||
|
returnOrderDetail.setHasReturnNum(hasReturnNum); |
||||
|
} |
||||
|
return returnOrderDetail; |
||||
|
} |
||||
|
} |
@ -0,0 +1,153 @@ |
|||||
|
<?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.BaseReturnOrderDetailMapper"> |
||||
|
|
||||
|
<resultMap type="BaseReturnOrderDetail" id="BaseReturnOrderDetailResult"> |
||||
|
<result property="id" column="id" /> |
||||
|
<result property="baseReturnOrderCode" column="base_return_order_code" /> |
||||
|
<result property="pickNo" column="pick_no" /> |
||||
|
<result property="materialNo" column="material_no" /> |
||||
|
<result property="materialName" column="material_name" /> |
||||
|
<result property="photoUrl" column="photo_url" /> |
||||
|
<result property="materialModel" column="material_model" /> |
||||
|
<result property="processMethod" column="process_method" /> |
||||
|
<result property="brand" column="brand" /> |
||||
|
<result property="unit" column="unit" /> |
||||
|
<result property="describe" column="describe" /> |
||||
|
<result property="hasPickNum" column="has_pick_num" /> |
||||
|
<result property="hasReturnNum" column="has_return_num" /> |
||||
|
<result property="returnNum" column="return_num" /> |
||||
|
<result property="useNum" column="use_num" /> |
||||
|
<result property="auditStatus" column="audit_status" /> |
||||
|
<result property="createBy" column="create_by" /> |
||||
|
<result property="createTime" column="create_time" /> |
||||
|
<result property="updateBy" column="update_by" /> |
||||
|
<result property="updateTime" column="update_time" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectBaseReturnOrderDetailVo"> |
||||
|
select id, base_return_order_code, pick_no, material_no, material_name, photo_url, |
||||
|
material_model, process_method, brand, unit, `describe`, has_pick_num, |
||||
|
has_return_num, return_num, use_num, audit_status, create_by, create_time, |
||||
|
update_by, update_time from base_return_order_detail |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectBaseReturnOrderDetailList" parameterType="BaseReturnOrderDetail" resultMap="BaseReturnOrderDetailResult"> |
||||
|
<include refid="selectBaseReturnOrderDetailVo"/> |
||||
|
<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="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if> |
||||
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> |
||||
|
<if test="photoUrl != null and photoUrl != ''"> and photo_url = #{photoUrl}</if> |
||||
|
<if test="materialModel != null and materialModel != ''"> and material_model = #{materialModel}</if> |
||||
|
<if test="processMethod != null and processMethod != ''"> and process_method = #{processMethod}</if> |
||||
|
<if test="brand != null and brand != ''"> and brand = #{brand}</if> |
||||
|
<if test="unit != null and unit != ''"> and unit = #{unit}</if> |
||||
|
<if test="hasPickNum != null "> and has_pick_num = #{hasPickNum}</if> |
||||
|
<if test="hasReturnNum != null "> and has_return_num = #{hasReturnNum}</if> |
||||
|
<if test="returnNum != null "> and return_num = #{returnNum}</if> |
||||
|
<if test="useNum != null "> and use_num = #{useNum}</if> |
||||
|
<if test="auditStatus != null and auditStatus != ''"> and audit_status = #{auditStatus}</if> |
||||
|
</where> |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectBaseReturnOrderDetailById" parameterType="Long" resultMap="BaseReturnOrderDetailResult"> |
||||
|
<include refid="selectBaseReturnOrderDetailVo"/> |
||||
|
where id = #{id} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertBaseReturnOrderDetail" parameterType="BaseReturnOrderDetail" useGeneratedKeys="true" keyProperty="id"> |
||||
|
insert into base_return_order_detail |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="baseReturnOrderCode != null">base_return_order_code,</if> |
||||
|
<if test="pickNo != null">pick_no,</if> |
||||
|
<if test="materialNo != null">material_no,</if> |
||||
|
<if test="materialName != null">material_name,</if> |
||||
|
<if test="photoUrl != null">photo_url,</if> |
||||
|
<if test="materialModel != null">material_model,</if> |
||||
|
<if test="processMethod != null">process_method,</if> |
||||
|
<if test="brand != null">brand,</if> |
||||
|
<if test="unit != null">unit,</if> |
||||
|
<if test="describe != null">`describe`,</if> |
||||
|
<if test="hasPickNum != null">has_pick_num,</if> |
||||
|
<if test="hasReturnNum != null">has_return_num,</if> |
||||
|
<if test="returnNum != null">return_num,</if> |
||||
|
<if test="useNum != null">use_num,</if> |
||||
|
<if test="auditStatus != null">audit_status,</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> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="baseReturnOrderCode != null">#{baseReturnOrderCode},</if> |
||||
|
<if test="pickNo != null">#{pickNo},</if> |
||||
|
<if test="materialNo != null">#{materialNo},</if> |
||||
|
<if test="materialName != null">#{materialName},</if> |
||||
|
<if test="photoUrl != null">#{photoUrl},</if> |
||||
|
<if test="materialModel != null">#{materialModel},</if> |
||||
|
<if test="processMethod != null">#{processMethod},</if> |
||||
|
<if test="brand != null">#{brand},</if> |
||||
|
<if test="unit != null">#{unit},</if> |
||||
|
<if test="describe != null">#{describe},</if> |
||||
|
<if test="hasPickNum != null">#{hasPickNum},</if> |
||||
|
<if test="hasReturnNum != null">#{hasReturnNum},</if> |
||||
|
<if test="returnNum != null">#{returnNum},</if> |
||||
|
<if test="useNum != null">#{useNum},</if> |
||||
|
<if test="auditStatus != null">#{auditStatus},</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> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateBaseReturnOrderDetail" parameterType="BaseReturnOrderDetail"> |
||||
|
update base_return_order_detail |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="baseReturnOrderCode != null">base_return_order_code = #{baseReturnOrderCode},</if> |
||||
|
<if test="pickNo != null">pick_no = #{pickNo},</if> |
||||
|
<if test="materialNo != null">material_no = #{materialNo},</if> |
||||
|
<if test="materialName != null">material_name = #{materialName},</if> |
||||
|
<if test="photoUrl != null">photo_url = #{photoUrl},</if> |
||||
|
<if test="materialModel != null">material_model = #{materialModel},</if> |
||||
|
<if test="processMethod != null">process_method = #{processMethod},</if> |
||||
|
<if test="brand != null">brand = #{brand},</if> |
||||
|
<if test="unit != null">unit = #{unit},</if> |
||||
|
<if test="describe != null">`describe` = #{describe},</if> |
||||
|
<if test="hasPickNum != null">has_pick_num = #{hasPickNum},</if> |
||||
|
<if test="hasReturnNum != null">has_return_num = #{hasReturnNum},</if> |
||||
|
<if test="returnNum != null">return_num = #{returnNum},</if> |
||||
|
<if test="useNum != null">use_num = #{useNum},</if> |
||||
|
<if test="auditStatus != null">audit_status = #{auditStatus},</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> |
||||
|
</trim> |
||||
|
where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteBaseReturnOrderDetailById" parameterType="Long"> |
||||
|
delete from base_return_order_detail where id = #{id} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteBaseReturnOrderDetailByIds" parameterType="String"> |
||||
|
delete from base_return_order_detail where id in |
||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
<update id="cancelBaseReturnOrderDetailById" parameterType="Long"> |
||||
|
update base_return_order_detail set del_flag = '1' where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<update id="restoreBaseReturnOrderDetailById" parameterType="Long"> |
||||
|
update base_return_order_detail set del_flag = '0' where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue