Browse Source

Merge remote-tracking branch 'origin/dev' into dev

dev
zhangsiqi 9 months ago
parent
commit
dac5fd739f
  1. 125
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java
  2. 13
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchanges.java
  3. 96
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java
  4. 8
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesDetailMapper.java
  5. 8
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesUnqualifiedMapper.java
  6. 10
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesDetailService.java
  7. 3
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesService.java
  8. 14
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesUnqualifiedService.java
  9. 40
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.java
  10. 18
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java
  11. 25
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesUnqualifiedServiceImpl.java
  12. 33
      ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml
  13. 6
      ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesMapper.xml
  14. 8
      ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesUnqualifiedMapper.xml
  15. 28
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html
  16. 25
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html
  17. 48
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html
  18. 224
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnAfterStorageDetail.html
  19. 195
      ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnBeforeStorageDetail.html

125
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualityRefundsExchangesController.java

@ -1,11 +1,19 @@
package com.ruoyi.quality.controller; package com.ruoyi.quality.controller;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.ruoyi.aftersales.domain.AftersalesComplaintNoticeDetail;
import com.ruoyi.aftersales.domain.vo.AftersalesMaterialVO;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.erp.domain.ErpMaterialVo; import com.ruoyi.erp.domain.ErpMaterialVo;
import com.ruoyi.erp.service.IErpMaterialService; import com.ruoyi.erp.service.IErpMaterialService;
import com.ruoyi.quality.domain.QualityOrderReport; import com.ruoyi.quality.domain.*;
import com.ruoyi.quality.domain.VO.CheckoutMaterialVO; import com.ruoyi.quality.domain.VO.CheckoutMaterialVO;
import com.ruoyi.quality.service.IQualityRefundsExchangesDetailService;
import com.ruoyi.quality.service.IQualityRefundsExchangesUnqualifiedService;
import lombok.extern.slf4j.Slf4j;
import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.formula.functions.T;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -14,7 +22,6 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.quality.domain.QualityRefundsExchanges;
import com.ruoyi.quality.service.IQualityRefundsExchangesService; import com.ruoyi.quality.service.IQualityRefundsExchangesService;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
@ -27,6 +34,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
* @author 刘晓旭 * @author 刘晓旭
* @date 2024-05-23 * @date 2024-05-23
*/ */
@Slf4j
@Controller @Controller
@RequestMapping("/quality/refundsExchanges") @RequestMapping("/quality/refundsExchanges")
public class QualityRefundsExchangesController extends BaseController public class QualityRefundsExchangesController extends BaseController
@ -39,6 +47,12 @@ public class QualityRefundsExchangesController extends BaseController
@Autowired @Autowired
private IErpMaterialService erpMaterialService; private IErpMaterialService erpMaterialService;
@Autowired
private IQualityRefundsExchangesUnqualifiedService refundsExchangesUnqualifiedService;
@Autowired
private IQualityRefundsExchangesDetailService refundsExchangesDetailService;
@RequiresPermissions("quality:refundsExchanges:view") @RequiresPermissions("quality:refundsExchanges:view")
@GetMapping() @GetMapping()
public String refundsExchanges() public String refundsExchanges()
@ -76,9 +90,10 @@ public class QualityRefundsExchangesController extends BaseController
/** /**
* 新增品质管理退换货单 * 新增品质管理退换货单
*/ */
@GetMapping("/add") @GetMapping("/add/{refundsExchangesCode}")
public String add() public String add(@PathVariable("refundsExchangesCode") String refundsExchangesCode,ModelMap mmap)
{ {
mmap.put("refundsExchangesCode", refundsExchangesCode);
return prefix + "/add"; return prefix + "/add";
} }
@ -163,4 +178,106 @@ public class QualityRefundsExchangesController extends BaseController
return toAjax(qualityRefundsExchangesService.updateRefundsExchangesStatus(qualityRefundsExchanges)); return toAjax(qualityRefundsExchangesService.updateRefundsExchangesStatus(qualityRefundsExchanges));
} }
/**
* 新增品质单报告不合格数
*/
@GetMapping("/qualityReport")
public String qualityReport( @RequestParam("materialNo") String materialNo,
@RequestParam("refundsExchangesCode") String refundsExchangesCode, ModelMap mmap)
{
if (StringUtils.isEmpty(materialNo)){
log.warn("物料号为空:{}",materialNo);
}
if (StringUtils.isEmpty(refundsExchangesCode)){
log.warn("退换货号为空:{}",refundsExchangesCode);
}
mmap.put("materialNo",materialNo);
mmap.put("refundsExchangesCode",refundsExchangesCode);
return prefix + "/qualityOrderReport";
}
/**
* 新增保存品质单报告不合格数
*/
@Log(title = "品质管理品质单", businessType = BusinessType.INSERT)
@PostMapping("/qualityReport")
@ResponseBody
public AjaxResult qualityReportSave(@RequestBody QualityRefundsExchangesDetail refundsExchangesDetail)
{
return toAjax(refundsExchangesDetailService.insertQualityRefundsExchangesDetail(refundsExchangesDetail));
}
/**
* 入库前退换货单详情
*/
@GetMapping("/returnBeforeStorageDetail/{refundsExchangesId}")
public String returnBeforeStorageDetail(@PathVariable("refundsExchangesId") Long refundsExchangesId, ModelMap mmap)
{
QualityRefundsExchanges qualityRefundsExchanges = qualityRefundsExchangesService.selectQualityRefundsExchangesById(refundsExchangesId);
mmap.put("qualityRefundsExchanges", qualityRefundsExchanges);
return prefix + "/returnBeforeStorageDetail";
}
/**
* 保存入库前退换货单详情
*/
@RequiresPermissions("quality:refundsExchanges:returnBeforeStorageDetail")
@Log(title = "品质管理退换货单", businessType = BusinessType.UPDATE)
@PostMapping("/returnBeforeStorageDetail")
@ResponseBody
public AjaxResult returnBeforeStorageDetailSave(QualityRefundsExchanges qualityRefundsExchanges)
{
return toAjax(qualityRefundsExchangesService.returnBeforeStorageDetail(qualityRefundsExchanges));
}
/**
* 入库前退货详情物料和供应商列表
*/
@ResponseBody
@RequestMapping("/detailListGroupedBySupplier")
public Map<String, List<QualityRefundsExchangesDetail>> detailListGroupedBySupplier(String refundsExchangesCode) {
List<QualityRefundsExchangesDetail> allDetails = refundsExchangesDetailService.selectRefundsExchangesDetailListByCode(refundsExchangesCode);
Map<String, List<QualityRefundsExchangesDetail>> groupedDetails = allDetails.stream()
.collect(Collectors.groupingBy(QualityRefundsExchangesDetail::getSupplierCode));
return groupedDetails;
}
/**
* 入库前退换货单详情
*/
@GetMapping("/returnAfterStorageDetail/{refundsExchangesId}")
public String returnAfterStorageDetail(@PathVariable("refundsExchangesId") Long refundsExchangesId, ModelMap mmap)
{
QualityRefundsExchanges qualityRefundsExchanges = qualityRefundsExchangesService.selectQualityRefundsExchangesById(refundsExchangesId);
mmap.put("qualityRefundsExchanges", qualityRefundsExchanges);
return prefix + "/returnAfterStorageDetail";
}
/**
* 保存入库前退换货单详情
*/
@RequiresPermissions("quality:refundsExchanges:returnAfterStorageDetail")
@Log(title = "品质管理退换货单", businessType = BusinessType.UPDATE)
@PostMapping("/returnAfterStorageDetail")
@ResponseBody
public AjaxResult returnAfterStorageDetailSave(QualityRefundsExchanges qualityRefundsExchanges)
{
return toAjax(qualityRefundsExchangesService.returnBeforeStorageDetail(qualityRefundsExchanges));
}
/**
* 入库后退货详情物料信息列表
* */
@ResponseBody
@PostMapping("/getMaterialListByRefundsExchangesCode")
public TableDataInfo getMaterialListByRefundsExchangesCode(QualityRefundsExchanges qualityRefundsExchanges){
startPage();
List<QualityRefundsExchangesDetail> list = refundsExchangesDetailService.selectRefundsExchangesDetailListByCode(qualityRefundsExchanges.getRefundsExchangesCode());
return getDataTable(list);
}
} }

