Browse Source

[update]:生产订单-添加委内入库、生产入库

dev
youjianchi 5 months ago
parent
commit
9730eed7f5
  1. 151
      ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java
  2. 151
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrder.java
  3. 140
      ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrderDetail.java
  4. 78
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpInboundOrderDetailMapper.java
  5. 77
      ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpInboundOrderMapper.java
  6. 76
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpInboundOrderDetailService.java
  7. 75
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpInboundOrderService.java
  8. 127
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderDetailServiceImpl.java
  9. 154
      ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderServiceImpl.java
  10. 24
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/SysMakeOrderController.java
  11. 114
      ruoyi-admin/src/main/resources/mapper/erp/ErpInboundOrderDetailMapper.xml
  12. 114
      ruoyi-admin/src/main/resources/mapper/erp/ErpInboundOrderMapper.xml
  13. 77
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/add.html
  14. 72
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/edit.html
  15. 153
      ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html
  16. 381
      ruoyi-admin/src/main/resources/templates/system/makeorder/addProcessInbound.html
  17. 373
      ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html
  18. 10
      ruoyi-admin/src/main/resources/templates/system/makeorder/makeorder.html

151
ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpInboundOrderController.java

@ -0,0 +1,151 @@
package com.ruoyi.erp.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.erp.domain.ErpInboundOrder;
import com.ruoyi.erp.service.IErpInboundOrderService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 入库单Controller
*
* @author ruoyi
* @date 2024-04-24
*/
@Controller
@RequestMapping("/erp/inboundOrder")
public class ErpInboundOrderController extends BaseController
{
private String prefix = "erp/inboundOrder";
@Autowired
private IErpInboundOrderService erpInboundOrderService;
@RequiresPermissions("erp:inboundOrder:view")
@GetMapping()
public String inboundOrder()
{
return prefix + "/inboundOrder";
}
/**
* 查询入库单列表
*/
@RequiresPermissions("erp:inboundOrder:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(ErpInboundOrder erpInboundOrder)
{
startPage();
List<ErpInboundOrder> list = erpInboundOrderService.selectErpInboundOrderList(erpInboundOrder);
return getDataTable(list);
}
/**
* 导出入库单列表
*/
@RequiresPermissions("erp:inboundOrder:export")
@Log(title = "入库单", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(ErpInboundOrder erpInboundOrder)
{
List<ErpInboundOrder> list = erpInboundOrderService.selectErpInboundOrderList(erpInboundOrder);
ExcelUtil<ErpInboundOrder> util = new ExcelUtil<ErpInboundOrder>(ErpInboundOrder.class);
return util.exportExcel(list, "入库单数据");
}
/**
* 新增入库单
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存入库单
*/
@RequiresPermissions("erp:inboundOrder:add")
@Log(title = "入库单", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(ErpInboundOrder erpInboundOrder)
{
return toAjax(erpInboundOrderService.insertErpInboundOrder(erpInboundOrder));
}
/**
* 修改入库单
*/
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
ErpInboundOrder erpInboundOrder = erpInboundOrderService.selectErpInboundOrderById(id);
mmap.put("erpInboundOrder", erpInboundOrder);
return prefix + "/edit";
}
/**
* 修改保存入库单
*/
@RequiresPermissions("erp:inboundOrder:edit")
@Log(title = "入库单", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(ErpInboundOrder erpInboundOrder)
{
return toAjax(erpInboundOrderService.updateErpInboundOrder(erpInboundOrder));
}
/**
* 删除入库单
*/
@RequiresPermissions("erp:inboundOrder:remove")
@Log(title = "入库单", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(erpInboundOrderService.deleteErpInboundOrderByIds(ids));
}
/**
* 作废入库单
*/
@RequiresPermissions("erp:inboundOrder:cancel")
@Log(title = "入库单", businessType = BusinessType.CANCEL)
@GetMapping( "/cancel/{id}")
@ResponseBody
public AjaxResult cancel(@PathVariable("id") Long id){
return toAjax(erpInboundOrderService.cancelErpInboundOrderById(id));
}
/**
* 恢复入库单
*/
@RequiresPermissions("erp:inboundOrder:restore")
@Log(title = "入库单", businessType = BusinessType.RESTORE)
@GetMapping( "/restore/{id}")
@ResponseBody
public AjaxResult restore(@PathVariable("id")Long id)
{
return toAjax(erpInboundOrderService.restoreErpInboundOrderById(id));
}
}

151
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrder.java

@ -0,0 +1,151 @@
package com.ruoyi.erp.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.List;
/**
* 入库单对象 erp_inbound_order
*
* @author ruoyi
* @date 2024-04-24
*/
public class ErpInboundOrder 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 saleNo;
/** 入库单号 */
@Excel(name = "入库单号")
private String inboundOrderNo;
/** 入库状态 */
@Excel(name = "入库状态")
private String inboundStatus;
/** 入库类型 */
@Excel(name = "入库类型")
private String inboundType;
/** 入库数 */
@Excel(name = "入库数")
private Long inboundNum;
private List<ErpInboundOrderDetail> inboundDetails;
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 setSaleNo(String saleNo)
{
this.saleNo = saleNo;
}
public String getSaleNo()
{
return saleNo;
}
public void setInboundOrderNo(String inboundOrderNo)
{
this.inboundOrderNo = inboundOrderNo;
}
public String getInboundOrderNo()
{
return inboundOrderNo;
}
public void setInboundStatus(String inboundStatus)
{
this.inboundStatus = inboundStatus;
}
public String getInboundStatus()
{
return inboundStatus;
}
public void setInboundType(String inboundType)
{
this.inboundType = inboundType;
}
public String getInboundType()
{
return inboundType;
}
public void setInboundNum(Long inboundNum)
{
this.inboundNum = inboundNum;
}
public Long getInboundNum()
{
return inboundNum;
}
public List<ErpInboundOrderDetail> getInboundDetails() {
return inboundDetails;
}
public void setInboundDetails(List<ErpInboundOrderDetail> inboundDetails) {
this.inboundDetails = inboundDetails;
}
@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("saleNo", getSaleNo())
.append("inboundOrderNo", getInboundOrderNo())
.append("inboundStatus", getInboundStatus())
.append("inboundType", getInboundType())
.append("inboundNum", getInboundNum())
.toString();
}
}

140
ruoyi-admin/src/main/java/com/ruoyi/erp/domain/ErpInboundOrderDetail.java

@ -0,0 +1,140 @@
package com.ruoyi.erp.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;
/**
* 入库单明细对象 erp_inbound_order_detail
*
* @author ruoyi
* @date 2024-04-24
*/
public class ErpInboundOrderDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键ID */
private Long id;
/** 删除标志(0代表存在 1代表删除) */
private String delFlag;
/** 入库单号 */
@Excel(name = "入库单号")
private String inboundOrderNo;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
/** 生产订单bomid */
@Excel(name = "生产订单bomid")
private Long makeorderBomId;
/** 已完成数 */
@Excel(name = "已完成数")
private Long completedNum;
/** 本次完成数 */
@Excel(name = "本次完成数")
private Long currentNum;
/** 加工费单价 */
@Excel(name = "加工费单价")
private BigDecimal processFeeUnitPrice;
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 setInboundOrderNo(String inboundOrderNo)
{
this.inboundOrderNo = inboundOrderNo;
}
public String getInboundOrderNo()
{
return inboundOrderNo;
}
public void setMaterialNo(String materialNo)
{
this.materialNo = materialNo;
}
public String getMaterialNo()
{
return materialNo;
}
public void setMakeorderBomId(Long makeorderBomId)
{
this.makeorderBomId = makeorderBomId;
}
public Long getMakeorderBomId()
{
return makeorderBomId;
}
public void setCompletedNum(Long completedNum)
{
this.completedNum = completedNum;
}
public Long getCompletedNum()
{
return completedNum;
}
public void setCurrentNum(Long currentNum)
{
this.currentNum = currentNum;
}
public Long getCurrentNum()
{
return currentNum;
}
public void setProcessFeeUnitPrice(BigDecimal processFeeUnitPrice)
{
this.processFeeUnitPrice = processFeeUnitPrice;
}
public BigDecimal getProcessFeeUnitPrice()
{
return processFeeUnitPrice;
}
@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("inboundOrderNo", getInboundOrderNo())
.append("materialNo", getMaterialNo())
.append("makeorderBomId", getMakeorderBomId())
.append("completedNum", getCompletedNum())
.append("currentNum", getCurrentNum())
.append("processFeeUnitPrice", getProcessFeeUnitPrice())
.toString();
}
}

