Explorar o código

2023年9月15日16:36:33

纪新园 %!s(int64=2) %!d(string=hai) anos
pai
achega
be15916371
Modificáronse 19 ficheiros con 577 adicións e 29 borrados
  1. 18 0
      blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/entity/Delivery.java
  2. 34 0
      blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/document/dto/DocumentRecoveryDTO.java
  3. 88 0
      blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/document/entity/DocumentRecovery.java
  4. 36 0
      blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/document/vo/DocumentRecoveryVO.java
  5. 18 0
      blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/entity/Order.java
  6. 2 0
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/feign/DeliveryClient.java
  7. 13 4
      blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/service/impl/DeliveryServiceImpl.java
  8. 126 0
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/controller/DocumentRecoveryController.java
  9. 42 0
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/mapper/DocumentRecoveryMapper.java
  10. 24 0
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/mapper/DocumentRecoveryMapper.xml
  11. 41 0
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/service/IDocumentRecoveryService.java
  12. 41 0
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/service/impl/DocumentRecoveryServiceImpl.java
  13. 27 2
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/export/ExportOrderController.java
  14. 31 11
      blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java
  15. 19 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/controller/GoodsDescController.java
  16. 7 9
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/impl/GoodsDescServiceImpl.java
  17. 1 0
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.xml
  18. 0 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java
  19. 9 1
      blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/impl/ProductLaunchServiceImpl.java

+ 18 - 0
blade-service-api/blade-deliver-goods-api/src/main/java/org/springblade/deliver/goods/entity/Delivery.java

@@ -725,4 +725,22 @@ public class Delivery implements Serializable {
 	@ApiModelProperty(value = "车号状态")
 	private String wagonNumberStatus;
 
+	/**
+	 * 运输方式描述
+	 */
+	@ApiModelProperty(value = "运输方式描述")
+	private String transportDescription;
+
+	/**
+	 * 船名
+	 */
+	@ApiModelProperty(value = "船名")
+	private String shipName;
+
+	/**
+	 * 航次
+	 */
+	@ApiModelProperty(value = "航次")
+	private String voyage;
+
 }

+ 34 - 0
blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/document/dto/DocumentRecoveryDTO.java

@@ -0,0 +1,34 @@
+/*
+ *      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.purchase.sales.document.dto;
+
+import org.springblade.purchase.sales.document.entity.DocumentRecovery;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+/**
+ * 福达单据号回收表数据传输对象实体类
+ *
+ * @author BladeX
+ * @since 2023-09-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+public class DocumentRecoveryDTO extends DocumentRecovery {
+	private static final long serialVersionUID = 1L;
+
+}

+ 88 - 0
blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/document/entity/DocumentRecovery.java

@@ -0,0 +1,88 @@
+/*
+ *      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.purchase.sales.document.entity;
+
+import com.baomidou.mybatisplus.annotation.TableName;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+
+/**
+ * 福达单据号回收表实体类
+ *
+ * @author BladeX
+ * @since 2023-09-15
+ */
+@Data
+@TableName("business_document_recovery")
+@ApiModel(value = "DocumentRecovery对象", description = "福达单据号回收表")
+public class DocumentRecovery implements Serializable {
+
+	private static final long serialVersionUID = 1L;
+
+	private Long id;
+	/**
+	 * 客户编码
+	 */
+	@ApiModelProperty(value = "客户编码")
+	private String corpCode;
+	/**
+	 * 单据编号
+	 */
+	@ApiModelProperty(value = "单据编号")
+	private String billNo;
+	/**
+	 * 创建人
+	 */
+	@ApiModelProperty(value = "创建人")
+	private Long createUser;
+	/**
+	 * 创建时间
+	 */
+	@ApiModelProperty(value = "创建时间")
+	private Date createTime;
+	/**
+	 * 修改人
+	 */
+	@ApiModelProperty(value = "修改人")
+	private Long updateUser;
+	/**
+	 * 修改时间
+	 */
+	@ApiModelProperty(value = "修改时间")
+	private Date updateTime;
+	/**
+	 * 是否已删除(0 否 1是)
+	 */
+	@ApiModelProperty(value = "是否已删除(0 否 1是)")
+	private Integer isDeleted;
+	private String updateUserName;
+	private String createUserName;
+
+	/**
+	 * 租户id
+	 */
+	@ApiModelProperty(value = "租户id")
+	private String tenantId;
+
+
+}