13
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchanges.java

@ -46,6 +46,10 @@ public class QualityRefundsExchanges extends BaseEntity
@Excel(name = "入库单号") @Excel(name = "入库单号")
private String inStorageCode; private String inStorageCode;
/** 入库类型 */
@Excel(name = "入库类型")
private String warehouseStorageType;
/** 退货节点 */ /** 退货节点 */
@Excel(name = "退货节点") @Excel(name = "退货节点")
private String qualityReturnNode; private String qualityReturnNode;
@ -180,6 +184,14 @@ public class QualityRefundsExchanges extends BaseEntity
return qualityRemark; return qualityRemark;
} }
public String getWarehouseStorageType() {
return warehouseStorageType;
}
public void setWarehouseStorageType(String warehouseStorageType) {
this.warehouseStorageType = warehouseStorageType;
}
public List<QualityRefundsExchangesDetail> getRefundsExchangesDetails() { public List<QualityRefundsExchangesDetail> getRefundsExchangesDetails() {
return refundsExchangesDetails; return refundsExchangesDetails;
} }
@ -198,6 +210,7 @@ public class QualityRefundsExchanges extends BaseEntity
.append("qualityPurchaseStatus", getQualityPurchaseStatus()) .append("qualityPurchaseStatus", getQualityPurchaseStatus())
.append("relatedOrderCode", getRelatedOrderCode()) .append("relatedOrderCode", getRelatedOrderCode())
.append("inStorageCode", getInStorageCode()) .append("inStorageCode", getInStorageCode())
.append("warehouseStorageType", getWarehouseStorageType())
.append("qualityReturnNode", getQualityReturnNode()) .append("qualityReturnNode", getQualityReturnNode())
.append("materialTotal", getMaterialTotal()) .append("materialTotal", getMaterialTotal())
.append("numTotal", getNumTotal()) .append("numTotal", getNumTotal())

96
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualityRefundsExchangesDetail.java

@ -1,6 +1,8 @@
package com.ruoyi.quality.domain; package com.ruoyi.quality.domain;
import java.util.Date; import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
@ -56,6 +58,28 @@ public class QualityRefundsExchangesDetail extends BaseEntity
@Excel(name = "数量合计") @Excel(name = "数量合计")
private Long numTotal; private Long numTotal;
/** 供应商Id */
@Excel(name = "供应商Id")
private String supplierCode;
/** 供应商名称 */
@Excel(name = "供应商名称")
private String supplierName;
/** 联系人 */
@Excel(name = "联系人")
private String customerContact;
/** 联系电话 */
@Excel(name = "联系电话")
private String contactNumber;
/** 公司地址 */
@Excel(name = "公司地址")
private String supplierAddress;
/** 料号 */ /** 料号 */
@Excel(name = "料号") @Excel(name = "料号")
private String materialNo; private String materialNo;
@ -97,10 +121,18 @@ public class QualityRefundsExchangesDetail extends BaseEntity
@Excel(name = "交付质检时间", width = 30, dateFormat = "yyyy-MM-dd") @Excel(name = "交付质检时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date deliveryInspectionTime; private Date deliveryInspectionTime;
/** 检验完成时间 */
@JsonFormat(pattern = "yyyy-MM-dd")
@Excel(name = "检验完成时间", width = 30, dateFormat = "yyyy-MM-dd")
private Date inspectionTime;
/** 品质备注 */ /** 品质备注 */
@Excel(name = "品质备注") @Excel(name = "品质备注")
private String qualityRemark; private String qualityRemark;
/*不合格分类列表*/
private List<QualityRefundsExchangesUnqualified> refundsExchangesUnqualifieds;
public void setRefundsExchangesDetailId(Long refundsExchangesDetailId) public void setRefundsExchangesDetailId(Long refundsExchangesDetailId)
{ {
this.refundsExchangesDetailId = refundsExchangesDetailId; this.refundsExchangesDetailId = refundsExchangesDetailId;
@ -291,6 +323,63 @@ public class QualityRefundsExchangesDetail extends BaseEntity
return qualityRemark; return qualityRemark;
} }
public Date getInspectionTime() {
return inspectionTime;
}
public void setInspectionTime(Date inspectionTime) {
this.inspectionTime = inspectionTime;
}
public String getSupplierCode() {
return supplierCode;
}
public void setSupplierCode(String supplierCode) {
this.supplierCode = supplierCode;
}
public String getSupplierName() {
return supplierName;
}
public void setSupplierName(String supplierName) {
this.supplierName = supplierName;
}
public String getCustomerContact() {
return customerContact;
}
public void setCustomerContact(String customerContact) {
this.customerContact = customerContact;
}
public String getContactNumber() {
return contactNumber;
}
public void setContactNumber(String contactNumber) {
this.contactNumber = contactNumber;
}
public String getSupplierAddress() {
return supplierAddress;
}
public void setSupplierAddress(String supplierAddress) {
this.supplierAddress = supplierAddress;
}
public List<QualityRefundsExchangesUnqualified> getRefundsExchangesUnqualifieds() {
return refundsExchangesUnqualifieds;
}
public void setRefundsExchangesUnqualifieds(List<QualityRefundsExchangesUnqualified> refundsExchangesUnqualifieds) {
this.refundsExchangesUnqualifieds = refundsExchangesUnqualifieds;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -304,6 +393,11 @@ public class QualityRefundsExchangesDetail extends BaseEntity
.append("qualityReturnNode", getQualityReturnNode()) .append("qualityReturnNode", getQualityReturnNode())
.append("materialTotal", getMaterialTotal()) .append("materialTotal", getMaterialTotal())
.append("numTotal", getNumTotal()) .append("numTotal", getNumTotal())
.append("supplierCode", getSupplierCode())
.append("supplierName", getSupplierName())
.append("customerContact", getCustomerContact())
.append("contactNumber", getContactNumber())
.append("supplierAddress", getSupplierAddress())
.append("materialNo", getMaterialNo()) .append("materialNo", getMaterialNo())
.append("materialName", getMaterialName()) .append("materialName", getMaterialName())
.append("materialType", getMaterialType()) .append("materialType", getMaterialType())
@ -314,12 +408,14 @@ public class QualityRefundsExchangesDetail extends BaseEntity
.append("materialProcessMethod", getMaterialProcessMethod()) .append("materialProcessMethod", getMaterialProcessMethod())
.append("refundsExchangesNum", getRefundsExchangesNum()) .append("refundsExchangesNum", getRefundsExchangesNum())
.append("deliveryInspectionTime", getDeliveryInspectionTime()) .append("deliveryInspectionTime", getDeliveryInspectionTime())
.append("inspectionTime", getInspectionTime())
.append("qualityRemark", getQualityRemark()) .append("qualityRemark", getQualityRemark())
.append("remark", getRemark()) .append("remark", getRemark())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())
.append("updateTime", getUpdateTime()) .append("updateTime", getUpdateTime())
.append("refundsExchangesUnqualifieds",getRefundsExchangesUnqualifieds())
.toString(); .toString();
} }
} }

8
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesDetailMapper.java

@ -74,4 +74,12 @@ public interface QualityRefundsExchangesDetailMapper
* @return 结果 * @return 结果
*/ */
public int restoreQualityRefundsExchangesDetailById(Long refundsExchangesDetailId); public int restoreQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
/**
* 查询品质管理退换货单详情列表
*
* @param refundsExchangesCode 退换货单号
* @return 品质管理退换货单详情集合
*/
List<QualityRefundsExchangesDetail> selectRefundsExchangesDetailListByCode(String refundsExchangesCode);
} }

8
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualityRefundsExchangesUnqualifiedMapper.java

