Commit 2cb9f245 authored by 周健威's avatar 周健威

Merge remote-tracking branch 'origin/base-modify' into base-modify

# Conflicts:
#	xx-activity/xx-activity-server/src/main/java/com/xxfc/platform/activity/config/RabbitIntegralConfig.java
#	xx-order/xx-order-server/src/main/java/com/xxfc/platform/order/rest/OrderVehicleCrosstownController.java
#	xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/feign/VehicleFeign.java
#	xx-vehicle/xx-vehicle-server/src/test/java/com/xxfc/platform/vehicle/ListTest.java
parents afa25d4d 70379a74
......@@ -6,6 +6,7 @@
<artifactId>ace-auth</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -6,6 +6,7 @@
<artifactId>ace-auth</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -6,6 +6,7 @@
<artifactId>ace-auth</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -76,9 +76,10 @@ public class AuthController {
@RequestMapping(value = "/register", method = RequestMethod.POST)
public JSONObject register(@RequestParam(value="username",defaultValue="")String username,
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password)throws Exception{
@RequestParam(value="password",defaultValue="")String password,
@RequestParam(value="code",defaultValue="")String code)throws Exception{
log.info(username+"----require register...");
JSONObject data=appAuthService.register(username,mobilecode,password);
JSONObject data=appAuthService.register(username,mobilecode,password,code);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JwtAuthenticationRequest authenticationRequest=new JwtAuthenticationRequest();
authenticationRequest.setUsername(username);
......@@ -98,11 +99,12 @@ public class AuthController {
@RequestParam(value="openid",defaultValue="")String openid,
@RequestParam(value="unionid",defaultValue="")String unionid,
@RequestParam(value="type",defaultValue="0")Integer type,
@RequestParam(value="isQQ",defaultValue="0")Integer isQQ
@RequestParam(value="isQQ",defaultValue="0")Integer isQQ,
@RequestParam(value="code",defaultValue="")String code
)throws Exception{
log.info(username+"----require wxregister...");
JSONObject data=appAuthService.wxregister( username, mobilecode, password, nickname,
headimgurl, openid, unionid,type,isQQ);
headimgurl, openid, unionid,type,isQQ,code);
if(data!=null&&data.getInteger("status")== ResultCode.SUCCESS_CODE){
JSONObject result=data.getJSONObject("data");
if(result==null){
......
......@@ -28,13 +28,14 @@ public interface IUserService {
@RequestMapping(value = "/api/app/user/register", method = RequestMethod.POST)
public JSONObject register( @RequestParam(value="username",defaultValue="")String username,
@RequestParam(value="mobilecode",defaultValue="")String mobilecode,
@RequestParam(value="password",defaultValue="")String password);
@RequestParam(value="password",defaultValue="")String password,
@RequestParam(value="code")String code);
@RequestMapping(value = "/api/app/user/wxregister", method = RequestMethod.POST)
public JSONObject wxregister(
@RequestParam(value="username")String username,@RequestParam(value="mobilecode")String mobilecode,
@RequestParam(value="password")String password,@RequestParam(value="nickname")String nickname,
@RequestParam(value="headimgurl")String headimgurl,@RequestParam(value="openid")String openid,
@RequestParam(value="unionid")String unionid,@RequestParam(value="type")Integer type,@RequestParam(value="isQQ")Integer isQQ);
@RequestParam(value="unionid")String unionid,@RequestParam(value="type")Integer type,@RequestParam(value="isQQ")Integer isQQ,@RequestParam(value="code")String code);
@RequestMapping(value = "/api/app/user/checkBindWechat",method = RequestMethod.POST)
public JSONObject checkBindWechat( @RequestParam(value="username")String username);
@RequestMapping(value = "/api/app/user/wxlogin",method = RequestMethod.POST)
......
......@@ -10,8 +10,8 @@ public interface AuthService {
String refresh(String oldToken) throws Exception;
void validate(String token) throws Exception;
JSONObject sendsms(String username, Integer type) throws Exception;
JSONObject register(String username, String mobilecode, String password) throws Exception;
JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ) throws Exception;
JSONObject register(String username, String mobilecode, String password,String code) throws Exception;
JSONObject wxregister( String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception;
JSONObject checkBindWechat(String username) throws Exception;
JSONObject wxlogin(String openid,Integer isQQ) throws Exception;
JSONObject tlogin(String username, String password,String mobilecode,Integer type) throws Exception;
......
......@@ -51,13 +51,13 @@ public class AppAuthServiceImpl implements AuthService {
}
@Override
public JSONObject register(String username, String mobilecode, String password) throws Exception {
return userService.register(username,mobilecode,password);
public JSONObject register(String username, String mobilecode, String password,String code) throws Exception {
return userService.register(username,mobilecode,password,code);
}
@Override
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ);
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ,code);
}
@Override
......
......@@ -50,13 +50,13 @@ public class AuthServiceImpl implements AuthService {
return userService.sendsms(username,type);
}
@Override
public JSONObject register(String username, String mobilecode, String password) throws Exception {
return userService.register(username,mobilecode,password);
public JSONObject register(String username, String mobilecode, String password,String code) throws Exception {
return userService.register(username,mobilecode,password,code);
}
@Override
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ);
public JSONObject wxregister(String username, String mobilecode, String password, String nickname, String headimgurl, String openid, String unionid, Integer type,Integer isQQ,String code) throws Exception {
return userService.wxregister(username,mobilecode,password,nickname,headimgurl,openid,unionid,type,isQQ,code);
}
@Override
......
......@@ -6,6 +6,7 @@
<artifactId>ace-security</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -42,3 +42,10 @@ ALIPAY_PID=2088531634846583
ALIPAY_PUBLIC_KEY=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAj/EMaAD2iJP3I5M0g6pssDDe3RxF5I3ECM/Kz/btM0RiW2g5oRrHSjtGuos9l1QhQAY0SrVqa2eZdPKUB3ZqJdimQiXr3dbiMvG9UCs8vVUcrtCHCBjDllKQLiYzboxE6JLXyfII5tIXbFKiGyiEyXQnffUhQ9uGyT2EGWGecz6PLIjDdbwpxuzF2gIUzV3bPxb+0axejBxJ/3zKnWrsbyq2nvs8XrzrR2CEggNqgqsKzaacCL1yZjXzQRseSnCMtgSxR5W5afbdY0zqbUlLHUrUZ8ycCRC0ECuI9HyTbuqtdWHEZH7vIH44wEQWZPDRhMfMZvzmPUgpTWZLv5BtaQIDAQAB
ALIPAY_ACOUNT=xxfc810@163.com
ALIPAY_PRIVATE_KEY=MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC3bANag6my6pjHWqwnSCffRonvOXE6uQgNNb+V23PV55zfcuC+jIgl9BRrIf4tax5f2itfDmlOdAX6mK8WJ620SHg777Q2KlgNTa25ta3xiEfgkb01SX9VyiaLPpP2TEo5LhhRcT+cUomIufQbVbm/jS8mRQ0qBoofbMfr7n9fBSiVDx/QX07qcJTc/MGCy79H5gUiy2fTOEMhTuNtPkoU3az7jXMQ5U/33ILFAJzPCMNJvQnCYxs/y5loxxHdVqV8FnuCWGEWNViuuBtFRVRNXkrs/x99nF0V5/FHnOZzdM3SWrKCpA/52G5QQrbhZXUhMyCs9stXvH+iVUC1JJ9DAgMBAAECggEAOGRf/5MdOGHCCQCKjyUzBQVV4RPDCS/cFtughH1M9sXXyCc0i8D/FtQc9vcjg2k8lHGqBfaTT8iCEhKhOemHETd6p8rBmCmamrR4JfGCghDJMHT+PATVvlWBViwuJ3o7E6tlVJzB1tjVahDpyQGpMwhAJ77xFiueiZzTNmlEBb02ByCG95vkBV7NQT8yO9/1i3eq/tMoY7FfJP5O4LQ41RmqU9TVaAnTfuE6gs5hJboNGbmSMs2w2M0tldibmWcsQsFFPLwbUz042czSVb9J7lsGJjCtsaBeUiJ15y66W9D3587JJar9p+EyA2LNbolgrrNi2AA9KU5wEW2w8XyoOQKBgQDZamXDQZK3N5E46Hp/79o0Q99jqj9sL/HCYB4+Z8dG/Mgs43HHpgd+gHVeSOgxXS7RxsLyjCsM97ysWk7sbafvqtsnYmPU2MzumykVVpgWO6dpBcwmf2Ygk2i2W77oEqIi2IUmzkvDhw9C8A8/oh+IuoyRouPGRHpykAF+uXKVhwKBgQDX+TfQDDPniSnA9kTlW5I44glRgogA4xJtAYLtEr2fH9Pys+lkOyRqQH5wbJVj27jzJ0lffNyyMxgbZ8KRiH+3qRa8wNazwwXlXmj4DQWZedkULOpgMdU4EbbkTQRU3onEpMAZhAmVvAV1KTozs4RKi+1fFZ9V6ZOtmvapNJuXZQKBgQC7Xb0rQ3SMHwAxGfCQFwVma2O2AX883iisCaemwkrze1+Lh8uDcisdMtlzEsO/3v09XdydqHxlZY6cvgssJ+hFXGoXi+xa/yfFLcR/FixlZK2Gja99MeeyhTcFiRWB7KT8ALrnUXvrmpZlanrJrQ8eBx6jV8ySDmu0FTSkoG8GOwKBgE5toxX7CHJBPhdjlvtPOJdNhiLCaw8fZpaNIPVkg9WgIkCVkuCiFYQ8LW44EDv2E4DBOITje+V+Zne1Q1PEJNUWIzqiMJWQ8bgsg6PoXqswM2N/OBF8pzg4PplDWppTQeZWCah6aVylrbmxIgCaZSUJEUchO/5f1xAJIR+rCgF9AoGBAKJVVbrKPWshQ4cTL6VzanowjpWCRUDR22Oz3nKIdRl1FX+DTXYE4Dwl38iiNHOJptS7VjU553BUZl7HxCmSBWUmtnV78NNnRKrFVUhQhIRYBjMn1W6MD0jlBkky6yXmXkPtlqU6vU19RzGrvv6fDdBf6v4AkD8kWXiH5j4XEiQS
#ALIPAY_APPID=2016100100641990
#ALIPAY_PID=2088531634846583
#ALIPAY_PUBLIC_KEY=MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAid9pFC4tSCYfiT6w6DpL4z3mOdShAungFXC3KK16wTfoti1ytnngveQHVHnN67hkGyGKhTP/ZCmUYKK7BahwcuJFnEx5rKuX3pNcAhW4Sigurm9bNCE2nSn2Jhq6Wjkp9MNBbVr4sBKWktjA8EhIAgfM7G0Jzlvpm2La44+4b2/iUX08paPlNMAZVV8OxjlGgOgm0FAjsO3PzYPRIqNYWZMTTcGmRQ60EQy3RsM8uKacDfWa8kPF59xuja0i17okPI7JKL+mWsLM+9ktXpr/Nflji0gPGejTr03mwZ5PIckoSqN0Q21/0Tt0vsSNIiF9/9FcgK+LaBgp1sjhnhp6LwIDAQAB
#ALIPAY_ACOUNT=xxfc810@163.com
#ALIPAY_PRIVATE_KEY=MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCJ32kULi1IJh+JPrDoOkvjPeY51KEC6eAVcLcorXrBN+i2LXK2eeC95AdUec3ruGQbIYqFM/9kKZRgorsFqHBy4kWcTHmsq5fek1wCFbhKKC6ub1s0ITadKfYmGrpaOSn0w0FtWviwEpaS2MDwSEgCB8zsbQnOW+mbYtrjj7hvb+JRfTylo+U0wBlVXw7GOUaA6CbQUCOw7c/Ng9Eio1hZkxNNwaZFDrQRDLdGwzy4ppwN9ZryQ8Xn3G6NrSLXuiQ8jskov6Zawsz72S1emv81+WOLSA8Z6NOvTebBnk8hyShKo3RDbX/RO3S+xI0iIX3/0VyAr4toGCnWyOGeGnovAgMBAAECggEATwGCInlPo3+NJMWS9JCref23lz4cQiIpMcAUhS/cHyrdpL+oc56lxcsM1EC0WragTtfKnAgu+oPFLhcyWsyqG3tEbot4UhVGgtooqF0v7PbXwUe4mMfLlwY7spwwW5FUVJkrPfIafjM4q8+fyFFzSg6URIs7SlBrLorYafyqsNgyFf9wbSoJJgDWLqUCQXwImcAoSdeZPQK6PhZ4eG25LRB/Qd06TDq3YBHY/sBnaaACsRsBa8FeNbtZ6jIa4YKCYniWtxbpkZ4C/kz2upEen9BeSV/1Xtz7RF0vyUEBkQi0RYwMKJrZ7nI8N44AlPMaEgHLw4MbDa2CRgKOWZI7sQKBgQDAPLD2BzwDBgKKhFQ9JJ+W2HNBrFpFi4rw8UJXZpZ5YrWNPHJ/0h1EbDTQ8X7DqHFRxIKYMfD4q/VWelgdWHORuZsiKJDq8726Lh5Fh/2wsSmew9OD4LhZ1J/PDpPikmbxytI08N55+VCv9hLdGl8Ybn/rP9pKnzrNH8hfSpBJBwKBgQC3moKZMRjshfB74+VXbOtNMxUBNiXnfo4nmHIMHA4PS8MpVMi5cMZ6647WltyO+M28auhUL1Ba0MZiHUxGcTQSlU8qNA2ZOhLVB2LCUpVdLpEw4uy8sXQVNCjMZIOcrb5FGVAdSEyt6caN1FQifURq8fx5Y+faFg9Eb+mAGK5DmQKBgQCbdnmF/gPCTjHv42RcrimBzDopekDmzRroD7QfCo/WSsWYGrJePIX+t6Ne9m4VvTsnbUxP2NOPx0D5Vqe707RivT+AOF46JDPjRTil8nxvUFbgVm3P0QRFYXZ79MYUDWHDWMr2lXTWH5HpO4+1z4XoNDSvA0x93JepG3Ln3V0iMQKBgQCMWc6PsFpvJAwriJCefiJ5Rx09adkb10BvwDceTqvowW+Uvr0aFL2E5WCxZW2A1WzgJZEoGWsBoSqlgeP2zT6THhQAHP5wLVaMBjNWfK61Jo3SowV5UOV99/tgE04QjTgvtiPp3oTPRS+E59TQ8JVGc2kemmJ38fkFxc7nHvbHsQKBgDlhm1N0VCUvLKaGzgLW7e4j/13ot3OoBTwxBLhZQkWxapR8E47X91rcljP0Huac1pP5upM7mLW9i6G01Y9ounrrQ98aH/OusnObDDyOcZlf1Zp5QkWCAVwWGcq6AlVIGxLyeggYBu6f85x+GFgl0x53X+G7sW/PraMQ7iAJ2w47
\ No newline at end of file
......@@ -6,6 +6,7 @@
<artifactId>ace-control</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -6,6 +6,7 @@
<artifactId>ace-security</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -6,6 +6,7 @@
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform</artifactId>
<version>2.0-SNAPSHOT</version>
<relativePath>../../xx-common/xx-common-platform/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.github.wxiaoqi</groupId>
......
package com.github.wxiaoqi.security.admin.constant;
public class Status{
public static final Integer FORBIDDEN = 1;
public static final Integer AVAILABLE = 0;
}
package com.github.wxiaoqi.security.admin.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 16:29
*/
@Data
public class UserPostionDTO {
private Integer id;
@ApiModelProperty("提成比例")
private Integer extract;
}
package com.github.wxiaoqi.security.admin.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 20:30
*/
@Data
public class WalletCathFindDTO extends PageParam {
private String userName;
private String phone;
/**
* 转账状态
*/
private Integer state;
}
package com.github.wxiaoqi.security.admin.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 20:40
*/
@Data
public class WalletCathListDTO {
private Long id;
private String username;
private String nickname;
private String realname;
private String phone;
@ApiModelProperty(value = "提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)")
private Integer cathType;
@ApiModelProperty(value = "提现金额")
private BigDecimal amount;
@ApiModelProperty(value = "订单状态:0-未提现,待审核,1-已审核")
private Integer stauts;
@ApiModelProperty(value = "提现日期", hidden = true )
private Long crtTime;
@ApiModelProperty(value = "审核日期")
private Long finishTime;
}
package com.github.wxiaoqi.security.admin.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/18 9:50
*/
@Data
public class WalletDetailListDTO {
private Integer id;
private String username;
private String nickname;
private String realname;
private String phone;
@ApiModelProperty(value = "来源:0-活动,1-佣金,2-会员充值,10-提现,11-转账,12-购买")
private Integer sourceType;
@ApiModelProperty("活动名称或佣金商品名称")
private String source;
@ApiModelProperty(value = "收入/支出:0-收入,1-支出")
private Integer itype;
@ApiModelProperty(value = "收入/支出的金额(分)")
private BigDecimal amount;
@ApiModelProperty(value = "活动类型")
private Integer type;
@ApiModelProperty(value = "活动id")
private Integer activityId;
@ApiModelProperty("活动名称")
private String activityName;
@ApiModelProperty(value = "单号")
private Integer cono;
@ApiModelProperty(value = "加上当时的收入的余额")
private BigDecimal balance;
@ApiModelProperty(value = "操作时间", hidden = true )
private Long crtTime;
}
package com.github.wxiaoqi.security.admin.dto;
import com.github.wxiaoqi.security.common.vo.PageParam;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 14:31
*/
@Data
public class WalletFindDTO extends PageParam {
private String phone;
private String username;
}
package com.github.wxiaoqi.security.admin.dto;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 15:21
*/
@Data
public class WalletListDTO {
private Integer id;
@ApiModelProperty("用户ID")
private Integer userId;
private String username;
private String nickname;
private String realname;
@ApiModelProperty(value = "余额(元)")
private BigDecimal balance;
@ApiModelProperty(value = "已提现金额")
private BigDecimal withdrawals;
@ApiModelProperty(value = "进账总额(元)")
private BigDecimal totalAmount;
@ApiModelProperty(value = "进账总额(元)")
private BigDecimal todayAmount;
@ApiModelProperty(value = "未入账金额")
private BigDecimal unbooked;
@ApiModelProperty(value = "是否冻结:0-正常,1-冻结")
private Integer isFrozen;
}
......@@ -71,6 +71,12 @@ public class MyWalletDetail implements Serializable {
private Integer activityId;
/**
* 活动名称
*/
@Column(name = "activity_name")
private String activityName;
/**
* 单号
*/
@Column(name = "cono")
......
......@@ -36,8 +36,8 @@ public class AppUserManageVo {
/**
* 状态:0-正常,1-禁用
*/
@Column(name = "isdel")
private Integer isDel;
@Column(name = "status")
private Integer status;
/**
* 昵称
......@@ -63,6 +63,12 @@ public class AppUserManageVo {
@Column(name = "city_code")
private Integer cityCode;
/**
* 市名称
*/
@Column(name = "city_code")
private String cityName;
/**
* 用户性别
*/
......
package com.github.wxiaoqi.security.admin.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 20:22
*/
@Data
public class WalletCathAdminVo {
private Long id;
private String username;
private String phone;
@ApiModelProperty(value = "提现类别,第三方提现类别(0-微信,1-支付宝,2-银行卡)")
private Integer cathType;
@ApiModelProperty(value = "提现金额")
private BigDecimal amount;
@ApiModelProperty(value = "订单状态:0-未提现,待审核,1-已审核")
private Integer stauts;
@ApiModelProperty(value = "提现日期", hidden = true )
private Long crtTime;
@ApiModelProperty(value = "审核日期")
private Long finishTime;
}
package com.github.wxiaoqi.security.admin.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 9:20
*/
@Data
public class WalletPageVo {
private Integer id;
@ApiModelProperty("用户ID")
private Integer userId;
private String username;
private String phone;
@ApiModelProperty(value = "余额(元)")
private BigDecimal balance;
@ApiModelProperty(value = "已提现金额")
private BigDecimal withdrawals;
@ApiModelProperty(value = "进账总额(元)")
private BigDecimal totalAmount;
@ApiModelProperty(value = "进账总额(元)")
private BigDecimal todayAmount;
@ApiModelProperty(value = "未入账金额")
private BigDecimal unbooked;
@ApiModelProperty(value = "是否冻结:0-正常,1-冻结")
private Integer isFrozen;
}
package com.github.wxiaoqi.security.admin.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 16:17
*/
@Data
public class WalletPostionVo {
@ApiModelProperty("主键id")
private Integer id;
@ApiModelProperty(value = "角色名称")
private String name;
@ApiModelProperty(value = "等级")
private Integer level;
@ApiModelProperty(value = "每年赠送的天数")
private Integer number;
@ApiModelProperty(value = "提成比例")
private Integer extract;
}
......@@ -6,6 +6,7 @@
<artifactId>ace-modules</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -190,4 +190,12 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
}
return null;
}
public void disable(AppUserLogin appUserLogin) {
mapper.updateByPrimaryKeySelective(appUserLogin);
}
public void available(AppUserLogin appUserLogin) {
mapper.updateByPrimaryKeySelective(appUserLogin);
}
}
package com.github.wxiaoqi.security.admin.biz;
import cn.hutool.core.bean.BeanUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
......@@ -9,14 +10,23 @@ import com.github.wxiaoqi.security.admin.mapper.*;
import com.github.wxiaoqi.security.admin.vo.AppUserManageVo;
import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.vehicle.entity.SysRegion;
import com.xxfc.platform.vehicle.feign.VehicleFeign;
import org.apache.commons.beanutils.BeanMap;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.collections.MapUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.transaction.interceptor.TransactionAspectSupport;
import tk.mybatis.mapper.entity.Example;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.stream.Collectors;
/**
......@@ -33,6 +43,9 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
@Autowired
private BaseUserMemberMapper baseUserMemberMapper;
@Autowired
private VehicleFeign vehicleFeign;
/**
* 根据条件查询
*
......@@ -40,10 +53,27 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
* @return
*/
public PageInfo<AppUserManageVo> findAllByQuery(AppUserManageDTO appUserManageDTO) {
Page<AppUserManageVo> page = PageHelper.startPage(appUserManageDTO.getPage(), appUserManageDTO.getLimit());
PageHelper.startPage(appUserManageDTO.getPage(), appUserManageDTO.getLimit());
List<AppUserManageVo> appUserManageVos = mapper.selectAppUserManage(appUserManageDTO);
return PageInfo.of(appUserManageVos);
PageInfo<AppUserManageVo> pageInfo = PageInfo.of(appUserManageVos);
if (pageInfo.getList()==null||pageInfo.getList().size()==0) {
return null;
}
List<Integer> Citys = pageInfo.getList().parallelStream().map(AppUserManageVo::getCityCode).collect(Collectors.toList());
HashSet<Integer> set = new HashSet<>();
set.addAll(Citys);
ObjectRestResponse<List<SysRegion>> orr = vehicleFeign.getSysRegionByIds(set);
List<SysRegion> sysRegions = orr.getData();
if (!(sysRegions==null||sysRegions.size()==0)) {
HashMap<Long, String> map = new HashMap<>();
for (SysRegion sysRegion : sysRegions) {
map.put(sysRegion.getId(),sysRegion.getName());
}
for (AppUserManageVo appUserManageVo : pageInfo.getList()) {
appUserManageVo.setCityName(map.get(appUserManageVo.getCityCode()));
}
}
return pageInfo;
}
/**
......@@ -90,13 +120,10 @@ public class AppUserManageBiz extends BaseBiz<AppUserDetailMapper, AppUserDetail
AppUserDetail appUserDetail = new AppUserDetail();
try {
BeanUtilsBean.getInstance().copyProperties(appUserLogin, appUserVo);
BeanUtilsBean.getInstance().copyProperties(appUserDetail, appUserVo);
if (appUserVo.getUserid() == null || appUserVo.getUserid() == 0) {
//设置登录用户信息
appUserLogin.setIsdel(0);
appUserLogin.setCreatetime(System.currentTimeMillis());
......
package com.github.wxiaoqi.security.admin.biz;
import com.github.wxiaoqi.security.admin.dto.UserPostionDTO;
import com.github.wxiaoqi.security.admin.vo.WalletPostionVo;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import com.github.wxiaoqi.security.admin.entity.AppUserPosition;
import com.github.wxiaoqi.security.admin.mapper.AppUserPositionMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.atomic.AtomicInteger;
/**
* 用户身份职位表
......@@ -13,6 +22,7 @@ import com.github.wxiaoqi.security.common.biz.BaseBiz;
* @email 18178966185@163.com
* @date 2019-07-09 10:00:42
*/
@Transactional
@Service
public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPosition> {
......@@ -21,4 +31,31 @@ public class AppUserPositionBiz extends BaseBiz<AppUserPositionMapper,AppUserPos
public Integer getExtract(Integer userId){
return mapper.getExtractByUserId(userId);
}
public List<WalletPostionVo> findAllPostions() {
List<WalletPostionVo> walletPostionVos = new ArrayList<>();
List<AppUserPosition> appUserPositions = mapper.selectAll();
if (CollectionUtils.isEmpty(appUserPositions)){
return walletPostionVos;
}
WalletPostionVo walletPostionVo;
for (AppUserPosition appUserPosition : appUserPositions) {
walletPostionVo = new WalletPostionVo();
BeanUtils.copyProperties(appUserPosition,walletPostionVo);
walletPostionVos.add(walletPostionVo);
}
return walletPostionVos;
}
public int updateUserPostionPercentage(List<UserPostionDTO> userPostionDTOS) {
AtomicInteger counter = new AtomicInteger(0);
for (UserPostionDTO userPostionDTO : userPostionDTOS) {
AppUserPosition appUserPosition = new AppUserPosition();
appUserPosition.setId(userPostionDTO.getId());
appUserPosition.setExtract(userPostionDTO.getExtract());
mapper.updateByPrimaryKeySelective(appUserPosition);
counter.incrementAndGet();
}
return counter.get();
}
}
\ No newline at end of file
package com.github.wxiaoqi.security.admin.biz;
import com.github.wxiaoqi.security.admin.dto.WalletFindDTO;
import com.github.wxiaoqi.security.admin.dto.WalletListDTO;
import com.github.wxiaoqi.security.admin.entity.MyWallet;
import com.github.wxiaoqi.security.admin.mapper.MyWalletMapper;
import com.github.wxiaoqi.security.admin.vo.AppletWalletVo;
import com.github.wxiaoqi.security.admin.vo.WalletPageVo;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
/**
......@@ -22,17 +30,44 @@ import java.util.List;
public class MyWalletBiz extends BaseBiz<MyWalletMapper, MyWallet> {
public AppletWalletVo findMyWallet(Integer userId){
public AppletWalletVo findMyWallet(Integer userId) {
AppletWalletVo appletWalletVo = new AppletWalletVo();
Example example = new Example(MyWallet.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("userId",userId);
criteria.andEqualTo("userId", userId);
List<MyWallet> wallets = mapper.selectByExample(example);
MyWallet myWallet = wallets.get(0);
BeanUtils.copyProperties(myWallet,appletWalletVo);
BeanUtils.copyProperties(myWallet, appletWalletVo);
return appletWalletVo;
}
public PageDataVO<WalletPageVo> listWalletWithPage(WalletFindDTO walletFindDTO) {
PageDataVO<WalletPageVo> walletPageVo = new PageDataVO<>();
PageDataVO<WalletListDTO> walletPage = PageDataVO.pageInfo(walletFindDTO.getPage(), walletFindDTO.getLimit(), () -> mapper.selectByPhoneOrUserName(walletFindDTO.getPhone(), walletFindDTO.getUsername()));
List<WalletListDTO> wallets = walletPage.getData();
if(CollectionUtils.isEmpty(wallets)){
return walletPageVo;
}
List<WalletPageVo> walletPageVos = new ArrayList<>();
WalletPageVo walletpg ;
for (WalletListDTO wallet : wallets) {
walletpg = new WalletPageVo();
BeanUtils.copyProperties(wallet,walletpg);
walletpg.setUsername(StringUtils.isEmpty(wallet.getRealname())?wallet.getNickname():wallet.getRealname());
walletpg.setPhone(wallet.getUsername());
walletPageVos.add(walletpg);
}
walletPageVos.sort(Comparator.comparing(WalletPageVo::getTotalAmount).reversed());
walletPageVo.setPageNum(walletFindDTO.getPage());
walletPageVo.setPageSize(walletFindDTO.getLimit());
walletPageVo.setTotalCount(walletPage.getTotalCount());
walletPageVo.setTotalPage(walletPage.getTotalPage());
walletPageVo.setData(walletPageVos);
return walletPageVo;
}
}
package com.github.wxiaoqi.security.admin.biz;
import com.github.wxiaoqi.security.admin.dto.WalletCathFindDTO;
import com.github.wxiaoqi.security.admin.dto.WalletCathListDTO;
import com.github.wxiaoqi.security.admin.entity.MyWalletCath;
import com.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper;
import com.github.wxiaoqi.security.admin.vo.WalletCathAdminVo;
import com.github.wxiaoqi.security.admin.vo.WalletCathDetailVo;
import com.github.wxiaoqi.security.admin.vo.WalletCathPageVo;
import com.github.wxiaoqi.security.admin.vo.WalletCathVo;
......@@ -11,13 +14,11 @@ import org.apache.commons.collections.CollectionUtils;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import tk.mybatis.mapper.entity.Example;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
import java.util.*;
/**
* @author libin
......@@ -29,18 +30,18 @@ import java.util.Optional;
@Service
public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
public WalletCathPageVo findWatchCatchByWithdrawalState(Integer userId,Integer state, Integer pageNo, Integer pageSize){
public WalletCathPageVo findWatchCatchByWithdrawalState(Integer userId, Integer state, Integer pageNo, Integer pageSize) {
WalletCathPageVo walletCathPageVo = new WalletCathPageVo();
Example example = new Example(MyWalletCath.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("stauts",state);
criteria.andEqualTo("userId",userId);
criteria.andEqualTo("stauts", state);
criteria.andEqualTo("userId", userId);
PageDataVO<MyWalletCath> walletCathPage = PageDataVO.pageInfo(pageNo, pageSize, () -> mapper.selectByExample(example));
List<MyWalletCath> walletCaths = walletCathPage.getData();
if (CollectionUtils.isEmpty(walletCaths)){
if (CollectionUtils.isEmpty(walletCaths)) {
walletCathPageVo.setPageNum(pageNo);
walletCathPageVo.setPageSize(pageSize);
walletCathPageVo.setTotalCount(0);
......@@ -54,7 +55,7 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
List<WalletCathVo> walletCatchPageVos = new ArrayList<>();
for (MyWalletCath walletCath : walletCaths) {
walletCathVo = new WalletCathVo();
BeanUtils.copyProperties(walletCath,walletCathVo);
BeanUtils.copyProperties(walletCath, walletCathVo);
totalWithdraw = totalWithdraw.add(walletCathVo.getAmount());
walletCatchPageVos.add(walletCathVo);
}
......@@ -72,9 +73,42 @@ public class MyWalletCathBiz extends BaseBiz<MyWalletCathMapper, MyWalletCath> {
MyWalletCath myWalletCath = new MyWalletCath();
myWalletCath.setId(id);
MyWalletCath walletCath = mapper.selectByPrimaryKey(myWalletCath);
Optional.ofNullable(walletCath).ifPresent(wc->{
BeanUtils.copyProperties(wc,walletCathDetailVo);
Optional.ofNullable(walletCath).ifPresent(wc -> {
BeanUtils.copyProperties(wc, walletCathDetailVo);
});
return walletCathDetailVo;
}
public PageDataVO<WalletCathAdminVo> listWalletCathWithPage(WalletCathFindDTO walletCathFindDTO) {
PageDataVO<WalletCathAdminVo> walletCathAdminVoPage = new PageDataVO<>();
// List<WalletCathListDTO> walletCathListDTOS = mapper.selectByUserNameOrPhoneOrWithDrawSate(walletCathFindDTO.getUserName(), walletCathFindDTO.getPhone(), walletCathFindDTO.getState());
PageDataVO<WalletCathListDTO> walletCathListDTOPage = PageDataVO.pageInfo(walletCathFindDTO.getPage(),
walletCathFindDTO.getLimit(),
() -> mapper.selectByUserNameOrPhoneOrWithDrawSate(walletCathFindDTO.getUserName(), walletCathFindDTO.getPhone(), walletCathFindDTO.getState()));
List<WalletCathListDTO> walletCathListDTOList = walletCathListDTOPage.getData();
if (CollectionUtils.isEmpty(walletCathListDTOList)){
return walletCathAdminVoPage;
}
List<WalletCathAdminVo> walletCathAdminVos = new ArrayList<>();
WalletCathAdminVo walletCathAdminVo ;
for (WalletCathListDTO walletCathListDTO : walletCathListDTOList) {
walletCathAdminVo = new WalletCathAdminVo();
BeanUtils.copyProperties(walletCathListDTO,walletCathAdminVo);
walletCathAdminVo.setUsername(StringUtils.isEmpty(walletCathListDTO.getRealname())?walletCathListDTO.getNickname():walletCathListDTO.getRealname());
walletCathAdminVo.setPhone(walletCathListDTO.getUsername());
walletCathAdminVos.add(walletCathAdminVo);
}
walletCathAdminVos.sort(Comparator.comparing(WalletCathAdminVo::getCrtTime).reversed());
walletCathAdminVoPage.setTotalPage(walletCathListDTOPage.getTotalPage());
walletCathAdminVoPage.setTotalCount(walletCathListDTOPage.getTotalCount());
walletCathAdminVoPage.setPageNum(walletCathFindDTO.getPage());
walletCathAdminVoPage.setPageSize(walletCathFindDTO.getLimit());
walletCathAdminVoPage.setData(walletCathAdminVos);
return walletCathAdminVoPage;
}
}
package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.dto.UserPostionDTO;
import com.github.wxiaoqi.security.admin.entity.AppUserPosition;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 用户身份职位表
*
......
package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.dto.WalletCathListDTO;
import com.github.wxiaoqi.security.admin.entity.MyWalletCath;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 钱包提现表
*
......@@ -12,4 +16,7 @@ import tk.mybatis.mapper.common.Mapper;
*/
public interface MyWalletCathMapper extends Mapper<MyWalletCath> {
List<WalletCathListDTO> selectByUserNameOrPhoneOrWithDrawSate(@Param("userName") String userName,
@Param("phone") String phone,
@Param("state") Integer state);
}
package com.github.wxiaoqi.security.admin.mapper;
import com.github.wxiaoqi.security.admin.dto.WalletListDTO;
import com.github.wxiaoqi.security.admin.entity.MyWallet;
import org.apache.ibatis.annotations.Param;
import tk.mybatis.mapper.common.Mapper;
import java.util.List;
/**
* 我的钱包
*
......@@ -12,8 +16,7 @@ import tk.mybatis.mapper.common.Mapper;
*/
public interface MyWalletMapper extends Mapper<MyWallet> {
void updMyWater(MyWallet myWallet);
public void updMyWater(MyWallet myWallet);
List<WalletListDTO> selectByPhoneOrUserName(@Param("phone") String phone, @Param("username") String username);
}
package com.github.wxiaoqi.security.admin.rest;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.biz.AppUserLoginBiz;
import com.github.wxiaoqi.security.admin.biz.AppUserManageBiz;
import com.github.wxiaoqi.security.admin.constant.Status;
import com.github.wxiaoqi.security.admin.dto.AppUserManageDTO;
import com.github.wxiaoqi.security.admin.dto.BaseUserMemberVO;
import com.github.wxiaoqi.security.admin.entity.AppUserLogin;
import com.github.wxiaoqi.security.admin.entity.AppUserManage;
import com.github.wxiaoqi.security.admin.vo.AppUserManageVo;
import com.github.wxiaoqi.security.admin.vo.AppUserVo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* app用户管理类
* @author Administrator
......@@ -21,6 +22,9 @@ import java.util.List;
@RequestMapping("appUsersManage")
public class AppUsersManageController extends BaseController<AppUserManageBiz,AppUserManage> {
@Autowired
private AppUserLoginBiz appUserLoginBiz;
/**
* 查询所有
* @return
......@@ -62,6 +66,34 @@ public class AppUsersManageController extends BaseController<AppUserManageBiz,Ap
return ObjectRestResponse.succ();
}
/**
* 禁用
* @param appUserId
* @return
*/
@PutMapping("/disable/{appUserId}")
public ObjectRestResponse disable(@PathVariable("appUserId") Integer appUserId){
AppUserLogin appUserLogin = new AppUserLogin();
appUserLogin.setStatus(Status.FORBIDDEN);
appUserLogin.setId(appUserId);
appUserLoginBiz.disable(appUserLogin);
return ObjectRestResponse.succ();
}
/**
* 取消禁用
* @param appUserId
* @return
*/
@PutMapping("/available/{appUserId}")
public ObjectRestResponse available(@PathVariable("appUserId") Integer appUserId){
AppUserLogin appUserLogin = new AppUserLogin();
appUserLogin.setStatus(Status.AVAILABLE);
appUserLogin.setId(appUserId);
appUserLoginBiz.available(appUserLogin);
return ObjectRestResponse.succ();
}
}
......@@ -8,6 +8,8 @@ import com.github.wxiaoqi.security.common.rest.BaseController;
import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.util.List;
......@@ -51,4 +53,26 @@ public class MemberLevelController extends BaseController<UserMemberLevelBiz, Ba
}
return null;
}
@GetMapping("/Manage/getMembers")
public ObjectRestResponse getMembers(){
Example exa = Example.builder(BaseUserMemberLevel.class).where(
WeekendSqls.<BaseUserMemberLevel>custom()
.andEqualTo(BaseUserMemberLevel::getIsdel,0)
).orderByAsc("level").build();
List<BaseUserMemberLevel> baseUserMemberLevels = baseBiz.selectByExample(exa);
return ObjectRestResponse.succ(baseUserMemberLevels);
}
@DeleteMapping("/Manage/delMembershipGrade/{id}")
public ObjectRestResponse delMembershipGrade(@PathVariable Integer id){
BaseUserMemberLevel baseUserMemberLevel = new BaseUserMemberLevel();
baseUserMemberLevel.setId(id);
baseUserMemberLevel.setIsdel(1);
baseBiz.updateSelectiveByIdRe(baseUserMemberLevel);
return ObjectRestResponse.succ();
}
}
package com.github.wxiaoqi.security.admin.rest.admin;
import com.github.wxiaoqi.security.admin.biz.AppUserPositionBiz;
import com.github.wxiaoqi.security.admin.dto.UserPostionDTO;
import com.github.wxiaoqi.security.admin.vo.WalletPostionVo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 16:13
*/
@RestController
@RequestMapping("/postion/admin")
public class AppUserPositionController {
@Autowired
private AppUserPositionBiz appUserPositionBiz;
@GetMapping("/postions")
public ObjectRestResponse<List<WalletPostionVo>> findAllPostions(){
List<WalletPostionVo> walletPostionVos = appUserPositionBiz.findAllPostions();
return ObjectRestResponse.succ(walletPostionVos);
}
@PutMapping
public ObjectRestResponse updateUserPostionPercentage(@RequestBody List<UserPostionDTO> userPostionDTOS){
appUserPositionBiz.updateUserPostionPercentage(userPostionDTOS);
return ObjectRestResponse.succ();
}
}
package com.github.wxiaoqi.security.admin.rest.admin;
import com.github.wxiaoqi.security.admin.biz.MyWalletBiz;
import com.github.wxiaoqi.security.admin.dto.WalletFindDTO;
import com.github.wxiaoqi.security.admin.vo.WalletPageVo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 14:11
*/
@RestController
@RequestMapping("/wallet/admin")
public class MyWalletAdminController {
@Autowired
private MyWalletBiz myWalletBiz;
@ApiOperation("分页查询用户钱包")
@GetMapping("/page")
public ObjectRestResponse<PageDataVO<WalletPageVo>> listWalletWithPage(WalletFindDTO walletFindDTO){
PageDataVO<WalletPageVo> walletPage = myWalletBiz.listWalletWithPage(walletFindDTO);
return ObjectRestResponse.succ(walletPage);
}
}
package com.github.wxiaoqi.security.admin.rest.admin;
import com.github.wxiaoqi.security.admin.biz.MyWalletCathBiz;
import com.github.wxiaoqi.security.admin.dto.WalletCathFindDTO;
import com.github.wxiaoqi.security.admin.vo.WalletCathAdminVo;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 19:50
*/
@RestController
@RequestMapping("/walletcath/admin")
public class WalletCathAdminController {
@Autowired
private MyWalletCathBiz myWalletCathBiz;
@GetMapping("/page")
public ObjectRestResponse<PageDataVO<WalletCathAdminVo>> listWalletCathWithPage(WalletCathFindDTO walletCathFindDTO){
PageDataVO<WalletCathAdminVo> walletCathAdminVoPage = myWalletCathBiz.listWalletCathWithPage(walletCathFindDTO);
return ObjectRestResponse.succ(walletCathAdminVoPage);
}
}
......@@ -50,10 +50,10 @@
l.id_number as idNumber,
l.createtime,
l.last_time as lastTime,
l.status,
d.channel,
d.is_member,
d.realname,
d.isdel,
d.nickname,
d.source,
d.province_code as provinceCode,
......
......@@ -21,5 +21,4 @@
ON d.position_id=p.id
WHERE d.userid=#{userId} LIMIT 1
</select>
</mapper>
\ No newline at end of file
<?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.github.wxiaoqi.security.admin.mapper.MyWalletCathMapper">
<select id="selectByUserNameOrPhoneOrWithDrawSate" resultType="com.github.wxiaoqi.security.admin.dto.WalletListDTO">
SELECT
wc.id,
aud.nickname,
aud.realname,
aul.username,
wc.amount,
wc.cath_type AS `cathType`,
wc.stauts,
wc.crt_time AS `crtTime`,
wc.finish_time AS `finishTime`
FROM
(SELECT * FROM `my_wallet_cath` <if test="state != null">
WHERE `stauts`=#{state}
</if>) AS `wc`
INNER JOIN ( SELECT `id`, `username` FROM `app_user_login` <if test="phone != null and phone != ''">
WHERE `username`=#{phone}
</if> ) AS `aul` ON aul.id = w.user_id
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if
test="userName != null and userName != ''">
WHERE nickname =#{username} OR realname =#{userName}
</if> ) AS `aud` ON aud.userid = aul.id
</select>
</mapper>
\ No newline at end of file
......@@ -45,4 +45,26 @@
</where>
</update>
<select id="selectByPhoneOrUserName" resultType="com.github.wxiaoqi.security.admin.dto.WalletListDTO">
SELECT
w.id,
w.user_id AS `userId`,
w.balance,
w.withdrawals,
w.total_amount AS `totalAmount`,
w.today_amount AS `todayAmount`,
w.unbooked,
w.is_frozen AS `isFrozen`,
aul.username,
aud.nickname,
aud.realname
FROM
`my_wallet` AS `w`
INNER JOIN ( SELECT `id`, `username` FROM `app_user_login` <if test="phone != null and phone != ''">
WHERE `username`=#{phone}
</if> ) AS `aul` ON aul.id = w.user_id
INNER JOIN ( SELECT `userid`, `nickname`, `realname` FROM `app_user_detail` <if test="username != null and username != ''">
WHERE nickname =#{username} OR realname =#{username}
</if> ) AS `aud` ON aud.userid = aul.id
</select>
</mapper>
\ No newline at end of file
......@@ -6,6 +6,7 @@
<artifactId>ace-modules</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -6,6 +6,7 @@
<artifactId>ace-modules</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -20,7 +20,6 @@
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.1.3.RELEASE</version>
<relativePath/>
</parent>
<properties>
<docker.image.prefix>ag</docker.image.prefix>
......@@ -37,7 +36,6 @@
<module>ace-sidecar</module>
<module>ace-control</module>
<module>ace-modules</module>
<module>vehicle</module>
<module>xx-app</module>
<module>xx-common</module>
<module>xx-order</module>
......
......@@ -6,6 +6,7 @@
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform</artifactId>
<version>2.0-SNAPSHOT</version>
<relativePath>../../xx-common/xx-common-platform/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
......
package com.xxfc.platform.activity.entity;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import javax.persistence.Column;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
@Data
public class ActivityManagement {
private static final long serialVersionUID = 1L;
/**
* 主键
*/
@Id
@GeneratedValue(generator = "JDBC")
@ApiModelProperty("主键")
private Integer id;
/**
* 活动名称
*/
@Column(name = "name")
@ApiModelProperty(value = "活动名称")
private String name;
/**
* 活动开始时间
*/
@Column(name = "start_time")
@ApiModelProperty(value = "活动开始时间")
private Long startTime;
/**
* 活动结束时间
*/
@Column(name = "end_time")
@ApiModelProperty(value = "活动结束时间")
private Long endTime;
/**
* 人数限制 -1--无限制
*/
@Column(name = "num_limit")
@ApiModelProperty(value = "人数限制 -1--无限制")
private Integer numLimit;
/**
* 已经参与人数
*/
@Column(name = "has_join_num")
@ApiModelProperty(value = "已经参与人数")
private Integer hasJoinNum;
/**
* 当前状态 1--显示在活动页 2--隐藏
*/
@Column(name = "status")
@ApiModelProperty(value = "当前状态 1--显示在活动页 2--隐藏")
private Integer status;
/**
* 排序
*/
@Column(name = "sort")
@ApiModelProperty(value = "排序")
private Integer sort;
/**
* 活动图片
*/
@Column(name = "picture")
@ApiModelProperty(value = "活动图片")
private Integer picture;
}
package com.xxfc.platform.activity.entity;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.IdentityDialect;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigInteger;
@Data
@Table(name = "activity_popup")
public class ActivityPopup {
@Id
@KeySql(dialect = IdentityDialect.MYSQL)
private Integer id;
@Column(name = "name")
private String name;
@Column(name = "descr")
private String descr;
@Column(name = "type")
private Integer type;
@Column(name = "url")
private String url;
@Column(name = "button_Images")
private String buttonImages;
@Column(name = "background")
private String background;
@Column(name = "start_time")
private BigInteger startTime;
@Column(name = "end_time")
private BigInteger endTime;
@Column(name = "status")
private Integer status;
@Column(name = "sort")
private Integer sort;
@Column(name = "crt_time")
private BigInteger crtTime;
@Column(name = "upd_time")
private BigInteger updTime;
}
package com.xxfc.platform.activity.entity;
import lombok.Data;
import tk.mybatis.mapper.annotation.KeySql;
import tk.mybatis.mapper.code.IdentityDialect;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import java.math.BigInteger;
/**
* @author Administrator
*/
@Data
@Table(name = "activity_popup_user")
public class ActivityPopupUser {
@Id
@KeySql(dialect = IdentityDialect.MYSQL)
private Integer id;
@Column(name = "popup_id")
private Integer popupId;
@Column(name = "user_id")
private Integer userId;
@Column(name = "crt_time")
private BigInteger crtTime;
@Column(name = "upd_time")
private BigInteger updTime;
}
......@@ -5,6 +5,7 @@ import lombok.Data;
import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.math.BigDecimal;
@Table(name = "integral_rule")
......@@ -121,7 +122,7 @@ public class IntegralRule{
private String code;
/**
* 获取积分规则
* 获取积分规则 如:{"rule":4} 订单金额*4
*/
private String regulation;
......@@ -131,5 +132,12 @@ public class IntegralRule{
@Column(name = "other_rule")
private String otherRule;
/**
* 操作按钮文字
*/
private String btnWord;
@Transient
private Boolean integralStatus;
}
\ No newline at end of file
package com.xxfc.platform.activity.entity;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
......@@ -10,7 +9,6 @@ import javax.persistence.Table;
@Table(name = "integral_user_record")
@Data
@Builder
public class IntegralUserRecord {
/**
* 主键id
......
......@@ -44,4 +44,12 @@ public class IntegralUserTotal {
*/
private Boolean isdel;
public static IntegralUserTotal initIntegralUserTotal() {
IntegralUserTotal integralUserTotal = new IntegralUserTotal();
integralUserTotal.setIsdel(false);
integralUserTotal.setTotalPoint(0);
integralUserTotal.setRestPoint(0);
return integralUserTotal;
}
}
\ No newline at end of file
......@@ -37,7 +37,7 @@ public interface ActivityFeign {
public ObjectRestResponse cancelUse(@RequestParam(value = "TickerNo",defaultValue ="" ) String TickerNo);
@ApiOperation("新人有礼参加活动")
@RequestMapping(value = "/user", method = RequestMethod.POST)
@RequestMapping(value = "/join/user", method = RequestMethod.POST)
public ObjectRestResponse join(@RequestParam(value = "userId",defaultValue ="0" ) Integer userId);
}
package com.xxfc.platform.activity.vo;
import com.xxfc.platform.activity.entity.IntegralRule;
import lombok.Data;
@Data
public class IntegralRuleVo extends IntegralRule {
private Boolean integralStatus;
}
......@@ -26,6 +26,14 @@ public class IntegralUserRecordDto extends PageParam {
private Integer channelId;
public IntegralUserRecord getIntegralUserRecord() {
return IntegralUserRecord.builder().integralRuleCode(integralRuleCode).userId(userId).channelId(channelId).point(point).type(type).isdel(false).isValid(true).build();
IntegralUserRecord integralUserRecord = new IntegralUserRecord();
integralUserRecord.setPoint(point);
integralUserRecord.setIntegralRuleCode(integralRuleCode);
integralUserRecord.setChannelId(channelId);
integralUserRecord.setIsValid(true);
integralUserRecord.setIsdel(false);
integralUserRecord.setUserId(userId);
integralUserRecord.setType(type);
return integralUserRecord;
}
}
......@@ -6,6 +6,7 @@
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform-web</artifactId>
<version>2.0-SNAPSHOT</version>
<relativePath>../../xx-common/xx-common-platform-web/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
......@@ -20,6 +21,7 @@
</dependencies>
<build>
<finalName>xx-activity</finalName>
<plugins>
<!-- 此插件用来生成通用mapper的代码 -->
<plugin>
......
package com.xxfc.platform.activity.biz;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.activity.entity.ActivityList;
import com.xxfc.platform.activity.entity.ActivityManagement;
import com.xxfc.platform.activity.mapper.ActivityManagementMapper;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.beanutils.BeanUtilsBean;
import org.apache.commons.jexl2.UnifiedJEXL;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.lang.reflect.InvocationTargetException;
import java.util.ArrayList;
import java.util.List;
/**
* @author Administrator
*/
@Slf4j
@Service
public class ActivityManagementBiz extends BaseBiz<ActivityManagementMapper, ActivityManagement> {
@Autowired
private ActivityListBiz activityListBiz;
/**
* 查询所有活动
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
public List<ActivityManagement> selectedActivityManagement() throws InvocationTargetException, IllegalAccessException {
List<ActivityList> activityLists = activityListBiz.selectListAll();
if (activityLists==null||activityLists.size()==0) {
return null;
}
ArrayList<ActivityManagement> activityManagements = new ArrayList<>();
for (ActivityList activityList : activityLists) {
ActivityManagement activityManagement =getActivityManagement(activityList);
activityManagements.add(activityManagement);
}
return activityManagements;
}
/**
* 根据活动id获取活动详情
* @param activityId
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
public Object getOne(Integer activityId) throws InvocationTargetException, IllegalAccessException {
ActivityList activityList = activityListBiz.selectById(activityId);
ActivityManagement activityManagement = getActivityManagement(activityList);
return activityManagement;
}
/**
* cope bean
* @param m
* @param <M>
* @param <V>
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
private <M,V> ActivityManagement getActivityManagement(M m) throws InvocationTargetException, IllegalAccessException {
ActivityManagement activityManagement = new ActivityManagement();
BeanUtilsBean.getInstance().copyProperties(activityManagement,m);
return activityManagement;
}
/**
* 修改活动
* @param activityManagement
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@Transactional(rollbackFor = Exception.class)
public void updateActivityManagement(ActivityManagement activityManagement) throws InvocationTargetException, IllegalAccessException {
ActivityList activityList= new ActivityList();
BeanUtilsBean.getInstance().copyProperties(activityList,activityManagement);
activityListBiz.updateSelectiveByIdRe(activityList);
}
}
package com.xxfc.platform.activity.biz;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.activity.entity.ActivityPopup;
import com.xxfc.platform.activity.entity.ActivityPopupUser;
import com.xxfc.platform.activity.mapper.ActivityPopupMapper;
import com.xxfc.platform.activity.mapper.ActivityPopupUserMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Example;
import tk.mybatis.mapper.weekend.WeekendSqls;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
/**
* 活动弹窗biz
* @author Administrator
*/
@Service
public class ActivityPopupBiz extends BaseBiz<ActivityPopupMapper,ActivityPopup> {
@Value("${activity.popup.loginTypes}")
private String loginTypes;
@Value("${activity.popup.notLoginTypes}")
private String notLoginTypes;
@Autowired
private ActivityPopupUserBiz activityPopupUserBiz;
/**
* 获取活动弹窗,根据是否登录
* @param userInfo
* @return
*/
public List<ActivityPopup> getActivityPopup(AppUserDTO userInfo) {
if (userInfo!=null){
List<ActivityPopup> activityPopups = getActivityPopupByTypes(loginTypes);
if (activityPopups==null||activityPopups.size()==0) {
return activityPopups;
}
List<Integer> collect = activityPopups.parallelStream().map(ActivityPopup::getId).collect(Collectors.toList());
Example exaple= Example.builder(ActivityPopupUser.class).where(
WeekendSqls.<ActivityPopupUser>custom().andIn(ActivityPopupUser::getPopupId,collect)
).build();
List<ActivityPopupUser> activityPopupUsers = activityPopupUserBiz.selectByExample(exaple);
if (activityPopupUsers==null||activityPopupUsers.size()==0) {
return activityPopups;
}
Set<Integer> popupIdSet = activityPopupUsers.parallelStream().map(ActivityPopupUser::getPopupId).collect(Collectors.toSet());
List<ActivityPopup> result= new ArrayList<>();
for (ActivityPopup activityPopup : activityPopups) {
if (popupIdSet.add(activityPopup.getId())){
result.add(activityPopup);
}
}
return result;
}else {
return getActivityPopupByTypes(notLoginTypes);
}
}
/**
* 根据不同的用户,可查询寻的类型.得到对应的弹窗
* @param Types
* @return
*/
private List<ActivityPopup> getActivityPopupByTypes(String Types) {
Example exa = Example.builder(ActivityPopup.class)
.where(
WeekendSqls.<ActivityPopup>custom()
.andGreaterThanOrEqualTo(ActivityPopup::getEndTime, BigInteger.valueOf(System.currentTimeMillis()))
.andLessThanOrEqualTo(ActivityPopup::getStartTime, BigInteger.valueOf(System.currentTimeMillis()))
.andIn(ActivityPopup::getType, Arrays.asList(Types.split(",")))
.andEqualTo(ActivityPopup::getStatus, 1)
).orderByAsc("sort").build();
List<ActivityPopup> activityPopups = mapper.selectByExample(exa);
long l = System.currentTimeMillis();
return activityPopups ;
}
@Transactional(rollbackFor = Exception.class)
public void setActivityPopup(AppUserDTO userInfo,Integer id){
if (userInfo!=null) {
Example exa=Example.builder(ActivityPopupUser.class).where(
WeekendSqls.<ActivityPopupUser>custom()
.andEqualTo(ActivityPopupUser::getPopupId,id)
).build();
List<ActivityPopupUser> activityPopupUsers = activityPopupUserBiz.selectByExample(exa);
if (activityPopupUsers==null||activityPopupUsers.size()==0) {
ActivityPopupUser activityPopupUser = new ActivityPopupUser();
activityPopupUser.setPopupId(id);
activityPopupUser.setUserId(userInfo.getUserid());
activityPopupUser.setCrtTime(BigInteger.valueOf(System.currentTimeMillis()));
activityPopupUserBiz.insertSelective(activityPopupUser);
}
}
}
}
package com.xxfc.platform.activity.biz;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.xxfc.platform.activity.entity.ActivityPopupUser;
import com.xxfc.platform.activity.mapper.ActivityPopupUserMapper;
import org.springframework.stereotype.Service;
@Service
public class ActivityPopupUserBiz extends BaseBiz<ActivityPopupUserMapper, ActivityPopupUser> {
}
......@@ -45,7 +45,7 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
userJoin.setActivityId(activityId);
userJoin.setUserId(userId);
Long num=selectCount(userJoin);
if(num!=null||num>0){
if(num!=null&&num>0){
log.error("----用户已经参与活动----userId===="+userId);
return;
}
......@@ -63,11 +63,15 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
ActivityUserJoin userJoin = new ActivityUserJoin();
userJoin.setActivityId(activityId);
userJoin.setUserId(userId);
Long num = selectCount(userJoin);
if (num == null || num == 0) {
userJoin= selectOne(userJoin);
if (userJoin == null ) {
log.error("----用户没有此参与活动----userId====" + userId);
return;
}
if(userJoin.getStatus()!=0){
log.error("----用户已领取----userId====" + userId);
return;
}
String value=rule.getValue();
JSONObject json=JSONObject.parseObject(value);
if(json!=null){
......@@ -81,8 +85,9 @@ public class ActivityUserJoinBiz extends BaseBiz<ActivityUserJoinMapper,Activity
}
}
}
}
userJoin.setStatus(1);
updateById(userJoin);
}
......
......@@ -2,14 +2,18 @@ package com.xxfc.platform.activity.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.github.wxiaoqi.security.common.vo.PageParam;
import com.xxfc.platform.activity.entity.IntegralRule;
import com.xxfc.platform.activity.entity.IntegralUserRecord;
import com.xxfc.platform.activity.mapper.IntegralRuleMapper;
import com.xxfc.platform.activity.user.UserInfoBiz;
import com.xxfc.platform.activity.vo.IntegralRuleDto;
import com.xxfc.platform.activity.vo.IntegralUserRecordDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -19,6 +23,10 @@ import java.util.List;
@Transactional
public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
@Autowired
UserInfoBiz userInfoBiz;
@Autowired
IntegralUserRecordBiz integralUserRecordBiz;
/**
* 添加、更新积分规则
......@@ -73,9 +81,41 @@ public class IntegralRuleBiz extends BaseBiz<IntegralRuleMapper, IntegralRule> {
public ObjectRestResponse<PageDataVO> getAll(IntegralRuleDto integralRule) {
Query query = new Query(integralRule);
PageDataVO pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectAllByParam(integralRule));
//添加个人积分状态
return ObjectRestResponse.succ(pageDataVO);
}
public ObjectRestResponse<PageDataVO> getList(IntegralRuleDto integralRule) {
AppUserDTO appUserDTO = userInfoBiz.getUserInfo();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(508, "token is null or invalid");
}
Query query = new Query(integralRule);
PageDataVO<IntegralRule> pageDataVO = PageDataVO.pageInfo(query, () -> mapper.selectAllByParam(integralRule));
//添加个人积分状态
for(IntegralRule value : pageDataVO.getData()) {
value.setIntegralStatus(getIntegralStatus(appUserDTO, value));
}
return ObjectRestResponse.succ(pageDataVO);
}
public boolean getIntegralStatus(AppUserDTO appUserDTO, IntegralRule integralRule) {
IntegralUserRecordDto integralUserRecordDto = new IntegralUserRecordDto();
integralUserRecordDto.setUserId(appUserDTO.getUserid());
integralUserRecordDto.setIntegralRuleCode(integralRule.getCode());
List<IntegralUserRecord> integralUserRecords = integralUserRecordBiz.getByUserAndTime(integralUserRecordDto).getData();
if(integralUserRecords == null || integralUserRecords.size() <=0 ) {
return false;
} else if(integralUserRecords.size() == integralRule.getNumber()){//记录 == 规则数 代表已经完成
return true;
} else {
return false;
}
}
}
package com.xxfc.platform.activity.biz;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.constant.RestCode;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.entity.IntegralRule;
import com.xxfc.platform.activity.entity.IntegralSignRecord;
import com.xxfc.platform.activity.entity.IntegralUserRecord;
import com.xxfc.platform.activity.entity.IntegralUserTotal;
import com.xxfc.platform.activity.mapper.IntegralSignRecordMapper;
import com.xxfc.platform.activity.user.UserInfoBiz;
import com.xxfc.platform.activity.util.IntegralToolsUtils;
import com.xxfc.platform.activity.vo.IntegralRuleDto;
import com.xxfc.platform.activity.vo.IntegralUserRecordDto;
import com.xxfc.platform.activity.vo.IntegralUserTotalDto;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.time.DateUtils;
import org.joda.time.DateTime;
import org.joda.time.DateTimeUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.Date;
import java.util.List;
@Service
@Transactional
......@@ -114,7 +106,7 @@ public class IntegralSignRecordBiz extends BaseBiz<IntegralSignRecordMapper, Int
integralSignRecord.setLastTime(new Date().getTime());
mapper.updateByPrimaryKeySelective(integralSignRecord);
addPoint(objectRestResponse.getData(),integralSignRecord, appUserDTO, integralSignRecord.getSignDays());
return ObjectRestResponse.succ();
return ObjectRestResponse.succ(objectRestResponse.getData().getPoint());
}
return ObjectRestResponse.createFailedResult(1006,"签到次数已达到上限,请下次再来");
}
......
package com.xxfc.platform.activity.biz;
import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.constant.RestCode;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.Query;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.github.wxiaoqi.security.common.vo.PageParam;
import com.xxfc.platform.activity.entity.IntegralRule;
import com.xxfc.platform.activity.entity.IntegralUserRecord;
import com.xxfc.platform.activity.entity.IntegralUserTotal;
......@@ -20,7 +18,6 @@ import com.xxfc.platform.activity.vo.IntegralUserTotalDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
......@@ -144,6 +141,11 @@ public class IntegralUserRecordBiz extends BaseBiz<IntegralUserRecordMapper, Int
if (integralUserRecordDto == null) {
return ObjectRestResponse.paramIsEmpty();
}
AppUserDTO appUserDTO = userInfoBiz.getUserInfo();
if (appUserDTO == null) {
return ObjectRestResponse.createFailedResult(508, "token is null or invalid");
}
integralUserRecordDto.setUserId(appUserDTO.getUserid());
List<IntegralUserRecord> integralUserRecordList = mapper.selectByUserAndTime(integralUserRecordDto);
return ObjectRestResponse.succ(integralUserRecordList);
}
......
package com.xxfc.platform.activity.biz;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.bean.copier.CopyOptions;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
......@@ -10,7 +8,6 @@ import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.activity.entity.IntegralUserTotal;
import com.xxfc.platform.activity.mapper.IntegralUserTotalMapper;
import com.xxfc.platform.activity.user.UserInfoBiz;
import com.xxfc.platform.activity.vo.IntegralRuleDto;
import com.xxfc.platform.activity.vo.IntegralUserTotalDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
......@@ -115,8 +112,13 @@ public class IntegralUserTotalBiz extends BaseBiz<IntegralUserTotalMapper, Integ
IntegralUserTotalDto integralUserTotalDto = new IntegralUserTotalDto();
integralUserTotalDto.setUserId(appUserDTO.getUserid());
List<IntegralUserTotal> oldValue = mapper.selectAllByParam(integralUserTotalDto);
return ObjectRestResponse.succ(oldValue == null || oldValue.size() <=0 ? null : oldValue.get(0));
if(oldValue == null || oldValue.size() <=0) {
IntegralUserTotal integralUserTotal = IntegralUserTotal.initIntegralUserTotal();
integralUserTotal.setUserId(appUserDTO.getUserid());
insertSelective(integralUserTotal);
return ObjectRestResponse.succ(integralUserTotal);
}
return ObjectRestResponse.succ(oldValue.get(0));
}
/**
......
package com.xxfc.platform.activity.config;
import org.springframework.amqp.core.Queue;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
* rabbitmq配置类
* 包含: 不知道什么orderWater队列
* @author zhoujw
* @date 2019/7/15
*/
@Configuration
public class RabbitIntegralConfig {
public static final String HZ_EXC = "hz_exchange";
public static final String INTEGRAL_QUEUE = "integral_queue";
public static final String ORDER_WATER_KEY = "order";
// /**
// * 队列交换机
// * 注意这里的交换机类型:CustomExchange
// * @return
// */
// @Bean
// public DirectExchange directExchange(){
// return new DirectExchange(HZ_EXC, true, false);
// }
/**
* 队列
* @return
*/
@Bean
public Queue orderWaterQueue(){
return new Queue(INTEGRAL_QUEUE,true);
}
// /**
// * 队列绑定交换机
// * @return
// */
// @Bean
// public Binding orderWaterBinding(Queue orderWaterQueue, DirectExchange directExchange){
// return BindingBuilder.bind(orderWaterQueue).to(directExchange).with(ORDER_WATER_KEY);
// }
}
package com.xxfc.platform.activity.handler;
import com.alibaba.fastjson.JSONObject;
import com.rabbitmq.client.Channel;
import com.xxfc.platform.activity.biz.IntegralUserRecordBiz;
import com.xxfc.platform.activity.vo.IntegralUserRecordDto;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.amqp.support.AmqpHeaders;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.messaging.handler.annotation.Headers;
import org.springframework.stereotype.Component;
import java.io.IOException;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
@Component
@Slf4j
public class IntegralMQHandler {
@Autowired
IntegralUserRecordBiz integralUserRecordBiz;
@RabbitListener(queues = "integral_queue")
public void integralHandler(Message message, @Headers Map<String, Object> headers, Channel channel) {
ExecutorService executorService = Executors.newCachedThreadPool();
executorService.execute(new Runnable() {
@Override
public void run() {
try{
String messageId = message.getMessageProperties().getMessageId();
String msg = new String(message.getBody(), "UTF-8");
log.info("接收到的消息:msg = {}, 消息ID是:messageId = {} ", msg, messageId);
if(StringUtils.isNotBlank(msg)) {
IntegralUserRecordDto integralUserRecordDto = JSONObject.parseObject(msg, IntegralUserRecordDto.class);
integralUserRecordBiz.add(integralUserRecordDto);
}
executorService.shutdown();
Long deliveryTag = (Long) headers.get(AmqpHeaders.DELIVERY_TAG);
// 手动签收
channel.basicAck(deliveryTag, false);
}catch (Exception e){
log.info("接收到的消息失败");
try{
channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, false);
}catch (IOException i){
i.printStackTrace();
}
e.printStackTrace();
}
}
});
}
}
//package com.xxfc.platform.activity.handler;
//
//
//import com.alibaba.fastjson.JSONObject;
//import com.rabbitmq.client.Channel;
//import com.xxfc.platform.activity.biz.IntegralUserRecordBiz;
//import com.xxfc.platform.activity.vo.IntegralUserRecordDto;
//import lombok.extern.slf4j.Slf4j;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.amqp.core.Message;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.amqp.support.AmqpHeaders;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.messaging.handler.annotation.Headers;
//import org.springframework.stereotype.Component;
//
//import java.io.IOException;
//import java.util.Map;
//import java.util.concurrent.ExecutorService;
//import java.util.concurrent.Executors;
//
//@Component
//@Slf4j
//public class IntegralMQHandler {
//
// @Autowired
// IntegralUserRecordBiz integralUserRecordBiz;
//
// @RabbitListener(queues = "integral_queue")
// public void integralHandler(Message message, @Headers Map<String, Object> headers, Channel channel) {
// ExecutorService executorService = Executors.newCachedThreadPool();
// executorService.execute(new Runnable() {
// @Override
// public void run() {
// try {
// String messageId = message.getMessageProperties().getMessageId();
// String msg = new String(message.getBody(), "UTF-8");
// log.info("接收到的消息:msg = {}, 消息ID是:messageId = {} ", msg, messageId);
//
// if (StringUtils.isNotBlank(msg)) {
// IntegralUserRecordDto integralUserRecordDto = JSONObject.parseObject(msg, IntegralUserRecordDto.class);
// integralUserRecordBiz.add(integralUserRecordDto);
// }
//
// executorService.shutdown();
// Long deliveryTag = (Long) headers.get(AmqpHeaders.DELIVERY_TAG);
// // 手动签收
// channel.basicAck(deliveryTag, false);
// } catch (Exception e) {
// log.info("接收到的消息失败");
// try {
// channel.basicNack(message.getMessageProperties().getDeliveryTag(), false, false);
// } catch (IOException i) {
// i.printStackTrace();
// }
// e.printStackTrace();
// }
// }
// });
// }
//
//
//}
package com.xxfc.platform.activity.mapper;
import com.xxfc.platform.activity.entity.ActivityManagement;
import tk.mybatis.mapper.common.Mapper;
/**
* @author Administrator
*/
public interface ActivityManagementMapper extends Mapper<ActivityManagement> {
}
package com.xxfc.platform.activity.mapper;
import com.xxfc.platform.activity.entity.ActivityPopup;
import tk.mybatis.mapper.common.Mapper;
/**
* @author Administrator
*/
public interface ActivityPopupMapper extends Mapper<ActivityPopup> {
}
package com.xxfc.platform.activity.mapper;
import com.xxfc.platform.activity.entity.ActivityPopupUser;
import tk.mybatis.mapper.common.Mapper;
/**
* @author Administrator
*/
public interface ActivityPopupUserMapper extends Mapper<ActivityPopupUser> {
}
package com.xxfc.platform.activity.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.rest.BaseController;
import com.xxfc.platform.activity.biz.ActivityManagementBiz;
import com.xxfc.platform.activity.entity.ActivityManagement;
import org.springframework.web.bind.annotation.*;
import java.lang.reflect.InvocationTargetException;
import java.util.List;
/**
* 后台活动管理
* @author Administrator
*/
@RestController
@RequestMapping("Management")
public class ActivityManagementController extends BaseController<ActivityManagementBiz, ActivityManagement> {
/**
* 查找全部
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@RequestMapping("/activity/findAll")
public ObjectRestResponse<List<ActivityManagement>> findAll() throws InvocationTargetException, IllegalAccessException {
List<ActivityManagement> list= baseBiz.selectedActivityManagement();
return ObjectRestResponse.succ(list);
}
/**
* 查找一条
* @param activityId
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@GetMapping("getOne/{activityId}")
public ObjectRestResponse<ActivityManagement> getOne(@PathVariable Integer activityId) throws InvocationTargetException, IllegalAccessException {
return ObjectRestResponse.succ(getBaseBiz().getOne(activityId));
}
/**
* 修改活动
* @param activityManagement
* @return
* @throws InvocationTargetException
* @throws IllegalAccessException
*/
@PutMapping("update")
public ObjectRestResponse updateActivityManagement(@RequestBody ActivityManagement activityManagement ) throws InvocationTargetException, IllegalAccessException {
getBaseBiz().updateActivityManagement(activityManagement);
return ObjectRestResponse.succ();
}
}
package com.xxfc.platform.activity.rest;
import com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.biz.ActivityPopupBiz;
import com.xxfc.platform.activity.entity.ActivityPopup;
import org.springframework.web.bind.annotation.*;
import java.util.List;
/**
* 活动弹窗
* @author Administrator
*/
@RestController
@RequestMapping("activityPopup")
public class ActivityPopupController extends ActivityBaseController<ActivityPopupBiz> {
/**
* 返回活动弹窗列表
* @return
*/
@GetMapping("/app/unauth/getActivityPopup")
public ObjectRestResponse<List<ActivityPopup>> getActivityPopup() {
AppUserDTO userInfo = getUserInfo();
return ObjectRestResponse.succ(getBaseBiz().getActivityPopup(userInfo));
}
/**
* 保存用户和活动弹窗关系
* @param id
* @return
*/
@PostMapping("/app/unauth/setActivityPopup/{id}")
public ObjectRestResponse<List<ActivityPopup>> setActivityPopup(@PathVariable Integer id) {
AppUserDTO userInfo = getUserInfo();
getBaseBiz().setActivityPopup(userInfo,id);
return ObjectRestResponse.succ();
}
}
......@@ -13,8 +13,6 @@ import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
@RestController
@RequestMapping(value = "integralRule")
@Api(value = "积分规则")
......@@ -44,7 +42,7 @@ public class IntegralRuleController {
@GetMapping(value = "/list")
@ApiOperation(value = "获取所有的规则")
public ObjectRestResponse<PageDataVO> getList(IntegralRuleDto integralRuleDto) {
return integralRuleBiz.getAll(integralRuleDto);
return integralRuleBiz.getList(integralRuleDto);
}
}
......@@ -2,7 +2,6 @@ package com.xxfc.platform.activity.rest;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.activity.biz.IntegralUserRecordBiz;
import com.xxfc.platform.activity.entity.IntegralUserRecord;
import com.xxfc.platform.activity.vo.IntegralUserRecordDto;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -35,5 +34,8 @@ public class IntegralUserRecordController {
return integralUserRecordBiz.getUserList(integralUserRecordDto);
}
@GetMapping(value = "/getListByCode")
public ObjectRestResponse getListByCode(IntegralUserRecordDto integralUserRecordDto) {
return integralUserRecordBiz.getByUserAndTime(integralUserRecordDto);
}
}
......@@ -29,7 +29,7 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
@RequestMapping(value = "/list/{type}", method = RequestMethod.GET)
public ObjectRestResponse list(@PathVariable Integer type) {
AppUserDTO userInfo = getUserInfo();
Integer userId = userInfo.getId();
Integer userId = userInfo.getUserid();
if(userId==null){
return ObjectRestResponse.createDefaultFail();
}
......@@ -66,7 +66,7 @@ public class UserCouponController extends ActivityBaseController<UserCouponBiz>
@RequestMapping(value = "/coupon/led", method = RequestMethod.POST)
public ObjectRestResponse led() {
AppUserDTO userInfo = getUserInfo();
Integer userId = userInfo.getId();
Integer userId = userInfo.getUserid();
if (userId == null) {
return ObjectRestResponse.createDefaultFail();
}
......
......@@ -6,6 +6,7 @@
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform</artifactId>
<version>2.0-SNAPSHOT</version>
<relativePath>../../xx-common/xx-common-platform/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
......
......@@ -65,4 +65,5 @@ public class Cofig implements Serializable {
@ApiModelProperty(value = "标题")
private String title;
private String params;
}
package com.xxfc.platform.app.entity.vo;
import lombok.Data;
import java.math.BigDecimal;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/17 19:55
*/
@Data
public class WithDrawRuleVo {
/**
* 提现金额
*/
private BigDecimal amount;
/**
* 手续费率
*/
private double proceduReates;
/**
* 规则说明
*/
private String description;
}
......@@ -2,7 +2,9 @@ package com.xxfc.platform.app.feign;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.xxfc.platform.app.entity.Cofig;
import com.xxfc.platform.app.entity.vo.WithDrawRuleVo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
......@@ -10,10 +12,11 @@ import org.springframework.web.bind.annotation.RequestMethod;
/**
* Created by ace on 2017/9/15.
*/
//@FeignClient(value = "${auth.serviceId}",configuration = {})
@FeignClient("xx-app")
public interface ConfigFeign {
@RequestMapping(value = "/cofig/app/unauth/types",method = RequestMethod.GET)
public ObjectRestResponse<Cofig> getAllByType(String types);
ObjectRestResponse<Cofig> getAllByType(String types);
@GetMapping("/app/unauth/withdraw_rule")
WithDrawRuleVo getWithDrawRule();
}
......@@ -6,6 +6,7 @@
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform-web</artifactId>
<version>2.0-SNAPSHOT</version>
<relativePath>../../xx-common/xx-common-platform-web/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
......
package com.xxfc.platform.app.biz;
import com.alibaba.fastjson.JSON;
import com.github.wxiaoqi.security.common.util.EntityUtils;
import com.xxfc.platform.app.entity.vo.WithDrawRuleVo;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;
import com.xxfc.platform.app.entity.Cofig;
import com.xxfc.platform.app.mapper.CofigMapper;
import com.github.wxiaoqi.security.common.biz.BaseBiz;
import tk.mybatis.mapper.entity.Example;
import java.util.List;
......@@ -33,4 +37,19 @@ public class CofigBiz extends BaseBiz<CofigMapper,Cofig> {
EntityUtils.setUpdatedInfo(cofig);
return mapper.updateConfig(cofig);
}
public WithDrawRuleVo getWithDrawRule(){
WithDrawRuleVo withDrawRuleVo = new WithDrawRuleVo();
Example example = new Example(Cofig.class);
Example.Criteria criteria = example.createCriteria();
criteria.andEqualTo("type",88);
List<Cofig> cofigs = mapper.selectByExample(example);
if (CollectionUtils.isEmpty(cofigs)){
return withDrawRuleVo;
}
Cofig cofig = cofigs.get(0);
withDrawRuleVo = JSON.parseObject(cofig.getParams(),WithDrawRuleVo.class);
withDrawRuleVo.setDescription(cofig.getValue());
return withDrawRuleVo;
}
}
\ No newline at end of file
......@@ -8,6 +8,7 @@ import com.github.wxiaoqi.security.common.rest.BaseController;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.xxfc.platform.app.biz.CofigBiz;
import com.xxfc.platform.app.entity.Cofig;
import com.xxfc.platform.app.entity.vo.WithDrawRuleVo;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
......@@ -37,4 +38,9 @@ public class CofigController extends BaseController<CofigBiz,Cofig> {
}
return new ObjectRestResponse<>().rel(true).data(baseBiz.getConfigByType(list));
}
@GetMapping("/app/unauth/withdraw_rule")
public WithDrawRuleVo getWithDrawRule(){
return baseBiz.getWithDrawRule();
}
}
\ No newline at end of file
......@@ -17,7 +17,7 @@
<result property="location" column="location"/>
</resultMap>
<select id="findBannerListByType">
<select id="findBannerListByType" resultMap="bannerMap">
select * from `banner` where `is_del`=0 and `type`=#{type}
<if test="location != null">
and `location`=#{location}
......
......@@ -11,6 +11,7 @@
<result property="crtTime" column="crt_time"/>
<result property="updTime" column="upd_time"/>
<result property="isDel" column="is_del"/>
<result property="params" column="params"/>
</resultMap>
<select id="getAllByType" resultMap="cofigMap">
......
......@@ -6,6 +6,7 @@
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform</artifactId>
<version>2.0-SNAPSHOT</version>
<relativePath>../../xx-common/xx-common-platform/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
......
......@@ -6,7 +6,7 @@
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform-web</artifactId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
<relativePath>../../xx-common/xx-common-platform-web/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
......
package com.xxfc.service;
import com.alibaba.fastjson.JSONObject;
import com.github.wxiaoqi.security.common.vo.PageDataVO;
import com.xxfc.platform.campsite.CampSiteApplication;
import com.xxfc.platform.campsite.biz.CampsiteShopBiz;
import com.xxfc.platform.campsite.dto.CampsiteShopAdminDTO;
import com.xxfc.platform.campsite.dto.CampsiteShopAdminFindDTO;
import com.xxfc.platform.campsite.dto.CampsiteShopCarouselDTO;
import com.xxfc.platform.campsite.dto.CampsiteShopTagDTO;
import com.xxfc.platform.campsite.vo.CampsiteShopAdminPageVo;
import lombok.extern.slf4j.Slf4j;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;
import java.time.Instant;
import java.util.Arrays;
/**
* @author libin
* @version 1.0
* @description TODO
* @data 2019/6/19 16:41
*/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = CampSiteApplication.class)
@Slf4j
public class CampsiteShopBizTest {
@Autowired
private CampsiteShopBiz campsiteShopBiz;
@Test
public void testList(){
CampsiteShopAdminFindDTO campsiteShopAdminFindDTO = new CampsiteShopAdminFindDTO();
campsiteShopAdminFindDTO.setName("kon");
Instant now = Instant.now();
long start = now.minusMillis(3 * 24 * 60 * 60 * 1000).toEpochMilli();
campsiteShopAdminFindDTO.setStartTime(start);
campsiteShopAdminFindDTO.setEndTime(now.toEpochMilli());
campsiteShopAdminFindDTO.setPage(1);
campsiteShopAdminFindDTO.setLimit(10);
PageDataVO<CampsiteShopAdminPageVo> campsiteShopPage = campsiteShopBiz.findCampsiteShopPage(campsiteShopAdminFindDTO);
System.out.println(campsiteShopPage.getData());
}
@Test
public void testSae(){
CampsiteShopAdminDTO campsiteShopAdminDTO = new CampsiteShopAdminDTO();
// campsiteShopAdminDTO.setId(13);
campsiteShopAdminDTO.setProvince(2323);
campsiteShopAdminDTO.setProvinceName("浙江省");
campsiteShopAdminDTO.setCity(2342342);
campsiteShopAdminDTO.setCityName("台州市");
campsiteShopAdminDTO.setAddress("胡同路23号");
campsiteShopAdminDTO.setConcat("zhangsan");
campsiteShopAdminDTO.setConfigure("dsaasdfasdfa");
campsiteShopAdminDTO.setContent("sadfasdfasdfasd");
campsiteShopAdminDTO.setHot(23);
campsiteShopAdminDTO.setLogo("https://xxtest.upyuns.com/image/admin/2019-06-13/23.png");
campsiteShopAdminDTO.setName("kong");
campsiteShopAdminDTO.setPhone("132121212121");
campsiteShopAdminDTO.setServicePhone("4545454545");
campsiteShopAdminDTO.setLatitude(39.983171);
campsiteShopAdminDTO.setLongitude(116.308479);
CampsiteShopCarouselDTO campsiteShopCarouselDTO = new CampsiteShopCarouselDTO();
//campsiteShopCarouselDTO.setId(12);
campsiteShopCarouselDTO.setImgUrl("https://xxtest.upyuns.com/image/admin/2019-06-13/23.png");
campsiteShopAdminDTO.setCarouselDTOS(Arrays.asList(campsiteShopCarouselDTO));
campsiteShopAdminDTO.setCampsiteTagDTOS(Arrays.asList(1));
System.out.println("保存的json信息:【{}】"+JSONObject.toJSONString(campsiteShopAdminDTO));
campsiteShopBiz.saveCampsiteShop(campsiteShopAdminDTO);
}
}
......@@ -6,6 +6,7 @@
<artifactId>xx-common</artifactId>
<groupId>com.xxfc</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath/>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -6,6 +6,7 @@
<artifactId>xx-common-platform</artifactId>
<groupId>com.xxfc.common</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath>../xx-common-platform/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xx-common-platform-web</artifactId>
......
......@@ -6,6 +6,7 @@
<artifactId>ace-security</artifactId>
<groupId>com.github.wxiaoqi</groupId>
<version>2.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xx-common-platform</artifactId>
......
......@@ -6,6 +6,7 @@
<groupId>com.xxfc.common</groupId>
<artifactId>xx-common-platform</artifactId>
<version>2.0-SNAPSHOT</version>
<relativePath>../../xx-common/xx-common-platform/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>com.xxfc.platform</groupId>
......@@ -16,5 +17,47 @@
<artifactId>ace-admin-api</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<!--引入开源后台项目的公共包-->
<dependency>
<groupId>com.github.wxiaoqi</groupId>
<artifactId>ace-auth-client</artifactId>
<version>2.0-SNAPSHOT</version>
</dependency>
<!-- 自己项目 -->
<!--mongodb-->
<dependency>
<groupId>org.mongodb.morphia</groupId>
<artifactId>morphia</artifactId>
<version>1.3.2</version>
</dependency>
<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
<version>7.1.0</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
</dependency>
<dependency>
<groupId>com.aliyun.oss</groupId>
<artifactId>aliyun-sdk-oss</artifactId>
</dependency>
<dependency>
<groupId>cn.hutool</groupId>
<artifactId>hutool-all</artifactId>
<version>4.1.14</version>
</dependency>
<dependency>
<groupId>commons-beanutils</groupId>
<artifactId>commons-beanutils</artifactId>
<version>1.9.3</version>
<scope>compile</scope>
</dependency>
</dependencies>
</project>
\ No newline at end of file
package com.xxfc.platform.im.dto;
import com.xxfc.platform.im.model.Comment;
import lombok.Data;
@Data
public class CommentVo extends Comment {
private String picUrl;
}
package com.xxfc.platform.im.dto;
import com.xxfc.platform.im.model.Praise;
import lombok.Data;
@Data
public class PraiseVo extends Praise {
private String picUrl;
}
......@@ -51,5 +51,21 @@ public class ImComment {
@Column(name = "is_del")
private Boolean isDel = false;
private String nickname;
private String picUrl;
/**
* 创建时间
*/
@Column(name = "crt_time")
private Long crtTime;
/**
* 更新时间
*/
@Column(name = "upd_time")
private Long updTime;
}
\ No newline at end of file
......@@ -43,4 +43,19 @@ public class ImPraise {
@Column(name = "is_del")
private Boolean isDel = false;
private String nickname;
private String picUrl;
/**
* 创建时间
*/
@Column(name = "crt_time")
private Long crtTime;
/**
* 更新时间
*/
@Column(name = "upd_time")
private Long updTime;
}
\ No newline at end of file
......@@ -55,6 +55,17 @@ public class ImQuestion {
@Column(name = "is_del")
private Boolean isDel = false;
/**
* 创建时间
*/
@Column(name = "crt_time")
private Long crtTime;
/**
* 更新时间
*/
@Column(name = "upd_time")
private Long updTime;
/**
* 内容
*/
......@@ -64,4 +75,8 @@ public class ImQuestion {
private Integer praiseCount;
private String nickname;
private String picUrl;
}
\ No newline at end of file
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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