78
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpInboundOrderDetailMapper.java

@ -0,0 +1,78 @@
package com.ruoyi.erp.mapper;
import com.ruoyi.erp.domain.ErpInboundOrderDetail;
import java.util.List;
/**
* 入库单明细Mapper接口
*
* @author ruoyi
* @date 2024-04-24
*/
public interface ErpInboundOrderDetailMapper
{
/**
* 查询入库单明细
*
* @param id 入库单明细ID
* @return 入库单明细
*/
public ErpInboundOrderDetail selectErpInboundOrderDetailById(Long id);
/**
* 查询入库单明细列表
*
* @param erpInboundOrderDetail 入库单明细
* @return 入库单明细集合
*/
public List<ErpInboundOrderDetail> selectErpInboundOrderDetailList(ErpInboundOrderDetail erpInboundOrderDetail);
/**
* 新增入库单明细
*
* @param erpInboundOrderDetail 入库单明细
* @return 结果
*/
public int insertErpInboundOrderDetail(ErpInboundOrderDetail erpInboundOrderDetail);
/**
* 修改入库单明细
*
* @param erpInboundOrderDetail 入库单明细
* @return 结果
*/
public int updateErpInboundOrderDetail(ErpInboundOrderDetail erpInboundOrderDetail);
/**
* 删除入库单明细
*
* @param id 入库单明细ID
* @return 结果
*/
public int deleteErpInboundOrderDetailById(Long id);
/**
* 批量删除入库单明细
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteErpInboundOrderDetailByIds(String[] ids);
/**
* 作废入库单明细
*
* @param id 入库单明细ID
* @return 结果
*/
public int cancelErpInboundOrderDetailById(Long id);
/**
* 恢复入库单明细
*
* @param id 入库单明细ID
* @return 结果
*/
public int restoreErpInboundOrderDetailById(Long id);
}

77
ruoyi-admin/src/main/java/com/ruoyi/erp/mapper/ErpInboundOrderMapper.java

