Browse Source

230619 委外领料单、供应商索赔扣款单

erp、
qianyu 1 year ago
parent
commit
df1aec4048
  1. 12
      ruoyi-admin/src/main/java/com/ruoyi/main.java
  2. 198
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.java
  3. 10
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/MaterialRequisitionDetail.java
  4. 190
      ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualitySupplierDeductionController.java
  5. 275
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualitySupplierDeduction.java
  6. 297
      ruoyi-admin/src/main/java/com/ruoyi/quality/domain/exportDto/QualitySupplierDeductionDto.java
  7. 61
      ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualitySupplierDeductionMapper.java
  8. 61
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualitySupplierDeductionService.java
  9. 94
      ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualitySupplierDeductionServiceImpl.java
  10. 14
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysBomBcp.java
  11. 6
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysBomRawMaterial.java
  12. 9
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysBomSubsidiaryMaterial.java
  13. 9
      ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysFinishProduct.java
  14. 1
      ruoyi-admin/src/main/resources/mapper/manufacture/MaterialRequisitionDetailMapper.xml
  15. 138
      ruoyi-admin/src/main/resources/mapper/quality/QualitySupplierDeductionMapper.xml
  16. 1
      ruoyi-admin/src/main/resources/mapper/system/SysBomBcpMapper.xml
  17. 7
      ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/add.html
  18. 82
      ruoyi-admin/src/main/resources/templates/outsource/materialRequisitionOutsource/add.html
  19. 2
      ruoyi-admin/src/main/resources/templates/outsource/materialRequisitionOutsource/materialRequisitionOutsource.html
  20. 184
      ruoyi-admin/src/main/resources/templates/quality/qualitySupplierDeduction/add.html
  21. 184
      ruoyi-admin/src/main/resources/templates/quality/qualitySupplierDeduction/edit.html
  22. 217
      ruoyi-admin/src/main/resources/templates/quality/qualitySupplierDeduction/qualitySupplierDeduction.html
  23. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.class
  24. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/MaterialRequisitionDetail.class
  25. BIN
      ruoyi-admin/target/classes/com/ruoyi/system/domain/SysBomBcp.class
  26. BIN
      ruoyi-admin/target/classes/com/ruoyi/system/domain/SysBomRawMaterial.class
  27. BIN
      ruoyi-admin/target/classes/com/ruoyi/system/domain/SysBomSubsidiaryMaterial.class
  28. BIN
      ruoyi-admin/target/classes/com/ruoyi/system/domain/SysFinishProduct.class
  29. 1
      ruoyi-admin/target/classes/mapper/manufacture/MaterialRequisitionDetailMapper.xml
  30. 1
      ruoyi-admin/target/classes/mapper/system/SysBomBcpMapper.xml
  31. 7
      ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/add.html

12
ruoyi-admin/src/main/java/com/ruoyi/main.java

@ -0,0 +1,12 @@
package com.ruoyi;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.manufacture.controller.MaterialRequisitionInfoController;
import java.util.Scanner;
public class main {
public static void main(String args[]){
}
}

198
ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.java