@ -74,4 +74,12 @@ public interface QualityRefundsExchangesUnqualifiedMapper
* @return 结果 * @return 结果
*/ */
public int restoreQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId); public int restoreQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
/**
* 查询品质管理退换货不合格分类
*
* @param refundsExchangesUnqualified 品质管理退换货不合格分类
* @return 品质管理退换货不合格分类
*/
QualityRefundsExchangesUnqualified selectRefundsExchangesUnqualifiedByNoAndCode(QualityRefundsExchangesUnqualified refundsExchangesUnqualified);
} }

10
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesDetailService.java

@ -27,6 +27,15 @@ public interface IQualityRefundsExchangesDetailService
*/ */
public List<QualityRefundsExchangesDetail> selectQualityRefundsExchangesDetailList(QualityRefundsExchangesDetail qualityRefundsExchangesDetail); public List<QualityRefundsExchangesDetail> selectQualityRefundsExchangesDetailList(QualityRefundsExchangesDetail qualityRefundsExchangesDetail);
/**
* 查询品质管理退换货单详情列表
*
* @param refundsExchangesCode 退换货单号
* @return 品质管理退换货单详情集合
*/
public List<QualityRefundsExchangesDetail> selectRefundsExchangesDetailListByCode(String refundsExchangesCode);
/** /**
* 新增品质管理退换货单详情 * 新增品质管理退换货单详情
* *
@ -72,4 +81,5 @@ public interface IQualityRefundsExchangesDetailService
* @return * @return
*/ */
int restoreQualityRefundsExchangesDetailById(Long refundsExchangesDetailId); int restoreQualityRefundsExchangesDetailById(Long refundsExchangesDetailId);
} }

3
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesService.java

@ -75,4 +75,7 @@ public interface IQualityRefundsExchangesService
/*修改退换货状态*/ /*修改退换货状态*/
int updateRefundsExchangesStatus(QualityRefundsExchanges qualityRefundsExchanges); int updateRefundsExchangesStatus(QualityRefundsExchanges qualityRefundsExchanges);
/*入库前退换货详情*/
int returnBeforeStorageDetail(QualityRefundsExchanges qualityRefundsExchanges);
} }

14
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualityRefundsExchangesUnqualifiedService.java

@ -72,4 +72,18 @@ public interface IQualityRefundsExchangesUnqualifiedService
* @return * @return
*/ */
int restoreQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId); int restoreQualityRefundsExchangesUnqualifiedById(Long refundsExchangesUnqualifiedId);
/**
* 查询品质管理退换货不合格分类
*
* @param refundsExchangesUnqualified 品质管理退换货不合格分类
* @return 品质管理退换货不合格分类
*/
public QualityRefundsExchangesUnqualified selectRefundsExchangesUnqualifiedByNoAndCode(QualityRefundsExchangesUnqualified refundsExchangesUnqualified);
/**
* 新增保存品质单报告不良分类
*/
int addRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified refundsExchangesUnqualified);
} }

40
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesDetailServiceImpl.java

@ -1,14 +1,19 @@
package com.ruoyi.quality.service.impl; package com.ruoyi.quality.service.impl;
import java.util.Date;
import java.util.List; import java.util.List;
import com.ruoyi.common.utils.DateUtils; import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.ShiroUtils; import com.ruoyi.common.utils.ShiroUtils;
import com.ruoyi.quality.domain.QualityRefundsExchangesUnqualified;
import com.ruoyi.quality.mapper.QualityOrderReportUnqualifiedMapper;
import com.ruoyi.quality.mapper.QualityRefundsExchangesUnqualifiedMapper;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.ruoyi.quality.mapper.QualityRefundsExchangesDetailMapper; import com.ruoyi.quality.mapper.QualityRefundsExchangesDetailMapper;
import com.ruoyi.quality.domain.QualityRefundsExchangesDetail; import com.ruoyi.quality.domain.QualityRefundsExchangesDetail;
import com.ruoyi.quality.service.IQualityRefundsExchangesDetailService; import com.ruoyi.quality.service.IQualityRefundsExchangesDetailService;
import com.ruoyi.common.core.text.Convert; import com.ruoyi.common.core.text.Convert;
import org.springframework.transaction.annotation.Transactional;
/** /**
* 品质管理退换货单详情Service业务层处理 * 品质管理退换货单详情Service业务层处理
@ -22,6 +27,9 @@ public class QualityRefundsExchangesDetailServiceImpl implements IQualityRefunds
@Autowired @Autowired
private QualityRefundsExchangesDetailMapper qualityRefundsExchangesDetailMapper; private QualityRefundsExchangesDetailMapper qualityRefundsExchangesDetailMapper;
@Autowired
private QualityRefundsExchangesUnqualifiedMapper unqualifiedMapper;
/** /**
* 查询品质管理退换货单详情 * 查询品质管理退换货单详情
* *
@ -46,19 +54,49 @@ public class QualityRefundsExchangesDetailServiceImpl implements IQualityRefunds
return qualityRefundsExchangesDetailMapper.selectQualityRefundsExchangesDetailList(qualityRefundsExchangesDetail); return qualityRefundsExchangesDetailMapper.selectQualityRefundsExchangesDetailList(qualityRefundsExchangesDetail);
} }
/**
* 查询品质管理退换货单详情列表
*
* @param refundsExchangesCode 退换货单号
* @return 品质管理退换货单详情集合
*/
@Override
public List<QualityRefundsExchangesDetail> selectRefundsExchangesDetailListByCode(String refundsExchangesCode) {
return qualityRefundsExchangesDetailMapper.selectRefundsExchangesDetailListByCode(refundsExchangesCode);
}
/** /**
* 新增品质管理退换货单详情 * 新增品质管理退换货单详情
* *
* @param qualityRefundsExchangesDetail 品质管理退换货单详情 * @param qualityRefundsExchangesDetail 品质管理退换货单详情
* @return 结果 * @return 结果
*/ */
@Transactional
@Override @Override
public int insertQualityRefundsExchangesDetail(QualityRefundsExchangesDetail qualityRefundsExchangesDetail) public int insertQualityRefundsExchangesDetail(QualityRefundsExchangesDetail qualityRefundsExchangesDetail)
{ {
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
qualityRefundsExchangesDetail.setCreateBy(loginName); qualityRefundsExchangesDetail.setCreateBy(loginName);
qualityRefundsExchangesDetail.setCreateTime(DateUtils.getNowDate()); qualityRefundsExchangesDetail.setCreateTime(DateUtils.getNowDate());
return qualityRefundsExchangesDetailMapper.insertQualityRefundsExchangesDetail(qualityRefundsExchangesDetail);
//获取前端不合格分类列表
List<QualityRefundsExchangesUnqualified> refundsExchangesUnqualifieds = qualityRefundsExchangesDetail.getRefundsExchangesUnqualifieds();
for (QualityRefundsExchangesUnqualified temp : refundsExchangesUnqualifieds) {
QualityRefundsExchangesUnqualified refundsExchangesUnqualified = new QualityRefundsExchangesUnqualified();
refundsExchangesUnqualified.setRefundsExchangesCode(qualityRefundsExchangesDetail.getRefundsExchangesCode());
refundsExchangesUnqualified.setMaterialNo(qualityRefundsExchangesDetail.getMaterialNo());
refundsExchangesUnqualified.setInspectionTime(qualityRefundsExchangesDetail.getInspectionTime());
refundsExchangesUnqualified.setProcessBadClassification(temp.getProcessBadClassification());
refundsExchangesUnqualified.setProcessBadGrade(temp.getProcessBadGrade());
refundsExchangesUnqualified.setProcessBadNum(temp.getProcessBadNum());
refundsExchangesUnqualified.setRemark(temp.getRemark());
refundsExchangesUnqualified.setCreateBy(loginName);
refundsExchangesUnqualified.setCreateTime(new Date());
unqualifiedMapper.insertQualityRefundsExchangesUnqualified(refundsExchangesUnqualified);
}
return 1;
} }
/** /**

18
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesServiceImpl.java

@ -69,6 +69,11 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan
public int insertQualityRefundsExchanges(QualityRefundsExchanges qualityRefundsExchanges) public int insertQualityRefundsExchanges(QualityRefundsExchanges qualityRefundsExchanges)
{ {
String refundsExchangesCode = qualityRefundsExchanges.getRefundsExchangesCode();
if (StringUtils.isEmpty(refundsExchangesCode)){
log.warn("退换货单号为空:{}",refundsExchangesCode);
}
String loginName = ShiroUtils.getLoginName(); String loginName = ShiroUtils.getLoginName();
List<QualityRefundsExchangesDetail> refundsExchangesDetails = qualityRefundsExchanges.getRefundsExchangesDetails(); List<QualityRefundsExchangesDetail> refundsExchangesDetails = qualityRefundsExchanges.getRefundsExchangesDetails();
if (StringUtils.isEmpty(refundsExchangesDetails)){ if (StringUtils.isEmpty(refundsExchangesDetails)){
@ -76,9 +81,9 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan
} }
for (QualityRefundsExchangesDetail tempDetail : refundsExchangesDetails) { for (QualityRefundsExchangesDetail tempDetail : refundsExchangesDetails) {
QualityRefundsExchangesDetail refundsExchangesDetail = new QualityRefundsExchangesDetail(); QualityRefundsExchangesDetail refundsExchangesDetail = new QualityRefundsExchangesDetail();
refundsExchangesDetail.setRefundsExchangesCode(tempDetail.getRefundsExchangesCode()); refundsExchangesDetail.setRefundsExchangesCode(refundsExchangesCode);
refundsExchangesDetail.setDeliveryInspectionTime(tempDetail.getDeliveryInspectionTime()); refundsExchangesDetail.setDeliveryInspectionTime(qualityRefundsExchanges.getDeliveryInspectionTime());
refundsExchangesDetail.setQualityRemark(tempDetail.getQualityRemark()); refundsExchangesDetail.setQualityRemark(qualityRefundsExchanges.getQualityRemark());
refundsExchangesDetail.setMaterialNo(tempDetail.getMaterialNo()); refundsExchangesDetail.setMaterialNo(tempDetail.getMaterialNo());
refundsExchangesDetail.setMaterialName(tempDetail.getMaterialName()); refundsExchangesDetail.setMaterialName(tempDetail.getMaterialName());
refundsExchangesDetail.setMaterialBrand(tempDetail.getMaterialBrand()); refundsExchangesDetail.setMaterialBrand(tempDetail.getMaterialBrand());
@ -168,6 +173,13 @@ public class QualityRefundsExchangesServiceImpl implements IQualityRefundsExchan
return qualityRefundsExchangesMapper.updateQualityRefundsExchanges(qualityRefundsExchanges); return qualityRefundsExchangesMapper.updateQualityRefundsExchanges(qualityRefundsExchanges);
} }
/*入库前退换货详情*/
@Override
public int returnBeforeStorageDetail(QualityRefundsExchanges qualityRefundsExchanges) {
return 1;
}
/** /**
*退换货单号: *退换货单号:

25
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualityRefundsExchangesUnqualifiedServiceImpl.java

@ -123,4 +123,29 @@ public class QualityRefundsExchangesUnqualifiedServiceImpl implements IQualityRe
{ {
return qualityRefundsExchangesUnqualifiedMapper.restoreQualityRefundsExchangesUnqualifiedById(refundsExchangesUnqualifiedId); return qualityRefundsExchangesUnqualifiedMapper.restoreQualityRefundsExchangesUnqualifiedById(refundsExchangesUnqualifiedId);
} }
/**
* 查询品质管理退换货不合格分类
*
* @param refundsExchangesUnqualified 品质管理退换货不合格分类
* @return 品质管理退换货不合格分类
*/
@Override
public QualityRefundsExchangesUnqualified selectRefundsExchangesUnqualifiedByNoAndCode(QualityRefundsExchangesUnqualified refundsExchangesUnqualified) {
return qualityRefundsExchangesUnqualifiedMapper.selectRefundsExchangesUnqualifiedByNoAndCode(refundsExchangesUnqualified);
}
/**
* 新增保存品质单报告不良分类
*/
@Override
public int addRefundsExchangesUnqualified(QualityRefundsExchangesUnqualified refundsExchangesUnqualified) {
String loginName = ShiroUtils.getLoginName();
refundsExchangesUnqualified.setUpdateBy(loginName);
refundsExchangesUnqualified.setUpdateTime(DateUtils.getNowDate());
return qualityRefundsExchangesUnqualifiedMapper.insertQualityRefundsExchangesUnqualified(refundsExchangesUnqualified);
}
} }

