Commit e718b027 by yangjiarong

修复支付宝,微信回传v1.0.2-7_29

parent 13c91000
No preview for this file type
No preview for this file type
#Generated by Maven #Generated by Maven
#Thu Jul 28 21:02:31 CST 2022 #Fri Jul 29 19:03:45 CST 2022
version=1.0.2-snapshot version=1.0.2-snapshot
groupId=com.icloud.boot groupId=com.icloud.boot
artifactId=icloud-common artifactId=icloud-common
...@@ -21,11 +21,21 @@ class GoodsCache extends AbstractCache[Goodspaye]{ ...@@ -21,11 +21,21 @@ class GoodsCache extends AbstractCache[Goodspaye]{
val now = DateTime.now val now = DateTime.now
val day = now.withHourOfDay(0).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0); val day = now.withHourOfDay(0).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0);
val pays = gpr.getGoodsPaysByHour(now) val pays = gpr.getGoodsPaysByHour(now)
//过滤禁用的支付渠道
val goodspayes = new util.ArrayList[Goodspaye]() val goodspayes = new util.ArrayList[Goodspaye]()
pays.asScala.map(x=>{ pays.asScala.map(x=>{
val goodspaye = gpr.findByIdAndStatus(x.id, 0) var goodspaye = gpr.findByIdAndStatus(x.id, 0)
if(goodspaye!=null) if(goodspaye!=null) {
goodspaye.alipays= goodspaye.alipays.asScala.filter(x=>{
x.paystatus==0
}).toSet.asJava
goodspaye.wxpayes=goodspaye.wxpayes.asScala.filter(x=>{
x.paystatus==0
}).toSet.asJava
goodspayes.add(goodspaye) goodspayes.add(goodspaye)
}
}) })
goodsPayeList=goodspayes goodsPayeList=goodspayes
......
...@@ -64,6 +64,7 @@ class GoodsPayController1 { ...@@ -64,6 +64,7 @@ class GoodsPayController1 {
with JpaSpecificationExecutor[Goodspaye] with JpaRepository[Goodspaye, Long] with JpaSpecificationExecutor[Goodspaye] with JpaRepository[Goodspaye, Long]
with PagingAndSortingRepository[Goodspaye, Long] with GoodsPayDao{ with PagingAndSortingRepository[Goodspaye, Long] with GoodsPayDao{
def findByIdAndStatus(id:Long,status:Int):Goodspaye def findByIdAndStatus(id:Long,status:Int):Goodspaye
// def findBySubjectLikeAndStatusAndUseridOrderById(subject: String,status:Int,userid: Long) :util.List[Goodspaye] // def findBySubjectLikeAndStatusAndUseridOrderById(subject: String,status:Int,userid: Long) :util.List[Goodspaye]
...@@ -330,7 +331,7 @@ class Alipaye{ ...@@ -330,7 +331,7 @@ class Alipaye{
var alipaypublickey: String = _ var alipaypublickey: String = _
@BeanProperty @BeanProperty
@Column(name = "paystatus") @Column(name = "paystatus")
var paystate: Int = _ var paystatus: Int = _
@BeanProperty @BeanProperty
@Column var status: Int = _ @Column var status: Int = _
@BeanProperty @BeanProperty
...@@ -377,7 +378,7 @@ class Wxpaye{ ...@@ -377,7 +378,7 @@ class Wxpaye{
var mchkey: String = _ var mchkey: String = _
@BeanProperty @BeanProperty
@Column(name = "paystatus") @Column(name = "paystatus")
var paystate: Int = _ var paystatus: Int = _
@BeanProperty @BeanProperty
@Column @Column
var weight: Int = _ var weight: Int = _
......
...@@ -89,7 +89,7 @@ class GoodsController { ...@@ -89,7 +89,7 @@ class GoodsController {
val count1 = gr.countBySubject(name) val count1 = gr.countBySubject(name)
val count = gr.countBySubjectLikeAndStatusAndParentAndUseridOrderByGoodsid("%" + name + "%", 0, 1, uid) val count = gr.countBySubjectLikeAndStatusAndParentAndUseridOrderByGoodsid("%" + name + "%", 0, 1, uid)
val list = gr.findBySubjectLikeAndStatusAndParentAndUseridOrderByGoodsid("%" + name + "%", 0, 1, uid,request) val list = gr.findBySubjectLikeAndStatusAndParentAndUseridOrderByGoodsidDesc("%" + name + "%", 0, 1, uid,request)
new JsonResult(new Findbylikename(count,list)) new JsonResult(new Findbylikename(count,list))
} }
...@@ -152,6 +152,7 @@ class GoodsController { ...@@ -152,6 +152,7 @@ class GoodsController {
var goodspayidss = new IdWorker().nextId() var goodspayidss = new IdWorker().nextId()
goodspay.goodspayditch.map(x => { goodspay.goodspayditch.map(x => {
x.goodspayid = goodspayidss x.goodspayid = goodspayidss
x.goodsid=goodspay.goodsid
createGoodspayditch(x) createGoodspayditch(x)
}) })
...@@ -195,6 +196,7 @@ class GoodsController { ...@@ -195,6 +196,7 @@ class GoodsController {
def upGoodspayditch(gd: UpGoodspayditchReq, goodsid: Long, goodspayid: Long): Unit = { def upGoodspayditch(gd: UpGoodspayditchReq, goodsid: Long, goodspayid: Long): Unit = {
// 删除渠道信息 // 删除渠道信息
val goodspayditch = gpdr.findByIdAndStatus(gd.id, 0) val goodspayditch = gpdr.findByIdAndStatus(gd.id, 0)
if(goodspayditch==null) throw new RuntimeException("请刷新页面,再更新")
goodspayditch.setStatus(1) goodspayditch.setStatus(1)
gpdr.save(goodspayditch) gpdr.save(goodspayditch)
...@@ -242,7 +244,7 @@ class GoodsController { ...@@ -242,7 +244,7 @@ class GoodsController {
var value= goodses.asScala.filter(x=>{ var value= goodses.asScala.filter(x=>{
x.goodspayditch=x.goodspayditch.asScala.filter(_.status==0).asJava x.goodspayditch=x.goodspayditch.asScala.filter(_.status==0).asJava
true true
}).asJava }).toList.asJava
new JsonResult(value) new JsonResult(value)
} }
...@@ -328,7 +330,7 @@ class GoodsController { ...@@ -328,7 +330,7 @@ class GoodsController {
// def findBySubjectLikeAndStatusAndParentOrderByGoodsid(subject: String,status:Int,parent: Int) :util.List[Goods] // def findBySubjectLikeAndStatusAndParentOrderByGoodsid(subject: String,status:Int,parent: Int) :util.List[Goods]
def countBySubjectLikeAndStatusAndParentAndUseridOrderByGoodsid(subject: String, status: Int, parent: Int, userid: Long): Long def countBySubjectLikeAndStatusAndParentAndUseridOrderByGoodsid(subject: String, status: Int, parent: Int, userid: Long): Long
def findBySubjectLikeAndStatusAndParentAndUseridOrderByGoodsid(subject: String, status: Int, parent: Int, userid: Long,pageable: Pageable): java.util.List[Goods] def findBySubjectLikeAndStatusAndParentAndUseridOrderByGoodsidDesc(subject: String, status: Int, parent: Int, userid: Long,pageable: Pageable): java.util.List[Goods]
def findBySubjectLike(subject: String): java.util.List[Goods] def findBySubjectLike(subject: String): java.util.List[Goods]
...@@ -383,6 +385,15 @@ class Goods extends Serializable { ...@@ -383,6 +385,15 @@ class Goods extends Serializable {
@BeanProperty @BeanProperty
@Column @Column
var price: Long = _ var price: Long = _
@BeanProperty
@Column
var sellcount: Long = _
@BeanProperty
@Column
var sellamount: Long = _
@BeanProperty @BeanProperty
@Column(name = "marking_price") @Column(name = "marking_price")
var markingprice: Long = _ var markingprice: Long = _
...@@ -717,7 +728,7 @@ case class GoodspayCase(@JsonProperty("goodsid") goodsid: Long, ...@@ -717,7 +728,7 @@ case class GoodspayCase(@JsonProperty("goodsid") goodsid: Long,
@ApiModel(description = "创建商品橱窗") @ApiModel(description = "创建商品橱窗")
case class GoodspayditchCase( case class GoodspayditchCase(
@(ApiModelProperty@field)(position = 1, example = "1232", value = "goodsid") @JsonProperty("goodsid") goodsid: Long, @(ApiModelProperty@field)(position = 1, example = "1232", value = "goodsid") @JsonProperty("goodsid") var goodsid: Long,
@ApiIgnore() @(ApiModelProperty@field)(position = 1, example = "1232", value = "goodspayid") @JsonProperty("goodspayid") var goodspayid: Long, @ApiIgnore() @(ApiModelProperty@field)(position = 1, example = "1232", value = "goodspayid") @JsonProperty("goodspayid") var goodspayid: Long,
@(ApiModelProperty@field)(position = 1, example = "1232", value = "payname") @JsonProperty("payname") payname: String, @(ApiModelProperty@field)(position = 1, example = "1232", value = "payname") @JsonProperty("payname") payname: String,
@(ApiModelProperty@field)(position = 1, example = "1232", value = "optpay") @JsonProperty("optpay") optpay: Long, @(ApiModelProperty@field)(position = 1, example = "1232", value = "optpay") @JsonProperty("optpay") optpay: Long,
......
...@@ -104,11 +104,13 @@ class Goodspay2 extends Serializable { ...@@ -104,11 +104,13 @@ class Goodspay2 extends Serializable {
@Column var UPDATETIME: Date = _ @Column var UPDATETIME: Date = _
//多对一 //多对一
@ManyToOne(fetch = FetchType.EAGER) // @ManyToOne(fetch = FetchType.EAGER)
@Fetch(FetchMode.JOIN) // @Fetch(FetchMode.JOIN)
// @JoinColumn(name = "goods_id")
// var goods2: Goods2 = _
@BeanProperty
@JoinColumn(name = "goods_id") @JoinColumn(name = "goods_id")
var goods2: Goods2 = _ @OneToOne(fetch = FetchType.EAGER, cascade = Array(CascadeType.ALL)) var goods: Goods2 = _
// @BeanProperty // @BeanProperty
// @JoinColumn( name = "ditch_id" ) // @JoinColumn( name = "ditch_id" )
// @OneToOne( fetch = FetchType.EAGER, cascade = Array( CascadeType.ALL ) ) var goodspayditch2: Goodspayditch2 = _ // @OneToOne( fetch = FetchType.EAGER, cascade = Array( CascadeType.ALL ) ) var goodspayditch2: Goodspayditch2 = _
...@@ -204,6 +206,12 @@ class Goods2 extends Serializable { ...@@ -204,6 +206,12 @@ class Goods2 extends Serializable {
@Column @Column
var price: Long = _ var price: Long = _
@BeanProperty @BeanProperty
@Column
var sellcount: Long = _
@BeanProperty
@Column
var sellamount: Long = _
@BeanProperty
@Column(name = "marking_price") @Column(name = "marking_price")
var markingprice: Long = _ var markingprice: Long = _
@BeanProperty @BeanProperty
......
package com.icloud.server.scala.pay package com.icloud.server.scala.pay
import com.fasterxml.jackson.annotation.JsonProperty import com.fasterxml.jackson.annotation.JsonProperty
import com.icloud.server.scala.goods.GoodspayditchCase
import com.icloud.server.web.err.{ErrorCode, GlobalErrorCodeConstants, ServerException, ServiceException} import com.icloud.server.web.err.{ErrorCode, GlobalErrorCodeConstants, ServerException, ServiceException}
import com.icloud.server.web.json.JsonResult import com.icloud.server.web.json.JsonResult
import io.swagger.annotations._ import io.swagger.annotations._
...@@ -53,12 +54,10 @@ class PayController { ...@@ -53,12 +54,10 @@ class PayController {
x.privatekey=xxx(x.privatekey) x.privatekey=xxx(x.privatekey)
x.appid=x.appid x.appid=x.appid
true true
}).asJava }).reverse.asJava
}else null }else null
val res = alipays.asScala.reverse.asJava new JsonResult(alipays)
new JsonResult(res)
} }
@ApiOperation(value = "在支付配制中查询微信渠道信息", notes = "") @ApiOperation(value = "在支付配制中查询微信渠道信息", notes = "")
...@@ -75,11 +74,11 @@ class PayController { ...@@ -75,11 +74,11 @@ class PayController {
x.mchid=x.mchid x.mchid=x.mchid
x.mchkey=xxx(x.mchkey) x.mchkey=xxx(x.mchkey)
true true
}).asJava }).reverse.asJava
}else null }else null
val res = wxpays.asScala.reverse.asJava
new JsonResult(res) new JsonResult(wxpays)
} }
...@@ -98,7 +97,8 @@ class PayController { ...@@ -98,7 +97,8 @@ class PayController {
x.appid=x.appid x.appid=x.appid
true true
}).asJava }).asJava
}else null //util.List[Alipay1]
}else new util.ArrayList[Alipay1]()
val alipay = new Alipay1() val alipay = new Alipay1()
alipay.setId(0) alipay.setId(0)
alipay.setName("默认") alipay.setName("默认")
...@@ -124,7 +124,19 @@ class PayController { ...@@ -124,7 +124,19 @@ class PayController {
x.mchkey=xxx(x.mchkey) x.mchkey=xxx(x.mchkey)
true true
}).asJava }).asJava
}else null }else new util.ArrayList[Wxpay1]()
// @(ApiModelProperty@field)(position = 1, example = "1232", value = "goodsid") @JsonProperty("goodsid") goodsid: Long,
// @ApiIgnore() @(ApiModelProperty@field)(position = 1, example = "1232", value = "goodspayid") @JsonProperty("goodspayid") var goodspayid: Long,
// @(ApiModelProperty@field)(position = 1, example = "1232", value = "payname") @JsonProperty("payname") payname: String,
// @(ApiModelProperty@field)(position = 1, example = "1232", value = "optpay") @JsonProperty("optpay") optpay: Long,
// @(ApiModelProperty@field)(position = 1, example = "1232", value = "random") @JsonProperty("random") random: String,
// @(ApiModelProperty@field)(position = 1, example = "1232", value = "appointpay") @JsonProperty("appointpay") appointpay: Long,
// @(ApiModelProperty@field)(position = 1, example = "1232", value = "status") @JsonProperty("status") status: Int)
// wxpays.asScala.map(x=>{
//
// })
// new GoodspayditchCase()
val wxpay = new Wxpay1() val wxpay = new Wxpay1()
wxpay.setId(0) wxpay.setId(0)
wxpay.setName("默认") wxpay.setName("默认")
...@@ -309,13 +321,44 @@ class PayController { ...@@ -309,13 +321,44 @@ class PayController {
} }
new JsonResult() new JsonResult()
} }
@ApiOperation(value = "禁用支付宝渠道信息", notes = "")
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "req", value = "删除支付实体类", required = true, dataType = "DelPayReq")
))
@PostMapping(Array("DisableAli"))
@ResponseBody
def disable_ali(@RequestBody req:DelPayReq): JsonResult ={
val ali = ar1.findById(req.payid).orElseGet(null)
if (ali!=null) {
ali.paystate=if(ali.paystate ==1) 0 else 1
ar1.save(ali)
}
new JsonResult("ok")
}
@ApiOperation(value = "禁用微信渠道信息", notes = "")
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "req", value = "删除支付实体类", required = true, dataType = "DelPayReq")
))
@PostMapping(Array("DisableWx"))
@ResponseBody
def disable_wx(@RequestBody req:DelPayReq): JsonResult ={
val wxpay = wr1.findById(req.payid).orElseGet(null)
if (wxpay!=null) {
wxpay.paystate=if(wxpay.paystate ==1) 0 else 1
wr1.save(wxpay)
}
new JsonResult("ok")
}
@ApiOperation(value = "删除支付宝渠道信息", notes = "") @ApiOperation(value = "删除支付宝渠道信息", notes = "")
@ApiImplicitParams(Array( @ApiImplicitParams(Array(
new ApiImplicitParam(name = "req", value = "删除支付实体类", required = true, dataType = "DelPayReq") new ApiImplicitParam(name = "req", value = "删除支付实体类", required = true, dataType = "DelPayReq")
)) ))
@PostMapping(Array("delali")) @PostMapping(Array("delali"))
@ResponseBody @ResponseBody
def del_ali(req:DelPayReq): JsonResult ={ def del_ali(@RequestBody req:DelPayReq): JsonResult ={
val ali = ar1.findById(req.payid).orElseGet(null) val ali = ar1.findById(req.payid).orElseGet(null)
if (ali!=null) { if (ali!=null) {
...@@ -330,7 +373,7 @@ class PayController { ...@@ -330,7 +373,7 @@ class PayController {
)) ))
@PostMapping(Array("delwx")) @PostMapping(Array("delwx"))
@ResponseBody @ResponseBody
def del_wx(req:DelPayReq): JsonResult ={ def del_wx(@RequestBody req:DelPayReq): JsonResult ={
val wxpay = wr1.findById(req.payid).orElseGet(null) val wxpay = wr1.findById(req.payid).orElseGet(null)
if (wxpay!=null) { if (wxpay!=null) {
wxpay.status = 1 wxpay.status = 1
...@@ -649,7 +692,9 @@ case class UpdateWxReq(@(ApiModelProperty@field)(position = 1, example = "1232", ...@@ -649,7 +692,9 @@ case class UpdateWxReq(@(ApiModelProperty@field)(position = 1, example = "1232",
@ApiModel(description = "支付参数") @ApiModel(description = "支付参数")
case class DelPayReq( @JsonProperty("uid") uid: Long,@JsonProperty("payid") payid: Long) case class DelPayReq(
@(ApiModelProperty@field)(position = 1, example = "1232", value = "权重")@JsonProperty("uid") uid: Long,
@(ApiModelProperty@field)(position = 1, example = "1232", value = "权重")@JsonProperty("payid") payid: Long)
case class Tt(@BeanProperty uid: String, @BeanProperty id: String) case class Tt(@BeanProperty uid: String, @BeanProperty id: String)
// x.name // x.name
......
...@@ -14,7 +14,8 @@ public class JWTUtil { ...@@ -14,7 +14,8 @@ public class JWTUtil {
private static final long EXPIRE_TIME = 60 * 24 * 60 * 1000; private static final long EXPIRE_TIME = 60 * 24 * 60 * 1000;
//private static final long EXPIRE_TIME = 1 * 1 * 60 * 1000; //private static final long EXPIRE_TIME = 1 * 1 * 60 * 1000;
// 密钥 // 密钥
private static final String SECRET = "OCCLOUD+JWT"; // private static final String SECRET = "OCCLOUD+JWT"; //ouchang
private static final String SECRET = "ouchang"; //
/** /**
* 生成 token, 5min后过期 * 生成 token, 5min后过期
......
package com.icloud.server.web.shiro.controller; package com.icloud.server.web.shiro.controller;
import com.icloud.server.web.JsonResult;
import io.swagger.annotations.Api;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore; import springfox.documentation.annotations.ApiIgnore;
/** /**
* logout, 映射shiro自带的过滤器 * logout, 映射shiro自带的过滤器
*/ */
//@CrossOrigin @CrossOrigin
@ApiIgnore
@RestController @RestController
@Api( tags = {"登陆,注册"} , value = "API" )
@RequestMapping("pub")
public class LogoutController { public class LogoutController {
// //
// //
// @RequestMapping("/logout") @RequestMapping("/logout")
// public JsonResult findMyPlayRecord() { public JsonResult findMyPlayRecord() {
//
// Subject subject = SecurityUtils.getSubject(); Subject subject = SecurityUtils.getSubject();
//
// if (subject.getPrincipals() != null) { if (subject.getPrincipals() != null) {
//
// } }
//
// SecurityUtils.getSubject().logout(); SecurityUtils.getSubject().logout();
//
// return new JsonResult("logout成功"); return new JsonResult("logout成功");
//
// } }
} }
#Generated by Maven #Generated by Maven
#Thu Jul 28 21:02:35 CST 2022 #Fri Jul 29 19:03:49 CST 2022
version=1.0.2-snapshot version=1.0.2-snapshot
groupId=com.icloud.boot groupId=com.icloud.boot
artifactId=icloud-pay artifactId=icloud-pay
#Generated by Maven #Generated by Maven
#Thu Jul 28 21:02:32 CST 2022 #Fri Jul 29 19:03:46 CST 2022
version=1.0.2-snapshot version=1.0.2-snapshot
groupId=com.icloud.boot groupId=com.icloud.boot
artifactId=icloud-web artifactId=icloud-web
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment