Просмотр исходного кода

Merge remote-tracking branch 'origin/feature/wxPay' into feature/payTemp

# Conflicts:
#	sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrder.java
#	sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderMapper.xml
#	sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeople.java
qzy 1 месяц назад
Родитель
Сommit
0eec3f1662
28 измененных файлов с 1551 добавлено и 74 удалено
  1. 2 0
      sp-core/sp-base/src/main/java/com/pj/project4sp/spcfg/SpCfgService.java
  2. 4 0
      sp-core/sp-base/src/main/java/com/pj/project4sp/spcfg/SpCfgUtil.java
  3. 4 0
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrder.java
  4. 22 4
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderAppController.java
  5. 1 0
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderMapper.xml
  6. 34 3
      sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java
  7. 70 66
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeople.java
  8. 1 1
      sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleMapper.xml
  9. 157 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletAppController.java
  10. 136 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecord.java
  11. 97 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecordController.java
  12. 39 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecordMapper.java
  13. 76 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecordMapper.xml
  14. 71 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecordService.java
  15. 40 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/vo/WalletRecordAppVo.java
  16. 18 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/vo/WalletRecordVo.java
  17. 122 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdown.java
  18. 87 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdownController.java
  19. 29 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdownMapper.java
  20. 71 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdownMapper.xml
  21. 55 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdownService.java
  22. 17 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/vo/WalletTopdownVo.java
  23. 122 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopup.java
  24. 97 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopupController.java
  25. 32 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopupMapper.java
  26. 71 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopupMapper.xml
  27. 57 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopupService.java
  28. 19 0
      sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/vo/ValletTopupVo.java

+ 2 - 0
sp-core/sp-base/src/main/java/com/pj/project4sp/spcfg/SpCfgService.java

@@ -1,5 +1,6 @@
 package com.pj.project4sp.spcfg;
 
+import com.pj.current.config.SystemObject;
 import org.springframework.cache.annotation.CacheEvict;
 import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
