Explorar el Código

2024年4月24日17:29:13

纪新园 hace 1 año
padre
commit
7cf8ade559

+ 6 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/entity/PjProductLaunch.java

@@ -318,4 +318,10 @@ public class PjProductLaunch implements Serializable {
 	 */
 	@TableField(exist = false)
 	private String whether;
+
+	/**
+	 * 商品编码
+	 */
+	@TableField(exist = false)
+	private String code;
 }

+ 6 - 0
blade-service-api/blade-sales-part-api/src/main/java/org/springblade/salesPart/excel/ProductLaunchExportExcel.java

@@ -33,6 +33,12 @@ public class ProductLaunchExportExcel implements Serializable {
 	private String cname;
 
 	/**
+	 * 商品编码
+	 */
+	@ExcelProperty(value = "商品编码")
+	private String code;
+
+	/**
 	 * 规格型号
 	 */
 	@ExcelProperty(value = "规格型号")

+ 5 - 7
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/controller/HYCKTemplateImportController.java

@@ -1,14 +1,12 @@
 package org.springblade.los.business.sea.controller;
 
-import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
 import lombok.AllArgsConstructor;
 import org.springblade.core.tool.api.R;
 import org.springblade.los.business.sea.entity.Bills;
 import org.springblade.los.business.sea.entity.Containers;
 import org.springblade.los.business.sea.service.ITemplateImportService;
-import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
@@ -33,7 +31,7 @@ public class HYCKTemplateImportController {
 	/**
 	 * 海运出口模版导入(ONE样本模板)
 	 */
-	@GetMapping("/importOne")
+	@PostMapping("/importOne")
 	public R<Bills> importHYCK(@RequestParam("file") MultipartFile file) throws Exception {
 		return templateImportService.importOne(file);
 	}
@@ -41,7 +39,7 @@ public class HYCKTemplateImportController {
 	/**
 	 * 海运出口模版导入(PIL订舱)
 	 */
-	@GetMapping("/importPilBooking")
+	@PostMapping("/importPilBooking")
 	public R<Bills> importPilBooking(@RequestParam("file") MultipartFile file) throws Exception {
 		return templateImportService.importPilBooking(file);
 	}
@@ -49,7 +47,7 @@ public class HYCKTemplateImportController {
 	/**
 	 * 海运出口模版导入(PIL截单)
 	 */
-	@GetMapping("/importPilCutOffOrders")
+	@PostMapping("/importPilCutOffOrders")
 	public R<Bills> importPilCutOffOrders(@RequestParam("file") MultipartFile file) throws Exception {
 		return templateImportService.importPilCutOffOrders(file);
 	}
@@ -57,7 +55,7 @@ public class HYCKTemplateImportController {
 	/**
 	 * 海运出口模版导入(海信组)
 	 */
-	@GetMapping("/importHisense")
+	@PostMapping("/importHisense")
 	public R<List<Containers>> importHisense(@RequestParam("file") MultipartFile file) throws Exception {
 		return templateImportService.importHisense(file);
 	}

+ 22 - 87
blade-service/blade-los/src/main/java/org/springblade/los/business/sea/service/impl/TemplateImportServiceImpl.java

@@ -158,14 +158,6 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		} else {
 			throw new RuntimeException("签单方式不能为空");
 		}
-		//PAYMODE
-		/*if (ObjectUtils.isNotNull(sheet.getRow(21).getCell(4))) {
-			String payMode = sheet.getRow(21).getCell(4).getStringCellValue();
-			System.out.println("payMode:" + payMode);
-			bills.setHpaymode(payMode);
-		} else {
-			throw new RuntimeException("运费支付方式不能为空");
-		}*/
 		//PLACE OF ISSUE
 		if (ObjectUtils.isNotNull(sheet.getRow(22).getCell(1))) {
 			String placeOfIssue = sheet.getRow(22).getCell(1).getStringCellValue();
@@ -182,22 +174,6 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		} else {
 			throw new RuntimeException("付费地不能为空");
 		}
-		//CONTRACTNO
-		/*if (ObjectUtils.isNotNull(sheet.getRow(23).getCell(1))) {
-			String contractno = sheet.getRow(23).getCell(1).getStringCellValue();
-			System.out.println("contractno:" + contractno);
-			bills.setCorpArgreementNo(contractno);
-		} else {
-			throw new RuntimeException("约号不能为空");
-		}*/
-		//VOLUME
-		/*if (ObjectUtils.isNotNull(sheet.getRow(23).getCell(4))) {
-			String volume = sheet.getRow(23).getCell(4).getStringCellValue();
-			System.out.println("volume:" + volume);
-			bills.setQuantityCntrDescr(volume);
-		} else {
-			throw new RuntimeException("箱型箱量不能为空");
-		}*/
 		//MARKS
 		StringBuilder marks = new StringBuilder();
 		for (int i = 25; i <= 46; i++) {
@@ -265,68 +241,13 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 			System.out.println("finalDestination:" + finalDestination);
 			bills.setFinalDestinationName(finalDestination);
 		}
-
-		/*for (int i = 0; i <= sheet.getLastRowNum(); i++) {
-			String rowStr = "";
-			//循环获取sheet页的每一行
-			Row row = sheet.getRow(i);
-			//循环每一行的每一个单元格
-			for (int l = 0; l <= 6; l++) {
-				//判断是否是合并单元格并返回值
-				String value = getValue(sheet, i, row.getCell(l).getColumnIndex());
-				//数值为空说明不是合并单元格或者当前单元格为空,则直接获取当前单元格值
-				if ("".equals(value)) {
-					if (ObjectUtils.isNull(row.getCell(l))) {
-						value = "";
-					} else {
-						CellType cellType = row.getCell(l).getCellTypeEnum();
-						switch (cellType.name()) {
-							case "STRING":
-								value = row.getCell(l).getStringCellValue();
-								// 处理字符串类型的值
-								break;
-							case "NUMERIC":
-								value = row.getCell(l).getNumericCellValue() + "";
-								// 处理数字类型的值
-								break;
-							case "FORMULA":
-								value = row.getCell(l).getNumericCellValue() + "";
-								// 处理数字类型的值
-								break;
-							case "_NONE":
-								value = "";
-								// 处理数字类型的值
-								break;
-							case "BLANK":
-								value = "";
-								// 处理数字类型的值
-								break;
-							case "BOOLEAN":
-								value = "";
-								// 处理数字类型的值
-								break;
-							case "ERROR":
-								value = "";
-								// 处理数字类型的值
-								break;
-							// 可以添加其他类型的处理
-							default:
-								System.out.println("cellType:" + cellType.name());
-								throw new RuntimeException("数据类型错误");
-						}
-					}
-				}
-				rowStr += "--" + value;
-			}
-			for (Cell cell : row) {
-				//判断是否是合并单元格并返回值
-				String value = getValue(sheet, i, cell.getColumnIndex());
-				//数值为空说明不是合并单元格或者当前单元格为空,则直接获取当前单元格值
-				if("".equals(value)){
-					value=cell.getStringCellValue();
-				}
-				rowStr+="--"+value;
-			}*/
+		bills.setContainersList(new ArrayList<>());
+		bills.setPreContainersList(new ArrayList<>());
+		bills.setContainersReportsList(new ArrayList<>());
+		bills.setFeeCenterListC(new ArrayList<>());
+		bills.setFeeCenterListD(new ArrayList<>());
+		bills.setFilesList(new ArrayList<>());
+		bills.setWaitingBoxList(new ArrayList<>());
 		return R.data(bills);
 	}
 
@@ -415,6 +336,13 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		} else {
 			throw new RuntimeException("体积不能为空");
 		}
+		bills.setContainersList(new ArrayList<>());
+		bills.setPreContainersList(new ArrayList<>());
+		bills.setContainersReportsList(new ArrayList<>());
+		bills.setFeeCenterListC(new ArrayList<>());
+		bills.setFeeCenterListD(new ArrayList<>());
+		bills.setFilesList(new ArrayList<>());
+		bills.setWaitingBoxList(new ArrayList<>());
 		return R.data(bills);
 	}
 
@@ -495,6 +423,14 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 		} else {
 			throw new RuntimeException("体积不能为空");
 		}
