Browse Source

销售对账导出,采购对账导出,成品入库导出,原料领料单导出

erp、
ling li 1 year ago
parent
commit
27d3eaec0a
  1. 117
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.java
  2. 14
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/MaterialRequisitionDetail.java
  3. 40
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionDetailDto.java
  4. 11
      ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionInfoDto.java
  5. 18
      ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java
  6. 2
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/exportDto/PurchaseMaterialDto.java
  7. 5
      ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/exportDto/PurchaseOrderDto.java
  8. 121
      ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAccountReconciliationController.java
  9. 29
      ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesAccountReconciliation.java
  10. 295
      ruoyi-admin/src/main/java/com/ruoyi/sales/domain/exportDto/SalesAccountReconciliationDto.java
  11. 4
      ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesAccountReconciliationMapper.java
  12. 7
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesAccountReconciliationService.java
  13. 17
      ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAccountReconciliationServiceImpl.java
  14. 95
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/controller/WarehousingInInfoController.java
  15. 95
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/domain/exportDto/WarehousingInDetailDto.java
  16. 40
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/utils/CustomRowWriteCellHandler.java
  17. 52
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/utils/CustomRowWriteCellsHandler.java
  18. 37
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/utils/CustomRowWriteHandler.java
  19. 86
      ruoyi-admin/src/main/java/com/ruoyi/storehouse/utils/MyHandler.java
  20. 6
      ruoyi-admin/src/main/resources/mapper/manufacture/MaterialRequisitionDetailMapper.xml
  21. 37
      ruoyi-admin/src/main/resources/mapper/sales/SalesAccountReconciliationMapper.xml
  22. 58
      ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/add.html
  23. 43
      ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/edit.html
  24. 27
      ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/materialRequisitionYL.html
  25. 9
      ruoyi-admin/src/main/resources/templates/manufacture/warehousingFinishProductNotice/edit.html
  26. 639
      ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/edit.html
  27. 68
      ruoyi-admin/src/main/resources/templates/sales/salesAccountReconciliation/salesAccountReconciliation.html
  28. 4
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingCheckInfo/add.html
  29. 12
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingCheckInfo/edit.html
  30. 10
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingCheckInfo/warehousingCheckInfo.html
  31. 6
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInFinishProduct/warehousingInFinishProduct.html
  32. 40
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDFinishProduct/add.html
  33. 37
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDFinishProduct/edit.html
  34. 6
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDFinishProduct/warehousingInPDFinishProduct.html
  35. 7
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInRGFinishProduct/warehousingInRGFinishProduct.html
  36. 10
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInRawMaterial/warehousingInRawMaterial.html
  37. 4
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInSearch/warehousingInSearch.html
  38. 10
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInSubsidiary/warehousingInSubsidiary.html
  39. 4
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInspectionNotice/add.html
  40. 4
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInspectionNotice/edit.html
  41. 6
      ruoyi-admin/src/main/resources/templates/storehouse/warehousingInspectionNotice/warehousingInspectionNotice.html
  42. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/controller/MaterialRequisitionInfoController.class
  43. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/MaterialRequisitionDetail.class
  44. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionDetailDto.class
  45. BIN
      ruoyi-admin/target/classes/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionInfoDto.class
  46. BIN
      ruoyi-admin/target/classes/com/ruoyi/purchase/controller/PurchaseOrderController.class
  47. BIN
      ruoyi-admin/target/classes/com/ruoyi/purchase/domain/exportDto/PurchaseMaterialDto.class
  48. BIN
      ruoyi-admin/target/classes/com/ruoyi/purchase/domain/exportDto/PurchaseOrderDto.class
  49. BIN
      ruoyi-admin/target/classes/com/ruoyi/sales/controller/SalesAccountReconciliationController.class
  50. BIN
      ruoyi-admin/target/classes/com/ruoyi/sales/domain/SalesAccountReconciliation.class
  51. BIN
      ruoyi-admin/target/classes/com/ruoyi/sales/mapper/SalesAccountReconciliationMapper.class
  52. BIN
      ruoyi-admin/target/classes/com/ruoyi/sales/service/ISalesAccountReconciliationService.class
  53. BIN
      ruoyi-admin/target/classes/com/ruoyi/sales/service/impl/SalesAccountReconciliationServiceImpl.class
  54. 6
      ruoyi-admin/target/classes/mapper/manufacture/MaterialRequisitionDetailMapper.xml
  55. 37
      ruoyi-admin/target/classes/mapper/sales/SalesAccountReconciliationMapper.xml
  56. 639
      ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/edit.html
  57. 68
      ruoyi-admin/target/classes/templates/sales/salesAccountReconciliation/salesAccountReconciliation.html
  58. 4
      ruoyi-admin/target/classes/templates/storehouse/warehousingInspectionNotice/add.html
  59. 4
      ruoyi-admin/target/classes/templates/storehouse/warehousingInspectionNotice/edit.html
  60. 6
      ruoyi-admin/target/classes/templates/storehouse/warehousingInspectionNotice/warehousingInspectionNotice.html

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