@ -0,0 +1,77 @@
package com.ruoyi.erp.mapper;
import java.util.List;
import com.ruoyi.erp.domain.ErpInboundOrder;
/**
* 入库单Mapper接口
*
* @author ruoyi
* @date 2024-04-24
*/
public interface ErpInboundOrderMapper
{
/**
* 查询入库单
*
* @param id 入库单ID
* @return 入库单
*/
public ErpInboundOrder selectErpInboundOrderById(Long id);
/**
* 查询入库单列表
*
* @param erpInboundOrder 入库单
* @return 入库单集合
*/
public List<ErpInboundOrder> selectErpInboundOrderList(ErpInboundOrder erpInboundOrder);
/**
* 新增入库单
*
* @param erpInboundOrder 入库单
* @return 结果
*/
public int insertErpInboundOrder(ErpInboundOrder erpInboundOrder);
/**
* 修改入库单
*
* @param erpInboundOrder 入库单
* @return 结果
*/
public int updateErpInboundOrder(ErpInboundOrder erpInboundOrder);
/**
* 删除入库单
*
* @param id 入库单ID
* @return 结果
*/
public int deleteErpInboundOrderById(Long id);
/**
* 批量删除入库单
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteErpInboundOrderByIds(String[] ids);
/**
* 作废入库单
*
* @param id 入库单ID
* @return 结果
*/
public int cancelErpInboundOrderById(Long id);
/**
* 恢复入库单
*
* @param id 入库单ID
* @return 结果
*/
public int restoreErpInboundOrderById(Long id);
}

76
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpInboundOrderDetailService.java

@ -0,0 +1,76 @@
package com.ruoyi.erp.service;
import com.ruoyi.erp.domain.ErpInboundOrderDetail;
import java.util.List;
/**
* 入库单明细Service接口
*
* @author ruoyi
* @date 2024-04-24
*/
public interface IErpInboundOrderDetailService
{
/**
* 查询入库单明细
*
* @param id 入库单明细ID
* @return 入库单明细
*/
public ErpInboundOrderDetail selectErpInboundOrderDetailById(Long id);
/**
* 查询入库单明细列表
*
* @param erpInboundOrderDetail 入库单明细
* @return 入库单明细集合
*/
public List<ErpInboundOrderDetail> selectErpInboundOrderDetailList(ErpInboundOrderDetail erpInboundOrderDetail);
/**
* 新增入库单明细
*
* @param erpInboundOrderDetail 入库单明细
* @return 结果
*/
public int insertErpInboundOrderDetail(ErpInboundOrderDetail erpInboundOrderDetail);
/**
* 修改入库单明细
*
* @param erpInboundOrderDetail 入库单明细
* @return 结果
*/
public int updateErpInboundOrderDetail(ErpInboundOrderDetail erpInboundOrderDetail);
/**
* 批量删除入库单明细
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteErpInboundOrderDetailByIds(String ids);
/**
* 删除入库单明细信息
*
* @param id 入库单明细ID
* @return 结果
*/
public int deleteErpInboundOrderDetailById(Long id);
/**
* 作废入库单明细
* @param id 入库单明细ID
* @return
*/
int cancelErpInboundOrderDetailById(Long id);
/**
* 恢复入库单明细
* @param id 入库单明细ID
* @return
*/
int restoreErpInboundOrderDetailById(Long id);
}

75
ruoyi-admin/src/main/java/com/ruoyi/erp/service/IErpInboundOrderService.java

@ -0,0 +1,75 @@
package com.ruoyi.erp.service;
import java.util.List;
import com.ruoyi.erp.domain.ErpInboundOrder;
/**
* 入库单Service接口
*
* @author ruoyi
* @date 2024-04-24
*/
public interface IErpInboundOrderService
{
/**
* 查询入库单
*
* @param id 入库单ID
* @return 入库单
*/
public ErpInboundOrder selectErpInboundOrderById(Long id);
/**
* 查询入库单列表
*
* @param erpInboundOrder 入库单
* @return 入库单集合
*/
public List<ErpInboundOrder> selectErpInboundOrderList(ErpInboundOrder erpInboundOrder);
/**
* 新增入库单
*
* @param erpInboundOrder 入库单
* @return 结果
*/
public int insertErpInboundOrder(ErpInboundOrder erpInboundOrder);
/**
* 修改入库单
*
* @param erpInboundOrder 入库单
* @return 结果
*/
public int updateErpInboundOrder(ErpInboundOrder erpInboundOrder);
/**
* 批量删除入库单
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteErpInboundOrderByIds(String ids);
/**
* 删除入库单信息
*
* @param id 入库单ID
* @return 结果
*/
public int deleteErpInboundOrderById(Long id);
/**
* 作废入库单
* @param id 入库单ID
* @return
*/
int cancelErpInboundOrderById(Long id);
/**
* 恢复入库单
* @param id 入库单ID
* @return
*/
int restoreErpInboundOrderById(Long id);
}

127
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderDetailServiceImpl.java

