Browse Source

[feat] 委外加工

整合新增委外计划 controller
整合新增委外计划  Service
整合新增委外计划  ServiceImpl
整合新增委外计划  Mapper
整合新增委外计划  Mapper.xml
整合新增委外计划 相关前端页面
dev
liuxiaoxu 4 months ago
parent
commit
f411ed2da6
  1. 159
      ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourcePlanController.java
  2. 269
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceMaterial.java
  3. 410
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceOrder.java
  4. 241
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceOrderDetail.java
  5. 191
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourcePlan.java
  6. 217
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourcePlanDetail.java
  7. 162
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java
  8. 195
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuoteChild.java
  9. 115
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/OutsourceQuoteVO.java
  10. 126
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourcePlanMapper.java
  11. 104
      ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java
  12. 94
      ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourcePlanService.java
  13. 265
      ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourcePlanServiceImpl.java
  14. 204
      ruoyi-admin/src/main/resources/mapper/system/OutsourcePlanMapper.xml
  15. 581
      ruoyi-admin/src/main/resources/templates/system/outsource_plan/addOutsourceOrder.html
  16. 238
      ruoyi-admin/src/main/resources/templates/system/outsource_plan/detail.html
  17. 232
      ruoyi-admin/src/main/resources/templates/system/outsource_plan/outsource_plan.html

159
ruoyi-admin/src/main/java/com/ruoyi/system/controller/OutsourcePlanController.java

