youjianchi
7 months ago
19 changed files with 1729 additions and 70 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.SysMakeorderBom; |
||||
|
import com.ruoyi.system.service.ISysMakeorderBomService; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 生产订单BOM信息Controller |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-04-18 |
||||
|
*/ |
||||
|
@Controller |
||||
|
@RequestMapping("/system/makeorderbom") |
||||
|
public class SysMakeorderBomController extends BaseController |
||||
|
{ |
||||
|
private String prefix = "system/makeorderbom"; |
||||
|
|
||||
|
@Autowired |
||||
|
private ISysMakeorderBomService sysMakeorderBomService; |
||||
|
|
||||
|
@RequiresPermissions("system:makeorderbom:view") |
||||
|
@GetMapping() |
||||
|
public String makeorderbom() |
||||
|
{ |
||||
|
return prefix + "/makeorderbom"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询生产订单BOM信息列表 |
||||
|
*/ |
||||
|
// @RequiresPermissions("system:makeorderbom:list")
|
||||
|
@PostMapping("/list") |
||||
|
@ResponseBody |
||||
|
public TableDataInfo list(SysMakeorderBom sysMakeorderBom) |
||||
|
{ |
||||
|
startPage(); |
||||
|
List<SysMakeorderBom> list = sysMakeorderBomService.selectSysMakeorderBomList(sysMakeorderBom); |
||||
|
return getDataTable(list); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 导出生产订单BOM信息列表 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:makeorderbom:export") |
||||
|
@Log(title = "生产订单BOM信息", businessType = BusinessType.EXPORT) |
||||
|
@PostMapping("/export") |
||||
|
@ResponseBody |
||||
|
public AjaxResult export(SysMakeorderBom sysMakeorderBom) |
||||
|
{ |
||||
|
List<SysMakeorderBom> list = sysMakeorderBomService.selectSysMakeorderBomList(sysMakeorderBom); |
||||
|
ExcelUtil<SysMakeorderBom> util = new ExcelUtil<SysMakeorderBom>(SysMakeorderBom.class); |
||||
|
return util.exportExcel(list, "生产订单BOM信息数据"); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增生产订单BOM信息 |
||||
|
*/ |
||||
|
@GetMapping("/add") |
||||
|
public String add() |
||||
|
{ |
||||
|
return prefix + "/add"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增保存生产订单BOM信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:makeorderbom:add") |
||||
|
@Log(title = "生产订单BOM信息", businessType = BusinessType.INSERT) |
||||
|
@PostMapping("/add") |
||||
|
@ResponseBody |
||||
|
public AjaxResult addSave(SysMakeorderBom sysMakeorderBom) |
||||
|
{ |
||||
|
return toAjax(sysMakeorderBomService.insertSysMakeorderBom(sysMakeorderBom)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改生产订单BOM信息 |
||||
|
*/ |
||||
|
@GetMapping("/edit/{id}") |
||||
|
public String edit(@PathVariable("id") Long id, ModelMap mmap) |
||||
|
{ |
||||
|
SysMakeorderBom sysMakeorderBom = sysMakeorderBomService.selectSysMakeorderBomById(id); |
||||
|
mmap.put("sysMakeorderBom", sysMakeorderBom); |
||||
|
return prefix + "/edit"; |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改保存生产订单BOM信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:makeorderbom:edit") |
||||
|
@Log(title = "生产订单BOM信息", businessType = BusinessType.UPDATE) |
||||
|
@PostMapping("/edit") |
||||
|
@ResponseBody |
||||
|
public AjaxResult editSave(SysMakeorderBom sysMakeorderBom) |
||||
|
{ |
||||
|
return toAjax(sysMakeorderBomService.updateSysMakeorderBom(sysMakeorderBom)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除生产订单BOM信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:makeorderbom:remove") |
||||
|
@Log(title = "生产订单BOM信息", businessType = BusinessType.DELETE) |
||||
|
@PostMapping( "/remove") |
||||
|
@ResponseBody |
||||
|
public AjaxResult remove(String ids) |
||||
|
{ |
||||
|
return toAjax(sysMakeorderBomService.deleteSysMakeorderBomByIds(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废生产订单BOM信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:makeorderbom:cancel") |
||||
|
@Log(title = "生产订单BOM信息", businessType = BusinessType.CANCEL) |
||||
|
@GetMapping( "/cancel/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult cancel(@PathVariable("id") Long id){ |
||||
|
return toAjax(sysMakeorderBomService.cancelSysMakeorderBomById(id)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复生产订单BOM信息 |
||||
|
*/ |
||||
|
@RequiresPermissions("system:makeorderbom:restore") |
||||
|
@Log(title = "生产订单BOM信息", businessType = BusinessType.RESTORE) |
||||
|
@GetMapping( "/restore/{id}") |
||||
|
@ResponseBody |
||||
|
public AjaxResult restore(@PathVariable("id")Long id) |
||||
|
{ |
||||
|
return toAjax(sysMakeorderBomService.restoreSysMakeorderBomById(id)); |
||||
|
} |
||||
|
|
||||
|
|
||||
|
} |
@ -0,0 +1,280 @@ |
|||||
|
package com.ruoyi.system.domain; |
||||
|
|
||||
|
import java.math.BigDecimal; |
||||
|
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; |
||||
|
|
||||
|
/** |
||||
|
* 生产订单BOM信息对象 sys_makeorder_bom |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-04-18 |
||||
|
*/ |
||||
|
public class SysMakeorderBom extends BaseEntity |
||||
|
{ |
||||
|
private static final long serialVersionUID = 1L; |
||||
|
|
||||
|
/** 主键ID */ |
||||
|
private Long id; |
||||
|
|
||||
|
/** 删除标志(0代表存在 1代表删除) */ |
||||
|
private String delFlag; |
||||
|
|
||||
|
/** 生产订单号 */ |
||||
|
@Excel(name = "生产订单号") |
||||
|
private String makeNo; |
||||
|
|
||||
|
/** 销售订单号 */ |
||||
|
@Excel(name = "销售订单号") |
||||
|
private String salesOrderCode; |
||||
|
|
||||
|
/** 销售订单料号 */ |
||||
|
@Excel(name = "销售订单料号") |
||||
|
private String salesOrderMaterialNo; |
||||
|
|
||||
|
/** bom号 */ |
||||
|
@Excel(name = "bom号") |
||||
|
private String bomNo; |
||||
|
|
||||
|
/** 料号 */ |
||||
|
@Excel(name = "料号") |
||||
|
private String materialNo; |
||||
|
|
||||
|
/** bom的图片地址 */ |
||||
|
@Excel(name = "bom的图片地址") |
||||
|
private String photoUrl; |
||||
|
|
||||
|
/** 物料名称 */ |
||||
|
@Excel(name = "物料名称") |
||||
|
private String materialName; |
||||
|
|
||||
|
/** 物料类型 */ |
||||
|
@Excel(name = "物料类型") |
||||
|
private String materialType; |
||||
|
|
||||
|
/** 加工方式 */ |
||||
|
@Excel(name = "加工方式") |
||||
|
private String processMethod; |
||||
|
|
||||
|
/** 单位 */ |
||||
|
@Excel(name = "单位") |
||||
|
private String unit; |
||||
|
|
||||
|
/** 品牌 */ |
||||
|
@Excel(name = "品牌") |
||||
|
private String brand; |
||||
|
|
||||
|
/** 描述 */ |
||||
|
@Excel(name = "描述") |
||||
|
private String describe; |
||||
|
|
||||
|
/** 用量 */ |
||||
|
@Excel(name = "用量") |
||||
|
private Long useNum; |
||||
|
|
||||
|
/** 损耗率 */ |
||||
|
@Excel(name = "损耗率") |
||||
|
private BigDecimal lossRate; |
||||
|
|
||||
|
/** 层级 */ |
||||
|
@Excel(name = "层级") |
||||
|
private Long level; |
||||
|
|
||||
|
/** 排序 */ |
||||
|
@Excel(name = "排序") |
||||
|
private Long sortNo; |
||||
|
|
||||
|
public void setId(Long id) |
||||
|
{ |
||||
|
this.id = id; |
||||
|
} |
||||
|
|
||||
|
public Long getId() |
||||
|
{ |
||||
|
return id; |
||||
|
} |
||||
|
public void setDelFlag(String delFlag) |
||||
|
{ |
||||
|
this.delFlag = delFlag; |
||||
|
} |
||||
|
|
||||
|
public String getDelFlag() |
||||
|
{ |
||||
|
return delFlag; |
||||
|
} |
||||
|
public void setMakeNo(String makeNo) |
||||
|
{ |
||||
|
this.makeNo = makeNo; |
||||
|
} |
||||
|
|
||||
|
public String getMakeNo() |
||||
|
{ |
||||
|
return makeNo; |
||||
|
} |
||||
|
public void setSalesOrderCode(String salesOrderCode) |
||||
|
{ |
||||
|
this.salesOrderCode = salesOrderCode; |
||||
|
} |
||||
|
|
||||
|
public String getSalesOrderCode() |
||||
|
{ |
||||
|
return salesOrderCode; |
||||
|
} |
||||
|
public void setSalesOrderMaterialNo(String salesOrderMaterialNo) |
||||
|
{ |
||||
|
this.salesOrderMaterialNo = salesOrderMaterialNo; |
||||
|
} |
||||
|
|
||||
|
public String getSalesOrderMaterialNo() |
||||
|
{ |
||||
|
return salesOrderMaterialNo; |
||||
|
} |
||||
|
public void setBomNo(String bomNo) |
||||
|
{ |
||||
|
this.bomNo = bomNo; |
||||
|
} |
||||
|
|
||||
|
public String getBomNo() |
||||
|
{ |
||||
|
return bomNo; |
||||
|
} |
||||
|
public void setMaterialNo(String materialNo) |
||||
|
{ |
||||
|
this.materialNo = materialNo; |
||||
|
} |
||||
|
|
||||
|
public String getMaterialNo() |
||||
|
{ |
||||
|
return materialNo; |
||||
|
} |
||||
|
public void setPhotoUrl(String photoUrl) |
||||
|
{ |
||||
|
this.photoUrl = photoUrl; |
||||
|
} |
||||
|
|
||||
|
public String getPhotoUrl() |
||||
|
{ |
||||
|
return photoUrl; |
||||
|
} |
||||
|
public void setMaterialName(String materialName) |
||||
|
{ |
||||
|
this.materialName = materialName; |
||||
|
} |
||||
|
|
||||
|
public String getMaterialName() |
||||
|
{ |
||||
|
return materialName; |
||||
|
} |
||||
|
public void setMaterialType(String materialType) |
||||
|
{ |
||||
|
this.materialType = materialType; |
||||
|
} |
||||
|
|
||||
|
public String getMaterialType() |
||||
|
{ |
||||
|
return materialType; |
||||
|
} |
||||
|
public void setProcessMethod(String processMethod) |
||||
|
{ |
||||
|
this.processMethod = processMethod; |
||||
|
} |
||||
|
|
||||
|
public String getProcessMethod() |
||||
|
{ |
||||
|
return processMethod; |
||||
|
} |
||||
|
public void setUnit(String unit) |
||||
|
{ |
||||
|
this.unit = unit; |
||||
|
} |
||||
|
|
||||
|
public String getUnit() |
||||
|
{ |
||||
|
return unit; |
||||
|
} |
||||
|
public void setBrand(String brand) |
||||
|
{ |
||||
|
this.brand = brand; |
||||
|
} |
||||
|
|
||||
|
public String getBrand() |
||||
|
{ |
||||
|
return brand; |
||||
|
} |
||||
|
public void setDescribe(String describe) |
||||
|
{ |
||||
|
this.describe = describe; |
||||
|
} |
||||
|
|
||||
|
public String getDescribe() |
||||
|
{ |
||||
|
return describe; |
||||
|
} |
||||
|
public void setUseNum(Long useNum) |
||||
|
{ |
||||
|
this.useNum = useNum; |
||||
|
} |
||||
|
|
||||
|
public Long getUseNum() |
||||
|
{ |
||||
|
return useNum; |
||||
|
} |
||||
|
public void setLossRate(BigDecimal lossRate) |
||||
|
{ |
||||
|
this.lossRate = lossRate; |
||||
|
} |
||||
|
|
||||
|
public BigDecimal getLossRate() |
||||
|
{ |
||||
|
return lossRate; |
||||
|
} |
||||
|
public void setLevel(Long level) |
||||
|
{ |
||||
|
this.level = level; |
||||
|
} |
||||
|
|
||||
|
public Long getLevel() |
||||
|
{ |
||||
|
return level; |
||||
|
} |
||||
|
public void setSortNo(Long sortNo) |
||||
|
{ |
||||
|
this.sortNo = sortNo; |
||||
|
} |
||||
|
|
||||
|
public Long getSortNo() |
||||
|
{ |
||||
|
return sortNo; |
||||
|
} |
||||
|
|
||||
|
@Override |
||||
|
public String toString() { |
||||
|
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) |
||||
|
.append("id", getId()) |
||||
|
.append("delFlag", getDelFlag()) |
||||
|
.append("createBy", getCreateBy()) |
||||
|
.append("createTime", getCreateTime()) |
||||
|
.append("updateBy", getUpdateBy()) |
||||
|
.append("updateTime", getUpdateTime()) |
||||
|
.append("remark", getRemark()) |
||||
|
.append("makeNo", getMakeNo()) |
||||
|
.append("salesOrderCode", getSalesOrderCode()) |
||||
|
.append("salesOrderMaterialNo", getSalesOrderMaterialNo()) |
||||
|
.append("bomNo", getBomNo()) |
||||
|
.append("materialNo", getMaterialNo()) |
||||
|
.append("photoUrl", getPhotoUrl()) |
||||
|
.append("materialName", getMaterialName()) |
||||
|
.append("materialType", getMaterialType()) |
||||
|
.append("processMethod", getProcessMethod()) |
||||
|
.append("unit", getUnit()) |
||||
|
.append("brand", getBrand()) |
||||
|
.append("describe", getDescribe()) |
||||
|
.append("useNum", getUseNum()) |
||||
|
.append("lossRate", getLossRate()) |
||||
|
.append("level", getLevel()) |
||||
|
.append("sortNo", getSortNo()) |
||||
|
.toString(); |
||||
|
} |
||||
|
} |
@ -0,0 +1,77 @@ |
|||||
|
package com.ruoyi.system.mapper; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.system.domain.SysMakeorderBom; |
||||
|
|
||||
|
/** |
||||
|
* 生产订单BOM信息Mapper接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-04-18 |
||||
|
*/ |
||||
|
public interface SysMakeorderBomMapper |
||||
|
{ |
||||
|
/** |
||||
|
* 查询生产订单BOM信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 生产订单BOM信息 |
||||
|
*/ |
||||
|
public SysMakeorderBom selectSysMakeorderBomById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询生产订单BOM信息列表 |
||||
|
* |
||||
|
* @param sysMakeorderBom 生产订单BOM信息 |
||||
|
* @return 生产订单BOM信息集合 |
||||
|
*/ |
||||
|
public List<SysMakeorderBom> selectSysMakeorderBomList(SysMakeorderBom sysMakeorderBom); |
||||
|
|
||||
|
/** |
||||
|
* 新增生产订单BOM信息 |
||||
|
* |
||||
|
* @param sysMakeorderBom 生产订单BOM信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertSysMakeorderBom(SysMakeorderBom sysMakeorderBom); |
||||
|
|
||||
|
/** |
||||
|
* 修改生产订单BOM信息 |
||||
|
* |
||||
|
* @param sysMakeorderBom 生产订单BOM信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateSysMakeorderBom(SysMakeorderBom sysMakeorderBom); |
||||
|
|
||||
|
/** |
||||
|
* 删除生产订单BOM信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteSysMakeorderBomById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除生产订单BOM信息 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteSysMakeorderBomByIds(String[] ids); |
||||
|
|
||||
|
/** |
||||
|
* 作废生产订单BOM信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int cancelSysMakeorderBomById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 恢复生产订单BOM信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int restoreSysMakeorderBomById(Long id); |
||||
|
} |
@ -0,0 +1,75 @@ |
|||||
|
package com.ruoyi.system.service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.system.domain.SysMakeorderBom; |
||||
|
|
||||
|
/** |
||||
|
* 生产订单BOM信息Service接口 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-04-18 |
||||
|
*/ |
||||
|
public interface ISysMakeorderBomService |
||||
|
{ |
||||
|
/** |
||||
|
* 查询生产订单BOM信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 生产订单BOM信息 |
||||
|
*/ |
||||
|
public SysMakeorderBom selectSysMakeorderBomById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 查询生产订单BOM信息列表 |
||||
|
* |
||||
|
* @param sysMakeorderBom 生产订单BOM信息 |
||||
|
* @return 生产订单BOM信息集合 |
||||
|
*/ |
||||
|
public List<SysMakeorderBom> selectSysMakeorderBomList(SysMakeorderBom sysMakeorderBom); |
||||
|
|
||||
|
/** |
||||
|
* 新增生产订单BOM信息 |
||||
|
* |
||||
|
* @param sysMakeorderBom 生产订单BOM信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int insertSysMakeorderBom(SysMakeorderBom sysMakeorderBom); |
||||
|
|
||||
|
/** |
||||
|
* 修改生产订单BOM信息 |
||||
|
* |
||||
|
* @param sysMakeorderBom 生产订单BOM信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int updateSysMakeorderBom(SysMakeorderBom sysMakeorderBom); |
||||
|
|
||||
|
/** |
||||
|
* 批量删除生产订单BOM信息 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteSysMakeorderBomByIds(String ids); |
||||
|
|
||||
|
/** |
||||
|
* 删除生产订单BOM信息信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
public int deleteSysMakeorderBomById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 作废生产订单BOM信息 |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int cancelSysMakeorderBomById(Long id); |
||||
|
|
||||
|
/** |
||||
|
* 恢复生产订单BOM信息 |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return |
||||
|
*/ |
||||
|
int restoreSysMakeorderBomById(Long id); |
||||
|
} |
@ -0,0 +1,126 @@ |
|||||
|
package com.ruoyi.system.service.impl; |
||||
|
|
||||
|
import java.util.List; |
||||
|
import com.ruoyi.common.utils.DateUtils; |
||||
|
import com.ruoyi.common.utils.ShiroUtils; |
||||
|
import org.springframework.beans.factory.annotation.Autowired; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
import com.ruoyi.system.mapper.SysMakeorderBomMapper; |
||||
|
import com.ruoyi.system.domain.SysMakeorderBom; |
||||
|
import com.ruoyi.system.service.ISysMakeorderBomService; |
||||
|
import com.ruoyi.common.core.text.Convert; |
||||
|
|
||||
|
/** |
||||
|
* 生产订单BOM信息Service业务层处理 |
||||
|
* |
||||
|
* @author ruoyi |
||||
|
* @date 2024-04-18 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class SysMakeorderBomServiceImpl implements ISysMakeorderBomService |
||||
|
{ |
||||
|
@Autowired |
||||
|
private SysMakeorderBomMapper sysMakeorderBomMapper; |
||||
|
|
||||
|
/** |
||||
|
* 查询生产订单BOM信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 生产订单BOM信息 |
||||
|
*/ |
||||
|
@Override |
||||
|
public SysMakeorderBom selectSysMakeorderBomById(Long id) |
||||
|
{ |
||||
|
return sysMakeorderBomMapper.selectSysMakeorderBomById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 查询生产订单BOM信息列表 |
||||
|
* |
||||
|
* @param sysMakeorderBom 生产订单BOM信息 |
||||
|
* @return 生产订单BOM信息 |
||||
|
*/ |
||||
|
@Override |
||||
|
public List<SysMakeorderBom> selectSysMakeorderBomList(SysMakeorderBom sysMakeorderBom) |
||||
|
{ |
||||
|
return sysMakeorderBomMapper.selectSysMakeorderBomList(sysMakeorderBom); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 新增生产订单BOM信息 |
||||
|
* |
||||
|
* @param sysMakeorderBom 生产订单BOM信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int insertSysMakeorderBom(SysMakeorderBom sysMakeorderBom) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
sysMakeorderBom.setCreateBy(loginName); |
||||
|
sysMakeorderBom.setCreateTime(DateUtils.getNowDate()); |
||||
|
return sysMakeorderBomMapper.insertSysMakeorderBom(sysMakeorderBom); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 修改生产订单BOM信息 |
||||
|
* |
||||
|
* @param sysMakeorderBom 生产订单BOM信息 |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int updateSysMakeorderBom(SysMakeorderBom sysMakeorderBom) |
||||
|
{ |
||||
|
String loginName = ShiroUtils.getLoginName(); |
||||
|
sysMakeorderBom.setUpdateBy(loginName); |
||||
|
sysMakeorderBom.setUpdateTime(DateUtils.getNowDate()); |
||||
|
return sysMakeorderBomMapper.updateSysMakeorderBom(sysMakeorderBom); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除生产订单BOM信息对象 |
||||
|
* |
||||
|
* @param ids 需要删除的数据ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteSysMakeorderBomByIds(String ids) |
||||
|
{ |
||||
|
return sysMakeorderBomMapper.deleteSysMakeorderBomByIds(Convert.toStrArray(ids)); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 删除生产订单BOM信息信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int deleteSysMakeorderBomById(Long id) |
||||
|
{ |
||||
|
return sysMakeorderBomMapper.deleteSysMakeorderBomById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 作废生产订单BOM信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int cancelSysMakeorderBomById(Long id) |
||||
|
{ |
||||
|
return sysMakeorderBomMapper.cancelSysMakeorderBomById(id); |
||||
|
} |
||||
|
|
||||
|
/** |
||||
|
* 恢复生产订单BOM信息信息 |
||||
|
* |
||||
|
* @param id 生产订单BOM信息ID |
||||
|
* @return 结果 |
||||
|
*/ |
||||
|
@Override |
||||
|
public int restoreSysMakeorderBomById(Long id) |
||||
|
{ |
||||
|
return sysMakeorderBomMapper.restoreSysMakeorderBomById(id); |
||||
|
} |
||||
|
} |
@ -0,0 +1,165 @@ |
|||||
|
<?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.SysMakeorderBomMapper"> |
||||
|
|
||||
|
<resultMap type="SysMakeorderBom" id="SysMakeorderBomResult"> |
||||
|
<result property="id" column="id" /> |
||||
|
<result property="delFlag" column="del_flag" /> |
||||
|
<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="remark" column="remark" /> |
||||
|
<result property="makeNo" column="make_no" /> |
||||
|
<result property="salesOrderCode" column="sales_order_code" /> |
||||
|
<result property="salesOrderMaterialNo" column="sales_order_material_no" /> |
||||
|
<result property="bomNo" column="bom_no" /> |
||||
|
<result property="materialNo" column="material_no" /> |
||||
|
<result property="photoUrl" column="photoUrl" /> |
||||
|
<result property="materialName" column="material_name" /> |
||||
|
<result property="materialType" column="material_type" /> |
||||
|
<result property="processMethod" column="process_method" /> |
||||
|
<result property="unit" column="unit" /> |
||||
|
<result property="brand" column="brand" /> |
||||
|
<result property="describe" column="describe" /> |
||||
|
<result property="useNum" column="use_num" /> |
||||
|
<result property="lossRate" column="loss_rate" /> |
||||
|
<result property="level" column="level" /> |
||||
|
<result property="sortNo" column="sort_no" /> |
||||
|
</resultMap> |
||||
|
|
||||
|
<sql id="selectSysMakeorderBomVo"> |
||||
|
select id, del_flag, create_by, create_time, update_by, update_time, remark, make_no, sales_order_code, sales_order_material_no, bom_no, material_no, photoUrl, material_name, material_type, process_method, unit, brand, `describe`, use_num, loss_rate, level, sort_no from sys_makeorder_bom |
||||
|
</sql> |
||||
|
|
||||
|
<select id="selectSysMakeorderBomList" parameterType="SysMakeorderBom" resultMap="SysMakeorderBomResult"> |
||||
|
<include refid="selectSysMakeorderBomVo"/> |
||||
|
<where> |
||||
|
<if test="makeNo != null and makeNo != ''"> and make_no = #{makeNo}</if> |
||||
|
<if test="salesOrderCode != null and salesOrderCode != ''"> and sales_order_code = #{salesOrderCode}</if> |
||||
|
<if test="salesOrderMaterialNo != null and salesOrderMaterialNo != ''"> and sales_order_material_no = #{salesOrderMaterialNo}</if> |
||||
|
<if test="bomNo != null and bomNo != ''"> and bom_no = #{bomNo}</if> |
||||
|
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if> |
||||
|
<if test="photoUrl != null and photoUrl != ''"> and photoUrl = #{photoUrl}</if> |
||||
|
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if> |
||||
|
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if> |
||||
|
<if test="processMethod != null and processMethod != ''"> and process_method = #{processMethod}</if> |
||||
|
<if test="unit != null and unit != ''"> and unit = #{unit}</if> |
||||
|
<if test="brand != null and brand != ''"> and brand = #{brand}</if> |
||||
|
<if test="describe != null and describe != ''"> and `describe` = #{describe}</if> |
||||
|
<if test="useNum != null "> and use_num = #{useNum}</if> |
||||
|
<if test="lossRate != null "> and loss_rate = #{lossRate}</if> |
||||
|
<if test="level != null "> and level = #{level}</if> |
||||
|
<if test="sortNo != null "> and sort_no = #{sortNo}</if> |
||||
|
</where> |
||||
|
order by sort_no |
||||
|
</select> |
||||
|
|
||||
|
<select id="selectSysMakeorderBomById" parameterType="Long" resultMap="SysMakeorderBomResult"> |
||||
|
<include refid="selectSysMakeorderBomVo"/> |
||||
|
where id = #{id} |
||||
|
</select> |
||||
|
|
||||
|
<insert id="insertSysMakeorderBom" parameterType="SysMakeorderBom" useGeneratedKeys="true" keyProperty="id"> |
||||
|
insert into sys_makeorder_bom |
||||
|
<trim prefix="(" suffix=")" suffixOverrides=","> |
||||
|
<if test="delFlag != null">del_flag,</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="remark != null">remark,</if> |
||||
|
<if test="makeNo != null">make_no,</if> |
||||
|
<if test="salesOrderCode != null">sales_order_code,</if> |
||||
|
<if test="salesOrderMaterialNo != null">sales_order_material_no,</if> |
||||
|
<if test="bomNo != null">bom_no,</if> |
||||
|
<if test="materialNo != null">material_no,</if> |
||||
|
<if test="photoUrl != null">photoUrl,</if> |
||||
|
<if test="materialName != null">material_name,</if> |
||||
|
<if test="materialType != null">material_type,</if> |
||||
|
<if test="processMethod != null">process_method,</if> |
||||
|
<if test="unit != null">unit,</if> |
||||
|
<if test="brand != null">brand,</if> |
||||
|
<if test="describe != null">`describe`,</if> |
||||
|
<if test="useNum != null">use_num,</if> |
||||
|
<if test="lossRate != null">loss_rate,</if> |
||||
|
<if test="level != null">level,</if> |
||||
|
<if test="sortNo != null">sort_no,</if> |
||||
|
</trim> |
||||
|
<trim prefix="values (" suffix=")" suffixOverrides=","> |
||||
|
<if test="delFlag != null">#{delFlag},</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="remark != null">#{remark},</if> |
||||
|
<if test="makeNo != null">#{makeNo},</if> |
||||
|
<if test="salesOrderCode != null">#{salesOrderCode},</if> |
||||
|
<if test="salesOrderMaterialNo != null">#{salesOrderMaterialNo},</if> |
||||
|
<if test="bomNo != null">#{bomNo},</if> |
||||
|
<if test="materialNo != null">#{materialNo},</if> |
||||
|
<if test="photoUrl != null">#{photoUrl},</if> |
||||
|
<if test="materialName != null">#{materialName},</if> |
||||
|
<if test="materialType != null">#{materialType},</if> |
||||
|
<if test="processMethod != null">#{processMethod},</if> |
||||
|
<if test="unit != null">#{unit},</if> |
||||
|
<if test="brand != null">#{brand},</if> |
||||
|
<if test="describe != null">#{describe},</if> |
||||
|
<if test="useNum != null">#{useNum},</if> |
||||
|
<if test="lossRate != null">#{lossRate},</if> |
||||
|
<if test="level != null">#{level},</if> |
||||
|
<if test="sortNo != null">#{sortNo},</if> |
||||
|
</trim> |
||||
|
</insert> |
||||
|
|
||||
|
<update id="updateSysMakeorderBom" parameterType="SysMakeorderBom"> |
||||
|
update sys_makeorder_bom |
||||
|
<trim prefix="SET" suffixOverrides=","> |
||||
|
<if test="delFlag != null">del_flag = #{delFlag},</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="remark != null">remark = #{remark},</if> |
||||
|
<if test="makeNo != null">make_no = #{makeNo},</if> |
||||
|
<if test="salesOrderCode != null">sales_order_code = #{salesOrderCode},</if> |
||||
|
<if test="salesOrderMaterialNo != null">sales_order_material_no = #{salesOrderMaterialNo},</if> |
||||
|
<if test="bomNo != null">bom_no = #{bomNo},</if> |
||||
|
<if test="materialNo != null">material_no = #{materialNo},</if> |
||||
|
<if test="photoUrl != null">photoUrl = #{photoUrl},</if> |
||||
|
<if test="materialName != null">material_name = #{materialName},</if> |
||||
|
<if test="materialType != null">material_type = #{materialType},</if> |
||||
|
<if test="processMethod != null">process_method = #{processMethod},</if> |
||||
|
<if test="unit != null">unit = #{unit},</if> |
||||
|
<if test="brand != null">brand = #{brand},</if> |
||||
|
<if test="describe != null">`describe` = #{describe},</if> |
||||
|
<if test="useNum != null">use_num = #{useNum},</if> |
||||
|
<if test="lossRate != null">loss_rate = #{lossRate},</if> |
||||
|
<if test="level != null">level = #{level},</if> |
||||
|
<if test="sortNo != null">sort_no = #{sortNo},</if> |
||||
|
</trim> |
||||
|
where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<delete id="deleteSysMakeorderBomById" parameterType="Long"> |
||||
|
delete from sys_makeorder_bom where id = #{id} |
||||
|
</delete> |
||||
|
|
||||
|
<delete id="deleteSysMakeorderBomByIds" parameterType="String"> |
||||
|
delete from sys_makeorder_bom where id in |
||||
|
<foreach item="id" collection="array" open="(" separator="," close=")"> |
||||
|
#{id} |
||||
|
</foreach> |
||||
|
</delete> |
||||
|
|
||||
|
<update id="cancelSysMakeorderBomById" parameterType="Long"> |
||||
|
update sys_makeorder_bom set del_flag = '1' where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
<update id="restoreSysMakeorderBomById" parameterType="Long"> |
||||
|
update sys_makeorder_bom set del_flag = '0' where id = #{id} |
||||
|
</update> |
||||
|
|
||||
|
</mapper> |
Loading…
Reference in new issue