+ 36 - 0
blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/document/vo/DocumentRecoveryVO.java

@@ -0,0 +1,36 @@
+/*
+ *      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.purchase.sales.document.vo;
+
+import org.springblade.purchase.sales.document.entity.DocumentRecovery;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import io.swagger.annotations.ApiModel;
+
+/**
+ * 福达单据号回收表视图实体类
+ *
+ * @author BladeX
+ * @since 2023-09-15
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@ApiModel(value = "DocumentRecoveryVO对象", description = "福达单据号回收表")
+public class DocumentRecoveryVO extends DocumentRecovery {
+	private static final long serialVersionUID = 1L;
+
+}

+ 18 - 0
blade-service-api/blade-purchase-sales-api/src/main/java/org/springblade/purchase/sales/entity/Order.java

@@ -1463,6 +1463,24 @@ public class Order implements Serializable {
 	@TableField(exist = false)
 	private BigDecimal memberAmout;
 
+	/**
+	 * 运输方式描述
+	 */
+	@ApiModelProperty(value = "运输方式描述")
+	private String transportDescription;
+
+	/**
+	 * 船名
+	 */
+	@ApiModelProperty(value = "船名")
+	private String shipName;
+
+	/**
+	 * 航次
+	 */
+	@ApiModelProperty(value = "航次")
+	private String voyage;
+
 	public String get$buyerId() {
 		return $buyerId;
 	}

+ 2 - 0
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/feign/DeliveryClient.java