@ -0,0 +1,127 @@
package com.ruoyi.erp.service.impl;
import com.ruoyi.common.core.text.Convert;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.erp.domain.ErpInboundOrderDetail;
import com.ruoyi.erp.mapper.ErpInboundOrderDetailMapper;
import com.ruoyi.erp.service.IErpInboundOrderDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* 入库单明细Service业务层处理
*
* @author ruoyi
* @date 2024-04-24
*/
@Service
public class ErpInboundOrderDetailServiceImpl implements IErpInboundOrderDetailService
{
@Autowired
private ErpInboundOrderDetailMapper erpInboundOrderDetailMapper;
/**
* 查询入库单明细
*
* @param id 入库单明细ID
* @return 入库单明细
*/
@Override
public ErpInboundOrderDetail selectErpInboundOrderDetailById(Long id)
{
return erpInboundOrderDetailMapper.selectErpInboundOrderDetailById(id);
}
/**
* 查询入库单明细列表
*
* @param erpInboundOrderDetail 入库单明细
* @return 入库单明细
*/
@Override
public List<ErpInboundOrderDetail> selectErpInboundOrderDetailList(ErpInboundOrderDetail erpInboundOrderDetail)
{
return erpInboundOrderDetailMapper.selectErpInboundOrderDetailList(erpInboundOrderDetail);
}
/**
* 新增入库单明细
*
* @param erpInboundOrderDetail 入库单明细
* @return 结果
*/
@Override
public int insertErpInboundOrderDetail(ErpInboundOrderDetail erpInboundOrderDetail)
{
String loginName = ShiroUtils.getLoginName();
erpInboundOrderDetail.setCreateBy(loginName);
erpInboundOrderDetail.setCreateTime(DateUtils.getNowDate());
return erpInboundOrderDetailMapper.insertErpInboundOrderDetail(erpInboundOrderDetail);
}
/**
* 修改入库单明细
*
* @param erpInboundOrderDetail 入库单明细
* @return 结果
*/
@Override
public int updateErpInboundOrderDetail(ErpInboundOrderDetail erpInboundOrderDetail)
{
String loginName = ShiroUtils.getLoginName();
erpInboundOrderDetail.setUpdateBy(loginName);
erpInboundOrderDetail.setUpdateTime(DateUtils.getNowDate());
return erpInboundOrderDetailMapper.updateErpInboundOrderDetail(erpInboundOrderDetail);
}
/**
* 删除入库单明细对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteErpInboundOrderDetailByIds(String ids)
{
return erpInboundOrderDetailMapper.deleteErpInboundOrderDetailByIds(Convert.toStrArray(ids));
}
/**
* 删除入库单明细信息
*
* @param id 入库单明细ID
* @return 结果
*/
@Override
public int deleteErpInboundOrderDetailById(Long id)
{
return erpInboundOrderDetailMapper.deleteErpInboundOrderDetailById(id);
}
/**
* 作废入库单明细
*
* @param id 入库单明细ID
* @return 结果
*/
@Override
public int cancelErpInboundOrderDetailById(Long id)
{
return erpInboundOrderDetailMapper.cancelErpInboundOrderDetailById(id);
}
/**
* 恢复入库单明细信息
*
* @param id 入库单明细ID
* @return 结果
*/
@Override
public int restoreErpInboundOrderDetailById(Long id)
{
return erpInboundOrderDetailMapper.restoreErpInboundOrderDetailById(id);
}
}

154
ruoyi-admin/src/main/java/com/ruoyi/erp/service/impl/ErpInboundOrderServiceImpl.java

@ -0,0 +1,154 @@
package com.ruoyi.erp.service.impl;
import java.util.List;
import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.common.core.redis.RedisCache;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.erp.domain.ErpInboundOrderDetail;
import com.ruoyi.erp.service.IErpInboundOrderDetailService;
import com.ruoyi.system.domain.SysMakeorderPickDetail;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.erp.mapper.ErpInboundOrderMapper;
import com.ruoyi.erp.domain.ErpInboundOrder;
import com.ruoyi.erp.service.IErpInboundOrderService;
import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/**
* 入库单Service业务层处理
*
* @author ruoyi
* @date 2024-04-24
*/
@Service
public class ErpInboundOrderServiceImpl implements IErpInboundOrderService
{
@Autowired
private ErpInboundOrderMapper erpInboundOrderMapper;
@Autowired
private RedisCache redisCache;
@Autowired
private IErpInboundOrderDetailService inboundOrderDetailService;
/**
* 查询入库单
*
* @param id 入库单ID
* @return 入库单
*/
@Override
public ErpInboundOrder selectErpInboundOrderById(Long id)
{
return erpInboundOrderMapper.selectErpInboundOrderById(id);
}
/**
* 查询入库单列表
*
* @param erpInboundOrder 入库单
* @return 入库单
*/
@Override
public List<ErpInboundOrder> selectErpInboundOrderList(ErpInboundOrder erpInboundOrder)
{
return erpInboundOrderMapper.selectErpInboundOrderList(erpInboundOrder);
}
/**
* 新增入库单
*
* @param erpInboundOrder 入库单
* @return 结果
*/
@Override
@Transactional(rollbackFor = Exception.class)
public int insertErpInboundOrder(ErpInboundOrder erpInboundOrder)
{
String loginName = ShiroUtils.getLoginName();
erpInboundOrder.setCreateBy(loginName);
erpInboundOrder.setCreateTime(DateUtils.getNowDate());
// 生成编号,年月日规则
String billNo = redisCache.generateBillNo("RK");
erpInboundOrder.setInboundOrderNo(billNo);
int id = erpInboundOrderMapper.insertErpInboundOrder(erpInboundOrder);
List<ErpInboundOrderDetail> inboundDetails = erpInboundOrder.getInboundDetails();
if(CollectionUtil.isNotEmpty(inboundDetails)){
// 插入子表
for (int i = 0; i < inboundDetails.size(); i++) {
ErpInboundOrderDetail inboundOrderDetail = inboundDetails.get(i);
inboundOrderDetail.setInboundOrderNo(billNo);
inboundOrderDetailService.insertErpInboundOrderDetail(inboundOrderDetail);
}
}
return id;
}
/**
* 修改入库单
*
* @param erpInboundOrder 入库单
* @return 结果
*/
@Override
public int updateErpInboundOrder(ErpInboundOrder erpInboundOrder)
{
String loginName = ShiroUtils.getLoginName();
erpInboundOrder.setUpdateBy(loginName);
erpInboundOrder.setUpdateTime(DateUtils.getNowDate());
return erpInboundOrderMapper.updateErpInboundOrder(erpInboundOrder);
}
/**
* 删除入库单对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteErpInboundOrderByIds(String ids)
{
return erpInboundOrderMapper.deleteErpInboundOrderByIds(Convert.toStrArray(ids));
}
/**
* 删除入库单信息
*
* @param id 入库单ID
* @return 结果
*/
@Override
public int deleteErpInboundOrderById(Long id)
{
return erpInboundOrderMapper.deleteErpInboundOrderById(id);
}
/**
* 作废入库单
*
* @param id 入库单ID
* @return 结果
*/
@Override
public int cancelErpInboundOrderById(Long id)
{
return erpInboundOrderMapper.cancelErpInboundOrderById(id);
}
/**
* 恢复入库单信息
*
* @param id 入库单ID
* @return 结果
*/
@Override
public int restoreErpInboundOrderById(Long id)
{
return erpInboundOrderMapper.restoreErpInboundOrderById(id);
}
}

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

