Commit a77b2a4c by liuliufashi
parents 222f1f7a e718b027
No preview for this file type
No preview for this file type
#Generated by Maven
#Thu Jul 28 21:02:31 CST 2022
#Fri Jul 29 19:03:45 CST 2022
version=1.0.2-snapshot
groupId=com.icloud.boot
artifactId=icloud-common
......@@ -21,11 +21,21 @@ class GoodsCache extends AbstractCache[Goodspaye]{
val now = DateTime.now
val day = now.withHourOfDay(0).withMinuteOfHour(0).withSecondOfMinute(0).withMillisOfSecond(0);
val pays = gpr.getGoodsPaysByHour(now)
//过滤禁用的支付渠道
val goodspayes = new util.ArrayList[Goodspaye]()
pays.asScala.map(x=>{
val goodspaye = gpr.findByIdAndStatus(x.id, 0)
if(goodspaye!=null)
goodspayes.add(goodspaye)
var goodspaye = gpr.findByIdAndStatus(x.id, 0)
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)
}
})
goodsPayeList=goodspayes
......
......@@ -64,6 +64,7 @@ class GoodsPayController1 {
with JpaSpecificationExecutor[Goodspaye] with JpaRepository[Goodspaye, Long]
with PagingAndSortingRepository[Goodspaye, Long] with GoodsPayDao{
def findByIdAndStatus(id:Long,status:Int):Goodspaye
// def findBySubjectLikeAndStatusAndUseridOrderById(subject: String,status:Int,userid: Long) :util.List[Goodspaye]
......@@ -330,7 +331,7 @@ class Alipaye{
var alipaypublickey: String = _
@BeanProperty
@Column(name = "paystatus")
var paystate: Int = _
var paystatus: Int = _
@BeanProperty
@Column var status: Int = _
@BeanProperty
......@@ -377,7 +378,7 @@ class Wxpaye{
var mchkey: String = _
@BeanProperty
@Column(name = "paystatus")
var paystate: Int = _
var paystatus: Int = _
@BeanProperty
@Column
var weight: Int = _
......
......@@ -89,7 +89,7 @@ class GoodsController {
val count1 = gr.countBySubject(name)
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))
}
......@@ -152,6 +152,7 @@ class GoodsController {
var goodspayidss = new IdWorker().nextId()
goodspay.goodspayditch.map(x => {
x.goodspayid = goodspayidss
x.goodsid=goodspay.goodsid
createGoodspayditch(x)
})
......@@ -195,6 +196,7 @@ class GoodsController {
def upGoodspayditch(gd: UpGoodspayditchReq, goodsid: Long, goodspayid: Long): Unit = {
// 删除渠道信息
val goodspayditch = gpdr.findByIdAndStatus(gd.id, 0)
if(goodspayditch==null) throw new RuntimeException("请刷新页面,再更新")
goodspayditch.setStatus(1)
gpdr.save(goodspayditch)
......@@ -242,7 +244,7 @@ class GoodsController {
var value= goodses.asScala.filter(x=>{
x.goodspayditch=x.goodspayditch.asScala.filter(_.status==0).asJava
true
}).asJava
}).toList.asJava
new JsonResult(value)
}
......@@ -328,7 +330,7 @@ class GoodsController {
// def findBySubjectLikeAndStatusAndParentOrderByGoodsid(subject: String,status:Int,parent: Int) :util.List[Goods]
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]
......@@ -383,6 +385,15 @@ class Goods extends Serializable {
@BeanProperty
@Column
var price: Long = _
@BeanProperty
@Column
var sellcount: Long = _
@BeanProperty
@Column
var sellamount: Long = _
@BeanProperty
@Column(name = "marking_price")
var markingprice: Long = _
......@@ -717,7 +728,7 @@ case class GoodspayCase(@JsonProperty("goodsid") goodsid: Long,
@ApiModel(description = "创建商品橱窗")
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,
@(ApiModelProperty@field)(position = 1, example = "1232", value = "payname") @JsonProperty("payname") payname: String,
@(ApiModelProperty@field)(position = 1, example = "1232", value = "optpay") @JsonProperty("optpay") optpay: Long,
......
......@@ -104,11 +104,13 @@ class Goodspay2 extends Serializable {
@Column var UPDATETIME: Date = _
//多对一
@ManyToOne(fetch = FetchType.EAGER)
@Fetch(FetchMode.JOIN)
// @ManyToOne(fetch = FetchType.EAGER)
// @Fetch(FetchMode.JOIN)
// @JoinColumn(name = "goods_id")
// var goods2: Goods2 = _
@BeanProperty
@JoinColumn(name = "goods_id")
var goods2: Goods2 = _
@OneToOne(fetch = FetchType.EAGER, cascade = Array(CascadeType.ALL)) var goods: Goods2 = _
// @BeanProperty
// @JoinColumn( name = "ditch_id" )
// @OneToOne( fetch = FetchType.EAGER, cascade = Array( CascadeType.ALL ) ) var goodspayditch2: Goodspayditch2 = _
......@@ -204,6 +206,12 @@ class Goods2 extends Serializable {
@Column
var price: Long = _
@BeanProperty
@Column
var sellcount: Long = _
@BeanProperty
@Column
var sellamount: Long = _
@BeanProperty
@Column(name = "marking_price")
var markingprice: Long = _
@BeanProperty
......
package com.icloud.server.scala.pay
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.json.JsonResult
import io.swagger.annotations._
......@@ -53,12 +54,10 @@ class PayController {
x.privatekey=xxx(x.privatekey)
x.appid=x.appid
true
}).asJava
}).reverse.asJava
}else null
val res = alipays.asScala.reverse.asJava
new JsonResult(res)
new JsonResult(alipays)
}
@ApiOperation(value = "在支付配制中查询微信渠道信息", notes = "")
......@@ -75,11 +74,11 @@ class PayController {
x.mchid=x.mchid
x.mchkey=xxx(x.mchkey)
true
}).asJava
}).reverse.asJava
}else null
val res = wxpays.asScala.reverse.asJava
new JsonResult(res)
new JsonResult(wxpays)
}
......@@ -98,7 +97,8 @@ class PayController {
x.appid=x.appid
true
}).asJava
}else null
//util.List[Alipay1]
}else new util.ArrayList[Alipay1]()
val alipay = new Alipay1()
alipay.setId(0)
alipay.setName("默认")
......@@ -124,7 +124,19 @@ class PayController {
x.mchkey=xxx(x.mchkey)
true
}).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()
wxpay.setId(0)
wxpay.setName("默认")
......@@ -309,13 +321,44 @@ class PayController {
}
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 = "")
@ApiImplicitParams(Array(
new ApiImplicitParam(name = "req", value = "删除支付实体类", required = true, dataType = "DelPayReq")
))
@PostMapping(Array("delali"))
@ResponseBody
def del_ali(req:DelPayReq): JsonResult ={
def del_ali(@RequestBody req:DelPayReq): JsonResult ={
val ali = ar1.findById(req.payid).orElseGet(null)
if (ali!=null) {
......@@ -330,7 +373,7 @@ class PayController {
))
@PostMapping(Array("delwx"))
@ResponseBody
def del_wx(req:DelPayReq): JsonResult ={
def del_wx(@RequestBody req:DelPayReq): JsonResult ={
val wxpay = wr1.findById(req.payid).orElseGet(null)
if (wxpay!=null) {
wxpay.status = 1
......@@ -649,7 +692,9 @@ case class UpdateWxReq(@(ApiModelProperty@field)(position = 1, example = "1232",
@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)
// x.name
......
......@@ -14,7 +14,8 @@ public class JWTUtil {
private static final long EXPIRE_TIME = 60 * 24 * 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后过期
......
......@@ -154,7 +154,7 @@ public class ShiroConfig {
credentialsMatcher.setHashIterations(2);
credentialsMatcher.setStoredCredentialsHexEncoded(true);
return credentialsMatcher;
return credentialsMatcher;
}
......
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 springfox.documentation.annotations.ApiIgnore;
/**
* logout, 映射shiro自带的过滤器
*/
//@CrossOrigin
@ApiIgnore
@CrossOrigin
@RestController
@Api( tags = {"登陆,注册"} , value = "API" )
@RequestMapping("pub")
public class LogoutController {
//
//
// @RequestMapping("/logout")
// public JsonResult findMyPlayRecord() {
//
// Subject subject = SecurityUtils.getSubject();
//
// if (subject.getPrincipals() != null) {
//
// }
//
// SecurityUtils.getSubject().logout();
//
// return new JsonResult("logout成功");
//
// }
@RequestMapping("/logout")
public JsonResult findMyPlayRecord() {
Subject subject = SecurityUtils.getSubject();
if (subject.getPrincipals() != null) {
}
SecurityUtils.getSubject().logout();
return new JsonResult("logout成功");
}
}
#Generated by Maven
#Thu Jul 28 21:02:35 CST 2022
#Fri Jul 29 19:03:49 CST 2022
version=1.0.2-snapshot
groupId=com.icloud.boot
artifactId=icloud-pay
#Generated by Maven
#Thu Jul 28 21:02:32 CST 2022
#Fri Jul 29 19:03:46 CST 2022
version=1.0.2-snapshot
groupId=com.icloud.boot
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