Browse Source

[update]:生产订单-工程审核通过生成BOM信息,领料单BOM信息来源取生成BOM信息

dev
youjianchi 7 months ago
parent
commit
82ff092c9c
  1. 2
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpBomService.java
  2. 6
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java
  3. 5
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  4. 151
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeorderBomController.java
  5. 24
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeorderPickDetailController.java
  6. 280
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java
  7. 141
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickDetail.java
  8. 77
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderBomMapper.java
  9. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java
  10. 75
      ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeorderBomService.java
  11. 54
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeOrderServiceImpl.java
  12. 126
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderBomServiceImpl.java
  13. 165
      ruoyi-admin/src/main/resources/mapper/system/SysMakeorderBomMapper.xml
  14. 38
      ruoyi-admin/src/main/resources/mapper/system/SysMakeorderPickDetailMapper.xml
  15. 28
      ruoyi-admin/src/main/resources/templates/system/makeorder/addpick.html
  16. 5
      ruoyi-admin/src/main/resources/templates/system/makeorder/gcsh.html
  17. 21
      ruoyi-admin/src/main/resources/templates/system/makeorderpick/detail.html
  18. 297
      ruoyi-admin/src/main/resources/templates/system/makeorderpick/taskScjlVerify.html
  19. 296
      ruoyi-admin/src/main/resources/templates/system/makeorderpick/taskSczgVerify.html

2
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpBomService.java

@ -101,4 +101,6 @@ public interface IErpBomService
String importData(List<ErpBomImportVo> bomImportVos,boolean updateSupport); String importData(List<ErpBomImportVo> bomImportVos,boolean updateSupport);
public ProcessInstance submitApply(ErpBom erpBom); public ProcessInstance submitApply(ErpBom erpBom);
ErpBom selectErpBomByOneMaterialNo(String materialNo);
} }

6
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpBomServiceImpl.java

@ -555,6 +555,12 @@ private ISysAttachService attachService;
erpBomMapper.updateErpBom(erpBom); erpBomMapper.updateErpBom(erpBom);
return processInstance; return processInstance;
} }
@Override
public ErpBom selectErpBomByOneMaterialNo(String materialNo) {
return erpBomMapper.selectErpBomByOneMaterialNo(materialNo);
}
@Override @Override
@Transactional(rollbackFor = Exception.class) @Transactional(rollbackFor = Exception.class)
public ProcessInstance cancelErpBomById(Long id) { public ProcessInstance cancelErpBomById(Long id) {

5
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java

@ -143,10 +143,7 @@ public class SysMakeOrderController extends BaseController
@PostMapping("/gcReview") @PostMapping("/gcReview")
@ResponseBody @ResponseBody
public AjaxResult gcReview(SysMakeOrder sysMakeOrder){ public AjaxResult gcReview(SysMakeOrder sysMakeOrder){
// 待生产 sysMakeOrderService.gcReview(sysMakeOrder);
sysMakeOrder.setMakeStatus("3");
sysMakeOrderService.updateByMakeNo(sysMakeOrder);
// todo 加工方式“采购”的物料生成采购计划
return AjaxResult.success("工程审核成功!"); return AjaxResult.success("工程审核成功!");
} }

151
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeorderBomController.java

@ -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));
}
}

24
ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeorderPickDetailController.java

@ -26,25 +26,25 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @date 2024-04-13 * @date 2024-04-13
*/ */
@Controller @Controller
@RequestMapping("/system/detail") @RequestMapping("/system/makeorderpickdetail")
public class SysMakeorderPickDetailController extends BaseController public class SysMakeorderPickDetailController extends BaseController
{ {
private String prefix = "system/detail"; private String prefix = "system/makeorderpickdetail";
@Autowired @Autowired
private ISysMakeorderPickDetailService sysMakeorderPickDetailService; private ISysMakeorderPickDetailService sysMakeorderPickDetailService;
@RequiresPermissions("system:detail:view") @RequiresPermissions("system:makeorderpickdetail:view")
@GetMapping() @GetMapping()
public String detail() public String makeorderpickdetail()
{ {
return prefix + "/detail"; return prefix + "/makeorderpickdetail";
} }
/** /**
* 查询生产订单领料明细列表 * 查询生产订单领料明细列表
*/ */
@RequiresPermissions("system:detail:list") // @RequiresPermissions("system:makeorderpickdetail:list")
@PostMapping("/list") @PostMapping("/list")
@ResponseBody @ResponseBody
public TableDataInfo list(SysMakeorderPickDetail sysMakeorderPickDetail) public TableDataInfo list(SysMakeorderPickDetail sysMakeorderPickDetail)
@ -57,7 +57,7 @@ public class SysMakeorderPickDetailController extends BaseController
/** /**
* 导出生产订单领料明细列表 * 导出生产订单领料明细列表
*/ */
@RequiresPermissions("system:detail:export") @RequiresPermissions("system:makeorderpickdetail:export")
@Log(title = "生产订单领料明细", businessType = BusinessType.EXPORT) @Log(title = "生产订单领料明细", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
@ResponseBody @ResponseBody
@ -80,7 +80,7 @@ public class SysMakeorderPickDetailController extends BaseController
/** /**
* 新增保存生产订单领料明细 * 新增保存生产订单领料明细
*/ */
@RequiresPermissions("system:detail:add") @RequiresPermissions("system:makeorderpickdetail:add")
@Log(title = "生产订单领料明细", businessType = BusinessType.INSERT) @Log(title = "生产订单领料明细", businessType = BusinessType.INSERT)
@PostMapping("/add") @PostMapping("/add")
@ResponseBody @ResponseBody
@ -103,7 +103,7 @@ public class SysMakeorderPickDetailController extends BaseController
/** /**
* 修改保存生产订单领料明细 * 修改保存生产订单领料明细
*/ */
@RequiresPermissions("system:detail:edit") @RequiresPermissions("system:makeorderpickdetail:edit")
@Log(title = "生产订单领料明细", businessType = BusinessType.UPDATE) @Log(title = "生产订单领料明细", businessType = BusinessType.UPDATE)
@PostMapping("/edit") @PostMapping("/edit")
@ResponseBody @ResponseBody
@ -115,7 +115,7 @@ public class SysMakeorderPickDetailController extends BaseController
/** /**
* 删除生产订单领料明细 * 删除生产订单领料明细
*/ */
@RequiresPermissions("system:detail:remove") @RequiresPermissions("system:makeorderpickdetail:remove")
@Log(title = "生产订单领料明细", businessType = BusinessType.DELETE) @Log(title = "生产订单领料明细", businessType = BusinessType.DELETE)
@PostMapping( "/remove") @PostMapping( "/remove")
@ResponseBody @ResponseBody
@ -127,7 +127,7 @@ public class SysMakeorderPickDetailController extends BaseController
/** /**
* 作废生产订单领料明细 * 作废生产订单领料明细
*/ */
@RequiresPermissions("system:detail:cancel") @RequiresPermissions("system:makeorderpickdetail:cancel")
@Log(title = "生产订单领料明细", businessType = BusinessType.CANCEL) @Log(title = "生产订单领料明细", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}") @GetMapping( "/cancel/{id}")
@ResponseBody @ResponseBody
@ -138,7 +138,7 @@ public class SysMakeorderPickDetailController extends BaseController
/** /**
* 恢复生产订单领料明细 * 恢复生产订单领料明细
*/ */
@RequiresPermissions("system:detail:restore") @RequiresPermissions("system:makeorderpickdetail:restore")
@Log(title = "生产订单领料明细", businessType = BusinessType.RESTORE) @Log(title = "生产订单领料明细", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}") @GetMapping( "/restore/{id}")
@ResponseBody @ResponseBody

280
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderBom.java

@ -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();
}
}

141
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysMakeorderPickDetail.java

@ -5,6 +5,8 @@ import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
/** /**
* 生产订单领料明细对象 sys_makeorder_pick_detail * 生产订单领料明细对象 sys_makeorder_pick_detail
* *
@ -34,13 +36,38 @@ public class SysMakeorderPickDetail extends BaseEntity
private String materialNo; private String materialNo;
/** bomid */ /** bomid */
@Excel(name = "bomid") @Excel(name = "makeorderBomId")
private Long bomId; private Long makeorderBomId;
/** 领料数量 */ /** 领料数量 */
@Excel(name = "领料数量") @Excel(name = "领料数量")
private Long pickNum; private Long pickNum;
/** bom号 */
private String bomNo;
/** bom的图片地址 */
private String photoUrl;
/** 物料名称 */
private String materialName;
/** 物料类型 */
private String materialType;
/** 加工方式 */
private String processMethod;
/** 单位 */
private String unit;
/** 品牌 */
private String brand;
/** 描述 */
private String describe;
/** 用量 */
private Long useNum;
/** 损耗率 */
private BigDecimal lossRate;
/** 层级 */
private Long level;
/** 排序 */
private Long sortNo;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -86,15 +113,15 @@ public class SysMakeorderPickDetail extends BaseEntity
{ {
return materialNo; return materialNo;
} }
public void setBomId(Long bomId)
{ public Long getMakeorderBomId() {
this.bomId = bomId; return makeorderBomId;
} }
public Long getBomId() public void setMakeorderBomId(Long makeorderBomId) {
{ this.makeorderBomId = makeorderBomId;
return bomId;
} }
public void setPickNum(Long pickNum) public void setPickNum(Long pickNum)
{ {
this.pickNum = pickNum; this.pickNum = pickNum;
@ -105,6 +132,102 @@ public class SysMakeorderPickDetail extends BaseEntity
return pickNum; return pickNum;
} }
public String getBomNo() {
return bomNo;
}
public void setBomNo(String bomNo) {
this.bomNo = bomNo;
}
public String getPhotoUrl() {
return photoUrl;
}
public void setPhotoUrl(String photoUrl) {
this.photoUrl = photoUrl;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getMaterialType() {
return materialType;
}
public void setMaterialType(String materialType) {
this.materialType = materialType;
}
public String getProcessMethod() {
return processMethod;
}
public void setProcessMethod(String processMethod) {
this.processMethod = processMethod;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getDescribe() {
return describe;
}
public void setDescribe(String describe) {
this.describe = describe;
}
public Long getUseNum() {
return useNum;
}
public void setUseNum(Long useNum) {
this.useNum = useNum;
}
public BigDecimal getLossRate() {
return lossRate;
}
public void setLossRate(BigDecimal lossRate) {
this.lossRate = lossRate;
}
public Long getLevel() {
return level;
}
public void setLevel(Long level) {
this.level = level;
}
public Long getSortNo() {
return sortNo;
}
public void setSortNo(Long sortNo) {
this.sortNo = sortNo;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -118,7 +241,7 @@ public class SysMakeorderPickDetail extends BaseEntity
.append("makeNo", getMakeNo()) .append("makeNo", getMakeNo())
.append("pickNo", getPickNo()) .append("pickNo", getPickNo())
.append("materialNo", getMaterialNo()) .append("materialNo", getMaterialNo())
.append("bomId", getBomId()) .append("makeorderBomId", getMakeorderBomId())
.append("pickNum", getPickNum()) .append("pickNum", getPickNum())
.toString(); .toString();
} }

77
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/SysMakeorderBomMapper.java

@ -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);
}

6
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeOrderService.java

@ -91,4 +91,10 @@ public interface ISysMakeOrderService
* @param salesOrderCode * @param salesOrderCode
*/ */
void generateMakeOrderBySalesOrderCode(String salesOrderCode); void generateMakeOrderBySalesOrderCode(String salesOrderCode);
/**
* 工程审核
* @param sysMakeOrder
*/
void gcReview(SysMakeOrder sysMakeOrder);
} }

75
ruoyi-admin/src/main/java/com/ruoyi/system/service/ISysMakeorderBomService.java

@ -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);
}

54
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeOrderServiceImpl.java

@ -5,16 +5,18 @@ import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.erp.domain.ErpBom;
import com.ruoyi.erp.service.IErpBomService;
import com.ruoyi.system.domain.SysMakeOrder; import com.ruoyi.system.domain.SysMakeOrder;
import com.ruoyi.system.domain.SysMakeorderBom;
import com.ruoyi.system.domain.SysSalesOrderChild; import com.ruoyi.system.domain.SysSalesOrderChild;
import com.ruoyi.system.domain.SysSalesOrderVo; import com.ruoyi.system.domain.SysSalesOrderVo;
import com.ruoyi.system.mapper.SysMakeOrderMapper; import com.ruoyi.system.mapper.SysMakeOrderMapper;
import com.ruoyi.system.service.ISysMakeOrderService; import com.ruoyi.system.service.*;
import com.ruoyi.system.service.ISysMakeorderDeptService; import org.springframework.beans.BeanUtils;
import com.ruoyi.system.service.ISysSalesOrderChildService;
import com.ruoyi.system.service.ISysSalesOrderService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List; import java.util.List;
@ -42,6 +44,12 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
@Autowired @Autowired
private ISysSalesOrderChildService salesOrderChildService; private ISysSalesOrderChildService salesOrderChildService;
@Autowired
private IErpBomService erpBomService;
@Autowired
private ISysMakeorderBomService makeorderBomService;
/** /**
* 查询生产订单 * 查询生产订单
* *
@ -199,4 +207,42 @@ public class SysMakeOrderServiceImpl implements ISysMakeOrderService
} }
} }
@Override
@Transactional(rollbackFor = Exception.class)
public void gcReview(SysMakeOrder sysMakeOrder) {
String makeNo = sysMakeOrder.getMakeNo();
// 待生产
sysMakeOrder.setMakeStatus("3");
updateByMakeNo(sysMakeOrder);
// 根据销售订单物料生成BOM
String saleNo = sysMakeOrder.getSaleNo();
List<SysSalesOrderChild> salesOrderChildList = salesOrderChildService.selectSysSalesOrderChildByQuoteId(saleNo);
if(CollectionUtil.isNotEmpty(salesOrderChildList)){
Long sortNo = 0L;
for (int i = 0; i < salesOrderChildList.size(); i++) {
SysSalesOrderChild sysSalesOrderChild = salesOrderChildList.get(i);
String materialCode = sysSalesOrderChild.getMaterialCode();
// 0阶
ErpBom erpBom = erpBomService.selectErpBomByOneMaterialNo(materialCode);
Long id = erpBom.getId();
// 查询1阶及以下
ErpBom oneLevelBom = new ErpBom();
oneLevelBom.setParentId(id);
List<ErpBom> subBomList = erpBomService.selectErpBomAllLevelList(oneLevelBom);
for (int j = 0; j < subBomList.size(); j++) {
ErpBom subBom = subBomList.get(j);
SysMakeorderBom orderBom = new SysMakeorderBom();
BeanUtils.copyProperties(subBom,orderBom, "id","delFlag","createBy","createTime","updateBy","updateTime","remark");
orderBom.setMakeNo(makeNo);
orderBom.setSalesOrderCode(saleNo);
orderBom.setSalesOrderMaterialNo(materialCode);
sortNo++;
orderBom.setSortNo(sortNo);
makeorderBomService.insertSysMakeorderBom(orderBom);
}
}
}
// todo 加工方式“采购”的物料生成采购计划
}
} }

126
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/SysMakeorderBomServiceImpl.java

@ -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);
}
}

165
ruoyi-admin/src/main/resources/mapper/system/SysMakeorderBomMapper.xml

@ -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>

38
ruoyi-admin/src/main/resources/mapper/system/SysMakeorderPickDetailMapper.xml

@ -15,22 +15,40 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="makeNo" column="make_no" /> <result property="makeNo" column="make_no" />
<result property="pickNo" column="pick_no" /> <result property="pickNo" column="pick_no" />
<result property="materialNo" column="material_no" /> <result property="materialNo" column="material_no" />
<result property="bomId" column="bom_id" /> <result property="makeorderBomId" column="makeorder_bom_id" />
<result property="pickNum" column="pick_num" /> <result property="pickNum" column="pick_num" />
<result property="bomNo" column="bom_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> </resultMap>
<sql id="selectSysMakeorderPickDetailVo"> <sql id="selectSysMakeorderPickDetailVo">
select id, del_flag, create_by, create_time, update_by, update_time, remark, make_no, pick_no, material_no, bom_id, pick_num from sys_makeorder_pick_detail select a.id, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark
, a.make_no, a.pick_no, a.material_no, a.makeorder_bom_id, a.pick_num
,b.bom_no,b.photoUrl,b.material_name,b.material_type,b.process_method,b.unit,b.brand
,b.describe,b.use_num,b.loss_rate,b.level,b.sort_no
from sys_makeorder_pick_detail a
left join sys_makeorder_bom b
on a.makeorder_bom_id = b.id
</sql> </sql>
<select id="selectSysMakeorderPickDetailList" parameterType="SysMakeorderPickDetail" resultMap="SysMakeorderPickDetailResult"> <select id="selectSysMakeorderPickDetailList" parameterType="SysMakeorderPickDetail" resultMap="SysMakeorderPickDetailResult">
<include refid="selectSysMakeorderPickDetailVo"/> <include refid="selectSysMakeorderPickDetailVo"/>
<where> <where>
<if test="makeNo != null and makeNo != ''"> and make_no = #{makeNo}</if> <if test="makeNo != null and makeNo != ''"> and a.make_no = #{makeNo}</if>
<if test="pickNo != null and pickNo != ''"> and pick_no = #{pickNo}</if> <if test="pickNo != null and pickNo != ''"> and a.pick_no = #{pickNo}</if>
<if test="materialNo != null and materialNo != ''"> and material_no = #{materialNo}</if> <if test="materialNo != null and materialNo != ''"> and a.material_no = #{materialNo}</if>
<if test="bomId != null "> and bom_id = #{bomId}</if> <if test="makeorderBomId != null "> and a.makeorder_bom_id = #{makeorderBomId}</if>
<if test="pickNum != null "> and pick_num = #{pickNum}</if> <if test="pickNum != null "> and a.pick_num = #{pickNum}</if>
</where> </where>
</select> </select>
@ -51,7 +69,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="makeNo != null">make_no,</if> <if test="makeNo != null">make_no,</if>
<if test="pickNo != null">pick_no,</if> <if test="pickNo != null">pick_no,</if>
<if test="materialNo != null">material_no,</if> <if test="materialNo != null">material_no,</if>
<if test="bomId != null">bom_id,</if> <if test="makeorderBomId != null">makeorder_bom_id,</if>
<if test="pickNum != null">pick_num,</if> <if test="pickNum != null">pick_num,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
@ -64,7 +82,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="makeNo != null">#{makeNo},</if> <if test="makeNo != null">#{makeNo},</if>
<if test="pickNo != null">#{pickNo},</if> <if test="pickNo != null">#{pickNo},</if>
<if test="materialNo != null">#{materialNo},</if> <if test="materialNo != null">#{materialNo},</if>
<if test="bomId != null">#{bomId},</if> <if test="makeorderBomId != null">#{makeorderBomId},</if>
<if test="pickNum != null">#{pickNum},</if> <if test="pickNum != null">#{pickNum},</if>
</trim> </trim>
</insert> </insert>
@ -81,7 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="makeNo != null">make_no = #{makeNo},</if> <if test="makeNo != null">make_no = #{makeNo},</if>
<if test="pickNo != null">pick_no = #{pickNo},</if> <if test="pickNo != null">pick_no = #{pickNo},</if>
<if test="materialNo != null">material_no = #{materialNo},</if> <if test="materialNo != null">material_no = #{materialNo},</if>
<if test="bomId != null">bom_id = #{bomId},</if> <if test="makeorderBomId != null">makeorder_bom_id = #{makeorderBomId},</if>
<if test="pickNum != null">pick_num = #{pickNum},</if> <if test="pickNum != null">pick_num = #{pickNum},</if>
</trim> </trim>
where id = #{id} where id = #{id}

28
ruoyi-admin/src/main/resources/templates/system/makeorder/addpick.html

@ -167,12 +167,14 @@
$detail.html('<table id="'+childTableId+'"></table>'); $detail.html('<table id="'+childTableId+'"></table>');
// BOM展示 // BOM展示
$('#'+childTableId).bootstrapTable({ $('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList", url: ctx + "system/makeorderbom/list",
method: 'post', method: 'post',
sidePagination: "server", sidePagination: "server",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
queryParams : { queryParams : {
parentId: parentRow.bomId makeNo: $("#makeNo").val(),
salesOrderCode: $("#saleNo").val(),
salesOrderMaterialNo: parentRow.materialCode
}, },
columns: [{ columns: [{
field: 'id', field: 'id',
@ -201,8 +203,8 @@
field: 'materialNo', field: 'materialNo',
title: '料号', title: '料号',
formatter: function (value,row,index){ formatter: function (value,row,index){
var curIndex = parentRowIndex*6+index; var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].bomId" value="'+row.id+'">'; return '<input readonly class = "form-control" data-id = "materialNo_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="pickDetails['+curIndex+'].makeorderBomId" value="'+row.id+'">';
} }
}, },
{ {
@ -304,13 +306,23 @@
field: 'pickNum', field: 'pickNum',
title: '本次领料数量', title: '本次领料数量',
formatter: function (value,row,index){ formatter: function (value,row,index){
var curIndex = parentRowIndex*6+index; var curIndex = row.sortNo-1;
return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">'; return '<input class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">';
} }
}, },
{ {
field: 'parentId', field: 'makeNo',
title: '父级id', title: '生产订单号',
visible: false,
},
{
field: 'salesOrderCode',
title: '销售订单号',
visible: false,
},
{
field: 'salesOrderMaterialNo',
title: '销售订单料号',
visible: false, visible: false,
}, },
{ {
@ -346,7 +358,7 @@
function submitHandler() { function submitHandler() {
debugger debugger
var data = $("#form-makeorder-edit").serializeArray(); var data = $("#form-makeorder-edit").serializeArray();
alert(data); alert(JSON.stringify(data));
$.operate.save(ctx + "system/makeorderpick/add", data); $.operate.save(ctx + "system/makeorderpick/add", data);
} }

5
ruoyi-admin/src/main/resources/templates/system/makeorder/gcsh.html

@ -490,7 +490,10 @@
function submitHandler() { function submitHandler() {
debugger debugger
// var data = $("#form-makeorder-edit").serializeArray(); // var data = $("#form-makeorder-edit").serializeArray();
var data = {makeNo:$("#makeNo").val()}; var data = {
makeNo:$("#makeNo").val(),
saleNo:$("#saleNo").val()
};
$.operate.save(prefix + "/gcReview", data); $.operate.save(prefix + "/gcReview", data);
} }

21
ruoyi-admin/src/main/resources/templates/system/makeorderpick/detail.html

@ -11,7 +11,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label> <label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" readonly> <input id="makeNo" name="makeNo" th:field="*{makeNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -23,7 +23,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">生产领料单号:</label> <label class="col-sm-3 control-label">生产领料单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="pickNo" th:field="*{pickNo}" class="form-control" type="text" readonly> <input id="pickNo" name="pickNo" th:field="*{pickNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -160,12 +160,12 @@
$detail.html('<table id="'+childTableId+'"></table>'); $detail.html('<table id="'+childTableId+'"></table>');
// BOM展示 // BOM展示
$('#'+childTableId).bootstrapTable({ $('#'+childTableId).bootstrapTable({
url: ctx + "erp/bom/allLevelList", url: ctx + "system/makeorderpickdetail/list",
method: 'post', method: 'post',
sidePagination: "server", sidePagination: "server",
contentType: "application/x-www-form-urlencoded", contentType: "application/x-www-form-urlencoded",
queryParams : { queryParams : {
parentId: parentRow.bomId pickNo: $("#pickNo").val()
}, },
columns: [{ columns: [{
field: 'id', field: 'id',
@ -194,8 +194,8 @@
field: 'materialNo', field: 'materialNo',
title: '料号', title: '料号',
formatter: function (value,row,index){ formatter: function (value,row,index){
var curIndex = parentRowIndex*6+index; var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].bomId" value="'+row.id+'">'; return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="pickDetails['+curIndex+'].makeorderBomId" value="'+row.id+'">';
} }
}, },
{ {
@ -297,15 +297,10 @@
field: 'pickNum', field: 'pickNum',
title: '本次领料数量', title: '本次领料数量',
formatter: function (value,row,index){ formatter: function (value,row,index){
var curIndex = parentRowIndex*6+index; var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum">'; return '<input readonly class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum" value="'+value+'">';
} }
}, },
{
field: 'parentId',
title: '父级id',
visible: false,
},
{ {
field: 'sortNo', field: 'sortNo',
title: '排序', title: '排序',

297
ruoyi-admin/src/main/resources/templates/system/makeorderpick/taskScjlVerify.html

@ -34,19 +34,19 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label> <label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" readonly> <input id="makeNo" name="makeNo" th:field="*{makeNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label> <label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="saleNo" th:field="*{saleNo}" class="form-control" type="text" readonly> <input id="saleNo" name="saleNo" th:field="*{saleNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">生产领料单号:</label> <label class="col-sm-3 control-label">生产领料单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="pickNo" th:field="*{pickNo}" class="form-control" type="text" readonly> <input id="pickNo" name="pickNo" th:field="*{pickNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -57,7 +57,11 @@
</div> </div>
</div> </div>
<!--缺订单类型--> <!--缺订单类型-->
<!--缺表格--> <div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
<hr /> <hr />
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label" for="scjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> <label class="col-sm-3 control-label" for="scjlVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
@ -81,6 +85,291 @@
<th:block th:include="include :: datetimepicker-js" /> <th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "system/makeorderpick"; var prefix = ctx + "system/makeorderpick";
// 字典
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$(function(){
var options = {
url: ctx + "system/orderChild/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: queryParams,
detailView: true,
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
/*onCollapseRow: function(index, row){
var childTableFormId = 'child_table_form_'+index;
var formData = $('#'+childTableFormId).serialize();
var formObj = $.common.formDataToObj(formData);
subTableFormArray.push(formObj);
},*/
columns: [
{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'quoteId',
title: '关联销售订单编号',
visible: false
},
{
field: 'bomId',
title: 'bom主键Id',
visible: false
},
{
field: 'materialCode',
align: 'center',
title: '料号'
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{
field: 'brand',
align: 'center',
title: '品牌'
},
{
field: 'describe',
align: 'center',
title: '描述'
},
{
field: 'processMethod',
align: 'center',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'deliveryTime',
align: 'center',
title: '客户期望交付时间'
},
{
field: 'materialNum',
align: 'center',
title: '订单数量'
}
]
};
$.table.init(options);
})
initChildTable = function(index, row, $detail) {
var parentRow = row;
var parentRowIndex = index;
var childTableId = 'child_table_'+index;
var childFormTableId = 'child_form_table_'+index;
var childTableFormId = 'child_table_form_'+index;
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>');
$detail.html('<table id="'+childTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "system/makeorderpickdetail/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
pickNo: $("#pickNo").val()
},
columns: [{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'level',
title: '阶层',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialNo',
title: '料号',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="pickDetails['+curIndex+'].makeorderBomId" value="'+row.id+'">';
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialName',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'brand',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'unit',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'processMethod',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'lossRate',
title: '损耗率',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value + "%";
}
}
},
{
field: 'materialNum',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
}
},
{
field: 'pickNum',
title: '本次领料数量',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum" value="'+value+'">';
}
},
{
field: 'sortNo',
title: '排序',
visible: false
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
},
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
return curParams;
}
$("#form-makeorderpick-edit").validate({ $("#form-makeorderpick-edit").validate({
focusCleanup: true focusCleanup: true
}); });