@ -0,0 +1,159 @@
package com.ruoyi.system.controller;
import java.util.List;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.system.domain.OutsourcePlan;
import com.ruoyi.system.domain.OutsourcePlanDetail;
import com.ruoyi.system.service.IOutsourcePlanService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 委外计划Controller
*
* @author ruoyi
* @date 2024-07-05
*/
@Controller
@RequestMapping("/system/outsource_plan")
public class OutsourcePlanController extends BaseController
{
private String prefix = "system/outsource_plan";
@Autowired
private IOutsourcePlanService outsourcePlanService;
@RequiresPermissions("system:outsource_plan:view")
@GetMapping()
public String outsource_plan()
{
return prefix + "/outsource_plan";
}
/**
* 查询委外计划列表
*/
@RequiresPermissions("system:outsource_plan:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(OutsourcePlan outsourcePlan)
{
startPage();
List<OutsourcePlan> list = outsourcePlanService.selectOutsourcePlanList(outsourcePlan);
return getDataTable(list);
}
/**
* 查询委外计划详情
*/
@GetMapping("/sublist")
@ResponseBody
public TableDataInfo subList(@RequestParam("outsourcePlanId") Long outsourcePlanId, ModelMap mmap)
{
OutsourcePlan outsourcePlan = outsourcePlanService.selectOutsourcePlanByOutsourcePlanId(outsourcePlanId);
List<OutsourcePlanDetail> list = outsourcePlan.getOutsourcePlanDetailList();
return getDataTable(list);
}
/**
* 导出委外计划列表
*/
@RequiresPermissions("system:outsource_plan:export")
@Log(title = "委外计划", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(OutsourcePlan outsourcePlan)
{
List<OutsourcePlan> list = outsourcePlanService.selectOutsourcePlanList(outsourcePlan);
ExcelUtil<OutsourcePlan> util = new ExcelUtil<OutsourcePlan>(OutsourcePlan.class);
return util.exportExcel(list, "委外计划数据");
}
/**
* 添加委外订单
*/
@GetMapping("/addOutsourceOrder/{outsourcePlanCodes}")
public String addOutsourceOrder(@PathVariable("outsourcePlanCodes") String outsourcePlanCodes, ModelMap mmap)
{
List<OutsourcePlan> outsourcePlan = outsourcePlanService.selectOutsourcePlanByCodes(outsourcePlanCodes);
mmap.put("outsourcePlanList", outsourcePlan);
// System.out.println(outsourcePlan);
return prefix + "/addOutsourceOrder";
}
/**
* 新增委外计划
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存委外计划
*/
@RequiresPermissions("system:outsource_plan:add")
@Log(title = "委外计划", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(OutsourcePlan outsourcePlan)
{
return toAjax(outsourcePlanService.insertOutsourcePlan(outsourcePlan));
}
/**
* 修改委外计划
*/
@RequiresPermissions("system:outsource_plan:edit")
@GetMapping("/edit/{outsourcePlanId}")
public String edit(@PathVariable("outsourcePlanId") Long outsourcePlanId, ModelMap mmap)
{
OutsourcePlan outsourcePlan = outsourcePlanService.selectOutsourcePlanByOutsourcePlanId(outsourcePlanId);
mmap.put("outsourcePlan", outsourcePlan);
return prefix + "/edit";
}
/**
* 修改委外计划
*/
@RequiresPermissions("system:outsource_plan:detail")
@GetMapping("/detail/{outsourcePlanId}")
public String detail(@PathVariable("outsourcePlanId") Long outsourcePlanId, ModelMap mmap)
{
OutsourcePlan outsourcePlan = outsourcePlanService.selectOutsourcePlanByOutsourcePlanId(outsourcePlanId);
mmap.put("outsourcePlan", outsourcePlan);
return prefix + "/detail";
}
/**
* 修改保存委外计划
*/
@RequiresPermissions("system:outsource_plan:edit")
@Log(title = "委外计划", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(OutsourcePlan outsourcePlan)
{
return toAjax(outsourcePlanService.updateOutsourcePlan(outsourcePlan));
}
/**
* 删除委外计划
*/
@RequiresPermissions("system:outsource_plan:remove")
@Log(title = "委外计划", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(outsourcePlanService.deleteOutsourcePlanByOutsourcePlanIds(ids));
}
}

269
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceMaterial.java

@ -0,0 +1,269 @@
package com.ruoyi.system.domain;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.domain.Vo.OutsourceProcessVo;
import org.apache.poi.hpsf.Decimal;
import java.util.Date;
import java.util.List;
/**
* 委外物料对象 outsource_material
*
* @author ruoyi
* @date 2024-07-06
*/
public class OutsourceMaterial extends BaseEntity {
private static final long serialVersionUID = 1L;
/** 委外物料表id */
private Long outsourceMaterialId;
/** 委外物料表编号 */
private String materialNo;
/** 物料名称 */
private String materialName;
/** 物料类型 */
private String materialType;
/** 物料图片 */
private String materialPhotourl;
/** 单位 */
private String unit;
/** 描述 */
private String description;
/** 品牌 */
private String brand;
/** 加工方式 */
private String processMethod;
/** 计划委外数 */
private int plannedOutsourceAmount;
/** 委外工序列表 */
private List<OutsourceProcessVo> outsourceProcessList;
/** 委外工序编号 */
private String outsourceProcessNo;
/** 委外工序名称 */
private String outsourceProcessName;
/** 计价单位 */
private String chargeUnit;
/** 每个物料规格 */
private Decimal singleMterial;
/** 供应商编码 */
private String supplierQuoteCode;
/** 供应商名称 */
private String supplierName;
/** 交付时间 */
private Date deliveryTime;
private String correlationCodes;
private List<OutsourceOrderDetail> orderDetails;
public List<OutsourceOrderDetail> getOrderDetails() {
return orderDetails;
}
public void setOrderDetails(List<OutsourceOrderDetail> orderDetails) {
this.orderDetails = orderDetails;
}
public String getCorrelationCodes() {
return correlationCodes;
}
public void setCorrelationCodes(String correlationCodes) {
this.correlationCodes = correlationCodes;
}
public String getUnit() {
return unit;
}
public void setUnit(String unit) {
this.unit = unit;
}
public String getProcessMethod() {
return processMethod;
}
public void setProcessMethod(String processMethod) {
this.processMethod = processMethod;
}
public int getPlannedOutsourceAmount() {
return plannedOutsourceAmount;
}
public void setPlannedOutsourceAmount(int plannedOutsourceAmount) {
this.plannedOutsourceAmount = plannedOutsourceAmount;
}
public String getMaterialType() {
return materialType;
}
public void setMaterialType(String materialType) {
this.materialType = materialType;
}
public String getMaterialPhotourl() {
return materialPhotourl;
}
public void setMaterialPhotourl(String materialPhotourl) {
this.materialPhotourl = materialPhotourl;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getMaterialNo() {
return materialNo;
}
public void setMaterialNo(String materialNo) {
this.materialNo = materialNo;
}
public String getMaterialName() {
return materialName;
}
public void setMaterialName(String materialName) {
this.materialName = materialName;
}
public String getBrand() {
return brand;
}
public void setBrand(String brand) {
this.brand = brand;
}
public String getProcess_method() {
return processMethod;
}
public void setProcess_method(String processMethod) {
this.processMethod = processMethod;
}
public List<OutsourceProcessVo> getOutsourceProcessList() {
return outsourceProcessList;
}
public void setOutsourceProcessList(List<OutsourceProcessVo> outsourceProcessList) {
this.outsourceProcessList = outsourceProcessList;
}
public Long getOutsourceMaterialId() {
return outsourceMaterialId;
}
public void setOutsourceMaterialId(Long outsourceMaterialId) {
this.outsourceMaterialId = outsourceMaterialId;
}
public String getOutsourceProcessNo() {
return outsourceProcessNo;
}
public void setOutsourceProcessNo(String outsourceProcessNo) {
this.outsourceProcessNo = outsourceProcessNo;
}
public String getOutsourceProcessName() {
return outsourceProcessName;
}
public void setOutsourceProcessName(String outsourceProcessName) {
this.outsourceProcessName = outsourceProcessName;
}
public String getChargeUnit() {
return chargeUnit;
}
public void setChargeUnit(String chargeUnit) {
this.chargeUnit = chargeUnit;
}
public Decimal getSingleMterial() {
return singleMterial;
}
public void setSingleMterial(Decimal singleMterial) {
this.singleMterial = singleMterial;
}
public String getSupplierQuoteCode() {
return supplierQuoteCode;
}
public void setSupplierQuoteCode(String supplierQuoteCode) {
this.supplierQuoteCode = supplierQuoteCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public Date getDeliveryTime() {
return deliveryTime;
}
public void setDeliveryTime(Date deliveryTime) {
this.deliveryTime = deliveryTime;
}
@Override
public String toString() {
return "OutsourceMaterial{" +
"outsourceMaterialId=" + outsourceMaterialId +
", materialNo='" + materialNo + '\'' +
", materialName='" + materialName + '\'' +
", materialType='" + materialType + '\'' +
", materialPhotourl='" + materialPhotourl + '\'' +
", description='" + description + '\'' +
", brand='" + brand + '\'' +
", processMethod='" + processMethod + '\'' +
", outsourceProcessList=" + outsourceProcessList +
", outsourceProcessNo='" + outsourceProcessNo + '\'' +
", outsourceProcessName='" + outsourceProcessName + '\'' +
", chargeUnit='" + chargeUnit + '\'' +
", singleMterial=" + singleMterial +
", supplierQuoteCode='" + supplierQuoteCode + '\'' +
", supplierName='" + supplierName + '\'' +
", deliveryTime=" + deliveryTime +
'}';
}
}

410
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceOrder.java

@ -0,0 +1,410 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.List;
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;
/**
* 委外订单对象 outsource_order
*
* @author ruoyi
* @date 2024-07-12
*/
public class OutsourceOrder extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 委外订单表id */
private Long outsourceOrderId;
/** 委外订单编号 */
@Excel(name = "委外订单编号")
private String outsourceOrderNo;
/** 委外计划单号 */
private String outsourcePlanCode;
/** 委外员 */
@Excel(name = "委外员")
private String outsourceStaff;
/** 供应商数 */
private Long supplierAmount;
/** 物料合计 */
@Excel(name = "物料合计")
private Long materialAmount;
/** 委外物料数量合计 */
@Excel(name = "委外物料数量合计")
private Long outsourceMaterialAmount;
/** 委外工序种类 */
@Excel(name = "委外工序种类")
private Long outsourceProcessType;
/** 委外工序合计 */
@Excel(name = "委外工序合计")
private Long outsourceProcessAmount;
/** 含税委外总价 */
@Excel(name = "含税委外总价")
private BigDecimal outsourceTotalPrice;
/** 不含税委外总价 */
@Excel(name = "不含税委外总价")
private BigDecimal outsourceNoPrice;
/** 使用状态 */
@Excel(name = "使用状态")
private String useStatus;
/** 收货状态 */
@Excel(name = "收货状态")
private String receiveStatus;
/** 入库状态 */
@Excel(name = "入库状态")
private String warehouseStatus;
/** 结案状态 */
@Excel(name = "结案状态")
private String closedStatus;
/** 打款状态 */
@Excel(name = "打款状态")
private String remitStatus;
/** 审核状态 */
@Excel(name = "审核状态")
private String auditStatus;
/** 实际委外物料合计 */
@Excel(name = "实际委外物料合计")
private Long actualMaterialAmount;
/** 实际委外工序合计 */
@Excel(name = "实际委外工序合计")
private Long actualProcessAmount;
/** 仓库ID */
@Excel(name = "仓库ID")
private String stockNo;
/** 仓库名称 */
@Excel(name = "仓库名称")
private String stockName;
/** 收货人 */
@Excel(name = "收货人")
private String receivePerson;
/** 收货电话 */
@Excel(name = "收货电话")
private String receiveTelephone;
/** 详细地址 */
@Excel(name = "详细地址")
private String receiveAddress;
/** 委外订单详情信息 */
private List<OutsourceOrderDetail> outsourceOrderDetailList;
private List<OutsourceMaterial> materials;
public List<OutsourceMaterial> getMaterials() {
return materials;
}
public void setMaterials(List<OutsourceMaterial> materials) {
this.materials = materials;
}
public void setOutsourceOrderId(Long outsourceOrderId)
{
this.outsourceOrderId = outsourceOrderId;
}
public Long getOutsourceOrderId()
{
return outsourceOrderId;
}
public void setOutsourceOrderNo(String outsourceOrderNo)
{
this.outsourceOrderNo = outsourceOrderNo;
}
public String getOutsourceOrderNo()
{
return outsourceOrderNo;
}
public void setOutsourcePlanCode(String outsourcePlanCode)
{
this.outsourcePlanCode = outsourcePlanCode;
}
public String getOutsourcePlanCode()
{
return outsourcePlanCode;
}
public void setOutsourceStaff(String outsourceStaff)
{
this.outsourceStaff = outsourceStaff;
}
public String getOutsourceStaff()
{
return outsourceStaff;
}
public void setSupplierAmount(Long supplierAmount)
{
this.supplierAmount = supplierAmount;
}
public Long getSupplierAmount()
{
return supplierAmount;
}
public void setMaterialAmount(Long materialAmount)
{
this.materialAmount = materialAmount;
}
public Long getMaterialAmount()
{
return materialAmount;
}
public void setOutsourceMaterialAmount(Long outsourceMaterialAmount)
{
this.outsourceMaterialAmount = outsourceMaterialAmount;
}
public Long getOutsourceMaterialAmount()
{
return outsourceMaterialAmount;
}
public void setOutsourceProcessType(Long outsourceProcessType)
{
this.outsourceProcessType = outsourceProcessType;
}
public Long getOutsourceProcessType()
{
return outsourceProcessType;
}
public void setOutsourceProcessAmount(Long outsourceProcessAmount)
{
this.outsourceProcessAmount = outsourceProcessAmount;
}
public Long getOutsourceProcessAmount()
{
return outsourceProcessAmount;
}
public void setOutsourceTotalPrice(BigDecimal outsourceTotalPrice)
{
this.outsourceTotalPrice = outsourceTotalPrice;
}
public BigDecimal getOutsourceTotalPrice()
{
return outsourceTotalPrice;
}
public void setOutsourceNoPrice(BigDecimal outsourceNoPrice)
{
this.outsourceNoPrice = outsourceNoPrice;
}
public BigDecimal getOutsourceNoPrice()
{
return outsourceNoPrice;
}
public void setUseStatus(String useStatus)
{
this.useStatus = useStatus;
}
public String getUseStatus()
{
return useStatus;
}
public void setReceiveStatus(String receiveStatus)
{
this.receiveStatus = receiveStatus;
}
public String getReceiveStatus()
{
return receiveStatus;
}
public void setWarehouseStatus(String warehouseStatus)
{
this.warehouseStatus = warehouseStatus;
}
public String getWarehouseStatus()
{
return warehouseStatus;
}
public void setClosedStatus(String closedStatus)
{
this.closedStatus = closedStatus;
}
public String getClosedStatus()
{
return closedStatus;
}
public void setRemitStatus(String remitStatus)
{
this.remitStatus = remitStatus;
}
public String getRemitStatus()
{
return remitStatus;
}
public void setAuditStatus(String auditStatus)
{
this.auditStatus = auditStatus;
}
public String getAuditStatus()
{
return auditStatus;
}
public void setActualMaterialAmount(Long actualMaterialAmount)
{
this.actualMaterialAmount = actualMaterialAmount;
}
public Long getActualMaterialAmount()
{
return actualMaterialAmount;
}
public void setActualProcessAmount(Long actualProcessAmount)
{
this.actualProcessAmount = actualProcessAmount;
}
public Long getActualProcessAmount()
{
return actualProcessAmount;
}
public void setStockNo(String stockNo)
{
this.stockNo = stockNo;
}
public String getStockNo()
{
return stockNo;
}
public void setStockName(String stockName)
{
this.stockName = stockName;
}
public String getStockName()
{
return stockName;
}
public void setReceivePerson(String receivePerson)
{
this.receivePerson = receivePerson;
}
public String getReceivePerson()
{
return receivePerson;
}
public void setReceiveTelephone(String receiveTelephone)
{
this.receiveTelephone = receiveTelephone;
}
public String getReceiveTelephone()
{
return receiveTelephone;
}
public void setReceiveAddress(String receiveAddress)
{
this.receiveAddress = receiveAddress;
}
public String getReceiveAddress()
{
return receiveAddress;
}
public List<OutsourceOrderDetail> getOutsourceOrderDetailList()
{
return outsourceOrderDetailList;
}
public void setOutsourceOrderDetailList(List<OutsourceOrderDetail> outsourceOrderDetailList)
{
this.outsourceOrderDetailList = outsourceOrderDetailList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("outsourceOrderId", getOutsourceOrderId())
.append("outsourceOrderNo", getOutsourceOrderNo())
.append("outsourcePlanCode", getOutsourcePlanCode())
.append("outsourceStaff", getOutsourceStaff())
.append("supplierAmount", getSupplierAmount())
.append("materialAmount", getMaterialAmount())
.append("outsourceMaterialAmount", getOutsourceMaterialAmount())
.append("outsourceProcessType", getOutsourceProcessType())
.append("outsourceProcessAmount", getOutsourceProcessAmount())
.append("outsourceTotalPrice", getOutsourceTotalPrice())
.append("outsourceNoPrice", getOutsourceNoPrice())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("useStatus", getUseStatus())
.append("receiveStatus", getReceiveStatus())
.append("warehouseStatus", getWarehouseStatus())
.append("closedStatus", getClosedStatus())
.append("remitStatus", getRemitStatus())
.append("auditStatus", getAuditStatus())
.append("actualMaterialAmount", getActualMaterialAmount())
.append("actualProcessAmount", getActualProcessAmount())
.append("stockNo", getStockNo())
.append("stockName", getStockName())
.append("receivePerson", getReceivePerson())
.append("receiveTelephone", getReceiveTelephone())
.append("receiveAddress", getReceiveAddress())
.append("outsourceOrderDetailList", getOutsourceOrderDetailList())
.toString();
}
}

241
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceOrderDetail.java

@ -0,0 +1,241 @@
package com.ruoyi.system.domain;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 委外订单详情对象 outsource_order_detail
*
* @author ruoyi
* @date 2024-07-12
*/
public class OutsourceOrderDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 委外订单详情id */
private Long outsourceOrderDetailId;
/** 委外订单编号 */
@Excel(name = "委外订单编号")
private String outsourceOrderNo;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
/** 委外工序编号 */
@Excel(name = "委外工序编号")
private String outsourceProcessNo;
/** 委外工序名称 */
@Excel(name = "委外工序名称")
private String outsourceProcessName;
/** 计价单位(0按重量计数,1按数量计,2按面积计) */
@Excel(name = "计价单位", readConverterExp = "0=按重量计数,1按数量计,2按面积计")
private String chargeUnit;
/** 每个物料规格 */
@Excel(name = "每个物料规格")
private BigDecimal singleMaterial;
/** 交付时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "交付时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date deliveryTime;
/** 实际委外数 */
@Excel(name = "实际委外数")
private Long actualOutsourceAmount;
/** 含税委外总价(RMB) */
@Excel(name = "含税委外总价(RMB) ")
private BigDecimal materialRmb;
/** 不含税委外总价(RMB) */
@Excel(name = "不含税委外总价(RMB)")
private BigDecimal materialNoRmb;
/** 供应商编号 */
@Excel(name = "供应商编号")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 结案状态 */
@Excel(name = "结案状态")
private String closedStatus;
/** 打款状态 */
@Excel(name = "打款状态")
private String remitStatus;
public void setOutsourceOrderDetailId(Long outsourceOrderDetailId)
{
this.outsourceOrderDetailId = outsourceOrderDetailId;
}
public Long getOutsourceOrderDetailId()
{
return outsourceOrderDetailId;
}
public void setOutsourceOrderNo(String outsourceOrderNo)
{
this.outsourceOrderNo = outsourceOrderNo;
}
public String getOutsourceOrderNo()
{
return outsourceOrderNo;
}
public void setMaterialNo(String materialNo)
{
this.materialNo = materialNo;
}
public String getMaterialNo()
{
return materialNo;
}
public void setOutsourceProcessNo(String outsourceProcessNo)
{
this.outsourceProcessNo = outsourceProcessNo;
}
public String getOutsourceProcessNo()
{
return outsourceProcessNo;
}
public void setOutsourceProcessName(String outsourceProcessName)
{
this.outsourceProcessName = outsourceProcessName;
}
public String getOutsourceProcessName()
{
return outsourceProcessName;
}
public void setChargeUnit(String chargeUnit)
{
this.chargeUnit = chargeUnit;
}
public String getChargeUnit()
{
return chargeUnit;
}
public void setSingleMaterial(BigDecimal singleMaterial)
{
this.singleMaterial = singleMaterial;
}
public BigDecimal getSingleMaterial()
{
return singleMaterial;
}
public void setDeliveryTime(Date deliveryTime)
{
this.deliveryTime = deliveryTime;
}
public Date getDeliveryTime()
{
return deliveryTime;
}
public void setActualOutsourceAmount(Long actualOutsourceAmount)
{
this.actualOutsourceAmount = actualOutsourceAmount;
}
public Long getActualOutsourceAmount()
{
return actualOutsourceAmount;
}
public void setMaterialRmb(BigDecimal materialRmb)
{
this.materialRmb = materialRmb;
}
public BigDecimal getMaterialRmb()
{
return materialRmb;
}
public void setMaterialNoRmb(BigDecimal materialNoRmb)
{
this.materialNoRmb = materialNoRmb;
}
public BigDecimal getMaterialNoRmb()
{
return materialNoRmb;
}
public void setSupplierCode(String supplierCode)
{
this.supplierCode = supplierCode;
}
public String getSupplierCode()
{
return supplierCode;
}
public void setSupplierName(String supplierName)
{
this.supplierName = supplierName;
}
public String getSupplierName()
{
return supplierName;
}
public void setClosedStatus(String closedStatus)
{
this.closedStatus = closedStatus;
}
public String getClosedStatus()
{
return closedStatus;
}
public void setRemitStatus(String remitStatus)
{
this.remitStatus = remitStatus;
}
public String getRemitStatus()
{
return remitStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("outsourceOrderDetailId", getOutsourceOrderDetailId())
.append("outsourceOrderNo", getOutsourceOrderNo())
.append("materialNo", getMaterialNo())
.append("outsourceProcessNo", getOutsourceProcessNo())
.append("outsourceProcessName", getOutsourceProcessName())
.append("chargeUnit", getChargeUnit())
.append("singleMaterial", getSingleMaterial())
.append("deliveryTime", getDeliveryTime())
.append("actualOutsourceAmount", getActualOutsourceAmount())
.append("materialRmb", getMaterialRmb())
.append("materialNoRmb", getMaterialNoRmb())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("closedStatus", getClosedStatus())
.append("remitStatus", getRemitStatus())
.toString();
}
}

191
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourcePlan.java

@ -0,0 +1,191 @@
package com.ruoyi.system.domain;
import java.util.List;
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;
/**
* 委外计划对象 outsource_plan
*
* @author ruoyi
* @date 2024-07-05
*/
public class OutsourcePlan extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 委外计划id */
private Long outsourcePlanId;
/** 委外计划单号 */
@Excel(name = "委外计划单号")
private String outsourcePlanCode;
/** 关联单号(生产/请购) */
@Excel(name = "关联单号", readConverterExp = "生产/请购")
private String associateOrderNo;
/** 申请人 */
@Excel(name = "申请人")
private String applicant;
/** 状态 */
@Excel(name = "状态")
private String status;
/** 物料总计 */
@Excel(name = "物料总计")
private Long materialAmount;
/** 数量总计 */
@Excel(name = "数量总计")
private Long totalAmount;
/** 委外工序种类 */
@Excel(name = "委外工序种类")
private Long outsourceProcessType;
/** 委外工序合计 */
@Excel(name = "委外工序合计")
private Long outsourceProcessAmount;
/** 来源 */
@Excel(name = "来源")
private String source;
/** 委外计划详情信息 */
private List<OutsourcePlanDetail> outsourcePlanDetailList;
public void setOutsourcePlanId(Long outsourcePlanId)
{
this.outsourcePlanId = outsourcePlanId;
}
public Long getOutsourcePlanId()
{
return outsourcePlanId;
}
public void setOutsourcePlanCode(String outsourcePlanCode)
{
this.outsourcePlanCode = outsourcePlanCode;
}
public String getOutsourcePlanCode()
{
return outsourcePlanCode;
}
public void setAssociateOrderNo(String associateOrderNo)
{
this.associateOrderNo = associateOrderNo;
}
public String getAssociateOrderNo()
{
return associateOrderNo;
}
public void setApplicant(String applicant)
{
this.applicant = applicant;
}
public String getApplicant()
{
return applicant;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setMaterialAmount(Long materialAmount)
{
this.materialAmount = materialAmount;
}
public Long getMaterialAmount()
{
return materialAmount;
}
public void setTotalAmount(Long totalAmount)
{
this.totalAmount = totalAmount;
}
public Long getTotalAmount()
{
return totalAmount;
}
public void setOutsourceProcessType(Long outsourceProcessType)
{
this.outsourceProcessType = outsourceProcessType;
}
public Long getOutsourceProcessType()
{
return outsourceProcessType;
}
public void setOutsourceProcessAmount(Long outsourceProcessAmount)
{
this.outsourceProcessAmount = outsourceProcessAmount;
}
public Long getOutsourceProcessAmount()
{
return outsourceProcessAmount;
}
public void setSource(String source)
{
this.source = source;
}
public String getSource()
{
return source;
}
public List<OutsourcePlanDetail> getOutsourcePlanDetailList()
{
return outsourcePlanDetailList;
}
public void setOutsourcePlanDetailList(List<OutsourcePlanDetail> outsourcePlanDetailList)
{
this.outsourcePlanDetailList = outsourcePlanDetailList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("outsourcePlanId", getOutsourcePlanId())
.append("outsourcePlanCode", getOutsourcePlanCode())
.append("associateOrderNo", getAssociateOrderNo())
.append("applicant", getApplicant())
.append("status", getStatus())
.append("materialAmount", getMaterialAmount())
.append("totalAmount", getTotalAmount())
.append("outsourceProcessType", getOutsourceProcessType())
.append("outsourceProcessAmount", getOutsourceProcessAmount())
.append("source", getSource())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("outsourcePlanDetailList", getOutsourcePlanDetailList())
.toString();
}
}

217
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourcePlanDetail.java

@ -0,0 +1,217 @@
package com.ruoyi.system.domain;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.util.List;
/**
* 委外计划详情对象 outsource_plan_detail
*
* @author ruoyi
* @date 2024-07-05
*/
public class OutsourcePlanDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 委外计划详情id */
private Long outsourcePlanDetailId;
/** 委外计划单号 */
@Excel(name = "委外计划单号")
private String outsourcePlanCode;
/** 料号 */
@Excel(name = "料号")
private String materialNo;
/** 物料名称 */
@Excel(name = "物料名称")
private String materialName;
/** 物料类型 */
@Excel(name = "物料类型")
private String materialType;
/** 物料图片 */
@Excel(name = "物料图片")
private String materialPhotourl;
/** 描述 */
@Excel(name = "描述")
private String description;
public OutsourceMaterial getMaterial() {
return material;
}
public void setMaterial(OutsourceMaterial material) {
this.material = material;
}
/** 品牌 */
@Excel(name = "品牌")
private String brand;
/** 加工方式 */
@Excel(name = "加工方式")
private String processMethod;
/** 单位 */
@Excel(name = "单位")
private String unit;
/** 计划委外数 */
@Excel(name = "计划委外数")
private Long plannedOutsourceAmount;
/** 委外工序种类 */
@Excel(name = "委外工序种类")
private Long outsourceProcessType;
/** 委外工序合计 */
@Excel(name = "委外工序合计")
private Long outsourceProcessAmount;
private OutsourceMaterial material;
public void setOutsourcePlanDetailId(Long outsourcePlanDetailId)
{
this.outsourcePlanDetailId = outsourcePlanDetailId;
}
public Long getOutsourcePlanDetailId()
{
return outsourcePlanDetailId;
}
public void setOutsourcePlanCode(String outsourcePlanCode)
{
this.outsourcePlanCode = outsourcePlanCode;
}
public String getOutsourcePlanCode()
{
return outsourcePlanCode;
}
public void setMaterialNo(String materialNo)
{
this.materialNo = materialNo;
}
public String getMaterialNo()
{
return materialNo;
}
public void setMaterialName(String materialName)
{
this.materialName = materialName;
}
public String getMaterialName()
{
return materialName;
}
public void setMaterialType(String materialType)
{
this.materialType = materialType;
}
public String getMaterialType()
{
return materialType;
}
public void setMaterialPhotourl(String materialPhotourl)
{
this.materialPhotourl = materialPhotourl;
}
public String getMaterialPhotourl()
{
return materialPhotourl;
}
public void setDescription(String description)
{
this.description = description;
}
public String getDescription()
{
return description;
}
public void setBrand(String brand)
{
this.brand = brand;
}
public String getBrand()
{
return brand;
}
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 setPlannedOutsourceAmount(Long plannedOutsourceAmount)
{
this.plannedOutsourceAmount = plannedOutsourceAmount;
}
public Long getPlannedOutsourceAmount()
{
return plannedOutsourceAmount;
}
public void setOutsourceProcessType(Long outsourceProcessType)
{
this.outsourceProcessType = outsourceProcessType;
}
public Long getOutsourceProcessType()
{
return outsourceProcessType;
}
public void setOutsourceProcessAmount(Long outsourceProcessAmount)
{
this.outsourceProcessAmount = outsourceProcessAmount;
}
public Long getOutsourceProcessAmount()
{
return outsourceProcessAmount;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("outsourcePlanDetailId", getOutsourcePlanDetailId())
.append("outsourcePlanCode", getOutsourcePlanCode())
.append("materialNo", getMaterialNo())
.append("materialName", getMaterialName())
.append("materialType", getMaterialType())
.append("materialPhotourl", getMaterialPhotourl())
.append("description", getDescription())
.append("brand", getBrand())
.append("processMethod", getProcessMethod())
.append("unit", getUnit())
.append("plannedOutsourceAmount", getPlannedOutsourceAmount())
.append("outsourceProcessType", getOutsourceProcessType())
.append("outsourceProcessAmount", getOutsourceProcessAmount())
.toString();
}
}

162
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuote.java

@ -0,0 +1,162 @@
package com.ruoyi.system.domain;
import java.util.Date;
import java.util.List;
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;
/**
* 委外报价对象 outsource_quote
*
* @author ruoyi
* @date 2024-07-01
*/
public class OutsourceQuote extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 委外报价ID */
private Integer outsourceQuoteId;
/** 委外报价单号 */
@Excel(name = "委外报价单号")
private String outsourceQuoteCode;
/** 供应商编号 */
@Excel(name = "供应商编号")
private String supplierQuoteCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 工序合计 */
@Excel(name = "工序合计")
private int processAmount;
/** 税率 */
@Excel(name = "税率")
private Long taxRate;
/** 定价日期 */
@Excel(name = "定价日期")
private Date pricingDate;
/** 审核状态 */
@Excel(name = "审核状态")
private String auditStatus;
/** 委外报价工序信息信息 */
private List<OutsourceQuoteChild> outsourceQuoteChildList;
public void setOutsourceQuoteId(Integer outsourceQuoteId)
{
this.outsourceQuoteId = outsourceQuoteId;
}
public Integer getOutsourceQuoteId()
{
return outsourceQuoteId;
}
public void setOutsourceQuoteCode(String outsourceQuoteCode)
{
this.outsourceQuoteCode = outsourceQuoteCode;
}
public String getOutsourceQuoteCode()
{
return outsourceQuoteCode;
}
public void setSupplierQuoteCode(String supplierQuoteCode)
{
this.supplierQuoteCode = supplierQuoteCode;
}
public String getSupplierQuoteCode()
{
return supplierQuoteCode;
}
public void setSupplierName(String supplierName)
{
this.supplierName = supplierName;
}
public String getSupplierName()
{
return supplierName;
}
public void setProcessAmount(int processAmount)
{
this.processAmount = processAmount;
}
public int getProcessAmount()
{
return processAmount;
}
public void setTaxRate(Long taxRate)
{
this.taxRate = taxRate;
}
public Long getTaxRate()
{
return taxRate;
}
public Date getPricingDate() {
return pricingDate;
}
public void setPricingDate(Date pricingDate) {
this.pricingDate = pricingDate;
}
public void setAuditStatus(String auditStatus)
{
this.auditStatus = auditStatus;
}
public String getAuditStatus()
{
return auditStatus;
}
public List<OutsourceQuoteChild> getOutsourceQuoteChildList()
{
return outsourceQuoteChildList;
}
public void setOutsourceQuoteChildList(List<OutsourceQuoteChild> outsourceQuoteChildList)
{
this.outsourceQuoteChildList = outsourceQuoteChildList;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("outsourceQuoteId", getOutsourceQuoteId())
.append("outsourceQuoteCode", getOutsourceQuoteCode())
.append("supplierQuoteCode", getSupplierQuoteCode())
.append("supplierName", getSupplierName())
.append("processAmount", getProcessAmount())
.append("taxRate", getTaxRate())
.append("pricingDate", getPricingDate())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("auditStatus", getAuditStatus())
.append("remark", getRemark())
.append("outsourceQuoteChildList", getOutsourceQuoteChildList())
.toString();
}
}

195
ruoyi-admin/src/main/java/com/ruoyi/system/domain/OutsourceQuoteChild.java

@ -0,0 +1,195 @@
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;
/**
* 委外报价工序信息对象 outsource_quote_child
*
* @author ruoyi
* @date 2024-07-01
*/
public class OutsourceQuoteChild extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 采购报价单工序索引 */
private Long outsourceQuoteChildId;
/** 关联报价编号字段 */
@Excel(name = "关联报价编号字段")
private String outsourceQuoteCode;
/** 委外工序ID */
@Excel(name = "委外工序ID")
private String outsourceProcessCode;
/** 委外工序编号 */
@Excel(name = "委外工序编号")
private String outsourceProcessNo;
/** 委外工序名称 */
@Excel(name = "委外工序名称")
private String outsourceProcessName;
/** 税率 */
@Excel(name = "税率")
private BigDecimal taxRate;
/** 工序的不含税单价(RMB) */
@Excel(name = "工序的不含税单价(RMB) ")
private BigDecimal materialRmb;
/** 工序的含税单价(RMB) */
@Excel(name = "工序的含税单价(RMB)")
private BigDecimal materialNormb;
/** 供应商编号 */
@Excel(name = "供应商编号")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 审核状态 */
@Excel(name = "审核状态")
private String auditStatus;
/** 计价单位 */
@Excel(name = "计价单位")
private String chargeUnit;
public String getChargeUnit() {
return chargeUnit;
}
public void setChargeUnit(String chargeUnit) {
this.chargeUnit = chargeUnit;
}
public void setOutsourceQuoteChildId(Long outsourceQuoteChildId)
{
this.outsourceQuoteChildId = outsourceQuoteChildId;
}
public Long getOutsourceQuoteChildId()
{
return outsourceQuoteChildId;
}
public void setOutsourceQuoteCode(String outsourceQuoteCode)
{
this.outsourceQuoteCode = outsourceQuoteCode;
}
public String getOutsourceQuoteCode()
{
return outsourceQuoteCode;
}
public void setOutsourceProcessCode(String outsourceProcessCode)
{
this.outsourceProcessCode = outsourceProcessCode;
}
public String getOutsourceProcessCode()
{
return outsourceProcessCode;
}
public void setOutsourceProcessNo(String outsourceProcessNo)
{
this.outsourceProcessNo = outsourceProcessNo;
}
public String getOutsourceProcessNo()
{
return outsourceProcessNo;
}
public void setOutsourceProcessName(String outsourceProcessName)
{
this.outsourceProcessName = outsourceProcessName;
}
public String getOutsourceProcessName()
{
return outsourceProcessName;
}
public void setTaxRate(BigDecimal taxRate)
{
this.taxRate = taxRate;
}
public BigDecimal getTaxRate()
{
return taxRate;
}
public void setMaterialRmb(BigDecimal materialRmb)
{
this.materialRmb = materialRmb;
}
public BigDecimal getMaterialRmb()
{
return materialRmb;
}
public void setMaterialNormb(BigDecimal materialNormb)
{
this.materialNormb = materialNormb;
}
public BigDecimal getMaterialNormb()
{
return materialNormb;
}
public void setSupplierCode(String supplierCode)
{
this.supplierCode = supplierCode;
}
public String getSupplierCode()
{
return supplierCode;
}
public void setSupplierName(String supplierName)
{
this.supplierName = supplierName;
}
public String getSupplierName()
{
return supplierName;
}
public void setAuditStatus(String auditStatus)
{
this.auditStatus = auditStatus;
}
public String getAuditStatus()
{
return auditStatus;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("outsourceQuoteChildId", getOutsourceQuoteChildId())
.append("outsourceQuoteCode", getOutsourceQuoteCode())
.append("outsourceProcessCode", getOutsourceProcessCode())
.append("outsourceProcessNo", getOutsourceProcessNo())
.append("outsourceProcessName", getOutsourceProcessName())
.append("remark", getRemark())
.append("taxRate", getTaxRate())
.append("materialRmb", getMaterialRmb())
.append("materialNormb", getMaterialNormb())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("createBy", getCreateBy())
.append("createTime", getCreateTime())
.append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime())
.append("auditStatus", getAuditStatus())
.toString();
}
}

