Browse Source

Merge remote-tracking branch 'origin/feature/asyncOrder' into feature/asyncOrder

Mechrevo 1 year ago
parent
commit
cb823da022

+ 2 - 3
.gitignore

@@ -3,7 +3,7 @@
 
 # Log file
 *.log
-*.properties
+
 # BlueJ files
 *.ctxt
 
@@ -43,8 +43,7 @@ unpackage/
 
 
 
-# 隐藏部分目录 
-sp-core/sp-nacos/src/main/resources/bootstrap.properties
+# 隐藏部分目录
 sp-service/sp-more/src/main/java/com/pj/project/*
 doc/nacos
 doc/sentinel-dashboard

+ 39 - 0
sp-core/sp-nacos/src/main/resources/bootstrap.properties

@@ -0,0 +1,39 @@
+# --------------------- nacos注册中心 --------------------- 
+### nacos注册中心 - 地址
+spring.cloud.nacos.discovery.server-addr=127.0.0.1:8001
+### nacos注册中心 - 用户
+spring.cloud.nacos.discovery.username=nacos
+### nacos注册中心 - 密码
+spring.cloud.nacos.discovery.password=nacos
+
+# --------------------- nacos配置中心 --------------------- 
+### nacos配置中心 - 地址 [注册中心地址]
+spring.cloud.nacos.config.server-addr=${spring.cloud.nacos.discovery.server-addr}
+### nacos配置中心 - 用户 [注册中心用户名]
+spring.cloud.nacos.config.username=${spring.cloud.nacos.discovery.username}
+### nacos配置中心 - 密码 [注册中心用密码]
+spring.cloud.nacos.config.password=${spring.cloud.nacos.discovery.password}
+### 配置文件前缀
+spring.cloud.nacos.config.prefix=${spring.application.name}
+### 配置文件后缀
+spring.cloud.nacos.config.file-extension=yml
+### 共享配置 (实时刷新) 
+spring.cloud.nacos.config.refreshable-dataids=application-common.yml, application-common-${spring.profiles.active}.yml
+
+# --------------------- sentinel-dashboard 控制台 --------------------- 
+# sentinel dashboard 控制台地址 
+spring.cloud.sentinel.transport.dashboard=127.0.0.1:8002
+
+# --------------------- sentinel-dashboard 集成nacos (将配置储存到nacos中) --------------------- 
+### 取消控制台懒加载 
+spring.cloud.sentinel.eager=true
+### nacos地址、用户名、密码等信息 
+spring.cloud.sentinel.datasource.ds.nacos.server-addr=${spring.cloud.nacos.discovery.server-addr}
+spring.cloud.sentinel.datasource.ds.nacos.username=${spring.cloud.nacos.discovery.username}
+spring.cloud.sentinel.datasource.ds.nacos.password=${spring.cloud.nacos.discovery.password}
+spring.cloud.sentinel.datasource.ds.nacos.dataId=${spring.application.name}-sentinel
+spring.cloud.sentinel.datasource.ds.nacos.groupId=DEFAULT_GROUP
+spring.cloud.sentinel.datasource.ds.nacos.data-type=json
+spring.cloud.sentinel.datasource.ds.nacos.rule-type=flow
+
+

+ 20 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_collage_orders/TbCollageOrders.java

@@ -113,16 +113,36 @@ public class TbCollageOrders extends Model<TbCollageOrders> implements Serializa
 	private String entryFailReason;
 
 	/**
+	 * 订单边民确认
+	 */
+	private String peopleConfirmStatus;
+
+	/**
+	 * 订单边民确认时间
+	 */
+	private Date peopleConfirmTime;
+
+	/**
 	 * 进口边民确认
 	 */
 	private String importPeopleStatus;
 
 	/**
+	 * 进口边民确认时间
+	 */
+	private Date importPeopleTime;
+
+	/**
 	 * 进口组长确认
 	 */
 	private String importLeaderStatus;
 
 	/**
+	 * 进口组长确认时间
+	 */
+	private Date importLeaderTime;
+
+	/**
 	 * 进口申报单号
 	 */
 	private String importNo;

+ 1 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_collage_orders/TbCollageOrdersMapper.xml

@@ -57,6 +57,7 @@
 			<if test=' this.has("updateName") '> and update_name = #{updateName} </if>
 			<if test=' this.has("updateTime") '> and update_time = #{updateTime} </if>
 			<if test=' this.has("deleteStatus") '> and delete_status = #{deleteStatus} </if>
+			<if test=' this.has("peopleConfirmStatus") '> and people_confirm_status = #{peopleConfirmStatus} </if>
 		</where>
 		order by
 		<choose>

+ 1 - 1
sp-service/level-two-server/src/main/java/com/pj/tb_fee_item/TbFeeItem.java