@ -6,7 +6,6 @@ import com.alibaba.excel.util.MapUtils;
import com.alibaba.excel.write.metadata.WriteSheet; import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.excel.write.metadata.fill.FillConfig; import com.alibaba.excel.write.metadata.fill.FillConfig;
import com.alibaba.excel.write.metadata.style.WriteCellStyle; import com.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy; import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.ruoyi.ck.utils.Result; import com.ruoyi.ck.utils.Result;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
@ -17,16 +16,23 @@ import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.manufacture.domain.MaterialRequisitionDetail; import com.ruoyi.manufacture.domain.MaterialRequisitionDetail;
import com.ruoyi.manufacture.domain.MaterialRequisitionInfo; import com.ruoyi.manufacture.domain.MaterialRequisitionInfo;
import com.ruoyi.manufacture.domain.WorkOrderInfo;
import com.ruoyi.manufacture.domain.exportDto.MaterialRequisitionDetailDto; import com.ruoyi.manufacture.domain.exportDto.MaterialRequisitionDetailDto;
import com.ruoyi.manufacture.domain.exportDto.MaterialRequisitionInfoDto; import com.ruoyi.manufacture.domain.exportDto.MaterialRequisitionInfoDto;
import com.ruoyi.manufacture.domain.exportDto.WorkOrderInfoDto;
import com.ruoyi.manufacture.service.IMaterialRequisitionDetailService; import com.ruoyi.manufacture.service.IMaterialRequisitionDetailService;
import com.ruoyi.manufacture.service.IMaterialRequisitionInfoService; import com.ruoyi.manufacture.service.IMaterialRequisitionInfoService;
import com.ruoyi.outsource.domain.OutsourceOrderMaterial; import com.ruoyi.outsource.domain.OutsourceOrderMaterial;
import com.ruoyi.outsource.service.IOutsourceOrderMaterialService; import com.ruoyi.outsource.service.IOutsourceOrderMaterialService;
import com.ruoyi.outsource.service.impl.OutsourceOrderMaterialServiceImpl; 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.system.service.ISysDictTypeService;
import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils; import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment; import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -62,12 +68,23 @@ public class MaterialRequisitionInfoController extends BaseController
private String prefixBcp = "manufacture/materialRequisitionBCP"; private String prefixBcp = "manufacture/materialRequisitionBCP";
private String prefixOutsource = "outsource/materialRequisitionOutsource"; private String prefixOutsource = "outsource/materialRequisitionOutsource";
//excel数据量
private Integer excelSize = 28;
@Autowired @Autowired
private IMaterialRequisitionInfoService materialRequisitionInfoService; private IMaterialRequisitionInfoService materialRequisitionInfoService;
@Autowired @Autowired
private IMaterialRequisitionDetailService materialRequisitionDetailService; private IMaterialRequisitionDetailService materialRequisitionDetailService;
@Autowired @Autowired
private ISysDictTypeService sysDictTypeService; private ISysDictTypeService sysDictTypeService;
@Autowired
private ISysBomService sysBomService;
@Autowired
private ISysBomBcpService sysBomBcpService;
@Autowired
private ISysBomRawMaterialService sysBomRawMaterialService;
@Autowired
private IWorkOrderInfoService workOrderInfoService;
// @RequiresPermissions("manufacture:materialRequisitionInfo:view") // @RequiresPermissions("manufacture:materialRequisitionInfo:view")
// @GetMapping() // @GetMapping()
@ -331,6 +348,7 @@ public class MaterialRequisitionInfoController extends BaseController
return Result.getSuccessResult(materialRequisitionInfoService.getOutsourceId()); return Result.getSuccessResult(materialRequisitionInfoService.getOutsourceId());
} }
/** /**
* 导出领料单列表 * 导出领料单列表
*/ */
@ -342,16 +360,32 @@ public class MaterialRequisitionInfoController extends BaseController
// //
System.out.println(materialRequisitionId); System.out.println(materialRequisitionId);
//领料单基础信息
MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId); MaterialRequisitionInfo materialRequisitionInfo = materialRequisitionInfoService.selectMaterialRequisitionInfoById(materialRequisitionId);
MaterialRequisitionInfoDto materialRequisitionInfoDto = new MaterialRequisitionInfoDto(); MaterialRequisitionInfoDto materialRequisitionInfoDto = new MaterialRequisitionInfoDto();
BeanUtils.copyProperties(materialRequisitionInfo,materialRequisitionInfoDto); BeanUtils.copyProperties(materialRequisitionInfo,materialRequisitionInfoDto);
//查询制工单信息
WorkOrderInfo workOrderInfo = new WorkOrderInfo();
workOrderInfo.setWorkOrderNumber(materialRequisitionInfo.getWorkOrderNumber());
List<WorkOrderInfo> workOrderInfoList = workOrderInfoService.selectWorkOrderInfoList(workOrderInfo);
WorkOrderInfoDto workOrderInfoDto = new WorkOrderInfoDto();
String specificationModel = "";
String versionNumber = "";
if (workOrderInfoList.size() == 1) {
BeanUtils.copyProperties(workOrderInfoList.get(0),workOrderInfoDto);
specificationModel = workOrderInfoDto.getSpecificationModel();
versionNumber = workOrderInfoDto.getVersionNumber();
}
//查询物料信息
MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail(); MaterialRequisitionDetail materialRequisitionDetail = new MaterialRequisitionDetail();
materialRequisitionDetail.setMaterialRequisitionNumber(materialRequisitionInfo.getMaterialRequisitionNumber()); materialRequisitionDetail.setMaterialRequisitionNumber(materialRequisitionInfo.getMaterialRequisitionNumber());
// 创建列合并工具类对象 // 创建列合并工具类对象
ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils(); ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
//领料单包含的物料
List<MaterialRequisitionDetail> materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail); List<MaterialRequisitionDetail> materialRequisitionDetailList = materialRequisitionDetailService.selectMaterialRequisitionDetailList(materialRequisitionDetail);
List<MaterialRequisitionDetailDto> materialRequisitionDetailDtoList = new ArrayList<>(); List<MaterialRequisitionDetailDto> materialRequisitionDetailDtoList = new ArrayList<>();
@ -362,10 +396,27 @@ public class MaterialRequisitionInfoController extends BaseController
Object source = values.next(); Object source = values.next();
MaterialRequisitionDetailDto target = MaterialRequisitionDetailDto.class.newInstance(); MaterialRequisitionDetailDto target = MaterialRequisitionDetailDto.class.newInstance();
BeanUtils.copyProperties(source, target); BeanUtils.copyProperties(source, target);
mergePrevColUtils.add(number+5,1,1);
mergePrevColUtils.add(number+5,4,1);
target.setNumber(++number); target.setNumber(++number);
materialRequisitionDetailDtoList.add(target); materialRequisitionDetailDtoList.add(target);
// getBomDetail(number, target.getMaterialCode(), materialRequisitionDetailDtoList);
}
int size = materialRequisitionDetailDtoList.size();
if (materialRequisitionDetailDtoList.size()<excelSize) {
int excelMinus = excelSize-size;
for (int i =0;i<excelMinus;i++) {
MaterialRequisitionDetailDto materialRequisitionDetailDto = new MaterialRequisitionDetailDto();
materialRequisitionDetailDto.setNumber(++number);
materialRequisitionDetailDto.setMaterialCode("");
materialRequisitionDetailDto.setMaterialName("");
materialRequisitionDetailDto.setSpecificationModel("");
materialRequisitionDetailDto.setItemNumber("");
materialRequisitionDetailDto.setInventoryUnit("");
materialRequisitionDetailDto.setPlanQuantity("");
materialRequisitionDetailDto.setUnitUsage("");
materialRequisitionDetailDto.setStorageLocation("");
materialRequisitionDetailDto.setActualQuantity("");
materialRequisitionDetailDtoList.add(materialRequisitionDetailDto);
}
} }
}catch (Exception e) { }catch (Exception e) {
log.error(">>>>>>异常<<<<<<", e); log.error(">>>>>>异常<<<<<<", e);
@ -373,13 +424,13 @@ public class MaterialRequisitionInfoController extends BaseController
System.out.println(materialRequisitionDetailDtoList); System.out.println(materialRequisitionDetailDtoList);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("销售订单", "UTF-8").replaceAll("\\+", "%20"); String fileName = URLEncoder.encode("领料单", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
String templateFileName = "C:\\exportTemplates\\exportMaterialRequisition.xlsx"; String templateFileName = "C:\\exportTemplates\\exportMaterialRequisition.xlsx";
try (ExcelWriter excelWriter = EasyExcel try (ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream(), MaterialRequisitionDetailDto.class) .write(response.getOutputStream(), MaterialRequisitionDetailDto.class)
.withTemplate(templateFileName) .withTemplate(templateFileName)
.registerWriteHandler(mergePrevColUtils) // .registerWriteHandler(mergePrevColUtils)
//样式注册 //样式注册
.registerWriteHandler(horizontalCellStyleStrategyBuilder()) .registerWriteHandler(horizontalCellStyleStrategyBuilder())
.build()) { .build()) {
@ -403,13 +454,47 @@ public class MaterialRequisitionInfoController extends BaseController
map.put("deptName", materialRequisitionInfoDto.getDeptName()); map.put("deptName", materialRequisitionInfoDto.getDeptName());
map.put("finishProductCode", materialRequisitionInfoDto.getFinishProductCode()); map.put("finishProductCode", materialRequisitionInfoDto.getFinishProductCode());
map.put("typeMachine", materialRequisitionInfoDto.getTypeMachine());
map.put("workOrderQuantity", materialRequisitionInfoDto.getWorkOrderQuantity()); map.put("workOrderQuantity", materialRequisitionInfoDto.getWorkOrderQuantity());
map.put("materialRequisitionPerson", materialRequisitionInfoDto.getMaterialRequisitionPerson()); map.put("typeMachine", materialRequisitionInfoDto.getTypeMachine());
map.put("specificationModel", specificationModel);
map.put("versionNumber", versionNumber);
excelWriter.fill(map, writeSheet); excelWriter.fill(map, writeSheet);
} }
} }
public void getBomDetail(Integer number, String materialCode, List<MaterialRequisitionDetailDto> materialRequisitionDetailDtoList) {
//获取bom信息
//判断是否有bom
SysBom sysBom = new SysBom();
sysBom.setFinishProductCode(materialCode);
List<SysBom> sysBomList = sysBomService.selectSysBomList(sysBom);
//如果是半成品,则继续查询
if (sysBomList.size() != 0) {
//先查询原料
SysBomRawMaterial sysBomRawMaterial = new SysBomRawMaterial();
sysBomRawMaterial.setFinishProductCode(sysBomList.get(0).getFinishProductCode());
List<SysBomRawMaterial> sysBomRawMaterialList = sysBomRawMaterialService.selectSysBomRawMaterialList(sysBomRawMaterial);
try {
// Iterator values1= sysBomRawMaterialList.iterator();
for (int i = 0; i < sysBomRawMaterialList.size(); i++){
MaterialRequisitionDetailDto target1 = MaterialRequisitionDetailDto.class.newInstance();
// BeanUtils.copyProperties(source1, target1);
target1.setNumber(++number);
target1.setMaterialCode(sysBomRawMaterialList.get(i).getRawMaterialCode());
target1.setMaterialName(sysBomRawMaterialList.get(i).getRawMaterialName());
target1.setSpecificationModel(sysBomRawMaterialList.get(i).getSpecificationModel());
target1.setItemNumber(sysBomRawMaterialList.get(i).getSupplierNumber());
target1.setInventoryUnit(sysBomRawMaterialList.get(i).getInventoryUnit());
target1.setUnitUsage(sysBomRawMaterialList.get(i).getRawMaterialConsumption());
materialRequisitionDetailDtoList.add(target1);
getBomDetail(number,sysBomRawMaterialList.get(i).getRawMaterialCode(),materialRequisitionDetailDtoList);
}
} catch (Exception e) {
log.error(">>>>>>异常<<<<<<", e);
}
}
}
/** /**
* 导出领料单列表 * 导出领料单列表
@ -482,10 +567,10 @@ public class MaterialRequisitionInfoController extends BaseController
public HorizontalCellStyleStrategy horizontalCellStyleStrategyBuilder() { public HorizontalCellStyleStrategy horizontalCellStyleStrategyBuilder() {
WriteCellStyle headWriteCellStyle = new WriteCellStyle(); WriteCellStyle headWriteCellStyle = new WriteCellStyle();
//设置头字体 //设置头字体
WriteFont headWriteFont = new WriteFont(); // WriteFont headWriteFont = new WriteFont();
headWriteFont.setFontHeightInPoints((short) 13); // headWriteFont.setFontHeightInPoints((short) 13);
headWriteFont.setBold(true); // headWriteFont.setBold(true);
headWriteCellStyle.setWriteFont(headWriteFont); // headWriteCellStyle.setWriteFont(headWriteFont);
//设置头居中 //设置头居中
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER); headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
@ -496,10 +581,10 @@ public class MaterialRequisitionInfoController extends BaseController
//垂直居中 //垂直居中
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
//单元格边框 //单元格边框
contentWriteCellStyle.setBorderTop(BorderStyle.DASHED); // contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
contentWriteCellStyle.setBorderLeft(BorderStyle.DASHED); // contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
contentWriteCellStyle.setBorderRight(BorderStyle.DASHED); // contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
contentWriteCellStyle.setBorderBottom(BorderStyle.DASHED); // contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
} }

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

@ -34,6 +34,10 @@ public class MaterialRequisitionDetail extends BaseEntity
@Excel(name = "规格型号") @Excel(name = "规格型号")
private String specificationModel; private String specificationModel;
/** 料号 */
@Excel(name = "料号")
private String itemNumber;
/** 机种 */ /** 机种 */
@Excel(name = "机种") @Excel(name = "机种")
private String typeMachine; private String typeMachine;
@ -121,6 +125,15 @@ public class MaterialRequisitionDetail extends BaseEntity
{ {
return specificationModel; return specificationModel;
} }
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public void setTypeMachine(String typeMachine) public void setTypeMachine(String typeMachine)
{ {
this.typeMachine = typeMachine; this.typeMachine = typeMachine;
@ -227,6 +240,7 @@ public class MaterialRequisitionDetail extends BaseEntity
.append("materialCode", getMaterialCode()) .append("materialCode", getMaterialCode())
.append("materialName", getMaterialName()) .append("materialName", getMaterialName())
.append("specificationModel", getSpecificationModel()) .append("specificationModel", getSpecificationModel())
.append("itemNumber", getItemNumber())
.append("typeMachine", getTypeMachine()) .append("typeMachine", getTypeMachine())
.append("inventoryUnit", getInventoryUnit()) .append("inventoryUnit", getInventoryUnit())
.append("planQuantity", getPlanQuantity()) .append("planQuantity", getPlanQuantity())

40
ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionDetailDto.java

@ -1,6 +1,8 @@
package com.ruoyi.manufacture.domain.exportDto; package com.ruoyi.manufacture.domain.exportDto;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
@ -17,6 +19,7 @@ public class MaterialRequisitionDetailDto extends BaseEntity
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 序号 */ /** 序号 */
@ExcelProperty("序号") @ExcelProperty("序号")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private Integer number; private Integer number;
/** 领料物料id */ /** 领料物料id */
@ -28,26 +31,36 @@ public class MaterialRequisitionDetailDto extends BaseEntity
/** 物料代码 */ /** 物料代码 */
@ExcelProperty("物料代码") @ExcelProperty("物料代码")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String materialCode; private String materialCode;
/** 物料名称 */ /** 物料名称 */
@ExcelProperty("物料名称") @ExcelProperty("物料名称")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String materialName; private String materialName;
/** 规格型号 */ /** 规格型号 */
@ExcelProperty("规格型号") @ExcelProperty("规格型号")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String specificationModel; private String specificationModel;
/** 料号 */
@ExcelProperty("料号")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String itemNumber;
/** 机种 */ /** 机种 */
@ExcelProperty("机种") @ExcelProperty("机种")
private String typeMachine; private String typeMachine;
/** 单位 */ /** 单位 */
@ExcelProperty("单位") @ExcelProperty("单位")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String inventoryUnit; private String inventoryUnit;
/** 计划数量 */ /** 计划数量 */
@ExcelProperty("计划数量") @ExcelProperty("计划数量")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String planQuantity; private String planQuantity;
/** 说明 */ /** 说明 */
@ -56,10 +69,12 @@ public class MaterialRequisitionDetailDto extends BaseEntity
/** 单位用量 */ /** 单位用量 */
@ExcelProperty("单位用量") @ExcelProperty("单位用量")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String unitUsage; private String unitUsage;
/** 存放位置 */ /** 存放位置 */
@ExcelProperty("存放位置") @ExcelProperty("存放位置")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String storageLocation; private String storageLocation;
/** 物料类别 */ /** 物料类别 */
@ -72,6 +87,11 @@ public class MaterialRequisitionDetailDto extends BaseEntity
/** 备用二 */ /** 备用二 */
private String standbyTwo; private String standbyTwo;
/** 实发数量 */
@ExcelProperty("实发数量")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String actualQuantity;
/** bom阶 */ /** bom阶 */
@Excel(name = "bom阶") @Excel(name = "bom阶")
private String bomRank; private String bomRank;
@ -133,6 +153,15 @@ public class MaterialRequisitionDetailDto extends BaseEntity
{ {
return specificationModel; return specificationModel;
} }
public String getItemNumber() {
return itemNumber;
}
public void setItemNumber(String itemNumber) {
this.itemNumber = itemNumber;
}
public void setTypeMachine(String typeMachine) public void setTypeMachine(String typeMachine)
{ {
this.typeMachine = typeMachine; this.typeMachine = typeMachine;
@ -230,6 +259,15 @@ public class MaterialRequisitionDetailDto extends BaseEntity
public void setUpFinishProductCode(String upFinishProductCode) { public void setUpFinishProductCode(String upFinishProductCode) {
this.upFinishProductCode = upFinishProductCode; this.upFinishProductCode = upFinishProductCode;
} }
public String getActualQuantity() {
return actualQuantity;
}
public void setActualQuantity(String actualQuantity) {
this.actualQuantity = actualQuantity;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -239,6 +277,7 @@ public class MaterialRequisitionDetailDto extends BaseEntity
.append("materialCode", getMaterialCode()) .append("materialCode", getMaterialCode())
.append("materialName", getMaterialName()) .append("materialName", getMaterialName())
.append("specificationModel", getSpecificationModel()) .append("specificationModel", getSpecificationModel())
.append("itemNumber", getItemNumber())
.append("typeMachine", getTypeMachine()) .append("typeMachine", getTypeMachine())
.append("inventoryUnit", getInventoryUnit()) .append("inventoryUnit", getInventoryUnit())
.append("planQuantity", getPlanQuantity()) .append("planQuantity", getPlanQuantity())
@ -250,6 +289,7 @@ public class MaterialRequisitionDetailDto extends BaseEntity
.append("standbyTwo", getStandbyTwo()) .append("standbyTwo", getStandbyTwo())
.append("bomRank", getBomRank()) .append("bomRank", getBomRank())
.append("upFinishProductCode", getUpFinishProductCode()) .append("upFinishProductCode", getUpFinishProductCode())
.append("actualQuantity", getActualQuantity())
.toString(); .toString();
} }
} }

11
ruoyi-admin/src/main/java/com/ruoyi/manufacture/domain/exportDto/MaterialRequisitionInfoDto.java

@ -1,6 +1,8 @@
package com.ruoyi.manufacture.domain.exportDto; package com.ruoyi.manufacture.domain.exportDto;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
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;
@ -20,18 +22,22 @@ public class MaterialRequisitionInfoDto extends BaseEntity
/** 领料单号 */ /** 领料单号 */
@ExcelProperty("领料单号") @ExcelProperty("领料单号")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String materialRequisitionNumber; private String materialRequisitionNumber;
/** 订单号码 */ /** 订单号码 */
@ExcelProperty("订单号码") @ExcelProperty("订单号码")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String salesOrderNumber; private String salesOrderNumber;
/** 制工单号 */ /** 制工单号 */
@ExcelProperty("制工单号") @ExcelProperty("制工单号")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String workOrderNumber; private String workOrderNumber;
/** 领料部门 */ /** 领料部门 */
@ExcelProperty("领料部门") @ExcelProperty("领料部门")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String deptName; private String deptName;
/** 领料人 */ /** 领料人 */
@ -60,18 +66,22 @@ public class MaterialRequisitionInfoDto extends BaseEntity
/** 出库日期 */ /** 出库日期 */
@ExcelProperty("出库日期") @ExcelProperty("出库日期")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String outputDate; private String outputDate;
/** 成品代码 */ /** 成品代码 */
@ExcelProperty("成品代码") @ExcelProperty("成品代码")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String finishProductCode; private String finishProductCode;
/** 机种 */ /** 机种 */
@ExcelProperty("机种") @ExcelProperty("机种")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String typeMachine; private String typeMachine;
/** 工单数量 */ /** 工单数量 */
@ExcelProperty("工单数量") @ExcelProperty("工单数量")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String workOrderQuantity; private String workOrderQuantity;
/** 备注内容 */ /** 备注内容 */
@ -84,6 +94,7 @@ public class MaterialRequisitionInfoDto extends BaseEntity
/** 录入时间 */ /** 录入时间 */
@ExcelProperty("录入时间") @ExcelProperty("录入时间")
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
private String firstAddTime; private String firstAddTime;
/** 修改时间 */ /** 修改时间 */

18
ruoyi-admin/src/main/java/com/ruoyi/purchase/controller/PurchaseOrderController.java

@ -21,6 +21,7 @@ import com.ruoyi.purchase.domain.exportDto.PurchaseMaterialDto;
import com.ruoyi.purchase.domain.exportDto.PurchaseOrderDto; import com.ruoyi.purchase.domain.exportDto.PurchaseOrderDto;
import com.ruoyi.purchase.service.IPurchaseMaterialService; import com.ruoyi.purchase.service.IPurchaseMaterialService;
import com.ruoyi.purchase.service.IPurchaseOrderService; import com.ruoyi.purchase.service.IPurchaseOrderService;
import com.ruoyi.storehouse.utils.CustomRowWriteHandler;
import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils; import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
@ -192,15 +193,15 @@ public class PurchaseOrderController extends BaseController
List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.selectPurchaseMaterialList(purchaseMaterial); List<PurchaseMaterial> purchaseMaterialList = purchaseMaterialService.selectPurchaseMaterialList(purchaseMaterial);
List<PurchaseMaterialDto> purchaseMaterialDtoList = new ArrayList<>(); List<PurchaseMaterialDto> purchaseMaterialDtoList = new ArrayList<>();
double total = 0.00; double total = 0.00;
try {
int number = 0; int number = 0;
try {
Iterator values= purchaseMaterialList.iterator(); Iterator values= purchaseMaterialList.iterator();
while(values.hasNext()) { while(values.hasNext()) {
Object source = values.next(); Object source = values.next();
PurchaseMaterialDto target = PurchaseMaterialDto.class.newInstance(); PurchaseMaterialDto target = PurchaseMaterialDto.class.newInstance();
BeanUtils.copyProperties(source, target); BeanUtils.copyProperties(source, target);
mergePrevColUtils.add(number+8,1,1); // mergePrevColUtils.add(number+8,1,1);
mergePrevColUtils.add(number+8,10,1); // mergePrevColUtils.add(number+8,10,1);
target.setNumber(++number); target.setNumber(++number);
purchaseMaterialDtoList.add(target); purchaseMaterialDtoList.add(target);
total = total + Double.parseDouble(target.getAmountMoney()); total = total + Double.parseDouble(target.getAmountMoney());
@ -211,6 +212,12 @@ public class PurchaseOrderController extends BaseController
} }
System.out.println(purchaseMaterialDtoList); System.out.println(purchaseMaterialDtoList);
// Map<String, Integer> colMap = new HashMap<>();
//// colMap.put(8, 9);
// colMap.put("rowNum1", purchaseMaterialDtoList.size()+8);
// colMap.put("rowNum2", purchaseMaterialDtoList.size()+8);
// colMap.put("colNum1", 8);
// colMap.put("colNum2", 9);
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("采购订单", "UTF-8").replaceAll("\\+", "%20"); String fileName = URLEncoder.encode("采购订单", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
@ -220,7 +227,10 @@ public class PurchaseOrderController extends BaseController
.withTemplate(templateFileName) .withTemplate(templateFileName)
.registerWriteHandler(mergePrevColUtils) .registerWriteHandler(mergePrevColUtils)
//样式注册 //样式注册
.registerWriteHandler(horizontalCellStyleStrategyBuilder()) // .registerWriteHandler(horizontalCellStyleStrategyBuilder())
.registerWriteHandler(new CustomRowWriteHandler(1))
.registerWriteHandler(new CustomRowWriteHandler(10))
// .registerWriteHandler(new CustomRowWriteCellsHandler(colMap))
.build()) { .build()) {
WriteSheet writeSheet = EasyExcel.writerSheet().build(); WriteSheet writeSheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();

2
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/exportDto/PurchaseMaterialDto.java

@ -14,7 +14,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @date 2023-04-03 * @date 2023-04-03
*/ */
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN) //@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
public class PurchaseMaterialDto extends BaseEntity public class PurchaseMaterialDto extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;

5
ruoyi-admin/src/main/java/com/ruoyi/purchase/domain/exportDto/PurchaseOrderDto.java

@ -13,7 +13,7 @@ import org.apache.commons.lang3.builder.ToStringStyle;
* @author ruoyi * @author ruoyi
* @date 2023-03-31 * @date 2023-03-31
*/ */
@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE) //@ContentStyle(borderLeft = BorderStyleEnum.NONE,borderTop = BorderStyleEnum.NONE,borderBottom = BorderStyleEnum.NONE,borderRight = BorderStyleEnum.NONE)
public class PurchaseOrderDto extends BaseEntity public class PurchaseOrderDto extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -145,7 +145,8 @@ public class PurchaseOrderDto extends BaseEntity
@ExcelProperty("修改时间") @ExcelProperty("修改时间")
private String updateInfoTime; private String updateInfoTime;
@ExcelProperty("金额总计") @ExcelProperty(value = "金额总计")
@ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private Double total; private Double total;
public Double getTotal() { public Double getTotal() {

121
ruoyi-admin/src/main/java/com/ruoyi/sales/controller/SalesAccountReconciliationController.java

@ -1,22 +1,46 @@
package com.ruoyi.sales.controller; package com.ruoyi.sales.controller;
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.alibaba.excel.write.metadata.style.WriteCellStyle;
import com.alibaba.excel.write.metadata.style.WriteFont;
import com.alibaba.excel.write.style.HorizontalCellStyleStrategy;
import com.ruoyi.common.annotation.Log; import com.ruoyi.common.annotation.Log;
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;
import com.ruoyi.common.core.domain.entity.SysDictData;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.sales.domain.SalesAccountReconciliation; import com.ruoyi.sales.domain.SalesAccountReconciliation;
import com.ruoyi.sales.domain.exportDto.SalesAccountReconciliationDto;
import com.ruoyi.sales.service.ISalesAccountReconciliationService; import com.ruoyi.sales.service.ISalesAccountReconciliationService;
import com.ruoyi.system.domain.SysCustomer; import com.ruoyi.system.domain.SysCustomer;
import com.ruoyi.system.service.ISysCustomerService; import com.ruoyi.system.service.ISysCustomerService;
import com.ruoyi.system.service.ISysDictTypeService;
import org.apache.poi.ss.usermodel.HorizontalAlignment;
import org.apache.poi.ss.usermodel.VerticalAlignment;
import org.apache.shiro.authz.annotation.RequiresPermissions; import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller; import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap; import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List; import java.util.List;
import java.util.Map;
import static com.ruoyi.common.config.datasource.DynamicDataSourceContextHolder.log;
/** /**
* 销售对账Controller * 销售对账Controller
@ -36,6 +60,9 @@ public class SalesAccountReconciliationController extends BaseController
@Autowired @Autowired
private ISysCustomerService customerService; private ISysCustomerService customerService;
@Autowired
private ISysDictTypeService sysDictTypeService;
@RequiresPermissions("sales:salesAccountReconciliation:view") @RequiresPermissions("sales:salesAccountReconciliation:view")
@GetMapping() @GetMapping()
public String salesAccountReconciliation() public String salesAccountReconciliation()
@ -94,10 +121,10 @@ public class SalesAccountReconciliationController extends BaseController
/** /**
* 修改销售对账 * 修改销售对账
*/ */
@GetMapping("/edit/{salesOrderCode}") @GetMapping("/edit/{salesFinishId}")
public String edit(@PathVariable("salesOrderCode") String salesOrderCode, ModelMap mmap) public String edit(@PathVariable("salesFinishId") Long salesFinishId, ModelMap mmap)
{ {
SalesAccountReconciliation salesAccountReconciliation = salesAccountReconciliationService.selectSalesAccountReconciliationById(salesOrderCode); SalesAccountReconciliation salesAccountReconciliation = salesAccountReconciliationService.selectSalesAccountReconciliationById(salesFinishId);
mmap.put("salesAccountReconciliation", salesAccountReconciliation); mmap.put("salesAccountReconciliation", salesAccountReconciliation);
return prefix + "/edit"; return prefix + "/edit";
} }
@ -133,4 +160,92 @@ public class SalesAccountReconciliationController extends BaseController
List<SysCustomer> list = customerService.selectSysCustomerList(customer); List<SysCustomer> list = customerService.selectSysCustomerList(customer);
return list; return list;
} }
/**
* 导出
* @param ids
* @param response
* @throws IOException
*/
@RequiresPermissions("purchase:purchaseOrder:export")
@Log(title = "采购订单", businessType = BusinessType.EXPORT)
@RequestMapping("/exportSelected/{ids}")
@ResponseBody
public void exportSelected(@PathVariable("ids") String ids, HttpServletResponse response) throws IOException {
String[] idsStr = ids.split(",");
// 创建列合并工具类对象
// ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
List<SalesAccountReconciliationDto> salesAccountReconciliationDtoList = new ArrayList<>();
List<SalesAccountReconciliation> salesAccountReconciliationList = new ArrayList<>();
for (int i = 0; i < idsStr.length; i++) {
SalesAccountReconciliation salesAccountReconciliation = salesAccountReconciliationService.selectSalesAccountReconciliationById(Long.valueOf(idsStr[i]));
salesAccountReconciliationList.add(salesAccountReconciliation);
}
Double total = 0.00;
try {
int number = 0;
Iterator values= salesAccountReconciliationList.iterator();
while(values.hasNext()) {
Object source = values.next();
SalesAccountReconciliationDto target = SalesAccountReconciliationDto.class.newInstance();
BeanUtils.copyProperties(source, target);
List<SysDictData> deptData = sysDictTypeService.selectDictDataByType("sys_common_currency");
for (int i = 0;i<deptData.size();i++) {
if (target.getCommonCurrency().equals(deptData.get(i).getDictValue())) {
target.setCommonCurrency(deptData.get(i).getDictLabel());
}
}
total = total + Double.parseDouble(target.getAmountMoney());
number++;
salesAccountReconciliationDtoList.add(target);
}
}catch (Exception e) {
log.error(">>>>>>异常<<<<<<", e);
}
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\\exportSalesReconciliation.xlsx";
try (ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream(), SalesAccountReconciliationDto.class)
.withTemplate(templateFileName)
// .registerWriteHandler(mergePrevColUtils)
//样式注册
.registerWriteHandler(horizontalCellStyleStrategyBuilder())
.build()) {
WriteSheet writeSheet = EasyExcel.writerSheet().build();
FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
excelWriter.fill(salesAccountReconciliationDtoList, fillConfig, writeSheet);
Map<String, Object> map = MapUtils.newHashMap();
map.put("date", DateTimeFormatter.ofPattern("yyyy/MM/dd").format(LocalDateTime.now()));
map.put("total", total);
excelWriter.fill(map, writeSheet);
}
}
public HorizontalCellStyleStrategy horizontalCellStyleStrategyBuilder() {
WriteCellStyle headWriteCellStyle = new WriteCellStyle();
//设置头字体
WriteFont headWriteFont = new WriteFont();
headWriteFont.setFontHeightInPoints((short) 13);
headWriteFont.setBold(true);
headWriteCellStyle.setWriteFont(headWriteFont);
//设置头居中
headWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
//内容策略
WriteCellStyle contentWriteCellStyle = new WriteCellStyle();
//设置 水平居中
contentWriteCellStyle.setHorizontalAlignment(HorizontalAlignment.CENTER);
// 垂直居中
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
//// 单元格边框
// contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
// contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
// contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
// contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
}
} }