115
ruoyi-admin/src/main/java/com/ruoyi/system/domain/Vo/OutsourceQuoteVO.java

@ -0,0 +1,115 @@
package com.ruoyi.system.domain.Vo;
import com.ruoyi.common.core.domain.BaseEntity;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
public class OutsourceQuoteVO extends BaseEntity {
/** 委外报价单号 */
private String outsourceQuoteCode;
/** 供应商编号 */
private String supplierQuoteCode;
/** 供应商名称 */
private String supplierName;
/** 工序合计 */
private String processAmount;
/** 税率 */
private BigDecimal taxRate;
/** 定价日期 */
private Date pricingDate;
/** 审核状态 */
private String auditStatus;
/** 委外报价工序信息 */
private List<OutsourceQuoteChild> outsourceQuoteChildList;
public String getOutsourceQuoteCode() {
return outsourceQuoteCode;
}
public void setOutsourceQuoteCode(String outsourceQuoteCode) {
this.outsourceQuoteCode = outsourceQuoteCode;
}
public String getSupplierQuoteCode() {
return supplierQuoteCode;
}
public void setSupplierQuoteCode(String supplierQuoteCode) {
this.supplierQuoteCode = supplierQuoteCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getProcessAmount() {
return processAmount;
}
public void setProcessAmount(String processAmount) {
this.processAmount = processAmount;
}
public BigDecimal getTaxRate() {
return taxRate;
}
public void setTaxRate(BigDecimal taxRate) {
this.taxRate = taxRate;
}
public Date getPricingDate() {
return pricingDate;
}
public void setPricingDate(Date pricingDate) {
this.pricingDate = pricingDate;
}
public String getAuditStatus() {
return auditStatus;
}
public void setAuditStatus(String auditStatus) {
this.auditStatus = auditStatus;
}
public List<OutsourceQuoteChild> getOutsourceQuoteChildList() {
return outsourceQuoteChildList;
}
public void setOutsourceQuoteChildList(List<OutsourceQuoteChild> outsourceQuoteChildList) {
this.outsourceQuoteChildList = outsourceQuoteChildList;
}
@Override
public String toString() {
return "OutsourceQuoteChildVO{" +
"outsourceQuoteCode='" + outsourceQuoteCode + '\'' +
", supplierQuoteCode='" + supplierQuoteCode + '\'' +
", supplierName='" + supplierName + '\'' +
", processAmount='" + processAmount + '\'' +
", taxRate=" + taxRate +
", pricingDate='" + pricingDate + '\'' +
", auditStatus='" + auditStatus + '\'' +
", outsourceQuoteChildList=" + outsourceQuoteChildList +
'}';
}
}

126
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourcePlanMapper.java

@ -0,0 +1,126 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.OutsourceMaterial;
import com.ruoyi.system.domain.OutsourcePlan;
import com.ruoyi.system.domain.OutsourcePlanDetail;
import java.util.List;
/**
* 委外计划Mapper接口
*
* @author ruoyi
* @date 2024-07-05
*/
public interface OutsourcePlanMapper
{
/**
* 查询委外计划
*
* @param outsourcePlanId 委外计划主键
* @return 委外计划
*/
public OutsourcePlan selectOutsourcePlanByOutsourcePlanId(Long outsourcePlanId);
/**
* 查询委外计划列表
*
* @param outsourcePlan 委外计划
* @return 委外计划集合
*/
public List<OutsourcePlan> selectOutsourcePlanList(OutsourcePlan outsourcePlan);
/**
* 查询委外计划详情列表
*
* @param outsourcePlanCode 委外计划编号
* @return 委外计划集合
*/
public List<OutsourcePlanDetail> selectOutsourcePlanDetailList(String outsourcePlanCode);
/**
* 新增委外计划
*
* @param outsourcePlan 委外计划
* @return 结果
*/
public int insertOutsourcePlan(OutsourcePlan outsourcePlan);
/**
* 修改委外计划
*
* @param outsourcePlan 委外计划
* @return 结果
*/
public int updateOutsourcePlan(OutsourcePlan outsourcePlan);
/**
* 删除委外计划
*
* @param outsourcePlanId 委外计划主键
* @return 结果
*/
public int deleteOutsourcePlanByOutsourcePlanId(Long outsourcePlanId);
/**
* 批量删除委外计划
*
* @param outsourcePlanIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutsourcePlanByOutsourcePlanIds(String[] outsourcePlanIds);
/**
* 批量查询委外计划详情
*
* @param outsourcePlanCodes 需要查询的数据编码集合
* @return 结果
*/
public List<OutsourcePlanDetail> selectOutsourcePlanDetailByCodes(String[] outsourcePlanCodes);
/**
* 批量查询委外计划详情
*
* @param outsourcePlanCodes 需要查询的数据编码集合
* @return 结果
*/
public List<OutsourcePlan> selectOutsourcePlanByCodes(String[] outsourcePlanCodes);
/**
* 查询委外物料
*
* @param materialNo 需要查询的数据编码
* @return 结果
*/
public OutsourceMaterial selectMaterialByCode(String materialNo);
public List<OutsourceMaterial> selectProcessNoByNo (String materialNo);
/**
* 批量删除委外计划详情
*
* @param outsourcePlanIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutsourcePlanDetailByOutsourcePlanCodes(String[] outsourcePlanIds);
/**
* 批量新增委外计划详情
*
* @param outsourcePlanDetailList 委外计划详情列表
* @return 结果
*/
public int batchOutsourcePlanDetail(List<OutsourcePlanDetail> outsourcePlanDetailList);
/**
* 通过委外计划主键删除委外计划详情信息
*
* @param outsourcePlanId 委外计划ID
* @return 结果
*/
public int deleteOutsourcePlanDetailByOutsourcePlanCode(Long outsourcePlanId);
}

104
ruoyi-admin/src/main/java/com/ruoyi/system/mapper/OutsourceQuoteMapper.java

@ -0,0 +1,104 @@
package com.ruoyi.system.mapper;
import com.ruoyi.system.domain.OutsourceQuote;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import java.util.List;
/**
* 委外报价Mapper接口
*
* @author ruoyi
* @date 2024-07-01
*/
public interface OutsourceQuoteMapper
{
/**
* 查询委外报价
*
* @param outsourceQuoteId 委外报价主键
* @return 委外报价
*/
public OutsourceQuote selectOutsourceQuoteByOutsourceQuoteId(Integer outsourceQuoteId);
/**
* 查询委外报价列表
*
* @param outsourceQuote 委外报价
* @return 委外报价集合
*/
public List<OutsourceQuote> selectOutsourceQuoteList(OutsourceQuote outsourceQuote);
/**
* 查询委外报价工序信息列表
*
* @param outsourceQuoteCode 委外报价工序信息
* @return 委外报价工序信息集合
*/
public List<OutsourceQuoteChild> selectOutsourceQuoteChildList(String outsourceQuoteCode);
/**
* 新增委外报价
*
* @param outsourceQuote 委外报价
* @return 结果
*/
public int insertOutsourceQuote(OutsourceQuote outsourceQuote);
/**
* 修改委外报价
*
* @param outsourceQuote 委外报价
* @return 结果
*/
public int updateOutsourceQuote(OutsourceQuote outsourceQuote);
/**
* 删除委外报价
*
* @param outsourceQuoteId 委外报价主键
* @return 结果
*/
public int deleteOutsourceQuoteByOutsourceQuoteId(Integer outsourceQuoteId);
/**
* 批量删除委外报价
*
* @param outsourceQuoteIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutsourceQuoteByOutsourceQuoteIds(String[] outsourceQuoteIds);
/**
* 批量删除委外报价工序信息
*
* @param outsourceQuoteIds 需要删除的数据主键集合
* @return 结果
*/
public int deleteOutsourceQuoteChildByOutsourceProcessCodes(String[] outsourceQuoteIds);
/**
* 批量新增委外报价工序信息
*
* @param outsourceQuoteChildList 委外报价工序信息列表
* @return 结果
*/
public int batchOutsourceQuoteChild(List<OutsourceQuoteChild> outsourceQuoteChildList);
/**
* 通过委外报价主键删除委外报价工序信息
*
* @param outsourceQuoteId 委外报价ID
* @return 结果
*/
public int deleteOutsourceQuoteChildByOutsourceProcessCode(Integer outsourceQuoteId);
/**
* 通过委外工序编号查询委外报价工序信息
*
* @param outsourceProcessNo 委外报价ID
* @return 结果
*/
public List<OutsourceQuoteChild> selectQuoteChildListByProcessNo(String outsourceProcessNo);
}

94
ruoyi-admin/src/main/java/com/ruoyi/system/service/IOutsourcePlanService.java

@ -0,0 +1,94 @@
package com.ruoyi.system.service;
import com.ruoyi.system.domain.OutsourceMaterial;
import com.ruoyi.system.domain.OutsourcePlan;
import com.ruoyi.system.domain.OutsourcePlanDetail;
import java.util.List;
/**
* 委外计划Service接口
*
* @author ruoyi
* @date 2024-07-05
*/
public interface IOutsourcePlanService
{
/**
* 查询委外计划
*
* @param outsourcePlanId 委外计划主键
* @return 委外计划
*/
public OutsourcePlan selectOutsourcePlanByOutsourcePlanId(Long outsourcePlanId);
/**
* 查询委外计划列表
*
* @param outsourcePlan 委外计划
* @return 委外计划集合
*/
public List<OutsourcePlan> selectOutsourcePlanList(OutsourcePlan outsourcePlan);
/**
* 新增委外计划
*
* @param outsourcePlan 委外计划
* @return 结果
*/
public int insertOutsourcePlan(OutsourcePlan outsourcePlan);
/**
* 修改委外计划
*
* @param outsourcePlan 委外计划
* @return 结果
*/
public int updateOutsourcePlan(OutsourcePlan outsourcePlan);
/**
* 批量删除委外计划
*
* @param outsourcePlanIds 需要删除的委外计划主键集合
* @return 结果
*/
public int deleteOutsourcePlanByOutsourcePlanIds(String outsourcePlanIds);
/**
* 删除委外计划信息
*
* @param outsourcePlanId 委外计划主键
* @return 结果
*/
public int deleteOutsourcePlanByOutsourcePlanId(Long outsourcePlanId);
/**
* 查询委外计划详情列表
*
* @param outsourcePlanCodes 委外计划
* @return 委外计划详情集合
*/
public List<OutsourcePlanDetail> selectOutsourcePlanDetailByCodes(String outsourcePlanCodes);
/**
* 查询委外计划列表
*
* @param outsourcePlanCodes 委外计划
* @return 委外计划集合
*/
public List<OutsourcePlan> selectOutsourcePlanByCodes(String outsourcePlanCodes);
/**
* 查询委外物料列表
*
* @param materialNo 委外计划详情中包含的料号
* @return 委外物料集合
*/
public OutsourceMaterial selectMaterialByCode(String materialNo);
}

265
ruoyi-admin/src/main/java/com/ruoyi/system/service/impl/OutsourcePlanServiceImpl.java

@ -0,0 +1,265 @@
package com.ruoyi.system.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.system.domain.OutsourceMaterial;
import com.ruoyi.system.domain.OutsourcePlan;
import com.ruoyi.system.domain.OutsourcePlanDetail;
import com.ruoyi.system.domain.OutsourceQuoteChild;
import com.ruoyi.system.domain.Vo.OutsourceProcessVo;
import com.ruoyi.system.domain.Vo.Supplier;
import com.ruoyi.system.mapper.OutsourcePlanMapper;
import com.ruoyi.system.mapper.OutsourceProcessMapper;
import com.ruoyi.system.mapper.OutsourceQuoteMapper;
import com.ruoyi.system.service.IOutsourcePlanService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.stream.Collectors;
import com.ruoyi.common.utils.StringUtils;
import org.springframework.transaction.annotation.Transactional;
import com.ruoyi.common.core.text.Convert;
/**
* 委外计划Service业务层处理
*
* @author ruoyi
* @date 2024-07-05
*/
@Service
public class OutsourcePlanServiceImpl implements IOutsourcePlanService
{
@Autowired
private OutsourcePlanMapper outsourcePlanMapper;
@Autowired
private OutsourceProcessMapper outsourceProcessMapper;
@Autowired
private OutsourceQuoteMapper outsourceQuoteMapper;
/**
* 查询委外计划
*
* @param outsourcePlanId 委外计划主键
* @return 委外计划
*/
@Override
public OutsourcePlan selectOutsourcePlanByOutsourcePlanId(Long outsourcePlanId)
{
OutsourcePlan outsourcePlan = new OutsourcePlan();
outsourcePlan = outsourcePlanMapper.selectOutsourcePlanByOutsourcePlanId(outsourcePlanId);
List<OutsourcePlanDetail> details = outsourcePlanMapper.selectOutsourcePlanDetailList(outsourcePlan.getOutsourcePlanCode());
if(details.size()!=0){
outsourcePlan.setOutsourcePlanDetailList(details);
}
return outsourcePlan;
}
/**
* 查询委外计划列表
*
* @param outsourcePlan 委外计划
* @return 委外计划
*/
@Override
public List<OutsourcePlan> selectOutsourcePlanList(OutsourcePlan outsourcePlan)
{
// List<OutsourcePlan> outsourcePlanList =
// for (OutsourcePlan plan:outsourcePlanList
// ) {
// List<OutsourcePlanDetail> details = outsourcePlanMapper.selectOutsourcePlanDetailList(plan.getOutsourcePlanCode());
// if(details.size()!=0){
// plan.setOutsourcePlanDetailList(details);
// }
// System.out.println(plan);
// }
return outsourcePlanMapper.selectOutsourcePlanList(outsourcePlan);
}
/**
* 查询委外计划详情列表
*
* @param outsourcePlanCodes 委外计划编号
* @return 结果
*/
@Override
public List<OutsourcePlanDetail> selectOutsourcePlanDetailByCodes(String outsourcePlanCodes) {
return outsourcePlanMapper.selectOutsourcePlanDetailByCodes(Convert.toStrArray(outsourcePlanCodes));
}
/**
* 查询委外计划列表
*
* @param outsourcePlanCodes 委外计划编号
* @return 结果
*/
@Override
public List<OutsourcePlan> selectOutsourcePlanByCodes(String outsourcePlanCodes) {
List<OutsourcePlan> outsourcePlans = outsourcePlanMapper.selectOutsourcePlanByCodes(Convert.toStrArray(outsourcePlanCodes));
for (OutsourcePlan plan:outsourcePlans) {
List<OutsourcePlanDetail> details = outsourcePlanMapper.selectOutsourcePlanDetailByCodes(Convert.toStrArray(plan.getOutsourcePlanCode()));
if(details.size()!=0){
for (OutsourcePlanDetail planDetail:details) {
OutsourceMaterial materials = selectMaterialByCode(planDetail.getMaterialNo());
materials.setCorrelationCodes(plan.getAssociateOrderNo());
planDetail.setMaterial(materials);
}
plan.setOutsourcePlanDetailList(details);
}
}
System.out.println(outsourcePlans);
return outsourcePlans;
}
// 获取物料信息
@Override
public OutsourceMaterial selectMaterialByCode(String materialNo) {
OutsourceMaterial material = outsourcePlanMapper.selectMaterialByCode(materialNo);
// 获取委外计划表中的物料信息中的工序编号,以查询同料号的所有工序
List<OutsourceMaterial> materials = outsourcePlanMapper.selectProcessNoByNo(material.getMaterialNo());
List<String> noList = materials.stream().map(OutsourceMaterial::getOutsourceProcessNo).collect(Collectors.toList());
List<OutsourceProcessVo> processVoS = supplierClassification(noList);
// 将查到的同料号所有工序赋给该物料的工序列表;
material.setOutsourceProcessList(processVoS);
return material;
}
public List<OutsourceProcessVo> supplierClassification(List<String> outsourceProcessNo){
List<OutsourceProcessVo> processVoS = outsourceProcessMapper.selectOutsourceProcessListByNos(outsourceProcessNo);
for (OutsourceProcessVo processvo:processVoS) {
// 通过委外工序编号查找报价信息;
List<OutsourceQuoteChild> children = outsourceQuoteMapper.selectQuoteChildListByProcessNo(processvo.getOutsourceProcessNo());
for (OutsourceQuoteChild child:children) {
// 将查找到的报价信息按报价单位不同分类供应商信息,赋给对应工序
String unit = child.getChargeUnit();
if (unit != null && child != null && processvo != null) {
Supplier supplier = new Supplier();
supplier.setSupplierCode(child.getSupplierCode());
supplier.setSupplierName(child.getSupplierName());
supplier.setMaterialNormb(child.getMaterialNormb());
supplier.setMaterialRmb(child.getMaterialRmb());
switch (unit) {
case "0":
List<Supplier> weightSuppliers = processvo.getWeightSupplier();
if (weightSuppliers == null) {
weightSuppliers = new ArrayList<>();
processvo.setWeightSupplier(weightSuppliers);
}
weightSuppliers.add(supplier);
break;
case "1":
List<Supplier> quantitySuppliers = processvo.getQuantitySupplier();
if (quantitySuppliers == null) {
quantitySuppliers = new ArrayList<>();
processvo.setQuantitySupplier(quantitySuppliers);
}
quantitySuppliers.add(supplier);
break;
case "2":
List<Supplier> areaSuppliers = processvo.getAreaSupplier();
if (areaSuppliers == null) {
areaSuppliers = new ArrayList<>();
processvo.setAreaSupplier(areaSuppliers);
}
areaSuppliers.add(supplier);
break;
}
}
}
}
return processVoS;
}
/**
* 新增委外计划
*
* @param outsourcePlan 委外计划
* @return 结果
*/
@Transactional
@Override
public int insertOutsourcePlan(OutsourcePlan outsourcePlan)
{
outsourcePlan.setCreateTime(DateUtils.getNowDate());
int rows = outsourcePlanMapper.insertOutsourcePlan(outsourcePlan);
insertOutsourcePlanDetail(outsourcePlan);
return rows;
}
/**
* 修改委外计划
*
* @param outsourcePlan 委外计划
* @return 结果
*/
@Transactional
@Override
public int updateOutsourcePlan(OutsourcePlan outsourcePlan)
{
outsourcePlan.setUpdateTime(DateUtils.getNowDate());
outsourcePlanMapper.deleteOutsourcePlanDetailByOutsourcePlanCode(outsourcePlan.getOutsourcePlanId());
insertOutsourcePlanDetail(outsourcePlan);
return outsourcePlanMapper.updateOutsourcePlan(outsourcePlan);
}
/**
* 批量删除委外计划
*
* @param outsourcePlanIds 需要删除的委外计划主键
* @return 结果
*/
@Transactional
@Override
public int deleteOutsourcePlanByOutsourcePlanIds(String outsourcePlanIds)
{
outsourcePlanMapper.deleteOutsourcePlanDetailByOutsourcePlanCodes(Convert.toStrArray(outsourcePlanIds));
return outsourcePlanMapper.deleteOutsourcePlanByOutsourcePlanIds(Convert.toStrArray(outsourcePlanIds));
}
/**
* 删除委外计划信息
*
* @param outsourcePlanId 委外计划主键
* @return 结果
*/
@Transactional
@Override
public int deleteOutsourcePlanByOutsourcePlanId(Long outsourcePlanId)
{
outsourcePlanMapper.deleteOutsourcePlanDetailByOutsourcePlanCode(outsourcePlanId);
return outsourcePlanMapper.deleteOutsourcePlanByOutsourcePlanId(outsourcePlanId);
}
/**
* 新增委外计划详情信息
*
* @param outsourcePlan 委外计划对象
*/
public void insertOutsourcePlanDetail(OutsourcePlan outsourcePlan)
{
List<OutsourcePlanDetail> outsourcePlanDetailList = outsourcePlan.getOutsourcePlanDetailList();
Long outsourcePlanId = outsourcePlan.getOutsourcePlanId();
if (StringUtils.isNotNull(outsourcePlanDetailList))
{
List<OutsourcePlanDetail> list = new ArrayList<OutsourcePlanDetail>();
for (OutsourcePlanDetail outsourcePlanDetail : outsourcePlanDetailList)
{
outsourcePlanDetail.setOutsourcePlanCode(outsourcePlan.getOutsourcePlanCode());
list.add(outsourcePlanDetail);
}
if (list.size() > 0)
{
outsourcePlanMapper.batchOutsourcePlanDetail(list);
}
}
}
}

204
ruoyi-admin/src/main/resources/mapper/system/OutsourcePlanMapper.xml

@ -0,0 +1,204 @@
<?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.OutsourcePlanMapper">
<resultMap type="OutsourcePlan" id="OutsourcePlanResult">
<result property="outsourcePlanId" column="outsource_plan_id" />
<result property="outsourcePlanCode" column="outsource_plan_code" />
<result property="associateOrderNo" column="associate_order_no" />
<result property="applicant" column="applicant" />
<result property="status" column="status" />
<result property="materialAmount" column="material_amount" />
<result property="totalAmount" column="total_amount" />
<result property="outsourceProcessType" column="outsource_process_type" />
<result property="outsourceProcessAmount" column="outsource_process_amount" />
<result property="source" column="source" />
<result property="createBy" column="create_by" />
<result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" />
<result property="updateTime" column="update_time" />
</resultMap>
<!-- 委外物料-->
<resultMap type="OutsourceMaterial" id="OutsourceMaterialResult">
<result property="outsourceMaterialId" column="outsource_material_id" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="outsourceProcessNo" column="outsource_process_no" />
<result property="outsourceProcessName" column="outsource_process_name" />
<result property="materialType" column="material_type" />
<result property="materialPhotourl" column="material_photoUrl" />
<result property="unit" column="unit" />
<result property="description" column="description" />
<result property="brand" column="brand" />
<result property="processMethod" column="process_method" />
<result property="plannedOutsourceAmount" column="planned_outsource_amount" />
</resultMap>
<resultMap id="OutsourcePlanOutsourcePlanDetailResult" type="OutsourcePlan" extends="OutsourcePlanResult">
<collection property="outsourcePlanDetailList" ofType="OutsourcePlanDetail" column="outsource_plan_id" select="selectOutsourcePlanDetailList" />
</resultMap>
<resultMap type="OutsourcePlanDetail" id="OutsourcePlanDetailResult">
<result property="outsourcePlanDetailId" column="outsource_plan_detail_id" />
<result property="outsourcePlanCode" column="outsource_plan_code" />
<result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" />
<result property="materialType" column="material_type" />
<result property="materialPhotourl" column="material_photoUrl" />
<result property="description" column="description" />
<result property="brand" column="brand" />
<result property="processMethod" column="process_method" />
<result property="unit" column="unit" />
<result property="plannedOutsourceAmount" column="planned_outsource_amount" />
<result property="outsourceProcessType" column="outsource_process_type" />
<result property="outsourceProcessAmount" column="outsource_process_amount" />
</resultMap>
<sql id="selectOutsourcePlanVo">
select outsource_plan_id, outsource_plan_code, associate_order_no, applicant, status, material_amount, total_amount, outsource_process_type, outsource_process_amount, source, create_by, create_time, update_by, update_time from outsource_plan
</sql>
<select id="selectOutsourcePlanList" parameterType="OutsourcePlan" resultMap="OutsourcePlanResult">
<include refid="selectOutsourcePlanVo"/>
<where>
<if test="outsourcePlanCode != null and outsourcePlanCode != ''"> and outsource_plan_code = #{outsourcePlanCode}</if>
<if test="associateOrderNo != null and associateOrderNo != ''"> and associate_order_no = #{associateOrderNo}</if>
<if test="applicant != null and applicant != ''"> and applicant = #{applicant}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="source != null and source != ''"> and source = #{source}</if>
<if test="createTime != null "> and create_time = #{createTime}</if>
</where>
</select>
<select id="selectOutsourcePlanByOutsourcePlanId" parameterType="Long" resultMap="OutsourcePlanOutsourcePlanDetailResult">
select outsource_plan_id, outsource_plan_code, associate_order_no, applicant, status, material_amount, total_amount, outsource_process_type, outsource_process_amount, source, create_by, create_time, update_by, update_time
from outsource_plan
where outsource_plan_id = #{outsourcePlanId}
</select>
<select id="selectOutsourcePlanDetailList" resultType="OutsourcePlanDetail" resultMap="OutsourcePlanDetailResult">
select outsource_plan_detail_id, outsource_plan_code, material_no, material_name, material_type, material_photoUrl, description, brand, process_method, unit, planned_outsource_amount, outsource_process_type, outsource_process_amount
from outsource_plan_detail
where outsource_plan_code = #{outsource_plan_code}
</select>
<insert id="insertOutsourcePlan" parameterType="OutsourcePlan" useGeneratedKeys="true" keyProperty="outsourcePlanId">
insert into outsource_plan
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="outsourcePlanCode != null and outsourcePlanCode != ''">outsource_plan_code,</if>
<if test="associateOrderNo != null">associate_order_no,</if>
<if test="applicant != null">applicant,</if>
<if test="status != null">status,</if>
<if test="materialAmount != null">material_amount,</if>
<if test="totalAmount != null">total_amount,</if>
<if test="outsourceProcessType != null">outsource_process_type,</if>
<if test="outsourceProcessAmount != null">outsource_process_amount,</if>
<if test="source != null">source,</if>
<if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="outsourcePlanCode != null and outsourcePlanCode != ''">#{outsourcePlanCode},</if>
<if test="associateOrderNo != null">#{associateOrderNo},</if>
<if test="applicant != null">#{applicant},</if>
<if test="status != null">#{status},</if>
<if test="materialAmount != null">#{materialAmount},</if>
<if test="totalAmount != null">#{totalAmount},</if>
<if test="outsourceProcessType != null">#{outsourceProcessType},</if>
<if test="outsourceProcessAmount != null">#{outsourceProcessAmount},</if>
<if test="source != null">#{source},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateOutsourcePlan" parameterType="OutsourcePlan">
update outsource_plan
<trim prefix="SET" suffixOverrides=",">
<if test="outsourcePlanCode != null and outsourcePlanCode != ''">outsource_plan_code = #{outsourcePlanCode},</if>
<if test="associateOrderNo != null">associate_order_no = #{associateOrderNo},</if>
<if test="applicant != null">applicant = #{applicant},</if>
<if test="status != null">status = #{status},</if>
<if test="materialAmount != null">material_amount = #{materialAmount},</if>
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
<if test="outsourceProcessType != null">outsource_process_type = #{outsourceProcessType},</if>
<if test="outsourceProcessAmount != null">outsource_process_amount = #{outsourceProcessAmount},</if>
<if test="source != null">source = #{source},</if>
<if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where outsource_plan_id = #{outsourcePlanId}
</update>
<delete id="deleteOutsourcePlanByOutsourcePlanId" parameterType="Long">
delete from outsource_plan where outsource_plan_id = #{outsourcePlanId}
</delete>
<delete id="deleteOutsourcePlanByOutsourcePlanIds" parameterType="String">
delete from outsource_plan where outsource_plan_id in
<foreach item="outsourcePlanId" collection="array" open="(" separator="," close=")">
#{outsourcePlanId}
</foreach>
</delete>
<!-- 按委外计划单编号批量查询详情-->
<select id="selectOutsourcePlanDetailByCodes" parameterType="String" resultMap="OutsourcePlanDetailResult">
select outsource_plan_detail_id, outsource_plan_code, material_no, material_name, material_type, material_photoUrl, description, brand, process_method, unit, planned_outsource_amount, outsource_process_type, outsource_process_amount
from outsource_plan_detail
where outsource_plan_code in
<foreach item="outsourcePlanCode" collection="array" open="(" separator="," close=")">
#{outsourcePlanCode}
</foreach>
</select>
<!-- 按委外计划单编号批量查询委外计划-->
<select id="selectOutsourcePlanByCodes" resultMap="OutsourcePlanResult">
select outsource_plan_id, outsource_plan_code, associate_order_no, applicant, status, material_amount, total_amount, outsource_process_type, outsource_process_amount, source, create_by, create_time, update_by, update_time
from outsource_plan
where outsource_plan_code in
<foreach item="outsourcePlanCode" collection="array" open="(" separator="," close=")">
#{outsourcePlanCode}
</foreach>
</select>
<!-- 按料号查询委外物料-->
<select id="selectMaterialByCode" parameterType="String" resultMap="OutsourceMaterialResult">
select material_no, material_name, material_type, material_photoUrl, description, brand, unit, planned_outsource_amount, process_method, outsource_process_no, outsource_process_name
from outsource_material
where material_no =#{materialNo}
</select>
<!-- 按料号查询委外物料-->
<select id="selectProcessNoByNo" parameterType="String" resultMap="OutsourceMaterialResult">
select material_no, material_name, material_type, material_photoUrl, description, brand, unit, planned_outsource_amount, process_method, outsource_process_no, outsource_process_name
from outsource_material
where material_no =#{materialNo}
</select>
<delete id="deleteOutsourcePlanDetailByOutsourcePlanCodes" parameterType="String">
delete from outsource_plan_detail where outsource_plan_code in
<foreach item="outsourcePlanCode" collection="array" open="(" separator="," close=")">
#{outsourcePlanCode}
</foreach>
</delete>
<delete id="deleteOutsourcePlanDetailByOutsourcePlanCode" parameterType="Long">
delete from outsource_plan_detail where outsource_plan_code = #{outsourcePlanCode}
</delete>
<insert id="batchOutsourcePlanDetail">
insert into outsource_plan_detail( outsource_plan_detail_id, outsource_plan_code, material_no, material_name, material_type, material_photoUrl, description, brand, process_method, unit, planned_outsource_amount, outsource_process_type, outsource_process_amount) values
<foreach item="item" index="index" collection="list" separator=",">
( #{item.outsourcePlanDetailId}, #{item.outsourcePlanCode}, #{item.materialNo}, #{item.materialName}, #{item.materialType}, #{item.materialPhotourl}, #{item.description}, #{item.brand}, #{item.processMethod}, #{item.unit}, #{item.plannedOutsourceAmount}, #{item.outsourceProcessType}, #{item.outsourceProcessAmount})
</foreach>
</insert>
</mapper>

581
ruoyi-admin/src/main/resources/templates/system/outsource_plan/addOutsourceOrder.html

@ -0,0 +1,581 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增委外订单')" />
<th:block th:include="include :: select2-css" />
<th:block th:include="include :: datetimepicker-css" />
<th:block th:include="include :: bootstrap-editable-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-plan-outsourceOrder-add" >
<div class="col-xs-12" >
<label class="col-sm-4 control-label">已选择委外计划:</label>
<div class="col-sm-7">
<input id="outsourcePlanCode" name="outsourcePlanCode" class="form-control" type="text">
</div>
</div>
<div class="container" id="material">
</div>
</form>
<!-- 收货信息-->
<div class="container">
<div class="row"><h4 class="card-header">收货地址:</h4></div>
<div class="form-group">
<label for="stockNo" class="col-sm-2 col-form-label">仓库ID:</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="stockNo" id="stockNo" >
</div>
</div>
<div class="form-group">
<label for="stockName" class="col-sm-2 col-form-label">仓库名称:</label>
<div class="col-sm-4">
<input type="text" class="form-control" name="stockName" id="stockName">
</div>
</div>
<div class="form-group">
<label for="receivePerson" class="col-sm-2 col-form-label">收货人:</label>
<div class="col-sm-4">
<input type="text" name="receivePerson" class="form-control" id="receivePerson" >
</div>
</div>
<div class="form-group">
<label for="receiveTelephone" class="col-sm-2 col-form-label">收货电话:</label>
<div class="col-sm-4">
<input type="text" name="receiveTelephone" class="form-control" id="receiveTelephone" placeholder="请输入收货电话">
</div>
</div>
<div class="form-group">
<label for="receiveAddress" class="col-sm-2 col-form-label">详细地址:</label>
<div class="col-sm-4">
<textarea class="form-control" name="receiveAddress" id="receiveAddress"></textarea>
</div>
</div>
</div>
<!-- 订单合计-->
<div class="container">
<div class="row"><h4 class="card-header">订单合计:</h4></div>
<div class="form-group">
<label for="materialAmount" class="col-sm-2 col-form-label">物料合计:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="materialAmount">
</div>
</div>
<div class="form-group">
<label for="outsourceMaterialAmount" class="col-sm-2 col-form-label">委外数量合计:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="outsourceMaterialAmount">
</div>
</div>
<div class="form-group">
<label for="outsourceProcessType" class="col-sm-2 col-form-label">委外工序种类:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="outsourceProcessType">
</div>
</div>
<div class="form-group">
<label for="outsourceProcessAmount" class="col-sm-2 col-form-label">委外工序合计:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="outsourceProcessAmount">
</div>
</div>
<div class="form-group">
<label for="outsourceNoPrice" class="col-sm-2 col-form-label">不含税委外总价:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="outsourceNoPrice">
</div>
</div><div class="form-group">
<label for="outsourceTotalPrice" class="col-sm-2 col-form-label">含税委外总价:</label>
<div class="col-sm-4">
<input type="text" class="form-control" value="0" id="outsourceTotalPrice">
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: select2-js" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var prefix = ctx + "system/outsource_order";
// var auditStatusDatas = [[${@dict.getType('audit_status')}]];
var processMethodDatas = [[${@dict.getType('processMethod')}]];
$("#form-plan-outsourceOrder-add").validate({focusCleanup: true});
var outsourcePlanList = [[${outsourcePlanList}]];
var outsourcePlanDetailList = [];
// var chargeUnitDatas = [[${@dict.getType("charge_unit")}]]
var formId = "form-plan-outsourceOrder-add";
var outsourcePlanCode = '';
var materialList = [];
var tableIdList = [];
var supplierList = [];
var $processContent;
var $supplierheaderContent;
var materials;
var outsourceProcessAmount = 0;
var actualOutsourceAmount = 0;
$(function() {
// 遍历委外计划列表,赋值给PlanDetail列表
for (var i = 0; i < outsourcePlanList.length; i++) {
if (outsourcePlanList[i].outsourcePlanDetailList) {
outsourcePlanDetailList = outsourcePlanDetailList.concat(outsourcePlanList[i].outsourcePlanDetailList);
}
outsourcePlanCode += outsourcePlanList[i].outsourcePlanCode + ',';
}
// 已选择委外计划号赋值
$("#outsourcePlanCode").val(outsourcePlanCode);
var originMaterial = outsourcePlanDetailList;
// 根据料号去重
materials = mergeRecords(originMaterial);
// console.log(materials);
// 遍历委外计划详情信息
materials.forEach(function (material, index) {
var tableId = 'materialNo-' + (index+1);
// console.log("料号:"+index);
// console.log(tableId);
var materialTable = "bootstrap-table_" + tableId;
tableIdList.push(tableId);
// 创建物料信息的容器
var $tableWrapper = $('<div id="material-' + tableId + '"></div>');
// 将整个物料信息容器添加到页面
$('#material').append($tableWrapper);
// 添加关联销售订单号信息
var $headerDiv =
$('<div class="row">' +
'<div class="col-xs-12" >' +
'<h3>' +
'<span><strong>物料 ' + (index+1) + ': </strong> ' + '<strong>关联订单号: </strong></span>' + '<span class="correlationCodes" style="color: blue" id="correlationCodes-' + tableId + ' ">' + material.correlationCodes + '</span>' +
'</h3>' +
'<div class="col-sm-12">' +
'<table class="table-materialNo" id="' + materialTable + '">' + '</table>' +
'</div>' +
'</div>' +
'</div>');
$tableWrapper.append($headerDiv);
var materialObj = {
materialNo: material.materialNo,
materialPhotourl: material.materialPhotourl,
materialName: material.materialName,
materialType: material.materialType,
description: material.description,
unit: material.unit,
brand: material.brand,
processMethod: material.processMethod,
correlationCodes: material.correlationCodes,
plannedOutsourceAmount: material.plannedOutsourceAmount,
};
var materialData = [materialObj]; // Bootstrap Table需要一个数组作为数据源
materialList.push(material);
tables(materialTable, materialData);
var columns = [];
var processData = [];
material.outsourceProcessList.forEach(function(process,index)
{
outsourceProcessAmount++;
var processObj = {
processInfo: process.outsourceProcessNo +'-' + process.outsourceProcessName,
}
processData.push(processObj);
console.log(processObj);
console.log(processData);
columns.push({
field: processObj.processInfo,
// 这里的key即为data中的字段名
title: "委外工序" + (index+1),
sortable: true
});
});
$('#' + tableId).bootstrapTable('load', processData); // 使用 'load' 方法更新数据,而不是重新初始化
$('#' + tableId).bootstrapTable('updateColumns', {columns: columns});
var $MaterialNumDiv =
$('<div class="row">' +
'<div class="form-group">' +
'<h3 style="vertical-align: middle">' +
'<label for="outMaterialNum" style="color: blue;vertical-align: middle" class="col-sm-5 col-form-label">实际委外数:</label>' +
'</h3>' +
'<div class="col-sm-7">' +
'<input type="number" name="outMaterialNum" class="form-control outMaterialNum" id="actualOutsourceNum_' + tableId + '">' +
'</div>' +
'<div class="col-xs-12">' +
'<h3>' +
'<span><strong>选择委外计价单位和供应商</strong></span>' +
'</h3>' +
'</div>' +
'</div>' +
'</div>');
$tableWrapper.append($MaterialNumDiv);
var $processInfo = $('<div class="process-card" style="height: 60px;" id="processInfo-' + tableId + '"></div>');
if(material.outsourceProcessList.length <= 0){
var $noProcessDiv = $('<div class="no-process">暂无委外工序信息,请先添加委外工序信息。</div>');
$tableWrapper.append($noProcessDiv);
}else{
material.outsourceProcessList.forEach(function(process, processIndex) {
// console.log(processIndex);
var processSelectId = 'process-select-' + tableId + '_' + (processIndex+1);
var processTableId = 'process-' + tableId + '_' + (processIndex+1);
// console.log(processSelectId);
// console.log(process);
$processContent =
$('<div class="card-header process_card" id="process-' + tableId + '_' + (processIndex+1) + '">' +
'<div class="row">' +
'<div class="card-text">' +
'<h5>委外工序 ' + (processIndex+1) + ':' +
'<span class="processNo">' + process.outsourceProcessNo + '</span>' + '-' +
'<span class="processName">' + process.outsourceProcessName + '</span>' +
'</h5>' +
'</div>' +
'<div class="col-sm-2" id="chargeUnit-'+processSelectId+'">' +
'<label style="color: blue;vertical-align: middle">*计价单位:</label>' +
'<select name="chargeUnit" data-id="chargeUnit" id="'+ processSelectId +'" class="chargeUnitSelect" onchange="unitChange(\'' + processSelectId + '\', \'' + processTableId + '\')">' +
'<option value="">请选择</option>'+
'<option value="0">按重量计</option>' +
'<option value="1">按数量计</option>' +
'<option value="2">按面积计</option>' +
'</select>' +
'</div>' +
'</div>' +
'</div>');
// const newColumn = {
// field: 'outsourceProcess',
// title: '委外工序'+ processIndex+1,
// formatter: function (value, row, index) {
// return process.outsourceProcessNo+process.outsourceProcessName;
// }
// };
// $('#' + tableId).bootstrapTable('addColumn',newColumn);
$tableWrapper.append($processContent);
});
}
tableSetup($processInfo, tableId);
});
// 给实际委外数的输入框绑定事件处理器
$(".form-control.outMaterialNum").on("change",function(event,element) {
//实际采购数不能超过计划采购数
$('.form-control.outMaterialNum').each(function() {
var inputElement = $(this);
var inputId = inputElement.attr('id'); // 获取输入框的id
var inputVal = inputElement.val(); // 获取输入框的值
// console.log("Input ID: " + inputId + ", Value: " + inputVal);
if(inputVal){
actualOutsourceAmount += inputVal;
}
});
$("#outsourceMaterialAmount").val(actualOutsourceAmount);
console.log(actualOutsourceAmount);
});
calculateTotal(materials);
});
// 函数用于合并重复的materialNo的记录
function mergeRecords(items) {
return items.reduce((merged, current) => {
const existingRecord = merged.find(record => record.materialNo === current.materialNo);
if (existingRecord) {
// console.log(existingRecord);
// 合并字段及委外工序列表
if (!existingRecord.outsourceProcessList) {
existingRecord.outsourceProcessList = [];
}
existingRecord.outsourceProcessList = current.material.outsourceProcessList;
if (typeof existingRecord.correlationCodes === 'string' && typeof current.material.correlationCodes === 'string') {
existingRecord.correlationCodes += current.material.correlationCodes.includes(',') ? current.material.correlationCodes : `,${current.material.correlationCodes}`;
}
// console.log(existingRecord.correlationCodes);
} else {
// console.log(current);
// 如果是第一次遇到这个materialNo,创建一个新的记录
merged.push({
materialNo: current.material.materialNo,
materialPhotourl: current.material.materialPhotourl,
materialName: current.material.materialName,
materialType: current.materialType,
description: current.material.description,
unit: current.material.unit,
brand: current.material.brand,
processMethod: current.processMethod,
correlationCodes: current.material.correlationCodes,
plannedOutsourceAmount: current.plannedOutsourceAmount,
outsourceProcessList: current.material.outsourceProcessList
});
}
return merged;
}, []);
}
// 下拉框选择后联动动作
function unitChange(processSelectId,processTableId) {
var selectUnit = $('#' + processSelectId).val();
var materialno;//下拉框对应物料index
var processno;//下拉框对应工序index
// 正则表达式获取processSelectId中的数字:"process-select-materialNo-1_1"
var matches = processSelectId.match(/(\d+)_(\d+)/);
if (matches) {
materialno = parseInt(matches[1], 10);
processno = parseInt(matches[2], 10);
}
// console.log(materialno,processno); //
var processItem = materials[materialno-1].outsourceProcessList[processno-1];
// console.log(selectUnit);
// console.log($("#supplier-" + processTableId + "_.card-header.suppplier_card").length);
switch (selectUnit) {
case '0':
removeSupplier(processTableId);
addLinkageInput(processSelectId,"kg");
supplierInfoShow(processTableId,processItem.weightSupplier);
addDeliveryTime(processTableId);
break;
case '1':
removeSupplier(processTableId);
if( $("#singleMaterial-"+processSelectId).length>0){
$("#singleMaterial-"+processSelectId).remove();
}
supplierInfoShow(processTableId,processItem.quantitySupplier);
addDeliveryTime(processTableId);
break;
case '2':
removeSupplier(processTableId);
addLinkageInput(processSelectId,"平方英寸");
supplierInfoShow(processTableId,processItem.areaSupplier);
addDeliveryTime(processTableId);
break;
default :
// $processContent.append($('<text>暂无委外供应商报价信息</text>'))
};
$('input[type="radio"]').on('change', function() {
supplierId = $(this).attr('id');
console.log(supplierId);
// 这里可以添加更多的处理逻辑
});
}
// 每次加载供应商信息前先移除之前的模块
function removeSupplier(processTableId) {
if( $('[id^="supplier-' + processTableId + '_"]').length>0){
$('[id^="supplier-' + processTableId + '_"]').remove();
}
if($(".form-row.deliveryTime-"+processTableId).length>0 ){
$(".form-row.deliveryTime-"+processTableId).remove();
}
}
// 添加下拉框联动每个物料规格输入框
function addLinkageInput(processSelectId,intext) {
// console.log($("#singleMaterial-"+processSelectId).length);
console.log($("#"+processSelectId+".chargeUnitSelect"));
if( $("#materialContent-"+processSelectId).length>0){
$("#materialContent-"+processSelectId).remove();
}
$addlink = $('<div class="flex-row" id="materialContent-'+processSelectId+'">' +
'<label style="color: blue;vertical-align: middle">*每个物料:</label>' +
'<input type="number" name="singleMaterial" placeholder="'+intext+'" id="singleMaterial-' + processSelectId + '">' +
'</div>'
);
$("#chargeUnit-"+processSelectId).append($addlink);
}
// 添加供应商信息后加入交付时间模块
function addDeliveryTime(processTableId) {
var $deliveryTimeContent = $('<div class="form-row deliveryTime-'+processTableId+'" >' +
'<label class="col-sm-2">计划交付时间: </label>' +
'<div class ="col-sm-4">' +
'<div class="input-group date"> ' +
'<input type="text" name="deliveryTime" class="form-control supplierDeliveryTime" id="deliveryTime_' + processTableId + '">' +
'<span class="input-group-addon"><i class="fa fa-calendar"></i></span>' +
'<hr style="border: none; height: 1px; background-color: #ccc;">' +
'</div> ' +
'</div>' +
'</div>' );
$("#"+processTableId).append($deliveryTimeContent);
}
// 供应商信息显示
function supplierInfoShow(processTableId,uniqueSuppliers){
// 循环处理每个供应商的信息
if(uniqueSuppliers===null){
$supplierheaderContent = $('<div class="card-header suppplier_card" id = "supplier-' + processTableId + '_' + '">' +
'<text>暂无委外供应商报价信息</text>' +
'</div>'
);
$("#"+processTableId).append($supplierheaderContent);
}else{
uniqueSuppliers.forEach(function (supplier, supplierIndex) {
//如果供应商相同,则不需要再次添加供应商信息
// 卡片样式容器,用于包裹每个供应商的信息
// 构建供应商信息头部
$supplierheaderContent =
$('<div class="card-header suppplier_card" id = "supplier-' + processTableId + '_' + supplierIndex + '">' +
'<div class="row">' +
'<div class="card-text">' +
'<input type="radio" id="supplier-' + processTableId + '_' + supplierIndex + '" name="supplier-' + processTableId + '" value="'+supplier+'">' +
'<span class="supplierCode">' + supplier.supplierCode + '</span>' + '-' +
'<span class="supplierName">' + supplier.supplierName + '</span>' +
'-最新不含税采购价: ' + '<span id="materialNormb-' + processTableId + '" class="materialNormb">' + supplier.materialNormb + '</span>' +
' RMB 最新含税采购价: ' + '<span id="materialRmb-' + processTableId + '" class="materialRmb">' + supplier.materialRmb + '</span> RMB ' +
// '<span class="supplierPurchasePlanCode" hidden="hidden" >' + material.planCodes + '</span>' +
// '<span class="supplierCorrelationCode" hidden="hidden" >' + material.correlationCodes + '</span>' +
// '<span class="supplierPurchaseQuoteCode" hidden="hidden" >' + supplier.purchaseQuoteCode + '</span>' +
'</div>' +
'</div>' +
'</div>' +
'</div>');
$("#"+processTableId).append($supplierheaderContent);
});
}
};
// 计算
function calculateTotal(materials) {
var materialAmount = materials.length;
console.log(materialAmount);
console.log(outsourceProcessAmount);
$("#materialAmount").val(materialAmount);
}
function tableSetup(element, tableId) {
var $totalSection = $(
'<div class="card">' +
'<div class="card-body" class="supplierTotal_' + tableId + '">' +
'<div class="form-row">' +
'<label for="actualPurchaseTotal" class="col-sm-4">实际采购数合计:</label>' +
'<div class="col-sm-8">' +
'<input type="number" name="materialAmountSum" class="form-control" id="materialNoRmbSum_' + tableId + '" readonly>' +
'</div>' +
'</div>' +
'<div class="form-row">' +
'<label for="actualPurchaseTotal" class="col-sm-4">不含税采购总价:</label>' +
'<div class="col-sm-8">' +
'<input type="number" name="materialNoRmbSum" class="form-control" id="materialNoRmbSum_' + tableId + '" readonly>' +
'</div>' +
'</div>' +
'<div class="form-row">' +
'<label for="actualPurchaseTotalTax" class="col-sm-4">含税采购总价:</label>' +
'<div class="col-sm-8">' +
'<input type="number" name="materialRmbSum" class="form-control" id="materialRmbSum_' + tableId + '" readonly>' +
'</div>' +
'</div>' +
'</div>'+
'</div>');
element.append($totalSection);
}
function tables(tableId, data) {
$('#' + tableId).bootstrapTable({
showExport: false,
showFooter: false,
showSearch: false,
showRefresh: false,
showColumns: false,
showToggle: false,
data: data,
columns: [
{checkbox: false},
{title: '料号', field: 'materialNo'},
{title: '图片', field: 'materialPhotourl', formatter: function (value, row, index) {
return $.table.imageView(value);
}
},
{title: '物料名称', field: 'materialName'},
{title: '物料描述', field: 'description'},
{title: '品牌', field: 'brand'},
{title: '单位', field: 'unit', align: 'center', },
{title: '加工方式', field: 'processMethod', align: 'center',},
{title: '计划委外数', field: 'plannedOutsourceAmount'},
],
});
}
function submitHandler() {
if ($.validate.form()) {
var materialSum = 0;
var materialNoRmbSum = 0;
var materialRmbSum = 0;
//添加去除供应商编号数组
var supplierNumList = [];
var purchaseOrder = {
supplierNum: 0,materialNum: 0,noRmbSum: 0,rmbSum: 0,
stockNo: $("#stockNo").val(),
stockName: $("#stockName").val(),
receivePerson: $("#receivePerson").val(),
receiveAddress: $("#receiveAddress").val(),
receiveTelephone: $("#receiveTelephone").val(),
purchaseOrderChildList: [],
};
// 遍历每个物料容器
$('.table-materialCode').each(function(index, tableElement) {
var tableId = tableIdList[index];
let materialObj = materialList[index];
if (typeof materialObj === 'undefined') return;
$('#' + 'material-' + tableId).find('.process_card').each(function(processIndex, processCard) {
var processCode = $(processCard).find('.processCode').text().trim();
var processName = $(processCard).find('.processName').text().trim();
if (materialRealNum > 0) {
materialSum += materialRealNum;
materialNoRmbSum += materialRealNoRmbSum;
materialRmbSum += materialRealRmbSum;
if (supplierNumList.indexOf(supplierCode) === -1) {
supplierNumList.push(supplierCode);
purchaseOrder.supplierNum += 1;
}
}
var materialData = {
materialNo: materialObj.materialNo,
materialName: materialObj.materialName,
materialBrand:materialObj.brand,
describe: materialObj.describe,
materialProcessMethod:materialObj.processMethod,
materialPhotoUrl: materialObj.materialPhotourl,
materialNum: materialObj.materialNum,
supplierCode: supplierCode,
supplierName: supplierName,
materialNoRmb: materialObj.materialNoRmb,
materialRmb: materialObj.materialRmb,
materialRealNum: materialRealNum,
materialRealRmb: materialRealRmb,
materialRealNoRmb: materialRealNoRmb,
materialRealRmbSum: materialRealRmbSum,
materialRealNoRmbSum: materialRealNoRmbSum,
deliveryTime: deliveryTime,
outsourcePlanCode:outsourcePlanCode,
correlationCodes:materialObj.correlationCodes,
};
outsourceOrder.outsourceOrderChildList.push(materialData);
});
});
// 将合计值附加到purchaseOrder对象
purchaseOrder.materialSum = materialSum;
purchaseOrder.materialNoRmbSum = materialNoRmbSum;
purchaseOrder.materialRmbSum = materialRmbSum;
purchaseOrder.supplierNum = supplierNumList.length;
// 发送数据到后端API
$.operate.saveJson(prefix + "/addPurchaseOrder",JSON.stringify(purchaseOrder));
}
}
$("input[name='deliveryTime']").datepicker({
language: 'zh-CN',
todayHighlight: true,
format: "yyyy-mm-dd",
autoClose: true,
});
</script>
</body>
</html>

238
ruoyi-admin/src/main/resources/templates/system/outsource_plan/detail.html

@ -0,0 +1,238 @@
<!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-outsource_plan-edit" th:object="${outsourcePlan}">
<h4 class="form-header h4">委外计划信息</h4>
<input name="outsourcePlanId" th:field="*{outsourcePlanId}" type="hidden">
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label is-required">委外计划单号:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourcePlan.outsourcePlanCode}"></div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourcePlan.associateOrderNo}"></div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">申请人:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourcePlan.applicant}"></div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">物料总计:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourcePlan.materialAmount}"></div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">数量总计:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourcePlan.totalAmount}"></div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">委外工序合计:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourcePlan.outsourceProcessAmount}"></div>
</div>
</div>
</div>
<div class="col-xs-12">
<div class="form-group">
<label class="col-sm-3 control-label">来源:</label>
<div class="col-sm-8">
<div class="form-control-static" th:text="${outsourcePlan.source}"></div>
</div>
</div>
</div>
<h4 class="form-header h4">委外计划详情信息</h4>
<div class="row">
<div class="col-sm-12">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/outsource_plan";
$("#form-outsource_plan-edit").validate({
focusCleanup: true
});
$(function() {
var options = {
data: [[${outsourcePlan.outsourcePlanDetailList}]],
pagination: false,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
sidePagination: "client",
columns: [{
checkbox: true
},
{
field: 'index',
align: 'center',
title: "序号",
formatter: function (value, row, index) {
var columnIndex = $.common.sprintf("<input type='hidden' name='index' value='%s'>", $.table.serialNumber(index));
return columnIndex + $.table.serialNumber(index);
}
},
{
field: 'materialNo',
align: 'center',
title: '料号',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].materialNo' value='%s'>", index, value);
return html;
}
},
{
field: 'materialName',
align: 'center',
title: '物料名称',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].materialName' value='%s'>", index, value);
return html;
}
},
{
field: 'materialType',
align: 'center',
title: '物料类型',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].materialType' value='%s'>", index, value);
return html;
}
},
{
field: 'materialPhotourl',
align: 'center',
title: '物料图片',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].materialPhotourl' value='%s'>", index, value);
return html;
}
},
{
field: 'description',
align: 'center',
title: '描述',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].description' value='%s'>", index, value);
return html;
}
},
{
field: 'brand',
align: 'center',
title: '品牌',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].brand' value='%s'>", index, value);
return html;
}
},
{
field: 'processMethod',
align: 'center',
title: '加工方式',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].processMethod' value='%s'>", index, value);
return html;
}
},
{
field: 'unit',
align: 'center',
title: '单位',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].unit' value='%s'>", index, value);
return html;
}
},
{
field: 'plannedOutsourceAmount',
align: 'center',
title: '计划委外数',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].plannedOutsourceAmount' value='%s'>", index, value);
return html;
}
},
{
field: 'outsourceProcessType',
align: 'center',
title: '委外工序种类',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].outsourceProcessType' value='%s'>", index, value);
return html;
}
},
{
field: 'outsourceProcessAmount',
align: 'center',
title: '委外工序合计',
formatter: function(value, row, index) {
var html = $.common.sprintf("<input class='form-control' type='text' name='outsourcePlanDetailList[%s].outsourceProcessAmount' value='%s'>", index, value);
return html;
}
},]
};
$.table.init(options);
});
function addRow() {
var count = $("#" + table.options.id).bootstrapTable('getData').length;
var row = {
index: $.table.serialNumber(count),
materialNo: "",
materialName: "",
materialType: "",
materialPhotourl: "",
description: "",
brand: "",
processMethod: "",
unit: "",
plannedOutsourceAmount: "",
outsourceProcessType: "",
outsourceProcessAmount: "",
}
sub.addRow(row);
}
</script>
</body>
</html>

