Browse Source

2023年1月17日10:41:36

纪新园 3 years ago
parent
commit
94c4977dde

+ 12 - 0
blade-service-api/blade-box-tube-api/src/main/java/org/springblade/box/tube/entity/TradingBoxItem.java

@@ -250,4 +250,16 @@ public class TradingBoxItem implements Serializable {
 	@ApiModelProperty(value = "堆存状态")
 	private String stockpilingStatus;
 
+	/**
+	 * 来源业务类型
+	 */
+	@ApiModelProperty(value = "来源业务类型")
+	private String srcBillType;
+
+	/**
+	 * 来源id
+	 */
+	@ApiModelProperty(value = "来源id")
+	private Long srcId;
+
 }

+ 9 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/feign/IGoodsDescClient.java

@@ -37,6 +37,8 @@ public interface IGoodsDescClient {
 	String GOODS_ALL = API_PREFIX+ "selectGoodsDescAll";
 	String GOODS_SPECIFICATION_LIST = API_PREFIX+ "goodsSpecificationList";
 
+	String SELECT_GOODS_SPECIFICATION_ALL = API_PREFIX+ "selectGoodsSpecificationAll";
+
 	/**
 	 * 根据销售明细的商品id获得商品信息
 	 *
@@ -181,6 +183,13 @@ public interface IGoodsDescClient {
 	List<GoodsDesc> selectGoodsDescAll();
 
 	/**
+	 * 获取租户号下所有商品属性、配件
+	 * @return
+	 */
+	@GetMapping(SELECT_GOODS_SPECIFICATION_ALL)
+	List<GoodsSpecification> selectGoodsSpecificationAll();
+
+	/**
 	 * 根据销售明细的商品id获得商品信息
 	 *
 	 * @param itemIds

+ 2 - 0
blade-service-api/blade-client-api/src/main/java/org/springblade/client/goods/enums/RedisKey.java

@@ -23,5 +23,7 @@ public class RedisKey {
 	public static final String ALL = "all";
 	//费用名称
 	public static final String FEE_NAME = "feeName";
+	//商品属性、配件
+	public static final String SPECIFICATION = "specification";
 
 }

+ 36 - 1
blade-service/blade-box-tube/src/main/java/org/springblade/box/tube/controller/TradingBoxController.java

@@ -25,8 +25,11 @@ 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.entity.TradingBox;
+import org.springblade.box.tube.entity.*;
+import org.springblade.box.tube.service.ITradingBoxFeesService;
+import org.springblade.box.tube.service.ITradingBoxItemService;
 import org.springblade.box.tube.service.ITradingBoxService;
+import org.springblade.box.tube.service.ITransportItemService;
 import org.springblade.box.tube.vo.TradingBoxVO;
 import org.springblade.common.annotation.RepeatSubmit;
 import org.springblade.core.boot.ctrl.BladeController;
@@ -57,6 +60,12 @@ public class TradingBoxController extends BladeController {
 
 	private final ITradingBoxService tradingBoxService;
 
+	private final ITradingBoxFeesService tradingBoxFeesService;
+
+	private final ITradingBoxItemService tradingBoxItemService;
+
+	private final ITransportItemService transportItemService;
+
 	/**
 	 * 详情
 	 */
@@ -148,6 +157,32 @@ public class TradingBoxController extends BladeController {
 		if (ObjectUtils.isNotNull(tradingBox) && 3 == tradingBox.getStatus()) {
 			throw new RuntimeException("审核通过不允许删除");
 		}
+		if (tradingBox.getType().equals("DCF")) {
+			LambdaQueryWrapper<TradingBoxFees> lambdaQueryWrapper = new LambdaQueryWrapper<>();
+			lambdaQueryWrapper.eq(TradingBoxFees::getPid, tradingBox.getId()).eq(TradingBoxFees::getIsDeleted, 0).eq(TradingBoxFees::getTenantId, AuthUtil.getTenantId());
+			List<TradingBoxFees> tradingBoxFeesList = tradingBoxFeesService.list(lambdaQueryWrapper);
+			if (ObjectUtils.isNotNull(tradingBoxFeesList) && tradingBoxFeesList.size() > 0) {
+				throw new RuntimeException("该单据已计算堆存费,删除失败!");
+			} else {
+				LambdaQueryWrapper<TradingBoxItem> tradingBoxItemLambdaQueryWrapper = new LambdaQueryWrapper<>();
+				tradingBoxItemLambdaQueryWrapper.eq(TradingBoxItem::getPid, tradingBox.getId()).eq(TradingBoxItem::getIsDeleted, 0).eq(TradingBoxItem::getTenantId, AuthUtil.getTenantId());
+				List<TradingBoxItem> tradingBoxItemList = tradingBoxItemService.list(tradingBoxItemLambdaQueryWrapper);
+				for (TradingBoxItem tradingBoxItem : tradingBoxItemList) {
+					if ("JKFC".equals(tradingBoxItem.getSrcBillType()) || "CKZY".equals(tradingBoxItem.getSrcBillType())){
+						TransportItem transportItem = new TransportItem();
+						transportItem.setId(tradingBoxItem.getSrcId());
+						transportItem.setStockpilingStatus("1");
+						transportItemService.updateById(transportItem);
+					}else{
+						TradingBoxItem old = new TradingBoxItem();
+						old.setId(tradingBoxItem.getSrcId());
+						old.setStockpilingStatus("1");
+						tradingBoxItemService.updateById(old);
+					}
+					tradingBoxItemService.updateById(tradingBoxItem);
+				}
+			}
+		}
 		return R.status(tradingBoxService.removeByIds(Func.toLongList(ids)));
 	}
 

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

@@ -140,6 +140,8 @@ public class TransferServiceImpl implements ITransferService {
 						tradingBoxItem_.setStockpilingStatus("0");
 						tradingBoxItemMapper.updateById(tradingBoxItem_);
 					}
+					tradingBoxItem.setSrcId(tradingBoxItem.getId());
+					tradingBoxItem.setSrcBillType(tradingBox.getSource());
 					tradingBoxItem.setId(null);
 				}
 				tradingBoxItem.setAddress(tradingBox.getAddress());

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