33
ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesDetailMapper.xml

@ -15,6 +15,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="qualityReturnNode" column="quality_return_node" /> <result property="qualityReturnNode" column="quality_return_node" />
<result property="materialTotal" column="material_total" /> <result property="materialTotal" column="material_total" />
<result property="numTotal" column="num_total" /> <result property="numTotal" column="num_total" />
<result property="supplierCode" column="supplier_code" />
<result property="supplierName" column="supplier_name" />
<result property="customerContact" column="customer_contact" />
<result property="contactNumber" column="contact_number" />
<result property="supplierAddress" column="supplier_address" />
<result property="materialNo" column="material_no" /> <result property="materialNo" column="material_no" />
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="materialType" column="material_type" /> <result property="materialType" column="material_type" />
@ -25,6 +30,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialProcessMethod" column="material_process_method" /> <result property="materialProcessMethod" column="material_process_method" />
<result property="refundsExchangesNum" column="refunds_exchanges_num" /> <result property="refundsExchangesNum" column="refunds_exchanges_num" />
<result property="deliveryInspectionTime" column="delivery_inspection_time" /> <result property="deliveryInspectionTime" column="delivery_inspection_time" />
<result property="inspectionTime" column="inspection_time" />
<result property="qualityRemark" column="quality_remark" /> <result property="qualityRemark" column="quality_remark" />
<result property="remark" column="remark" /> <result property="remark" column="remark" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
@ -34,7 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectQualityRefundsExchangesDetailVo"> <sql id="selectQualityRefundsExchangesDetailVo">
select refunds_exchanges_detail_id, refunds_exchanges_code, refunds_exchanges_status, quality_warehouse_status, quality_purchase_status, related_order_code, in_storage_code, quality_return_node, material_total, num_total, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, refunds_exchanges_num, delivery_inspection_time, quality_remark, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges_detail select refunds_exchanges_detail_id, refunds_exchanges_code, refunds_exchanges_status, quality_warehouse_status, quality_purchase_status, related_order_code, in_storage_code, quality_return_node, material_total, num_total, supplier_code, supplier_name, customer_contact, contact_number, supplier_address, material_no, material_name, material_type, material_photoUrl, material_brand, material_unit, material_describe, material_process_method, refunds_exchanges_num, delivery_inspection_time, inspection_time ,quality_remark, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges_detail
</sql> </sql>
<select id="selectQualityRefundsExchangesDetailList" parameterType="QualityRefundsExchangesDetail" resultMap="QualityRefundsExchangesDetailResult"> <select id="selectQualityRefundsExchangesDetailList" parameterType="QualityRefundsExchangesDetail" resultMap="QualityRefundsExchangesDetailResult">
@ -48,6 +54,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where refunds_exchanges_detail_id = #{refundsExchangesDetailId} where refunds_exchanges_detail_id = #{refundsExchangesDetailId}
</select> </select>
<select id="selectRefundsExchangesDetailListByCode" parameterType="String" resultMap="QualityRefundsExchangesDetailResult">
<include refid="selectQualityRefundsExchangesDetailVo"/>
where refunds_exchanges_code = #{refundsExchangesCode}
</select>
<insert id="insertQualityRefundsExchangesDetail" parameterType="QualityRefundsExchangesDetail" useGeneratedKeys="true" keyProperty="refundsExchangesDetailId"> <insert id="insertQualityRefundsExchangesDetail" parameterType="QualityRefundsExchangesDetail" useGeneratedKeys="true" keyProperty="refundsExchangesDetailId">
insert into quality_refunds_exchanges_detail insert into quality_refunds_exchanges_detail
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -60,6 +73,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityReturnNode != null">quality_return_node,</if> <if test="qualityReturnNode != null">quality_return_node,</if>
<if test="materialTotal != null">material_total,</if> <if test="materialTotal != null">material_total,</if>
<if test="numTotal != null">num_total,</if> <if test="numTotal != null">num_total,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="supplierName != null">supplier_name,</if>
<if test="customerContact != null">customer_contact,</if>
<if test="contactNumber != null">contact_number,</if>
<if test="supplierAddress != null">supplier_address,</if>
<if test="materialNo != null">material_no,</if> <if test="materialNo != null">material_no,</if>
<if test="materialName != null">material_name,</if> <if test="materialName != null">material_name,</if>
<if test="materialType != null">material_type,</if> <if test="materialType != null">material_type,</if>
@ -70,6 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialProcessMethod != null">material_process_method,</if> <if test="materialProcessMethod != null">material_process_method,</if>
<if test="refundsExchangesNum != null">refunds_exchanges_num,</if> <if test="refundsExchangesNum != null">refunds_exchanges_num,</if>
<if test="deliveryInspectionTime != null">delivery_inspection_time,</if> <if test="deliveryInspectionTime != null">delivery_inspection_time,</if>
<if test="inspectionTime != null">inspection_time,</if>
<if test="qualityRemark != null">quality_remark,</if> <if test="qualityRemark != null">quality_remark,</if>
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
@ -87,6 +106,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityReturnNode != null">#{qualityReturnNode},</if> <if test="qualityReturnNode != null">#{qualityReturnNode},</if>
<if test="materialTotal != null">#{materialTotal},</if> <if test="materialTotal != null">#{materialTotal},</if>
<if test="numTotal != null">#{numTotal},</if> <if test="numTotal != null">#{numTotal},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="supplierName != null">#{supplierName},</if>
<if test="customerContact != null">#{customerContact},</if>
<if test="contactNumber != null">#{contactNumber},</if>
<if test="supplierAddress != null">#{supplierAddress},</if>
<if test="materialNo != null">#{materialNo},</if> <if test="materialNo != null">#{materialNo},</if>
<if test="materialName != null">#{materialName},</if> <if test="materialName != null">#{materialName},</if>
<if test="materialType != null">#{materialType},</if> <if test="materialType != null">#{materialType},</if>
@ -97,6 +121,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialProcessMethod != null">#{materialProcessMethod},</if> <if test="materialProcessMethod != null">#{materialProcessMethod},</if>
<if test="refundsExchangesNum != null">#{refundsExchangesNum},</if> <if test="refundsExchangesNum != null">#{refundsExchangesNum},</if>
<if test="deliveryInspectionTime != null">#{deliveryInspectionTime},</if> <if test="deliveryInspectionTime != null">#{deliveryInspectionTime},</if>
<if test="inspectionTime != null">#{inspectionTime},</if>
<if test="qualityRemark != null">#{qualityRemark},</if> <if test="qualityRemark != null">#{qualityRemark},</if>
<if test="remark != null">#{remark},</if> <if test="remark != null">#{remark},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
@ -118,6 +143,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityReturnNode != null">quality_return_node = #{qualityReturnNode},</if> <if test="qualityReturnNode != null">quality_return_node = #{qualityReturnNode},</if>
<if test="materialTotal != null">material_total = #{materialTotal},</if> <if test="materialTotal != null">material_total = #{materialTotal},</if>
<if test="numTotal != null">num_total = #{numTotal},</if> <if test="numTotal != null">num_total = #{numTotal},</if>
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="supplierName != null">supplier_name = #{supplierName},</if>
<if test="customerContact != null">customer_contact = #{customerContact},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="supplierAddress != null">supplier_address = #{supplierAddress},</if>
<if test="materialNo != null">material_no = #{materialNo},</if> <if test="materialNo != null">material_no = #{materialNo},</if>
<if test="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="materialType != null">material_type = #{materialType},</if> <if test="materialType != null">material_type = #{materialType},</if>
@ -128,6 +158,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if> <if test="materialProcessMethod != null">material_process_method = #{materialProcessMethod},</if>
<if test="refundsExchangesNum != null">refunds_exchanges_num = #{refundsExchangesNum},</if> <if test="refundsExchangesNum != null">refunds_exchanges_num = #{refundsExchangesNum},</if>
<if test="deliveryInspectionTime != null">delivery_inspection_time = #{deliveryInspectionTime},</if> <if test="deliveryInspectionTime != null">delivery_inspection_time = #{deliveryInspectionTime},</if>
<if test="inspectionTime != null">inspection_time = #{inspectionTime},</if>
<if test="qualityRemark != null">quality_remark = #{qualityRemark},</if> <if test="qualityRemark != null">quality_remark = #{qualityRemark},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>