@@ -148,6 +148,7 @@ public class DeliveryClient implements IDeliveryClient {
 			delivery1.setSigningMethod(order.getSigningMethod());
 			delivery1.setTripartiteInspection(order.getTripartiteInspection());
 			delivery1.setCreateUser(order.getDocumenterId());
+			delivery1.setTransportDescription(order.getTransportDescription());
 			deliveryService.updateById(delivery1);
 			deliveryNew = delivery1;
 		} else {
@@ -195,6 +196,7 @@ public class DeliveryClient implements IDeliveryClient {
 			delivery.setCertificateOriginRequired(order.getCertificateOriginRequired());
 			delivery.setSigningMethod(order.getSigningMethod());
 			delivery.setTripartiteInspection(order.getTripartiteInspection());
+			delivery.setTransportDescription(order.getTransportDescription());
 			deliveryService.save(delivery);
 			deliveryNew = delivery;
 		}

+ 13 - 4
blade-service/blade-deliver-goods/src/main/java/org/springblade/deliver/goods/service/impl/DeliveryServiceImpl.java

@@ -245,6 +245,15 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 			delivery.setUpdateTime(new Date());
 			delivery.setDeliveryStatus(status);
 			baseMapper.updateById(delivery);
+
+			if ("577435".equals(AuthUtil.getTenantId())) {
+				Order temp = new Order();
+				temp.setId(delivery.getOrgId());
+				temp.setShipName(delivery.getShipName());
+				temp.setVoyage(delivery.getVoyage());
+				temp.setBillLadingNo(delivery.getBillLadingNo());
+				orderDescClient.updateOrderNew(temp);
+			}
 		}
 		//保存发货明细信息
 		if (CollectionUtils.isNotEmpty(delivery.getDeliveryItemsList())) {
@@ -1944,7 +1953,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 			select.setWagonNumberTwo(delivery.getWagonNumberTwo());
 			baseMapper.updateById(select);
 			Order details = orderDescClient.getById(select.getSrcId());
-			if (ObjectUtils.isNotNull(details) && "XS".equals(details.getBillType()) && "已完成".equals(details.getOrderStatus())){
+			if (ObjectUtils.isNotNull(details) && "XS".equals(details.getBillType()) && "已完成".equals(details.getOrderStatus())) {
 				throw new RuntimeException("客户已收货,操作失败");
 			}
 			details.setWagonNumberOne(select.getWagonNumberOne());
@@ -1952,7 +1961,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 			orderDescClient.updateOrder(details);
 
 			Order orderTemp = orderDescClient.getById(select.getOrgId());
-			if (ObjectUtils.isNotNull(orderTemp) && "XS".equals(orderTemp.getBillType()) && "已完成".equals(orderTemp.getOrderStatus())){
+			if (ObjectUtils.isNotNull(orderTemp) && "XS".equals(orderTemp.getBillType()) && "已完成".equals(orderTemp.getOrderStatus())) {
 				throw new RuntimeException("客户已收货,操作失败");
 			}
 			orderTemp.setWagonNumberOne(select.getWagonNumberOne());
@@ -1978,7 +1987,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 			delivery.setWagonNumberTwo(" ");
 			baseMapper.updateById(delivery);
 			Order details = orderDescClient.getById(select.getSrcId());
-			if (ObjectUtils.isNotNull(details) && "XS".equals(details.getBillType()) && "已完成".equals(details.getOrderStatus())){
+			if (ObjectUtils.isNotNull(details) && "XS".equals(details.getBillType()) && "已完成".equals(details.getOrderStatus())) {
 				throw new RuntimeException("客户已收货,操作失败");
 			}
 			details.setWagonNumberOne(" ");
@@ -1986,7 +1995,7 @@ public class DeliveryServiceImpl extends ServiceImpl<DeliveryMapper, Delivery> i
 			orderDescClient.updateOrder(details);
 
 			Order orderTemp = orderDescClient.getById(select.getOrgId());
-			if (ObjectUtils.isNotNull(orderTemp) && "XS".equals(orderTemp.getBillType()) && "已完成".equals(orderTemp.getOrderStatus())){
+			if (ObjectUtils.isNotNull(orderTemp) && "XS".equals(orderTemp.getBillType()) && "已完成".equals(orderTemp.getOrderStatus())) {
 				throw new RuntimeException("客户已收货,操作失败");
 			}
 			orderTemp.setWagonNumberOne(" ");

+ 126 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/controller/DocumentRecoveryController.java

@@ -0,0 +1,126 @@
+/*
+ *      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.purchase.sales.document.controller;
+
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import io.swagger.annotations.ApiParam;
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import lombok.AllArgsConstructor;
+import javax.validation.Valid;
+
+import org.springblade.core.mp.support.Condition;
+import org.springblade.core.mp.support.Query;
+import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.Func;
+import org.springframework.web.bind.annotation.*;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import org.springblade.purchase.sales.document.entity.DocumentRecovery;
+import org.springblade.purchase.sales.document.vo.DocumentRecoveryVO;
+import org.springblade.purchase.sales.document.service.IDocumentRecoveryService;
+import org.springblade.core.boot.ctrl.BladeController;
+
+/**
+ * 福达单据号回收表 控制器
+ *
+ * @author BladeX
+ * @since 2023-09-15
+ */
+@RestController
+@AllArgsConstructor
+@RequestMapping("/documentrecovery")
+@Api(value = "福达单据号回收表", tags = "福达单据号回收表接口")
+public class DocumentRecoveryController extends BladeController {
+
+	private final IDocumentRecoveryService documentRecoveryService;
+
+	/**
+	 * 详情
+	 */
+	@GetMapping("/detail")
+	@ApiOperationSupport(order = 1)
+	@ApiOperation(value = "详情", notes = "传入documentRecovery")
+	public R<DocumentRecovery> detail(DocumentRecovery documentRecovery) {
+		DocumentRecovery detail = documentRecoveryService.getOne(Condition.getQueryWrapper(documentRecovery));
+		return R.data(detail);
+	}
+
+	/**
+	 * 分页 福达单据号回收表
+	 */
+	@GetMapping("/list")
+	@ApiOperationSupport(order = 2)
+	@ApiOperation(value = "分页", notes = "传入documentRecovery")
+	public R<IPage<DocumentRecovery>> list(DocumentRecovery documentRecovery, Query query) {
+		IPage<DocumentRecovery> pages = documentRecoveryService.page(Condition.getPage(query), Condition.getQueryWrapper(documentRecovery));
+		return R.data(pages);
+	}
+
+	/**
+	 * 自定义分页 福达单据号回收表
+	 */
+	@GetMapping("/page")
+	@ApiOperationSupport(order = 3)
+	@ApiOperation(value = "分页", notes = "传入documentRecovery")
+	public R<IPage<DocumentRecoveryVO>> page(DocumentRecoveryVO documentRecovery, Query query) {
+		IPage<DocumentRecoveryVO> pages = documentRecoveryService.selectDocumentRecoveryPage(Condition.getPage(query), documentRecovery);
+		return R.data(pages);
+	}
+
+	/**
+	 * 新增 福达单据号回收表
+	 */
+	@PostMapping("/save")
+	@ApiOperationSupport(order = 4)
+	@ApiOperation(value = "新增", notes = "传入documentRecovery")
+	public R save(@Valid @RequestBody DocumentRecovery documentRecovery) {
+		return R.status(documentRecoveryService.save(documentRecovery));
+	}
+
+	/**
+	 * 修改 福达单据号回收表
+	 */
+	@PostMapping("/update")
+	@ApiOperationSupport(order = 5)
+	@ApiOperation(value = "修改", notes = "传入documentRecovery")
+	public R update(@Valid @RequestBody DocumentRecovery documentRecovery) {
+		return R.status(documentRecoveryService.updateById(documentRecovery));
+	}
+
+	/**
+	 * 新增或修改 福达单据号回收表
+	 */
+	@PostMapping("/submit")
+	@ApiOperationSupport(order = 6)
+	@ApiOperation(value = "新增或修改", notes = "传入documentRecovery")
+	public R submit(@Valid @RequestBody DocumentRecovery documentRecovery) {
+		return R.status(documentRecoveryService.saveOrUpdate(documentRecovery));
+	}
+
+	
+	/**
+	 * 删除 福达单据号回收表
+	 */
+	@PostMapping("/remove")
+	@ApiOperationSupport(order = 8)
+	@ApiOperation(value = "删除", notes = "传入ids")
+	public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
+		return R.status(documentRecoveryService.removeByIds(Func.toLongList(ids)));
+	}
+
+	
+}

+ 42 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/mapper/DocumentRecoveryMapper.java

@@ -0,0 +1,42 @@
+/*
+ *      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.purchase.sales.document.mapper;
+
+import org.springblade.purchase.sales.document.entity.DocumentRecovery;
+import org.springblade.purchase.sales.document.vo.DocumentRecoveryVO;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import java.util.List;
+
+/**
+ * 福达单据号回收表 Mapper 接口
+ *
+ * @author BladeX
+ * @since 2023-09-15
+ */
+public interface DocumentRecoveryMapper extends BaseMapper<DocumentRecovery> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param documentRecovery
+	 * @return
+	 */
+	List<DocumentRecoveryVO> selectDocumentRecoveryPage(IPage page, DocumentRecoveryVO documentRecovery);
+
+}

+ 24 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/mapper/DocumentRecoveryMapper.xml

@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="org.springblade.purchase.sales.document.mapper.DocumentRecoveryMapper">
+
+    <!-- 通用查询映射结果 -->
+    <resultMap id="documentRecoveryResultMap" type="org.springblade.purchase.sales.document.entity.DocumentRecovery">
+        <id column="id" property="id"/>
+        <result column="corp_code" property="corpCode"/>
+        <result column="bill_no" property="billNo"/>
+        <result column="create_user" property="createUser"/>
+        <result column="create_time" property="createTime"/>
+        <result column="update_user" property="updateUser"/>
+        <result column="update_time" property="updateTime"/>
+        <result column="is_deleted" property="isDeleted"/>
+        <result column="update_user_name" property="updateUserName"/>
+        <result column="create_user_name" property="createUserName"/>
+    </resultMap>
+
+
+    <select id="selectDocumentRecoveryPage" resultMap="documentRecoveryResultMap">
+        select * from business_document_recovery where is_deleted = 0
+    </select>
+
+</mapper>

+ 41 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/service/IDocumentRecoveryService.java

@@ -0,0 +1,41 @@
+/*
+ *      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.purchase.sales.document.service;
+
+import org.springblade.purchase.sales.document.entity.DocumentRecovery;
+import org.springblade.purchase.sales.document.vo.DocumentRecoveryVO;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 福达单据号回收表 服务类
+ *
+ * @author BladeX
+ * @since 2023-09-15
+ */
+public interface IDocumentRecoveryService extends IService<DocumentRecovery> {
+
+	/**
+	 * 自定义分页
+	 *
+	 * @param page
+	 * @param documentRecovery
+	 * @return
+	 */
+	IPage<DocumentRecoveryVO> selectDocumentRecoveryPage(IPage<DocumentRecoveryVO> page, DocumentRecoveryVO documentRecovery);
+
+}

+ 41 - 0
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/document/service/impl/DocumentRecoveryServiceImpl.java

@@ -0,0 +1,41 @@
+/*
+ *      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.purchase.sales.document.service.impl;
+
+import org.springblade.purchase.sales.document.entity.DocumentRecovery;
+import org.springblade.purchase.sales.document.vo.DocumentRecoveryVO;
+import org.springblade.purchase.sales.document.mapper.DocumentRecoveryMapper;
+import org.springblade.purchase.sales.document.service.IDocumentRecoveryService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+
+/**
+ * 福达单据号回收表 服务实现类
+ *
+ * @author BladeX
+ * @since 2023-09-15
+ */
+@Service
+public class DocumentRecoveryServiceImpl extends ServiceImpl<DocumentRecoveryMapper, DocumentRecovery> implements IDocumentRecoveryService {
+
+	@Override
+	public IPage<DocumentRecoveryVO> selectDocumentRecoveryPage(IPage<DocumentRecoveryVO> page, DocumentRecoveryVO documentRecovery) {
+		return page.setRecords(baseMapper.selectDocumentRecoveryPage(page, documentRecovery));
+	}
+
+}

+ 27 - 2
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/export/ExportOrderController.java

@@ -4,13 +4,13 @@ import com.alibaba.fastjson.JSON;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.core.toolkit.BeanUtils;
 import com.baomidou.mybatisplus.core.toolkit.CollectionUtils;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
 import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
 import com.trade.purchase.order.enums.OrderTypeEnum;
 import com.trade.purchase.order.feign.IFinancingClient;
+import io.seata.spring.annotation.GlobalTransactional;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import io.swagger.annotations.ApiParam;
@@ -34,6 +34,8 @@ import org.springblade.deliver.goods.entity.Delivery;
 import org.springblade.deliver.goods.feign.IDeliveryClient;
 import org.springblade.finance.feign.IFinanceClient;
 import org.springblade.finance.vojo.Acc;
+import org.springblade.purchase.sales.document.entity.DocumentRecovery;
+import org.springblade.purchase.sales.document.service.IDocumentRecoveryService;
 import org.springblade.purchase.sales.entity.Order;
 import org.springblade.purchase.sales.entity.OrderFees;
 import org.springblade.purchase.sales.entity.OrderItems;
@@ -43,13 +45,14 @@ import org.springblade.purchase.sales.service.*;
 import org.springblade.purchase.sales.vo.*;
 import org.springblade.system.user.entity.User;
 import org.springblade.system.user.feign.IUserClient;
+import org.springframework.transaction.annotation.Transactional;
 import org.springframework.web.bind.annotation.*;
 
 import javax.servlet.http.HttpServletResponse;
-import javax.sql.rowset.serial.SerialException;
 import javax.validation.Valid;
 import java.math.BigDecimal;
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -75,6 +78,7 @@ public class ExportOrderController extends BladeController {
 	private final IDeliveryClient deliveryClient;
 	private final IFinancingClient financingClient;
 	private IGoodsDescClient goodsDescClient;
+	private final IDocumentRecoveryService documentRecoveryService;
 
 	/**
 	 * 详情
@@ -224,6 +228,8 @@ public class ExportOrderController extends BladeController {
 	@PostMapping("/update")
 	@ApiOperationSupport(order = 5)
 	@ApiOperation(value = "修改", notes = "传入order")
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R update(@Valid @RequestBody Order order) {
 		if (order.getId() == null) {
 			throw new SecurityException("请选择要删除的数据");
@@ -258,6 +264,25 @@ public class ExportOrderController extends BladeController {
 		orderFreightService.updateByPid(order.getId());
 		orderModifyService.updateByPid(order.getId());
 		orderPartsService.updateByPid(order.getId());
+		if ("577435".equals(AuthUtil.getTenantId())) {
+			DocumentRecovery documentRecovery = new DocumentRecovery();
+			documentRecovery.setCreateTime(new Date());
+			documentRecovery.setCreateUser(AuthUtil.getUserId());
+			documentRecovery.setCreateUserName(AuthUtil.getUserName());
+			documentRecovery.setTenantId(AuthUtil.getTenantId());
+			documentRecovery.setBillNo(orderMessage.getOrderNo());
+			if (ObjectUtils.isNotNull(orderMessage.getCorpId())) {
+				CorpsDesc corpsDesc = corpsDescClient.getCorpId(orderMessage.getCorpId());
+				if (ObjectUtils.isNotNull(corpsDesc)) {
+					documentRecovery.setCorpCode(corpsDesc.getCode());
+				} else {
+					throw new SecurityException("未查到客户,删除失败");
+				}
+			} else {
+				throw new SecurityException("未查到客户,删除失败");
+			}
+			documentRecoveryService.saveOrUpdate(documentRecovery);
+		}
 		return R.success("操作成功");
 	}
 

+ 31 - 11
blade-service/blade-purchase-sales/src/main/java/org/springblade/purchase/sales/service/impl/OrderServiceImpl.java

@@ -60,6 +60,8 @@ import org.springblade.pay.tonglianPayment.dto.PaymentDTO;
 import org.springblade.pay.tonglianPayment.entity.Parameters;
 import org.springblade.pay.tonglianPayment.fegin.IPaymentClient;
 import org.springblade.pay.tonglianPayment.fegin.ITongLianPaymentClient;
+import org.springblade.purchase.sales.document.entity.DocumentRecovery;
+import org.springblade.purchase.sales.document.service.IDocumentRecoveryService;
 import org.springblade.purchase.sales.entity.*;
 import org.springblade.purchase.sales.enums.OrderStatusEnum;
 import org.springblade.purchase.sales.excel.*;
@@ -187,6 +189,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 
 	private final IWechatClient wechatClient;
 
+	private final IDocumentRecoveryService documentRecoveryService;
+
 
 	@Override
 	public IPage<OrderVO> selectOrderPage(IPage<OrderVO> page, OrderVO order) {
@@ -211,7 +215,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R saveOrderMessage(Order order) {
 		// 校验单号重复-新增
 		if (order.getId() == null && StringUtils.isNotBlank(order.getOrderNo())) {
@@ -267,15 +272,29 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 						} else {
 							substring = substring + corpMessage.getData().getCode();
 						}
-						R clientBillNo = serialClient.getBillNo(substring, order.getTradeType(), order.getBillType());
-						if (!clientBillNo.isSuccess()) {
-							TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
-							return R.fail(500, "生成订单编号失败");
-						}
-						order.setOrderNo((String) clientBillNo.getData());
-						// 进口的orgOrderNo 存的是采购订单号  出口国内存的是本身的订单号码
-						if (!order.getBillType().equals(OrderTypeEnum.IMPORT.getType())) {
-							order.setOrgOrderNo((String) clientBillNo.getData());
+						List<DocumentRecovery> documentRecovery = documentRecoveryService.list(new LambdaQueryWrapper<DocumentRecovery>()
+							.eq(DocumentRecovery::getTenantId, AuthUtil.getTenantId())
+							.eq(DocumentRecovery::getIsDeleted, 0)
+							.eq(DocumentRecovery::getCorpCode, corpMessage.getData().getCode())
+							.orderByDesc(DocumentRecovery::getCreateTime));
+						if (documentRecovery.size() > 0) {
+							order.setOrderNo(documentRecovery.get(0).getBillNo());
+							// 进口的orgOrderNo 存的是采购订单号  出口国内存的是本身的订单号码
+							if (!order.getBillType().equals(OrderTypeEnum.IMPORT.getType())) {
+								order.setOrgOrderNo(documentRecovery.get(0).getBillNo());
+							}
+							documentRecoveryService.removeById(documentRecovery.get(0).getId());
+						} else {
+							R clientBillNo = serialClient.getBillNo(substring, order.getTradeType(), order.getBillType());
+							if (!clientBillNo.isSuccess()) {
+								TransactionAspectSupport.currentTransactionStatus().setRollbackOnly();
+								return R.fail(500, "生成订单编号失败");
+							}
+							order.setOrderNo((String) clientBillNo.getData());
+							// 进口的orgOrderNo 存的是采购订单号  出口国内存的是本身的订单号码
+							if (!order.getBillType().equals(OrderTypeEnum.IMPORT.getType())) {
+								order.setOrgOrderNo((String) clientBillNo.getData());
+							}
 						}
 					}
 					if ("CG".equals(order.getBillType()) && ObjectUtils.isNotNull(order.getSrcIds())) {
@@ -621,7 +640,8 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, Order> implements
 	}
 
 	@Override
-	@Transactional
+	@Transactional(rollbackFor = Exception.class)
+	@GlobalTransactional(rollbackFor = Exception.class, timeoutMills = 12000000)
 	public R saveOrderMessageApp(Order order) {
 		// 校验单号重复-新增
 		if (order.getId() == null && StringUtils.isNotBlank(order.getOrderNo())) {

+ 19 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/controller/GoodsDescController.java

@@ -38,11 +38,14 @@ import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.Func;
 import org.springblade.core.tool.utils.ObjectUtil;
 import org.springblade.purchase.sales.entity.OrderItems;
+import org.springblade.salesPart.brand.service.IBrandFilesService;
 import org.springblade.salesPart.corps.service.ICorpsDescService;
 import org.springblade.salesPart.entity.*;
 import org.springblade.salesPart.excel.GoodsDescExportExcel;
 import org.springblade.salesPart.excel.GoodsExcel;
+import org.springblade.salesPart.files.service.PjpfFilesService;
 import org.springblade.salesPart.goods.service.IGoodsDescService;
+import org.springblade.salesPart.goods.service.IGoodsFilesService;
 import org.springblade.salesPart.goods.service.IGoodsTypeService;
 import org.springblade.salesPart.order.service.IOrderItemsService;
 import org.springblade.salesPart.productLaunch.service.IProductLaunchService;
@@ -75,6 +78,8 @@ public class GoodsDescController extends BladeController {
 	private final IGoodsDescService goodsDescService;
 	private final IProductLaunchService productLaunchService;
 	private final IOrderItemsService orderItemsService;
+	private final IGoodsFilesService goodsFilesService;
+	private final IBrandFilesService brandFilesService;
 
 	/**
 	 * 详情
@@ -468,7 +473,20 @@ public class GoodsDescController extends BladeController {
 				List<String> typeStr = types.stream().map(PjGoodsType::getCname).collect(Collectors.toList());
 				item.setGoodsTypeName(typeStr.toString().replace("[", "").replace("]", ""));
 			}
-
+			List<PjGoodsFiles> goodsFilesList = new ArrayList<>();
+			goodsFilesList = goodsFilesService.list(new LambdaQueryWrapper<PjGoodsFiles>()
+				.eq(PjGoodsFiles::getMainImage, 0)
+				.eq(PjGoodsFiles::getPid, item.getId())
+				.eq(PjGoodsFiles::getTenantId, AuthUtil.getTenantId())
+				.eq(PjGoodsFiles::getIsDeleted, 0));
+			if (goodsFilesList.size() == 0 && ObjectUtils.isNotNull(item.getBrandId())) {
+				goodsFilesList = BeanUtil.copy(brandFilesService.list(new LambdaQueryWrapper<PjBrandFiles>()
+					.eq(PjBrandFiles::getMainImage, 0)
+					.eq(PjBrandFiles::getPid, item.getBrandId())
+					.eq(PjBrandFiles::getTenantId, AuthUtil.getTenantId())
+					.eq(PjBrandFiles::getIsDeleted, 0)), PjGoodsFiles.class);
+			}
+			item.setGoodsFilesList(goodsFilesList);
 		}
 		return R.data(list);
 	}

+ 7 - 9
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/goods/service/impl/GoodsDescServiceImpl.java

@@ -50,10 +50,7 @@ import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.math.BigDecimal;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-import java.util.Objects;
+import java.util.*;
 import java.util.regex.Matcher;
 import java.util.regex.Pattern;
 
@@ -138,7 +135,7 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 				throw new RuntimeException("品牌名称错误或品牌不存在");
 			}
 		}
-		if (ObjectUtils.isNull(goodsDesc.getCnameInt())){
+		if (ObjectUtils.isNull(goodsDesc.getCnameInt())) {
 			goodsDesc.setCnameInt(getCnameInt(goodsDesc.getCname()));
 		}
 		if (goodsDesc.getId() == null) {
@@ -282,7 +279,6 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 				throw new SecurityException("第" + (i + 2) + "行未添加分类或者分类不存在");
 			}
 		}
-
 		data.forEach(e -> {
 			String type = e.getGoodsTypeName();
 			PjGoodsType goodsType = goodsTypeMapper.selectGoodsTypeCname(type, AuthUtil.getTenantId());
@@ -345,9 +341,9 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 				}
 
 				goodsDesc.setGoodsDescription(e.getGoodsDescription());
-				if(ObjectUtils.isNotNull(e.getWhether()) && ("1".equals(e.getWhether()) || "0".equals(e.getWhether()))){
+				if (ObjectUtils.isNotNull(e.getWhether()) && ("1".equals(e.getWhether()) || "0".equals(e.getWhether()))) {
 					goodsDesc.setWhether(e.getWhether());
-				}else{
+				} else {
 					goodsDesc.setWhether("0");
 				}
 				goodsDesc.setInventoryAlert(e.getInventoryAlert());
@@ -377,7 +373,9 @@ public class GoodsDescServiceImpl extends ServiceImpl<GoodsDescMapper, PjGoodsDe
 					goodsTypeDes.setCreateDept(Long.valueOf(AuthUtil.getDeptId()));
 					goodsTypeDescMapper.insert(goodsTypeDes);
 				} else {
-					throw new RuntimeException("商品" + goodsDesc.getCname() + "已存在");
+					goodsDesc.setUpdateTime(new Date());
+					goodsDesc.setUpdateUser(AuthUtil.getUserId());
+					baseMapper.updateById(goodsDesc);
 				}
 			}
 		});

+ 1 - 0
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/mapper/OrderMapper.xml

@@ -158,6 +158,7 @@
         WHERE
         po.tenant_id = #{tenantId}
         AND po.is_deleted = 0
+          and po.bs_type = 'XS'
         <if test="firstDay != null">
             and po.busines_date &gt;= #{firstDay}
         </if>

+ 0 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/order/service/impl/OrderServiceImpl.java

@@ -315,7 +315,6 @@ public class OrderServiceImpl extends ServiceImpl<OrderMapper, PjOrder> implemen
 
 		if (order.getBsType().equals(OrderTypeEnum.SALES.getType())) {//销售
 			if (order.getId() == null) {
-
 				if (ObjectUtils.isNull(order.getBillType())) {
 					if (ObjectUtils.isNotNull(order.getStorageId())) {
 						order.setBillType(0);

+ 9 - 1
blade-service/blade-sales-part/src/main/java/org/springblade/salesPart/productLaunch/service/impl/ProductLaunchServiceImpl.java

@@ -27,7 +27,9 @@ import lombok.AllArgsConstructor;
 import org.springblade.client.feign.ISerialClient;
 import org.springblade.core.secure.utils.AuthUtil;
 import org.springblade.core.tool.api.R;
+import org.springblade.core.tool.utils.BeanUtil;
 import org.springblade.core.tool.utils.ObjectUtil;
+import org.springblade.salesPart.brand.service.IBrandFilesService;
 import org.springblade.salesPart.corps.service.ICorpsAttnService;
 import org.springblade.salesPart.corps.service.ICorpsDescService;
 import org.springblade.salesPart.entity.*;
@@ -68,6 +70,7 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
 	private final ISerialClient serialClient;//生成系统编号
 	private final ShoppingCartMapper shoppingCartMapper;
 	private final IStockDescService stockDescService;
+	private final IBrandFilesService brandFilesService;
 
 	/**
 	 * 获取详情
@@ -443,7 +446,12 @@ public class ProductLaunchServiceImpl extends ServiceImpl<ProductLaunchMapper, P
 		detail.setFilesList(productLaunchFilesService.list(new QueryWrapper<PjProductLaunchFiles>()
 			.eq("pid", productLaunch.getId())
 			.eq("is_deleted", 0)));
-
+		if (ObjectUtils.isNull(detail.getFilesList()) || detail.getFilesList().size() == 0) {
+			if (ObjectUtils.isNotNull(detail.getBrandId())) {
+				detail.setFilesList(BeanUtil.copy(brandFilesService.list(new QueryWrapper<PjBrandFiles>()
+					.eq("pid", detail.getBrandId()).eq("is_deleted", 0)), PjProductLaunchFiles.class));
+			}
+		}
 		PjCorpsDesc corpsDesc = null;
 		//根据当前登录人获得客户
 		PjCorpsAttn corpsAttn = corpsAttnService.getAttn(AuthUtil.getUserId());