@@ -243,7 +243,7 @@ public class TransportServiceImpl extends ServiceImpl<TransportMapper, Transport
 				//更新箱档案信息
 				if (ObjectUtils.isNotNull(transportItem.getCode())) {
 					Archives archives = new Archives();
-					archives.setStatus("使用");
+					archives.setStatus("使用");
 					archives.setCode(transportItem.getCode());
 					archives.setAddress(transportItem.getAddress());
 					archives.setAddressId(transportItem.getAddressId());

+ 19 - 1
blade-service/blade-client/src/main/java/org/springblade/client/RedisClient.java

@@ -46,7 +46,7 @@ public class RedisClient implements IRedisClient {
 
 	@Override
 	public boolean basicData(String type) {
-		if (ObjectUtils.isNull(type)){
+		if (ObjectUtils.isNull(type)) {
 			type = RedisKey.ALL;
 		}
 		//redis缓存基础资料数据
@@ -68,6 +68,14 @@ public class RedisClient implements IRedisClient {
 				redisTemplate.opsForValue().getAndSet(RedisKey.REDIS_GOODS, goodsDescClient.selectGoodsDescAll());
 			}
 
+			//商品属性、配件
+			if (redisTemplate.hasKey(RedisKey.SPECIFICATION)) {
+				redisTemplate.opsForValue().set(RedisKey.SPECIFICATION, goodsDescClient.selectGoodsSpecificationAll(), 30, TimeUnit.DAYS);
+				redisTemplate.persist(type);
+			} else {
+				redisTemplate.opsForValue().getAndSet(RedisKey.SPECIFICATION, goodsDescClient.selectGoodsSpecificationAll());
+			}
+
 			//客户
 			CorpsDesc corpsDesc = new CorpsDesc();
 			corpsDesc.setTenantId(AuthUtil.getTenantId());
@@ -128,6 +136,16 @@ public class RedisClient implements IRedisClient {
 				}
 			}
 
+			//商品属性、配件
+			if (RedisKey.SPECIFICATION.equals(type)) {
+				if (redisTemplate.hasKey(type)) {
+					redisTemplate.opsForValue().set(type, goodsDescClient.selectGoodsSpecificationAll(), 30, TimeUnit.DAYS);
+					redisTemplate.persist(type);
+				} else {
+					redisTemplate.opsForValue().getAndSet(type, goodsDescClient.selectGoodsSpecificationAll());
+				}
+			}
+
 			//客户
 			if (RedisKey.REDIS_CORPS.equals(type)) {
 				CorpsDesc corpsDesc = new CorpsDesc();

+ 1 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/controller/GoodsDescController.java

@@ -283,6 +283,7 @@ public class GoodsDescController extends BladeController {
 	public R<?> modify(@RequestBody GoodsDesc goodsDesc) {
 		goodsDescService.modify(goodsDesc);
 		redisClient.basicData("goods");
+		redisClient.basicData("specification");
 		return R.data(goodsDesc);
 	}
 

+ 10 - 0
blade-service/blade-client/src/main/java/org/springblade/client/goods/feign/GoodsDescClient.java

@@ -220,6 +220,16 @@ public class GoodsDescClient implements IGoodsDescClient {
 	}
 
 	@Override
+	public List<GoodsSpecification> selectGoodsSpecificationAll() {
+		// 查询商品规格明细
+		List<GoodsSpecification> goodsSpecificationList = goodsSpecificationService.list(new LambdaQueryWrapper<GoodsSpecification>()
+			.eq(GoodsSpecification::getIsDeleted, 0)
+			.eq(GoodsSpecification::getTenantId, SecureUtil.getTenantId())
+		);
+		return goodsSpecificationList;
+	}
+
+	@Override
 	public List<GoodsSpecification> goodsSpecificationList(Long itemIds) {
 		// 查询商品规格明细
 		List<GoodsSpecification> goodsSpecificationList = goodsSpecificationService.list(new LambdaQueryWrapper<GoodsSpecification>()

+ 11 - 3
blade-service/blade-mocha-item/src/main/java/org/springblade/mocha/controller/PriceBankController.java

@@ -56,6 +56,7 @@ import org.springframework.web.multipart.MultipartFile;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.stream.Collectors;
 
 /**
  * 出口价格库 控制器
@@ -223,6 +224,13 @@ public class PriceBankController extends BladeController {
 			redisClient.basicData("goods");
 			goodsList = castToList(redisTemplate.opsForValue().get("goods"), GoodsDesc.class);
 		}
+		//商品
+		List<GoodsSpecification> goodsSpecificationList = new ArrayList<>();
+		goodsSpecificationList = castToList(redisTemplate.opsForValue().get("specification"), GoodsSpecification.class);
+		if (goodsSpecificationList.size() == 0) {
+			redisClient.basicData("specification");
+			goodsSpecificationList = castToList(redisTemplate.opsForValue().get("specification"), GoodsSpecification.class);
+		}
 		List<PriceBank> pages = priceBankService.list(lambdaQueryWrapper);
 		if (CollectionUtils.isNotEmpty(pages)){
 			for(PriceBank item :pages){
@@ -249,9 +257,9 @@ public class PriceBankController extends BladeController {
 					}*/
 
 				}
-				/*List<GoodsSpecification> goodsSpecificationList = goodsDescClient.goodsSpecificationList(item.getItemId());
-				List<GoodsSpecificationDto> goodsSpecificationDtoList = BeanUtil.copy(goodsSpecificationList, GoodsSpecificationDto.class);
-				item.setGoodsSpecificationList(goodsSpecificationDtoList);*/
+				List<GoodsSpecification> goodsSpecification = goodsSpecificationList.stream().filter(e -> e.getPid().equals(item.getId())).collect(Collectors.toList());
+				List<GoodsSpecificationDto> goodsSpecificationDtoList = BeanUtil.copy(goodsSpecification, GoodsSpecificationDto.class);
+				item.setGoodsSpecificationList(goodsSpecificationDtoList);
 
 			}
 		}

+ 1 - 1
blade-service/blade-school/src/main/java/org/springblade/school/service/impl/SalaryItemServiceImpl.java

@@ -2575,7 +2575,7 @@ public class SalaryItemServiceImpl extends ServiceImpl<SalaryItemMapper, SalaryI
 
 		if (bladeFile != null && StringUtils.isNotBlank(bladeFile.getLink())) {
 			String link = bladeFile.getLink();
-			String replace = link.replace("http://121.37.83.47:9000/", "https://trade.tubaosoft.com/file/");
+			String replace = link.replace("http://121.37.83.47:9000/", "http://trade.tubaosoft.com/file/");
 //			String replace = link.replace("http://127.0.0.1:9000/", "http://192.168.1.12:9000/");
 			bladeFile.setLink(replace);
 			salaryAccessory.setUrl(bladeFile.getLink());