@@ -43,7 +43,7 @@ public class TbFeeItem extends Model<TbFeeItem> implements Serializable {
 	/**
 	 * 主键 
 	 */
-	private String id;
+	private Long id;
 
 	/**
 	 * 企业ID 

+ 12 - 2
sp-service/level-two-server/src/main/java/com/pj/tb_fee_item/TbFeeItemService.java

@@ -49,12 +49,22 @@ public class TbFeeItemService extends ServiceImpl<TbFeeItemMapper, TbFeeItem> im
 		return super.getById(id);
 	}
 
-	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
-	List<TbFeeItem> getList(SoMap so) { 
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */
+	public List<TbFeeItem> getList(SoMap so) {
 		return tbFeeItemMapper.getList(so);	
 	}
 
 	/**
+	 * 查询所有税费
+	 * @return
+	 */
+	public List<TbFeeItem> getFeeItems() {
+		SoMap so=new SoMap();
+		so.put("status",1);
+		return tbFeeItemMapper.getList(so);
+	}
+
+	/**
 	 * 根据收费公司查找
 	 * @param companyId
 	 * @return

+ 4 - 2
sp-service/level-two-server/src/main/java/com/pj/tb_fee_item_record/TbFeeItemRecord.java

@@ -1,6 +1,8 @@
 package com.pj.tb_fee_item_record;
 
 import java.io.Serializable;
+import java.util.Date;
+
 import com.baomidou.mybatisplus.annotation.*;
 import com.baomidou.mybatisplus.extension.activerecord.Model;
 import lombok.EqualsAndHashCode;
@@ -98,12 +100,12 @@ public class TbFeeItemRecord extends Model<TbFeeItemRecord> implements Serializa
 	/**
 	 * 创建时间 
 	 */
-	private String createTime;	
+	private Date createTime;
 
 	/**
 	 * 支付/划拨时间 
 	 */
-	private String payTime;	
+	private Date payTime;
 
 	/**
 	 * 支付/划拨状态(0=未划拨,1=划拨成功,2=划拨失败) 

+ 32 - 9
sp-service/level-two-server/src/main/java/com/pj/tb_orders/TbOrdersService.java

@@ -1,13 +1,10 @@
 package com.pj.tb_orders;
 
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Date;
-import java.util.List;
-
 import cn.dev33.satoken.stp.StpUtil;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.pj.api.client.admin.AdminInterface;
 import com.pj.api.client.async_server.AsyncServerInterface;
 import com.pj.api.client.level_one_server.LevelOneServerInterface;
@@ -22,11 +19,13 @@ import com.pj.current.satoken.StpAPPUserUtil;
 import com.pj.enummj.DataType;
 import com.pj.enummj.DeleteStatus;
 import com.pj.enummj.OrderStatus;
-import com.pj.tb_company.TbCompany;
 import com.pj.tb_demand_quotation.TbDemandQuotation;
 import com.pj.tb_demand_quotation.TbDemandQuotationService;
+import com.pj.tb_fee_item.TbFeeItem;
+import com.pj.tb_fee_item.TbFeeItemService;
+import com.pj.tb_fee_item_record.TbFeeItemRecord;
+import com.pj.tb_fee_item_record.TbFeeItemRecordService;
 import com.pj.tb_goods_demand.TbGoodsDemand;
-import com.pj.tb_goods_demand.TbGoodsDemandMapper;
 import com.pj.tb_goods_demand.TbGoodsDemandService;
 import com.pj.tb_goods_demand.vo.GoodsDemandVo;
 import com.pj.tb_orders_cart.TbOrdersCart;
@@ -37,10 +36,13 @@ import com.pj.utils.so.SoMap;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.baomidou.mybatisplus.extension.service.IService;
-import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import org.springframework.transaction.annotation.Transactional;
 
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Date;
+import java.util.List;
+
 /**
  * Service: tb_orders -- 订单表
  *
@@ -68,6 +70,12 @@ public class TbOrdersService extends ServiceImpl<TbOrdersMapper, TbOrders> imple
     @Autowired
     TbOrdersCartMapper tbOrdersCartMapper;
 
+    @Autowired
+    TbFeeItemService tbFeeItemService;
+
+    @Autowired
+    TbFeeItemRecordService tbFeeItemRecordService;
+
     /**
      * 远程调用
      */
@@ -162,6 +170,21 @@ public class TbOrdersService extends ServiceImpl<TbOrdersMapper, TbOrders> imple
         orders.setPayTaxTime(new Date());
         orders.setOrderFinish(1);//缴费成功订单完成
         if (updateById(orders)) {
+            //保存缴费记录
+            List<TbFeeItem> feeItems = tbFeeItemService.getFeeItems();
+            feeItems.stream().forEach(e -> {
+                TbFeeItemRecord record = new TbFeeItemRecord();
+                record.setItemId(e.getId());
+                record.setCompanyName(e.getCompanyName());
+                record.setItemName(e.getName());
+                record.setOrderNo(orders.getOrderNo());
+                record.setLevelTwoOrderId(orders.getId());
+                record.setPayTime(new Date());
+                record.setCreateTime(new Date());
+                record.setPayStatus("1");
+                record.setPayRemark("缴纳:" + e.getName());
+                tbFeeItemRecordService.save(record);
+            });
             //todo:给收购商发送边民缴费成功消息
             MessageDto dto = new MessageDto();
             dto.setUrl("/pages/market/two/purchaser/order/list");