6
ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesMapper.xml

@ -12,6 +12,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="qualityPurchaseStatus" column="quality_purchase_status" /> <result property="qualityPurchaseStatus" column="quality_purchase_status" />
<result property="relatedOrderCode" column="related_order_code" /> <result property="relatedOrderCode" column="related_order_code" />
<result property="inStorageCode" column="in_storage_code" /> <result property="inStorageCode" column="in_storage_code" />
<result property="warehouseStorageType" column="warehouse_storage_type" />
<result property="qualityReturnNode" column="quality_return_node" /> <result property="qualityReturnNode" column="quality_return_node" />
<result property="materialTotal" column="material_total" /> <result property="materialTotal" column="material_total" />
<result property="numTotal" column="num_total" /> <result property="numTotal" column="num_total" />
@ -25,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectQualityRefundsExchangesVo"> <sql id="selectQualityRefundsExchangesVo">
select refunds_exchanges_id, refunds_exchanges_code, refunds_exchanges_status, quality_warehouse_status, quality_purchase_status, related_order_code, in_storage_code, quality_return_node, material_total, num_total, delivery_inspection_time, quality_remark, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges select refunds_exchanges_id, refunds_exchanges_code, refunds_exchanges_status, quality_warehouse_status, quality_purchase_status, related_order_code, in_storage_code, warehouse_storage_type ,quality_return_node, material_total, num_total, delivery_inspection_time, quality_remark, remark, create_by, create_time, update_by, update_time from quality_refunds_exchanges
</sql> </sql>
<select id="selectQualityRefundsExchangesList" parameterType="QualityRefundsExchanges" resultMap="QualityRefundsExchangesResult"> <select id="selectQualityRefundsExchangesList" parameterType="QualityRefundsExchanges" resultMap="QualityRefundsExchangesResult">
@ -56,6 +57,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityPurchaseStatus != null">quality_purchase_status,</if> <if test="qualityPurchaseStatus != null">quality_purchase_status,</if>
<if test="relatedOrderCode != null">related_order_code,</if> <if test="relatedOrderCode != null">related_order_code,</if>
<if test="inStorageCode != null">in_storage_code,</if> <if test="inStorageCode != null">in_storage_code,</if>
<if test="warehouseStorageType != null">warehouse_storage_type,</if>
<if test="qualityReturnNode != null">quality_return_node,</if> <if test="qualityReturnNode != null">quality_return_node,</if>
<if test="materialTotal != null">material_total,</if> <if test="materialTotal != null">material_total,</if>
<if test="numTotal != null">num_total,</if> <if test="numTotal != null">num_total,</if>
@ -74,6 +76,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityPurchaseStatus != null">#{qualityPurchaseStatus},</if> <if test="qualityPurchaseStatus != null">#{qualityPurchaseStatus},</if>
<if test="relatedOrderCode != null">#{relatedOrderCode},</if> <if test="relatedOrderCode != null">#{relatedOrderCode},</if>
<if test="inStorageCode != null">#{inStorageCode},</if> <if test="inStorageCode != null">#{inStorageCode},</if>
<if test="warehouseStorageType != null">#{warehouseStorageType},</if>
<if test="qualityReturnNode != null">#{qualityReturnNode},</if> <if test="qualityReturnNode != null">#{qualityReturnNode},</if>
<if test="materialTotal != null">#{materialTotal},</if> <if test="materialTotal != null">#{materialTotal},</if>
<if test="numTotal != null">#{numTotal},</if> <if test="numTotal != null">#{numTotal},</if>
@ -96,6 +99,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="qualityPurchaseStatus != null">quality_purchase_status = #{qualityPurchaseStatus},</if> <if test="qualityPurchaseStatus != null">quality_purchase_status = #{qualityPurchaseStatus},</if>
<if test="relatedOrderCode != null">related_order_code = #{relatedOrderCode},</if> <if test="relatedOrderCode != null">related_order_code = #{relatedOrderCode},</if>
<if test="inStorageCode != null">in_storage_code = #{inStorageCode},</if> <if test="inStorageCode != null">in_storage_code = #{inStorageCode},</if>
<if test="warehouseStorageType != null">warehouse_storage_type = #{warehouseStorageType},</if>
<if test="qualityReturnNode != null">quality_return_node = #{qualityReturnNode},</if> <if test="qualityReturnNode != null">quality_return_node = #{qualityReturnNode},</if>
<if test="materialTotal != null">material_total = #{materialTotal},</if> <if test="materialTotal != null">material_total = #{materialTotal},</if>
<if test="numTotal != null">num_total = #{numTotal},</if> <if test="numTotal != null">num_total = #{numTotal},</if>