29
ruoyi-admin/src/main/java/com/ruoyi/sales/domain/SalesAccountReconciliation.java

@ -14,6 +14,10 @@ public class SalesAccountReconciliation extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 销售物料id */
@Excel(name = "销售物料id")
private String salesFinishId;
/** 发货通知单号 */ /** 发货通知单号 */
@Excel(name = "发货通知单号") @Excel(name = "发货通知单号")
private String noticeOrderNumber; private String noticeOrderNumber;
@ -54,9 +58,9 @@ public class SalesAccountReconciliation extends BaseEntity
@Excel(name = "客户料号") @Excel(name = "客户料号")
private String customerNumber; private String customerNumber;
/** 机种 */ /** 币别 */
@Excel(name = "机种") @Excel(name = "币别")
private String typeMachine; private String commonCurrency;
/** 单价 */ /** 单价 */
@Excel(name = "单价") @Excel(name = "单价")
@ -94,6 +98,14 @@ public class SalesAccountReconciliation extends BaseEntity
@Excel(name = "对账时间") @Excel(name = "对账时间")
private String accountReconciliationTime; private String accountReconciliationTime;
public String getSalesFinishId() {
return salesFinishId;
}
public void setSalesFinishId(String salesFinishId) {
this.salesFinishId = salesFinishId;
}
public String getNoticeOrderNumber() { public String getNoticeOrderNumber() {
return noticeOrderNumber; return noticeOrderNumber;
} }
@ -174,12 +186,12 @@ public class SalesAccountReconciliation extends BaseEntity
this.customerNumber = customerNumber; this.customerNumber = customerNumber;
} }
public String getTypeMachine() { public String getCommonCurrency() {
return typeMachine; return commonCurrency;
} }
public void setTypeMachine(String typeMachine) { public void setCommonCurrency(String commonCurrency) {
this.typeMachine = typeMachine; this.commonCurrency = commonCurrency;
} }
public String getProcessPrice() { public String getProcessPrice() {
@ -257,6 +269,7 @@ public class SalesAccountReconciliation extends BaseEntity
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this) return new ToStringBuilder(this)
.append("salesFinishId", salesFinishId)
.append("noticeOrderNumber", noticeOrderNumber) .append("noticeOrderNumber", noticeOrderNumber)
.append("deliveryDate", deliveryDate) .append("deliveryDate", deliveryDate)
.append("salesOrderNumber", salesOrderNumber) .append("salesOrderNumber", salesOrderNumber)
@ -267,7 +280,7 @@ public class SalesAccountReconciliation extends BaseEntity
.append("finishProductName", finishProductName) .append("finishProductName", finishProductName)
.append("specificationModel", specificationModel) .append("specificationModel", specificationModel)
.append("customerNumber", customerNumber) .append("customerNumber", customerNumber)
.append("typeMachine", typeMachine) .append("commonCurrency", commonCurrency)
.append("processPrice", processPrice) .append("processPrice", processPrice)
.append("productQuantity", productQuantity) .append("productQuantity", productQuantity)
.append("amountMoney", amountMoney) .append("amountMoney", amountMoney)

295
ruoyi-admin/src/main/java/com/ruoyi/sales/domain/exportDto/SalesAccountReconciliationDto.java

@ -0,0 +1,295 @@
package com.ruoyi.sales.domain.exportDto;
import com.alibaba.excel.annotation.ExcelProperty;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
/**
* 销售对账对象 sales_account_reconciliation
*
* @author ruoyi
* @date 2023-02-03
*/
public class SalesAccountReconciliationDto extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 销售物料id */
@ExcelProperty("销售物料id")
private String salesFinishId;
/** 发货通知单号 */
@ExcelProperty("发货通知单号")
private String noticeOrderNumber;
/** 发货日期 */
@ExcelProperty("发货日期")
private String deliveryDate;
/** 订单号码 */
@ExcelProperty("订单号码")
private String salesOrderNumber;
/** 客户代码 */
@ExcelProperty("客户代码")
private String enterpriseCode;
/** 客户名称 */
@ExcelProperty("客户名称")
private String enterpriseName;
/** 联系人 */
@ExcelProperty("联系人")
private String customerContact;
/** 成品代码 */
@ExcelProperty("成品代码")
private String finishProductCode;
/** 成品名称 */
@ExcelProperty("成品名称")
private String finishProductName;
/** 规格型号 */
@ExcelProperty("规格型号")
private String specificationModel;
/** 客户料号 */
@ExcelProperty("客户料号")
private String customerNumber;
/** 币别 */
@ExcelProperty("币别")
private String commonCurrency;
/** 单价 */
@ExcelProperty("单价")
private String processPrice;
/** 数量 */
@ExcelProperty("数量")
private String productQuantity;
/** 金额 */
@ExcelProperty("金额")
private String amountMoney;
/** 客户使用否 */
@ExcelProperty("客户使用否")
private String customerUseOrNot;
/** 客户使用数量 */
@ExcelProperty("客户使用数量")
private String customerUseQuantity;
/** 客户使用备注说明 */
@ExcelProperty("客户使用备注说明")
private String customerUseRemarks;
/** 对账否 */
@ExcelProperty("对账否")
private String accountReconciliationOrNot;
/** 对账人 */
@ExcelProperty("对账人")
private String accountReconciliationPerson;
/** 对账时间 */
@ExcelProperty("对账时间")
private String accountReconciliationTime;
public String getSalesFinishId() {
return salesFinishId;
}
public void setSalesFinishId(String salesFinishId) {
this.salesFinishId = salesFinishId;
}
public String getNoticeOrderNumber() {
return noticeOrderNumber;
}
public void setNoticeOrderNumber(String noticeOrderNumber) {
this.noticeOrderNumber = noticeOrderNumber;
}
public String getDeliveryDate() {
return deliveryDate;
}
public void setDeliveryDate(String deliveryDate) {
this.deliveryDate = deliveryDate;
}
public String getSalesOrderNumber() {
return salesOrderNumber;
}
public void setSalesOrderNumber(String salesOrderNumber) {
this.salesOrderNumber = salesOrderNumber;
}
public String getEnterpriseCode() {
return enterpriseCode;
}
public void setEnterpriseCode(String enterpriseCode) {
this.enterpriseCode = enterpriseCode;
}
public String getEnterpriseName() {
return enterpriseName;
}
public void setEnterpriseName(String enterpriseName) {
this.enterpriseName = enterpriseName;
}
public String getCustomerContact() {
return customerContact;
}
public void setCustomerContact(String customerContact) {
this.customerContact = customerContact;
}
public String getFinishProductCode() {
return finishProductCode;
}
public void setFinishProductCode(String finishProductCode) {
this.finishProductCode = finishProductCode;
}
public String getFinishProductName() {
return finishProductName;
}
public void setFinishProductName(String finishProductName) {
this.finishProductName = finishProductName;
}
public String getSpecificationModel() {
return specificationModel;
}
public void setSpecificationModel(String specificationModel) {
this.specificationModel = specificationModel;
}
public String getCustomerNumber() {
return customerNumber;
}
public void setCustomerNumber(String customerNumber) {
this.customerNumber = customerNumber;
}
public String getCommonCurrency() {
return commonCurrency;
}
public void setCommonCurrency(String commonCurrency) {
this.commonCurrency = commonCurrency;
}
public String getProcessPrice() {
return processPrice;
}
public void setProcessPrice(String processPrice) {
this.processPrice = processPrice;
}
public String getProductQuantity() {
return productQuantity;
}
public void setProductQuantity(String productQuantity) {
this.productQuantity = productQuantity;
}
public String getAmountMoney() {
return amountMoney;
}
public void setAmountMoney(String amountMoney) {
this.amountMoney = amountMoney;
}
public String getCustomerUseOrNot() {
return customerUseOrNot;
}
public void setCustomerUseOrNot(String customerUseOrNot) {
this.customerUseOrNot = customerUseOrNot;
}
public String getCustomerUseQuantity() {
return customerUseQuantity;
}
public void setCustomerUseQuantity(String customerUseQuantity) {
this.customerUseQuantity = customerUseQuantity;
}
public String getCustomerUseRemarks() {
return customerUseRemarks;
}
public void setCustomerUseRemarks(String customerUseRemarks) {
this.customerUseRemarks = customerUseRemarks;
}
public String getAccountReconciliationOrNot() {
return accountReconciliationOrNot;
}
public void setAccountReconciliationOrNot(String accountReconciliationOrNot) {
this.accountReconciliationOrNot = accountReconciliationOrNot;
}
public String getAccountReconciliationPerson() {
return accountReconciliationPerson;
}
public void setAccountReconciliationPerson(String accountReconciliationPerson) {
this.accountReconciliationPerson = accountReconciliationPerson;
}
public String getAccountReconciliationTime() {
return accountReconciliationTime;
}
public void setAccountReconciliationTime(String accountReconciliationTime) {
this.accountReconciliationTime = accountReconciliationTime;
}
@Override
public String toString() {
return new ToStringBuilder(this)
.append("salesFinishId", salesFinishId)
.append("noticeOrderNumber", noticeOrderNumber)
.append("deliveryDate", deliveryDate)
.append("salesOrderNumber", salesOrderNumber)
.append("enterpriseCode", enterpriseCode)
.append("enterpriseName", enterpriseName)
.append("customerContact", customerContact)
.append("finishProductCode", finishProductCode)
.append("finishProductName", finishProductName)
.append("specificationModel", specificationModel)
.append("customerNumber", customerNumber)
.append("commonCurrency", commonCurrency)
.append("processPrice", processPrice)
.append("productQuantity", productQuantity)
.append("amountMoney", amountMoney)
.append("customerUseOrNot", customerUseOrNot)
.append("customerUseQuantity", customerUseQuantity)
.append("customerUseRemarks", customerUseRemarks)
.append("accountReconciliationOrNot", accountReconciliationOrNot)
.append("accountReconciliationPerson", accountReconciliationPerson)
.append("accountReconciliationTime", accountReconciliationTime)
.toString();
}
}

4
ruoyi-admin/src/main/java/com/ruoyi/sales/mapper/SalesAccountReconciliationMapper.java

@ -15,10 +15,10 @@ public interface SalesAccountReconciliationMapper
/** /**
* 查询销售对账 * 查询销售对账
* *
* @param salesOrderCode 销售对账ID * @param salesFinishId 销售对账ID
* @return 销售对账 * @return 销售对账
*/ */
public SalesAccountReconciliation selectSalesAccountReconciliationById(String salesOrderCode); public SalesAccountReconciliation selectSalesAccountReconciliationById(Long salesFinishId);
/** /**
* 查询销售对账列表 * 查询销售对账列表

7
ruoyi-admin/src/main/java/com/ruoyi/sales/service/ISalesAccountReconciliationService.java

@ -1,8 +1,9 @@
package com.ruoyi.sales.service; package com.ruoyi.sales.service;
import java.util.List;
import com.ruoyi.sales.domain.SalesAccountReconciliation; import com.ruoyi.sales.domain.SalesAccountReconciliation;
import java.util.List;
/** /**
* 销售对账Service接口 * 销售对账Service接口
* *
@ -14,10 +15,10 @@ public interface ISalesAccountReconciliationService
/** /**
* 查询销售对账 * 查询销售对账
* *
* @param salesOrderCode 销售对账ID * @param salesFinishId 销售对账ID
* @return 销售对账 * @return 销售对账
*/ */
public SalesAccountReconciliation selectSalesAccountReconciliationById(String salesOrderCode); public SalesAccountReconciliation selectSalesAccountReconciliationById(Long salesFinishId);
/** /**
* 查询销售对账列表 * 查询销售对账列表

17
ruoyi-admin/src/main/java/com/ruoyi/sales/service/impl/SalesAccountReconciliationServiceImpl.java

@ -1,12 +1,13 @@
package com.ruoyi.sales.service.impl; package com.ruoyi.sales.service.impl;
import java.util.List; import com.ruoyi.common.core.text.Convert;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.sales.mapper.SalesAccountReconciliationMapper;
import com.ruoyi.sales.domain.SalesAccountReconciliation; import com.ruoyi.sales.domain.SalesAccountReconciliation;
import com.ruoyi.sales.mapper.SalesAccountReconciliationMapper;
import com.ruoyi.sales.service.ISalesAccountReconciliationService; import com.ruoyi.sales.service.ISalesAccountReconciliationService;
import com.ruoyi.common.core.text.Convert; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/** /**
* 销售对账Service业务层处理 * 销售对账Service业务层处理
@ -23,13 +24,13 @@ public class SalesAccountReconciliationServiceImpl implements ISalesAccountRecon
/** /**
* 查询销售对账 * 查询销售对账
* *
* @param salesOrderCode 销售对账ID * @param salesFinishId 销售对账ID
* @return 销售对账 * @return 销售对账
*/ */
@Override @Override
public SalesAccountReconciliation selectSalesAccountReconciliationById(String salesOrderCode) public SalesAccountReconciliation selectSalesAccountReconciliationById(Long salesFinishId)
{ {
return salesAccountReconciliationMapper.selectSalesAccountReconciliationById(salesOrderCode); return salesAccountReconciliationMapper.selectSalesAccountReconciliationById(salesFinishId);
} }
/** /**

95
ruoyi-admin/src/main/java/com/ruoyi/storehouse/controller/WarehousingInInfoController.java

@ -15,12 +15,17 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.manufacture.domain.WarehousingFinishProductNotice;
import com.ruoyi.manufacture.domain.WorkOrderInfo;
import com.ruoyi.manufacture.service.IWarehousingFinishProductNoticeService;
import com.ruoyi.manufacture.service.IWorkOrderInfoService;
import com.ruoyi.storehouse.domain.WarehousingInDetail; import com.ruoyi.storehouse.domain.WarehousingInDetail;
import com.ruoyi.storehouse.domain.WarehousingInInfo; import com.ruoyi.storehouse.domain.WarehousingInInfo;
import com.ruoyi.storehouse.domain.exportDto.WarehousingInDetailDto; import com.ruoyi.storehouse.domain.exportDto.WarehousingInDetailDto;
import com.ruoyi.storehouse.domain.exportDto.WarehousingInInfoDto; import com.ruoyi.storehouse.domain.exportDto.WarehousingInInfoDto;
import com.ruoyi.storehouse.service.IWarehousingInDetailService; import com.ruoyi.storehouse.service.IWarehousingInDetailService;
import com.ruoyi.storehouse.service.IWarehousingInInfoService; import com.ruoyi.storehouse.service.IWarehousingInInfoService;
import com.ruoyi.storehouse.utils.CustomRowWriteHandler;
import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils; import com.ruoyi.system.utils.ExcelFillCellMergePrevColUtils;
import org.apache.poi.ss.usermodel.BorderStyle; import org.apache.poi.ss.usermodel.BorderStyle;
import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.usermodel.HorizontalAlignment;
@ -35,8 +40,6 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import java.io.IOException; import java.io.IOException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Iterator; import java.util.Iterator;
import java.util.List; import java.util.List;
@ -66,7 +69,13 @@ public class WarehousingInInfoController extends BaseController
@Autowired @Autowired
private IWarehousingInDetailService warehousingInDetailService; private IWarehousingInDetailService warehousingInDetailService;
@Autowired
private IWarehousingFinishProductNoticeService warehousingFinishProductNoticeService;
@Autowired
private IWorkOrderInfoService workOrderInfoService;
//excel数据量
private Integer excelSize = 9;
/** /**
* 页面跳转 * 页面跳转
* @return * @return
@ -482,7 +491,7 @@ public class WarehousingInInfoController extends BaseController
} }
/** /**
* 导出辅料入库单 * 导出成品入库单
*/ */
@RequiresPermissions("storehouse:warehousingInInfo:export") @RequiresPermissions("storehouse:warehousingInInfo:export")
@Log(title = "入库", businessType = BusinessType.EXPORT) @Log(title = "入库", businessType = BusinessType.EXPORT)
@ -503,32 +512,74 @@ public class WarehousingInInfoController extends BaseController
ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils(); ExcelFillCellMergePrevColUtils mergePrevColUtils = new ExcelFillCellMergePrevColUtils();
List<WarehousingInDetail> warehousingInDetailList = warehousingInDetailService.selectWarehousingInDetailList(warehousingInDetail); List<WarehousingInDetail> warehousingInDetailList = warehousingInDetailService.selectWarehousingInDetailList(warehousingInDetail);
WarehousingInDetail warehousingInDetail1 = warehousingInDetailList.get(0); List<WarehousingInDetailDto> warehousingInDetailDtoList = new ArrayList<>();
try {
int number = 0;
Iterator values= warehousingInDetailList.iterator();
while(values.hasNext()) {
Object source = values.next();
WarehousingInDetailDto target = WarehousingInDetailDto.class.newInstance();
BeanUtils.copyProperties(source, target);
mergePrevColUtils.add(number+7,1,1);
WorkOrderInfo workOrderInfo = new WorkOrderInfo();
workOrderInfo.setWorkOrderNumber(warehousingInInfo.getWorkOrderNumber());
List<WorkOrderInfo> workOrderInfoList = workOrderInfoService.selectWorkOrderInfoList(workOrderInfo);
WarehousingFinishProductNotice warehousingFinishProductNotice = new WarehousingFinishProductNotice();
warehousingFinishProductNotice.setWorkOrderNumber(warehousingInInfo.getWorkOrderNumber());
List<WarehousingFinishProductNotice> warehousingFinishProductNoticeList = warehousingFinishProductNoticeService.selectWarehousingFinishProductNoticeList(warehousingFinishProductNotice);
target.setSalesOrderNumber(workOrderInfoList.get(0).getSalesOrderNumber());
target.setAcceptanceQuantity(String.valueOf(Float.valueOf(warehousingFinishProductNoticeList.get(0).getQualifiedQuantity())+Float.valueOf(warehousingFinishProductNoticeList.get(0).getUnqualifiedQuantity())));
target.setRejectionQuantity(warehousingFinishProductNoticeList.get(0).getUnqualifiedQuantity());
target.setNumber(++number);
target.setInspectionStatus("OK");
warehousingInDetailDtoList.add(target);
}
int size = warehousingInDetailDtoList.size();
if (warehousingInDetailDtoList.size()<excelSize) {
int excelMinus = excelSize-size;
for (int i =0;i<excelMinus;i++) {
WarehousingInDetailDto warehousingInDetailDto = new WarehousingInDetailDto(); WarehousingInDetailDto warehousingInDetailDto = new WarehousingInDetailDto();
BeanUtils.copyProperties(warehousingInDetail1,warehousingInDetailDto); warehousingInDetailDto.setNumber(++number);
warehousingInDetailDto.setSalesOrderNumber("");
warehousingInDetailDto.setMaterialCode("");
warehousingInDetailDto.setMaterialName("");
warehousingInDetailDto.setSpecificationModel("");
warehousingInDetailDto.setWarehousingQuantity("");
warehousingInDetailDto.setScrapQuantity("");
warehousingInDetailDto.setAcceptanceQuantity("");
warehousingInDetailDto.setRejectionQuantity("");
warehousingInDetailDto.setInspectionStatus("");
warehousingInDetailDto.setWarehouseNameRemarks("");
// mergePrevColUtils.add(number+7,1,1);
warehousingInDetailDtoList.add(warehousingInDetailDto);
}
}
}catch (Exception e) {
log.error(">>>>>>异常<<<<<<", e);
}
// System.out.println(warehousingInDetailDtoList); // System.out.println(warehousingInDetailDtoList);
for (int i=0;i<warehousingInDetailDtoList.size();i++) {
mergePrevColUtils.add(i+7,1,1);
}
response.setCharacterEncoding("utf-8"); response.setCharacterEncoding("utf-8");
String fileName = URLEncoder.encode("辅料入库单", "UTF-8").replaceAll("\\+", "%20"); String fileName = URLEncoder.encode("成品入库单", "UTF-8").replaceAll("\\+", "%20");
response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx"); response.setHeader("Content-disposition", "attachment;filename*=utf-8''" + fileName + ".xlsx");
String templateFileName = "C:\\exportTemplates\\成品入库单.xlsx"; String templateFileName = "C:\\exportTemplates\\exportWarehousingInCP.xlsx";
try (ExcelWriter excelWriter = EasyExcel try (ExcelWriter excelWriter = EasyExcel
.write(response.getOutputStream()) .write(response.getOutputStream(), WarehousingInDetailDto.class)
.withTemplate(templateFileName) .withTemplate(templateFileName)
.registerWriteHandler(mergePrevColUtils) // .registerWriteHandler(mergePrevColUtils)
//样式注册 //样式注册
.registerWriteHandler(horizontalCellStyleStrategyBuilder()) // .registerWriteHandler(horizontalCellStyleStrategyBuilder())
.registerWriteHandler(new CustomRowWriteHandler(1))
.build()) { .build()) {
WriteSheet writeSheet = EasyExcel.writerSheet().build(); WriteSheet writeSheet = EasyExcel.writerSheet().build();
// FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build(); FillConfig fillConfig = FillConfig.builder().forceNewRow(Boolean.TRUE).build();
// excelWriter.fill(warehousingInDetailDtoList, fillConfig, writeSheet); excelWriter.fill(warehousingInDetailDtoList, fillConfig, writeSheet);
Map<String, Object> map = MapUtils.newHashMap(); Map<String, Object> map = MapUtils.newHashMap();
map.put("date", DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDateTime.now())); // map.put("date", DateTimeFormatter.ofPattern("yyyy-MM-dd").format(LocalDateTime.now()));
map.put("workOrderNumber", warehousingInInfoDto.getWorkOrderNumber());
map.put("enterpriseCode", warehousingInInfoDto.getEnterpriseCode());
map.put("enterpriseName", warehousingInInfoDto.getEnterpriseName());
map.put("materialCode", warehousingInDetailDto.getMaterialCode());
map.put("materialName", warehousingInDetailDto.getMaterialName());
excelWriter.fill(map, writeSheet); excelWriter.fill(map, writeSheet);
} }
} }
@ -550,10 +601,10 @@ public class WarehousingInInfoController extends BaseController
//垂直居中 //垂直居中
contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER); contentWriteCellStyle.setVerticalAlignment(VerticalAlignment.CENTER);
//单元格边框 //单元格边框
contentWriteCellStyle.setBorderTop(BorderStyle.DASHED); contentWriteCellStyle.setBorderTop(BorderStyle.THIN);
contentWriteCellStyle.setBorderLeft(BorderStyle.DASHED); contentWriteCellStyle.setBorderLeft(BorderStyle.THIN);
contentWriteCellStyle.setBorderRight(BorderStyle.DASHED); contentWriteCellStyle.setBorderRight(BorderStyle.THIN);
contentWriteCellStyle.setBorderBottom(BorderStyle.DASHED); contentWriteCellStyle.setBorderBottom(BorderStyle.THIN);
return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle); return new HorizontalCellStyleStrategy(headWriteCellStyle, contentWriteCellStyle);
} }

95
ruoyi-admin/src/main/java/com/ruoyi/storehouse/domain/exportDto/WarehousingInDetailDto.java

@ -1,6 +1,8 @@
package com.ruoyi.storehouse.domain.exportDto; package com.ruoyi.storehouse.domain.exportDto;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.alibaba.excel.annotation.write.style.ContentStyle;
import com.alibaba.excel.enums.poi.BorderStyleEnum;
import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.BaseEntity;
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;
@ -15,6 +17,9 @@ public class WarehousingInDetailDto extends BaseEntity
{ {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
/** 序号 */
@ExcelProperty("序号")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private Integer number; private Integer number;
/** 入库物料id */ /** 入库物料id */
@ -24,12 +29,15 @@ public class WarehousingInDetailDto extends BaseEntity
@ExcelProperty("入库单号") @ExcelProperty("入库单号")
private String warehousingNumber; private String warehousingNumber;
/** 物料代码 */ /** 物料代码 */
@ExcelProperty("物料代码") @ExcelProperty("物料代码")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String materialCode; private String materialCode;
/** 物料名称 */ /** 物料名称 */
@ExcelProperty("物料名称") @ExcelProperty("物料名称")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String materialName; private String materialName;
/** 物料类型 */ /** 物料类型 */
@ -38,6 +46,7 @@ public class WarehousingInDetailDto extends BaseEntity
/** 规格型号 */ /** 规格型号 */
@ExcelProperty("规格型号") @ExcelProperty("规格型号")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String specificationModel; private String specificationModel;
/** 机种 */ /** 机种 */
@ -50,6 +59,7 @@ public class WarehousingInDetailDto extends BaseEntity
/** 合格数量 */ /** 合格数量 */
@ExcelProperty("合格数量") @ExcelProperty("合格数量")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String warehousingQuantity; private String warehousingQuantity;
/** 说明 */ /** 说明 */
@ -72,6 +82,36 @@ public class WarehousingInDetailDto extends BaseEntity
@ExcelProperty("退货数量") @ExcelProperty("退货数量")
private String returnGoodsQuantity; private String returnGoodsQuantity;
/** 订单号 */
@ExcelProperty("订单号")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String salesOrderNumber;
/** 报废数量 */
@ExcelProperty("报废数量")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String scrapQuantity;
/** 验收数量 */
@ExcelProperty("验收数量")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String acceptanceQuantity;
/** 验退数量 */
@ExcelProperty("验退数量")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String rejectionQuantity;
/** 单位检验状况 */
@ExcelProperty("单位检验状况")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String inspectionStatus;
/** 库别名称备注 */
@ExcelProperty("库别名称备注")
// @ContentStyle(borderLeft = BorderStyleEnum.THIN,borderTop = BorderStyleEnum.THIN,borderBottom = BorderStyleEnum.THIN,borderRight = BorderStyleEnum.THIN)
private String warehouseNameRemarks;
public Integer getNumber() { public Integer getNumber() {
return number; return number;
} }
@ -207,6 +247,54 @@ public class WarehousingInDetailDto extends BaseEntity
return returnGoodsQuantity; return returnGoodsQuantity;
} }
public String getSalesOrderNumber() {
return salesOrderNumber;
}
public void setSalesOrderNumber(String salesOrderNumber) {
this.salesOrderNumber = salesOrderNumber;
}
public String getScrapQuantity() {
return scrapQuantity;
}
public void setScrapQuantity(String scrapQuantity) {
this.scrapQuantity = scrapQuantity;
}
public String getAcceptanceQuantity() {
return acceptanceQuantity;
}
public void setAcceptanceQuantity(String acceptanceQuantity) {
this.acceptanceQuantity = acceptanceQuantity;
}
public String getRejectionQuantity() {
return rejectionQuantity;
}
public void setRejectionQuantity(String rejectionQuantity) {
this.rejectionQuantity = rejectionQuantity;
}
public String getInspectionStatus() {
return inspectionStatus;
}
public void setInspectionStatus(String inspectionStatus) {
this.inspectionStatus = inspectionStatus;
}
public String getWarehouseNameRemarks() {
return warehouseNameRemarks;
}
public void setWarehouseNameRemarks(String warehouseNameRemarks) {
this.warehouseNameRemarks = warehouseNameRemarks;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
@ -224,7 +312,12 @@ public class WarehousingInDetailDto extends BaseEntity
.append("batchNumber", getBatchNumber()) .append("batchNumber", getBatchNumber())
.append("manufacturerBatchNumber", getManufacturerBatchNumber()) .append("manufacturerBatchNumber", getManufacturerBatchNumber())
.append("storageLocation", getStorageLocation()) .append("storageLocation", getStorageLocation())
.append("returnGoodsQuantity", getReturnGoodsQuantity()) .append("salesOrderNumber", getSalesOrderNumber())
.append("scrapQuantity", getScrapQuantity())
.append("acceptanceQuantity", getAcceptanceQuantity())
.append("rejectionQuantity", getRejectionQuantity())
.append("inspectionStatus", getInspectionStatus())
.append("warehouseNameRemarks", getWarehouseNameRemarks())
.toString(); .toString();
} }
} }

40
ruoyi-admin/src/main/java/com/ruoyi/storehouse/utils/CustomRowWriteCellHandler.java

@ -0,0 +1,40 @@
package com.ruoyi.storehouse.utils;
import com.alibaba.excel.write.handler.RowWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import java.util.Map;
/**
* 自定义 excel 行处理
*
* @author zjw
* @date 2021-08-31
*/
public class CustomRowWriteCellHandler implements RowWriteHandler {
private final Map<Integer, Integer> colMap;
public CustomRowWriteCellHandler(Map<Integer, Integer> colMap) {
this.colMap = colMap;
}
@Override
public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
if (relativeRowIndex == null) {
return;
}
for (Map.Entry<Integer, Integer> entry : colMap.entrySet()) {
int key = entry.getKey() - 1;
int val = entry.getValue() - 1;
Cell cell = row.createCell(key + 1);
cell.setCellStyle(row.getCell(key).getCellStyle());
int rowNum = row.getRowNum();
CellRangeAddress cellRangeAddress = new CellRangeAddress(rowNum, rowNum, key, val);
writeSheetHolder.getSheet().addMergedRegionUnsafe(cellRangeAddress);
}
}
}

52
ruoyi-admin/src/main/java/com/ruoyi/storehouse/utils/CustomRowWriteCellsHandler.java

@ -0,0 +1,52 @@
package com.ruoyi.storehouse.utils;
import com.alibaba.excel.write.handler.RowWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.util.CellRangeAddress;
import java.util.Map;
/**
* 自定义 excel 行处理
*
* @author zjw
* @date 2021-08-31
*/
public class CustomRowWriteCellsHandler implements RowWriteHandler {
private final Map<String, Integer> colMap;
public CustomRowWriteCellsHandler(Map<String, Integer> colMap) {
this.colMap = colMap;
}
// @Override
// public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
// for (Map.Entry<Integer, Integer> entry : colMap.entrySet()) {
// Integer key = entry.getKey() - 1;
// Integer val = entry.getValue() - 1;
// Cell cell = row.createCell(key + 1);
// cell.setCellStyle(row.getCell(key).getCellStyle());
// int rowNum = row.getRowNum();
// CellRangeAddress cellRangeAddress = new CellRangeAddress(rowNum, rowNum, key, val);
// writeSheetHolder.getSheet().addMergedRegionUnsafe(cellRangeAddress);
// }
// }
@Override
public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
Integer rowNum1 = colMap.get("rowNum1");
Integer rowNum2 = colMap.get("rowNum2");
Integer colNum1 = colMap.get("colNum1");
Integer colNum2 = colMap.get("colNum2");
Cell cell = row.createCell(rowNum1);
cell.setCellStyle(row.getCell(rowNum1).getCellStyle());
int rowNum = row.getRowNum();
CellRangeAddress cellRangeAddress = new CellRangeAddress(rowNum1, rowNum2, colNum1, colNum2);
writeSheetHolder.getSheet().addMergedRegionUnsafe(cellRangeAddress);
}
}

37
ruoyi-admin/src/main/java/com/ruoyi/storehouse/utils/CustomRowWriteHandler.java

@ -0,0 +1,37 @@
package com.ruoyi.storehouse.utils;
import com.alibaba.excel.write.handler.RowWriteHandler;
import com.alibaba.excel.write.metadata.holder.WriteSheetHolder;
import com.alibaba.excel.write.metadata.holder.WriteTableHolder;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import java.util.Arrays;
import java.util.List;
/**
* 自定义 excel 行处理
*
* @author ll
* @date 2023-06-09
*/
public class CustomRowWriteHandler implements RowWriteHandler {
private final List<Integer> cols;
public CustomRowWriteHandler(Integer... cols) {
this.cols = Arrays.asList(cols);
}
@Override
public void afterRowDispose(WriteSheetHolder writeSheetHolder, WriteTableHolder writeTableHolder, Row row, Integer relativeRowIndex, Boolean isHead) {
for (Integer col : cols) {
Cell cell = row.createCell(col + 1);
cell.setCellStyle(row.getCell(col).getCellStyle());
int rowNum = row.getRowNum();
CellRangeAddress cellRangeAddress = new CellRangeAddress(rowNum, rowNum, col, col + 1);
writeSheetHolder.getSheet().addMergedRegionUnsafe(cellRangeAddress);
}
}
}

86
ruoyi-admin/src/main/java/com/ruoyi/storehouse/utils/MyHandler.java

@ -0,0 +1,86 @@
package com.ruoyi.storehouse.utils;
import com.alibaba.excel.metadata.Head;
import com.alibaba.excel.write.merge.AbstractMergeStrategy;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.ss.util.RegionUtil;
import java.util.List;
/**
* 合并单元格处理类
*/
public class MyHandler extends AbstractMergeStrategy {
/**
* 合并开始行
*/
private Integer startRow = 0;
/**
* list表格所有的合并列集合
*/
private List<CellRangeAddress> cellRangeAddressList = null;
public MyHandler() {
}
public MyHandler(int startRow, List<CellRangeAddress> cellRangeAddressList) {
this.startRow = startRow;
this.cellRangeAddressList = cellRangeAddressList;
}
@Override
protected void merge(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) {
// 设置样式
CellStyle cellStyle = cell.getCellStyle();
//水平居中
cellStyle.setAlignment(HorizontalAlignment.CENTER);
//自动换行
cellStyle.setWrapText(true);
//在这里判断从哪一行开始调用合并的方法
if (cell.getRowIndex() > this.startRow) {
if (relativeRowIndex == null || relativeRowIndex == 0) {
return;
}
mergeColumn(sheet, cell, head, relativeRowIndex);
}
}
/**
* 合并单元格
*
* @param sheet
* @param cell
* @param head
* @param relativeRowIndex
*/
protected void mergeColumn(Sheet sheet, Cell cell, Head head, Integer relativeRowIndex) {
int rowIndex = cell.getRowIndex();
int colIndex = cell.getColumnIndex();
sheet = cell.getSheet();
// 获取前一行
Row preRow = sheet.getRow(rowIndex - 1);
//获取前一列
Cell preCell = preRow.getCell(colIndex);
List<CellRangeAddress> list = this.cellRangeAddressList;
for (int i = 0; i < list.size(); i++) {
CellRangeAddress cellRangeAddress = list.get(i);
if (cellRangeAddress.containsColumn(preCell.getColumnIndex())) {
int lastColIndex = cellRangeAddress.getLastColumn();
int firstColIndex = cellRangeAddress.getFirstColumn();
CellRangeAddress cra = new CellRangeAddress(cell.getRowIndex(), cell.getRowIndex(), firstColIndex, lastColIndex);
sheet.addMergedRegion(cra);
// 加边框
RegionUtil.setBorderBottom(BorderStyle.THIN, cra, sheet);
RegionUtil.setBorderLeft(BorderStyle.THIN, cra, sheet);
RegionUtil.setBorderRight(BorderStyle.THIN, cra, sheet);
RegionUtil.setBorderTop(BorderStyle.THIN, cra, sheet);
return;
}
}
}
}

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

@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialCode" column="material_code" /> <result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="specificationModel" column="specification_model" /> <result property="specificationModel" column="specification_model" />
<result property="itemNumber" column="item_number" />
<result property="typeMachine" column="type_machine" /> <result property="typeMachine" column="type_machine" />
<result property="inventoryUnit" column="inventory_unit" /> <result property="inventoryUnit" column="inventory_unit" />
<result property="planQuantity" column="plan_quantity" /> <result property="planQuantity" column="plan_quantity" />
@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectMaterialRequisitionDetailVo"> <sql id="selectMaterialRequisitionDetailVo">
select material_requisition_detail_id, material_requisition_number, material_code, material_name, specification_model, type_machine, inventory_unit, plan_quantity, description, unit_usage, storage_location, material_type, standby_one, standby_two, bom_rank, up_finish_product_code from material_requisition_detail select material_requisition_detail_id, material_requisition_number, material_code, material_name, specification_model, item_number, type_machine, inventory_unit, plan_quantity, description, unit_usage, storage_location, material_type, standby_one, standby_two, bom_rank, up_finish_product_code from material_requisition_detail
</sql> </sql>
<select id="selectMaterialRequisitionDetailList" parameterType="MaterialRequisitionDetail" resultMap="MaterialRequisitionDetailResult"> <select id="selectMaterialRequisitionDetailList" parameterType="MaterialRequisitionDetail" resultMap="MaterialRequisitionDetailResult">
@ -49,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">material_code,</if> <if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if> <if test="materialName != null">material_name,</if>
<if test="specificationModel != null">specification_model,</if> <if test="specificationModel != null">specification_model,</if>
<if test="itemNumber != null">item_number,</if>
<if test="typeMachine != null">type_machine,</if> <if test="typeMachine != null">type_machine,</if>
<if test="inventoryUnit != null">inventory_unit,</if> <if test="inventoryUnit != null">inventory_unit,</if>
<if test="planQuantity != null">plan_quantity,</if> <if test="planQuantity != null">plan_quantity,</if>
@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">#{materialCode},</if> <if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if> <if test="materialName != null">#{materialName},</if>
<if test="specificationModel != null">#{specificationModel},</if> <if test="specificationModel != null">#{specificationModel},</if>
<if test="itemNumber != null">#{itemNumber},</if>
<if test="typeMachine != null">#{typeMachine},</if> <if test="typeMachine != null">#{typeMachine},</if>
<if test="inventoryUnit != null">#{inventoryUnit},</if> <if test="inventoryUnit != null">#{inventoryUnit},</if>
<if test="planQuantity != null">#{planQuantity},</if> <if test="planQuantity != null">#{planQuantity},</if>
@ -87,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">material_code = #{materialCode},</if> <if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="specificationModel != null">specification_model = #{specificationModel},</if> <if test="specificationModel != null">specification_model = #{specificationModel},</if>
<if test="itemNumber != null">item_number = #{itemNumber},</if>
<if test="typeMachine != null">type_machine = #{typeMachine},</if> <if test="typeMachine != null">type_machine = #{typeMachine},</if>
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if> <if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if>
<if test="planQuantity != null">plan_quantity = #{planQuantity},</if> <if test="planQuantity != null">plan_quantity = #{planQuantity},</if>

37
ruoyi-admin/src/main/resources/mapper/sales/SalesAccountReconciliationMapper.xml

@ -5,6 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.sales.mapper.SalesAccountReconciliationMapper"> <mapper namespace="com.ruoyi.sales.mapper.SalesAccountReconciliationMapper">
<resultMap type="SalesAccountReconciliation" id="SalesAccountReconciliationResult"> <resultMap type="SalesAccountReconciliation" id="SalesAccountReconciliationResult">
<result property="salesFinishId" column="sales_finish_id" />
<result property="noticeOrderNumber" column="notice_order_number" /> <result property="noticeOrderNumber" column="notice_order_number" />
<result property="deliveryDate" column="delivery_date" /> <result property="deliveryDate" column="delivery_date" />
<result property="salesOrderNumber" column="sales_order_number" /> <result property="salesOrderNumber" column="sales_order_number" />
@ -15,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="finishProductName" column="finish_product_name" /> <result property="finishProductName" column="finish_product_name" />
<result property="specificationModel" column="specification_model" /> <result property="specificationModel" column="specification_model" />
<result property="customerNumber" column="customer_number" /> <result property="customerNumber" column="customer_number" />
<result property="typeMachine" column="type_machine" /> <result property="commonCurrency" column="common_currency" />
<result property="processPrice" column="process_price" /> <result property="processPrice" column="process_price" />
<result property="productQuantity" column="product_quantity" /> <result property="productQuantity" column="product_quantity" />
<result property="amountMoney" column="amount_money" /> <result property="amountMoney" column="amount_money" />
@ -43,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-- FROM sys_sales_order sso,sys_sales_finish ssf -- FROM sys_sales_order sso,sys_sales_finish ssf
-- WHERE sso.sales_order_code = ssf.sales_order_code AND sso.sales_order_number = ssf.sales_order_number -- WHERE sso.sales_order_code = ssf.sales_order_code AND sso.sales_order_number = ssf.sales_order_number
SELECT SELECT
`sales`.sales_finish_id,
notice_order_number, notice_order_number,
delivery_date, delivery_date,
`sales`.sales_order_number, `sales`.sales_order_number,
@ -53,7 +55,7 @@ SELECT
`sales`.finish_product_name, `sales`.finish_product_name,
specification_model, specification_model,
customer_number, customer_number,
type_machine, common_currency,
process_price, process_price,
product_quantity, product_quantity,
amount_money, amount_money,
@ -66,18 +68,13 @@ SELECT
FROM FROM
( (
SELECT SELECT
ssf.sales_finish_id,
sso.sales_order_number AS sales_order_number, sso.sales_order_number AS sales_order_number,
sso.enterprise_code AS enterprise_code, sso.enterprise_code AS enterprise_code,
sso.enterprise_name AS enterprise_name, sso.enterprise_name AS enterprise_name,
sso.customer_contact, sso.customer_contact,
ssf.finish_product_code, ssf.finish_product_code AS finish_product_code,
ssf.finish_product_name, ssf.finish_product_name AS finish_product_name,
ssf.specification_model,
ssf.customer_number,
ssf.type_machine,
ssf.process_price,
ssf.product_quantity,
ssf.amount_money,
ssf.account_reconciliation_or_not, ssf.account_reconciliation_or_not,
ssf.account_reconciliation_person, ssf.account_reconciliation_person,
ssf.account_reconciliation_time, ssf.account_reconciliation_time,
@ -97,7 +94,13 @@ FROM
dgd.sales_order_number AS sales_order_number, dgd.sales_order_number AS sales_order_number,
dgn.delivery_date, dgn.delivery_date,
dgd.finish_product_code AS finish_product_code, dgd.finish_product_code AS finish_product_code,
dgd.finish_product_name AS finish_product_name dgd.finish_product_name AS finish_product_name,
dgd.specification_model,
dgd.customer_number,
dgd.common_currency,
dgd.process_price,
dgd.product_quantity,
dgd.amount_money
FROM FROM
delivery_goods_notice dgn, delivery_goods_notice dgn,
delivery_goods_detail dgd delivery_goods_detail dgd
@ -121,12 +124,12 @@ WHERE
<if test="finishProductName != null and finishProductName != ''"> and finish_product_name like concat('%', #{finishProductName}, '%')</if> <if test="finishProductName != null and finishProductName != ''"> and finish_product_name like concat('%', #{finishProductName}, '%')</if>
</select> </select>
<!-- -->
<!-- <select id="selectSalesAccountReconciliationById" parameterType="String" resultMap="SalesAccountReconciliationResult">--> <select id="selectSalesAccountReconciliationById" parameterType="Long" resultMap="SalesAccountReconciliationResult">
<!-- <include refid="selectSalesAccountReconciliationVo"/>--> <include refid="selectSalesAccountReconciliationVo"/>
<!-- where sales_order_code = #{salesOrderCode}--> AND sales_finish_id = #{salesFinishId}
<!-- </select>--> </select>
<!-- -->
<!-- <insert id="insertSalesAccountReconciliation" parameterType="SalesAccountReconciliation">--> <!-- <insert id="insertSalesAccountReconciliation" parameterType="SalesAccountReconciliation">-->
<!-- insert into sales_account_reconciliation--> <!-- insert into sales_account_reconciliation-->
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">--> <!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->

58
ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/add.html

@ -47,10 +47,10 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">制工单号:</label> <label class="col-sm-3 control-label is-required">制工单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<!-- <input name="workOrderNumber" class="form-control" type="text">--> <!-- <input name="workOrderNumber" class="form-control" type="text">-->
<select name="workOrderNumber" class="form-control m-b" type="text"> <select name="workOrderNumber" class="form-control m-b" type="text" required>
<option value="">请选择工单号</option> <option value="">请选择工单号</option>
</select> </select>
</div> </div>
@ -355,6 +355,7 @@
// $.operate.save(prefix + "/add", $('#form-materialRequisitionYL-add').serialize()); // $.operate.save(prefix + "/add", $('#form-materialRequisitionYL-add').serialize());
// } // }
let getData=$('#addMaterialTable').bootstrapTable('getData', true) let getData=$('#addMaterialTable').bootstrapTable('getData', true)
console.log(JSON.stringify(getData))
if(getData.length > 0){ if(getData.length > 0){
//确认添加选中的物料数据 //确认添加选中的物料数据
confirmMaterial(); confirmMaterial();
@ -388,7 +389,6 @@
clickToSelect: true,//点击行选中 clickToSelect: true,//点击行选中
paginationDetailHAlign: ' hiddenDetailInfo', paginationDetailHAlign: ' hiddenDetailInfo',
height: 250, height: 250,
uniqueId: 'materialCode',
queryParams: function (params) { queryParams: function (params) {
//console.log("123"); //console.log("123");
var curParams = { var curParams = {
@ -428,6 +428,10 @@
field: 'specificationModel', field: 'specificationModel',
title: '规格型号' title: '规格型号'
}, },
{
field: 'itemNumber',
title: '客户料号'
},
// { // {
// field: 'typeMachine', // field: 'typeMachine',
// title: '机种', // title: '机种',
@ -453,6 +457,11 @@
validate: function (value) { validate: function (value) {
} }
},
formatter: (value, row, index) => {
let quantity = $("input[name='workOrderQuantity']").val();
row.planQuantity = quantity * row.unitUsage;
return quantity * row.unitUsage;
} }
}, },
{ {
@ -528,6 +537,8 @@
// console.log(finishProductData[i].finishProductCode) // console.log(finishProductData[i].finishProductCode)
$("#form-materialRequisitionYL-add select[name='materialRequisitionPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>"); $("#form-materialRequisitionYL-add select[name='materialRequisitionPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>");
} }
let userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-materialRequisitionYL-add select[name='materialRequisitionPerson']").val(userName).trigger("change")
} }
} }
@ -613,7 +624,7 @@
//选择工单号显示表内订单信息 //选择工单号显示表内订单信息
function showDetailMaterial(workOrderNumber) { function showDetailMaterial(workOrderNumber) {
$('#addMaterialTable').bootstrapTable("removeAll") $('#addMaterialTable').bootstrapTable("removeAll")
console.log(workOrderNumber) // console.log(workOrderNumber)
$.ajax({ $.ajax({
url: ctx + 'manufacture/workOrderDetail/list', url: ctx + 'manufacture/workOrderDetail/list',
type: 'post', type: 'post',
@ -626,7 +637,39 @@
var count = res.rows.length; var count = res.rows.length;
var data = res.rows; var data = res.rows;
var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val(); var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val();
for (i = 0; i < data.length; i++) { for (let i = 0; i < data.length; i++) {
$("#addMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
materialRequisitionNumber: materialRequisitionNumber,
materialCode: data[i].materialCode,
materialName: data[i].materialName,
specificationModel: data[i].specificationModel,
itemNumber: data[i].itemNumber,
inventoryUnit: data[i].inventoryUnit,
planQuantity: '',
description: '',
unitUsage: data[i].materialConsumption,
storageLocation: '',
materialType: data[i].materialType
}
});
}
}
})
$.ajax({
url: ctx + 'manufacture/workOrderDetail/list',
type: 'post',
data: {
workOrderNumber: workOrderNumber,
materialType: '半成品'
},
success: function (res) {
console.log(res)
var count = res.rows.length;
var data = res.rows;
var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val();
for (let i = 0; i < data.length; i++) {
$("#addMaterialTable").bootstrapTable('insertRow', { $("#addMaterialTable").bootstrapTable('insertRow', {
index: count + i, index: count + i,
row: { row: {
@ -634,10 +677,11 @@
materialCode: data[i].materialCode, materialCode: data[i].materialCode,
materialName: data[i].materialName, materialName: data[i].materialName,
specificationModel: data[i].specificationModel, specificationModel: data[i].specificationModel,
itemNumber: data[i].itemNumber,
inventoryUnit: data[i].inventoryUnit, inventoryUnit: data[i].inventoryUnit,
planQuantity: data[i].materialConsumption, planQuantity: '',
description: '', description: '',
unitUsage: '', unitUsage: data[i].materialConsumption,
storageLocation: '', storageLocation: '',
materialType: data[i].materialType materialType: data[i].materialType
} }

43
ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/edit.html

@ -426,6 +426,10 @@
field: 'specificationModel', field: 'specificationModel',
title: '规格型号' title: '规格型号'
}, },
{
field: 'itemNumber',
title: '客户料号'
},
// { // {
// field: 'typeMachine', // field: 'typeMachine',
// title: '机种', // title: '机种',
@ -451,6 +455,10 @@
validate: function (value) { validate: function (value) {
} }
},
formatter: (value, row, index) => {
let quantity = $("input[name='workOrderQuantity']").val();
return quantity * row.unitUsage;
} }
}, },
{ {
@ -620,8 +628,41 @@
materialCode: data[i].materialCode, materialCode: data[i].materialCode,
materialName: data[i].materialName, materialName: data[i].materialName,
specificationModel: data[i].specificationModel, specificationModel: data[i].specificationModel,
itemNumber: data[i].itemNumber,
inventoryUnit: data[i].inventoryUnit,
planQuantity: '',
description: '',
unitUsage: '',
storageLocation: '',
materialType: data[i].materialType
}
});
}
}
})
$.ajax({
url: ctx + 'manufacture/workOrderDetail/list',
type: 'post',
data: {
workOrderNumber: workOrderNumber,
materialType: '半成品'
},
success: function (res) {
console.log(res)
var count = res.rows.length;
var data = res.rows;
var materialRequisitionNumber = $("input[name='materialRequisitionNumber']").val();
for (let i = 0; i < data.length; i++) {
$("#addMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
materialRequisitionNumber: materialRequisitionNumber,
materialCode: data[i].materialCode,
materialName: data[i].materialName,
specificationModel: data[i].specificationModel,
itemNumber: data[i].itemNumber,
inventoryUnit: data[i].inventoryUnit, inventoryUnit: data[i].inventoryUnit,
planQuantity: data[i].materialConsumption, planQuantity: '',
description: '', description: '',
unitUsage: '', unitUsage: '',
storageLocation: '', storageLocation: '',

27
ruoyi-admin/src/main/resources/templates/manufacture/materialRequisitionYL/materialRequisitionYL.html

@ -35,7 +35,6 @@
<label>仓库名称:</label> <label>仓库名称:</label>
<select name="stockName"> <select name="stockName">
<option value="">所有</option> <option value="">所有</option>
<option value="-1">代码生成请选择字典属性</option>
</select> </select>
</li> </li>
<li> <li>
@ -219,6 +218,32 @@
$.table.init(options); $.table.init(options);
}); });
//获取仓库信息
$.ajax({
url: ctx + "stock/stockInfo/list",
type: "post",
success: function (res) {
// console.log(res)
if (res.rows.length > 0) {
let stockData = res.rows;
for (let i in stockData) {
// console.log(finishProductData[i].finishProductCode)
$("#formId select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>");
// $("#formId select[name='stockName']").change(function () {
// var stockName = $(this).val();
// for (let i=0;i<stockData.length;i++) {
// if (stockData[i].stockname == stockName) {
// $("#formId input[name='stockNumber']").val(stockData[i].stockNO);
// $("#formId input[name='stockManager']").val(stockData[i].stockmanager);
// }
// }
// })
}
}
}
})
//删除 //删除
function removeSelected() { function removeSelected() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId); var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);

9
ruoyi-admin/src/main/resources/templates/manufacture/warehousingFinishProductNotice/edit.html

@ -17,10 +17,10 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label is-required">工单号:</label> <label class="col-sm-3 control-label">工单号:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<!-- <input name="workOrderNumber" th:field="*{workOrderNumber}" class="form-control" type="text">--> <!-- <input name="workOrderNumber" th:field="*{workOrderNumber}" class="form-control" type="text">-->
<select name="workOrderNumber" class="form-control m-b" type="text" required> <select name="workOrderNumber" class="form-control m-b" type="text">
<option value="">请选择工单号</option> <option value="">请选择工单号</option>
</select> </select>
</div> </div>
@ -186,6 +186,8 @@
let orderData = res.rows; let orderData = res.rows;
for (let i in orderData) { for (let i in orderData) {
$("#form-warehousingFinishProductNotice-edit select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>"); $("#form-warehousingFinishProductNotice-edit select[name='workOrderNumber']").append("<option value='" + orderData[i].workOrderNumber + "'>" + orderData[i].workOrderNumber + "</option>");
}
console.log(getData.workOrderNumber)
$("#form-warehousingFinishProductNotice-edit select[name='workOrderNumber']").val(getData.workOrderNumber).trigger("change") $("#form-warehousingFinishProductNotice-edit select[name='workOrderNumber']").val(getData.workOrderNumber).trigger("change")
$("#form-warehousingFinishProductNotice-edit select[name='workOrderNumber']").change(function () { $("#form-warehousingFinishProductNotice-edit select[name='workOrderNumber']").change(function () {
var workOrderNumber = $(this).val(); var workOrderNumber = $(this).val();
@ -205,7 +207,6 @@
}) })
} }
} }
}
}) })
//获取仓库信息 //获取仓库信息
@ -219,6 +220,7 @@
for (let i in stockData) { for (let i in stockData) {
// console.log(finishProductData[i].finishProductCode) // console.log(finishProductData[i].finishProductCode)
$("#form-warehousingFinishProductNotice-edit select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); $("#form-warehousingFinishProductNotice-edit select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>");
}
$("#form-warehousingFinishProductNotice-edit select[name='stockName']").val(getData.stockName).trigger("change") $("#form-warehousingFinishProductNotice-edit select[name='stockName']").val(getData.stockName).trigger("change")
$("#form-warehousingFinishProductNotice-edit select[name='stockName']").change(function () { $("#form-warehousingFinishProductNotice-edit select[name='stockName']").change(function () {
var stockName = $(this).val(); var stockName = $(this).val();
@ -230,7 +232,6 @@
} }
}) })
} }
}
} }
}) })

639
ruoyi-admin/src/main/resources/templates/manufacture/workOrderInfo/edit.html

@ -511,7 +511,6 @@
clickToSelect: true, clickToSelect: true,
paginationDetailHAlign: ' hiddenDetailInfo', paginationDetailHAlign: ' hiddenDetailInfo',
height: 250, height: 250,
uniqueId: 'materialCode',
queryParams: function (params) { queryParams: function (params) {
//console.log("123"); //console.log("123");
var curParams = { var curParams = {
@ -817,7 +816,7 @@
modalName: "bom半成品", modalName: "bom半成品",
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图 cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表 detailView: true, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数 smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮 showExport: false, // 是否显示导出按钮
clickToSelect: true, clickToSelect: true,
@ -892,11 +891,500 @@
{ {
field: 'processingCategory', field: 'processingCategory',
title: '加工类别' title: '加工类别'
}] }],
onExpandRow: function (index,row,$detail) {
// console.log(index)
// console.log(row.finishProductCode)
// console.log($detail)
$detail.html('<table class="table-container" id="raw_table"></table>' +
'<table class="table-container" id="subsidiary_table"></table>'+
'<table class="table-container" id="bcp_table"></table>'
).find('table');
initRawDetail(index,row,$detail);
initSubsidiaryDetail(index,row,$detail);
initBcpDetail(index,row,$detail);
}
}; };
$.table.init(options); $.table.init(options);
} }
//初始化子表格(循环) 一阶--原料
initRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#raw_table").bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
checkbox: true
},
{
field: 'rawMaterialId',
title: '原料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'rawMaterialCode',
title: '原料代码'
},
{
field: 'rawMaterialName',
title: '原料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'rawMaterialConsumption',
title: '用量'
},
{
field: 'rawMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initRawDetail(index, row, $detail);
}
})
}
//初始化子表格(循环) 一阶--辅料
initSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#subsidiary_table").bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
checkbox: true
},
{
field: 'subsidiaryMaterialId',
title: 'bom辅料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'subsidiaryMaterialCode',
title: '辅料代码'
},
{
field: 'subsidiaryMaterialName',
title: '辅料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'subsidiaryMaterialConsumption',
title: '用量'
},
{
field: 'subsidiaryMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initSubsidiaryDetail(index, row, $detail);
}
})
}
//初始化子表格(循环) 一阶--半成品
initBcpDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var bcp_table = $detail.html('<table class="table-container" id="bcp_table"></table>').find('table');
$("#bcp_table").bootstrapTable({
url: ctx + 'system/bomBcp/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
detailView: true,
columns: [
{
checkbox: true
},
{
field: 'bcpCode',
title: '半成品代码(二阶)'
},
{
field: 'bcpName',
title: '半成品名称'
},
{
field: 'bcpVersionNumber',
title: '版本号'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'bcpConsumption',
title: '用量'
},
{
field: 'bcpLoss',
title: '损耗%'
},
{
field: 'customerNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $bcpdetail) {
$bcpdetail.html('<table class="table-container" id="bcp_raw_table"></table>' +
'<table class="table-container" id="bcp_subsidiary_table"></table>' +
'<table class="table-container" id="bcp_bcp_table"></table>'
).find('table');
initBcpDetail(index, row, $bcpdetail);
initBcpRawDetail(index, row, $bcpdetail);
initBcpSubsidiaryDetail(index, row, $bcpdetail);
initBcpBcpDetail(index, row, $bcpdetail);
}
})
}
//初始化子表格(循环) 二阶--原料
initBcpRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var bcpVersionNumber = row.bcpVersionNumber;
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#bcp_raw_table").bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
checkbox: true
},
{
field: 'rawMaterialId',
title: '原料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'rawMaterialCode',
title: '原料代码'
},
{
field: 'rawMaterialName',
title: '原料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'rawMaterialConsumption',
title: '用量'
},
{
field: 'rawMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initBcpRawDetail(index, row, $detail);
}
})
}
//初始化子表格(循环) 二阶--辅料
initBcpSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var bcpVersionNumber = row.bcpVersionNumber;
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#bcp_subsidiary_table").bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
checkbox: true
},
{
field: 'subsidiaryMaterialId',
title: 'bom辅料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'subsidiaryMaterialCode',
title: '辅料代码'
},
{
field: 'subsidiaryMaterialName',
title: '辅料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'subsidiaryMaterialConsumption',
title: '用量'
},
{
field: 'subsidiaryMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initBcpSubsidiaryDetail(index, row, $detail);
}
})
}
//关闭BOM信息 //关闭BOM信息
function closeBomDetailModal() { function closeBomDetailModal() {
$("#bomMaterialModal").modal("hide"); $("#bomMaterialModal").modal("hide");
@ -907,14 +1395,19 @@
var dataRaw = $("#rawMaterialBomTable").bootstrapTable("getSelections"); var dataRaw = $("#rawMaterialBomTable").bootstrapTable("getSelections");
var dataSubsidiary = $("#subsidiaryMaterialBomTable").bootstrapTable("getSelections"); var dataSubsidiary = $("#subsidiaryMaterialBomTable").bootstrapTable("getSelections");
var dataBcp = $("#bcpMaterialBomTable").bootstrapTable("getSelections"); var dataBcp = $("#bcpMaterialBomTable").bootstrapTable("getSelections");
var dataRawTable = $("#raw_table").bootstrapTable("getSelections");
var dataSubsidiaryTable = $("#subsidiary_table").bootstrapTable("getSelections");
var dataBcpTable = $("#bcp_table").bootstrapTable("getSelections");
var dataBcpRawTable = $("#bcp_raw_table").bootstrapTable("getSelections");
var dataBcpSubsidiaryTable = $("#bcp_subsidiary_table").bootstrapTable("getSelections");
var count = $('#addBomMaterialTable').bootstrapTable('getData').length; var count = $('#addBomMaterialTable').bootstrapTable('getData').length;
var workOrderNumber = $("input[name='workOrderNumber']").val(); var workOrderNumber = $("input[name='workOrderNumber']").val();
for (let i = 0; i < dataRaw.length; i++) { for (let i = 0; i < dataRaw.length; i++) {
let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataRaw[i].rawMaterialCode); // let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataRaw[i].rawMaterialCode);
if (material != null) { // if (material != null) {
alert(material.materialName + "已存在,不可重复添加!"); // alert(material.materialName + "已存在,不可重复添加!");
continue; // continue;
} // }
$("#addBomMaterialTable").bootstrapTable('insertRow', { $("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i, index: count + i,
row: { row: {
@ -931,11 +1424,11 @@
}); });
} }
for (let i = 0; i < dataSubsidiary.length; i++) { for (let i = 0; i < dataSubsidiary.length; i++) {
let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataSubsidiary[i].subsidiaryMaterialCode); // let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataSubsidiary[i].subsidiaryMaterialCode);
if (material != null) { // if (material != null) {
alert(material.materialName + "已存在,不可重复添加!"); // alert(material.materialName + "已存在,不可重复添加!");
continue; // continue;
} // }
$("#addBomMaterialTable").bootstrapTable('insertRow', { $("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i, index: count + i,
row: { row: {
@ -952,11 +1445,11 @@
}); });
} }
for (let i = 0; i < dataBcp.length; i++) { for (let i = 0; i < dataBcp.length; i++) {
let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode); // let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
if (material != null) { // if (material != null) {
alert(material.materialName + "已存在,不可重复添加!"); // alert(material.materialName + "已存在,不可重复添加!");
continue; // continue;
} // }
$("#addBomMaterialTable").bootstrapTable('insertRow', { $("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i, index: count + i,
row: { row: {
@ -972,9 +1465,119 @@
} }
}); });
} }
for (let i = 0; i < dataRawTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataRawTable[i].rawMaterialCode,
materialName: dataRawTable[i].rawMaterialName,
specificationModel: dataRawTable[i].specificationModel,
inventoryUnit: dataRawTable[i].inventoryUnit,
materialType: '原料',
materialConsumption: dataRawTable[i].rawMaterialConsumption,
itemNumber: dataRawTable[i].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataSubsidiaryTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataSubsidiaryTable[i].subsidiaryMaterialCode,
materialName: dataSubsidiaryTable[i].subsidiaryMaterialName,
specificationModel: dataSubsidiaryTable[i].specificationModel,
inventoryUnit: dataSubsidiaryTable[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataSubsidiaryTable[i].subsidiaryMaterialConsumption,
itemNumber: dataSubsidiaryTable[i].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataBcpTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpTable[i].bcpCode,
materialName: dataBcpTable[i].bcpName,
specificationModel: dataBcpTable[i].specificationModel,
inventoryUnit: dataBcpTable[i].inventoryUnit,
materialType: '半成品',
materialConsumption: dataBcpTable[i].bcpConsumption,
itemNumber: dataBcpTable[i].customerNumber,
description: ''
}
});
}
for (let i = 0; i < dataBcpRawTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpRawTable[i].rawMaterialCode,
materialName: dataBcpRawTable[i].rawMaterialName,
specificationModel: dataBcpRawTable[i].specificationModel,
inventoryUnit: dataBcpRawTable[i].inventoryUnit,
materialType: '原料',
materialConsumption: dataBcpRawTable[i].rawMaterialConsumption,
itemNumber: dataBcpRawTable[i].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataBcpSubsidiaryTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpSubsidiaryTable[i].subsidiaryMaterialCode,
materialName: dataBcpSubsidiaryTable[i].subsidiaryMaterialName,
specificationModel: dataBcpSubsidiaryTable[i].specificationModel,
inventoryUnit: dataBcpSubsidiaryTable[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataBcpSubsidiaryTable[i].subsidiaryMaterialConsumption,
itemNumber: dataBcpSubsidiaryTable[i].supplierNumber,
description: ''
}
});
}
$("#rawMaterialBomTable").bootstrapTable("uncheckAll"); $("#rawMaterialBomTable").bootstrapTable("uncheckAll");
$("#subsidiaryMaterialBomTable").bootstrapTable("uncheckAll"); $("#subsidiaryMaterialBomTable").bootstrapTable("uncheckAll");
$("#bcpMaterialBomTable").bootstrapTable("uncheckAll"); $("#bcpMaterialBomTable").bootstrapTable("uncheckAll");
$("#raw_table").bootstrapTable("uncheckAll");
$("#subsidiary_table").bootstrapTable("uncheckAll");
$("#bcp_table").bootstrapTable("uncheckAll");
$("#bcp_raw_table").bootstrapTable("uncheckAll");
$("#bcp_subsidiary_table").bootstrapTable("uncheckAll");
closeBomDetailModal(); closeBomDetailModal();
} }

68
ruoyi-admin/src/main/resources/templates/sales/salesAccountReconciliation/salesAccountReconciliation.html

@ -3,6 +3,7 @@
<head> <head>
<th:block th:include="include :: header('销售对账列表')"/> <th:block th:include="include :: header('销售对账列表')"/>
<th:block th:include="include :: datetimepicker-css"/> <th:block th:include="include :: datetimepicker-css"/>
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
<style> <style>
.table-striped { .table-striped {
border: 0px !important; border: 0px !important;
@ -106,7 +107,7 @@
shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:customConfirm"> shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:customConfirm">
<i class="fa fa-hand-grab-o"></i> 客户使用确认 <i class="fa fa-hand-grab-o"></i> 客户使用确认
</a> </a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" <a class="btn btn-warning" onclick="exportAccountReconciliation()"
shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:export"> shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
@ -332,7 +333,7 @@
var nationalTaxBillDatas = [[${@dict.getType('sys_whether')}]]; var nationalTaxBillDatas = [[${@dict.getType('sys_whether')}]];
var closeCaseOrNotDatas = [[${@dict.getType('sys_whether')}]]; var closeCaseOrNotDatas = [[${@dict.getType('sys_whether')}]];
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]];
var commonCurrencyDatas = [[${@dict.getType('sys_coin_class')}]]; var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var prefix = ctx + "sales/salesAccountReconciliation"; var prefix = ctx + "sales/salesAccountReconciliation";
var prefix1 = ctx + "returnGoods/returnGoodsProduct"; var prefix1 = ctx + "returnGoods/returnGoodsProduct";
@ -348,6 +349,11 @@
modalName: "销售对账", modalName: "销售对账",
columns: [{ columns: [{
checkbox: true checkbox: true
},
{
field: 'salesFinishId',
title: '销售物料id',
visible: false
}, },
{ {
field: 'accountReconciliationOrNot', field: 'accountReconciliationOrNot',
@ -405,8 +411,12 @@
title: '客户料号' title: '客户料号'
}, },
{ {
field: 'typeMachine', field: 'commonCurrency',
title: '机种' title: '币别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(commonCurrencyDatas, value);
},
visible: false
}, },
{ {
field: 'processPrice', field: 'processPrice',
@ -787,6 +797,56 @@
}); });
} }
//导出
function exportAccountReconciliation() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
// console.log(rows)
// console.log(rows.join())
var data = $("#bootstrap-table").bootstrapTable("getSelections")
if (rows.length == 0) {
$.modal.alert("未选择数据,请选择数据!");
return;
} else {
// rows为选中行的id
// console.log(rows);
console.log(data);
// console.log(data[0].orderNumber)
var ids = [];
for (let i=0;i<rows.length;i++) {
ids.push(data[i].salesFinishId)
}
// console.log(ids)
// console.log(ids.join())
$.modal.confirm("确认要导出销售对账吗?", function (){
axios({
url: prefix + '/exportSelected/'+ ids.join(),
method: 'POST',
responseType: 'blob'
}).then(response => {
// sendSearchParameter(supplierCode, supplierName);
// 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> </script>
</body> </body>
</html> </html>

4
ruoyi-admin/src/main/resources/templates/storehouse/warehousingCheckInfo/add.html

@ -333,7 +333,7 @@
} }
}); });
//获取领料 //获取盘点
$.ajax({ $.ajax({
url: ctx + "system/user/list", url: ctx + "system/user/list",
type: "post", type: "post",
@ -345,6 +345,8 @@
// console.log(finishProductData[i].finishProductCode) // console.log(finishProductData[i].finishProductCode)
$("#form-warehousingCheckInfo-add select[name='warehousingCheckPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>"); $("#form-warehousingCheckInfo-add select[name='warehousingCheckPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>");
} }
let userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-warehousingCheckInfo-add select[name='warehousingCheckPerson']").val(userName).trigger("change")
} }
} }

12
ruoyi-admin/src/main/resources/templates/storehouse/warehousingCheckInfo/edit.html

@ -327,9 +327,9 @@
let userData = res.rows; let userData = res.rows;
for (let i in userData) { for (let i in userData) {
// console.log(finishProductData[i].finishProductCode) // console.log(finishProductData[i].finishProductCode)
$("#form-warehousingCheckInfo-add select[name='warehousingCheckPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>"); $("#form-warehousingCheckInfo-edit select[name='warehousingCheckPerson']").append("<option value='" + userData[i].userName + "'>" + userData[i].userName + "</option>");
} }
$("#form-warehousingCheckInfo-add select[name='warehousingCheckPerson']").val(getData.warehousingCheckPerson).trigger("change") $("#form-warehousingCheckInfo-edit select[name='warehousingCheckPerson']").val(getData.warehousingCheckPerson).trigger("change")
} }
} }
@ -345,13 +345,13 @@
let stockData = res.rows; let stockData = res.rows;
for (let i in stockData) { for (let i in stockData) {
// console.log(finishProductData[i].finishProductCode) // console.log(finishProductData[i].finishProductCode)
$("#form-warehousingCheckInfo-add select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>"); $("#form-warehousingCheckInfo-edit select[name='stockName']").append("<option value='" + stockData[i].stockname + "'>" + stockData[i].stockname + "</option>");
$("#form-warehousingCheckInfo-add select[name='stockName']").val(getData.stockName).trigger("change") $("#form-warehousingCheckInfo-edit select[name='stockName']").val(getData.stockName).trigger("change")
$("#form-warehousingCheckInfo-add select[name='stockName']").change(function () { $("#form-warehousingCheckInfo-edit select[name='stockName']").change(function () {
var stockName = $(this).val(); var stockName = $(this).val();
for (let i=0;i<stockData.length;i++) { for (let i=0;i<stockData.length;i++) {
if (stockData[i].stockname == stockName) { if (stockData[i].stockname == stockName) {
$("#form-warehousingCheckInfo-add input[name='stockNumber']").val(stockData[i].stockNO); $("#form-warehousingCheckInfo-edit input[name='stockNumber']").val(stockData[i].stockNO);
} }
} }
}) })

10
ruoyi-admin/src/main/resources/templates/storehouse/warehousingCheckInfo/warehousingCheckInfo.html

@ -24,9 +24,9 @@
</li> </li>
<li class="select-time"> <li class="select-time">
<label>盘点日期:</label> <label>盘点日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginWarehousingCheckDate]"/> <input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingCheckDate]"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endWarehousingCheckDate]"/> <input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingCheckDate]"/>
</li> </li>
<li> <li>
<label>物料种类:</label> <label>物料种类:</label>
@ -61,9 +61,9 @@
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="storehouse:warehousingCheckInfo:remove"> <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="storehouse:warehousingCheckInfo:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storehouse:warehousingCheckInfo:export"> <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storehouse:warehousingCheckInfo:export">-->
<i class="fa fa-download"></i> 导出 <!-- <i class="fa fa-download"></i> 导出-->
</a> <!-- </a>-->
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space: nowrap"></table> <table id="bootstrap-table" style="white-space: nowrap"></table>

6
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInFinishProduct/warehousingInFinishProduct.html

@ -66,9 +66,9 @@
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInFinishProduct:remove"> <a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInFinishProduct:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storehouse:warehousingInFinishProduct:export"> <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storehouse:warehousingInFinishProduct:export">-->
<i class="fa fa-download"></i> 导出 <!-- <i class="fa fa-download"></i> 导出-->
</a> <!-- </a>-->
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space: nowrap"></table> <table id="bootstrap-table" style="white-space: nowrap"></table>

40
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDFinishProduct/add.html