296
ruoyi-admin/src/main/resources/templates/system/makeorderpick/taskSczgVerify.html

@ -34,19 +34,19 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label> <label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text" readonly> <input id="makeNo" name="makeNo" th:field="*{makeNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label> <label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="saleNo" th:field="*{saleNo}" class="form-control" type="text" readonly> <input id="saleNo" name="saleNo" th:field="*{saleNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">生产领料单号:</label> <label class="col-sm-3 control-label">生产领料单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="pickNo" th:field="*{pickNo}" class="form-control" type="text" readonly> <input id="pickNo" name="pickNo" th:field="*{pickNo}" class="form-control" type="text" readonly>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -57,7 +57,11 @@
</div> </div>
</div> </div>
<!--缺订单类型--> <!--缺订单类型-->
<!--缺表格--> <div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
<hr /> <hr />
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label" for="sczgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label> <label class="col-sm-3 control-label" for="sczgVerifyApproved"><span style="color: red; ">*</span>审批意见:</label>
@ -81,6 +85,290 @@
<th:block th:include="include :: datetimepicker-js" /> <th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "system/makeorderpick"; var prefix = ctx + "system/makeorderpick";
// 字典
var processMethodDatas = [[${@dict.getType('processMethod')}]];
var sysUnitClassDatas = [[${@dict.getType('sys_unit_class')}]];
var materialTypeDatas = [[${@category.getChildByCode('materialType')}]];
var levelDatas = [[${@dict.getType('bomLevel')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$(function(){
var options = {
url: ctx + "system/orderChild/list",
id: 'bootstrap-sub-table-1',
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
uniqueId: "id",
pagination: false, // 设置不分页
sidePagination: "client",
queryParams: queryParams,
detailView: true,
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
/*onCollapseRow: function(index, row){
var childTableFormId = 'child_table_form_'+index;
var formData = $('#'+childTableFormId).serialize();
var formObj = $.common.formDataToObj(formData);
subTableFormArray.push(formObj);
},*/
columns: [
{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'quoteId',
title: '关联销售订单编号',
visible: false
},
{
field: 'bomId',
title: 'bom主键Id',
visible: false
},
{
field: 'materialCode',
align: 'center',
title: '料号'
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function(value, row, index) {
return $.table.selectDictLabel(sysUnitClassDatas, value);
}
},
{
field: 'brand',
align: 'center',
title: '品牌'
},
{
field: 'describe',
align: 'center',
title: '描述'
},
{
field: 'processMethod',
align: 'center',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'deliveryTime',
align: 'center',
title: '客户期望交付时间'
},
{
field: 'materialNum',
align: 'center',
title: '订单数量'
}
]
};
$.table.init(options);
})
initChildTable = function(index, row, $detail) {
var parentRow = row;
var parentRowIndex = index;
var childTableId = 'child_table_'+index;
var childFormTableId = 'child_form_table_'+index;
var childTableFormId = 'child_table_form_'+index;
// $detail.html('<form id="'+childTableFormId+'"><table id="'+childTableId+'"></table><table id="'+childFormTableId+'"></table></form>');
$detail.html('<table id="'+childTableId+'"></table>');
// BOM展示
$('#'+childTableId).bootstrapTable({
url: ctx + "system/makeorderpickdetail/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
pickNo: $("#pickNo").val()
},
columns: [{
field: 'id',
title: '主键id',
visible: false
},
{
field: 'level',
title: '阶层',
formatter: function(value, row, index) {
return $.table.selectDictLabel(levelDatas, value);
}
},
{
field: 'bomNo',
title: 'BOM号',
formatter:function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialNo',
title: '料号',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "id_'+curIndex+'" name="pickDetails['+curIndex+'].materialNo" value="'+value+'"><input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="pickDetails['+curIndex+'].makeorderBomId" value="'+row.id+'">';
}
},
{
field: 'photoUrl',
title: '图片',
formatter: function(value, row, index) {
return $.table.imageView(value);
}
},
{
field: 'materialName',
title: '物料名称',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'materialType',
title: '物料类型',
formatter: function(value, row, index) {
return $.table.selectCategoryLabel(materialTypeDatas, value);
}
},
{
field: 'describe',
title: '描述',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'brand',
title: '品牌',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'unit',
title: '单位',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'processMethod',
title: '加工方式',
formatter: function(value, row, index) {
return $.table.selectDictLabel(processMethodDatas, value);
}
},
{
field: 'useNum',
title: '用量',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value
}
}
},
{
field: 'lossRate',
title: '损耗率',
formatter: function (value,row,index){
if (value == null || value == ''){
return '/';
}else{
return value + "%";
}
}
},
{
field: 'materialNum',
title: '订单用量',
formatter: function (value,row,index){
return parentRow.materialNum * row.useNum;
}
},
{
field: 'pickNum',
title: '本次领料数量',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input readonly class = "form-control" data-id = "pickNum_'+curIndex+'" name="pickDetails['+curIndex+'].pickNum" value="'+value+'">';
}
},
{
field: 'sortNo',
title: '排序',
visible: false
}],
// 当所有数据被加载时触发
onLoadSuccess: function(data) {
},
});
};
function queryParams(params) {
var curParams = {
// 传递参数查询参数
// pageSize: params.limit,
// pageNum: params.offset / params.limit + 1,
// searchValue: params.search,
// orderByColumn: params.sort,
// isAsc: params.order
};
// 额外传参
curParams.quoteId = $("#saleNo").val();
return curParams;
}
$("#form-makeorderpick-edit").validate({ $("#form-makeorderpick-edit").validate({
focusCleanup: true focusCleanup: true
}); });

Loading…
Cancel
Save