8
ruoyi-admin/src/main/resources/mapper/quality/QualityRefundsExchangesUnqualifiedMapper.xml

@ -36,6 +36,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where refunds_exchanges_unqualified_id = #{refundsExchangesUnqualifiedId} where refunds_exchanges_unqualified_id = #{refundsExchangesUnqualifiedId}
</select> </select>
<select id="selectRefundsExchangesUnqualifiedByNoAndCode" parameterType="QualityRefundsExchangesUnqualified" resultMap="QualityRefundsExchangesUnqualifiedResult">
<include refid="selectQualityRefundsExchangesUnqualifiedVo"/>
where refunds_exchanges_code = #{refundsExchangesCode}
and material_no = #{materialNo}
</select>
<insert id="insertQualityRefundsExchangesUnqualified" parameterType="QualityRefundsExchangesUnqualified" useGeneratedKeys="true" keyProperty="refundsExchangesUnqualifiedId"> <insert id="insertQualityRefundsExchangesUnqualified" parameterType="QualityRefundsExchangesUnqualified" useGeneratedKeys="true" keyProperty="refundsExchangesUnqualifiedId">
insert into quality_refunds_exchanges_unqualified insert into quality_refunds_exchanges_unqualified
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">

28
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/add.html

@ -8,7 +8,7 @@
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-refundsExchanges-add"> <form class="form-horizontal m" id="form-refundsExchanges-add">
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">付质检时间:</label> <label class="col-sm-4 control-label">交检时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="deliveryInspectionTime" class="form-control" placeholder="yyyy-MM-dd" type="text"> <input name="deliveryInspectionTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
@ -17,7 +17,7 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">品质备注:</label> <label class="col-sm-4 control-label">品质备注:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="qualityRemark" class="form-control" type="text"> <input name="qualityRemark" class="form-control" type="text">
</div> </div>
@ -45,6 +45,9 @@
<th:block th:include="include :: bootstrap-table-editable-js" /> <th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "quality/refundsExchanges" var prefix = ctx + "quality/refundsExchanges"
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/ '';
$("#form-refundsExchanges-add").validate({ $("#form-refundsExchanges-add").validate({
focusCleanup: true focusCleanup: true
}); });
@ -82,7 +85,11 @@
}; };
}); });
const combinedData = Object.assign({}, refundsExchangesData, { refundsExchangesDetails: materialDataList }); // 将全局变量 refundsExchangesCode 添加到要提交的数据中
const combinedData = Object.assign({}, refundsExchangesData, {
refundsExchangesDetails: materialDataList,
refundsExchangesCode: refundsExchangesCode // 直接使用全局变量
});
// 合并表单数据和表格数据 // 合并表单数据和表格数据
console.log(combinedData) console.log(combinedData)
// 使用 JSON.stringify() 序列化数据 // 使用 JSON.stringify() 序列化数据
@ -112,6 +119,12 @@
columns: [{ columns: [{
checkbox: true checkbox: true
}, },
{
title: '退换货单号',
field: 'refundsExchangesCode',
visible: false
},
{ {
title: '料号', title: '料号',
field: 'materialNo', field: 'materialNo',
@ -148,8 +161,9 @@
title: '品质报告', title: '品质报告',
align: 'center', align: 'center',
formatter: function(value, row, index) { formatter: function(value, row, index) {
// 这里直接使用row对象获取refundsExchangesCode,假设它是存在的
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="checkoutReport(\'' + row.materialNo + '\')"><i class="fa fa-plus"></i>报告</a> '); actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + refundsExchangesCode + '\')"><i class="fa fa-plus"></i>报告</a> ');
return actions.join(''); return actions.join('');
} }
}, },
@ -215,12 +229,12 @@
/*品质报告*/ /*品质报告*/
function qualityReport(materialNo, supplierCode) { function qualityReport(materialNo, refundsExchangesCode) {
var queryParams = new URLSearchParams(); var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo); queryParams.append('materialNo', materialNo);
queryParams.append('supplierCode', encodeURIComponent(supplierCode)); queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
var url = ctx + 'quality/qualityOrder/qualityReport?' + queryParams.toString(); var url = ctx + 'quality/refundsExchanges/qualityReport?' + queryParams.toString();
$.modal.open("品质报告", url); $.modal.open("品质报告", url);
} }

25
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/qualityOrderReport.html

@ -6,7 +6,7 @@
</head> </head>
<body class="white-bg"> <body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content"> <div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-qualityOrderReport-edit" th:object="${QualityRefundsExchangesUnqualified}"> <form class="form-horizontal m" id="form-qualityOrderReport-add">
<input name="materialNo" th:field="*{materialNo}" type="hidden"> <input name="materialNo" th:field="*{materialNo}" type="hidden">
<div class="container"> <div class="container">
<!--不合格数--> <!--不合格数-->
@ -30,10 +30,10 @@
<!--其他字段--> <!--其他字段-->
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">检验完成时间:</label> <label class="col-sm-3 control-label">检验完成时间:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="inspectionTime" th:value="${#dates.format(QualityRefundsExchangesUnqualified.inspectionTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text"> <input name="inspectionTime" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span> <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div> </div>
</div> </div>
@ -41,7 +41,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-4 control-label">备注:</label> <label class="col-sm-4 control-label">备注:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<textarea name="remark" th:field="*{remark}" class="form-control" type="text"></textarea> <textarea name="remark" class="form-control" type="text"></textarea>
</div> </div>
</div> </div>
</form> </form>
@ -50,18 +50,23 @@
<th:block th:include="include :: datetimepicker-js" /> <th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js"/> <th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript"> <script th:inline="javascript">
var prefix = ctx + "quality/refundsExchanges";
var materialNo = /*[[${materialNo}]]*/'';
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/'';
var processBadClassificationDatas = [[${@dict.getType('process_bad_classification')}]]; var processBadClassificationDatas = [[${@dict.getType('process_bad_classification')}]];
var processBadGradeDatas = [[${@dict.getType('process_bad_grade')}]]; var processBadGradeDatas = [[${@dict.getType('process_bad_grade')}]];
var $table = $("#bootstrap-unqualified-table"); var $table = $("#bootstrap-unqualified-table");
var prefix = ctx + "quality/qualityOrder";
$("#form-qualityOrderReport-edit").validate({ $("#form-qualityOrderReport-add").validate({
focusCleanup: true focusCleanup: true
}); });
function submitHandler() { function submitHandler() {
// 获取表单数据 // 获取表单数据
const qualityReportData = $("#form-qualityOrderReport-edit").serializeArray().reduce((obj, item) => { const qualityReportData = $("#form-qualityOrderReport-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value; obj[item.name] = item.value;
return obj; return obj;
}, {}); }, {});
@ -85,7 +90,11 @@
}; };
}); });
const combinedData = Object.assign({}, qualityReportData, { unqualifiedDataList: unqualifiedDataList }); const combinedData = Object.assign({}, qualityReportData, {
refundsExchangesUnqualifieds: unqualifiedDataList ,
materialNo:materialNo,
refundsExchangesCode:refundsExchangesCode
});
// 合并表单数据和表格数据 // 合并表单数据和表格数据
// const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData); // const combinedData = Object.assign({}, ...complaintNoticeData.array(item => ({ [item.name]: item.value })), ...materialData);
console.log(combinedData) console.log(combinedData)