@ -75,22 +75,24 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">制单人员:</label> <label class="col-sm-3 control-label">制单人员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="documentPreparationPersonnel" class="form-control" type="text"> <!-- <input name="documentPreparationPersonnel" class="form-control" type="text">-->
<select name="documentPreparationPersonnel" class="form-control m-b">
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">仓库</label> <label class="col-sm-3 control-label is-required">仓库名称</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="stockNumber" class="form-control" type="text"> <!-- <input name="stockName" class="form-control" type="text">-->
<select name="stockName" class="form-control m-b">
<option value="">所有</option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">仓库名称</label> <label class="col-sm-3 control-label">仓库</label>
<div class="col-sm-8"> <div class="col-sm-8">
<!-- <input name="stockName" class="form-control" type="text">--> <input name="stockNumber" class="form-control" type="text">
<select name="stockName" class="form-control m-b" required>
<option value="">所有</option>
</select>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -256,6 +258,28 @@
} }
}) })
/*用户列表*/
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var usertData = res.rows;
//alert(JSON.stringify(data));
for (let i in usertData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-warehousingInPDFinishProduct-add select[name='documentPreparationPersonnel']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
let userName = [[${@permission.getPrincipalProperty('userName')}]];
$("#form-warehousingInPDFinishProduct-add select[name='documentPreparationPersonnel']").val(userName).trigger("change")
} else {
$.modal.msgError(res.msg);
}
}
})
//初始化添加材料表 //初始化添加材料表
$('#addDetailTable').bootstrapTable({ $('#addDetailTable').bootstrapTable({
pagination: true, pagination: true,

37
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDFinishProduct/edit.html

@ -76,13 +76,9 @@
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">制单人员:</label> <label class="col-sm-3 control-label">制单人员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
<input name="documentPreparationPersonnel" th:field="*{documentPreparationPersonnel}" class="form-control" type="text"> <!-- <input name="documentPreparationPersonnel" th:field="*{documentPreparationPersonnel}" class="form-control" type="text">-->
</div> <select name="documentPreparationPersonnel" class="form-control m-b">
</div> </select>
<div class="form-group">
<label class="col-sm-3 control-label">仓库号:</label>
<div class="col-sm-8">
<input name="stockNumber" th:field="*{stockNumber}" class="form-control" type="text">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
@ -94,6 +90,12 @@
</select> </select>
</div> </div>
</div> </div>
<div class="form-group">
<label class="col-sm-3 control-label">仓库号:</label>
<div class="col-sm-8">
<input name="stockNumber" th:field="*{stockNumber}" class="form-control" type="text">
</div>
</div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">仓库管理员:</label> <label class="col-sm-3 control-label">仓库管理员:</label>
<div class="col-sm-8"> <div class="col-sm-8">
@ -239,6 +241,27 @@
} }
}) })
/*用户列表*/
$.ajax({
url: ctx + 'system/user/list',
type: 'post',
success: function (res) {
console.log(res)
if (res.rows.length > 0) {
var usertData = res.rows;
//alert(JSON.stringify(data));
for (let i in usertData) {
// console.log(finishProductData[i].finishProductCode)
$("#form-warehousingInPDFinishProduct-edit select[name='documentPreparationPersonnel']").append("<option value='" + usertData[i].userName + "'>" + usertData[i].userName + "</option>");
}
$("#form-warehousingInPDFinishProduct-edit select[name='documentPreparationPersonnel']").val(getData.documentPreparationPersonnel).trigger("change")
} else {
$.modal.msgError(res.msg);
}
}
})
//初始化添加材料表 //初始化添加材料表
$('#addDetailTable').bootstrapTable({ $('#addDetailTable').bootstrapTable({
url: prefixDetail + '/list', url: prefixDetail + '/list',

6
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInPDFinishProduct/warehousingInPDFinishProduct.html

@ -24,9 +24,9 @@
</li> </li>
<li class="select-time"> <li class="select-time">
<label>入库日期:</label> <label>入库日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginWarehousingDate]"/> <input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingDate]"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endWarehousingDate]"/> <input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingDate]"/>
</li> </li>
<li> <li>
<label>仓库名称:</label> <label>仓库名称:</label>
@ -211,7 +211,7 @@
$.modal.alert("请选择一条记录"); $.modal.alert("请选择一条记录");
return; return;
} else { } else {
$.modal.confirm("是否确认要导出本条订单?", function (){ $.modal.confirm("是否确认要导出所选的成品入库单?", function (){
axios({ axios({
url: prefix + '/exportSelectedFinishProduct/'+data[0].warehousingInfoId, url: prefix + '/exportSelectedFinishProduct/'+data[0].warehousingInfoId,
method: 'POST', method: 'POST',

7
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInRGFinishProduct/warehousingInRGFinishProduct.html

@ -13,6 +13,7 @@
<li> <li>
<label>入库单号:</label> <label>入库单号:</label>
<input type="text" name="warehousingNumber"/> <input type="text" name="warehousingNumber"/>
<input type="text" name="warehousingNumber"/>
</li> </li>
<li> <li>
<label>入库类型:</label> <label>入库类型:</label>
@ -58,9 +59,9 @@
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInFinishProduct:remove"> <a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInFinishProduct:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storehouse:warehousingInFinishProduct:export"> <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="storehouse:warehousingInFinishProduct:export">-->
<i class="fa fa-download"></i> 导出 <!-- <i class="fa fa-download"></i> 导出-->
</a> <!-- </a>-->
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space: nowrap"></table> <table id="bootstrap-table" style="white-space: nowrap"></table>

10
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInRawMaterial/warehousingInRawMaterial.html

@ -32,9 +32,9 @@
</li> </li>
<li class="select-time"> <li class="select-time">
<label>入库日期:</label> <label>入库日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginWarehousingDate]"/> <input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingDate]"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endWarehousingDate]"/> <input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingDate]"/>
</li> </li>
<li> <li>
<label>仓库名称:</label> <label>仓库名称:</label>
@ -66,9 +66,9 @@
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInInfo:remove"> <a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInInfo:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>
<a class="btn btn-warning" onclick="exportSelectedRaw()" shiro:hasPermission="storehouse:warehousingInInfo:export"> <!-- <a class="btn btn-warning" onclick="exportSelectedRaw()" shiro:hasPermission="storehouse:warehousingInInfo:export">-->
<i class="fa fa-download"></i> 导出 <!-- <i class="fa fa-download"></i> 导出-->
</a> <!-- </a>-->
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space: nowrap"></table> <table id="bootstrap-table" style="white-space: nowrap"></table>

4
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInSearch/warehousingInSearch.html

@ -54,9 +54,9 @@
</li> </li>
<li class="select-time"> <li class="select-time">
<label>入库日期:</label> <label>入库日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginWarehousingDate]"/> <input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingDate]"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endWarehousingDate]"/> <input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingDate]"/>
</li> </li>
<li> <li>
<label>供应商代码:</label> <label>供应商代码:</label>

10
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInSubsidiary/warehousingInSubsidiary.html

@ -32,9 +32,9 @@
</li> </li>
<li class="select-time"> <li class="select-time">
<label>入库日期:</label> <label>入库日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginWarehousingDate]"/> <input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingDate]"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endWarehousingDate]"/> <input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingDate]"/>
</li> </li>
<li> <li>
<label>仓库名称:</label> <label>仓库名称:</label>
@ -66,9 +66,9 @@
<a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInInfo:remove"> <a class="btn btn-danger multiple disabled" onclick="removeSelected()" shiro:hasPermission="storehouse:warehousingInInfo:remove">
<i class="fa fa-remove"></i> 删除 <i class="fa fa-remove"></i> 删除
</a> </a>
<a class="btn btn-warning" onclick="exportSelectedSubsidiary()" shiro:hasPermission="storehouse:warehousingInInfo:export"> <!-- <a class="btn btn-warning" onclick="exportSelectedSubsidiary()" shiro:hasPermission="storehouse:warehousingInInfo:export">-->
<i class="fa fa-download"></i> 导出 <!-- <i class="fa fa-download"></i> 导出-->
</a> <!-- </a>-->
</div> </div>
<div class="col-sm-12 select-table table-striped"> <div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table" style="white-space: nowrap"></table> <table id="bootstrap-table" style="white-space: nowrap"></table>

4
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInspectionNotice/add.html

@ -104,10 +104,10 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">交检日期</label> <label class="col-sm-3 control-label">交检时间</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="inspectionDate" class="form-control" placeholder="yyyy-MM-dd" type="text"> <input name="inspectionDate" class="form-control" placeholder="yyyy-MM-dd hh:ii:ss" 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>

4
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInspectionNotice/edit.html

@ -105,10 +105,10 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">交检日期</label> <label class="col-sm-3 control-label">交检时间</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="inspectionDate" th:field="*{inspectionDate}" class="form-control" placeholder="yyyy-MM-dd" type="text"> <input name="inspectionDate" th:field="*{inspectionDate}" class="form-control" placeholder="yyyy-MM-dd hh:ii:ss" 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>

6
ruoyi-admin/src/main/resources/templates/storehouse/warehousingInspectionNotice/warehousingInspectionNotice.html

@ -40,9 +40,9 @@
</li> </li>
<li class="select-time"> <li class="select-time">
<label>入库日期:</label> <label>入库日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginWarehousingDate]"/> <input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingDate]"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endWarehousingDate]"/> <input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingDate]"/>
</li> </li>
<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-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -216,7 +216,7 @@
}, },
{ {
field: 'inspectionDate', field: 'inspectionDate',
title: '交检日期' title: '交检时间'
}, },
{ {
field: 'warehousingDate', field: 'warehousingDate',

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/manufacture/domain/exportDto/MaterialRequisitionDetailDto.class

Binary file not shown.

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

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/purchase/controller/PurchaseOrderController.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/purchase/domain/exportDto/PurchaseMaterialDto.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/purchase/domain/exportDto/PurchaseOrderDto.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/sales/controller/SalesAccountReconciliationController.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/sales/domain/SalesAccountReconciliation.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/sales/mapper/SalesAccountReconciliationMapper.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/sales/service/ISalesAccountReconciliationService.class

Binary file not shown.

BIN
ruoyi-admin/target/classes/com/ruoyi/sales/service/impl/SalesAccountReconciliationServiceImpl.class

Binary file not shown.

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

@ -10,6 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="materialCode" column="material_code" /> <result property="materialCode" column="material_code" />
<result property="materialName" column="material_name" /> <result property="materialName" column="material_name" />
<result property="specificationModel" column="specification_model" /> <result property="specificationModel" column="specification_model" />
<result property="itemNumber" column="item_number" />
<result property="typeMachine" column="type_machine" /> <result property="typeMachine" column="type_machine" />
<result property="inventoryUnit" column="inventory_unit" /> <result property="inventoryUnit" column="inventory_unit" />
<result property="planQuantity" column="plan_quantity" /> <result property="planQuantity" column="plan_quantity" />
@ -24,7 +25,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectMaterialRequisitionDetailVo"> <sql id="selectMaterialRequisitionDetailVo">
select material_requisition_detail_id, material_requisition_number, material_code, material_name, specification_model, type_machine, inventory_unit, plan_quantity, description, unit_usage, storage_location, material_type, standby_one, standby_two, bom_rank, up_finish_product_code from material_requisition_detail select material_requisition_detail_id, material_requisition_number, material_code, material_name, specification_model, item_number, type_machine, inventory_unit, plan_quantity, description, unit_usage, storage_location, material_type, standby_one, standby_two, bom_rank, up_finish_product_code from material_requisition_detail
</sql> </sql>
<select id="selectMaterialRequisitionDetailList" parameterType="MaterialRequisitionDetail" resultMap="MaterialRequisitionDetailResult"> <select id="selectMaterialRequisitionDetailList" parameterType="MaterialRequisitionDetail" resultMap="MaterialRequisitionDetailResult">
@ -49,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">material_code,</if> <if test="materialCode != null">material_code,</if>
<if test="materialName != null">material_name,</if> <if test="materialName != null">material_name,</if>
<if test="specificationModel != null">specification_model,</if> <if test="specificationModel != null">specification_model,</if>
<if test="itemNumber != null">item_number,</if>
<if test="typeMachine != null">type_machine,</if> <if test="typeMachine != null">type_machine,</if>
<if test="inventoryUnit != null">inventory_unit,</if> <if test="inventoryUnit != null">inventory_unit,</if>
<if test="planQuantity != null">plan_quantity,</if> <if test="planQuantity != null">plan_quantity,</if>
@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">#{materialCode},</if> <if test="materialCode != null">#{materialCode},</if>
<if test="materialName != null">#{materialName},</if> <if test="materialName != null">#{materialName},</if>
<if test="specificationModel != null">#{specificationModel},</if> <if test="specificationModel != null">#{specificationModel},</if>
<if test="itemNumber != null">#{itemNumber},</if>
<if test="typeMachine != null">#{typeMachine},</if> <if test="typeMachine != null">#{typeMachine},</if>
<if test="inventoryUnit != null">#{inventoryUnit},</if> <if test="inventoryUnit != null">#{inventoryUnit},</if>
<if test="planQuantity != null">#{planQuantity},</if> <if test="planQuantity != null">#{planQuantity},</if>
@ -87,6 +90,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="materialCode != null">material_code = #{materialCode},</if> <if test="materialCode != null">material_code = #{materialCode},</if>
<if test="materialName != null">material_name = #{materialName},</if> <if test="materialName != null">material_name = #{materialName},</if>
<if test="specificationModel != null">specification_model = #{specificationModel},</if> <if test="specificationModel != null">specification_model = #{specificationModel},</if>
<if test="itemNumber != null">item_number = #{itemNumber},</if>
<if test="typeMachine != null">type_machine = #{typeMachine},</if> <if test="typeMachine != null">type_machine = #{typeMachine},</if>
<if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if> <if test="inventoryUnit != null">inventory_unit = #{inventoryUnit},</if>
<if test="planQuantity != null">plan_quantity = #{planQuantity},</if> <if test="planQuantity != null">plan_quantity = #{planQuantity},</if>

37
ruoyi-admin/target/classes/mapper/sales/SalesAccountReconciliationMapper.xml

@ -5,6 +5,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<mapper namespace="com.ruoyi.sales.mapper.SalesAccountReconciliationMapper"> <mapper namespace="com.ruoyi.sales.mapper.SalesAccountReconciliationMapper">
<resultMap type="SalesAccountReconciliation" id="SalesAccountReconciliationResult"> <resultMap type="SalesAccountReconciliation" id="SalesAccountReconciliationResult">
<result property="salesFinishId" column="sales_finish_id" />
<result property="noticeOrderNumber" column="notice_order_number" /> <result property="noticeOrderNumber" column="notice_order_number" />
<result property="deliveryDate" column="delivery_date" /> <result property="deliveryDate" column="delivery_date" />
<result property="salesOrderNumber" column="sales_order_number" /> <result property="salesOrderNumber" column="sales_order_number" />
@ -15,7 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="finishProductName" column="finish_product_name" /> <result property="finishProductName" column="finish_product_name" />
<result property="specificationModel" column="specification_model" /> <result property="specificationModel" column="specification_model" />
<result property="customerNumber" column="customer_number" /> <result property="customerNumber" column="customer_number" />
<result property="typeMachine" column="type_machine" /> <result property="commonCurrency" column="common_currency" />
<result property="processPrice" column="process_price" /> <result property="processPrice" column="process_price" />
<result property="productQuantity" column="product_quantity" /> <result property="productQuantity" column="product_quantity" />
<result property="amountMoney" column="amount_money" /> <result property="amountMoney" column="amount_money" />
@ -43,6 +44,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
-- FROM sys_sales_order sso,sys_sales_finish ssf -- FROM sys_sales_order sso,sys_sales_finish ssf
-- WHERE sso.sales_order_code = ssf.sales_order_code AND sso.sales_order_number = ssf.sales_order_number -- WHERE sso.sales_order_code = ssf.sales_order_code AND sso.sales_order_number = ssf.sales_order_number
SELECT SELECT
`sales`.sales_finish_id,
notice_order_number, notice_order_number,
delivery_date, delivery_date,
`sales`.sales_order_number, `sales`.sales_order_number,
@ -53,7 +55,7 @@ SELECT
`sales`.finish_product_name, `sales`.finish_product_name,
specification_model, specification_model,
customer_number, customer_number,
type_machine, common_currency,
process_price, process_price,
product_quantity, product_quantity,
amount_money, amount_money,
@ -66,18 +68,13 @@ SELECT
FROM FROM
( (
SELECT SELECT
ssf.sales_finish_id,
sso.sales_order_number AS sales_order_number, sso.sales_order_number AS sales_order_number,
sso.enterprise_code AS enterprise_code, sso.enterprise_code AS enterprise_code,
sso.enterprise_name AS enterprise_name, sso.enterprise_name AS enterprise_name,
sso.customer_contact, sso.customer_contact,
ssf.finish_product_code, ssf.finish_product_code AS finish_product_code,
ssf.finish_product_name, ssf.finish_product_name AS finish_product_name,
ssf.specification_model,
ssf.customer_number,
ssf.type_machine,
ssf.process_price,
ssf.product_quantity,
ssf.amount_money,
ssf.account_reconciliation_or_not, ssf.account_reconciliation_or_not,
ssf.account_reconciliation_person, ssf.account_reconciliation_person,
ssf.account_reconciliation_time, ssf.account_reconciliation_time,
@ -97,7 +94,13 @@ FROM
dgd.sales_order_number AS sales_order_number, dgd.sales_order_number AS sales_order_number,
dgn.delivery_date, dgn.delivery_date,
dgd.finish_product_code AS finish_product_code, dgd.finish_product_code AS finish_product_code,
dgd.finish_product_name AS finish_product_name dgd.finish_product_name AS finish_product_name,
dgd.specification_model,
dgd.customer_number,
dgd.common_currency,
dgd.process_price,
dgd.product_quantity,
dgd.amount_money
FROM FROM
delivery_goods_notice dgn, delivery_goods_notice dgn,
delivery_goods_detail dgd delivery_goods_detail dgd
@ -121,12 +124,12 @@ WHERE
<if test="finishProductName != null and finishProductName != ''"> and finish_product_name like concat('%', #{finishProductName}, '%')</if> <if test="finishProductName != null and finishProductName != ''"> and finish_product_name like concat('%', #{finishProductName}, '%')</if>
</select> </select>
<!-- -->
<!-- <select id="selectSalesAccountReconciliationById" parameterType="String" resultMap="SalesAccountReconciliationResult">--> <select id="selectSalesAccountReconciliationById" parameterType="Long" resultMap="SalesAccountReconciliationResult">
<!-- <include refid="selectSalesAccountReconciliationVo"/>--> <include refid="selectSalesAccountReconciliationVo"/>
<!-- where sales_order_code = #{salesOrderCode}--> AND sales_finish_id = #{salesFinishId}
<!-- </select>--> </select>
<!-- -->
<!-- <insert id="insertSalesAccountReconciliation" parameterType="SalesAccountReconciliation">--> <!-- <insert id="insertSalesAccountReconciliation" parameterType="SalesAccountReconciliation">-->
<!-- insert into sales_account_reconciliation--> <!-- insert into sales_account_reconciliation-->
<!-- <trim prefix="(" suffix=")" suffixOverrides=",">--> <!-- <trim prefix="(" suffix=")" suffixOverrides=",">-->

639
ruoyi-admin/target/classes/templates/manufacture/workOrderInfo/edit.html

@ -511,7 +511,6 @@
clickToSelect: true, clickToSelect: true,
paginationDetailHAlign: ' hiddenDetailInfo', paginationDetailHAlign: ' hiddenDetailInfo',
height: 250, height: 250,
uniqueId: 'materialCode',
queryParams: function (params) { queryParams: function (params) {
//console.log("123"); //console.log("123");
var curParams = { var curParams = {
@ -817,7 +816,7 @@
modalName: "bom半成品", modalName: "bom半成品",
showToggle: false, // 是否显示详细视图和列表视图的切换按钮 showToggle: false, // 是否显示详细视图和列表视图的切换按钮
cardView: false, // 是否显示详细视图 cardView: false, // 是否显示详细视图
detailView: false, // 是否显示父子表 detailView: true, // 是否显示父子表
smartDisplay: false, // 加了这个才显示每页显示的行数 smartDisplay: false, // 加了这个才显示每页显示的行数
showExport: false, // 是否显示导出按钮 showExport: false, // 是否显示导出按钮
clickToSelect: true, clickToSelect: true,
@ -892,11 +891,500 @@
{ {
field: 'processingCategory', field: 'processingCategory',
title: '加工类别' title: '加工类别'
}] }],
onExpandRow: function (index,row,$detail) {
// console.log(index)
// console.log(row.finishProductCode)
// console.log($detail)
$detail.html('<table class="table-container" id="raw_table"></table>' +
'<table class="table-container" id="subsidiary_table"></table>'+
'<table class="table-container" id="bcp_table"></table>'
).find('table');
initRawDetail(index,row,$detail);
initSubsidiaryDetail(index,row,$detail);
initBcpDetail(index,row,$detail);
}
}; };
$.table.init(options); $.table.init(options);
} }
//初始化子表格(循环) 一阶--原料
initRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#raw_table").bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
checkbox: true
},
{
field: 'rawMaterialId',
title: '原料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'rawMaterialCode',
title: '原料代码'
},
{
field: 'rawMaterialName',
title: '原料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'rawMaterialConsumption',
title: '用量'
},
{
field: 'rawMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initRawDetail(index, row, $detail);
}
})
}
//初始化子表格(循环) 一阶--辅料
initSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#subsidiary_table").bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
checkbox: true
},
{
field: 'subsidiaryMaterialId',
title: 'bom辅料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'subsidiaryMaterialCode',
title: '辅料代码'
},
{
field: 'subsidiaryMaterialName',
title: '辅料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'subsidiaryMaterialConsumption',
title: '用量'
},
{
field: 'subsidiaryMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initSubsidiaryDetail(index, row, $detail);
}
})
}
//初始化子表格(循环) 一阶--半成品
initBcpDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var bcp_table = $detail.html('<table class="table-container" id="bcp_table"></table>').find('table');
$("#bcp_table").bootstrapTable({
url: ctx + 'system/bomBcp/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
detailView: true,
columns: [
{
checkbox: true
},
{
field: 'bcpCode',
title: '半成品代码(二阶)'
},
{
field: 'bcpName',
title: '半成品名称'
},
{
field: 'bcpVersionNumber',
title: '版本号'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'bcpConsumption',
title: '用量'
},
{
field: 'bcpLoss',
title: '损耗%'
},
{
field: 'customerNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $bcpdetail) {
$bcpdetail.html('<table class="table-container" id="bcp_raw_table"></table>' +
'<table class="table-container" id="bcp_subsidiary_table"></table>' +
'<table class="table-container" id="bcp_bcp_table"></table>'
).find('table');
initBcpDetail(index, row, $bcpdetail);
initBcpRawDetail(index, row, $bcpdetail);
initBcpSubsidiaryDetail(index, row, $bcpdetail);
initBcpBcpDetail(index, row, $bcpdetail);
}
})
}
//初始化子表格(循环) 二阶--原料
initBcpRawDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var bcpVersionNumber = row.bcpVersionNumber;
// var raw_table = $detail.html('<table class="table-container" id="raw_table"></table>').find('table');
$("#bcp_raw_table").bootstrapTable({
url: ctx + 'system/bomrawmaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
checkbox: true
},
{
field: 'rawMaterialId',
title: '原料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'rawMaterialCode',
title: '原料代码'
},
{
field: 'rawMaterialName',
title: '原料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'rawMaterialConsumption',
title: '用量'
},
{
field: 'rawMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initBcpRawDetail(index, row, $detail);
}
})
}
//初始化子表格(循环) 二阶--辅料
initBcpSubsidiaryDetail = function (index, row, $detail) {
var bcpCode = row.bcpCode;
// var bcpVersionNumber = row.bcpVersionNumber;
// var subsidiary_table = $detail.html('<table class="table-container" id="subsidiary_table"></table>').find('table');
$("#bcp_subsidiary_table").bootstrapTable({
url: ctx + 'system/bomsubsidiarymaterial/list',
contentType: "application/x-www-form-urlencoded",
method: 'post',
queryParams: function (params) {
var curParams = {
// 传递参数查询参数
pageSize: params.limit,
pageNum: params.offset / params.limit + 1,
finishProductCode: bcpCode
// versionNumber: bcpVersionNumber
};
// console.log(data[0].enterpriseCode)
return curParams
},
toolbar: false, //工具按钮用哪个容器
striped: true, //是否显示行间隔色
cache: false, //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
pagination: false, //是否显示分页(*)
sortable: false, //是否启用排序
pageNumber: 1, //初始化加载第一页,默认第一页
pageSize: 10, //每页的记录行数(*)
pageList: [10, 25, 50, 100], //可供选择的每页的行数(*)
search: false, //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
strictSearch: true,
showColumns: false, //是否显示所有的列
showRefresh: false, //是否显示刷新按钮
clickToSelect: true, //是否启用点击选中行
showToggle: false, //是否显示详细视图和列表视图的切换按钮
cardView: false, //是否显示详细视图
columns: [
{
checkbox: true
},
{
field: 'subsidiaryMaterialId',
title: 'bom辅料id',
visible: false
},
{
field: 'finishProductCode',
title: '成品代码',
visible: false
},
{
field: 'subsidiaryMaterialCode',
title: '辅料代码'
},
{
field: 'subsidiaryMaterialName',
title: '辅料名称'
},
{
field: 'specificationModel',
title: '规格型号'
},
{
field: 'inventoryUnit',
title: '单位'
},
{
field: 'subsidiaryMaterialConsumption',
title: '用量'
},
{
field: 'subsidiaryMaterialLoss',
title: '损耗%'
},
{
field: 'supplierNumber',
title: '厂商料号'
},
{
field: 'finishedProductQuantity',
title: '成品数量'
},
{
field: 'remarks',
title: '备注说明'
},
{
field: 'processingCategory',
title: '加工类别'
}],
//无线循环取子表,直到子表里面没有记录
onExpandRow: function (index, row, $detail) {
initBcpSubsidiaryDetail(index, row, $detail);
}
})
}
//关闭BOM信息 //关闭BOM信息
function closeBomDetailModal() { function closeBomDetailModal() {
$("#bomMaterialModal").modal("hide"); $("#bomMaterialModal").modal("hide");
@ -907,14 +1395,19 @@
var dataRaw = $("#rawMaterialBomTable").bootstrapTable("getSelections"); var dataRaw = $("#rawMaterialBomTable").bootstrapTable("getSelections");
var dataSubsidiary = $("#subsidiaryMaterialBomTable").bootstrapTable("getSelections"); var dataSubsidiary = $("#subsidiaryMaterialBomTable").bootstrapTable("getSelections");
var dataBcp = $("#bcpMaterialBomTable").bootstrapTable("getSelections"); var dataBcp = $("#bcpMaterialBomTable").bootstrapTable("getSelections");
var dataRawTable = $("#raw_table").bootstrapTable("getSelections");
var dataSubsidiaryTable = $("#subsidiary_table").bootstrapTable("getSelections");
var dataBcpTable = $("#bcp_table").bootstrapTable("getSelections");
var dataBcpRawTable = $("#bcp_raw_table").bootstrapTable("getSelections");
var dataBcpSubsidiaryTable = $("#bcp_subsidiary_table").bootstrapTable("getSelections");
var count = $('#addBomMaterialTable').bootstrapTable('getData').length; var count = $('#addBomMaterialTable').bootstrapTable('getData').length;
var workOrderNumber = $("input[name='workOrderNumber']").val(); var workOrderNumber = $("input[name='workOrderNumber']").val();
for (let i = 0; i < dataRaw.length; i++) { for (let i = 0; i < dataRaw.length; i++) {
let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataRaw[i].rawMaterialCode); // let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataRaw[i].rawMaterialCode);
if (material != null) { // if (material != null) {
alert(material.materialName + "已存在,不可重复添加!"); // alert(material.materialName + "已存在,不可重复添加!");
continue; // continue;
} // }
$("#addBomMaterialTable").bootstrapTable('insertRow', { $("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i, index: count + i,
row: { row: {
@ -931,11 +1424,11 @@
}); });
} }
for (let i = 0; i < dataSubsidiary.length; i++) { for (let i = 0; i < dataSubsidiary.length; i++) {
let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataSubsidiary[i].subsidiaryMaterialCode); // let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataSubsidiary[i].subsidiaryMaterialCode);
if (material != null) { // if (material != null) {
alert(material.materialName + "已存在,不可重复添加!"); // alert(material.materialName + "已存在,不可重复添加!");
continue; // continue;
} // }
$("#addBomMaterialTable").bootstrapTable('insertRow', { $("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i, index: count + i,
row: { row: {
@ -952,11 +1445,11 @@
}); });
} }
for (let i = 0; i < dataBcp.length; i++) { for (let i = 0; i < dataBcp.length; i++) {
let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode); // let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
if (material != null) { // if (material != null) {
alert(material.materialName + "已存在,不可重复添加!"); // alert(material.materialName + "已存在,不可重复添加!");
continue; // continue;
} // }
$("#addBomMaterialTable").bootstrapTable('insertRow', { $("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i, index: count + i,
row: { row: {
@ -972,9 +1465,119 @@
} }
}); });
} }
for (let i = 0; i < dataRawTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataRawTable[i].rawMaterialCode,
materialName: dataRawTable[i].rawMaterialName,
specificationModel: dataRawTable[i].specificationModel,
inventoryUnit: dataRawTable[i].inventoryUnit,
materialType: '原料',
materialConsumption: dataRawTable[i].rawMaterialConsumption,
itemNumber: dataRawTable[i].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataSubsidiaryTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataSubsidiaryTable[i].subsidiaryMaterialCode,
materialName: dataSubsidiaryTable[i].subsidiaryMaterialName,
specificationModel: dataSubsidiaryTable[i].specificationModel,
inventoryUnit: dataSubsidiaryTable[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataSubsidiaryTable[i].subsidiaryMaterialConsumption,
itemNumber: dataSubsidiaryTable[i].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataBcpTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpTable[i].bcpCode,
materialName: dataBcpTable[i].bcpName,
specificationModel: dataBcpTable[i].specificationModel,
inventoryUnit: dataBcpTable[i].inventoryUnit,
materialType: '半成品',
materialConsumption: dataBcpTable[i].bcpConsumption,
itemNumber: dataBcpTable[i].customerNumber,
description: ''
}
});
}
for (let i = 0; i < dataBcpRawTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpRawTable[i].rawMaterialCode,
materialName: dataBcpRawTable[i].rawMaterialName,
specificationModel: dataBcpRawTable[i].specificationModel,
inventoryUnit: dataBcpRawTable[i].inventoryUnit,
materialType: '原料',
materialConsumption: dataBcpRawTable[i].rawMaterialConsumption,
itemNumber: dataBcpRawTable[i].supplierNumber,
description: ''
}
});
}
for (let i = 0; i < dataBcpSubsidiaryTable.length; i++) {
// let material = $('#addBomMaterialTable').bootstrapTable('getRowByUniqueId', dataBcp[i].bcpCode);
// if (material != null) {
// alert(material.materialName + "已存在,不可重复添加!");
// continue;
// }
$("#addBomMaterialTable").bootstrapTable('insertRow', {
index: count + i,
row: {
workOrderNumber: workOrderNumber,
materialCode: dataBcpSubsidiaryTable[i].subsidiaryMaterialCode,
materialName: dataBcpSubsidiaryTable[i].subsidiaryMaterialName,
specificationModel: dataBcpSubsidiaryTable[i].specificationModel,
inventoryUnit: dataBcpSubsidiaryTable[i].inventoryUnit,
materialType: '辅料',
materialConsumption: dataBcpSubsidiaryTable[i].subsidiaryMaterialConsumption,
itemNumber: dataBcpSubsidiaryTable[i].supplierNumber,
description: ''
}
});
}
$("#rawMaterialBomTable").bootstrapTable("uncheckAll"); $("#rawMaterialBomTable").bootstrapTable("uncheckAll");
$("#subsidiaryMaterialBomTable").bootstrapTable("uncheckAll"); $("#subsidiaryMaterialBomTable").bootstrapTable("uncheckAll");
$("#bcpMaterialBomTable").bootstrapTable("uncheckAll"); $("#bcpMaterialBomTable").bootstrapTable("uncheckAll");
$("#raw_table").bootstrapTable("uncheckAll");
$("#subsidiary_table").bootstrapTable("uncheckAll");
$("#bcp_table").bootstrapTable("uncheckAll");
$("#bcp_raw_table").bootstrapTable("uncheckAll");
$("#bcp_subsidiary_table").bootstrapTable("uncheckAll");
closeBomDetailModal(); closeBomDetailModal();
} }