@@ -25,6 +26,7 @@ public class SpCfgService {
 	/** 修改cfg_value 根据cfgName */
 	@CacheEvict(value="sp_cfg_", key="#cfgName")
 	public int updateCfgValue(String cfgName, String cfgValue){
+		int	num=SpCfgUtil.getTradeNum();
 		return SP.publicMapper.updateColumnBy("sp_cfg", "cfg_value", cfgValue, "cfg_name", cfgName);
 	}
 	

+ 4 - 0
sp-core/sp-base/src/main/java/com/pj/project4sp/spcfg/SpCfgUtil.java

@@ -79,6 +79,10 @@ public class SpCfgUtil {
 	public static String appName() {
 		return SpCfgUtil.getAppCfg("appName", "");
 	}
+	public static Integer getTradeNum() {
+		String num= SpCfgUtil.getAppCfg("tradeNum", "1");
+		return Integer.parseInt(num);
+	}
 	/** 获取配置信息:版本号  */
 	public static String appVersionNo() {
 		return SpCfgUtil.getAppCfg("appVersionNo", "");

+ 4 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrder.java

@@ -563,4 +563,8 @@ public class TbOrder extends Model<TbOrder> implements Serializable {
 	@TableField(exist = false)
 	private String phone;
 
+	/**
+	 * 是否扣除服务点费(0=未扣除,1=已扣除)
+	 */
+	private Integer isCheckoffWallet;
 }

+ 22 - 4
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderAppController.java

@@ -1,10 +1,14 @@
 package com.pj.tb_order;
 
 import com.pj.api.dto.OrderDto;
+import com.pj.current.dto.APPLoginUserInfo;
 import com.pj.current.satoken.StpAPPUserUtil;
 import com.pj.project4sp.SP;
+import com.pj.project4sp.spcfg.SpCfgUtil;
 import com.pj.tb_order.vo.OrderVo;
 import com.pj.tb_order.vo.PeopleConfirmVo;
+import com.pj.tb_people.TbPeople;
+import com.pj.tb_people.TbPeopleService;
 import com.pj.utils.sg.AjaxJson;
 import com.pj.utils.so.SoMap;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -26,7 +30,11 @@ public class TbOrderAppController {
 	@Autowired
 	TbOrderService tbOrderService;
 
-
+	/**
+	 * 底层 Service 对象
+	 */
+	@Autowired
+	TbPeopleService tbPeopleService;
 
 
 	/** 查 - 根据id */
@@ -146,8 +154,18 @@ public class TbOrderAppController {
 
 	@RequestMapping("up")
 	public AjaxJson up(@RequestParam("id")Long id,@RequestParam("upPrice")String upPrice) {
-		tbOrderService.up(id,upPrice);
-		return AjaxJson.getSuccess();
+		APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
+		if(tbOrderService.getById(id).getIsCheckoffWallet().equals(0)) {
+			TbPeople tbPeople = tbPeopleService.getById(appLoginInfo.getFk());
+			if (tbPeople.getWallet() < SpCfgUtil.getTradeNum()) {
+				return AjaxJson.getError("余额不足!");
+			}
+			tbOrderService.up(id,upPrice,tbPeople);
+			return AjaxJson.getSuccess();
+		}else {
+			tbOrderService.up(id,upPrice,null);
+			return AjaxJson.getSuccess();
+		}
 	}
 
 	@RequestMapping("down")
@@ -194,7 +212,7 @@ public class TbOrderAppController {
         return AjaxJson.toAjax(tbOrderService.orderRefund(id));
     }
 
-	/*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/
+	/*-----           正常业务逻辑    rpc远程调用 -----*/
 
 	/** 边民订单确认-收到银行扣款回执 */
 	@PostMapping("rpc/confirmOrderFromBank")

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

@@ -119,6 +119,7 @@
 			<if test=' this.has("returns") '> and returns = #{returns} </if>
 			<if test=' this.has("chargebacks") '> and chargebacks = #{chargebacks} </if>
 
+			<if test=' this.has("isCheckoffWallet") '> and is_checkoff_wallet = #{isCheckoffWallet} </if>
 			<if test='confirmType == "people_confirm_time" and this.has("dateBegin")'> and people_confirm_time &gt;= #{dateBegin} </if>
 			<if test='confirmType == "people_confirm_time" and this.has("dateEnd")'> and people_confirm_time &lt;= #{dateEnd} </if>
 

+ 34 - 3
sp-service/level-one-server/src/main/java/com/pj/tb_order/TbOrderService.java

@@ -27,6 +27,7 @@ import com.pj.current.satoken.StpAPPUserUtil;
 import com.pj.enummj.*;
 import com.pj.ht_trade_settlement.HtTradeSettlement;
 import com.pj.ht_trade_settlement.HtTradeSettlementService;
+import com.pj.project4sp.spcfg.SpCfgUtil;
 import com.pj.tb_enterprise.TbEnterprise;
 import com.pj.tb_enterprise.TbEnterpriseMapper;
 import com.pj.tb_goods_transit.TbGoodsTransit;
@@ -46,6 +47,8 @@ import com.pj.tb_shop.TbShop;
 import com.pj.tb_shop.TbShopService;
 import com.pj.tb_trade_area.TbTradeArea;
 import com.pj.tb_trade_area.TbTradeAreaService;
+import com.pj.tb_wallet_record.TbWalletRecord;
+import com.pj.tb_wallet_record.TbWalletRecordService;
 import com.pj.utils.sg.AjaxError;
 import com.pj.utils.so.SoMap;
 import io.swagger.models.auth.In;
@@ -109,6 +112,10 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
     @Autowired
     private TbTradeAreaService tbTradeAreaService;
 
+    /** 底层 Service 对象 */
+    @Autowired
+    TbWalletRecordService tbWalletRecordService;
+
     /**
      * 远程调用
      */
@@ -788,7 +795,7 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         return tbOrders;
     }
 
-    /*-----           正常业务逻辑👆👆    rpc远程调用👇👇 -----*/
+    /*-----           正常业务逻辑    rpc远程调用 -----*/
 
     /**
      * 航通发起的退单
@@ -1118,11 +1125,35 @@ public class TbOrderService extends ServiceImpl<TbOrderMapper, TbOrder> implemen
         return true;
     }
 
-    public void up(Long id, String upPrice) {
-        TbOrder tbOrder = new TbOrder();
+    public void up(Long id, String upPrice, TbPeople tbPeople) {
+        TbOrder tbOrder =super.getById(id);
         tbOrder.setId(id);
+        // -plj 2024-09-5 11:08:00 修改上架扣除服务点处理
+        if (tbPeople!= null) {
+            tbOrder.setIsCheckoffWallet(1);   //1=已扣除
+        }
         tbOrder.setUpPrice(new BigDecimal(upPrice)).setUpTime(new Date()).setUpStatus(2);
         int i = tbOrderMapper.updateById(tbOrder);
+        if (i== 1 && tbPeople != null) {
+            double beforeAmount=tbPeople.getWallet();
+            double afterAmount=tbPeople.getWallet()- SpCfgUtil.getTradeNum();
+            Date date = new Date();
+            tbPeopleService.updateById(tbPeople.setWallet(afterAmount));
+            tbWalletRecordService.save(new TbWalletRecord()
+                    .setPeopleId(tbPeople.getId().toString())
+                    .setAmount(SpCfgUtil.getTradeNum().toString())
+                    .setBeforeAmount(beforeAmount)
+                    .setAfterAmount(afterAmount)
+                    .setOrderId(tbOrder.getId())
+                    .setTradeNo(tbOrder.getTradeNo())
+                    .setGoodsId(tbOrder.getGoodsId())
+                    .setGoodsNames(tbOrder.getGoodsNames())
+                    .setCreateTime(date).setRecordTime(date)
+                    .setCreateBy(StpAPPUserUtil.getAPPLoginInfo().getLoginId().toString())
+                    .setCreateName(StpAPPUserUtil.getAPPLoginInfo().getLoginName())
+                    .setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode())
+                );
+        }
         if (i != 1) {
             throw new AjaxError("上架失败");
         }

+ 70 - 66
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeople.java

@@ -66,208 +66,208 @@ public class TbPeople extends Model<TbPeople> implements Serializable {
 	private String name;
 
 	/**
-	 * 边民号
+	 * 边民号 
 	 */
-	private String code;
+	private String code;	
 
 	/**
-	 * 性别(1=男,2=女)
+	 * 性别(1=男,2=女) 
 	 */
 	private Integer sex;
 
 	/**
-	 * 年龄
+	 * 年龄 
 	 */
-	private Integer age;
+	private Integer age;	
 
 	/**
-	 * 身份证
+	 * 身份证 
 	 */
 	private String idCard;
 
 	/**
-	 * 身份证复印件
+	 * 身份证复印件 
 	 */
-	private String idCardImg;
+	private String idCardImg;	
 
 	/**
-	 * 手机号码
+	 * 手机号码 
 	 */
 	private String phone;
 
 	/**
-	 * 银行编号
+	 * 银行编号 
 	 */
-	private String bankNo;
+	private String bankNo;	
 
 	/**
-	 * 银行卡号
+	 * 银行卡号 
 	 */
-	private String bankCode;
+	private String bankCode;	
 
 	/**
-	 * 银行名称
+	 * 银行名称 
 	 */
-	private String bankName;
+	private String bankName;	
 
 	/**
-	 * 所属互助组(1=测试组)
+	 * 所属互助组(1=测试组) 
 	 */
-	private Long groupId;
+	private Long groupId;	
 
 	/**
-	 * 互助组名称
+	 * 互助组名称 
 	 */
-	private String groupName;
+	private String groupName;	
 
 	/**
-	 * 是否可用(0=否,1=是)
+	 * 是否可用(0=否,1=是) 
 	 */
 	private Integer status;
 
 	/**
-	 * 角色(1=普通边民,2=兼组长)
+	 * 角色(1=普通边民,2=兼组长) 
 	 */
 	private Integer role;
 
 	/**
-	 * 经度
+	 * 经度 
 	 */
-	private Double lng;
+	private Double lng;	
 
 	/**
-	 * 纬度
+	 * 纬度 
 	 */
-	private Double lat;
+	private Double lat;	
 
 	/**
-	 * 最后一次下单定位
+	 * 最后一次下单定位 
 	 */
-	private String lastLocation;
+	private String lastLocation;	
 
 	/**
-	 * 联系地址
+	 * 联系地址 
 	 */
-	private String address;
+	private String address;	
 
 	/**
-	 * 地址ID
+	 * 地址ID 
 	 */
-	private String addressIds;
+	private String addressIds;	
 
 	/**
-	 * 详细地址
+	 * 详细地址 
 	 */
-	private String detailAddress;
+	private String detailAddress;	
 
 	/**
-	 * 是否锁定
+	 * 是否锁定 
 	 */
 	private Integer isLock;
 
 	/**
-	 * 当天剩余额度
+	 * 当天剩余额度 
 	 */
-	private Double leftPrice;
+	private Double leftPrice;	
 
 	/**
-	 * 审核状态
+	 * 审核状态 
 	 */
 	private Integer judgeStatus;
 
 	/**
-	 * 审核不通过内容
+	 * 审核不通过内容 
 	 */
-	private String judgeContent;
+	private String judgeContent;	
 
 	/**
-	 * 注册时间
+	 * 注册时间 
 	 */
 	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	private Date registerTime;
 
 	/**
-	 * 审核时间
+	 * 审核时间 
 	 */
 	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	private Date judgeTime;
 
 	/**
-	 * 审核人ID
+	 * 审核人ID 
 	 */
-	private String personId;
+	private String personId;	
 
 	/**
-	 * 创建时间
+	 * 创建时间 
 	 */
 	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	private Date createTime;
 
 	/**
-	 * 创建人编号
+	 * 创建人编号 
 	 */
-	private String createBy;
+	private String createBy;	
 
 	/**
-	 * 创建人名称
+	 * 创建人名称 
 	 */
-	private String createName;
+	private String createName;	
 
 	/**
-	 * 更新时间
+	 * 更新时间 
 	 */
 	@DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
 	private Date updateTime;
 
 	/**
-	 * 更新人编号
+	 * 更新人编号 
 	 */
-	private String updateBy;
+	private String updateBy;	
 
 	/**
-	 * 更新人名称
+	 * 更新人名称 
 	 */
-	private String updateName;
+	private String updateName;	
 
 	/**
-	 * 删除状态(0=禁用,1=启用)
+	 * 删除状态(0=禁用,1=启用) 
 	 */
-	private Integer deleteStatus;
+	private Integer deleteStatus;	
 
 	/**
-	 * 地方平台的内部业务编号,每次申请都是新编号
+	 * 地方平台的内部业务编号,每次申请都是新编号 
 	 */
-	private String platSeqNo;
+	private String platSeqNo;	
 
 	/**
-	 * 身份证有效期起,身份证有效期起必须小于身份证有效期止;格式:yyyy-MM-dd
+	 * 身份证有效期起,身份证有效期起必须小于身份证有效期止;格式:yyyy-MM-dd 
 	 */
 	@DateTimeFormat(pattern = "yyyy-MM-dd")
 	private Date startDate;
 
 	/**
-	 * 身份证有效期止,身份证有效期止必须大于身份证有效期起;格式:yyyy-MM-dd
+	 * 身份证有效期止,身份证有效期止必须大于身份证有效期起;格式:yyyy-MM-dd 
 	 */
 	@DateTimeFormat(pattern = "yyyy-MM-dd")
 	private Date endDate;
 
 	/**
-	 * 身份证发证机关
+	 * 身份证发证机关 
 	 */
-	private String idcdGcertPgoffNm;
+	private String idcdGcertPgoffNm;	
 
 	/**
-	 * 户籍地址
+	 * 户籍地址 
 	 */
-	private String birplAddr;
+	private String birplAddr;	
 
 	/**
-	 * 关区代码,参见关区代码表
+	 * 关区代码,参见关区代码表 
 	 */
-	private String customsCode;
+	private String customsCode;	
 
 	/**
-	 * 有 效 效 截 止 时 间yyyy-MM-dd
+	 * 有 效 效 截 止 时 间yyyy-MM-dd 
 	 */
 	@DateTimeFormat(pattern = "yyyy-MM-dd")
 	private Date expiry;
@@ -304,6 +304,10 @@ public class TbPeople extends Model<TbPeople> implements Serializable {
 
 
 
+	/**
+	 *  服务点
+	 */
+	private Double wallet;
 
 
 }

+ 1 - 1
sp-service/level-one-server/src/main/java/com/pj/tb_people/TbPeopleMapper.xml

@@ -17,7 +17,7 @@
 			   p.group_id, p.group_name, p.status, p.role, p.lng, p.lat, p.last_location, p.address, p.address_ids,
 			   p.detail_address, p.is_lock, p.left_price, p.judge_status, p.judge_content, p.register_time, p.judge_time,
 			   p.person_id, p.create_time, p.create_by, p.create_name, p.update_time, p.update_by, p.update_name,
-			   p.delete_status, p.trade_area_id, p.trade_area_name
+			   p.delete_status, p.trade_area_id, p.trade_area_name,p.wallet
 		from  tb_people p
 	</sql>
 

+ 157 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletAppController.java

@@ -0,0 +1,157 @@
+package com.pj.tb_wallet_record;
+
+
+import com.pj.current.dto.APPLoginUserInfo;
+import com.pj.current.satoken.StpAPPUserUtil;
+import com.pj.enummj.DeleteStatus;
+import com.pj.tb_order.TbOrder;
+import com.pj.tb_people.TbPeople;
+import com.pj.tb_people.TbPeopleService;
+import com.pj.tb_wallet_record.vo.WalletRecordAppVo;
+import com.pj.tb_wallet_topdown.TbWalletTopdown;
+import com.pj.tb_wallet_topdown.TbWalletTopdownService;
+import com.pj.tb_wallet_topup.TbWalletTopup;
+import com.pj.tb_wallet_topup.TbWalletTopupService;
+import com.pj.utils.sg.AjaxJson;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import java.util.List;
+
+
+
+/**
+ * Controller: tb_wallet_record -- 服务点交易记录
+ * @author plj
+ */
+@RestController
+@RequestMapping("/app/WalletManage/")
+public class TbWalletAppController {
+
+    /**
+     * 底层 Service 对象
+     */
+    @Autowired
+    TbWalletRecordService tbWalletRecordService;
+
+    /** 底层 Service 对象 */
+    @Autowired
+    TbWalletTopupService tbWalletTopupService;
+
+    /** 底层 Service 对象 */
+    @Autowired
+    TbWalletTopdownService tbWalletTopdownService;
+
+    /**
+     * 底层 Service 对象
+     */
+    @Autowired
+    TbPeopleService tbPeopleService;
+
+    /**
+     * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+     *
+     * @return
+     */
+    @RequestMapping("getList")
+    public AjaxJson getList() {
+        SoMap so = SoMap.getRequestSoMap();
+        if(StpAPPUserUtil.getAPPLoginInfo().getUserType() == 1){
+            List<WalletRecordAppVo> list = tbWalletRecordService.getAPPList(so.startPage());
+            if (list.size() == 0) return AjaxJson.getSuccess("暂无更多的订单消息!");
+            return AjaxJson.getPageData(so.getDataCount(), list);
+        }else{
+            return AjaxJson.getError("边民用户才能查看服务点交易记录!");
+        }
+    }
+
+
+    /** 查服务点充值 - 根据id */
+    @RequestMapping("getTopUpById")
+    public AjaxJson getTopUpById(Long id){
+        TbWalletTopup t = tbWalletTopupService.getById(id);
+        return AjaxJson.getSuccessData(t);
+    }
+
+
+    /** 查服务点提现- 根据id */
+    @RequestMapping("getTopDownById")
+    public AjaxJson getTopDownById(Long id){
+        TbWalletTopdown t = tbWalletTopdownService.getById(id);
+        return AjaxJson.getSuccessData(t);
+    }
+
+
+    /** 查服务点扣除 - 根据id */
+    @RequestMapping("getWalletRecordById")
+    public AjaxJson getWalletRecordById(Long id){
+        TbWalletRecord t = tbWalletRecordService.getById(id);
+        return AjaxJson.getSuccessData(t);
+    }
+    /*
+    * 服务点提现
+     */
+    @RequestMapping("topupSave")
+    public AjaxJson topupSave(@RequestParam("amount") Integer amount,@RequestParam("outTradeNo")String outTradeNo,@RequestParam("transactionId") String transactionId) {
+        //获取登录人
+        APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
+        TbWalletTopup tbWalletTopup = new TbWalletTopup();
+        Date date = new Date();
+        tbWalletTopup.setMchid("AAAAAA1111111111AAAAAA");
+        tbWalletTopup.setOutTradeNo(outTradeNo);
+        tbWalletTopup.setAmount(String.valueOf(amount/100));
+        tbWalletTopup.setTransactionId(transactionId);
+        tbWalletTopup.setPeopleId(appLoginInfo.getFk().toString());
+        tbWalletTopup.setTopupTime(date);
+        tbWalletTopup.setCreateTime(date);
+        tbWalletTopup.setCreateBy(appLoginInfo.getLoginId().toString());
+        tbWalletTopup.setCreateName(appLoginInfo.getLoginName());
+        tbWalletTopup.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
+        boolean ret=tbWalletTopupService.save(tbWalletTopup);
+        if(ret){
+            TbPeople tbPeople = tbPeopleService.getById(appLoginInfo.getFk());
+            tbPeople.setWallet(tbPeople.getWallet()+amount/100);
+            tbPeopleService.updateById(tbPeople);
+            return AjaxJson.getSuccess();
+        }else{
+            return AjaxJson.getError("操作失败!");
+        }
+    }
+
+    /*
+    * 服务点提现
+     */
+    @RequestMapping("topdownSave")
+    public AjaxJson topdownSave(@RequestParam("amount") Integer amount,@RequestParam("outTradeNo")String outTradeNo,@RequestParam("transactionId") String transactionId) {
+        //获取登录人
+        APPLoginUserInfo appLoginInfo = StpAPPUserUtil.getAPPLoginInfo();
+        TbPeople tbPeople = tbPeopleService.getById(appLoginInfo.getFk());
+        if(tbPeople.getWallet()<amount/100){
+            return AjaxJson.getError("余额不足!");
+        }
+        TbWalletTopdown tbWalletTopdown = new TbWalletTopdown();
+        Date date = new Date();
+        tbWalletTopdown.setMchid("AAAAAA1111111111AAAAAA");
+        tbWalletTopdown.setOutTradeNo(outTradeNo);
+        tbWalletTopdown.setAmount(String.valueOf(amount/100));
+        tbWalletTopdown.setTransactionId(transactionId);
+        tbWalletTopdown.setPeopleId(appLoginInfo.getFk().toString());
+        tbWalletTopdown.setTopdownTime(date);
+        tbWalletTopdown.setCreateTime(date);
+        tbWalletTopdown.setCreateBy(appLoginInfo.getLoginId().toString());
+        tbWalletTopdown.setCreateName(appLoginInfo.getLoginName());
+        tbWalletTopdown.setDeleteStatus(DeleteStatus.DELETE_STATUS_ON.getCode());
+        boolean ret=tbWalletTopdownService.save(tbWalletTopdown);
+        if(ret){
+            tbPeople.setWallet(tbPeople.getWallet()-amount/100);
+            tbPeopleService.updateById(tbPeople);
+            return AjaxJson.getSuccess();
+        }else{
+            return AjaxJson.getError("操作失败!");
+        }
+    }
+
+}

+ 136 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecord.java

@@ -0,0 +1,136 @@
+package com.pj.tb_wallet_record;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_wallet_record -- 服务点交易记录
+ * @author plj 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbWalletRecord.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbWalletRecord extends Model<TbWalletRecord> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_wallet_record";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-wallet-record";
+	public static final String PERMISSION_CODE_ADD = "tb-wallet-record-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-wallet-record-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-wallet-record-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 边民id 
+	 */
+	private String peopleId;	
+
+	/**
+	 * 交易前点数 
+	 */
+	private double beforeAmount;
+
+	/**
+	 * 交易后点数 
+	 */
+	private double afterAmount;
+
+	/**
+	 * 交易扣除点数 
+	 */
+	private String amount;
+
+	/**
+	 * 关联订单号主键
+	 */
+	private Long orderId;
+	/**
+	 * 关联订单号 
+	 */
+	private String tradeNo;	
+
+	/**
+	 * 关联商品id 
+	 */
+	private Long goodsId;	
+
+	/**
+	 * 关联商品名称 
+	 */
+	private String goodsNames;	
+
+	/**
+	 * 扣除时间 
+	 */
+	private Date recordTime;
+
+	/**
+	 * 创建人编号 
+	 */
+	private String createBy;	
+
+	/**
+	 * 创建人名称 
+	 */
+	private String createName;	
+
+	/**
+	 * 创建时间 
+	 */
+	private Date createTime;
+
+	/**
+	 * 更新人编号 
+	 */
+	private String updateBy;	
+
+	/**
+	 * 更新人名称 
+	 */
+	private String updateName;	
+
+	/**
+	 * 更新时间 
+	 */
+	private Date updateTime;
+
+	/**
+	 * 删除状态(0=禁用,1=启用) 
+	 */
+	private Integer deleteStatus;
+
+
+
+
+
+	
+
+
+}

+ 97 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecordController.java

@@ -0,0 +1,97 @@
+package com.pj.tb_wallet_record;
+
+import java.util.List;
+
+import com.pj.tb_wallet_record.vo.WalletRecordVo;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: tb_wallet_record -- 服务点交易记录
+ * @author plj 
+ */
+@RestController
+@RequestMapping("/TbWalletRecord/")
+public class TbWalletRecordController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbWalletRecordService tbWalletRecordService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbWalletRecord.PERMISSION_CODE_ADD)
+	public AjaxJson add(TbWalletRecord t){
+		tbWalletRecordService.add(t);
+		t = tbWalletRecordService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbWalletRecord.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 tbWalletRecordService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbWalletRecord.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbWalletRecord.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbWalletRecord.PERMISSION_CODE_EDIT)
+	public AjaxJson update(TbWalletRecord t){
+		tbWalletRecordService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(TbWalletRecord.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		TbWalletRecord t = tbWalletRecordService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(TbWalletRecord.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<WalletRecordVo> list = tbWalletRecordService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	/** 改 - 删除状态(0=禁用,1=启用) */  
+	@RequestMapping("updateDeleteStatus")
+	@SaCheckPermission(TbWalletRecord.PERMISSION_CODE_EDIT)
+	public AjaxJson updateDeleteStatus(Long id, String value){
+		int line = SP.publicMapper.updateColumnById(TbWalletRecord.TABLE_NAME, "delete_status", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+
+	
+	
+	
+
+}

+ 39 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecordMapper.java

@@ -0,0 +1,39 @@
+package com.pj.tb_wallet_record;
+
+import java.util.List;
+
+import com.pj.tb_order.TbOrder;
+import com.pj.tb_wallet_record.vo.WalletRecordAppVo;
+import com.pj.tb_wallet_record.vo.WalletRecordVo;
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: tb_wallet_record -- 服务点交易记录
+ * @author plj 
+ */
+
+@Mapper
+@Repository
+public interface TbWalletRecordMapper extends BaseMapper <TbWalletRecord> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<WalletRecordVo> getList(SoMap so);
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合
+	 * @return 数据列表
+	 */
+	List<WalletRecordAppVo> getAppList(SoMap so);
+}

+ 76 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecordMapper.xml

@@ -0,0 +1,76 @@
+<?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="com.pj.tb_wallet_record.TbWalletRecordMapper">
+
+
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.tb_wallet_record.vo.WalletRecordVo"></resultMap>
+
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select w.*,p.name as peopleName
+		from tb_wallet_record as w
+		left join tb_people as p on w.people_id = p.id
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and w.id = #{id} </if>
+			<if test=' this.has("peopleId") '> and w.people_id = #{peopleId} </if>
+			<if test=' this.has("beforeAmount") '> and w.before_amount = #{beforeAmount} </if>
+			<if test=' this.has("afterAmount") '> and w.after_amount = #{afterAmount} </if>
+			<if test=' this.has("amount") '> and w.amount = #{amount} </if>
+			<if test=' this.has("orderId") '> and w.order_id = #{orderId} </if>
+			<if test=' this.has("tradeNo") '> and w.trade_no = #{tradeNo} </if>
+			<if test=' this.has("goodsId") '> and w.goods_id = #{goodsId} </if>
+			<if test=' this.has("goodsNames") '> and w.goods_names = #{goodsNames} </if>
+			<if test=' this.has("recordTime") '> and w.record_time = #{recordTime} </if>
+			<if test=' this.has("createBy") '> and w.create_by = #{createBy} </if>
+			<if test=' this.has("createName") '> and w.create_name = #{createName} </if>
+			<if test=' this.has("createTime") '> and w.create_time = #{createTime} </if>
+			<if test=' this.has("updateBy") '> and w.update_by = #{updateBy} </if>
+			<if test=' this.has("updateName") '> and w.update_name = #{updateName} </if>
+			<if test=' this.has("updateTime") '> and w.update_time = #{updateTime} </if>
+			<if test=' this.has("deleteStatus") '> and w.delete_status = #{deleteStatus} </if>
+			<if test=' this.has("peopleName") '> and p.name = #{peopleName} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> people_id desc </when>
+			<when test='sortType == 3'> before_amount desc </when>
+			<when test='sortType == 4'> after_amount desc </when>
+			<when test='sortType == 5'> amount desc </when>
+			<when test='sortType == 6'> trade_no desc </when>
+			<when test='sortType == 7'> goods_id desc </when>
+			<when test='sortType == 8'> goods_names desc </when>
+			<when test='sortType == 9'> record_time desc </when>
+			<when test='sortType == 10'> create_by desc </when>
+			<when test='sortType == 11'> create_name desc </when>
+			<when test='sortType == 12'> create_time desc </when>
+			<when test='sortType == 13'> update_by desc </when>
+			<when test='sortType == 14'> update_name desc </when>
+			<when test='sortType == 15'> update_time desc </when>
+			<when test='sortType == 16'> delete_status desc </when>
+			<otherwise> id desc </otherwise>
+		</choose>
+	</select>
+
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getAppList" resultType="com.pj.tb_wallet_record.vo.WalletRecordAppVo">
+		select w.*,p.name as peopleName
+		from v_wallet_record as w
+		left join tb_people as p on w.people_id = p.id
+		<where>
+			<if test=' this.has("peopleId") '> and w.people_id = #{peopleId} </if>
+			<if test=' this.has("peopleName") '> and p.name = #{peopleName} </if>
+			<if test=' this.has("tagType") '> and w.tag_type = #{tagType} </if>
+		</where>
+		order by  record_time desc
+	</select>
+	
+
+</mapper>

+ 71 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/TbWalletRecordService.java

@@ -0,0 +1,71 @@
+package com.pj.tb_wallet_record;
+
+import java.util.List;
+
+import com.pj.current.dto.APPLoginUserInfo;
+import com.pj.current.satoken.StpAPPUserUtil;
+import com.pj.tb_order.TbOrder;
+import com.pj.tb_wallet_record.vo.WalletRecordAppVo;
+import com.pj.tb_wallet_record.vo.WalletRecordVo;
+import com.pj.utils.so.SoMap;
+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;
+
+/**
+ * Service: tb_wallet_record -- 服务点交易记录
+ * @author plj 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbWalletRecordService extends ServiceImpl<TbWalletRecordMapper, TbWalletRecord> implements IService<TbWalletRecord>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbWalletRecordMapper tbWalletRecordMapper;
+
+	/** 增 */
+	void add(TbWalletRecord t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbWalletRecord t){
+		updateById(t);
+
+	}
+
+	/** 查 */
+	TbWalletRecord getById(Long id){
+		//return super.getById(id);
+		List<WalletRecordVo> listObj=tbWalletRecordMapper.getList(new SoMap().set("id",id));
+		if(listObj!=null && listObj.size()>0) {
+			return listObj.get(0);
+		}else {
+			return  null;
+		}
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<WalletRecordVo> getList(SoMap so) {
+		return tbWalletRecordMapper.getList(so);
+	}
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * APP专用 获取服务点关联记录包括充值、提现、扣除
+	 *
+	 * @param so
+	 * @return
+	 */
+	List<WalletRecordAppVo> getAPPList(SoMap so) {
+		return tbWalletRecordMapper.getAppList(so);
+	}
+}

+ 40 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/vo/WalletRecordAppVo.java

@@ -0,0 +1,40 @@
+package com.pj.tb_wallet_record.vo;
+
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import lombok.Data;
+
+@Data
+public class WalletRecordAppVo {
+    /**
+     * 主键
+     */
+    @TableId(type = IdType.AUTO)
+    private Long id;
+
+    /**
+     * 标签类型(0=全部,1=充值,2=提现,3=扣除)
+     */
+    private String tagType;
+
+
+    /**
+     * 支标签类型名称
+     */
+    private String tagTypeName;
+
+    /**
+     * 边民id
+     */
+    private String peopleId;
+
+    /**
+     * 交易扣除点数
+     */
+    private String amount;
+
+    /**
+     * 扣除时间
+     */
+    private String recordTime;
+}

+ 18 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_record/vo/WalletRecordVo.java

@@ -0,0 +1,18 @@
+package com.pj.tb_wallet_record.vo;
+
+import com.pj.tb_wallet_record.TbWalletRecord;
+import lombok.Data;
+
+/**
+ * Model: tb_wallet_record -- 服务点交易记录
+ * @author plj
+ */
+@Data
+public class WalletRecordVo extends TbWalletRecord {
+
+
+    /**
+     * 边民姓名
+     */
+    private String peopleName;
+}

+ 122 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdown.java

@@ -0,0 +1,122 @@
+package com.pj.tb_wallet_topdown;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_wallet_topdown -- 服务点提现记录
+ * @author plj 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbWalletTopdown.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbWalletTopdown extends Model<TbWalletTopdown> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_wallet_topdown";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-wallet-topdown";
+	public static final String PERMISSION_CODE_ADD = "tb-wallet-topdown-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-wallet-topdown-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-wallet-topdown-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 边民id 
+	 */
+	private String peopleId;	
+
+	/**
+	 * 商户号 
+	 */
+	private String mchid;	
+
+	/**
+	 * 商户系统内部订单号 
+	 */
+	private String outTradeNo;	
+
+	/**
+	 * 微信支付系统生成的订单号 
+	 */
+	private String transactionId;	
+
+	/**
+	 * 提现金额 
+	 */
+	private String amount;	
+
+	/**
+	 * 提现时间 
+	 */
+	private Date topdownTime;
+
+	/**
+	 * 创建时间 
+	 */
+	private Date createTime;
+
+	/**
+	 * 创建人编号 
+	 */
+	private String createBy;	
+
+	/**
+	 * 创建人名称 
+	 */
+	private String createName;	
+
+	/**
+	 * 更新时间 
+	 */
+	private Date updateTime;
+
+	/**
+	 * 更新人编号 
+	 */
+	private String updateBy;	
+
+	/**
+	 * 更新人名称 
+	 */
+	private String updateName;	
+
+	/**
+	 * 删除状态(0=禁用,1=启用) 
+	 */
+	private Integer deleteStatus;	
+
+
+
+
+
+	
+
+
+}

+ 87 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdownController.java

@@ -0,0 +1,87 @@
+package com.pj.tb_wallet_topdown;
+
+import java.util.List;
+import com.pj.tb_wallet_topdown.vo.WalletTopdownVo;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: tb_wallet_topdown -- 服务点提现记录
+ * @author plj 
+ */
+@RestController
+@RequestMapping("/TbWalletTopdown/")
+public class TbWalletTopdownController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbWalletTopdownService tbWalletTopdownService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbWalletTopdown.PERMISSION_CODE_ADD)
+	public AjaxJson add(TbWalletTopdown t){
+		tbWalletTopdownService.add(t);
+		t = tbWalletTopdownService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbWalletTopdown.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 tbWalletTopdownService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbWalletTopdown.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbWalletTopdown.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbWalletTopdown.PERMISSION_CODE_EDIT)
+	public AjaxJson update(TbWalletTopdown t){
+		tbWalletTopdownService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(TbWalletTopdown.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		TbWalletTopdown t = tbWalletTopdownService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(TbWalletTopdown.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<WalletTopdownVo> list = tbWalletTopdownService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	/** 改 - 删除状态(0=禁用,1=启用) */  
+	@RequestMapping("updateDeleteStatus")
+	@SaCheckPermission(TbWalletTopdown.PERMISSION_CODE_EDIT)
+	public AjaxJson updateDeleteStatus(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbWalletTopdown.TABLE_NAME, "delete_status", value, id);
+		return AjaxJson.getByLine(line);
+	}
+
+
+}

+ 29 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdownMapper.java

@@ -0,0 +1,29 @@
+package com.pj.tb_wallet_topdown;
+
+import java.util.List;
+import com.pj.tb_wallet_topdown.vo.WalletTopdownVo;
+import org.apache.ibatis.annotations.Mapper;
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+/**
+ * Mapper: tb_wallet_topdown -- 服务点提现记录
+ * @author plj 
+ */
+
+@Mapper
+@Repository
+public interface TbWalletTopdownMapper extends BaseMapper <TbWalletTopdown> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<WalletTopdownVo> getList(SoMap so);
+
+
+}

+ 71 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdownMapper.xml

@@ -0,0 +1,71 @@
+<?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="com.pj.tb_wallet_topdown.TbWalletTopdownMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, people_id, mchid, out_trade_no, transaction_id, amount, topdown_time, create_time, create_by, create_name, update_time, update_by, update_name, delete_status from tb_wallet_topdown  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.tb_wallet_topdown.vo.WalletTopdownVo"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select w.*,p.name as peopleName
+		from tb_wallet_topdown as w
+		left join tb_people as p on w.people_id = p.id
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and w.id = #{id} </if>
+			<if test=' this.has("peopleId") '> and w.people_id = #{peopleId} </if>
+			<if test=' this.has("mchid") '> and w.mchid = #{mchid} </if>
+			<if test=' this.has("outTradeNo") '> and w.out_trade_no = #{outTradeNo} </if>
+			<if test=' this.has("transactionId") '> and w.transaction_id = #{transactionId} </if>
+			<if test=' this.has("amount") '> and w.amount = #{amount} </if>
+			<if test=' this.has("topdownTime") '> and w.topdown_time = #{topdownTime} </if>
+			<if test=' this.has("createTime") '> and w.create_time = #{createTime} </if>
+			<if test=' this.has("createBy") '> and w.create_by = #{createBy} </if>
+			<if test=' this.has("createName") '> and w.create_name = #{createName} </if>
+			<if test=' this.has("updateTime") '> and w.update_time = #{updateTime} </if>
+			<if test=' this.has("updateBy") '> and w.update_by = #{updateBy} </if>
+			<if test=' this.has("updateName") '> and w.update_name = #{updateName} </if>
+			<if test=' this.has("deleteStatus") '> and w.delete_status = #{deleteStatus} </if>
+			<if test=' this.has("peopleName") '> and p.name = #{peopleName} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> people_id desc </when>
+			<when test='sortType == 3'> mchid desc </when>
+			<when test='sortType == 4'> out_trade_no desc </when>
+			<when test='sortType == 5'> transaction_id desc </when>
+			<when test='sortType == 6'> amount desc </when>
+			<when test='sortType == 7'> topdown_time desc </when>
+			<when test='sortType == 8'> create_time desc </when>
+			<when test='sortType == 9'> create_by desc </when>
+			<when test='sortType == 10'> create_name desc </when>
+			<when test='sortType == 11'> update_time desc </when>
+			<when test='sortType == 12'> update_by desc </when>
+			<when test='sortType == 13'> update_name desc </when>
+			<when test='sortType == 14'> delete_status desc </when>
+			<otherwise> topdown_time desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 55 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/TbWalletTopdownService.java

@@ -0,0 +1,55 @@
+package com.pj.tb_wallet_topdown;
+
+import java.util.List;
+import com.pj.utils.so.SoMap;
+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 com.pj.tb_wallet_topdown.vo.WalletTopdownVo;
+/**
+ * Service: tb_wallet_topdown -- 服务点提现记录
+ * @author plj 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbWalletTopdownService extends ServiceImpl<TbWalletTopdownMapper, TbWalletTopdown> implements IService<TbWalletTopdown>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbWalletTopdownMapper tbWalletTopdownMapper;
+
+	/** 增 */
+	void add(TbWalletTopdown t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbWalletTopdown t){
+		updateById(t);
+
+	}
+
+	/** 查 */
+	TbWalletTopdown getById(Long id){
+		List<WalletTopdownVo> listObj=tbWalletTopdownMapper.getList(new SoMap().set("id",id));
+		if(listObj!=null && listObj.size()>0) {
+			return listObj.get(0);
+		}else {
+			return  null;
+		}
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<WalletTopdownVo> getList(SoMap so) { 
+		return tbWalletTopdownMapper.getList(so);	
+	}
+	
+
+}

+ 17 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topdown/vo/WalletTopdownVo.java

@@ -0,0 +1,17 @@
+package com.pj.tb_wallet_topdown.vo;
+
+import com.pj.tb_wallet_topdown.TbWalletTopdown;
+import lombok.Data;
+
+/**
+ * Model: tb_wallet_topdown -- 服务点提现记录
+ * @author plj
+ */
+@Data
+public class WalletTopdownVo extends TbWalletTopdown {
+
+    /**
+     * 边民姓名
+     */
+    private String peopleName;
+}

+ 122 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopup.java

@@ -0,0 +1,122 @@
+package com.pj.tb_wallet_topup;
+
+import java.io.Serializable;
+import java.util.Date;
+
+import com.baomidou.mybatisplus.annotation.*;
+import com.baomidou.mybatisplus.extension.activerecord.Model;
+import lombok.EqualsAndHashCode;
+
+import lombok.Data;
+import lombok.experimental.Accessors;
+
+/**
+ * Model: tb_wallet_topup -- 服务点充值记录
+ * @author plj 
+ */
+@Data
+@Accessors(chain = true)
+@TableName(TbWalletTopup.TABLE_NAME)
+@EqualsAndHashCode(callSuper = false)
+public class TbWalletTopup extends Model<TbWalletTopup> implements Serializable {
+
+	// ---------- 模块常量 ----------
+	/**
+	 * 序列化版本id 
+	 */
+	private static final long serialVersionUID = 1L;	
+	/**
+	 * 此模块对应的表名 
+	 */
+	public static final String TABLE_NAME = "tb_wallet_topup";	
+	/**
+	 * 此模块对应的权限码 
+	 */
+	public static final String PERMISSION_CODE = "tb-wallet-topup";
+	public static final String PERMISSION_CODE_ADD = "tb-wallet-topup-add";
+	public static final String PERMISSION_CODE_EDIT = "tb-wallet-topup-edit";
+	public static final String PERMISSION_CODE_DEL = "tb-wallet-topup-del";
+
+
+
+
+	// ---------- 表中字段 ----------
+	/**
+	 * 主键 
+	 */
+	@TableId(type = IdType.AUTO)
+	private Long id;	
+
+	/**
+	 * 边民id 
+	 */
+	private String peopleId;	
+
+	/**
+	 * 商户号 
+	 */
+	private String mchid;	
+
+	/**
+	 * 商户系统内部订单号 
+	 */
+	private String outTradeNo;	
+
+	/**
+	 * 微信支付系统生成的订单号 
+	 */
+	private String transactionId;	
+
+	/**
+	 * 充值金额 
+	 */
+	private String amount;	
+
+	/**
+	 * 充值时间 
+	 */
+	private Date topupTime;
+
+	/**
+	 * 创建时间 
+	 */
+	private Date createTime;
+
+	/**
+	 * 创建人编号 
+	 */
+	private String createBy;	
+
+	/**
+	 * 创建人名称 
+	 */
+	private String createName;	
+
+	/**
+	 * 更新时间 
+	 */
+	private Date updateTime;
+
+	/**
+	 * 更新人编号 
+	 */
+	private String updateBy;	
+
+	/**
+	 * 更新人名称 
+	 */
+	private String updateName;	
+
+	/**
+	 * 删除状态(0=禁用,1=启用) 
+	 */
+	private Integer deleteStatus;	
+
+
+
+
+
+	
+
+
+}

+ 97 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopupController.java

@@ -0,0 +1,97 @@
+package com.pj.tb_wallet_topup;
+
+import java.util.List;
+
+import com.pj.tb_wallet_topup.vo.ValletTopupVo;
+import com.pj.utils.so.SoMap;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.*;
+
+import com.pj.utils.sg.*;
+import com.pj.project4sp.SP;
+
+import com.pj.current.satoken.StpUserUtil;
+import cn.dev33.satoken.annotation.SaCheckPermission;
+
+
+/**
+ * Controller: tb_wallet_topup -- 服务点充值记录
+ * @author plj 
+ */
+@RestController
+@RequestMapping("/TbWalletTopup/")
+public class TbWalletTopupController {
+
+	/** 底层 Service 对象 */
+	@Autowired
+	TbWalletTopupService tbWalletTopupService;
+
+	/** 增 */  
+	@RequestMapping("add")
+	@SaCheckPermission(TbWalletTopup.PERMISSION_CODE_ADD)
+	public AjaxJson add(TbWalletTopup t){
+		tbWalletTopupService.add(t);
+		t = tbWalletTopupService.getById(SP.publicMapper.getPrimarykey());
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 删 */  
+	@RequestMapping("delete")
+	@SaCheckPermission(TbWalletTopup.PERMISSION_CODE_DEL)
+	public AjaxJson delete(Long id){
+		 tbWalletTopupService.delete(id);
+		return AjaxJson.getSuccess();
+	}
+	
+	/** 删 - 根据id列表 */  
+	@RequestMapping("deleteByIds")
+	@SaCheckPermission(TbWalletTopup.PERMISSION_CODE_DEL)
+	public AjaxJson deleteByIds(){
+		List<Long> ids = SoMap.getRequestSoMap().getListByComma("ids", long.class); 
+		int line = SP.publicMapper.deleteByIds(TbWalletTopup.TABLE_NAME, ids);
+		return AjaxJson.getByLine(line);
+	}
+	
+	/** 改 */  
+	@RequestMapping("update")
+	@SaCheckPermission(TbWalletTopup.PERMISSION_CODE_EDIT)
+	public AjaxJson update(TbWalletTopup t){
+		tbWalletTopupService.update(t);
+		return AjaxJson.getSuccess();
+	}
+
+	/** 查 - 根据id */  
+	@RequestMapping("getById")
+		@SaCheckPermission(TbWalletTopup.PERMISSION_CODE)
+	public AjaxJson getById(Long id){
+		ValletTopupVo t = tbWalletTopupService.getById(id);
+		return AjaxJson.getSuccessData(t);
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	@RequestMapping("getList")
+		@SaCheckPermission(TbWalletTopup.PERMISSION_CODE)
+	public AjaxJson getList() { 
+		SoMap so = SoMap.getRequestSoMap();
+		List<ValletTopupVo> list = tbWalletTopupService.getList(so.startPage());
+		return AjaxJson.getPageData(so.getDataCount(), list);
+	}
+	
+	
+	
+	/** 改 - 删除状态(0=禁用,1=启用) */  
+	@RequestMapping("updateDeleteStatus")
+	@SaCheckPermission(TbWalletTopup.PERMISSION_CODE_EDIT)
+	public AjaxJson updateDeleteStatus(Long id, Integer value){
+		int line = SP.publicMapper.updateColumnById(TbWalletTopup.TABLE_NAME, "delete_status", value, id);
+		return AjaxJson.getByLine(line);
+	}
+	
+	
+
+	
+	
+	
+
+}

+ 32 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopupMapper.java

@@ -0,0 +1,32 @@
+package com.pj.tb_wallet_topup;
+
+import com.pj.tb_wallet_topup.vo.ValletTopupVo;
+
+import org.apache.ibatis.annotations.Mapper;
+
+import com.pj.utils.so.*;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * Mapper: tb_wallet_topup -- 服务点充值记录
+ * @author plj 
+ */
+
+@Mapper
+@Repository
+public interface TbWalletTopupMapper extends BaseMapper <TbWalletTopup> {
+
+
+
+	/**
+	 * 查集合 - 根据条件(参数为空时代表忽略指定条件)
+	 * @param so 参数集合 
+	 * @return 数据列表 
+	 */
+	List<ValletTopupVo> getList(SoMap so);
+
+
+}

+ 71 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopupMapper.xml

@@ -0,0 +1,71 @@
+<?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="com.pj.tb_wallet_topup.TbWalletTopupMapper">
+
+
+
+
+	<!-- ================================== 查询相关 ================================== -->
+	<!-- select id, people_id, mchid, out_trade_no, transaction_id, amount, topup_time, create_time, create_by, create_name, update_time, update_by, update_name, delete_status from tb_wallet_topup  -->
+	
+	<!-- 通用映射:自动模式 -->
+	<resultMap id="model" autoMapping="true" type="com.pj.tb_wallet_topup.vo.ValletTopupVo"></resultMap>
+	
+	<!-- 公共查询sql片段 -->
+	<sql id="select_sql">
+		select w.*,p.name as peopleName
+		from tb_wallet_topup as w
+		left join tb_people as p on w.people_id = p.id
+	</sql>
+
+	
+	<!-- 查集合 - 根据条件(参数为空时代表忽略指定条件) [G] -->
+	<select id="getList" resultMap="model">
+		<include refid="select_sql"></include>
+		<where>
+			<if test=' this.has("id") '> and w.id = #{id} </if>
+			<if test=' this.has("peopleId") '> and w.people_id = #{peopleId} </if>
+			<if test=' this.has("mchid") '> and w.mchid = #{mchid} </if>
+			<if test=' this.has("outTradeNo") '> and w.out_trade_no = #{outTradeNo} </if>
+			<if test=' this.has("transactionId") '> and w.transaction_id = #{transactionId} </if>
+			<if test=' this.has("amount") '> and w.amount = #{amount} </if>
+			<if test=' this.has("topupTime") '> and w.topup_time = #{topupTime} </if>
+			<if test=' this.has("createTime") '> and w.create_time = #{createTime} </if>
+			<if test=' this.has("createBy") '> and w.create_by = #{createBy} </if>
+			<if test=' this.has("createName") '> and w.create_name = #{createName} </if>
+			<if test=' this.has("updateTime") '> and w.update_time = #{updateTime} </if>
+			<if test=' this.has("updateBy") '> and w.update_by = #{updateBy} </if>
+			<if test=' this.has("updateName") '> and w.update_name = #{updateName} </if>
+			<if test=' this.has("deleteStatus") '> and w.delete_status = #{deleteStatus} </if>
+			<if test=' this.has("peopleName") '> and p.name = #{peopleName} </if>
+		</where>
+		order by
+		<choose>
+			<when test='sortType == 1'> id desc </when>
+			<when test='sortType == 2'> people_id desc </when>
+			<when test='sortType == 3'> mchid desc </when>
+			<when test='sortType == 4'> out_trade_no desc </when>
+			<when test='sortType == 5'> transaction_id desc </when>
+			<when test='sortType == 6'> amount desc </when>
+			<when test='sortType == 7'> topup_time desc </when>
+			<when test='sortType == 8'> create_time desc </when>
+			<when test='sortType == 9'> create_by desc </when>
+			<when test='sortType == 10'> create_name desc </when>
+			<when test='sortType == 11'> update_time desc </when>
+			<when test='sortType == 12'> update_by desc </when>
+			<when test='sortType == 13'> update_name desc </when>
+			<when test='sortType == 14'> delete_status desc </when>
+			<otherwise> topup_time desc </otherwise>
+		</choose>
+	</select>
+	
+	
+	
+	
+	
+	
+	
+	
+	
+
+</mapper>

+ 57 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/TbWalletTopupService.java

@@ -0,0 +1,57 @@
+package com.pj.tb_wallet_topup;
+
+import com.pj.tb_wallet_topup.vo.ValletTopupVo;
+import com.pj.utils.so.SoMap;
+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.List;
+
+/**
+ * Service: tb_wallet_topup -- 服务点充值记录
+ * @author plj 
+ */
+@Service
+@Transactional(rollbackFor = Exception.class)
+public class TbWalletTopupService extends ServiceImpl<TbWalletTopupMapper, TbWalletTopup> implements IService<TbWalletTopup>{
+
+	/** 底层 Mapper 对象 */
+	@Autowired
+	TbWalletTopupMapper tbWalletTopupMapper;
+
+	/** 增 */
+	void add(TbWalletTopup t){
+		save(t);
+	}
+
+	/** 删 */
+	void delete(Long id){
+		removeById(id);
+	}
+
+	/** 改 */
+	void update(TbWalletTopup t){
+		updateById(t);
+
+	}
+
+	/** 查 */
+	ValletTopupVo getById(Long id){
+		List<ValletTopupVo> listObj=tbWalletTopupMapper.getList(new SoMap().set("id",id));
+		if(listObj!=null && listObj.size()>0) {
+			return listObj.get(0);
+		}else {
+			return  null;
+		}
+	}
+
+	/** 查集合 - 根据条件(参数为空时代表忽略指定条件) */  
+	List<ValletTopupVo> getList(SoMap so) {
+		return tbWalletTopupMapper.getList(so);	
+	}
+	
+
+}

+ 19 - 0
sp-service/level-one-server/src/main/java/com/pj/tb_wallet_topup/vo/ValletTopupVo.java

@@ -0,0 +1,19 @@
+package com.pj.tb_wallet_topup.vo;
+
+import com.pj.tb_wallet_topup.TbWalletTopup;
+import lombok.Data;
+
+/**
+ * Model: tb_wallet_topup -- 铺位
+ * @author plj
+ */
+@Data
+public class ValletTopupVo extends TbWalletTopup {
+
+
+    /**
+     * 边民姓名
+     */
+    private String peopleName;
+
+}