48
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/refundsExchanges.html

@ -64,7 +64,7 @@
</div> </div>
<div class="btn-group-sm" id="toolbar" role="group"> <div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="quality:refundsExchanges:add"> <a id="addRefundsButton" class="btn btn-success" onclick="add()" shiro:hasPermission="quality:refundsExchanges:add">
<i class="fa fa-plus"></i> 添加退货单 <i class="fa fa-plus"></i> 添加退货单
</a> </a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="quality:refundsExchanges:export"> <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="quality:refundsExchanges:export">
@ -81,6 +81,8 @@
var editFlag = [[${@permission.hasPermi('quality:refundsExchanges:edit')}]]; var editFlag = [[${@permission.hasPermi('quality:refundsExchanges:edit')}]];
var closingProceduresFlag = [[${@permission.hasPermi('quality:refundsExchanges:closingProcedures')}]]; var closingProceduresFlag = [[${@permission.hasPermi('quality:refundsExchanges:closingProcedures')}]];
var returnBeforeStorageDetailFlag = [[${@permission.hasPermi('quality:refundsExchanges:returnBeforeStorageDetail')}]];
var returnAfterStorageDetailFlag = [[${@permission.hasPermi('quality:refundsExchanges:returnAfterStorageDetailFlag')}]];
var refundsExchangesStatusDatas = [[${@dict.getType('refunds_exchanges_status')}]]; var refundsExchangesStatusDatas = [[${@dict.getType('refunds_exchanges_status')}]];
var qualityWarehouseStatusDatas = [[${@dict.getType('quality_warehouse_status')}]]; var qualityWarehouseStatusDatas = [[${@dict.getType('quality_warehouse_status')}]];
@ -185,21 +187,63 @@
formatter: function(value, row, index) { formatter: function(value, row, index) {
var actions = []; var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
if (row.refundsExchangesStatus != 1){ if (row.refundsExchangesStatus == 0 && row.qualityPurchaseStatus == 4){
actions.push('<a class="btn btn-success btn-xs ' + closingProceduresFlag + '" href="javascript:void(0)" onclick="closingProcedures(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>结案</a> '); actions.push('<a class="btn btn-success btn-xs ' + closingProceduresFlag + '" href="javascript:void(0)" onclick="closingProcedures(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>结案</a> ');
} }
/*入库前退货详情*/
if (row.qualityReturnNode == 0){
actions.push('<a class="btn btn-success btn-xs ' + returnBeforeStorageDetailFlag + '" href="javascript:void(0)" onclick="returnBeforeStorageDetail(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>详情</a> ');
}
/*入库后退货详情*/
if (row.qualityReturnNode == 1){
actions.push('<a class="btn btn-success btn-xs ' + returnAfterStorageDetailFlag + '" href="javascript:void(0)" onclick="returnAfterStorageDetail(\'' + row.refundsExchangesId + '\')"><i class="fa fa-edit"></i>详情</a> ');
}
return actions.join(''); return actions.join('');
} }
}] }]
}; };
$.table.init(options); $.table.init(options);
}); });
/*入库前退货详情*/
function returnBeforeStorageDetail(refundsExchangesId){
var url = ctx + 'quality/refundsExchanges/returnBeforeStorageDetail/' +refundsExchangesId;
$.modal.open("入库前退货详情",url);
}
/*入库后退货详情*/
function returnAfterStorageDetail(refundsExchangesId){
var url = ctx + 'quality/refundsExchanges/returnAfterStorageDetail/' +refundsExchangesId;
$.modal.open("入库后退货详情",url);
}
/*结案*/ /*结案*/
function closingProcedures(refundsExchangesId){ function closingProcedures(refundsExchangesId){
var url = ctx + 'quality/refundsExchanges/closingProcedures/' +refundsExchangesId; var url = ctx + 'quality/refundsExchanges/closingProcedures/' +refundsExchangesId;
$.modal.open("结案",url); $.modal.open("结案",url);
} }
function add() {
var rows = $("#bootstrap-table").bootstrapTable('getSelections');
console.log("rows" + rows);
if (rows.length == 1){
// var curQualityReturnNode = rows[0].qualityReturnNode;
// var curRefundsExchangesCode = rows[0].refundsExchangesCode;
if (rows[0].qualityReturnNode == 1){
var url = ctx + 'quality/refundsExchanges/add/' +rows[0].refundsExchangesCode;
$.modal.open("添加退换货",url);
}else {
$.modal.msgWarning("请选择退货节点为入库后退货的数据!")
}
// $.modal.open("添加" + table.options.modalName, $.operate.addUrl(rows[0].id));
}else{
$.modal.msgWarning("只能选中一行作为添加对象!")
}
};
</script> </script>
</body> </body>
</html> </html>

224
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnAfterStorageDetail.html