@ -102,6 +102,30 @@ public class SysMakeOrderController extends BaseController
return prefix + "/addPick"; return prefix + "/addPick";
} }
/**
* 跳转创建委内加工入库单
*/
@GetMapping("/addProcessInbound/{id}")
public String addProcessInbound(@PathVariable("id") Long id, ModelMap mmap)
{
mmap.put("currentUser", ShiroUtils.getSysUser());
SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id);
mmap.put("sysMakeOrder", sysMakeOrder);
return prefix + "/addProcessInbound";
}
/**
* 跳转创建生产入库单
*/
@GetMapping("/addProduceInbound/{id}")
public String addProduceInbound(@PathVariable("id") Long id, ModelMap mmap)
{
mmap.put("currentUser", ShiroUtils.getSysUser());
SysMakeOrder sysMakeOrder = sysMakeOrderService.selectSysMakeOrderById(id);
mmap.put("sysMakeOrder", sysMakeOrder);
return prefix + "/addProduceInbound";
}
/** /**
* 部门评审 * 部门评审

114
ruoyi-admin/src/main/resources/mapper/erp/ErpInboundOrderDetailMapper.xml

@ -0,0 +1,114 @@
<?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.erp.mapper.ErpInboundOrderDetailMapper">
<resultMap type="ErpInboundOrderDetail" id="ErpInboundOrderDetailResult">
<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="inboundOrderNo" column="inbound_order_no" />
<result property="materialNo" column="material_no" />
<result property="makeorderBomId" column="makeorder_bom_id" />
<result property="completedNum" column="completed_num" />
<result property="currentNum" column="current_num" />
<result property="processFeeUnitPrice" column="process_fee_unit_price" />
</resultMap>
<sql id="selectErpInboundOrderDetailVo">
select a.id, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.inbound_order_no, a.material_no, a.makeorder_bom_id, a.completed_num, a.current_num, a.process_fee_unit_price from erp_inbound_order_detail a
</sql>
<select id="selectErpInboundOrderDetailList" parameterType="ErpInboundOrderDetail" resultMap="ErpInboundOrderDetailResult">
<include refid="selectErpInboundOrderDetailVo"/>
<where>
<if test="inboundOrderNo != null and inboundOrderNo != ''"> and a.inbound_order_no = #{inboundOrderNo}</if>
<if test="materialNo != null and materialNo != ''"> and a.material_no = #{materialNo}</if>
<if test="makeorderBomId != null "> and a.makeorder_bom_id = #{makeorderBomId}</if>
<if test="completedNum != null "> and a.completed_num = #{completedNum}</if>
<if test="currentNum != null "> and a.current_num = #{currentNum}</if>
<if test="processFeeUnitPrice != null "> and a.process_fee_unit_price = #{processFeeUnitPrice}</if>
</where>
</select>
<select id="selectErpInboundOrderDetailById" parameterType="Long" resultMap="ErpInboundOrderDetailResult">
<include refid="selectErpInboundOrderDetailVo"/>
where a.id = #{id}
</select>
<insert id="insertErpInboundOrderDetail" parameterType="ErpInboundOrderDetail" useGeneratedKeys="true" keyProperty="id">
insert into erp_inbound_order_detail
<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="inboundOrderNo != null">inbound_order_no,</if>
<if test="materialNo != null">material_no,</if>
<if test="makeorderBomId != null">makeorder_bom_id,</if>
<if test="completedNum != null">completed_num,</if>
<if test="currentNum != null">current_num,</if>
<if test="processFeeUnitPrice != null">process_fee_unit_price,</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="inboundOrderNo != null">#{inboundOrderNo},</if>
<if test="materialNo != null">#{materialNo},</if>
<if test="makeorderBomId != null">#{makeorderBomId},</if>
<if test="completedNum != null">#{completedNum},</if>
<if test="currentNum != null">#{currentNum},</if>
<if test="processFeeUnitPrice != null">#{processFeeUnitPrice},</if>
</trim>
</insert>
<update id="updateErpInboundOrderDetail" parameterType="ErpInboundOrderDetail">
update erp_inbound_order_detail
<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="inboundOrderNo != null">inbound_order_no = #{inboundOrderNo},</if>
<if test="materialNo != null">material_no = #{materialNo},</if>
<if test="makeorderBomId != null">makeorder_bom_id = #{makeorderBomId},</if>
<if test="completedNum != null">completed_num = #{completedNum},</if>
<if test="currentNum != null">current_num = #{currentNum},</if>
<if test="processFeeUnitPrice != null">process_fee_unit_price = #{processFeeUnitPrice},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteErpInboundOrderDetailById" parameterType="Long">
delete from erp_inbound_order_detail where id = #{id}
</delete>
<delete id="deleteErpInboundOrderDetailByIds" parameterType="String">
delete from erp_inbound_order_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="cancelErpInboundOrderDetailById" parameterType="Long">
update erp_inbound_order_detail set del_flag = '1' where id = #{id}
</update>
<update id="restoreErpInboundOrderDetailById" parameterType="Long">
update erp_inbound_order_detail set del_flag = '0' where id = #{id}
</update>
</mapper>

114
ruoyi-admin/src/main/resources/mapper/erp/ErpInboundOrderMapper.xml

@ -0,0 +1,114 @@
<?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.erp.mapper.ErpInboundOrderMapper">
<resultMap type="ErpInboundOrder" id="ErpInboundOrderResult">
<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="saleNo" column="sale_no" />
<result property="inboundOrderNo" column="inbound_order_no" />
<result property="inboundStatus" column="inbound_status" />
<result property="inboundType" column="inbound_type" />
<result property="inboundNum" column="inbound_num" />
</resultMap>
<sql id="selectErpInboundOrderVo">
select a.id, a.del_flag, a.create_by, a.create_time, a.update_by, a.update_time, a.remark, a.make_no, a.sale_no, a.inbound_order_no, a.inbound_status, a.inbound_type, a.inbound_num from erp_inbound_order a
</sql>
<select id="selectErpInboundOrderList" parameterType="ErpInboundOrder" resultMap="ErpInboundOrderResult">
<include refid="selectErpInboundOrderVo"/>
<where>
<if test="makeNo != null and makeNo != ''"> and a.make_no = #{makeNo}</if>
<if test="saleNo != null and saleNo != ''"> and a.sale_no = #{saleNo}</if>
<if test="inboundOrderNo != null and inboundOrderNo != ''"> and a.inbound_order_no = #{inboundOrderNo}</if>
<if test="inboundStatus != null and inboundStatus != ''"> and a.inbound_status = #{inboundStatus}</if>
<if test="inboundType != null and inboundType != ''"> and a.inbound_type = #{inboundType}</if>
<if test="inboundNum != null "> and a.inbound_num = #{inboundNum}</if>
</where>
</select>
<select id="selectErpInboundOrderById" parameterType="Long" resultMap="ErpInboundOrderResult">
<include refid="selectErpInboundOrderVo"/>
where a.id = #{id}
</select>
<insert id="insertErpInboundOrder" parameterType="ErpInboundOrder" useGeneratedKeys="true" keyProperty="id">
insert into erp_inbound_order
<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="saleNo != null">sale_no,</if>
<if test="inboundOrderNo != null">inbound_order_no,</if>
<if test="inboundStatus != null">inbound_status,</if>
<if test="inboundType != null">inbound_type,</if>
<if test="inboundNum != null">inbound_num,</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="saleNo != null">#{saleNo},</if>
<if test="inboundOrderNo != null">#{inboundOrderNo},</if>
<if test="inboundStatus != null">#{inboundStatus},</if>
<if test="inboundType != null">#{inboundType},</if>
<if test="inboundNum != null">#{inboundNum},</if>
</trim>
</insert>
<update id="updateErpInboundOrder" parameterType="ErpInboundOrder">
update erp_inbound_order
<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="saleNo != null">sale_no = #{saleNo},</if>
<if test="inboundOrderNo != null">inbound_order_no = #{inboundOrderNo},</if>
<if test="inboundStatus != null">inbound_status = #{inboundStatus},</if>
<if test="inboundType != null">inbound_type = #{inboundType},</if>
<if test="inboundNum != null">inbound_num = #{inboundNum},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteErpInboundOrderById" parameterType="Long">
delete from erp_inbound_order where id = #{id}
</delete>
<delete id="deleteErpInboundOrderByIds" parameterType="String">
delete from erp_inbound_order where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<update id="cancelErpInboundOrderById" parameterType="Long">
update erp_inbound_order set del_flag = '1' where id = #{id}
</update>
<update id="restoreErpInboundOrderById" parameterType="Long">
update erp_inbound_order set del_flag = '0' where id = #{id}
</update>
</mapper>

77
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/add.html

@ -0,0 +1,77 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增入库单')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inboundOrder-add">
<div class="form-group">
<label class="col-sm-3 control-label">删除标志:</label>
<div class="col-sm-8">
<input name="delFlag" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8">
<input name="makeNo" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input name="saleNo" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库单号:</label>
<div class="col-sm-8">
<input name="inboundOrderNo" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库状态:</label>
<div class="col-sm-8">
<select name="inboundStatus" class="form-control m-b" th:with="type=${@dict.getType('erp_inbound_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库类型:</label>
<div class="col-sm-8">
<select name="inboundType" class="form-control m-b" th:with="type=${@dict.getType('erp_inbound_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库数:</label>
<div class="col-sm-8">
<input name="inboundNum" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "erp/inboundOrder"
$("#form-inboundOrder-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-inboundOrder-add').serialize());
}
}
</script>
</body>
</html>

72
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/edit.html

@ -0,0 +1,72 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改入库单')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-inboundOrder-edit" th:object="${erpInboundOrder}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<textarea name="remark" class="form-control">[[*{remark}]]</textarea>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8">
<input name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input name="saleNo" th:field="*{saleNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库单号:</label>
<div class="col-sm-8">
<input name="inboundOrderNo" th:field="*{inboundOrderNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库状态:</label>
<div class="col-sm-8">
<select name="inboundStatus" class="form-control m-b" th:with="type=${@dict.getType('erp_inbound_status')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{inboundStatus}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库类型:</label>
<div class="col-sm-8">
<select name="inboundType" class="form-control m-b" th:with="type=${@dict.getType('erp_inbound_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{inboundType}"></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">入库数:</label>
<div class="col-sm-8">
<input name="inboundNum" th:field="*{inboundNum}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "erp/inboundOrder";
$("#form-inboundOrder-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-inboundOrder-edit').serialize());
}
}
</script>
</body>
</html>

153
ruoyi-admin/src/main/resources/templates/erp/inboundOrder/inboundOrder.html

@ -0,0 +1,153 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('入库单列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>生产订单号:</label>
<input type="text" name="makeNo"/>
</li>
<li>
<label>关联销售订单号:</label>
<input type="text" name="saleNo"/>
</li>
<li>
<label>入库单号:</label>
<input type="text" name="inboundOrderNo"/>
</li>
<li>
<label>入库状态:</label>
<select name="inboundStatus" th:with="type=${@dict.getType('erp_inbound_status')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>入库类型:</label>
<select name="inboundType" th:with="type=${@dict.getType('erp_inbound_type')}">
<option value="">所有</option>
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
</select>
</li>
<li>
<label>入库数:</label>
<input type="text" name="inboundNum"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="erp:inboundOrder:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="erp:inboundOrder:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="erp:inboundOrder:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="erp:inboundOrder:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('erp:inboundOrder:edit')}]];
var removeFlag = [[${@permission.hasPermi('erp:inboundOrder:remove')}]];
var cancelFlag = [[${@permission.hasPermi('erp:inboundOrder:cancel')}]];
var restoreFlag = [[${@permission.hasPermi('erp:inboundOrder:restore')}]];
var inboundStatusDatas = [[${@dict.getType('erp_inbound_status')}]];
var inboundTypeDatas = [[${@dict.getType('erp_inbound_type')}]];
var prefix = ctx + "erp/inboundOrder";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
cancelUrl: prefix + "/cancel/{id}",
restoreUrl: prefix + "/restore/{id}",
exportUrl: prefix + "/export",
modalName: "入库单",
columns: [{
checkbox: true
},
{
title: '主键ID',
field: 'id',
visible: false
},
{
title: '备注',
field: 'remark',
},
{
title: '生产订单号',
field: 'makeNo',
},
{
title: '关联销售订单号',
field: 'saleNo',
},
{
title: '入库单号',
field: 'inboundOrderNo',
},
{
title: '入库状态',
field: 'inboundStatus',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inboundStatusDatas, value);
}
},
{
title: '入库类型',
field: 'inboundType',
formatter: function(value, row, index) {
return $.table.selectDictLabel(inboundTypeDatas, value);
}
},
{
title: '入库数',
field: 'inboundNum',
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
if(row.delFlag == '0'){
actions.push('<a class="btn btn-danger btn-xs ' + cancelFlag + '" href="javascript:void(0)" onclick="$.operate.cancel(\'' + row.id + '\')"><i class="fa fa-remove"></i>作废</a> ');
}else{
actions.push('<a class="btn btn-success btn-xs ' + restoreFlag + '" href="javascript:void(0)" onclick="$.operate.restore(\'' + row.id + '\')"><i class="fa fa-window-restore"></i>恢复</a> ');
}
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

381
ruoyi-admin/src/main/resources/templates/system/makeorder/addProcessInbound.html

@ -0,0 +1,381 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('创建委内加工入库单')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-makeorder-edit" th:object="${sysMakeOrder}">
<input name="inboundType" type="hidden" value="1">
<div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8">
<input readonly id="makeNo" name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input readonly id="saleNo" name="saleNo" th:field="*{saleNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8">
<input readonly name="Salesman" th:field="*{Salesman}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">订单类型:</label>
<div class="col-sm-8">
<select disabled name="salesOrderType" class="form-control" type="text" th:with="dictList=${@dict.getType('sys_order_type')}" required>
<option value="">请选择</option>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option>
</select>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/makeorder";
var curUser = [[${currentUser}]];
var curUsrDeptNumber = curUser.dept.deptNumber;
// 字典
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')}]];
// var subTableFormArray = [];
$(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/makeorderbom/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
makeNo: $("#makeNo").val(),
salesOrderCode: $("#saleNo").val(),
salesOrderMaterialNo: parentRow.materialCode
},
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 = "materialNo_'+curIndex+'" name="inboundDetails['+curIndex+'].materialNo" value="'+value+'">' +
'<input class = "hidden form-control" data-id = "makeorderBomId_'+curIndex+'" name="inboundDetails['+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: 'completedNum',
title: '已完成数'
},
{
field: 'currentNum',
title: '本次委内完成数量',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input class = "form-control" data-id = "currentNum_'+curIndex+'" name="inboundDetails['+curIndex+'].currentNum">';
}
},
{
field: 'processFeeUnitPrice',
title: '委内加工费单价',
formatter: function (value,row,index){
var curIndex = row.sortNo-1;
return '<input class = "form-control" data-id = "processFeeUnitPrice_'+curIndex+'" name="inboundDetails['+curIndex+'].processFeeUnitPrice">';
}
},
{
field: 'makeNo',
title: '生产订单号',
visible: false,
},
{
field: 'salesOrderCode',
title: '销售订单号',
visible: false,
},
{
field: 'salesOrderMaterialNo',
title: '销售订单料号',
visible: false,
},
{
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-makeorder-edit").validate({
focusCleanup: true
});
function submitHandler() {
debugger
var data = $("#form-makeorder-edit").serializeArray();
alert(JSON.stringify(data));
$.operate.save(ctx + "erp/inboundOrder/add", data);
}
</script>
</body>
</html>

373
ruoyi-admin/src/main/resources/templates/system/makeorder/addProduceInbound.html

@ -0,0 +1,373 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('创建生产入库和设备履历设置')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-makeorder-edit" th:object="${sysMakeOrder}">
<input name="inboundType" type="hidden" value="0">
<div class="form-group">
<label class="col-sm-3 control-label">生产订单号:</label>
<div class="col-sm-8">
<input readonly id="makeNo" name="makeNo" th:field="*{makeNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联销售订单号:</label>
<div class="col-sm-8">
<input readonly id="saleNo" name="saleNo" th:field="*{saleNo}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">业务员:</label>
<div class="col-sm-8">
<input readonly name="Salesman" th:field="*{Salesman}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label is-required">订单类型:</label>
<div class="col-sm-8">
<select disabled name="salesOrderType" class="form-control" type="text" th:with="dictList=${@dict.getType('sys_order_type')}" required>
<option value="">请选择</option>
<option th:each="dict : ${dictList}" th:value="${dict.dictValue}" th:text="${dict.dictLabel}"></option>
</select>
</div>
</div>
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-sub-table-1"></table>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<script th:inline="javascript">
var prefix = ctx + "system/makeorder";
var curUser = [[${currentUser}]];
var curUsrDeptNumber = curUser.dept.deptNumber;
// 字典
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')}]];
// var subTableFormArray = [];
$(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: '料号',
formatter: function (value,row,index){
var curIndex = index;
return '<input readonly class = "form-control" data-id = "materialNo_'+curIndex+'" name="inboundDetails['+curIndex+'].materialNo" value="'+value+'">';
}
},
{
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: '订单数量'
},
{
field: 'completedNum',
align: 'center',
title: '已完成数'
},
{
field: 'currentNum',
title: '本次委内完成数量',
formatter: function (value,row,index){
var curIndex = index;
return '<input class = "form-control" data-id = "currentNum_'+curIndex+'" name="inboundDetails['+curIndex+'].currentNum">';
}
},
]
};
$.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/makeorderbom/list",
method: 'post',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
makeNo: $("#makeNo").val(),
salesOrderCode: $("#saleNo").val(),
salesOrderMaterialNo: parentRow.materialCode
},
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: '料号'
},
{
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: 'makeNo',
title: '生产订单号',
visible: false,
},
{
field: 'salesOrderCode',
title: '销售订单号',
visible: false,
},
{
field: 'salesOrderMaterialNo',
title: '销售订单料号',
visible: false,
},
{
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-makeorder-edit").validate({
focusCleanup: true
});
function submitHandler() {
debugger
var data = $("#form-makeorder-edit").serializeArray();
alert(JSON.stringify(data));
$.operate.save(ctx + "erp/inboundOrder/add", data);
}
</script>
</body>
</html>

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

@ -221,19 +221,27 @@
// actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
// actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> '); // actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a> ');
// 评审
if(row.makeStatus == '0'){ if(row.makeStatus == '0'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门评审\',\'' + prefix+"/bmps/"+row.id + '\')">评审</a> '); actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门评审\',\'' + prefix+"/bmps/"+row.id + '\')">评审</a> ');
} }
// 部门主管确认
if(row.deptLeaderConfirmStatus == '0'){ if(row.deptLeaderConfirmStatus == '0'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门主管确认\',\'' + prefix+"/bmzgqr/"+row.id + '\')">确认时间</a> '); actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'部门主管确认\',\'' + prefix+"/bmzgqr/"+row.id + '\')">确认时间</a> ');
} }
// 工程审核
if(row.makeStatus == '2'){ if(row.makeStatus == '2'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'工程审核\',\'' + prefix+"/gcsh/"+row.id + '\')">工程审核</a> '); actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'工程审核\',\'' + prefix+"/gcsh/"+row.id + '\')">工程审核</a> ');
} }
// 待生产、生产中、部分完成 // 领料
if(row.makeStatus == '3' || row.makeStatus == '4' || row.makeStatus == '5'){ if(row.makeStatus == '3' || row.makeStatus == '4' || row.makeStatus == '5'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加领料单\',\'' + prefix+"/addpick/"+row.id + '\')">领料</a> '); actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'添加领料单\',\'' + prefix+"/addpick/"+row.id + '\')">领料</a> ');
} }
// 委内入库
if(row.makeStatus == '4' || row.makeStatus == '5'){
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'创建委内入库单\',\'' + prefix+"/addProcessInbound/"+row.id + '\')">委内入库</a> ');
actions.push('<a class="btn btn-success btn-xs " href="javascript:void(0)" onclick="$.modal.open(\'创建生产入库和设备履历设置\',\'' + prefix+"/addProduceInbound/"+row.id + '\')">生产入库</a> ');
}
// if(row.delFlag == '0'){ // if(row.delFlag == '0'){

Loading…
Cancel
Save