68
ruoyi-admin/target/classes/templates/sales/salesAccountReconciliation/salesAccountReconciliation.html

@ -3,6 +3,7 @@
<head> <head>
<th:block th:include="include :: header('销售对账列表')"/> <th:block th:include="include :: header('销售对账列表')"/>
<th:block th:include="include :: datetimepicker-css"/> <th:block th:include="include :: datetimepicker-css"/>
<script type="text/javascript" th:src="@{/js/axios.min.js}"></script>
<style> <style>
.table-striped { .table-striped {
border: 0px !important; border: 0px !important;
@ -106,7 +107,7 @@
shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:customConfirm"> shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:customConfirm">
<i class="fa fa-hand-grab-o"></i> 客户使用确认 <i class="fa fa-hand-grab-o"></i> 客户使用确认
</a> </a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" <a class="btn btn-warning" onclick="exportAccountReconciliation()"
shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:export"> shiro:hasPermission="salesAccountReconciliation:salesAccountReconciliation:export">
<i class="fa fa-download"></i> 导出 <i class="fa fa-download"></i> 导出
</a> </a>
@ -332,7 +333,7 @@
var nationalTaxBillDatas = [[${@dict.getType('sys_whether')}]]; var nationalTaxBillDatas = [[${@dict.getType('sys_whether')}]];
var closeCaseOrNotDatas = [[${@dict.getType('sys_whether')}]]; var closeCaseOrNotDatas = [[${@dict.getType('sys_whether')}]];
var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]]; var inventoryUnitDatas = [[${@dict.getType('sys_unit_class')}]];
var commonCurrencyDatas = [[${@dict.getType('sys_coin_class')}]]; var commonCurrencyDatas = [[${@dict.getType('sys_common_currency')}]];
var prefix = ctx + "sales/salesAccountReconciliation"; var prefix = ctx + "sales/salesAccountReconciliation";
var prefix1 = ctx + "returnGoods/returnGoodsProduct"; var prefix1 = ctx + "returnGoods/returnGoodsProduct";
@ -348,6 +349,11 @@
modalName: "销售对账", modalName: "销售对账",
columns: [{ columns: [{
checkbox: true checkbox: true
},
{
field: 'salesFinishId',
title: '销售物料id',
visible: false
}, },
{ {
field: 'accountReconciliationOrNot', field: 'accountReconciliationOrNot',
@ -405,8 +411,12 @@
title: '客户料号' title: '客户料号'
}, },
{ {
field: 'typeMachine', field: 'commonCurrency',
title: '机种' title: '币别',
formatter: function (value, row, index) {
return $.table.selectDictLabel(commonCurrencyDatas, value);
},
visible: false
}, },
{ {
field: 'processPrice', field: 'processPrice',
@ -787,6 +797,56 @@
}); });
} }
//导出
function exportAccountReconciliation() {
var rows = $.common.isEmpty(table.options.uniqueId) ? $.table.selectFirstColumns() : $.table.selectColumns(table.options.uniqueId);
// console.log(rows)
// console.log(rows.join())
var data = $("#bootstrap-table").bootstrapTable("getSelections")
if (rows.length == 0) {
$.modal.alert("未选择数据,请选择数据!");
return;
} else {
// rows为选中行的id
// console.log(rows);
console.log(data);
// console.log(data[0].orderNumber)
var ids = [];
for (let i=0;i<rows.length;i++) {
ids.push(data[i].salesFinishId)
}
// console.log(ids)
// console.log(ids.join())
$.modal.confirm("确认要导出销售对账吗?", function (){
axios({
url: prefix + '/exportSelected/'+ ids.join(),
method: 'POST',
responseType: 'blob'
}).then(response => {
// sendSearchParameter(supplierCode, supplierName);
// 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> </script>
</body> </body>
</html> </html>

4
ruoyi-admin/target/classes/templates/storehouse/warehousingInspectionNotice/add.html

@ -104,10 +104,10 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">交检日期</label> <label class="col-sm-3 control-label">交检时间</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="inspectionDate" class="form-control" placeholder="yyyy-MM-dd" type="text"> <input name="inspectionDate" class="form-control" placeholder="yyyy-MM-dd hh:ii:ss" 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>

4
ruoyi-admin/target/classes/templates/storehouse/warehousingInspectionNotice/edit.html

@ -105,10 +105,10 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-sm-3 control-label">交检日期</label> <label class="col-sm-3 control-label">交检时间</label>
<div class="col-sm-8"> <div class="col-sm-8">
<div class="input-group date"> <div class="input-group date">
<input name="inspectionDate" th:field="*{inspectionDate}" class="form-control" placeholder="yyyy-MM-dd" type="text"> <input name="inspectionDate" th:field="*{inspectionDate}" class="form-control" placeholder="yyyy-MM-dd hh:ii:ss" 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>

6
ruoyi-admin/target/classes/templates/storehouse/warehousingInspectionNotice/warehousingInspectionNotice.html

@ -40,9 +40,9 @@
</li> </li>
<li class="select-time"> <li class="select-time">
<label>入库日期:</label> <label>入库日期:</label>
<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginWarehousingDate]"/> <input type="text" class="time-input" id="startTime" placeholder="开始日期" name="params[beginWarehousingDate]"/>
<span>-</span> <span>-</span>
<input type="text" class="time-input" id="endTime" placeholder="结束时间" name="params[endWarehousingDate]"/> <input type="text" class="time-input" id="endTime" placeholder="结束日期" name="params[endWarehousingDate]"/>
</li> </li>
<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-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
@ -216,7 +216,7 @@
}, },
{ {
field: 'inspectionDate', field: 'inspectionDate',
title: '交检日期' title: '交检时间'
}, },
{ {
field: 'warehousingDate', field: 'warehousingDate',

Loading…
Cancel
Save