232
ruoyi-admin/src/main/resources/templates/system/outsource_plan/outsource_plan.html

@ -0,0 +1,232 @@
<!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="outsourcePlanCode"/>
</li>
<li>
<label>关联单号:</label>
<input type="text" name="associateOrderNo"/>
</li>
<li>
<label>申请人:</label>
<input type="text" name="applicant"/>
</li>
<li>
<label>审核状态:</label>
<select name="auditStatus" th:with="type=${@dict.getType('sys_yes_no')}">
<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="source"/>
</li>
<li>
<label>录入时间:</label>
<input type="text" class="time-input" placeholder="请选择录入时间" name="createTime"/>
</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="addOutsourceOrder()" shiro:hasPermission="system:outsource_plan:add">
<i class="fa fa-plus"></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 detailFlag = [[${@permission.hasPermi('system:outsource_plan:detail')}]];
var prefix = ctx + "system/outsource_plan";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
detailUrl: prefix + "/detail/{id}",
modalName: "委外计划",
detailView: true,
onExpandRow : function(index, row, $detail) {
initChildTable(index, row, $detail);
},
columns: [{
checkbox: true
},
{
field: 'status',
title: '状态'
},
{
field: 'outsourcePlanId',
title: '委外计划id',
visible: false
},
{
field: 'outsourcePlanCode',
title: '委外计划单号'
},
{
field: 'associateOrderNo',
title: '关联单号'
},
{
field: 'materialAmount',
title: '物料总计'
},
{
field: 'totalAmount',
title: '数量总计'
},
{
field: 'outsourceProcessType',
title: '委外工序种类'
},
{
field: 'outsourceProcessAmount',
title: '委外工序合计'
},
{
field: 'source',
title: '来源'
},
{
field: 'applicant',
title: '申请人'
},
{
field: 'createTime',
title: '录入时间'
},
{
field: 'updateBy',
title: '更新人'
},
{
field: 'updateTime',
title: '更新时间'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-info btn-xs ' + detailFlag + '" href="javascript:;" onclick="$.operate.detail(\'' + row.outsourcePlanId + '\')"><i class="fa fa-search"></i>详情</a> ');
return actions.join('');
}
}]
};
$.table.init(options);
});
initChildTable = function(index, row, $detail) {
var childTable = $detail.html('<table style="table-layout:fixed"></table>').find('table');
$(childTable).bootstrapTable({
url: prefix + "/sublist?outsourcePlanId="+row.outsourcePlanId,
method: 'get',
sidePagination: "server",
contentType: "application/x-www-form-urlencoded",
queryParams : {
// userName: '测试8'
},
columns: [
{
field : 'materialNo',
title : '料号',
align: 'center',
},
{
field : 'materialPhotourl',
title : '图片',
align: 'center',
},
{
field : 'materialName',
title : '物料名称'
},
{
field : 'materialType',
title : '物料类型'
},
{
field : 'description',
title : '描述'
},
{
field : 'brand',
title : '品牌'
},
{
field : 'processMethod',
title : '加工方式'
},
{
field : 'unit',
title : '单位'
},
{
field : 'plannedOutsourceAmount',
title : '计划委外数'
},
{
field : 'outsourceProcessType',
title : '委外工序种类'
},
{
field : 'outsourceProcessAmount',
title : '委外工序合计'
},
]
});
};
var outsourcePlanCodes = "";
function addOutsourceOrder() {
var selections = $("#bootstrap-table").bootstrapTable("getSelections");
if(selections.length === 0){
$.modal.alertWarning("请选择采购计划单");
return;
}else{
if(selections.length > 1 ){
//·拼接采购计划单号
for(let i=0;i<selections.length;i++){
if(i === selections.length - 1){
outsourcePlanCodes += selections[i].outsourcePlanCode ;
}else{
outsourcePlanCodes += selections[i].outsourcePlanCode + ",";
}
}
}else if(selections.length === 1){
outsourcePlanCodes = selections[0].outsourcePlanCode;
}
}
$.modal.open("新增委外订单", prefix + "/addOutsourceOrder/" + outsourcePlanCodes);
};
</script>
</body>
</html>
Loading…
Cancel
Save