Browse Source

2023年1月29日08:32:11

纪新园 2 năm trước cách đây
mục cha
commit
37dbce7080

+ 94 - 0
blade-service-api/blade-box-tube-api/src/main/java/org/springblade/box/tube/dto/ExportTransferOut.java

@@ -0,0 +1,94 @@
+/*
+ *      Copyright (c) 2018-2028, Chill Zhuang All rights reserved.
+ *
+ *  Redistribution and use in source and binary forms, with or without
+ *  modification, are permitted provided that the following conditions are met:
+ *
+ *  Redistributions of source code must retain the above copyright notice,
+ *  this list of conditions and the following disclaimer.
+ *  Redistributions in binary form must reproduce the above copyright
+ *  notice, this list of conditions and the following disclaimer in the
+ *  documentation and/or other materials provided with the distribution.
+ *  Neither the name of the dreamlu.net developer nor the names of its
+ *  contributors may be used to endorse or promote products derived from
+ *  this software without specific prior written permission.
+ *  Author: Chill 庄骞 (smallchill@163.com)
+ */
+package org.springblade.box.tube.dto;
+
+import com.alibaba.excel.annotation.ExcelProperty;
+import com.alibaba.excel.annotation.write.style.ColumnWidth;
+import com.alibaba.excel.annotation.write.style.ContentRowHeight;
+import com.alibaba.excel.annotation.write.style.HeadRowHeight;
+import lombok.Data;
+
+import java.io.Serializable;
+import java.util.Date;
+
+/**
+ * 买(卖)箱表实体类
+ *
+ * @author BladeX
+ * @since 2022-11-14
+ */
+@Data
+@ColumnWidth(25)
+@HeadRowHeight(20)
+@ContentRowHeight(18)
+public class ExportTransferOut implements Serializable {
+
+	/**
+	 * 系统号
+	 */
+	@ExcelProperty(value = "系统号")
+	private String sysNo;
+	/**
+	 * 合同号
+	 */
+	@ExcelProperty(value = "合同号")
+	private String contractNo;
+
+	/**
+	 * 买入公司名称
+	 */
+	@ExcelProperty(value = "付费对象")
+	private String purchaseCompanyName;
+
+	/**
+	 * 买入公司名称
+	 */
+	@ExcelProperty(value = "堆存地点")
+	private String address;
+	/**
+	 * 备注
+	 */
+	@ExcelProperty(value = "备注")
+	private String remarks;
+
+	/**
+	 * 箱数
+	 */
+	@ExcelProperty(value = "箱数")
+	private int boxNumber;
+
+	/**
+	 * 创建人
+	 */
+	@ExcelProperty(value = "创建人")
+	private String createUserName;
+	/**
+	 * 创建时间
+	 */
+	@ExcelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ExcelProperty(value = "修改人")
+	private String updateUserName;
+	/**
+	 * 修改时间
+	 */
+	@ExcelProperty(value = "修改时间")
+	private Date updateTime;
+}

+ 27 - 0
blade-service/blade-box-tube/src/main/java/org/springblade/box/tube/controller/TransferController.java

@@ -25,6 +25,8 @@ import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
 import lombok.AllArgsConstructor;
+import org.springblade.box.tube.dto.ExportTradingBoxOut;
+import org.springblade.box.tube.dto.ExportTransferOut;
 import org.springblade.box.tube.dto.ExportTransportOut;
 import org.springblade.box.tube.dto.TransportItemExcelEnter;
 import org.springblade.box.tube.entity.TradingBox;
@@ -135,4 +137,29 @@ public class TransferController extends BladeController {
 		return R.data(transferService.revokeRentCalculation(tradingBox));
 	}
 
+	/**
+	 * 导出 买(卖)箱表
+	 */
+	@GetMapping("/exportTradingBoxOut")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入tradingBox")
+	public void exportTradingBoxOut(TradingBox tradingBox, HttpServletResponse response) {
+		LambdaQueryWrapper<TradingBox> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+		lambdaQueryWrapper.eq(TradingBox::getTenantId, AuthUtil.getTenantId())
+			.eq(TradingBox::getIsDeleted, 0)
+			.like(ObjectUtils.isNotNull(tradingBox.getSysNo()), TradingBox::getSysNo, tradingBox.getSysNo())//业务编号
+			.like(ObjectUtils.isNotNull(tradingBox.getContractNo()), TradingBox::getContractNo, tradingBox.getContractNo())//合同号
+			.like(ObjectUtils.isNotNull(tradingBox.getPurchaseCompanyId()), TradingBox::getPurchaseCompanyId, tradingBox.getPurchaseCompanyId())//买入公司id
+			.eq(ObjectUtils.isNotNull(tradingBox.getStatus()), TradingBox::getStatus, tradingBox.getStatus())//状态
+			.like(ObjectUtils.isNotNull(tradingBox.getCode()), TradingBox::getCode, tradingBox.getCode())//箱号
+			.eq(ObjectUtils.isNotNull(tradingBox.getType()), TradingBox::getType, "DCF");//业务类型
+		if (tradingBox.getPurchaseDateList() != null && tradingBox.getPurchaseDateList().size() > 1) {//买入时间
+			lambdaQueryWrapper.ge(TradingBox::getPurchaseDate, tradingBox.getPurchaseDateList().get(0));
+			lambdaQueryWrapper.le(TradingBox::getPurchaseDate, tradingBox.getPurchaseDateList().get(1));
+		}
+		lambdaQueryWrapper.orderByDesc(TradingBox::getCreateTime);
+		List<TradingBox> tradingBoxList = tradingBoxService.list(lambdaQueryWrapper);
+		ExcelUtil.export(response, "导出订单信息", "导出数据表", BeanUtil.copy(tradingBoxList, ExportTransferOut.class), ExportTransferOut.class);
+	}
+
 }

+ 2 - 0
blade-service/blade-box-tube/src/main/java/org/springblade/box/tube/service/impl/TradingBoxServiceImpl.java

@@ -329,6 +329,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 							archives.setBoxAge(tradingBoxItem.getBoxAge());
 							archives.setPurchaseDate(tradingBox.getPurchaseDate());
 							archives.setContractNo(tradingBox.getContractNo());
+							archives.setBoxAccessStatus("");
 						}
 						archives.setStatus(tradingBoxItem.getStatus());
 						if (ObjectUtils.isNotNull(archivesR)) {
@@ -597,6 +598,7 @@ public class TradingBoxServiceImpl extends ServiceImpl<TradingBoxMapper, Trading
 						archives.setBoxAge(tradingBoxItem.getBoxAge());
 						archives.setPurchaseDate(tradingBoxItem.getLeaseCommencementDate());
 						archives.setContractNo(tradingBox.getContractNo());
+						archives.setBoxAccessStatus("");
 						if (ObjectUtils.isNotNull(archivesR)) {
 							archives.setUpdateTime(new Date());
 							archives.setUpdateUserName(AuthUtil.getUserName());

+ 1 - 0
blade-service/blade-box-tube/src/main/java/org/springblade/box/tube/service/impl/TransportServiceImpl.java

@@ -249,6 +249,7 @@ public class TransportServiceImpl extends ServiceImpl<TransportMapper, Transport
 					archives.setAddress(transportItem.getAddress());
 					archives.setAddressId(transportItem.getAddressId());
 					archives.setNewDate(transportItem.getNewDate());
+					archives.setBoxAccessStatus("");
 					archivesMapper.updateCode(archives);
 				} else {
 					throw new RuntimeException("箱号不能为空");