+		bills.setContainersList(new ArrayList<>());
+		bills.setPreContainersList(new ArrayList<>());
+		bills.setContainersReportsList(new ArrayList<>());
+		bills.setFeeCenterListC(new ArrayList<>());
+		bills.setFeeCenterListD(new ArrayList<>());
+		bills.setFeeCenterList(new ArrayList<>());
+		bills.setFilesList(new ArrayList<>());
+		bills.setWaitingBoxList(new ArrayList<>());
 		return R.data(bills);
 	}
 
@@ -509,7 +445,6 @@ public class TemplateImportServiceImpl implements ITemplateImportService {
 
 		// 创建FileInputStream来读取临时文件
 		FileInputStream fis = new FileInputStream(tempFile.toFile());
-//		Workbook workbook = new HSSFWorkbook(fis);
 		Workbook workbook = new XSSFWorkbook(fis);
 		Sheet sheet = workbook.getSheetAt(0); // 获取第一个工作表
 

+ 48 - 3
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/mapper/OrderMapper.xml

@@ -1785,7 +1785,7 @@ ORDER BY
             BOI.quantity AS quantity,
             BO.debit_amount AS amount,
             BOI.actualQuantity AS actualQuantity,
-            Round(BOI.arrivalAmount,2) AS arrivalAmount,
+            Round(  bdf.delivery_amount ,2) AS arrivalAmount,
             BO.this_used_profit AS thisUsedProfit,
             BO.gross_profit AS netGrossProfit,
             BO.predict_ocean_freight AS predictOceanFreight
@@ -1805,6 +1805,21 @@ ORDER BY
             GROUP BY
                 pid
         ) BOI ON BOI.pid = BO.id
+        LEFT JOIN (
+        SELECT
+        bd.org_order_no,
+        bd.actual_arrival_amount AS delivery_amount,
+        SUM( bdi.actual_quantity ) AS actual_quantity
+        FROM
+        business_delivery bd
+        LEFT JOIN business_delivery_items bdi ON bd.id = bdi.pid
+        WHERE
+        bd.tenant_id = '681169'
+        AND bd.is_deleted = 0
+        AND bd.bill_type = 'FH'
+        GROUP BY
+        bd.org_order_no
+        ) bdf ON BO.morder_no = bdf.org_order_no
         LEFT JOIN basic_goods_desc BGD ON BGD.id = BOI.item_id
         <where>
             BO.tenant_id = #{statisticsVo.tenantId}
@@ -1982,7 +1997,7 @@ ORDER BY
             BOI.quantity AS quantity,
             BO.debit_amount AS amount,
             BOI.actualQuantity AS actualQuantity,
-            Round(BOI.arrivalAmount,2) AS arrivalAmount,
+            Round(bdf.delivery_amount,2) AS arrivalAmount,
             IFNULL(BOF.feesAmount, 0) AS feesAmount,
             BO.this_used_profit AS thisUsedProfit,
             BO.gross_profit AS netGrossProfit,
@@ -2016,6 +2031,21 @@ ORDER BY
             GROUP BY
                 pid
         ) BOF ON BOF.pid = BO.id
+        LEFT JOIN (
+        SELECT
+        bd.org_order_no,
+        bd.actual_arrival_amount AS delivery_amount,
+        SUM( bdi.actual_quantity ) AS actual_quantity
+        FROM
+        business_delivery bd
+        LEFT JOIN business_delivery_items bdi ON bd.id = bdi.pid
+        WHERE
+        bd.tenant_id = '681169'
+        AND bd.is_deleted = 0
+        AND bd.bill_type = 'FH'
+        GROUP BY
+        bd.org_order_no
+        ) bdf ON BO.morder_no = bdf.org_order_no
         LEFT JOIN basic_corps_desc BCD ON BCD.id = BO.corp_id
         LEFT JOIN basic_goods_desc BGD ON BGD.id = BOI.item_id
         <where>
@@ -2185,7 +2215,7 @@ ORDER BY
             BOI.quantity AS quantity,
             BO.debit_amount AS amount,
             BOI.actualQuantity AS actualQuantity,
-            Round(BOI.arrivalAmount,2) AS arrivalAmount,
+            Round(bdf.delivery_amount,2) AS arrivalAmount,
             BO.this_used_profit AS thisUsedProfit,
             BO.gross_profit AS netGrossProfit,
             BO.predict_ocean_freight AS predictOceanFreight