@ -5,6 +5,7 @@ import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.util.MapUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.excel.write.metadata.fill.FillWrapper;
import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.ruoyi.ck.utils.Result;
@ -26,15 +27,19 @@ import com.ruoyi.outsource.domain.OutsourceOrderMaterial;
import com.ruoyi.outsource.service.IOutsourceOrderMaterialService;
import com.ruoyi.outsource.service.impl.OutsourceOrderMaterialServiceImpl;
import com.ruoyi.manufacture.service.IWorkOrderInfoService;
import com.ruoyi.system.domain.SysBom;
import com.ruoyi.system.domain.SysBomRawMaterial;
import com.ruoyi.system.service.ISysBomBcpService;
import com.ruoyi.system.service.ISysBomRawMaterialService;
import com.ruoyi.system.service.ISysBomService;
import com.ruoyi.system.service.ISysDictTypeService;
import com.ruoyi.storehouse.domain.OutboundDetail;
import com.ruoyi.storehouse.domain.exportDto.OutboundDetailDto;
import com.ruoyi.system.domain.*;
import com.ruoyi.system.service.*;
import com.ruoyi.system.service.impl.SysBomBcpServiceImpl;
import com.ruoyi.system.service.impl.SysBomRawMaterialServiceImpl;
import com.ruoyi.system.service.impl.SysBomServiceImpl;
import com.ruoyi.system.service.impl.SysBomSubsidiaryMaterialServiceImpl;
import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
import com.sun.xml.internal.messaging.saaj.util.ByteOutputStream;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
@ -43,12 +48,10 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.*;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.text.SimpleDateFormat;
import java.util.*;
import static com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder.log;
@ -84,7 +87,14 @@ public class MaterialRequisitionInfoController extends BaseController
@Autowired
private ISysBomRawMaterialService sysBomRawMaterialService;
@Autowired
private ISysBomSubsidiaryMaterialService sysBomSubsidiaryMaterialService;
@Autowired
private IWorkOrderInfoService workOrderInfoService;
@Autowired
private IOutsourceOrderMaterialService outsourceOrderMaterialService;
@Autowired
private ISysFinishProductService sysFinishProductService;
// @RequiresPermissions("manufacture:materialRequisitionInfo:view")
// @GetMapping()
@ -592,24 +602,178 @@ public class MaterialRequisitionInfoController extends BaseController
/**
* 查询委外领料单物料明细List
*/
@RequiresPermissions("manufacture:materialRequisitionInfo:listOutsource")
@PostMapping("/selectOutsourceDetail")
// @RequiresPermissions("manufacture:materialRequisitionInfo:listOutsource")
@PostMapping("/selectOutsourceDetail/{outsourceOrderNumber}")
@ResponseBody
public void selectOutsourceDetail(MaterialRequisitionInfo materialRequisitionInfo){
public TableDataInfo selectOutsourceDetail(@PathVariable("outsourceOrderNumber")String outsourceOrderNumber){
startPage();
//委外订单
IOutsourceOrderMaterialService outsourceOrderMaterialService = new OutsourceOrderMaterialServiceImpl();
List<OutsourceOrderMaterial> orderMaterialList = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(new OutsourceOrderMaterial(materialRequisitionInfo.getSalesOrderNumber()));
List<OutsourceOrderMaterial> orderMaterialList = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(new OutsourceOrderMaterial(outsourceOrderNumber));
//委外明细
List<MaterialRequisitionDetail> materialRequisitionDetailList = new ArrayList<>();
//bom阶
int bomRank = 1;
for (OutsourceOrderMaterial outsourceOrderMaterial : orderMaterialList) {
List<MaterialRequisitionDetail> list = sysBomBcpAllList(bomRank,Double.valueOf(outsourceOrderMaterial.getQuantity()),new SysBomBcp(outsourceOrderMaterial.getMaterialCode()));
if (list.size()>0){
materialRequisitionDetailList.addAll(list);
}
}
return getDataTable(materialRequisitionDetailList);
}
@RequiresPermissions("manufacture:materialRequisitionInfo:export")
@Log(title = "领料单", businessType = BusinessType.EXPORT)
@PostMapping("/exportOutsource/{materialRequisitionId}")
@ResponseBody
public void exportOutsource(@PathVariable("materialRequisitionId") Long materialRequisitionId, HttpServletResponse response) throws IOException {
//委外领料
MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
//委外订单
List<OutsourceOrderMaterial> orderMaterialList = outsourceOrderMaterialService.selectOutsourceOrderMaterialList(new OutsourceOrderMaterial(materialRequisitionInfo.getOutsourceOrderNumber()));
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("委外领料单", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
String templateFileName = "C:\\exportTemplates\\exportMaterialRequisitionOutsource.xlsx";
ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
Map<OutsourceOrderMaterial,List<MaterialRequisitionDetailDto>> map = new HashMap<>();
for (OutsourceOrderMaterial orderMaterial : orderMaterialList) {
List<MaterialRequisitionDetail> materialRequisitionDetailList = exportOutsourceList(materialRequisitionInfo.getMaterialRequisitionNumber(), orderMaterial.getMaterialCode());
List<MaterialRequisitionDetailDto> materialRequisitionDetailDtoList = new ArrayList<>();
try {
int number = 0;
Iterator materialRequisitionDetailValues = materialRequisitionDetailList.iterator();
while (materialRequisitionDetailValues.hasNext()) {
Object detailValues = materialRequisitionDetailValues.next();
MaterialRequisitionDetailDto detailDto = new MaterialRequisitionDetailDto();
BeanUtils.copyProperties(detailValues, detailDto);
detailDto.setNumber(++number);
materialRequisitionDetailDtoList.add(detailDto);
}
} catch (Exception e) {
log.error(">>>>>>异常OutboundDetailDto<<<<<<", e);
}
map.put(orderMaterial,materialRequisitionDetailDtoList);
}
File file = new File(templateFileName);
try(FileInputStream fileInputStream = new FileInputStream(file); ByteArrayOutputStream bos = new ByteArrayOutputStream()){
int sheetCount = map.size();
XSSFWorkbook workbook = new XSSFWorkbook(fileInputStream);
for (int i = 1; i < sheetCount; i++) {
workbook.cloneSheet(0,"sheet"+(i+1));
}
workbook.write(bos);
byte[] bArray = bos.toByteArray();
InputStream is = new ByteArrayInputStream(bArray);
ExcelWriter excelWriter = EasyExcel.write(response.getOutputStream(), MaterialRequisitionDetailDto.class).withTemplate(is).registerWriteHandler(mergePrevColUtils).build();
int i = 0;
for (OutsourceOrderMaterial orderMaterial : map.keySet()) {
List<SysFinishProduct> finishProductList = sysFinishProductService.selectSysFinishProductList(new SysFinishProduct(orderMaterial.getMaterialCode()));
List<SysFinishProduct> list=new ArrayList<>();
for (MaterialRequisitionDetailDto materialRequisitionDetailDto : map.get(orderMaterial)) {
list.add(finishProductList.get(0));
}
WriteSheet writeSheet = EasyExcel.writerSheet(i++).build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
excelWriter.fill(new FillWrapper("material",map.get(orderMaterial)), fillConfig, writeSheet);
excelWriter.fill(new FillWrapper("finish",list), writeSheet);
Map<String, Object> excelMap = MapUtils.newHashMap();
SimpleDateFormat format = new SimpleDateFormat("yyyy年MM月dd日");
excelMap.put("materialRequisitionNumber", materialRequisitionInfo.getMaterialRequisitionNumber());
excelMap.put("salesOrderNumber", materialRequisitionInfo.getOutsourceOrderNumber());
//暂时存在问题
excelMap.put("typeMachine",finishProductList.get(0).getTypeMachine());
excelMap.put("firstAddTime",format.format( new SimpleDateFormat("yyyy-MM-dd").parse(materialRequisitionInfo.getFirstAddTime())));
excelMap.put("quantity",orderMaterial.getQuantity());
excelMap.put("finishCode",orderMaterial.getMaterialCode());
excelMap.put("nowDate",format.format(new Date()));
excelMap.put("deliveryDate",format.format(new SimpleDateFormat("yyyy-MM-dd").parse(orderMaterial.getDeliveryDate())));
excelMap.put("finishName",orderMaterial.getMaterialName());
excelWriter.fill(excelMap,writeSheet);
}
excelWriter.finish();
}catch (Exception e){
e.printStackTrace();
}
}
private List<MaterialRequisitionDetail> exportOutsourceList(String materialRequisitionNumber,String materialCode) {
List<MaterialRequisitionDetail> result = new ArrayList<>();
List<MaterialRequisitionDetail> materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(new MaterialRequisitionDetail(materialRequisitionNumber,materialCode));
if (materialRequisitionDetailList.size()>0){
result.addAll(materialRequisitionDetailList);
for (MaterialRequisitionDetail materialRequisitionDetail : materialRequisitionDetailList) {
result.addAll(exportOutsourceList(materialRequisitionNumber,materialRequisitionDetail.getMaterialCode()));
}
}
return result;
}
private List<MaterialRequisitionDetail> sysBomBcpAllList(int bomRank,Double quantity,SysBomBcp sysBomBcp) {
List<MaterialRequisitionDetail> materialRequisitionDetailList = new ArrayList<>();
List<SysBomBcp> bomBcpList =sysBomBcpService.selectSysBomBcpList(sysBomBcp);
List<SysBomRawMaterial> rawMaterialList = sysBomRawMaterialService.selectSysBomRawMaterialList(new SysBomRawMaterial(sysBomBcp.getFinishProductCode()));
List<SysBomSubsidiaryMaterial> subsidiaryMaterialList = sysBomSubsidiaryMaterialService.selectSysBomSubsidiaryMaterialList(new SysBomSubsidiaryMaterial(sysBomBcp.getFinishProductCode()));
if(rawMaterialList.size()>0){
for (SysBomRawMaterial rawMaterial : rawMaterialList) {
MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
materialRequisitionDetail.setMaterialCode(rawMaterial.getRawMaterialCode()); //物料代码
materialRequisitionDetail.setMaterialName(rawMaterial.getRawMaterialName()); //物料名称
materialRequisitionDetail.setSpecificationModel(rawMaterial.getSpecificationModel()); //规格型号
materialRequisitionDetail.setItemNumber(rawMaterial.getSupplierNumber()); //料号
materialRequisitionDetail.setInventoryUnit(rawMaterial.getInventoryUnit()); //单位
materialRequisitionDetail.setUnitUsage(rawMaterial.getRawMaterialConsumption()); //单位用量
materialRequisitionDetail.setUpFinishProductCode(rawMaterial.getFinishProductCode()); //上级半成品代码
materialRequisitionDetail.setPlanQuantity(String.valueOf(Double.valueOf(rawMaterial.getRawMaterialConsumption()) * quantity)); //计划数量
materialRequisitionDetail.setMaterialType("原料"); //物料类别
materialRequisitionDetail.setBomRank(String.valueOf(bomRank)); //bom阶
materialRequisitionDetailList.add(materialRequisitionDetail);
}
}
if (subsidiaryMaterialList.size()>0){
for (SysBomSubsidiaryMaterial subsidiaryMaterial : subsidiaryMaterialList) {
MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
materialRequisitionDetail.setMaterialCode(subsidiaryMaterial.getSubsidiaryMaterialCode()); //物料代码
materialRequisitionDetail.setMaterialName(subsidiaryMaterial.getSubsidiaryMaterialName()); //物料名称
materialRequisitionDetail.setSpecificationModel(subsidiaryMaterial.getSpecificationModel()); //规格型号
materialRequisitionDetail.setItemNumber(subsidiaryMaterial.getSupplierNumber()); //料号
materialRequisitionDetail.setInventoryUnit(subsidiaryMaterial.getInventoryUnit()); //单位
materialRequisitionDetail.setUnitUsage(subsidiaryMaterial.getSubsidiaryMaterialConsumption()); //单位用量
materialRequisitionDetail.setUpFinishProductCode(subsidiaryMaterial.getFinishProductCode()); //上级半成品代码
materialRequisitionDetail.setPlanQuantity(String.valueOf(Double.valueOf(subsidiaryMaterial.getSubsidiaryMaterialConsumption())*quantity)); //计划数量
materialRequisitionDetail.setMaterialType("辅料"); //物料类别
materialRequisitionDetail.setBomRank(String.valueOf(bomRank)); //bom阶
materialRequisitionDetailList.add(materialRequisitionDetail);
}
}
if(bomBcpList.size()>0){
for (SysBomBcp bomBcp : bomBcpList) {
quantity = Double.valueOf(bomBcp.getBcpMaterialConsumption())*quantity;
MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
materialRequisitionDetail.setMaterialCode(bomBcp.getBcpCode()); //物料代码
materialRequisitionDetail.setMaterialName(bomBcp.getBcpName()); //物料名称
materialRequisitionDetail.setSpecificationModel(bomBcp.getSpecificationModel()); //规格型号
materialRequisitionDetail.setItemNumber(bomBcp.getCustomerNumber()); //料号
materialRequisitionDetail.setInventoryUnit(bomBcp.getInventoryUnit()); //单位
materialRequisitionDetail.setUnitUsage(bomBcp.getBcpMaterialConsumption()); //单位用量
materialRequisitionDetail.setUpFinishProductCode(bomBcp.getFinishProductCode()); //上级半成品代码
materialRequisitionDetail.setPlanQuantity(String.valueOf(quantity)); //计划数量
materialRequisitionDetail.setMaterialType("半成品"); //物料类别
materialRequisitionDetail.setBomRank(String.valueOf(bomRank)); //bom阶
materialRequisitionDetailList.add(materialRequisitionDetail);
List<MaterialRequisitionDetail> list = sysBomBcpAllList(bomRank+1,quantity,new SysBomBcp(bomBcp.getBomBcpId(),bomBcp.getBcpCode()));
materialRequisitionDetailList.addAll(list);
}
}
return materialRequisitionDetailList;
}
}

10
ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/MaterialRequisitionDetail.java

@ -80,7 +80,15 @@ public class MaterialRequisitionDetail extends BaseEntity
@Excel(name = "上级半成品代码")
private String upFinishProductCode;
public void setMaterialRequisitionDetailId(Long materialRequisitionDetailId)
public MaterialRequisitionDetail() {
}
public MaterialRequisitionDetail(String materialRequisitionNumber, String upFinishProductCode) {
this.materialRequisitionNumber = materialRequisitionNumber;
this.upFinishProductCode = upFinishProductCode;
}
public void setMaterialRequisitionDetailId(Long materialRequisitionDetailId)
{
this.materialRequisitionDetailId = materialRequisitionDetailId;
}

190
ruoyi-admin/src/main/java/com/ruoyi/quality/controller/QualitySupplierDeductionController.java

@ -0,0 +1,190 @@
package com.ruoyi.quality.controller;
import java.io.IOException;
import java.net.URLEncoder;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.util.MapUtils;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.ruoyi.quality.domain.exportDto.QualitySupplierDeductionDto;
import com.ruoyi.storehouse.domain.exportDto.OutboundDetailDto;
import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.quality.domain.QualitySupplierDeduction;
import com.ruoyi.quality.service.IQualitySupplierDeductionService;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
import javax.servlet.http.HttpServletResponse;
/**
* qualitySupplierDeductionController
*
* @author ruoyi
* @date 2023-06-19
*/
@Controller
@RequestMapping("/quality/qualitySupplierDeduction")
public class QualitySupplierDeductionController extends BaseController
{
private String prefix = "quality/qualitySupplierDeduction";
@Autowired
private IQualitySupplierDeductionService qualitySupplierDeductionService;
@RequiresPermissions("quality:qualitySupplierDeduction:view")
@GetMapping()
public String qualitySupplierDeduction()
{
return prefix + "/qualitySupplierDeduction";
}
/**
* 查询qualitySupplierDeduction列表
*/
@RequiresPermissions("quality:qualitySupplierDeduction:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(QualitySupplierDeduction qualitySupplierDeduction)
{
startPage();
List<QualitySupplierDeduction> list = qualitySupplierDeductionService.selectQualitySupplierDeductionList(qualitySupplierDeduction);
return getDataTable(list);
}
/**
* 导出qualitySupplierDeduction列表
*/
@RequiresPermissions("quality:qualitySupplierDeduction:export")
@Log(title = "qualitySupplierDeduction", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(QualitySupplierDeduction qualitySupplierDeduction)
{
List<QualitySupplierDeduction> list = qualitySupplierDeductionService.selectQualitySupplierDeductionList(qualitySupplierDeduction);
ExcelUtil<QualitySupplierDeduction> util = new ExcelUtil<QualitySupplierDeduction>(QualitySupplierDeduction.class);
return util.exportExcel(list, "qualitySupplierDeduction数据");
}
/**
* 导出原料出库单
*/
@RequiresPermissions("storehouse:outboundInfo:export")
@Log(title = "outboundInfo", businessType = BusinessType.EXPORT)
@PostMapping("/export/{qualitySupplierDeductionId}")
@ResponseBody
public void exportYL(@PathVariable("qualitySupplierDeductionId") Long qualitySupplierDeductionId , HttpServletResponse response) throws IOException {
QualitySupplierDeduction qualitySupplierDeduction= qualitySupplierDeductionService.selectQualitySupplierDeductionById(qualitySupplierDeductionId);
ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("供应商索赔扣款单", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
String templateFileName = "C:\\exportTemplates\\exportQualitySupplierDeduction.xlsx";
try (ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream(), QualitySupplierDeductionDto.class)
.withTemplate(templateFileName)
.registerWriteHandler(mergePrevColUtils)
.build()) {
WriteSheet writeSheet = EasyExcel.writerSheet().build();
Map<String, Object> map = MapUtils.newHashMap();
map.put("supplierCode", qualitySupplierDeduction.getSupplierCode());
map.put("modeOfService", qualitySupplierDeduction.getModeOfService());
map.put("acceptanceDepartment", qualitySupplierDeduction.getAcceptanceDepartment());
map.put("acceptancePerson", qualitySupplierDeduction.getAcceptancePerson());
map.put("contactNumber", qualitySupplierDeduction.getContactNumber());
map.put("reworkLaborCost", qualitySupplierDeduction.getReworkLaborCost());
map.put("customerDeduction", qualitySupplierDeduction.getCustomerDeduction());
map.put("punitiveDamage", qualitySupplierDeduction.getPunitiveDamage());
map.put("materialScrapCost", qualitySupplierDeduction.getMaterialScrapCost());
map.put("transportationExpenses", qualitySupplierDeduction.getTransportationExpenses());
map.put("otherName", "其他("+qualitySupplierDeduction.getOtherName()+")");
map.put("othersCost", qualitySupplierDeduction.getOthersCost());
map.put("totalAmount", qualitySupplierDeduction.getTotalAmount());
map.put("proposePerson", qualitySupplierDeduction.getProposePerson());
map.put("reviewedPerson", qualitySupplierDeduction.getReviewedPerson());
map.put("approvalPerson", qualitySupplierDeduction.getApprovalPerson());
List<String> reasons = new ArrayList<>();
map.put("reason", qualitySupplierDeduction.getReason());
excelWriter.fill(map,writeSheet);
}
}
/**
* 新增qualitySupplierDeduction
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存qualitySupplierDeduction
*/
@RequiresPermissions("quality:qualitySupplierDeduction:add")
@Log(title = "qualitySupplierDeduction", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(QualitySupplierDeduction qualitySupplierDeduction)
{
return toAjax(qualitySupplierDeductionService.insertQualitySupplierDeduction(qualitySupplierDeduction));
}
/**
* 修改qualitySupplierDeduction
*/
@GetMapping("/edit/{supplierDeductionId}")
public String edit(@PathVariable("supplierDeductionId") Long supplierDeductionId, ModelMap mmap)
{
QualitySupplierDeduction qualitySupplierDeduction = qualitySupplierDeductionService.selectQualitySupplierDeductionById(supplierDeductionId);
mmap.put("qualitySupplierDeduction", qualitySupplierDeduction);
return prefix + "/edit";
}
/**
* 修改保存qualitySupplierDeduction
*/
@RequiresPermissions("quality:qualitySupplierDeduction:edit")
@Log(title = "qualitySupplierDeduction", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(QualitySupplierDeduction qualitySupplierDeduction)
{
return toAjax(qualitySupplierDeductionService.updateQualitySupplierDeduction(qualitySupplierDeduction));
}
/**
* 删除qualitySupplierDeduction
*/
@RequiresPermissions("quality:qualitySupplierDeduction:remove")
@Log(title = "qualitySupplierDeduction", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(qualitySupplierDeductionService.deleteQualitySupplierDeductionByIds(ids));
}
}

275
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/QualitySupplierDeduction.java

@ -0,0 +1,275 @@
package com.ruoyi.quality.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;
/**
* qualitySupplierDeduction对象 quality_supplier_deduction
*
* @author ruoyi
* @date 2023-06-19
*/
public class QualitySupplierDeduction extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long supplierDeductionId;
/** 供应商代码 */
@Excel(name = "供应商代码")
private String supplierCode;
/** 送达方式 */
@Excel(name = "送达方式")
private String modeOfService;
/** 受理部门 */
@Excel(name = "受理部门")
private String acceptanceDepartment;
/** 受理人 */
@Excel(name = "受理人")
private String acceptancePerson;
/** 联络方式 */
@Excel(name = "联络方式")
private String contactNumber;
/** 索赔扣款详细原因 */
@Excel(name = "索赔扣款详细原因")
private String reason;
/** 返工工时费 */
@Excel(name = "返工工时费")
private String reworkLaborCost;
/** 客户扣款 */
@Excel(name = "客户扣款")
private String customerDeduction;
/** 惩罚性罚款 */
@Excel(name = "惩罚性罚款")
private String punitiveDamage;
/** 物料报废费用 */
@Excel(name = "物料报废费用")
private String materialScrapCost;
/** 交通/运输费 */
@Excel(name = "交通/运输费")
private String transportationExpenses;
/** 其他名字 */
@Excel(name = "其他名字")
private String otherName;
/** 其他金额 */
@Excel(name = "其他金额")
private String othersCost;
/** 合计金额 */
@Excel(name = "合计金额")
private String totalAmount;
/** 提出人 */
@Excel(name = "提出人")
private String proposePerson;
/** 审核人 */
@Excel(name = "审核人")
private String reviewedPerson;
/** 复核人 */
@Excel(name = "复核人")
private String approvalPerson;
public void setSupplierDeductionId(Long supplierDeductionId)
{
this.supplierDeductionId = supplierDeductionId;
}
public Long getSupplierDeductionId()
{
return supplierDeductionId;
}
public void setSupplierCode(String supplierCode)
{
this.supplierCode = supplierCode;
}
public String getSupplierCode()
{
return supplierCode;
}
public void setModeOfService(String modeOfService)
{
this.modeOfService = modeOfService;
}
public String getModeOfService()
{
return modeOfService;
}
public void setAcceptanceDepartment(String acceptanceDepartment)
{
this.acceptanceDepartment = acceptanceDepartment;
}
public String getAcceptanceDepartment()
{
return acceptanceDepartment;
}
public void setAcceptancePerson(String acceptancePerson)
{
this.acceptancePerson = acceptancePerson;
}
public String getAcceptancePerson()
{
return acceptancePerson;
}
public void setContactNumber(String contactNumber)
{
this.contactNumber = contactNumber;
}
public String getContactNumber()
{
return contactNumber;
}
public void setReason(String reason)
{
this.reason = reason;
}
public String getReason()
{
return reason;
}
public void setReworkLaborCost(String reworkLaborCost)
{
this.reworkLaborCost = reworkLaborCost;
}
public String getReworkLaborCost()
{
return reworkLaborCost;
}
public void setCustomerDeduction(String customerDeduction)
{
this.customerDeduction = customerDeduction;
}
public String getCustomerDeduction()
{
return customerDeduction;
}
public void setPunitiveDamage(String punitiveDamage)
{
this.punitiveDamage = punitiveDamage;
}
public String getPunitiveDamage()
{
return punitiveDamage;
}
public void setMaterialScrapCost(String materialScrapCost)
{
this.materialScrapCost = materialScrapCost;
}
public String getMaterialScrapCost()
{
return materialScrapCost;
}
public void setTransportationExpenses(String transportationExpenses)
{
this.transportationExpenses = transportationExpenses;
}
public String getTransportationExpenses()
{
return transportationExpenses;
}
public void setOtherName(String otherName)
{
this.otherName = otherName;
}
public String getOtherName()
{
return otherName;
}
public void setOthersCost(String othersCost)
{
this.othersCost = othersCost;
}
public String getOthersCost()
{
return othersCost;
}
public void setTotalAmount(String totalAmount)
{
this.totalAmount = totalAmount;
}
public String getTotalAmount()
{
return totalAmount;
}
public void setProposePerson(String proposePerson)
{
this.proposePerson = proposePerson;
}
public String getProposePerson()
{
return proposePerson;
}
public void setReviewedPerson(String reviewedPerson)
{
this.reviewedPerson = reviewedPerson;
}
public String getReviewedPerson()
{
return reviewedPerson;
}
public void setApprovalPerson(String approvalPerson)
{
this.approvalPerson = approvalPerson;
}
public String getApprovalPerson()
{
return approvalPerson;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("supplierDeductionId", getSupplierDeductionId())
.append("supplierCode", getSupplierCode())
.append("modeOfService", getModeOfService())
.append("acceptanceDepartment", getAcceptanceDepartment())
.append("acceptancePerson", getAcceptancePerson())
.append("contactNumber", getContactNumber())
.append("reason", getReason())
.append("reworkLaborCost", getReworkLaborCost())
.append("customerDeduction", getCustomerDeduction())
.append("punitiveDamage", getPunitiveDamage())
.append("materialScrapCost", getMaterialScrapCost())
.append("transportationExpenses", getTransportationExpenses())
.append("otherName", getOtherName())
.append("othersCost", getOthersCost())
.append("totalAmount", getTotalAmount())
.append("proposePerson", getProposePerson())
.append("reviewedPerson", getReviewedPerson())
.append("approvalPerson", getApprovalPerson())
.toString();
}
}

297
ruoyi-admin/src/main/java/com/ruoyi/quality/domain/exportDto/QualitySupplierDeductionDto.java

@ -0,0 +1,297 @@
package com.ruoyi.quality.domain.exportDto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentFontStyle;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.BooleanEnum;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.alibaba.excel.enums.poi.HorizontalAlignmentEnum;
import com.alibaba.excel.enums.poi.VerticalAlignmentEnum;
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;
/**
* qualitySupplierDeduction对象 quality_supplier_deduction
*
* @author ruoyi
* @date 2023-06-19
*/
public class QualitySupplierDeductionDto extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** */
private Long supplierDeductionId;
/** 供应商代码 */
@ExcelProperty("供应商代码")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String supplierCode;
/** 送达方式 */
@ExcelProperty("送达方式")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String modeOfService;
/** 受理部门 */
@ExcelProperty("受理部门")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String acceptanceDepartment;
/** 受理人 */
@ExcelProperty("受理人")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String acceptancePerson;
/** 联络方式 */
@ExcelProperty("联络方式")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String contactNumber;
/** 索赔扣款详细原因 */
@ExcelProperty("索赔扣款详细原因")
@ContentStyle(horizontalAlignment = HorizontalAlignmentEnum.LEFT , verticalAlignment = VerticalAlignmentEnum.TOP , wrapped = BooleanEnum.TRUE)
private String reason;
/** 返工工时费 */
@ExcelProperty("返工工时费")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String reworkLaborCost;
/** 客户扣款 */
@ExcelProperty("客户扣款")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String customerDeduction;
/** 惩罚性罚款 */
@ExcelProperty("惩罚性罚款")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String punitiveDamage;
/** 物料报废费用 */
@ExcelProperty("物料报废费用")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String materialScrapCost;
/** 交通/运输费 */
@ExcelProperty("交通/运输费")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String transportationExpenses;
/** 其他名字 */
@ExcelProperty("其他名字")
@ContentFontStyle(fontName="等线")
private String otherName;
/** 其他金额 */
@ExcelProperty("其他金额")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String othersCost;
/** 合计金额 */
@ExcelProperty("合计金额")
@ContentStyle(borderTop = BorderStyleEnum.THIN , borderBottom = BorderStyleEnum.THIN , horizontalAlignment = HorizontalAlignmentEnum.CENTER , verticalAlignment = VerticalAlignmentEnum.CENTER)
private String totalAmount;
/** 提出人 */
@ExcelProperty("提出人")
private String proposePerson;
/** 审核人 */
@ExcelProperty("审核人")
private String reviewedPerson;
/** 复核人 */
@ExcelProperty("复核人")
@ContentStyle(borderRight = BorderStyleEnum.THIN)
private String approvalPerson;
public void setSupplierDeductionId(Long supplierDeductionId)
{
this.supplierDeductionId = supplierDeductionId;
}
public Long getSupplierDeductionId()
{
return supplierDeductionId;
}
public void setSupplierCode(String supplierCode)
{
this.supplierCode = supplierCode;
}
public String getSupplierCode()
{
return supplierCode;
}
public void setModeOfService(String modeOfService)
{
this.modeOfService = modeOfService;
}
public String getModeOfService()
{
return modeOfService;
}
public void setAcceptanceDepartment(String acceptanceDepartment)
{
this.acceptanceDepartment = acceptanceDepartment;
}
public String getAcceptanceDepartment()
{
return acceptanceDepartment;
}
public void setAcceptancePerson(String acceptancePerson)
{
this.acceptancePerson = acceptancePerson;
}
public String getAcceptancePerson()
{
return acceptancePerson;
}
public void setContactNumber(String contactNumber)
{
this.contactNumber = contactNumber;
}
public String getContactNumber()
{
return contactNumber;
}
public void setReason(String reason)
{
this.reason = reason;
}
public String getReason()
{
return reason;
}
public void setReworkLaborCost(String reworkLaborCost)
{
this.reworkLaborCost = reworkLaborCost;
}
public String getReworkLaborCost()
{
return reworkLaborCost;
}
public void setCustomerDeduction(String customerDeduction)
{
this.customerDeduction = customerDeduction;
}
public String getCustomerDeduction()
{
return customerDeduction;
}
public void setPunitiveDamage(String punitiveDamage)
{
this.punitiveDamage = punitiveDamage;
}
public String getPunitiveDamage()
{
return punitiveDamage;
}
public void setMaterialScrapCost(String materialScrapCost)
{
this.materialScrapCost = materialScrapCost;
}
public String getMaterialScrapCost()
{
return materialScrapCost;
}
public void setTransportationExpenses(String transportationExpenses)
{
this.transportationExpenses = transportationExpenses;
}
public String getTransportationExpenses()
{
return transportationExpenses;
}
public void setOtherName(String otherName)
{
this.otherName = otherName;
}
public String getOtherName()
{
return otherName;
}
public void setOthersCost(String othersCost)
{
this.othersCost = othersCost;
}
public String getOthersCost()
{
return othersCost;
}
public void setTotalAmount(String totalAmount)
{
this.totalAmount = totalAmount;
}
public String getTotalAmount()
{
return totalAmount;
}
public void setProposePerson(String proposePerson)
{
this.proposePerson = proposePerson;
}
public String getProposePerson()
{
return proposePerson;
}
public void setReviewedPerson(String reviewedPerson)
{
this.reviewedPerson = reviewedPerson;
}
public String getReviewedPerson()
{
return reviewedPerson;
}
public void setApprovalPerson(String approvalPerson)
{
this.approvalPerson = approvalPerson;
}
public String getApprovalPerson()
{
return approvalPerson;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("supplierDeductionId", getSupplierDeductionId())
.append("supplierCode", getSupplierCode())
.append("modeOfService", getModeOfService())
.append("acceptanceDepartment", getAcceptanceDepartment())
.append("acceptancePerson", getAcceptancePerson())
.append("contactNumber", getContactNumber())
.append("reason", getReason())
.append("reworkLaborCost", getReworkLaborCost())
.append("customerDeduction", getCustomerDeduction())
.append("punitiveDamage", getPunitiveDamage())
.append("materialScrapCost", getMaterialScrapCost())
.append("transportationExpenses", getTransportationExpenses())
.append("otherName", getOtherName())
.append("othersCost", getOthersCost())
.append("totalAmount", getTotalAmount())
.append("proposePerson", getProposePerson())
.append("reviewedPerson", getReviewedPerson())
.append("approvalPerson", getApprovalPerson())
.toString();
}
}

61
ruoyi-admin/src/main/java/com/ruoyi/quality/mapper/QualitySupplierDeductionMapper.java

@ -0,0 +1,61 @@
package com.ruoyi.quality.mapper;
import java.util.List;
import com.ruoyi.quality.domain.QualitySupplierDeduction;
/**
* qualitySupplierDeductionMapper接口
*
* @author ruoyi
* @date 2023-06-19
*/
public interface QualitySupplierDeductionMapper
{
/**
* 查询qualitySupplierDeduction
*
* @param supplierDeductionId qualitySupplierDeductionID
* @return qualitySupplierDeduction
*/
public QualitySupplierDeduction selectQualitySupplierDeductionById(Long supplierDeductionId);
/**
* 查询qualitySupplierDeduction列表
*
* @param qualitySupplierDeduction qualitySupplierDeduction
* @return qualitySupplierDeduction集合
*/
public List<QualitySupplierDeduction> selectQualitySupplierDeductionList(QualitySupplierDeduction qualitySupplierDeduction);
/**
* 新增qualitySupplierDeduction
*
* @param qualitySupplierDeduction qualitySupplierDeduction
* @return 结果
*/
public int insertQualitySupplierDeduction(QualitySupplierDeduction qualitySupplierDeduction);
/**
* 修改qualitySupplierDeduction
*
* @param qualitySupplierDeduction qualitySupplierDeduction
* @return 结果
*/
public int updateQualitySupplierDeduction(QualitySupplierDeduction qualitySupplierDeduction);
/**
* 删除qualitySupplierDeduction
*
* @param supplierDeductionId qualitySupplierDeductionID
* @return 结果
*/
public int deleteQualitySupplierDeductionById(Long supplierDeductionId);
/**
* 批量删除qualitySupplierDeduction
*
* @param supplierDeductionIds 需要删除的数据ID
* @return 结果
*/
public int deleteQualitySupplierDeductionByIds(String[] supplierDeductionIds);
}

61
ruoyi-admin/src/main/java/com/ruoyi/quality/service/IQualitySupplierDeductionService.java

@ -0,0 +1,61 @@
package com.ruoyi.quality.service;
import java.util.List;
import com.ruoyi.quality.domain.QualitySupplierDeduction;
/**
* qualitySupplierDeductionService接口
*
* @author ruoyi
* @date 2023-06-19
*/
public interface IQualitySupplierDeductionService
{
/**
* 查询qualitySupplierDeduction
*
* @param supplierDeductionId qualitySupplierDeductionID
* @return qualitySupplierDeduction
*/
public QualitySupplierDeduction selectQualitySupplierDeductionById(Long supplierDeductionId);
/**
* 查询qualitySupplierDeduction列表
*
* @param qualitySupplierDeduction qualitySupplierDeduction
* @return qualitySupplierDeduction集合
*/
public List<QualitySupplierDeduction> selectQualitySupplierDeductionList(QualitySupplierDeduction qualitySupplierDeduction);
/**
* 新增qualitySupplierDeduction
*
* @param qualitySupplierDeduction qualitySupplierDeduction
* @return 结果
*/
public int insertQualitySupplierDeduction(QualitySupplierDeduction qualitySupplierDeduction);
/**
* 修改qualitySupplierDeduction
*
* @param qualitySupplierDeduction qualitySupplierDeduction
* @return 结果
*/
public int updateQualitySupplierDeduction(QualitySupplierDeduction qualitySupplierDeduction);
/**
* 批量删除qualitySupplierDeduction
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteQualitySupplierDeductionByIds(String ids);
/**
* 删除qualitySupplierDeduction信息
*
* @param supplierDeductionId qualitySupplierDeductionID
* @return 结果
*/
public int deleteQualitySupplierDeductionById(Long supplierDeductionId);
}

94
ruoyi-admin/src/main/java/com/ruoyi/quality/service/impl/QualitySupplierDeductionServiceImpl.java

@ -0,0 +1,94 @@
package com.ruoyi.quality.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.quality.mapper.QualitySupplierDeductionMapper;
import com.ruoyi.quality.domain.QualitySupplierDeduction;
import com.ruoyi.quality.service.IQualitySupplierDeductionService;
import com.ruoyi.common.core.text.Convert;
/**
* qualitySupplierDeductionService业务层处理
*
* @author ruoyi
* @date 2023-06-19
*/
@Service
public class QualitySupplierDeductionServiceImpl implements IQualitySupplierDeductionService
{
@Autowired
private QualitySupplierDeductionMapper qualitySupplierDeductionMapper;
/**
* 查询qualitySupplierDeduction
*
* @param supplierDeductionId qualitySupplierDeductionID
* @return qualitySupplierDeduction
*/
@Override
public QualitySupplierDeduction selectQualitySupplierDeductionById(Long supplierDeductionId)
{
return qualitySupplierDeductionMapper.selectQualitySupplierDeductionById(supplierDeductionId);
}
/**
* 查询qualitySupplierDeduction列表
*
* @param qualitySupplierDeduction qualitySupplierDeduction
* @return qualitySupplierDeduction
*/
@Override
public List<QualitySupplierDeduction> selectQualitySupplierDeductionList(QualitySupplierDeduction qualitySupplierDeduction)
{
return qualitySupplierDeductionMapper.selectQualitySupplierDeductionList(qualitySupplierDeduction);
}
/**
* 新增qualitySupplierDeduction
*
* @param qualitySupplierDeduction qualitySupplierDeduction
* @return 结果
*/
@Override
public int insertQualitySupplierDeduction(QualitySupplierDeduction qualitySupplierDeduction)
{
return qualitySupplierDeductionMapper.insertQualitySupplierDeduction(qualitySupplierDeduction);
}
/**
* 修改qualitySupplierDeduction
*
* @param qualitySupplierDeduction qualitySupplierDeduction
* @return 结果
*/
@Override
public int updateQualitySupplierDeduction(QualitySupplierDeduction qualitySupplierDeduction)
{
return qualitySupplierDeductionMapper.updateQualitySupplierDeduction(qualitySupplierDeduction);
}
/**
* 删除qualitySupplierDeduction对象
*
* @param ids 需要删除的数据ID
* @return 结果
*/
@Override
public int deleteQualitySupplierDeductionByIds(String ids)
{
return qualitySupplierDeductionMapper.deleteQualitySupplierDeductionByIds(Convert.toStrArray(ids));
}
/**
* 删除qualitySupplierDeduction信息
*
* @param supplierDeductionId qualitySupplierDeductionID
* @return 结果
*/
@Override
public int deleteQualitySupplierDeductionById(Long supplierDeductionId)
{
return qualitySupplierDeductionMapper.deleteQualitySupplierDeductionById(supplierDeductionId);
}
}

14
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysBomBcp.java

@ -75,7 +75,19 @@ public class SysBomBcp extends BaseEntity
/** 备用二 */
private String standbyTwo;
public void setBomBcpId(Long bomBcpId)
public SysBomBcp() {
}
public SysBomBcp(String finishProductCode) {
this.finishProductCode = finishProductCode;
}
public SysBomBcp(Long bomBcpId, String finishProductCode) {
this.bomBcpId = bomBcpId;
this.finishProductCode = finishProductCode;
}
public void setBomBcpId(Long bomBcpId)
{
this.bomBcpId = bomBcpId;
}

6
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysBomRawMaterial.java

@ -73,6 +73,12 @@ public class SysBomRawMaterial extends BaseEntity
@Excel(name = "备用二")
private String standbyTwo;
public SysBomRawMaterial() {
}
public SysBomRawMaterial(String finishProductCode) {
this.finishProductCode = finishProductCode;
}
public void setRawMaterialId(Long rawMaterialId)
{

9
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysBomSubsidiaryMaterial.java

@ -73,7 +73,14 @@ public class SysBomSubsidiaryMaterial extends BaseEntity
@Excel(name = "备用二")
private String standbyTwo;
public void setSubsidiaryMaterialId(Long subsidiaryMaterialId)
public SysBomSubsidiaryMaterial() {
}
public SysBomSubsidiaryMaterial(String finishProductCode) {
this.finishProductCode = finishProductCode;
}
public void setSubsidiaryMaterialId(Long subsidiaryMaterialId)
{
this.subsidiaryMaterialId = subsidiaryMaterialId;
}

9
ruoyi-admin/src/main/java/com/ruoyi/system/domain/SysFinishProduct.java

@ -154,7 +154,14 @@ public class SysFinishProduct extends BaseEntity
@Excel(name = "修改时间")
private String updateInfoTime;
public void setFinishProductId(Long finishProductId)
public SysFinishProduct() {
}
public SysFinishProduct(String finishProductCode) {
this.finishProductCode = finishProductCode;
}
public void setFinishProductId(Long finishProductId)
{
this.finishProductId = finishProductId;
}

1
ruoyi-admin/src/main/resources/mapper/manufacture/MaterialRequisitionDetailMapper.xml

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="upFinishProductCode != null and upFinishProductCode != ''"> and up_finish_product_code = #{upFinishProductCode}</if>
</where>
</select>

138
ruoyi-admin/src/main/resources/mapper/quality/QualitySupplierDeductionMapper.xml

@ -0,0 +1,138 @@
<?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.quality.mapper.QualitySupplierDeductionMapper">
<resultMap type="QualitySupplierDeduction" id="QualitySupplierDeductionResult">
<result property="supplierDeductionId" column="supplier_deduction_id" />
<result property="supplierCode" column="supplier_code" />
<result property="modeOfService" column="mode_of_service" />
<result property="acceptanceDepartment" column="acceptance_department" />
<result property="acceptancePerson" column="acceptance_person" />
<result property="contactNumber" column="contact_number" />
<result property="reason" column="reason" />
<result property="reworkLaborCost" column="rework_labor_cost" />
<result property="customerDeduction" column="customer_deduction" />
<result property="punitiveDamage" column="punitive_damage" />
<result property="materialScrapCost" column="material_scrap_cost" />
<result property="transportationExpenses" column="transportation_expenses" />
<result property="otherName" column="other_name" />
<result property="othersCost" column="others_cost" />
<result property="totalAmount" column="total_amount" />
<result property="proposePerson" column="propose_person" />
<result property="reviewedPerson" column="reviewed_person" />
<result property="approvalPerson" column="approval_person" />
</resultMap>
<sql id="selectQualitySupplierDeductionVo">
select supplier_deduction_id, supplier_code, mode_of_service, acceptance_department, acceptance_person, contact_number, reason, rework_labor_cost, customer_deduction, punitive_damage, material_scrap_cost, transportation_expenses, other_name, others_cost, total_amount, propose_person, reviewed_person, approval_person from quality_supplier_deduction
</sql>
<select id="selectQualitySupplierDeductionList" parameterType="QualitySupplierDeduction" resultMap="QualitySupplierDeductionResult">
<include refid="selectQualitySupplierDeductionVo"/>
<where>
<if test="supplierCode != null and supplierCode != ''"> and supplier_code = #{supplierCode}</if>
<if test="modeOfService != null and modeOfService != ''"> and mode_of_service = #{modeOfService}</if>
<if test="acceptanceDepartment != null and acceptanceDepartment != ''"> and acceptance_department = #{acceptanceDepartment}</if>
<if test="acceptancePerson != null and acceptancePerson != ''"> and acceptance_person = #{acceptancePerson}</if>
<if test="contactNumber != null and contactNumber != ''"> and contact_number = #{contactNumber}</if>
<if test="reason != null and reason != ''"> and reason = #{reason}</if>
<if test="reworkLaborCost != null and reworkLaborCost != ''"> and rework_labor_cost = #{reworkLaborCost}</if>
<if test="customerDeduction != null and customerDeduction != ''"> and customer_deduction = #{customerDeduction}</if>
<if test="punitiveDamage != null and punitiveDamage != ''"> and punitive_damage = #{punitiveDamage}</if>
<if test="materialScrapCost != null and materialScrapCost != ''"> and material_scrap_cost = #{materialScrapCost}</if>
<if test="transportationExpenses != null and transportationExpenses != ''"> and transportation_expenses = #{transportationExpenses}</if>
<if test="otherName != null and otherName != ''"> and other_name like concat('%', #{otherName}, '%')</if>
<if test="othersCost != null and othersCost != ''"> and others_cost = #{othersCost}</if>
<if test="totalAmount != null and totalAmount != ''"> and total_amount = #{totalAmount}</if>
<if test="proposePerson != null and proposePerson != ''"> and propose_person = #{proposePerson}</if>
<if test="reviewedPerson != null and reviewedPerson != ''"> and reviewed_person = #{reviewedPerson}</if>
<if test="approvalPerson != null and approvalPerson != ''"> and approval_person = #{approvalPerson}</if>
</where>
</select>
<select id="selectQualitySupplierDeductionById" parameterType="Long" resultMap="QualitySupplierDeductionResult">
<include refid="selectQualitySupplierDeductionVo"/>
where supplier_deduction_id = #{supplierDeductionId}
</select>
<insert id="insertQualitySupplierDeduction" parameterType="QualitySupplierDeduction">
insert into quality_supplier_deduction
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="supplierDeductionId != null">supplier_deduction_id,</if>
<if test="supplierCode != null">supplier_code,</if>
<if test="modeOfService != null">mode_of_service,</if>
<if test="acceptanceDepartment != null">acceptance_department,</if>
<if test="acceptancePerson != null">acceptance_person,</if>
<if test="contactNumber != null">contact_number,</if>
<if test="reason != null">reason,</if>
<if test="reworkLaborCost != null">rework_labor_cost,</if>
<if test="customerDeduction != null">customer_deduction,</if>
<if test="punitiveDamage != null">punitive_damage,</if>
<if test="materialScrapCost != null">material_scrap_cost,</if>
<if test="transportationExpenses != null">transportation_expenses,</if>
<if test="otherName != null">other_name,</if>
<if test="othersCost != null">others_cost,</if>
<if test="totalAmount != null">total_amount,</if>
<if test="proposePerson != null">propose_person,</if>
<if test="reviewedPerson != null">reviewed_person,</if>
<if test="approvalPerson != null">approval_person,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="supplierDeductionId != null">#{supplierDeductionId},</if>
<if test="supplierCode != null">#{supplierCode},</if>
<if test="modeOfService != null">#{modeOfService},</if>
<if test="acceptanceDepartment != null">#{acceptanceDepartment},</if>
<if test="acceptancePerson != null">#{acceptancePerson},</if>
<if test="contactNumber != null">#{contactNumber},</if>
<if test="reason != null">#{reason},</if>
<if test="reworkLaborCost != null">#{reworkLaborCost},</if>
<if test="customerDeduction != null">#{customerDeduction},</if>
<if test="punitiveDamage != null">#{punitiveDamage},</if>
<if test="materialScrapCost != null">#{materialScrapCost},</if>
<if test="transportationExpenses != null">#{transportationExpenses},</if>
<if test="otherName != null">#{otherName},</if>
<if test="othersCost != null">#{othersCost},</if>
<if test="totalAmount != null">#{totalAmount},</if>
<if test="proposePerson != null">#{proposePerson},</if>
<if test="reviewedPerson != null">#{reviewedPerson},</if>
<if test="approvalPerson != null">#{approvalPerson},</if>
</trim>
</insert>
<update id="updateQualitySupplierDeduction" parameterType="QualitySupplierDeduction">
update quality_supplier_deduction
<trim prefix="SET" suffixOverrides=",">
<if test="supplierCode != null">supplier_code = #{supplierCode},</if>
<if test="modeOfService != null">mode_of_service = #{modeOfService},</if>
<if test="acceptanceDepartment != null">acceptance_department = #{acceptanceDepartment},</if>
<if test="acceptancePerson != null">acceptance_person = #{acceptancePerson},</if>
<if test="contactNumber != null">contact_number = #{contactNumber},</if>
<if test="reason != null">reason = #{reason},</if>
<if test="reworkLaborCost != null">rework_labor_cost = #{reworkLaborCost},</if>
<if test="customerDeduction != null">customer_deduction = #{customerDeduction},</if>
<if test="punitiveDamage != null">punitive_damage = #{punitiveDamage},</if>
<if test="materialScrapCost != null">material_scrap_cost = #{materialScrapCost},</if>
<if test="transportationExpenses != null">transportation_expenses = #{transportationExpenses},</if>
<if test="otherName != null">other_name = #{otherName},</if>
<if test="othersCost != null">others_cost = #{othersCost},</if>
<if test="totalAmount != null">total_amount = #{totalAmount},</if>
<if test="proposePerson != null">propose_person = #{proposePerson},</if>
<if test="reviewedPerson != null">reviewed_person = #{reviewedPerson},</if>
<if test="approvalPerson != null">approval_person = #{approvalPerson},</if>
</trim>
where supplier_deduction_id = #{supplierDeductionId}
</update>
<delete id="deleteQualitySupplierDeductionById" parameterType="Long">
delete from quality_supplier_deduction where supplier_deduction_id = #{supplierDeductionId}
</delete>
<delete id="deleteQualitySupplierDeductionByIds" parameterType="String">
delete from quality_supplier_deduction where supplier_deduction_id in
<foreach item="supplierDeductionId" collection="array" open="(" separator="," close=")">
#{supplierDeductionId}
</foreach>
</delete>
</mapper>

1
ruoyi-admin/src/main/resources/mapper/system/SysBomBcpMapper.xml

@ -123,5 +123,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{bomBcpId}
</foreach>
</delete>
</mapper>

7
ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/add.html

@ -919,13 +919,6 @@
$("#bomMaterialModal").modal("hide");
}
//半成品二阶bom
function bcpList(){
$.ajax({
url:ctx+
})
}
//添加BOM材料信息
function addBomDetailToTable() {
var dataRaw = $("#rawMaterialBomTable").bootstrapTable("getSelections");

82
ruoyi-admin/src/main/resources/templates/outsource/materialRequisitionOutsource/add.html

@ -390,47 +390,9 @@
// $("#form-MaterialRequisitionOutsource-add select[name='stockName']").val(orderData[i].stockName).trigger("change");
// $("#form-MaterialRequisitionOutsource-add input[name='stockNumber']").val(orderData[i].stockNumber);
// $("#form-MaterialRequisitionOutsource-add input[name='stockManager']").val(orderData[i].stockManager);
showMaterial();
}
}
$.ajax({
url: prefixOrderMaterial + '/list',
type: "post",
data: {
outsourceOrderNumber: outsourceOrderNumber
},
success: function (res) {
// console.log(res)
$('#addMaterialTable').bootstrapTable("refresh")
$('#addMaterialTable').bootstrapTable("removeAll")
// console.log(res.rows)
if (res.rows.length>0) {
let data = res.rows;
var count = $('#addMaterialTable').bootstrapTable('getData').length;
var materialRequisitionNumber = $("#form-MaterialRequisitionOutsource-add input[name='materialRequisitionNumber']").val()
for (let j in data) {
$("#addMaterialTable").bootstrapTable('insertRow', {
index: count + j,
row: {
materialRequisitionNumber: materialRequisitionNumber,
materialCode: data[j].materialCode,
materialName: data[j].materialName,
specificationModel: data[j].specificationModel,
inventoryUnit: data[j].inventoryUnit,
planQuantity: data[j].quantity,
description: data[j].description,
unitUsage: '',
bomRank: '',
upFinishProductCode: '',
storageLocation: '',
materialType: ''
}
});
}
} else {
$.modal.alertWarning("该订单内无物料,请先添加!")
}
}
})
})
}
},
@ -438,6 +400,48 @@
$.modal.msgError("后台出错啦!");
}
})
function showMaterial() {
$('#addMaterialTable').bootstrapTable("removeAll");
var outsourceOrderNumber = $("select[name='outsourceOrderNumber']").val();
$.ajax({
url: ctx + 'manufacture/materialRequisitionInfo/selectOutsourceDetail/'+ outsourceOrderNumber,
type: "post",
// data: {
// outsourceOrderNumber: outsourceOrderNumber
// },
success: function (res) {
// console.log(res.rows)
if (res.rows.length>0) {
var count = res.rows.length;
var data = res.rows;
var materialRequisitionNumber = $("#form-MaterialRequisitionOutsource-add input[name='materialRequisitionNumber']").val()
for (let i in data) {
$("#addMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
materialRequisitionNumber: materialRequisitionNumber,
materialCode: data[i].materialCode,
materialName: data[i].materialName,
specificationModel: data[i].specificationModel,
inventoryUnit: data[i].inventoryUnit,
planQuantity: data[i].planQuantity,
description: data[i].description,
unitUsage: data[i].unitUsage,
bomRank: data[i].bomRank,
upFinishProductCode: data[i].upFinishProductCode,
storageLocation: data[i].storageLocation,
materialType: data[i].materialType,
}
});
}
} else {
$.modal.alertWarning("该订单内无物料,请先添加!")
}
}
})
}
//获取单号
$.ajax({

2
ruoyi-admin/src/main/resources/templates/outsource/materialRequisitionOutsource/materialRequisitionOutsource.html

@ -250,7 +250,7 @@
// console.log(data[0].orderNumber)
$.modal.confirm("是否确认要导出本条领料单?", function (){
axios({
url: prefix + '/exportSelectedOutSource/'+data[0].materialRequisitionId,
url: prefix + '/exportOutsource/'+data[0].materialRequisitionId,
method: 'POST',
responseType: 'blob'
}).then(response => {

184
ruoyi-admin/src/main/resources/templates/quality/qualitySupplierDeduction/add.html

@ -0,0 +1,184 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增qualitySupplierDeduction')" />
<th:block th:include="include :: datetimepicker-css" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
<th:block th:include="include :: bootstrap-editable-css"/>
<style>
.other-container {
width: 90%;
height: 200px;
margin: auto;
}
.other {
margin-top: 20px;
}
h4 {
display: inline-block;
margin-right: 20px;
}
.modal-body{
height: 550px;
}
iframe{
width: 100%;
height: 500px;
frameborder: 0;
border: 0;
display: inline-block;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-qualitySupplierDeduction-add">
<div class="form-group">
<label class="col-sm-3 control-label">供应商代码:</label>
<div class="col-sm-8">
<select name="supplierCode" class="form-control m-b">
<option value="">所有</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">送达方式:</label>
<div class="col-sm-8">
<input name="modeOfService" 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="acceptanceDepartment" 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="acceptancePerson" 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="contactNumber" 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="reworkLaborCost" 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="customerDeduction" 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="punitiveDamage" 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="materialScrapCost" 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="transportationExpenses" 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="otherName" 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="othersCost" 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="totalAmount" 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="proposePerson" 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="reviewedPerson" 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="approvalPerson" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">索赔扣款详细原因:</label>
<div class="col-sm-8">
<textarea name="reason" class="form-control"></textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript">
var prefix = ctx + "quality/qualitySupplierDeduction"
var prefixSupplier = ctx + "system/supplier"
$("#form-qualitySupplierDeduction-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-qualitySupplierDeduction-add').serialize());
}
}
//获取供应商代码
$.ajax({
url: prefixSupplier + "/list",
type: "post",
dateType: "json",
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var orderData = res.rows;
for (let i in orderData) {
$("#form-qualitySupplierDeduction-add select[name='supplierCode']").append("<option value='" + orderData[i].supplierCode + "'>" + orderData[i].supplierCode + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
});
</script>
</body>
</html>

184
ruoyi-admin/src/main/resources/templates/quality/qualitySupplierDeduction/edit.html

@ -0,0 +1,184 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改qualitySupplierDeduction')" />
<th:block th:include="include :: datetimepicker-css" />
<link th:href="@{/ajax/libs/select2/select2.css}" rel="stylesheet">
<link th:href="@{/ajax/libs/select2/select2-bootstrap.css}" rel="stylesheet">
<th:block th:include="include :: bootstrap-editable-css"/>
<style>
.other-container {
width: 90%;
height: 200px;
margin: auto;
}
.other {
margin-top: 20px;
}
h4 {
display: inline-block;
margin-right: 20px;
}
.modal-body{
height: 550px;
}
iframe{
width: 100%;
height: 500px;
frameborder: 0;
border: 0;
display: inline-block;
}
</style>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-qualitySupplierDeduction-edit" th:object="${qualitySupplierDeduction}">
<input name="supplierDeductionId" th:field="*{supplierDeductionId}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">供应商代码:</label>
<div class="col-sm-8">
<select name="supplierCode" class="form-control m-b" th:field="*{supplierCode}">
<option value=""></option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">送达方式:</label>
<div class="col-sm-8">
<input name="modeOfService" th:field="*{modeOfService}" 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="acceptanceDepartment" th:field="*{acceptanceDepartment}" 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="acceptancePerson" th:field="*{acceptancePerson}" 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="contactNumber" th:field="*{contactNumber}" 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="reworkLaborCost" th:field="*{reworkLaborCost}" 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="customerDeduction" th:field="*{customerDeduction}" 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="punitiveDamage" th:field="*{punitiveDamage}" 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="materialScrapCost" th:field="*{materialScrapCost}" 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="transportationExpenses" th:field="*{transportationExpenses}" 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="otherName" th:field="*{otherName}" 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="othersCost" th:field="*{othersCost}" 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="totalAmount" th:field="*{totalAmount}" 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="proposePerson" th:field="*{proposePerson}" 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="reviewedPerson" th:field="*{reviewedPerson}" 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="approvalPerson" th:field="*{approvalPerson}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">索赔扣款详细原因:</label>
<div class="col-sm-8">
<textarea name="reason" class="form-control">[[*{reason}]]</textarea>
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<th:block th:include="include :: datetimepicker-js" />
<th:block th:include="include :: select2-js"/>
<th:block th:include="include :: bootstrap-table-editable-js"/>
<script th:inline="javascript">
var prefix = ctx + "quality/qualitySupplierDeduction";
var prefixSupplier = ctx + "system/supplier"
$("#form-qualitySupplierDeduction-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-qualitySupplierDeduction-edit').serialize());
}
}
//获取供应商代码
$.ajax({
url: prefixSupplier + "/list",
type: "post",
dateType: "json",
success: function (res) {
if (res.rows.length > 0) {
var orderData = res.rows;
for(let i in orderData){
$("#form-qualitySupplierDeduction-edit select[name='supplierCode']").append("<option value='" + orderData[i].supplierCode + "'>" + orderData[i].supplierCode + "</option>");
}
$("#form-qualitySupplierDeduction-edit select[name='supplierCode']").val(getData.supplierCode).trigger("supplierCode")
} else {
$.modal.msgError(res.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
});
</script>
</body>
</html>

217
ruoyi-admin/src/main/resources/templates/quality/qualitySupplierDeduction/qualitySupplierDeduction.html

@ -0,0 +1,217 @@
<!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('qualitySupplierDeduction列表')" />
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
</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>
<select name="supplierCode">
<option value="">所有</option>
</select>
</li>
<li>
<label>受理部门:</label>
<input type="text" name="acceptanceDepartment"/>
</li>
<li>
<label>受理人:</label>
<input type="text" name="acceptancePerson"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="quality:qualitySupplierDeduction:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="quality:qualitySupplierDeduction:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="quality:qualitySupplierDeduction:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="exportSelectedRaw()" shiro:hasPermission="quality:qualitySupplierDeduction:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space: nowrap"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('quality:qualitySupplierDeduction:edit')}]];
var removeFlag = [[${@permission.hasPermi('quality:qualitySupplierDeduction:remove')}]];
var prefix = ctx + "quality/qualitySupplierDeduction";
var prefixSupplier = ctx + "system/supplier"
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "qualitySupplierDeduction",
columns: [{
checkbox: true
},
{
field: 'supplierDeductionId',
title: '',
visible: false
},
{
field: 'supplierCode',
title: '供应商代码'
},
{
field: 'modeOfService',
title: '送达方式'
},
{
field: 'acceptanceDepartment',
title: '受理部门'
},
{
field: 'acceptancePerson',
title: '受理人'
},
{
field: 'contactNumber',
title: '联络方式'
},
{
field: 'reason',
title: '索赔扣款详细原因'
},
{
field: 'reworkLaborCost',
title: '返工工时费'
},
{
field: 'customerDeduction',
title: '客户扣款'
},
{
field: 'punitiveDamage',
title: '惩罚性罚款'
},
{
field: 'materialScrapCost',
title: '物料报废费用'
},
{
field: 'transportationExpenses',
title: '交通/运输费'
},
{
field: 'otherName',
title: '其他名字'
},
{
field: 'othersCost',
title: '其他金额'
},
{
field: 'totalAmount',
title: '合计金额'
},
{
field: 'proposePerson',
title: '提出人'
},
{
field: 'reviewedPerson',
title: '审核人'
},
{
field: 'approvalPerson',
title: '复核人'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.supplierDeductionId + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.supplierDeductionId + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
//获取供应商代码
$.ajax({
url: prefixSupplier + "/list",
type: "post",
dateType: "json",
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var orderData = res.rows;
for (let i in orderData) {
$("#formId select[name='supplierCode']").append("<option value='" + orderData[i].supplierCode + "'>" + orderData[i].supplierCode + "</option>");
}
} else {
$.modal.msgError(res.msg);
}
},
error: function () {
$.modal.msgError("后台出错啦!");
}
});
//导出
function exportSelectedRaw() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
var data = $("#bootstrap-table").bootstrapTable("getSelections")
if (rows.length !== 1) {
$.modal.alert("请选择一条记录");
return;
} else {
$.modal.confirm("是否确认要导出本条出库单?", function (){
axios({
url: prefix + '/export/'+data[0].supplierDeductionId,
method: 'POST',
responseType: 'blob'
}).then(response => {
// console.log(response)
const URL = window.URL.createObjectURL(response.data)
// 创建隐藏<a>标签进行下载
const tempLink = document.createElement('a')
tempLink.style.display = 'none'
tempLink.href = URL
let time = new Date().toLocaleString()
tempLink.setAttribute('download', time + "供应商索赔扣款单.xlsx")
if (typeof tempLink.download === 'undefined') {
tempLink.setAttribute('target', '_blank')
}
document.body.appendChild(tempLink)
tempLink.click()
document.body.removeChild(tempLink)// 移除dom元素
window.URL.revokeObjectURL(URL)//释放内存
})
});
}
}
</script>
</body>
</html>

BIN
ruoyi-admin/target/classes/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/MaterialRequisitionDetail.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/system/domain/SysBomBcp.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/system/domain/SysBomRawMaterial.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/system/domain/SysBomSubsidiaryMaterial.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/system/domain/SysFinishProduct.class

Binary file not shown.

1
ruoyi-admin/target/classes/mapper/manufacture/MaterialRequisitionDetailMapper.xml

@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null and materialCode != ''"> and material_code like concat('%', #{materialCode}, '%')</if>
<if test="materialName != null and materialName != ''"> and material_name like concat('%', #{materialName}, '%')</if>
<if test="materialType != null and materialType != ''"> and material_type = #{materialType}</if>
<if test="upFinishProductCode != null and upFinishProductCode != ''"> and up_finish_product_code = #{upFinishProductCode}</if>
</where>
</select>

1
ruoyi-admin/target/classes/mapper/system/SysBomBcpMapper.xml

@ -123,5 +123,4 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{bomBcpId}
</foreach>
</delete>
</mapper>

7
ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/add.html

@ -919,13 +919,6 @@
$("#bomMaterialModal").modal("hide");
}
//半成品二阶bom
function bcpList(){
$.ajax({
url:ctx+
})
}
//添加BOM材料信息
function addBomDetailToTable() {
var dataRaw = $("#rawMaterialBomTable").bootstrapTable("getSelections");

Loading…
Cancel
Save