@ -0,0 +1,224 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增品质管理退换货单')" />
<th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-returnAfterStorageDetail-edit" th:object="${qualityRefundsExchanges}">
<input name="refundsExchangesId" th:field="*{refundsExchangesId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">退换货单号:</label>
<div class="col-sm-8">
<input name="refundsExchangesCode" th:field="*{refundsExchangesCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">交检时间:</label>
<div class="col-sm-8">
<div class="input-group date">
<input name="deliveryInspectionTime" th:value="${#dates.format(qualityRefundsExchanges.deliveryInspectionTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">
<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
</div>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品质备注:</label>
<div class="col-sm-8">
<input name="qualityRemark" th:field="*{qualityRemark}" class="form-control" type="text">
</div>
</div>
</form>
<!--物料信息-->
<div class="container">
<div class="row">
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<!--用于可以修改列表字段的插件-->
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var prefix = ctx + "quality/refundsExchanges"
var refundsExchangesCode = /*[[${refundsExchangesCode}]]*/ '';
var qualityRefundsExchanges = [[${qualityRefundsExchanges}]];
$("input[name='deliveryInspectionTime']").datetimepicker({
format: "yyyy-mm-dd",
minView: "month",
autoclose: true
});
$("#form-returnAfterStorageDetail-edit").validate({
focusCleanup: true
});
// 新增提交
function submitHandler() {
// 获取表单数据
const refundsExchangesData = $("#form-refundsExchanges-add").serializeArray().reduce((obj, item) => {
obj[item.name] = item.value;
return obj;
}, {});
// 获取bootstrap-table的数据,这里假设你使用bootstrap-table的API获取所有数据
var table = $('#bootstrap-table').bootstrapTable('getData');
// 检查表格数据是否为空
if (table.length===0){
$.modal.alertWarning("请至少添加一条物料数据后再保存!");
return;
}
console.log(table);
// 将表数据转换成与complaintNoticeData格式一致的数组
var materialDataList = table.map(function(item) {
// 根据实际字段名调整
return {
"materialNo": item.materialNo, // 假设id对应materialId
"materialPhotourl": item.materialPhotourl, // 假设quantity是物料数量字段
"materialName": item.materialName,
"materialType": item.materialType,
"materialDescribe": item.materialDescribe,
"materialUnit": item.materialUnit,
"materialBrand": item.materialBrand,
"materialProcessMethod":item.materialProcessMethod,
"refundsExchangesNum":item.refundsExchangesNum
// ...其他字段
};
});
// 将全局变量 refundsExchangesCode 添加到要提交的数据中
const combinedData = Object.assign({}, refundsExchangesData, {
refundsExchangesDetails: materialDataList,
refundsExchangesCode: refundsExchangesCode // 直接使用全局变量
});
// 合并表单数据和表格数据
console.log(combinedData)
// 使用 JSON.stringify() 序列化数据
const jsonData = JSON.stringify(combinedData);
// 发送 AJAX 请求到后端接口
$.operate.saveJson(prefix + "/add", jsonData);
}
//物料信息展示列表
$(function() {
var options = {
modalName: "选择物料",
url: ctx + "quality/refundsExchanges/getMaterialListByRefundsExchangesCode",
queryParams: queryParams,
showSearch: false,
showRefresh: false,
showToggle: false,
showColumns: false,
pagination: false, // 设置不分页
columns: [{
checkbox: true
},
{
title: '退换货单号',
field: 'refundsExchangesCode',
visible: false
},
{
title: '料号',
field: 'materialNo',
},
{
title: '图片',
field: 'materialPhotourl',
},
{
title: '物料名称',
field: 'materialName',
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '描述',
field: 'materialDescribe',
},
{
title: '品牌',
field: 'materialBrand',
},
{
title: '单位',
field: 'materialUnit',
},
{
title: '加工方式',
field: 'materialProcessMethod',
},
{
title: '品质报告',
align: 'center',
formatter: function(value, row, index) {
// 这里直接使用row对象获取refundsExchangesCode,假设它是存在的
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + refundsExchangesCode + '\')"><i class="fa fa-plus"></i>报告</a> ');
return actions.join('');
}
},
{
title: '退换数',
field: 'refundsExchangesNum',
}
]
};
$.table.init(options);
})
function queryParams(params) {
var curParams = {
// 传递参数查询参数
refundsExchangesCode: qualityRefundsExchanges.refundsExchangesCode
};
console.log(curParams);
return curParams;
}
function doSubmit(index, layero,uniqueId){
console.log(uniqueId);
var iframeWin = window[layero.find('iframe')[0]['name']];
var rowData = iframeWin.$('#bootstrap-materialSelect-table').bootstrapTable('getSelections')[0];
console.log("rowData: "+rowData);
$("#bootstrap-table").bootstrapTable('insertRow', {
index:1,
row: {
materialNo:rowData.materialNo,
materialPhotourl:rowData.materialPhotourl,
materialName: rowData.materialName,
materialType: rowData.materialType,
materialDescribe: rowData.materialDescribe,
materialBrand: rowData.materialBrand,
materialUnit: rowData.materialUnit,
materialProcessMethod: rowData.materialProcessMethod,
makeTotal:rowData.makeTotal
}
})
layer.close(index);
}
/*品质报告*/
function qualityReport(materialNo, refundsExchangesCode) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('refundsExchangesCode', encodeURIComponent(refundsExchangesCode));
var url = ctx + 'quality/refundsExchanges/qualityReport?' + queryParams.toString();
$.modal.open("品质报告", url);
}
</script>
</body>
</html>

195
ruoyi-admin/src/main/resources/templates/quality/refundsExchanges/returnBeforeStorageDetail.html

@ -0,0 +1,195 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('入库前退货详情')" />
<th:block th:include="include :: datetimepicker-css" />
<style>
.supplier-value {
display: flex;
align-items: center;
justify-content: space-between;
}
.supplier-value span {
margin-right: 10px;
}
.info-separator::after {
content: "-";
margin: 0 5px;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-qualityRefundsExchanges-edit" th:object="${qualityRefundsExchanges}">
<input name="refundsExchangesId" th:field="*{refundsExchangesId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">退换货单号:</label>
<div class="col-sm-8">
<input name="refundsExchangesCode" th:field="*{refundsExchangesCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">关联单号:</label>
<div class="col-sm-8">
<input name="relatedOrderCode" th:field="*{relatedOrderCode}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">品质单入库类型:</label>
<div class="col-sm-8">
<select name="warehouseStorageType" class="form-control m-b" th:with="type=${@dict.getType('warehouse_storage_type')}">
<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}" th:field="*{warehouseStorageType}"></option>
</select>
</div>
</div>
<div class="container">
<!--物料相关-->
<div class="row">
<div class="col-sm-12" id="tablesContainer">
<!-- 表格将在这里动态生成 -->
</div>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: bootstrap-table-editable-js" />
<script th:inline="javascript">
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]]
var prefix = ctx + "quality/refundsExchanges";
$("#form-qualityRefundsExchanges-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/returnBeforeStorageDetail", $('#form-qualityRefundsExchanges-edit').serialize());
}
}
$(function() {
// 假设refundsExchangesCode已经定义或者可以通过某种方式获取到
var refundsExchangesCode = [[${qualityRefundsExchanges.refundsExchangesCode}]]; // 这里需要实际赋值,比如从前端某个地方读取
$.getJSON(prefix + "/detailListGroupedBySupplier?refundsExchangesCode=" + refundsExchangesCode, function(data) {
for (var supplierCode in data) {
if (data.hasOwnProperty(supplierCode)) {
var supplierData = data[supplierCode];
createTableForSupplier(supplierCode, supplierData);
}
}
});
});
function createTableForSupplier(supplierCode, supplierData) {
var tableId = 'bootstrap-table-' + supplierCode.replace(/[^a-z0-9]/gi, '_').toLowerCase();
var $tableWrapper = $('<div class="table-responsive mt-3"></div>');
// 确保supplierData至少有一条记录,并从中提取供应商详细信息
var supplierInfo = supplierData.length > 0 ? supplierData[0] : {}; // 默认为空对象,以防数据不存在
// 构建含有额外供应商信息的标题字符串
var headerTitle ='供应商'+'</br>'+supplierCode + ' - ' + (supplierInfo.supplierName || 'N/A') +
' </br> ' + (supplierInfo.customerContact || 'N/A') +
' - ' + (supplierInfo.contactNumber || 'N/A') +
' - ' + (supplierInfo.supplierAddress || 'N/A');
var $header = $('<h4>' + headerTitle + '</h4>');
var $table = $('<table id="' + tableId + '" class="table table-striped table-bordered"></table>');
$table.bootstrapTable({
data: supplierData,
columns: [{
checkbox: true
},
{
title: '供应商ID',
field: 'supplierCode',
visible: false
},
{
title: '料号',
field: 'materialNo'
}, {
title: '物料名称',
field: 'materialName'
},
{
title: '物料类型',
field: 'materialType',
},
{
title: '物料图片地址',
field: 'materialPhotourl',
},
{
title: '物料描述',
field: 'materialDescribe',
},
{
title: '物料品牌',
field: 'materialBrand',
},
{
title: '物料单位',
field: 'materialUnit',
},
{
title: '物料加工方式',
field: 'materialProcessMethod',
},
{
title: '订单数',
field: 'makeTotal',
},
{
title: '品质已合格数',
field: 'qualityHasqualifiedNum',
},
{
title: '本次到货数',
field: 'thisArrivedNum',
editable:{
type:'text'
},
required:true
},
{
title: '品质报告',
align: 'center',
formatter: function(value, row, index) {
// 这里直接使用row对象获取supplierCode,假设它是存在的
var actions = [];
actions.push('<a class="btn btn-success btn-xs" href="javascript:void(0)" onclick="qualityReport(\'' + row.materialNo + '\', \'' + row.supplierCode + '\')"><i class="fa fa-plus"></i>报告</a> ');
return actions.join('');
}
},
{
title: '品质不合格数',
field: 'qualityUnqualifiedNum',
}]
});
$tableWrapper.append($header).append($table);
$('#tablesContainer').append($tableWrapper);
}
/*品质报告*/
function qualityReport(materialNo, supplierCode) {
var queryParams = new URLSearchParams();
queryParams.append('materialNo', materialNo);
queryParams.append('supplierCode', encodeURIComponent(supplierCode));
var url = ctx + 'quality/qualityOrder/qualityReport?' + queryParams.toString();
$.modal.open("品质报告", url);
}
</script>
</body>
</html>
Loading…
Cancel
Save