@@ -2205,6 +2235,21 @@ ORDER BY
             GROUP BY
                 pid
         ) BOI ON BOI.pid = BO.id
+        LEFT JOIN (
+        SELECT
+        bd.org_order_no,
+        bd.actual_arrival_amount AS delivery_amount,
+        SUM( bdi.actual_quantity ) AS actual_quantity
+        FROM
+        business_delivery bd
+        LEFT JOIN business_delivery_items bdi ON bd.id = bdi.pid
+        WHERE
+        bd.tenant_id = '681169'
+        AND bd.is_deleted = 0
+        AND bd.bill_type = 'FH'
+        GROUP BY
+        bd.org_order_no
+        ) bdf ON BO.morder_no = bdf.org_order_no
         LEFT JOIN basic_goods_desc BGD ON BGD.id = BOI.item_id
         <where>
             BO.tenant_id = #{statisticsVo.tenantId}

+ 10 - 9
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/controller/ProductLaunchController.java

@@ -59,8 +59,6 @@ import javax.validation.Valid;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 
 /**
@@ -433,13 +431,13 @@ public class ProductLaunchController extends BladeController {
 		} else {
 			lambdaQueryWrapper.apply(ObjectUtil.isNotEmpty(productLaunch.getSharedCompany()), "find_in_set('" + productLaunch.getSharedCompany() + "',shared_company)");//共享公司
 		}
+		List<PjGoodsDesc> pjGoodsDescList = goodsDescService.list(new LambdaQueryWrapper<PjGoodsDesc>()
+			.eq(PjGoodsDesc::getIsDeleted, 0)
+			.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId()));
 		if ("1".equals(productLaunch.getWhetherIntegral())) {
-			List<PjGoodsDesc> pjGoodsDescList = goodsDescService.list(new LambdaQueryWrapper<PjGoodsDesc>()
-				.eq(PjGoodsDesc::getWhetherIntegral, "1")
-				.eq(PjGoodsDesc::getIsDeleted, 0)
-				.eq(PjGoodsDesc::getTenantId, AuthUtil.getTenantId()));
-			if (!pjGoodsDescList.isEmpty()) {
-				List<Long> goodsId = pjGoodsDescList.stream().map(PjGoodsDesc::getId).collect(Collectors.toList());
+			List<PjGoodsDesc> pjGoodsDescs = pjGoodsDescList.stream().filter(e-> e.getWhetherIntegral().equals("1")).collect(Collectors.toList());
+			if (!pjGoodsDescs.isEmpty()) {
+				List<Long> goodsId = pjGoodsDescs.stream().map(PjGoodsDesc::getId).collect(Collectors.toList());
 				lambdaQueryWrapper.in(PjProductLaunch::getGoodsId, goodsId);
 			}
 		}
@@ -447,13 +445,16 @@ public class ProductLaunchController extends BladeController {
 		String deptId = pjProductLaunchList.stream().map(PjProductLaunch::getSharedCompany).filter(ObjectUtils::isNotNull).distinct().collect(Collectors.joining(","));
 		R<List<Dept>> deptList = iSysClient.selectByDeptIds(deptId);
 		for (PjProductLaunch item : pjProductLaunchList) {
+			PjGoodsDesc pjGoodsDesc = pjGoodsDescList.stream().filter(e->e.getId().equals(item.getGoodsId())).findFirst().orElse(null);
+			if (pjGoodsDesc != null){
+				item.setCode(pjGoodsDesc.getCode());
+			}
 			if (ObjectUtils.isNotNull(deptList.getData()) && !deptList.getData().isEmpty()) {
 				String deptName = deptList.getData().stream()
 					.filter(e -> ObjectUtils.isNotNull(item.getSharedCompany()) && item.getSharedCompany().contains(e.getId() + ""))
 					.map(Dept::getFullName).collect(Collectors.joining(" | "));
 				item.setSharedCompany(deptName);
 			}
-
 		}
 		ExcelUtil.export(response, "导出产品上下架数据", "产品上下架数据表", BeanUtil.copyProperties(pjProductLaunchList, ProductLaunchExportExcel.class), ProductLaunchExportExcel.class);
 	}