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

[Release][Merge]:B端接口问题修复,车场相关逻辑升级

release_toaliyun_real
hupeng 7 лет назад
Родитель
Сommit
a3664e3ece
100 измененных файлов: 1956 добавлений и 3336 удалений
  1. +1
    -0
      mallinkAdmin/src/main/java/com/simple/config/ShiroConfig.java
  2. +1
    -2
      mallinkAdmin/src/main/java/com/simple/controller/CouponInjectController.java
  3. +35
    -5
      mallinkAdmin/src/main/java/com/simple/controller/WxCUserBasicInfoController.java
  4. +324
    -0
      mallinkAdmin/src/main/java/com/simple/controller/WxCarCallBackController.java
  5. +1
    -276
      mallinkAdmin/src/main/java/com/simple/controller/WxCarController.java
  6. +1
    -0
      mallinkAdmin/src/main/java/com/simple/controller/WxCouponController.java
  7. +13
    -9
      mallinkAdmin/src/main/java/com/simple/controller/WxMallBuildingController.java
  8. +10
    -3
      mallinkAdmin/src/main/java/com/simple/controller/WxMallFloorController.java
  9. +23
    -6
      mallinkAdmin/src/main/java/com/simple/controller/WxMerchantBUserController.java
  10. +2
    -0
      mallinkBApi/src/main/java/com/simple/controller/WxBLogController.java
  11. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxBannersController.java
  12. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxBusinessController.java
  13. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxCLogController.java
  14. +0
    -70
      mallinkBApi/src/main/java/com/simple/controller/WxCUserCarController.java
  15. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxCUserController.java
  16. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxCUserTagsController.java
  17. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxCouponActionLogController.java
  18. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxCouponCarController.java
  19. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxCouponChannelController.java
  20. +15
    -54
      mallinkBApi/src/main/java/com/simple/controller/WxCouponController.java
  21. +7
    -7
      mallinkBApi/src/main/java/com/simple/controller/WxCouponOrderController.java
  22. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxCouponSendController.java
  23. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxCouponTypeController.java
  24. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxCouponVerifyController.java
  25. +1
    -46
      mallinkBApi/src/main/java/com/simple/controller/WxDateAmountRecordController.java
  26. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxMallBuildingController.java
  27. +54
    -53
      mallinkBApi/src/main/java/com/simple/controller/WxMallController.java
  28. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxMallFloorController.java
  29. +86
    -47
      mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java
  30. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxMerchantController.java
  31. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxMerchantShopController.java
  32. +12
    -38
      mallinkBApi/src/main/java/com/simple/controller/WxMerchantTradeDailyController.java
  33. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxMsgCallbackController.java
  34. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxMsgConfigController.java
  35. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxMsgController.java
  36. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxMsgModelController.java
  37. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxMsgSignatureController.java
  38. +2
    -0
      mallinkBApi/src/main/java/com/simple/controller/WxMsgValidationcodeController.java
  39. +6
    -4
      mallinkBApi/src/main/java/com/simple/controller/WxOrderController.java
  40. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxParkController.java
  41. +0
    -133
      mallinkBApi/src/main/java/com/simple/controller/WxPayOrderController.java
  42. +22
    -44
      mallinkBApi/src/main/java/com/simple/controller/WxRefundOrderController.java
  43. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxScoreHistoryController.java
  44. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxScoreRulesController.java
  45. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxScoreValidityPeriodController.java
  46. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxShopController.java
  47. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxTagsController.java
  48. +0
    -71
      mallinkBApi/src/main/java/com/simple/controller/WxWebLogController.java
  49. +2
    -4
      mallinkBApi/src/main/java/com/simple/interceptor/AuthorizationInterceptor.java
  50. +75
    -47
      mallinkCApi/src/main/java/com/simple/controller/WxCarController.java
  51. +4
    -4
      mallinkCApi/src/main/java/com/simple/controller/WxCouponOrderController.java
  52. +8
    -10
      mallinkCApi/src/main/java/com/simple/controller/WxOrderController.java
  53. +5
    -5
      mallinkCApi/src/main/java/com/simple/controller/WxPayOrderController.java
  54. +3
    -3
      mallinkCApi/src/main/java/com/simple/controller/WxRefundOrderController.java
  55. +36
    -6
      mallinkCApi/src/main/java/com/simple/controller/WxUserGrantController.java
  56. +2
    -3
      mallinkCApi/src/main/java/com/simple/interceptor/AuthorizationInterceptor.java
  57. +51
    -26
      mallinkService/src/main/java/com/simple/common/ErrorCode.java
  58. +5
    -0
      mallinkService/src/main/java/com/simple/common/ResultData.java
  59. +80
    -0
      mallinkService/src/main/java/com/simple/domain/dto/WxCuerBasicInfoDto.java
  60. +16
    -5
      mallinkService/src/main/java/com/simple/domain/po/WxAppinfo.java
  61. +11
    -19
      mallinkService/src/main/java/com/simple/domain/po/WxCUserBasicInfo.java
  62. +56
    -45
      mallinkService/src/main/java/com/simple/domain/po/WxCouponActionLog.java
  63. +14
    -2
      mallinkService/src/main/java/com/simple/domain/po/WxMall.java
  64. +9
    -6
      mallinkService/src/main/java/com/simple/domain/po/WxMerchant.java
  65. +2
    -3
      mallinkService/src/main/java/com/simple/domain/po/WxMerchantBUser.java
  66. +25
    -5
      mallinkService/src/main/java/com/simple/domain/po/WxMerchantTradeDaily.java
  67. +161
    -161
      mallinkService/src/main/java/com/simple/domain/po/WxTags.java
  68. +35
    -0
      mallinkService/src/main/java/com/simple/enums/EnumETCPCode.java
  69. +36
    -0
      mallinkService/src/main/java/com/simple/enums/EnumMerchantStatus.java
  70. +36
    -0
      mallinkService/src/main/java/com/simple/enums/EnumTJDCode.java
  71. +3
    -1
      mallinkService/src/main/java/com/simple/mapper/WxCUserBasicInfoMapper.java
  72. +4
    -0
      mallinkService/src/main/java/com/simple/mapper/WxCouponOrderMapper.java
  73. +106
    -0
      mallinkService/src/main/java/com/simple/schedule/DaliyAmountSchedule.java
  74. +112
    -0
      mallinkService/src/main/java/com/simple/schedule/MsgSendingSchedule.java
  75. +9
    -105
      mallinkService/src/main/java/com/simple/schedule/SchedulingConfig.java
  76. +3
    -2
      mallinkService/src/main/java/com/simple/service/CouponInjectService.java
  77. +2
    -2
      mallinkService/src/main/java/com/simple/service/WxCUserBasicInfoService.java
  78. +2
    -0
      mallinkService/src/main/java/com/simple/service/WxCouponActionLogService.java
  79. +4
    -7
      mallinkService/src/main/java/com/simple/service/WxMallBuildingService.java
  80. +4
    -7
      mallinkService/src/main/java/com/simple/service/WxMallFloorService.java
  81. +16
    -3
      mallinkService/src/main/java/com/simple/service/WxMerchantTradeDailyService.java
  82. +53
    -31
      mallinkService/src/main/java/com/simple/service/impl/CouponInjectServiceImpl.java
  83. +10
    -0
      mallinkService/src/main/java/com/simple/service/impl/WxCUserBasicInfoServiceImpl.java
  84. +5
    -1
      mallinkService/src/main/java/com/simple/service/impl/WxCUserCarServiceImpl.java
  85. +13
    -8
      mallinkService/src/main/java/com/simple/service/impl/WxCouponActionLogServiceImpl.java
  86. +11
    -8
      mallinkService/src/main/java/com/simple/service/impl/WxMallBuildingServiceImpl.java
  87. +12
    -3
      mallinkService/src/main/java/com/simple/service/impl/WxMallFloorServiceImpl.java
  88. +1
    -5
      mallinkService/src/main/java/com/simple/service/impl/WxMallServiceImpl.java
  89. +20
    -6
      mallinkService/src/main/java/com/simple/service/impl/WxMerchantBUserServiceImpl.java
  90. +52
    -30
      mallinkService/src/main/java/com/simple/service/impl/WxMerchantServiceImpl.java
  91. +106
    -2
      mallinkService/src/main/java/com/simple/service/impl/WxMerchantTradeDailyServiceImpl.java
  92. +1
    -1
      mallinkService/src/main/java/com/simple/service/impl/WxMsgServiceImpl.java
  93. +40
    -10
      mallinkService/src/main/java/com/simple/service/impl/WxMsgValidationcodeServiceImpl.java
  94. +1
    -3
      mallinkService/src/main/java/com/simple/service/impl/WxOrderServiceImpl.java
  95. +4
    -1
      mallinkService/src/main/java/com/simple/service/impl/WxParkServiceImpl.java
  96. +6
    -3
      mallinkService/src/main/java/com/simple/service/impl/WxRefundOrderServiceImpl.java
  97. +17
    -12
      mallinkService/src/main/java/com/simple/utils/ETCPUtil.java
  98. +8
    -2
      mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml
  99. +27
    -5
      mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml
  100. +16
    -10
      mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml

+ 1
- 0
mallinkAdmin/src/main/java/com/simple/config/ShiroConfig.java Просмотреть файл

@@ -122,6 +122,7 @@ public class ShiroConfig {
filterChainDefinitionMap.put("/swagger-resources/**","anon");
filterChainDefinitionMap.put("/webjars/**","anon");
filterChainDefinitionMap.put("/wxMsgCallback/**","anon");
filterChainDefinitionMap.put("/carCallback/**","anon");
// filterChainDefinitionMap.put("/role/**", "corsFilter,token");
filterChainDefinitionMap.put("/**", "corsFilter,token,authc");
// filterChainDefinitionMap.put("/**", "anon");


+ 1
- 2
mallinkAdmin/src/main/java/com/simple/controller/CouponInjectController.java Просмотреть файл

@@ -57,8 +57,7 @@ public class CouponInjectController extends BaseController
}
//Assert.notNull(couponInject.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
couponInjectService.add(couponInject);
return new ResultData();
return couponInjectService.add(couponInject);
}

@ApiOperation("根据id更新接口")


+ 35
- 5
mallinkAdmin/src/main/java/com/simple/controller/WxCUserBasicInfoController.java Просмотреть файл

@@ -18,10 +18,13 @@ import com.alibaba.fastjson.JSONObject;
import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.dto.WxCuerBasicInfoDto;
import com.simple.domain.po.WxCUser;
import com.simple.domain.po.WxCUserBasicInfo;
import com.simple.domain.po.WxCUserTags;
import com.simple.domain.po.WxTags;
import com.simple.service.WxCUserBasicInfoService;
import com.simple.service.WxCUserService;
import com.simple.service.WxCUserTagsService;
import com.simple.service.WxTagsService;

@@ -43,6 +46,9 @@ public class WxCUserBasicInfoController extends BaseController
@Autowired
private WxTagsService wxTagsService;
@Autowired
private WxCUserService wxCUserService;

private Logger logger = Logger.getLogger(WxCUserBasicInfoController.class);
@@ -51,12 +57,36 @@ public class WxCUserBasicInfoController extends BaseController
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCUserBasicInfo wxCUserBasicInfo,Integer pageNum, Integer pageSize) {
if (null == wxCUserBasicInfo) wxCUserBasicInfo = new WxCUserBasicInfo();
wxCUserBasicInfo.setTenantId(getTenantId());
final PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageNum, pageSize);
public ResultData list(@ModelAttribute WxCuerBasicInfoDto wxCUserBasicInfo,Integer pageNum, Integer pageSize) {
if (null == wxCUserBasicInfo) wxCUserBasicInfo = new WxCuerBasicInfoDto();
String tenantId = getTenantId();
wxCUserBasicInfo.setTenantId(tenantId);
PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.list(wxCUserBasicInfo, pageNum, pageSize);
if(page.getSize()==0 && StringUtils.isNotBlank(wxCUserBasicInfo.getPhone())
&& wxCUserBasicInfo.getEndTime()==null && wxCUserBasicInfo.getStartTime()==null
&& StringUtils.isBlank(wxCUserBasicInfo.getName())
) {//当只有手机号查询并且查不到数据 ,新增
WxCUser cUser = new WxCUser();
cUser.setTenantId(tenantId);
cUser.setPhone(wxCUserBasicInfo.getPhone());
PageInfo<WxCUser> cUsers = wxCUserService.listAsPage(cUser, 1, 1);
if(cUsers.getSize()>0) {
createUserBasicInfo(cUsers.getList().get(0));
page = wxCUserBasicInfoService.list(wxCUserBasicInfo, pageNum, pageSize);
}
}
return new ResultData(page);
}
private void createUserBasicInfo(WxCUser wxCUser) {
WxCUserBasicInfo wxCUserBasicInfo =new WxCUserBasicInfo();
wxCUserBasicInfo.setCUserId(wxCUser.getId());
wxCUserBasicInfo.setPhone(wxCUser.getPhone());
wxCUserBasicInfo.setTenantId(wxCUser.getTenantId());
wxCUserBasicInfoService.saveOrUpdate(wxCUserBasicInfo);
}

// @ApiOperation("新增接口")
// @PostMapping("add")
@@ -73,7 +103,7 @@ public class WxCUserBasicInfoController extends BaseController
wxCUserBasicInfo.setTenantId(getTenantId());
if(StringUtils.isNotBlank(wxCUserBasicInfo.getTags())) {
WxCUserTags record =new WxCUserTags();
record.setUserId(wxCUserBasicInfo.getcUserId());
record.setUserId(wxCUserBasicInfo.getCUserId());
record.setTenantId(getTenantId());
PageInfo<WxCUserTags> page = wxCUserTagsService.listAsPage(record, 1, 1);
if(page.getSize()>0) {


+ 324
- 0
mallinkAdmin/src/main/java/com/simple/controller/WxCarCallBackController.java Просмотреть файл

@@ -0,0 +1,324 @@
package com.simple.controller;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.simple.common.ErrorCode;
import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.po.*;
import com.simple.enums.EnumCarCmd;
import com.simple.enums.EnumCarVendor;
import com.simple.enums.EnumETCPCode;
import com.simple.service.WxCUserCarService;
import com.simple.service.WxCarCmdLogService;
import com.simple.service.WxMerchantService;
import com.simple.service.WxParkService;
import com.simple.utils.ETCPUtil;
import com.simple.utils.TJDCarUtil;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/carCallback")
public class WxCarCallBackController extends BaseController
{
private Logger logger = Logger.getLogger(WxCarCallBackController.class);

ETCPUtil etcp = new ETCPUtil();

TJDCarUtil tjd = new TJDCarUtil();

@Autowired
WxParkService wxParkService;

@Autowired
WxCUserCarService wxCUserCarService;

@Autowired
WxMerchantService wxMerchantService;

@Autowired
WxCarCmdLogService wxCarCmdLogService;

/**
* ETCP 车辆入场通知
* {
* "synId": "4ebd80ff-cfcf-462a-94cb-727e9fa9547c",
* "plateNumber": "渝 ATX061",
* "parkName": "ETCP 智慧停车场",
* "parkId": "1",
* "entranceTime": "2017-08-20 12:59:54",
* "userType": "76",
* "pushTime": "2017-08-20 12:59:57",
* "fixParkingId": "U7",
* "remainingDays": "11"
* }
*/
@RequestMapping(value = "/etcpParkInCallback")
public Result etcpParkInCallback(@RequestBody Map<String,String> paramMap) {
logger.info("etcpParkInCallback: " + paramMap.toString());
String etcpParkId = paramMap.get("parkId");
WxPark parkQ = new WxPark();
parkQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
parkQ.setParkId(etcpParkId);
WxPark park = wxParkService.getByObj(parkQ);
if (park == null) {
logger.error("etcpParkInCallback: ETCP车场未找到"+ etcpParkId);
return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId);
}

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setTenantId(park.getTenantId());
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("etcpParkInCallback: 入库错误 "+ paramMap.toString());
return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString());
}

// TODO 发起 营销 -- 短信
return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage());
}

/**
* ETCP 车辆出场通知
* {
* "synId": "fd92f645-880e-4c2a-9d7d-7081a2488181",
* "plateNumber": "渝 ATX061",
* "parkName": "ETCP 智慧停车场",
* "parkId": "1",
* "entranceTime": "2017-08-17 18:44:19",
* "userType": "76",
* "pushTime": "2017-08-20 11:57:51",
* "exitTime": "2017-08-19 12:07:19",
* "stayedTime": 148980,
* "receivableFee": 0,
* "paidServiceFee": 0,
* "fixParkingId": "U7",
* "remainingDays": "12"
* }
*/
@RequestMapping(value = "/etcpParkOutCallback")
public Result etcpParkOutCallback(@RequestParam Map<String,String> paramMap) {
logger.info("etcpParkOutCallback: " + paramMap.toString());
String etcpParkId = paramMap.get("parkId");
WxPark parkQ = new WxPark();
parkQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
parkQ.setParkId(etcpParkId);
WxPark park = wxParkService.getByObj(parkQ);
if (park == null) {
logger.error("etcpParkOutCallback: ETCP车场未找到 "+ etcpParkId);
return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId);
}

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setTenantId(park.getTenantId());
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_OUT.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("etcpParkOutCallback: 入库错误 "+ paramMap.toString());
return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString());
}

// TODO 发起 营销 -- 短信
return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage());
}

/**
* ETCP 车辆解绑通知
* {
* "plateNumber": "渝 ATX061",
* "time": "2017-08-20 11:57:51"
* }
*/
@RequestMapping(value = "/etcpUnbindCarCallBack")
public Result etcpUnbindCarCallBack(@RequestParam Map<String,String> paramMap) {
logger.info("etcpUnbindCarCallBack: " + paramMap.toString());
String carNumber = paramMap.get("plateNumber");

// TODO how to get the parkId

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_UNBIND.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("etcpUnbindCarCallBack: 入库错误 "+ paramMap.toString());
return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString());
}

WxCUserCar userCarQ = new WxCUserCar();
userCarQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
userCarQ.setCarNumber(carNumber);
// 数据库里删除,保持同步
try {
wxCUserCarService.deleteByObj(userCarQ);
} catch (Exception e) {
logger.error(e.getMessage());
}
// 营销 - 短信
return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage());
}

/**
* ETCP 主动支付结果通知
* {
* "plateNumber": "渝 ATX061",
* "orderId": "fd92f645-880e-4c2a-9d7d-7081a2488181",
* "fee": 7.65,
* "paidServiceFee": 0.07,
* "coupon": 0,
* "time": "2017-08-20 11:57:51"
* }
*/
@RequestMapping(value = "/etcpPaidCallback")
public Result etcpPaidCallback(@RequestParam Map<String,String> paramMap) {
logger.info("etcpPaidCallback: " + paramMap.toString());
String carNumber = paramMap.get("plateNumber");

// TODO how to get the parkId

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PAY_MANUAL.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("etcpPaidCallback: 入库错误 "+ paramMap.toString());
return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString());
}

// 营销 - 短信
return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage());
}


/**
* TJD 车辆入场通知
* {
* "tradeId": "5836b8b52ada463ebc6199579f029565",
* "outCarId": "45454545454",
* "carNum": "京A45413",
* "carNumColor ": "blue",
* "inDt": "20170319202020",
* "parkName": "测试停车场",
* "parkId": "5836b8b52ada463ebc6199579f029561",
* "lon": "74.000272",
* "lat": "159.768703",
* "wLon": "123.523032",
* "wLat": "35.430735",
* "payUrl": "http://prep.tingjiandan.com/tcweixin/letter/prePay/payInPark.html?prePayType=16&channel=10001",
* "canFindCar": "0"
* }
*/
@RequestMapping(value = "/tjdParkInCallback")
public Map tjdParkInCallback(@RequestParam Map<String,String> paramMap) {
logger.info("tjdParkInCallback: " + paramMap.toString());
Map map = new HashMap();


String tjdParkId = paramMap.get("parkId");

WxPark parkQ = new WxPark();
parkQ.setVendorType(EnumCarVendor.CAR_TJD.getCode());
parkQ.setParkId(tjdParkId);
WxPark park = wxParkService.getByObj(parkQ);
if (park == null) {
logger.error("tjdParkInCallback: 停简单车场未找到"+ tjdParkId);
map.put("isSuccess", "0");
map.put("errorMsg", "停简单车场未找到"+ tjdParkId);
return map;
}

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setTenantId(park.getTenantId());
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_TJD.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("tjdParkInCallback: 入库错误"+ paramMap.toString());
map.put("isSuccess", "0");
map.put("errorMsg", "入库错误"+ paramMap.toString());
return map;
}

map.put("isSuccess", "0");
map.put("errorMsg", "");
return map;
}

/**
* TJD 车辆出场通知
* {
* "tradeId": "5836b8b52ada463ebc6199579f029565",
* "outDt": "20170319232020",
* "lon": "74.000272",
* "lat": "159.768703",
* "wLon": "123.523032",
* "wLat": "35.430735",
* "parkAmount": "5.20"
* }
*/
@RequestMapping(value = "/tjdParkoutCallback")
public Map tjdParkOutCallback(@RequestParam Map<String,String> paramMap) {
logger.info("tjdParkoutCallback: " + paramMap.toString());
Map map = new HashMap();


String tradeId = paramMap.get("tradeId");

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_OUT.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("tjdParkoutCallback: 入库错误"+ paramMap.toString());
map.put("isSuccess", "0");
map.put("errorMsg", "入库错误"+ paramMap.toString());
return map;
}

map.put("isSuccess", "0");
map.put("errorMsg", "");
return map;
}
}

+ 1
- 276
mallinkAdmin/src/main/java/com/simple/controller/WxCarController.java Просмотреть файл

@@ -118,7 +118,7 @@ public class WxCarController extends BaseController
if (StringUtils.isBlank(merchantIdStr)) {
// 优先从从商户表里取
logger.error("quanTemplate failed, merchantId为空");
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "merchantId为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId为空");
}
String params = park.getVendorParams();
JSONObject objParams = JSON.parseObject(params);
@@ -161,279 +161,4 @@ public class WxCarController extends BaseController
businessId = objParams1.getString("businessId");
return businessId;
}

/**
* ETCP 车辆入场通知
* {
* "synId": "4ebd80ff-cfcf-462a-94cb-727e9fa9547c",
* "plateNumber": "渝 ATX061",
* "parkName": "ETCP 智慧停车场",
* "parkId": "1",
* "entranceTime": "2017-08-20 12:59:54",
* "userType": "76",
* "pushTime": "2017-08-20 12:59:57",
* "fixParkingId": "U7",
* "remainingDays": "11"
* }
*/
@RequestMapping(value = "/etcpParkInCallback")
public Result etcpParkInCallback(@RequestBody Map<String,String> paramMap) {
logger.info("etcpParkInCallback: " + paramMap.toString());
String etcpParkId = paramMap.get("parkId");
WxPark parkQ = new WxPark();
parkQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
parkQ.setParkId(etcpParkId);
WxPark park = wxParkService.getByObj(parkQ);
if (park == null) {
logger.error("etcpParkInCallback: ETCP车场未找到"+ etcpParkId);
return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId);
}

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setTenantId(park.getTenantId());
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("etcpParkInCallback: 入库错误 "+ paramMap.toString());
return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString());
}

// TODO 发起 营销 -- 短信
return new Result(0, "ok");
}

/**
* ETCP 车辆出场通知
* {
* "synId": "fd92f645-880e-4c2a-9d7d-7081a2488181",
* "plateNumber": "渝 ATX061",
* "parkName": "ETCP 智慧停车场",
* "parkId": "1",
* "entranceTime": "2017-08-17 18:44:19",
* "userType": "76",
* "pushTime": "2017-08-20 11:57:51",
* "exitTime": "2017-08-19 12:07:19",
* "stayedTime": 148980,
* "receivableFee": 0,
* "paidServiceFee": 0,
* "fixParkingId": "U7",
* "remainingDays": "12"
* }
*/
@RequestMapping(value = "/etcpParkOutCallback")
public Result etcpParkOutCallback(@RequestParam Map<String,String> paramMap) {
logger.info("etcpParkOutCallback: " + paramMap.toString());
String etcpParkId = paramMap.get("parkId");
WxPark parkQ = new WxPark();
parkQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
parkQ.setParkId(etcpParkId);
WxPark park = wxParkService.getByObj(parkQ);
if (park == null) {
logger.error("etcpParkInCallback: ETCP车场未找到 "+ etcpParkId);
return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId);
}

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setTenantId(park.getTenantId());
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_OUT.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("etcpParkInCallback: 入库错误 "+ paramMap.toString());
return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString());
}

// TODO 发起 营销 -- 短信
return new Result(0, "ok");
}

/**
* ETCP 车辆解绑通知
* {
* "plateNumber": "渝 ATX061",
* "time": "2017-08-20 11:57:51"
* }
*/
@RequestMapping(value = "/etcpUnbindCarCallBack")
public Result etcpUnbindCarCallBack(@RequestParam Map<String,String> paramMap) {
logger.info("etcpUnbindCarCallBack: " + paramMap.toString());
String carNumber = paramMap.get("plateNumber");

// TODO how to get the parkId

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_UNBIND.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("etcpParkInCallback: 入库错误 "+ paramMap.toString());
return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString());
}

WxCUserCar userCarQ = new WxCUserCar();
userCarQ.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
userCarQ.setCarNumber(carNumber);
// 数据库里删除,保持同步
try {
wxCUserCarService.deleteByObj(userCarQ);
} catch (Exception e) {
logger.error(e.getMessage());
}
// 营销 - 短信
return new Result(0, "ok");
}

/**
* ETCP 主动支付结果通知
* {
* "plateNumber": "渝 ATX061",
* "orderId": "fd92f645-880e-4c2a-9d7d-7081a2488181",
* "fee": 7.65,
* "paidServiceFee": 0.07,
* "coupon": 0,
* "time": "2017-08-20 11:57:51"
* }
*/
@RequestMapping(value = "/etcpPaidCallback")
public Result etcpPaidCallback(@RequestParam Map<String,String> paramMap) {
logger.info("etcpPaidCallback: " + paramMap.toString());
String carNumber = paramMap.get("plateNumber");

// TODO how to get the parkId

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PAY_MANUAL.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("etcpParkInCallback: 入库错误 "+ paramMap.toString());
return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误"+paramMap.toString());
}

// 营销 - 短信
return new Result(0, "ok");
}


/**
* TJD 车辆入场通知
* {
* "tradeId": "5836b8b52ada463ebc6199579f029565",
* "outCarId": "45454545454",
* "carNum": "京A45413",
* "carNumColor ": "blue",
* "inDt": "20170319202020",
* "parkName": "测试停车场",
* "parkId": "5836b8b52ada463ebc6199579f029561",
* "lon": "74.000272",
* "lat": "159.768703",
* "wLon": "123.523032",
* "wLat": "35.430735",
* "payUrl": "http://prep.tingjiandan.com/tcweixin/letter/prePay/payInPark.html?prePayType=16&channel=10001",
* "canFindCar": "0"
* }
*/
@RequestMapping(value = "/tjdParkInCallback")
public Map tjdParkInCallback(@RequestParam Map<String,String> paramMap) {
logger.info("tjdParkInCallback: " + paramMap.toString());
Map map = new HashMap();


String tjdParkId = paramMap.get("parkId");

WxPark parkQ = new WxPark();
parkQ.setVendorType(EnumCarVendor.CAR_TJD.getCode());
parkQ.setParkId(tjdParkId);
WxPark park = wxParkService.getByObj(parkQ);
if (park == null) {
logger.error("tjdParkInCallback: 停简单车场未找到"+ tjdParkId);
map.put("isSuccess", "0");
map.put("errorMsg", "停简单车场未找到"+ tjdParkId);
return map;
}

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setTenantId(park.getTenantId());
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_TJD.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_IN.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("tjdParkInCallback: 入库错误"+ paramMap.toString());
map.put("isSuccess", "0");
map.put("errorMsg", "入库错误"+ paramMap.toString());
return map;
}

map.put("isSuccess", "0");
map.put("errorMsg", "");
return map;
}

/**
* TJD 车辆出场通知
* {
* "tradeId": "5836b8b52ada463ebc6199579f029565",
* "outDt": "20170319232020",
* "lon": "74.000272",
* "lat": "159.768703",
* "wLon": "123.523032",
* "wLat": "35.430735",
* "parkAmount": "5.20"
* }
*/
@RequestMapping(value = "/tjdParkoutCallback")
public Map tjdParkOutCallback(@RequestParam Map<String,String> paramMap) {
logger.info("tjdParkoutCallback: " + paramMap.toString());
Map map = new HashMap();


String tradeId = paramMap.get("tradeId");

Date currentDate = new Date();
WxCarCmdLog wxCarCmdLog = new WxCarCmdLog();
wxCarCmdLog.setVendorType(EnumCarVendor.CAR_ETCP.getCode());
wxCarCmdLog.setCmdType(EnumCarCmd.CAR_ETCP_CALLBACK_PARK_OUT.getCode());
wxCarCmdLog.setCmdJson(JSON.toJSONString(paramMap));
wxCarCmdLog.setCreateDate(currentDate);
wxCarCmdLog.setUpdateDate(currentDate);
try {
wxCarCmdLogService.saveOrUpdate(wxCarCmdLog);
} catch (Exception e) {
logger.error("tjdParkoutCallback: 入库错误"+ paramMap.toString());
map.put("isSuccess", "0");
map.put("errorMsg", "入库错误"+ paramMap.toString());
return map;
}

map.put("isSuccess", "0");
map.put("errorMsg", "");
return map;
}
}

+ 1
- 0
mallinkAdmin/src/main/java/com/simple/controller/WxCouponController.java Просмотреть файл

@@ -72,6 +72,7 @@ public class WxCouponController extends BaseController
String[] arys = wxCoupon.getBusiness().split(",");
wxCoupon.setBusiness(JSON.toJSONString(arys));
}
wxCoupon.setTenantId(getUser().getTenantId());
Long id = wxCouponService.saveOrUpdate(wxCoupon);
return new ResultData(id);
}


+ 13
- 9
mallinkAdmin/src/main/java/com/simple/controller/WxMallBuildingController.java Просмотреть файл

@@ -1,19 +1,16 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMallBuilding;
import com.simple.service.WxMallBuildingService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("wxMallBuilding")
@@ -65,7 +62,14 @@ public class WxMallBuildingController extends BaseController
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMallBuildingService.getById(id));
}


@ApiOperation("获取所有数据")
@GetMapping("getbuildinglist")
public ResultData getbuildinglist() {
return wxMallBuildingService.getbuildinglist(getTenantId());
}



}

+ 10
- 3
mallinkAdmin/src/main/java/com/simple/controller/WxMallFloorController.java Просмотреть файл

@@ -65,7 +65,14 @@ public class WxMallFloorController extends BaseController
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMallFloorService.getById(id));
}

@ApiOperation("获取所有数据")
@GetMapping("getfloorlist")
@ApiImplicitParams({
@ApiImplicitParam(name="buildingId",value="楼座ID",dataType="Long", paramType = "query",required=true)})
public ResultData getfloorlist(Long buildingId){
return wxMallFloorService.getfloorlist(getTenantId(),buildingId);
}


}

+ 23
- 6
mallinkAdmin/src/main/java/com/simple/controller/WxMerchantBUserController.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.simple.controller;

import com.github.pagehelper.PageInfo;
import com.simple.common.ErrorCode;
import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMerchantBUser;
@@ -8,10 +9,13 @@ import com.simple.service.WxMerchantBUserService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("wxMerchantBUser")
public class WxMerchantBUserController extends BaseController
@@ -73,12 +77,25 @@ public class WxMerchantBUserController extends BaseController
}

@ApiOperation("修改密码")
@GetMapping("/updatepwd")
@ApiImplicitParams({
@ApiImplicitParam(name="phone",value="手机号",dataType="String", paramType = "query",required=true),
@ApiImplicitParam(name="code",value="验证码",dataType="String", paramType = "query",required=true),
@ApiImplicitParam(name="pwd",value="密码",dataType="String", paramType = "query",required=true)})
public ResultData updatepwd(String phone,String code,String pwd) {
@PostMapping("/updatepwd")
public ResultData updatepwd(@RequestBody Map<String,String> params) {
// String phone,String code,String pwd
String phone=params.get("phone");
String code=params.get("code");
String pwd=params.get("pwd");
boolean blank = StringUtils.isBlank(phone);
if(blank){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"手机号不能为空");
}
blank = StringUtils.isBlank(code);
if(blank){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"验证码不能为空");
}
blank = StringUtils.isBlank(pwd);
if(blank){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"密码不能为空");
}

return wxMerchantBUserService.updatepwd(phone,code,pwd);
}


+ 2
- 0
mallinkBApi/src/main/java/com/simple/controller/WxBLogController.java Просмотреть файл

@@ -1,5 +1,6 @@
package com.simple.controller;

import io.swagger.annotations.Api;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
@@ -17,6 +18,7 @@ import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxBLog")
@Api(description="B端埋点相关接口")
public class WxBLogController extends BaseController
{
@Autowired


+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxBannersController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxBanners;
import com.simple.service.WxBannersService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxBanners")
public class WxBannersController extends BaseController
{
@Autowired
private WxBannersService wxBannersService;

private Logger logger = Logger.getLogger(WxBannersController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxBanners wxBanners,Integer pageNum, Integer pageSize) {
if (null == wxBanners) wxBanners = new WxBanners();
final PageInfo<WxBanners> page = wxBannersService.listAsPage(wxBanners, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxBanners wxBanners) {
//Assert.notNull(wxBanners.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxBannersService.saveOrUpdate(wxBanners);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxBanners wxBanners) {
wxBannersService.saveOrUpdate(wxBanners);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxBannersService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxBannersService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxBusinessController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxBusiness;
import com.simple.service.WxBusinessService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxBusiness")
public class WxBusinessController extends BaseController
{
@Autowired
private WxBusinessService wxBusinessService;

private Logger logger = Logger.getLogger(WxBusinessController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxBusiness wxBusiness,Integer pageNum, Integer pageSize) {
if (null == wxBusiness) wxBusiness = new WxBusiness();
final PageInfo<WxBusiness> page = wxBusinessService.listAsPage(wxBusiness, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxBusiness wxBusiness) {
//Assert.notNull(wxBusiness.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxBusinessService.saveOrUpdate(wxBusiness);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxBusiness wxBusiness) {
wxBusinessService.saveOrUpdate(wxBusiness);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxBusinessService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxBusinessService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxCLogController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCLog;
import com.simple.service.WxCLogService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCLog")
public class WxCLogController extends BaseController
{
@Autowired
private WxCLogService wxCLogService;

private Logger logger = Logger.getLogger(WxCLogController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCLog wxCLog,Integer pageNum, Integer pageSize) {
if (null == wxCLog) wxCLog = new WxCLog();
final PageInfo<WxCLog> page = wxCLogService.listAsPage(wxCLog, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCLog wxCLog) {
//Assert.notNull(wxCLog.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCLogService.saveOrUpdate(wxCLog);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCLog wxCLog) {
wxCLogService.saveOrUpdate(wxCLog);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCLogService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCLogService.getById(id));
}
}

+ 0
- 70
mallinkBApi/src/main/java/com/simple/controller/WxCUserCarController.java Просмотреть файл

@@ -1,70 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCUserCar;
import com.simple.service.WxCUserCarService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCUserCars")
public class WxCUserCarController extends BaseController
{
@Autowired
private WxCUserCarService wxCUserCarService;

private Logger logger = Logger.getLogger(WxCUserCarController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCUserCar wxCUserCars,Integer pageNum, Integer pageSize) {
if (null == wxCUserCars) wxCUserCars = new WxCUserCar();
final PageInfo<WxCUserCar> page = wxCUserCarService.listAsPage(wxCUserCars, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCUserCar wxCUserCars) {
//Assert.notNull(wxCUserCars.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCUserCarService.saveOrUpdate(wxCUserCars);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCUserCar wxCUserCar) {
wxCUserCarService.saveOrUpdate(wxCUserCar);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCUserCarService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCUserCarService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxCUserController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCUser;
import com.simple.service.WxCUserService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCUser")
public class WxCUserController extends BaseController
{
@Autowired
private WxCUserService wxCUserService;

private Logger logger = Logger.getLogger(WxCUserController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCUser wxCUser,Integer pageNum, Integer pageSize) {
if (null == wxCUser) wxCUser = new WxCUser();
final PageInfo<WxCUser> page = wxCUserService.listAsPage(wxCUser, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCUser wxCUser) {
//Assert.notNull(wxCUser.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCUserService.saveOrUpdate(wxCUser);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCUser wxCUser) {
wxCUserService.saveOrUpdate(wxCUser);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCUserService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCUserService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxCUserTagsController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCUserTags;
import com.simple.service.WxCUserTagsService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCUserTags")
public class WxCUserTagsController extends BaseController
{
@Autowired
private WxCUserTagsService wxCUserTagsService;

private Logger logger = Logger.getLogger(WxCUserTagsController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCUserTags wxCUserTags,Integer pageNum, Integer pageSize) {
if (null == wxCUserTags) wxCUserTags = new WxCUserTags();
final PageInfo<WxCUserTags> page = wxCUserTagsService.listAsPage(wxCUserTags, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCUserTags wxCUserTags) {
//Assert.notNull(wxCUserTags.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCUserTagsService.saveOrUpdate(wxCUserTags);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCUserTags wxCUserTags) {
wxCUserTagsService.saveOrUpdate(wxCUserTags);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCUserTagsService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCUserTagsService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxCouponActionLogController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCouponActionLog;
import com.simple.service.WxCouponActionLogService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCouponActionLog")
public class WxCouponActionLogController extends BaseController
{
@Autowired
private WxCouponActionLogService wxCouponActionLogService;

private Logger logger = Logger.getLogger(WxCouponActionLogController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCouponActionLog wxCouponActionLog,Integer pageNum, Integer pageSize) {
if (null == wxCouponActionLog) wxCouponActionLog = new WxCouponActionLog();
final PageInfo<WxCouponActionLog> page = wxCouponActionLogService.listAsPage(wxCouponActionLog, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCouponActionLog wxCouponActionLog) {
//Assert.notNull(wxCouponActionLog.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCouponActionLogService.saveOrUpdate(wxCouponActionLog);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCouponActionLog wxCouponActionLog) {
wxCouponActionLogService.saveOrUpdate(wxCouponActionLog);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCouponActionLogService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCouponActionLogService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxCouponCarController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCouponCar;
import com.simple.service.WxCouponCarService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCouponCar")
public class WxCouponCarController extends BaseController
{
@Autowired
private WxCouponCarService wxCouponCarService;

private Logger logger = Logger.getLogger(WxCouponCarController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCouponCar wxCouponCar,Integer pageNum, Integer pageSize) {
if (null == wxCouponCar) wxCouponCar = new WxCouponCar();
final PageInfo<WxCouponCar> page = wxCouponCarService.listAsPage(wxCouponCar, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCouponCar wxCouponCar) {
//Assert.notNull(wxCouponCar.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCouponCarService.saveOrUpdate(wxCouponCar);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCouponCar wxCouponCar) {
wxCouponCarService.saveOrUpdate(wxCouponCar);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCouponCarService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCouponCarService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxCouponChannelController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCouponChannel;
import com.simple.service.WxCouponChannelService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCouponChannel")
public class WxCouponChannelController extends BaseController
{
@Autowired
private WxCouponChannelService wxCouponChannelService;

private Logger logger = Logger.getLogger(WxCouponChannelController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCouponChannel wxCouponChannel,Integer pageNum, Integer pageSize) {
if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel();
final PageInfo<WxCouponChannel> page = wxCouponChannelService.listAsPage(wxCouponChannel, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCouponChannel wxCouponChannel) {
//Assert.notNull(wxCouponChannel.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCouponChannelService.saveOrUpdate(wxCouponChannel);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCouponChannel wxCouponChannel) {
wxCouponChannelService.saveOrUpdate(wxCouponChannel);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCouponChannelService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCouponChannelService.getById(id));
}
}

+ 15
- 54
mallinkBApi/src/main/java/com/simple/controller/WxCouponController.java Просмотреть файл

@@ -1,71 +1,32 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCoupon;
import com.simple.service.WxCouponService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.log4j.Logger;
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;

@RestController
@RequestMapping("wxCoupon")
public class WxCouponController extends BaseController
{
@RequestMapping("/api/coupon")
@Api(description="券类相关接口")
public class WxCouponController extends BaseController {
private Logger logger = Logger.getLogger(WxCouponController.class);

@Autowired
@Autowired
private WxCouponService wxCouponService;

@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCoupon wxCoupon,Integer pageNum, Integer pageSize) {
if (null == wxCoupon) wxCoupon = new WxCoupon();
final PageInfo<WxCoupon> page = wxCouponService.listAsPage(wxCoupon, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCoupon wxCoupon) {
//Assert.notNull(wxCoupon.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCouponService.saveOrUpdate(wxCoupon);
return new ResultData();
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS, "查询成功", wxCouponService.getById(id));
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCoupon wxCoupon) {
wxCouponService.saveOrUpdate(wxCoupon);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCouponService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCouponService.getById(id));
}
}

+ 7
- 7
mallinkBApi/src/main/java/com/simple/controller/WxCouponOrderController.java Просмотреть файл

@@ -21,7 +21,7 @@ import java.util.Map;

@RestController
@RequestMapping("/api/couponOrder")
@Api(description = "核销和用户卡券查询接口")
@Api(description = "卡券相关接口")
public class WxCouponOrderController extends BaseController {
private Logger logger = Logger.getLogger(WxCouponOrderController.class);

@@ -35,7 +35,7 @@ public class WxCouponOrderController extends BaseController {
String couponOrderIdStr = paramMap.get("couponOrderId");
if (StringUtils.isBlank(couponOrderIdStr)) {
logger.error("couponOrderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
Long couponOrderId = 0L;
try {
@@ -43,7 +43,7 @@ public class WxCouponOrderController extends BaseController {
} catch (NumberFormatException e) {
couponOrderId = 0L;
logger.error("couponOrderId参数不正确: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
try {
ResultData rd = wxCouponOrderService.verify(couponOrderId, getUser().getId());
@@ -64,14 +64,14 @@ public class WxCouponOrderController extends BaseController {
String couponOrderIdStr = paramMap.get("couponOrderId");
if (StringUtils.isBlank(couponOrderIdStr)) {
logger.error("couponOrderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
Long couponOrderId = 0L;
try {
couponOrderId = Long.valueOf(couponOrderIdStr);
} catch (NumberFormatException e) {
logger.error("couponOrderId参数不正确: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
try {
ResultData rd = wxCouponOrderService.refund(couponOrderId, getUser().getId());
@@ -110,7 +110,7 @@ public class WxCouponOrderController extends BaseController {
String couponOrderIdStr = paramMap.get("couponOrderId");
if (StringUtils.isBlank(couponOrderIdStr)) {
logger.error("couponOrderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
Long couponOrderId = 0L;
try {
@@ -118,7 +118,7 @@ public class WxCouponOrderController extends BaseController {
} catch (NumberFormatException e) {
couponOrderId = 0L;
logger.error("couponOrderId参数不正确: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId));
}


+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxCouponSendController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCouponSend;
import com.simple.service.WxCouponSendService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCouponSend")
public class WxCouponSendController extends BaseController
{
@Autowired
private WxCouponSendService wxCouponSendService;

private Logger logger = Logger.getLogger(WxCouponSendController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCouponSend wxCouponSend,Integer pageNum, Integer pageSize) {
if (null == wxCouponSend) wxCouponSend = new WxCouponSend();
final PageInfo<WxCouponSend> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCouponSend wxCouponSend) {
//Assert.notNull(wxCouponSend.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCouponSendService.saveOrUpdate(wxCouponSend);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCouponSend wxCouponSend) {
wxCouponSendService.saveOrUpdate(wxCouponSend);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCouponSendService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCouponSendService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxCouponTypeController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCouponType;
import com.simple.service.WxCouponTypeService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCouponType")
public class WxCouponTypeController extends BaseController
{
@Autowired
private WxCouponTypeService wxCouponTypeService;

private Logger logger = Logger.getLogger(WxCouponTypeController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCouponType wxCouponType,Integer pageNum, Integer pageSize) {
if (null == wxCouponType) wxCouponType = new WxCouponType();
final PageInfo<WxCouponType> page = wxCouponTypeService.listAsPage(wxCouponType, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCouponType wxCouponType) {
//Assert.notNull(wxCouponType.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCouponTypeService.saveOrUpdate(wxCouponType);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCouponType wxCouponType) {
wxCouponTypeService.saveOrUpdate(wxCouponType);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCouponTypeService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCouponTypeService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxCouponVerifyController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxCouponVerify;
import com.simple.service.WxCouponVerifyService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxCouponVerify")
public class WxCouponVerifyController extends BaseController
{
@Autowired
private WxCouponVerifyService wxCouponVerifyService;

private Logger logger = Logger.getLogger(WxCouponVerifyController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxCouponVerify wxCouponVerify,Integer pageNum, Integer pageSize) {
if (null == wxCouponVerify) wxCouponVerify = new WxCouponVerify();
final PageInfo<WxCouponVerify> page = wxCouponVerifyService.listAsPage(wxCouponVerify, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxCouponVerify wxCouponVerify) {
//Assert.notNull(wxCouponVerify.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxCouponVerifyService.saveOrUpdate(wxCouponVerify);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxCouponVerify wxCouponVerify) {
wxCouponVerifyService.saveOrUpdate(wxCouponVerify);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxCouponVerifyService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxCouponVerifyService.getById(id));
}
}

+ 1
- 46
mallinkBApi/src/main/java/com/simple/controller/WxDateAmountRecordController.java Просмотреть файл

@@ -25,7 +25,7 @@ import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("/api/wxDateAmountRecord")
@Api(description="首页查询交易金额记录和核销记录接口")
@Api(description="首页交易记录相关接口")
public class WxDateAmountRecordController extends BaseController
{
@Autowired
@@ -62,50 +62,5 @@ public class WxDateAmountRecordController extends BaseController
}
return list;
}
// @ApiOperation("分页列表接口")
// @GetMapping("list")
// @ApiImplicitParams({
// @ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
// @ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
// public ResultData list(@ModelAttribute WxDateAmountRecord wxDateAmountRecord,Integer pageNum, Integer pageSize) {
// if (null == wxDateAmountRecord) wxDateAmountRecord = new WxDateAmountRecord();
// final PageInfo<WxDateAmountRecord> page = wxDateAmountRecordService.listAsPage(wxDateAmountRecord, pageNum, pageSize);
// return new ResultData(page);
// }

// @ApiOperation("新增接口")
// @PostMapping("add")
// public ResultData add(@RequestBody WxDateAmountRecord wxDateAmountRecord) {
// //Assert.notNull(wxDateAmountRecord.getName(), "角色名不能为空");
// //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
// wxDateAmountRecordService.saveOrUpdate(wxDateAmountRecord);
// return new ResultData();
// }
//
// @ApiOperation("根据id更新接口")
// @PostMapping("update")
// public ResultData update(@RequestBody WxDateAmountRecord wxDateAmountRecord) {
// wxDateAmountRecordService.saveOrUpdate(wxDateAmountRecord);
// return new ResultData();
// }
//
// @ApiOperation("根据id删除接口")
// @GetMapping("/del")
// @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
// public ResultData delete(Long id) {
// wxDateAmountRecordService.deleteById(id);
// return new ResultData(Result.SUCCESS, "删除成功", null);
// }
//
// @ApiOperation("根据id查询接口")
// @GetMapping("/findById")
// @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
// public ResultData findById(Long id) {
// return new ResultData(Result.SUCCESS,"查询成功",wxDateAmountRecordService.getById(id));
// }
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxMallBuildingController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMallBuilding;
import com.simple.service.WxMallBuildingService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMallBuilding")
public class WxMallBuildingController extends BaseController
{
@Autowired
private WxMallBuildingService wxMallBuildingService;

private Logger logger = Logger.getLogger(WxMallBuildingController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMallBuilding wxMallBuilding,Integer pageNum, Integer pageSize) {
if (null == wxMallBuilding) wxMallBuilding = new WxMallBuilding();
final PageInfo<WxMallBuilding> page = wxMallBuildingService.listAsPage(wxMallBuilding, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMallBuilding wxMallBuilding) {
//Assert.notNull(wxMallBuilding.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMallBuildingService.saveOrUpdate(wxMallBuilding);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMallBuilding wxMallBuilding) {
wxMallBuildingService.saveOrUpdate(wxMallBuilding);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMallBuildingService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMallBuildingService.getById(id));
}
}

+ 54
- 53
mallinkBApi/src/main/java/com/simple/controller/WxMallController.java Просмотреть файл

@@ -1,71 +1,72 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.annotation.AuthIgnore;
import com.simple.common.ErrorCode;
import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.po.WxAppinfo;
import com.simple.domain.po.WxMall;
import com.simple.mapper.WxAppinfoMapper;
import com.simple.service.WxAppinfoService;
import com.simple.service.WxMallService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.apache.log4j.Logger;
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;

import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("wxMall")
public class WxMallController extends BaseController
{
@Autowired
@RequestMapping("/api/mall")
@Api(description="商场信息相关接口")
public class WxMallController extends BaseController {
private Logger logger = Logger.getLogger(WxMallController.class);

@Autowired
private WxMallService wxMallService;

private Logger logger = Logger.getLogger(WxMallController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMall wxMall,Integer pageNum, Integer pageSize) {
if (null == wxMall) wxMall = new WxMall();
final PageInfo<WxMall> page = wxMallService.listAsPage(wxMall, pageNum, pageSize);
return new ResultData(page);
}
@Autowired
private WxAppinfoService wxAppinfoService;

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMall wxMall) {
//Assert.notNull(wxMall.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMallService.saveOrUpdate(wxMall);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMall wxMall) {
wxMallService.saveOrUpdate(wxMall);
return new ResultData();
@AuthIgnore
@ApiOperation("根据appId获取")
@GetMapping("/getAppIcon")
@ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true)
public ResultData getAppIcon(String appId) {
WxAppinfo appInfo = wxAppinfoService.getByAppId(appId);
if (appInfo == null) {
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
}
WxMall mall = wxMallService.getByTenantId(appInfo.getTenantId());
if (mall==null) {
return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND);
}
Map resultMap = new HashMap();
resultMap.put("mallImgUrl", mall.getImgUrl());
resultMap.put("mallName", mall.getName());
return new ResultData(Result.SUCCESS, "查询成功", resultMap);
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMallService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
@ApiOperation("根据appId获取")
@GetMapping("/mallInfo")
@ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true)
public ResultData getMallInfo(String appId) {
WxAppinfo appInfo = wxAppinfoService.getByAppId(appId);
if (appInfo == null) {
return new ResultData(ErrorCode.APP_ID_NOT_FOUND);
}
WxMall mall = wxMallService.getByTenantId(appInfo.getTenantId());
if (mall==null) {
return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND);
}
return new ResultData(Result.SUCCESS, "查询成功", mall);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMallService.getById(id));
}


}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxMallFloorController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMallFloor;
import com.simple.service.WxMallFloorService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMallFloor")
public class WxMallFloorController extends BaseController
{
@Autowired
private WxMallFloorService wxMallFloorService;

private Logger logger = Logger.getLogger(WxMallFloorController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMallFloor wxMallFloor,Integer pageNum, Integer pageSize) {
if (null == wxMallFloor) wxMallFloor = new WxMallFloor();
final PageInfo<WxMallFloor> page = wxMallFloorService.listAsPage(wxMallFloor, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMallFloor wxMallFloor) {
//Assert.notNull(wxMallFloor.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMallFloorService.saveOrUpdate(wxMallFloor);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMallFloor wxMallFloor) {
wxMallFloorService.saveOrUpdate(wxMallFloor);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMallFloorService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMallFloorService.getById(id));
}
}

+ 86
- 47
mallinkBApi/src/main/java/com/simple/controller/WxMerchantBUserController.java Просмотреть файл

@@ -1,30 +1,24 @@
package com.simple.controller;

import cn.binarywang.wx.miniapp.api.WxMaService;
import cn.binarywang.wx.miniapp.bean.WxMaJscode2SessionResult;

import com.simple.annotation.AuthIgnore;
import com.simple.common.ErrorCode;
import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMall;
import com.simple.domain.po.WxMerchant;
import com.simple.domain.po.WxMerchantBUser;
import com.simple.enums.EnumMerchantStatus;
import com.simple.service.WxMallService;
import com.simple.service.WxMerchantBUserService;
import com.simple.service.WxMerchantService;
import com.simple.utils.IPUtil;
import me.chanjar.weixin.common.error.WxErrorException;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMerchantBUser;
import com.simple.service.WxMerchantBUserService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.context.request.RequestContextHolder;
import org.springframework.web.context.request.ServletRequestAttributes;

@@ -34,6 +28,7 @@ import java.util.HashMap;
import java.util.Map;

@RestController
@Api(description="B端用户相关接口")
@RequestMapping("/api/user")
public class WxMerchantBUserController extends BaseController
{
@@ -57,24 +52,25 @@ public class WxMerchantBUserController extends BaseController
WxMerchantBUser user = wxMerchantBUserService.getById(getUser().getId());

if (user==null)
return new ResultData(ErrorCode.USER_IS_EMPTY, ErrorCode.USER_IS_EMPTY.getMessage());
return new ResultData(ErrorCode.USER_IS_EMPTY);

WxMerchant merchant = wxMerchantService.getById(user.getMerchantId());

if (merchant==null)
return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND, ErrorCode.MCH_INFO_NOT_FOUND.getMessage());
return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND);

WxMall mall = wxMallService.getByTenantId(merchant.getTenantId());
if (mall==null)
return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND, ErrorCode.MCH_INFO_NOT_FOUND.getMessage());
return new ResultData(ErrorCode.MALL_INFO_NOT_FOUND);

resultMap.put("phone",user.getPhone());
resultMap.put("name",user.getName());
resultMap.put("merchant_name",merchant.getName());
resultMap.put("merchant_img_url",merchant.getImgUrl());
resultMap.put("mall_name",mall.getName());
resultMap.put("service_phone",mall.getServicePhone());

return new ResultData(Result.SUCCESS,"查询成功",resultMap);
return new ResultData(resultMap);
}

/**
@@ -84,7 +80,10 @@ public class WxMerchantBUserController extends BaseController
*/
@AuthIgnore
@PostMapping("/login")
@ApiOperation(value="用户登录", notes="{\"appId\":\"string\",\"phone\":\"string\",\"password\":\"string\",\"scene\":\"string\",\"sceneAddress\":\"string\"}")
@ApiOperation(value="用户登录", notes="{" +
"\"appId\":\"string\"," +
"\"phone\":\"string\",\"password\":\"string\"," +
"\"latitude\":\"string\",\"longitude\":\"string\"}")
public ResultData userLogin(@RequestBody Map<String, String> map) {
logger.debug(map.toString());

@@ -93,60 +92,100 @@ public class WxMerchantBUserController extends BaseController
String appId = map.get("appId");
String phone = map.get("phone");
String password = map.get("password");
String scene = map.get("scene");
String sceneAddress = map.get("sceneAddress");
String latitude = map.get("latitude");
String longitude = map.get("longitude");
//登录凭证不能为空
if (StringUtils.isBlank(phone)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "phone不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "手机号不能为空");
}
if (StringUtils.isBlank(password)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "password不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "密码不能为空");
}

String token = null;
String session_key = null;
String openId = null;
HttpServletRequest request = ((ServletRequestAttributes)RequestContextHolder.getRequestAttributes()).getRequest();
String ipaddress = IPUtil.getIpAddr(request);
if (!StringUtils.isBlank(latitude)&&!StringUtils.isBlank(longitude)) {
//return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "经纬度未获取");
logger.info("B端用户: " + phone + " 登录 IP" + ipaddress + ", 经纬度(" + longitude + "," + latitude + ")");
}

WxMerchantBUser user = new WxMerchantBUser();
user.setAppId(appId);
user.setPhone(phone);

Date currentDate = new Date();
WxMerchantBUser user1 = null;

try {
WxMerchantBUser user1 = wxMerchantBUserService.getBUserByAppId(user);
if (user1 != null) {
if (user1.getBUserPwd().equalsIgnoreCase(password)) {
user1.createToken(new Date());
token = user1.getToken();
user1 = wxMerchantBUserService.getBUserByAppId(user);
} catch (Exception e) {
logger.error(e.getMessage());
logger.error("B端用户不存在, phone: " + phone);
return new ResultData(ErrorCode.USER_IS_EMPTY);
}

if (user1 != null) {
// check merchant 状态
WxMerchant merchant = null;
try {
merchant = wxMerchantService.getById(user1.getMerchantId());
} catch (Exception e) {
logger.error(ErrorCode.DB_FAIL.getMessage( ) + ": " + user1.getMerchantId());
return new ResultData(ErrorCode.DB_FAIL);
}
if (merchant == null) {
logger.error(ErrorCode.MERCHANT_INFO_NOT_FOUND.getMessage( ) + ": " + user1.getMerchantId());
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);
}
if (merchant.getStatus() == EnumMerchantStatus.NOT_VALID.getCode()) {
logger.error(ErrorCode.MERCHANT_INFO_NOT_VALID.getMessage( ) + ": " + user1.getMerchantId());
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID);
}
// check password
if (user1.getBUserPwd().equalsIgnoreCase(password)) {
user1.createToken(currentDate);
token = user1.getToken();
try {
wxMerchantBUserService.saveOrUpdate(user1);
resultMap.put("token", token);
} else {
return new ResultData(ErrorCode.PASSWORD_ERROR);
} catch (Exception e) {
logger.error("B端用户更新用户信息失败, e:" + e.getMessage());
return new ResultData(ErrorCode.DB_FAIL.getCode(), "数据库保存失败,e:" + e.getMessage());
}
} else {
user.setBUserPwd(password);
user.createToken(new Date());
token = user.getToken();

wxMerchantBUserService.saveOrUpdate(user);
resultMap.put("token", token);
return new ResultData(resultMap);
} else {
return new ResultData(ErrorCode.PASSWORD_ERROR);
}
} catch (Exception e) {
logger.error(e.getMessage());
return new ResultData(ErrorCode.DB_FAIL.getCode(), "wx_c_user数据库保存出错", resultMap);
} else {
logger.error("B端用户不存在, phone: " + phone);
return new ResultData(ErrorCode.USER_IS_EMPTY);
}
return new ResultData(resultMap);
}

@AuthIgnore
@ApiOperation("修改密码")
@PostMapping("/updatepwd")
@ApiImplicitParams({
@ApiImplicitParam(name="phone",value="手机号",dataType="String", paramType = "query",required=true),
@ApiImplicitParam(name="code",value="验证码",dataType="String", paramType = "query",required=true),
@ApiImplicitParam(name="pwd",value="密码",dataType="String", paramType = "query",required=true)})
public ResultData updatepwd(String phone,String code,String pwd) {
public ResultData updatepwd(@RequestBody Map<String,String> params) {
// String phone,String code,String pwd
String phone=params.get("phone");
String code=params.get("code");
String pwd=params.get("pwd");
boolean blank = StringUtils.isBlank(phone);
if(blank){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"手机号不能为空");
}
blank = StringUtils.isBlank(code);
if(blank){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"验证码不能为空");
}
blank = StringUtils.isBlank(pwd);
if(blank){
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(),"密码不能为空");
}

return wxMerchantBUserService.updatepwd(phone,code,pwd);
}


+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxMerchantController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMerchant;
import com.simple.service.WxMerchantService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMerchant")
public class WxMerchantController extends BaseController
{
@Autowired
private WxMerchantService wxMerchantService;

private Logger logger = Logger.getLogger(WxMerchantController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMerchant wxMerchant,Integer pageNum, Integer pageSize) {
if (null == wxMerchant) wxMerchant = new WxMerchant();
final PageInfo<WxMerchant> page = wxMerchantService.listAsPage(wxMerchant, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMerchant wxMerchant) {
//Assert.notNull(wxMerchant.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMerchantService.saveOrUpdate(wxMerchant);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMerchant wxMerchant) {
wxMerchantService.saveOrUpdate(wxMerchant);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMerchantService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMerchantService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxMerchantShopController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMerchantShop;
import com.simple.service.WxMerchantShopService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMerchantShop")
public class WxMerchantShopController extends BaseController
{
@Autowired
private WxMerchantShopService wxMerchantShopService;

private Logger logger = Logger.getLogger(WxMerchantShopController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMerchantShop wxMerchantShop,Integer pageNum, Integer pageSize) {
if (null == wxMerchantShop) wxMerchantShop = new WxMerchantShop();
final PageInfo<WxMerchantShop> page = wxMerchantShopService.listAsPage(wxMerchantShop, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMerchantShop wxMerchantShop) {
//Assert.notNull(wxMerchantShop.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMerchantShopService.saveOrUpdate(wxMerchantShop);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMerchantShop wxMerchantShop) {
wxMerchantShopService.saveOrUpdate(wxMerchantShop);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMerchantShopService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMerchantShopService.getById(id));
}
}

+ 12
- 38
mallinkBApi/src/main/java/com/simple/controller/WxMerchantTradeDailyController.java Просмотреть файл

@@ -1,5 +1,6 @@
package com.simple.controller;

import io.swagger.annotations.Api;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
@@ -16,54 +17,27 @@ import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMerchantTradeDaily")
@RequestMapping("/api/wxMerchantTradeDaily")
@Api(description = "解单相关接口")
public class WxMerchantTradeDailyController extends BaseController
{
@Autowired
private WxMerchantTradeDailyService wxMerchantTradeDailyService;

private Logger logger = Logger.getLogger(WxMerchantTradeDailyController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMerchantTradeDaily wxMerchantTradeDaily,Integer pageNum, Integer pageSize) {
if (null == wxMerchantTradeDaily) wxMerchantTradeDaily = new WxMerchantTradeDaily();
final PageInfo<WxMerchantTradeDaily> page = wxMerchantTradeDailyService.listAsPage(wxMerchantTradeDaily, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMerchantTradeDaily wxMerchantTradeDaily) {
//Assert.notNull(wxMerchantTradeDaily.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMerchantTradeDailyService.saveOrUpdate(wxMerchantTradeDaily);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMerchantTradeDaily wxMerchantTradeDaily) {
wxMerchantTradeDailyService.saveOrUpdate(wxMerchantTradeDaily);
return new ResultData();
@ApiOperation("获得当日解单")
@GetMapping("/getVolume")
public ResultData getVolume() {
return wxMerchantTradeDailyService.getVolume(getUser().getId());
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMerchantTradeDailyService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMerchantTradeDailyService.getById(id));
@ApiOperation("上报每日解单")
@GetMapping("/reportDailyVolume")
@ApiImplicitParam(name="volume",value="总金额(分)",dataType="Integer", paramType = "query",required=true)
public ResultData saveDailyTradingVolume(Integer volume) {
return wxMerchantTradeDailyService.saveDailyTradingVolume(getUser().getId(),volume);
}


+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxMsgCallbackController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMsgCallback;
import com.simple.service.WxMsgCallbackService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMsgCallback")
public class WxMsgCallbackController extends BaseController
{
@Autowired
private WxMsgCallbackService wxMsgCallbackService;

private Logger logger = Logger.getLogger(WxMsgCallbackController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMsgCallback wxMsgCallback,Integer pageNum, Integer pageSize) {
if (null == wxMsgCallback) wxMsgCallback = new WxMsgCallback();
final PageInfo<WxMsgCallback> page = wxMsgCallbackService.listAsPage(wxMsgCallback, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMsgCallback wxMsgCallback) {
//Assert.notNull(wxMsgCallback.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMsgCallbackService.saveOrUpdate(wxMsgCallback);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMsgCallback wxMsgCallback) {
wxMsgCallbackService.saveOrUpdate(wxMsgCallback);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMsgCallbackService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMsgCallbackService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxMsgConfigController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMsgConfig;
import com.simple.service.WxMsgConfigService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMsgConfig")
public class WxMsgConfigController extends BaseController
{
@Autowired
private WxMsgConfigService wxMsgConfigService;

private Logger logger = Logger.getLogger(WxMsgConfigController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMsgConfig wxMsgConfig,Integer pageNum, Integer pageSize) {
if (null == wxMsgConfig) wxMsgConfig = new WxMsgConfig();
final PageInfo<WxMsgConfig> page = wxMsgConfigService.listAsPage(wxMsgConfig, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMsgConfig wxMsgConfig) {
//Assert.notNull(wxMsgConfig.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMsgConfigService.saveOrUpdate(wxMsgConfig);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMsgConfig wxMsgConfig) {
wxMsgConfigService.saveOrUpdate(wxMsgConfig);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMsgConfigService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMsgConfigService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxMsgController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMsg;
import com.simple.service.WxMsgService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMsg")
public class WxMsgController extends BaseController
{
@Autowired
private WxMsgService wxMsgService;

private Logger logger = Logger.getLogger(WxMsgController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMsg wxMsg,Integer pageNum, Integer pageSize) {
if (null == wxMsg) wxMsg = new WxMsg();
final PageInfo<WxMsg> page = wxMsgService.listAsPage(wxMsg, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMsg wxMsg) {
//Assert.notNull(wxMsg.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMsgService.saveOrUpdate(wxMsg);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMsg wxMsg) {
wxMsgService.saveOrUpdate(wxMsg);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMsgService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMsgService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxMsgModelController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMsgModel;
import com.simple.service.WxMsgModelService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMsgModel")
public class WxMsgModelController extends BaseController
{
@Autowired
private WxMsgModelService wxMsgModelService;

private Logger logger = Logger.getLogger(WxMsgModelController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMsgModel wxMsgModel,Integer pageNum, Integer pageSize) {
if (null == wxMsgModel) wxMsgModel = new WxMsgModel();
final PageInfo<WxMsgModel> page = wxMsgModelService.listAsPage(wxMsgModel, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMsgModel wxMsgModel) {
//Assert.notNull(wxMsgModel.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMsgModelService.saveOrUpdate(wxMsgModel);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMsgModel wxMsgModel) {
wxMsgModelService.saveOrUpdate(wxMsgModel);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMsgModelService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMsgModelService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxMsgSignatureController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxMsgSignature;
import com.simple.service.WxMsgSignatureService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxMsgSignature")
public class WxMsgSignatureController extends BaseController
{
@Autowired
private WxMsgSignatureService wxMsgSignatureService;

private Logger logger = Logger.getLogger(WxMsgSignatureController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxMsgSignature wxMsgSignature,Integer pageNum, Integer pageSize) {
if (null == wxMsgSignature) wxMsgSignature = new WxMsgSignature();
final PageInfo<WxMsgSignature> page = wxMsgSignatureService.listAsPage(wxMsgSignature, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxMsgSignature wxMsgSignature) {
//Assert.notNull(wxMsgSignature.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxMsgSignatureService.saveOrUpdate(wxMsgSignature);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxMsgSignature wxMsgSignature) {
wxMsgSignatureService.saveOrUpdate(wxMsgSignature);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxMsgSignatureService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxMsgSignatureService.getById(id));
}
}

+ 2
- 0
mallinkBApi/src/main/java/com/simple/controller/WxMsgValidationcodeController.java Просмотреть файл

@@ -3,6 +3,7 @@ package com.simple.controller;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMsgValidationcode;
import com.simple.service.WxMsgValidationcodeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import org.apache.log4j.Logger;
@@ -13,6 +14,7 @@ import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("wxMsgValidationcode")
@Api(description="短信验证相关接口")
public class WxMsgValidationcodeController extends BaseController {
private Logger logger = Logger.getLogger(WxMsgValidationcodeController.class);



+ 6
- 4
mallinkBApi/src/main/java/com/simple/controller/WxOrderController.java Просмотреть файл

@@ -4,6 +4,7 @@ import com.simple.common.ErrorCode;
import com.simple.domain.po.WxMerchantBUser;
import com.simple.domain.vo.OrderVo;
import com.simple.enums.EnumOrderStatus;
import io.swagger.annotations.Api;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
@@ -25,6 +26,7 @@ import java.util.Map;

@RestController
@RequestMapping("/order")
@Api(description="订单相关接口")
public class WxOrderController extends BaseController {
private Logger logger = Logger.getLogger(WxOrderController.class);

@@ -60,13 +62,13 @@ public class WxOrderController extends BaseController {
String orderIdStr = paramMap.get("orderId");
String couponIdStr = paramMap.get("couponId");
if (StringUtils.isBlank(couponOrderIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空");
}
if (StringUtils.isBlank(orderIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
}
if (StringUtils.isBlank(couponIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空");
}
Long couponOrderId = 0L, orderId = 0L, couponId = 0L;
try {
@@ -92,7 +94,7 @@ public class WxOrderController extends BaseController {
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
String orderIdStr = paramMap.get("orderId");
if (StringUtils.isBlank(orderIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
}
Long orderId = 0L;
try {


+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxParkController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxPark;
import com.simple.service.WxParkService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxPark")
public class WxParkController extends BaseController
{
@Autowired
private WxParkService wxParkService;

private Logger logger = Logger.getLogger(WxParkController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxPark wxPark,Integer pageNum, Integer pageSize) {
if (null == wxPark) wxPark = new WxPark();
final PageInfo<WxPark> page = wxParkService.listAsPage(wxPark, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxPark wxPark) {
//Assert.notNull(wxPark.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxParkService.saveOrUpdate(wxPark);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxPark wxPark) {
wxParkService.saveOrUpdate(wxPark);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxParkService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxParkService.getById(id));
}
}

+ 0
- 133
mallinkBApi/src/main/java/com/simple/controller/WxPayOrderController.java Просмотреть файл

@@ -1,133 +0,0 @@
package com.simple.controller;

import com.simple.common.ErrorCode;
import com.simple.domain.po.WxAppinfo;
import com.simple.domain.po.WxCUser;
import com.simple.enums.EnumPayStatus;
import com.simple.enums.EnumPayWay;
import com.simple.exception.BizMessageException;
import com.simple.exception.MallinkException;
import com.simple.pay.WxPayment;
import com.simple.utils.IPUtil;
import org.apache.commons.codec.Charsets;
import org.apache.log4j.Logger;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxPayOrder;
import com.simple.service.WxPayOrderService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

import javax.servlet.http.HttpServletRequest;
import java.nio.charset.Charset;
import java.util.Map;

@RestController
@RequestMapping("wxPayOrder")
public class WxPayOrderController extends BaseController {

private Logger logger = Logger.getLogger(WxPayOrderController.class);

@Autowired
private WxPayOrderService wxPayOrderService;

/**
*
* @return 接收微信异步通知
* @throws Exception 可能产生的任何异常
*/
@RequestMapping(value = "/notify", method = RequestMethod.POST)
public String __doNotify(HttpServletRequest request) throws Exception {
Map<String, String> paramMap = null;
String response;
try {
String xml = IOUtils.toString(request.getInputStream(), Charset.forName("UTF-8"));
paramMap = WxPayment.xmlToMap(xml);
logger.info("payment wxpay, notify, param: " + paramMap.toString() );
response = wxPayOrderService.notify(paramMap, EnumPayWay.PAY_WAY_WEAPP);
logger.info("payment wxpay, notify success, req : " + paramMap.toString() + ", resp: " + response.toString());
return response;
} catch (BizMessageException e) {
logger.error("payment wxpay, notify error, req: " + paramMap.toString() + ", e:" + e.getLocalizedMessage());
return e.getMessage();
} catch (MallinkException e) {
logger.error("payment wxpay, notify error, req: " + paramMap.toString() + ", e:" +e.getLocalizedMessage());
return e.getMessage();
} catch (Exception e) {
logger.error("payment wxpay, order create error, req: " + paramMap.toString() + ", e: " + e.getMessage());
return e.getMessage();
}
}

/**
*
* @return 同步回调(订单状态主动检查)
* @throws Exception 可能产生的任何异常
*/
@RequestMapping(value = "callback", method = {RequestMethod.GET, RequestMethod.POST})
public String __doCallback(HttpServletRequest request) throws Exception {

logger.info("payment wxpay, callback,request:" + request.toString());

return "\n" +
"\n" +
"<xml>\n" +
"\n" +
" <return_code><![CDATA[SUCCESS]]></return_code>\n" +
" <return_msg><![CDATA[OK]]></return_msg>\n" +
"</xml>\n";
}
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxPayOrder wxPayOrder,Integer pageNum, Integer pageSize) {
if (null == wxPayOrder) wxPayOrder = new WxPayOrder();
final PageInfo<WxPayOrder> page = wxPayOrderService.listAsPage(wxPayOrder, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxPayOrder wxPayOrder) {
//Assert.notNull(wxPayOrder.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxPayOrderService.saveOrUpdate(wxPayOrder);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxPayOrder wxPayOrder) {
wxPayOrderService.saveOrUpdate(wxPayOrder);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxPayOrderService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxPayOrderService.getById(id));
}
}

+ 22
- 44
mallinkBApi/src/main/java/com/simple/controller/WxRefundOrderController.java Просмотреть файл

@@ -4,10 +4,13 @@ import com.github.pagehelper.PageInfo;
import com.simple.common.ErrorCode;
import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.po.*;
import com.simple.domain.po.WxAppinfo;
import com.simple.domain.po.WxMerchantBUser;
import com.simple.domain.po.WxRefundOrder;
import com.simple.enums.EnumPayWay;
import com.simple.exception.MallinkException;
import com.simple.service.WxRefundOrderService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
@@ -20,11 +23,11 @@ import java.util.Map;

@RestController
@RequestMapping("/api/refund")
public class WxRefundOrderController extends BaseController
{
@Api(description="退款相关接口")
public class WxRefundOrderController extends BaseController {
private Logger logger = Logger.getLogger(WxRefundOrderController.class);

@Autowired
@Autowired
private WxRefundOrderService wxRefundOrderService;

@ApiOperation(value = "发起退款", notes = "{\"orderId\":,\"string\", \"payOrderId\":\"string\"}")
@@ -37,18 +40,18 @@ public class WxRefundOrderController extends BaseController
String payOrderIdStr = paramMap.get("payOrderId");
if (StringUtils.isBlank(orderIdStr)) {
logger.error("orderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
if (StringUtils.isBlank(payOrderIdStr)) {
logger.error("payOrderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "payOrderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
Long orderId = 0L;
try {
orderId = Long.valueOf(orderIdStr);
} catch (NumberFormatException e) {
logger.error("orderId参数不正确: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL);
}
WxRefundOrder refundOrder = new WxRefundOrder();
refundOrder.setPayOrderNo(payOrderIdStr);
@@ -67,49 +70,24 @@ public class WxRefundOrderController extends BaseController
return new ResultData(ErrorCode.REFUND_ORDER_ERROR);
}
}
@ApiOperation("分页列表接口")
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxRefundOrder wxRefundOrder,Integer pageNum, Integer pageSize) {
if (null == wxRefundOrder) wxRefundOrder = new WxRefundOrder();
@ApiImplicitParams({
@ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true),
@ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)})
public ResultData list(@ModelAttribute WxRefundOrder wxRefundOrder, Integer pageNum, Integer pageSize) {
if (null == wxRefundOrder) wxRefundOrder = new WxRefundOrder();
final PageInfo<WxRefundOrder> page = wxRefundOrderService.listAsPage(wxRefundOrder, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxRefundOrder wxRefundOrder) {
//Assert.notNull(wxRefundOrder.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxRefundOrderService.saveOrUpdate(wxRefundOrder);
return new ResultData();
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS, "查询成功", wxRefundOrderService.getById(id));
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxRefundOrder wxRefundOrder) {
wxRefundOrderService.saveOrUpdate(wxRefundOrder);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxRefundOrderService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxRefundOrderService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxScoreHistoryController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxScoreHistory;
import com.simple.service.WxScoreHistoryService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxScoreHistory")
public class WxScoreHistoryController extends BaseController
{
@Autowired
private WxScoreHistoryService wxScoreHistoryService;

private Logger logger = Logger.getLogger(WxScoreHistoryController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxScoreHistory wxScoreHistory,Integer pageNum, Integer pageSize) {
if (null == wxScoreHistory) wxScoreHistory = new WxScoreHistory();
final PageInfo<WxScoreHistory> page = wxScoreHistoryService.listAsPage(wxScoreHistory, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxScoreHistory wxScoreHistory) {
//Assert.notNull(wxScoreHistory.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxScoreHistoryService.saveOrUpdate(wxScoreHistory);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxScoreHistory wxScoreHistory) {
wxScoreHistoryService.saveOrUpdate(wxScoreHistory);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxScoreHistoryService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxScoreHistoryService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxScoreRulesController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxScoreRules;
import com.simple.service.WxScoreRulesService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxScoreRules")
public class WxScoreRulesController extends BaseController
{
@Autowired
private WxScoreRulesService wxScoreRulesService;

private Logger logger = Logger.getLogger(WxScoreRulesController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxScoreRules wxScoreRules,Integer pageNum, Integer pageSize) {
if (null == wxScoreRules) wxScoreRules = new WxScoreRules();
final PageInfo<WxScoreRules> page = wxScoreRulesService.listAsPage(wxScoreRules, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxScoreRules wxScoreRules) {
//Assert.notNull(wxScoreRules.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxScoreRulesService.saveOrUpdate(wxScoreRules);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxScoreRules wxScoreRules) {
wxScoreRulesService.saveOrUpdate(wxScoreRules);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxScoreRulesService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxScoreRulesService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxScoreValidityPeriodController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxScoreValidityPeriod;
import com.simple.service.WxScoreValidityPeriodService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxScoreValidityPeriod")
public class WxScoreValidityPeriodController extends BaseController
{
@Autowired
private WxScoreValidityPeriodService wxScoreValidityPeriodService;

private Logger logger = Logger.getLogger(WxScoreValidityPeriodController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxScoreValidityPeriod wxScoreValidityPeriod,Integer pageNum, Integer pageSize) {
if (null == wxScoreValidityPeriod) wxScoreValidityPeriod = new WxScoreValidityPeriod();
final PageInfo<WxScoreValidityPeriod> page = wxScoreValidityPeriodService.listAsPage(wxScoreValidityPeriod, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxScoreValidityPeriod wxScoreValidityPeriod) {
//Assert.notNull(wxScoreValidityPeriod.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxScoreValidityPeriodService.saveOrUpdate(wxScoreValidityPeriod);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxScoreValidityPeriod wxScoreValidityPeriod) {
wxScoreValidityPeriodService.saveOrUpdate(wxScoreValidityPeriod);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxScoreValidityPeriodService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxScoreValidityPeriodService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxShopController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxShop;
import com.simple.service.WxShopService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxShop")
public class WxShopController extends BaseController
{
@Autowired
private WxShopService wxShopService;

private Logger logger = Logger.getLogger(WxShopController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxShop wxShop,Integer pageNum, Integer pageSize) {
if (null == wxShop) wxShop = new WxShop();
final PageInfo<WxShop> page = wxShopService.listAsPage(wxShop, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxShop wxShop) {
//Assert.notNull(wxShop.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxShopService.saveOrUpdate(wxShop);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxShop wxShop) {
wxShopService.saveOrUpdate(wxShop);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxShopService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxShopService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxTagsController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxTags;
import com.simple.service.WxTagsService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxTags")
public class WxTagsController extends BaseController
{
@Autowired
private WxTagsService wxTagsService;

private Logger logger = Logger.getLogger(WxTagsController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxTags wxTags,Integer pageNum, Integer pageSize) {
if (null == wxTags) wxTags = new WxTags();
final PageInfo<WxTags> page = wxTagsService.listAsPage(wxTags, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxTags wxTags) {
//Assert.notNull(wxTags.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxTagsService.saveOrUpdate(wxTags);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxTags wxTags) {
wxTagsService.saveOrUpdate(wxTags);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxTagsService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxTagsService.getById(id));
}
}

+ 0
- 71
mallinkBApi/src/main/java/com/simple/controller/WxWebLogController.java Просмотреть файл

@@ -1,71 +0,0 @@
package com.simple.controller;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
import com.simple.common.Result;
import com.simple.common.ResultData;

import com.simple.domain.po.WxWebLog;
import com.simple.service.WxWebLogService;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;

@RestController
@RequestMapping("wxWebLog")
public class WxWebLogController extends BaseController
{
@Autowired
private WxWebLogService wxWebLogService;

private Logger logger = Logger.getLogger(WxWebLogController.class);
@ApiOperation("分页列表接口")
@GetMapping("list")
@ApiImplicitParams({
@ApiImplicitParam(name="pageNum",value="页数",dataType="int", paramType = "query",required=true),
@ApiImplicitParam(name="pageSize",value="每页条数",dataType="int", paramType = "query",required=true)})
public ResultData list(@ModelAttribute WxWebLog wxWebLog,Integer pageNum, Integer pageSize) {
if (null == wxWebLog) wxWebLog = new WxWebLog();
final PageInfo<WxWebLog> page = wxWebLogService.listAsPage(wxWebLog, pageNum, pageSize);
return new ResultData(page);
}

@ApiOperation("新增接口")
@PostMapping("add")
public ResultData add(@RequestBody WxWebLog wxWebLog) {
//Assert.notNull(wxWebLog.getName(), "角色名不能为空");
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
wxWebLogService.saveOrUpdate(wxWebLog);
return new ResultData();
}

@ApiOperation("根据id更新接口")
@PostMapping("update")
public ResultData update(@RequestBody WxWebLog wxWebLog) {
wxWebLogService.saveOrUpdate(wxWebLog);
return new ResultData();
}

@ApiOperation("根据id删除接口")
@GetMapping("/del")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData delete(Long id) {
wxWebLogService.deleteById(id);
return new ResultData(Result.SUCCESS, "删除成功", null);
}
@ApiOperation("根据id查询接口")
@GetMapping("/findById")
@ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true)
public ResultData findById(Long id) {
return new ResultData(Result.SUCCESS,"查询成功",wxWebLogService.getById(id));
}
}

+ 2
- 4
mallinkBApi/src/main/java/com/simple/interceptor/AuthorizationInterceptor.java Просмотреть файл

@@ -3,10 +3,8 @@ package com.simple.interceptor;

import com.simple.annotation.AuthIgnore;
import com.simple.common.ErrorCode;
import com.simple.domain.po.WxCUser;
import com.simple.domain.po.WxMerchantBUser;
import com.simple.exception.MallinkException;
import com.simple.service.WxCUserService;
import com.simple.service.WxMerchantBUserService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
@@ -53,14 +51,14 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {

//token为空
if(StringUtils.isBlank(token)){
throw new MallinkException(ErrorCode.TOKEN_EMPTY);
throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY);
}

///// TODO use b端用户表
// 查询token信息
WxMerchantBUser wxMerchantBUser = wxMerchantBUserService.getByToken(token);
if(wxMerchantBUser == null || wxMerchantBUser.getExpireTime().getTime() < System.currentTimeMillis()){
throw new MallinkException(ErrorCode.TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录");
throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录");
}

//设置userId到request里,后续根据userId,获取用户信息


+ 75
- 47
mallinkCApi/src/main/java/com/simple/controller/WxCarController.java Просмотреть файл

@@ -8,6 +8,8 @@ import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.po.*;
import com.simple.enums.EnumCarVendor;
import com.simple.enums.EnumETCPCode;
import com.simple.enums.EnumTJDCode;
import com.simple.service.WxCUserCarService;
import com.simple.service.WxMerchantService;
import com.simple.service.WxParkService;
@@ -81,7 +83,7 @@ public class WxCarController extends BaseController
String phone = paramMap.get("phone");
if (StringUtils.isBlank(phone)) {
logger.error("手机号为空");
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "phone为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "phone为空");
}
String params = park.getVendorParams();
JSONObject objParams = JSON.parseObject(params);
@@ -93,7 +95,7 @@ public class WxCarController extends BaseController

String ret = etcp.userSignin(url, appId, merchantNo, merchantKey, version, phone);
JSONObject retObj = JSON.parseObject(ret);
if (retObj.getIntValue("code") == 0) {
if (retObj.getIntValue("code") == EnumETCPCode.SUCCESS.getCode()) {
// 获取绑定的车牌
JSONObject dataObj = retObj.getJSONObject("data");
String etcpToken = dataObj.getString("token");
@@ -114,6 +116,18 @@ public class WxCarController extends BaseController
return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "登录失败");
}

/**
* 同步
* @param cUserId
* @param tenantId
* @param iVendorType
* @param url
* @param merchantNo
* @param merchantKey
* @param version
* @param etcpToken
* @return
*/
private JSONObject syncCarNumbers(Long cUserId, String tenantId, int iVendorType,
String url, String merchantNo, String merchantKey, String version,
String etcpToken) {
@@ -205,12 +219,12 @@ public class WxCarController extends BaseController
String etcpToken = paramMap.get("etcpToken");
if (StringUtils.isBlank(etcpToken)) {
logger.error("etcpToken为空");
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "etcpToken为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空");
}
String carNumber = paramMap.get("carNumber");
if (StringUtils.isBlank(carNumber)) {
logger.error("carNumber为空");
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空");
}
String params = park.getVendorParams();
JSONObject objParams = JSON.parseObject(params);
@@ -244,17 +258,17 @@ public class WxCarController extends BaseController
String carNumber = paramMap.get("carNumber");
if (StringUtils.isBlank(carNumber)) {
logger.error("carNumber为空");
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空");
}
String carNumColor = paramMap.get("carNumColor");
if (StringUtils.isBlank(carNumColor)) {
logger.error("carNumColor为空");
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumColor为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumColor为空");
}
String outCarId = paramMap.get("outCarId");
if (StringUtils.isBlank(outCarId)) {
logger.error("outCarId为空");
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "outCarId为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "outCarId为空");
}
String params = park.getVendorParams();
JSONObject objParams = JSON.parseObject(params);
@@ -266,21 +280,26 @@ public class WxCarController extends BaseController
carNumber, carNumColor, null, outCarId);
JSONObject retObj = JSON.parseObject(ret);
retObj.put("vendor", park.getVendorType());
if (retObj.getString("returnCode") == "T") {
if (retObj.getString("returnCode").equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) {
String carId = retObj.getString("carId");
// 插入车牌
Date curr = new Date();
WxCUserCar userCar = new WxCUserCar();
userCar.setCUserId(user.getId());
userCar.setTenantId(user.getTenantId());
userCar.setCarNumber(carNumber);
userCar.setVendorType(EnumCarVendor.CAR_TJD.getCode());
JSONObject jo = new JSONObject();
jo.put("carId", carId);
userCar.setVendorParams(JSON.toJSONString(jo));
userCar.setCreateDate(curr);
userCar.setUpdateDate(curr);
wxCUserCarService.saveOrUpdate(userCar);
try {
WxCUserCar userCar = new WxCUserCar();
userCar.setCUserId(user.getId());
userCar.setTenantId(user.getTenantId());
userCar.setCarNumber(carNumber);
userCar.setVendorType(EnumCarVendor.CAR_TJD.getCode());
JSONObject jo = new JSONObject();
jo.put("carId", carId);
userCar.setVendorParams(JSON.toJSONString(jo));
userCar.setCreateDate(curr);
userCar.setUpdateDate(curr);
wxCUserCarService.saveOrUpdate(userCar);
} catch (Exception e) {
logger.error(e.getMessage());
return new ResultData(ErrorCode.DB_FAIL.getCode(), "TJD保存车牌失败, e:" + e.getMessage());
}
return new ResultData(retObj);
} else {
return new ResultData(ErrorCode.TJD_BIND_FAIL.getCode(), "绑车牌失败", retObj);
@@ -316,12 +335,12 @@ public class WxCarController extends BaseController
String etcpToken = paramMap.get("etcpToken");
if (StringUtils.isBlank(etcpToken)) {
logger.error("etcpToken为空");
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "etcpToken为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空");
}
String carNumber = paramMap.get("carNumber");
if (StringUtils.isBlank(carNumber)) {
logger.error("carNumber为空");
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空");
}
String params = park.getVendorParams();
JSONObject objParams = JSON.parseObject(params);
@@ -333,11 +352,17 @@ public class WxCarController extends BaseController
String ret = etcp.unbindCar(url, merchantNo, merchantKey, version, etcpToken, carNumber);
JSONObject retObj = JSON.parseObject(ret);
if (retObj.getIntValue("code") == 0) {
WxCUserCar userCar = new WxCUserCar();
userCar.setCUserId(user.getId());
userCar.setTenantId(user.getTenantId());
userCar.setCarNumber(carNumber);
wxCUserCarService.deleteByObj(userCar);
try {
WxCUserCar userCar = new WxCUserCar();
userCar.setCUserId(user.getId());
userCar.setTenantId(user.getTenantId());
userCar.setCarNumber(carNumber);
wxCUserCarService.deleteByObj(userCar);
} catch (Exception e) {
logger.error(e.getMessage());
return new ResultData(ErrorCode.DB_FAIL.getCode(), "解绑车牌数据库错误, e:" + e.getMessage());
}

return new ResultData();
} else {
logger.error("解绑车牌失败");
@@ -347,7 +372,7 @@ public class WxCarController extends BaseController
else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) {
String carNumber = paramMap.get("carNumber");
if (StringUtils.isBlank(carNumber)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空");
}
WxCUserCar queryOne = new WxCUserCar();
queryOne.setCarNumber(carNumber);
@@ -366,8 +391,14 @@ public class WxCarController extends BaseController
String version = objParams.getString("version");
String ret = tjd.writeOffCar(url, partner, key, version, carId);
JSONObject retObj = JSON.parseObject(ret);
if (retObj.getString("returnCode") == "T") {
wxCUserCarService.deleteByObj(userCar);
if (retObj.getString("returnCode").equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) {
try {
wxCUserCarService.deleteByObj(userCar);
} catch (Exception e) {
logger.error("解绑车牌数据库错误, e:" + e.getMessage());
return new ResultData(ErrorCode.DB_FAIL.getCode(), "解绑车牌数据库错误, e:" + e.getMessage());
}

return new ResultData();
} else {
return new ResultData(ErrorCode.TJD_UNBIND_FAIL, "解绑车牌失败");
@@ -427,10 +458,10 @@ public class WxCarController extends BaseController
String etcpToken = paramMap.get("etcpToken");
String carNumber = paramMap.get("carNumber");
if (StringUtils.isBlank(etcpToken)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "etcpToken为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空");
}
if (StringUtils.isBlank(carNumber)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空");
}
String params = park.getVendorParams();
JSONObject objParams = JSON.parseObject(params);
@@ -453,7 +484,7 @@ public class WxCarController extends BaseController
else if (park.getVendorType() == EnumCarVendor.CAR_TJD.getCode()) {
String carNumber = paramMap.get("carNumber");
if (StringUtils.isBlank(carNumber)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空");
}
String params = park.getVendorParams();
JSONObject objParams = JSON.parseObject(params);
@@ -463,7 +494,7 @@ public class WxCarController extends BaseController
String version = objParams.getString("version");
String ret = tjd.infoForFreeMins(url, partner, key, version, carNumber);
JSONObject retObj = JSON.parseObject(ret);
if (retObj.getString("returnCode") == "T") {
if (retObj.getString("returnCode").equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) {
return new ResultData(retObj);
} else {
return new ResultData(ErrorCode.TJD_STOP_FEE_FAIL.getCode(), "停车费获取失败");
@@ -495,16 +526,16 @@ public class WxCarController extends BaseController
String accountId = paramMap.get("accountId");
String outTradeNo = paramMap.get("orderId");
if (StringUtils.isBlank(tradeId)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "tradeId为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "tradeId为空");
}
if (StringUtils.isBlank(deductionAmount)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "deductionAmount为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "deductionAmount为空");
}
if (StringUtils.isBlank(accountId)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "accountId为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "accountId为空");
}
if (StringUtils.isBlank(outTradeNo)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId为空");
}
String params = park.getVendorParams();
JSONObject objParams = JSON.parseObject(params);
@@ -514,7 +545,7 @@ public class WxCarController extends BaseController
String version = objParams.getString("version");
String ret = tjd.deductionNotSettle(url, partner, key, version, tradeId, deductionAmount, outTradeNo, accountId);
JSONObject retObj = JSON.parseObject(ret);
if (retObj.getString("returnCode") == "T") {
if (retObj.getString("returnCode").equalsIgnoreCase(EnumTJDCode.SUCCESS.getMessage())) {
return new ResultData();
} else {
return new ResultData(ErrorCode.TJD_DEDUCE_FEE_FAIL.getCode(), "停车费抵扣失败");
@@ -554,19 +585,16 @@ public class WxCarController extends BaseController
String couponFreeId = paramMap.get("couponFreeId");
String merchantIdStr = paramMap.get("merchantId");
if (StringUtils.isBlank(etcpToken)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "etcpToken为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "etcpToken为空");
}
if (StringUtils.isBlank(carNumber)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空");
}
if (StringUtils.isBlank(carNumber)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "carNumber为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "carNumber为空");
}
if (StringUtils.isBlank(couponFreeId)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponFreeId为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponFreeId为空");
}
if (StringUtils.isBlank(merchantIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "merchantId为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "merchantId为空");
}
String params = park.getVendorParams();
JSONObject objParams = JSON.parseObject(params);
@@ -586,10 +614,10 @@ public class WxCarController extends BaseController
String ret = etcp.bCouponRecord(url, merchantNo, merchantKey, version,
etcpToken, parkId, businessId, carNumber, couponFreeId);
JSONObject retObj = JSON.parseObject(ret);
if (retObj.getIntValue("code") == 0) {
if (retObj.getIntValue("code") == EnumETCPCode.SUCCESS.getCode()) {
return new ResultData();
} else {
return new ResultData(ErrorCode.ETCP_QUAN_SEND_FAIL.getCode(), "优免券领取失败");
return new ResultData(ErrorCode.ETCP_QUAN_SEND_FAIL.getCode(), retObj.getString("message"));
}
}
return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "优免券领取失败");


+ 4
- 4
mallinkCApi/src/main/java/com/simple/controller/WxCouponOrderController.java Просмотреть файл

@@ -35,14 +35,14 @@ public class WxCouponOrderController extends BaseController {
String couponOrderIdStr = paramMap.get("couponOrderId");
if (StringUtils.isBlank(couponOrderIdStr)) {
logger.error("couponOrderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空");
}
Long couponOrderId = 0L;
try {
couponOrderId = Long.valueOf(couponOrderIdStr);
} catch (NumberFormatException e) {
logger.error("couponOrderId参数不正确: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确");
}
try {
ResultData rd = wxCouponOrderService.refund(couponOrderId, getUser().getId());
@@ -80,7 +80,7 @@ public class WxCouponOrderController extends BaseController {
String couponOrderIdStr = paramMap.get("couponOrderId");
if (StringUtils.isBlank(couponOrderIdStr)) {
logger.error("couponOrderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId不能为空");
}
Long couponOrderId = 0L;
try {
@@ -88,7 +88,7 @@ public class WxCouponOrderController extends BaseController {
} catch (NumberFormatException e) {
couponOrderId = 0L;
logger.error("couponOrderId参数不正确: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponOrderId参数不正确");
}
return new ResultData(Result.SUCCESS, "查询成功", wxCouponOrderService.getById(couponOrderId));
}


+ 8
- 10
mallinkCApi/src/main/java/com/simple/controller/WxOrderController.java Просмотреть файл

@@ -4,11 +4,9 @@ import com.simple.common.ErrorCode;
import com.simple.domain.po.WxCUser;
import com.simple.enums.EnumOrderStatus;
import com.simple.exception.MallinkException;
import io.swagger.models.auth.In;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.util.Assert;
import org.springframework.web.bind.annotation.*;

import com.github.pagehelper.PageInfo;
@@ -38,14 +36,14 @@ public class WxOrderController extends BaseController {
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
String couponIdStr = paramMap.get("couponId");
if (StringUtils.isBlank(couponIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空");
}
Long couponId = 0L;
try {
couponId = Long.valueOf(couponIdStr);
} catch (NumberFormatException e) {
logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage());
return new ResultData(ErrorCode.PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage());
return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage());
}

Long cUserId = getUserId();
@@ -69,14 +67,14 @@ public class WxOrderController extends BaseController {
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
String couponIdStr = paramMap.get("couponId");
if (StringUtils.isBlank(couponIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "couponId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponId不能为空");
}
Long couponId = 0L;
try {
couponId = Long.valueOf(couponIdStr);
} catch (NumberFormatException e) {
logger.error("couponId convert error, " + couponIdStr + ", e:" + e.getMessage());
return new ResultData(ErrorCode.PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage());
return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "couponId: " + couponIdStr + ", e:" + e.getMessage());
}
WxCUser user = getUser();

@@ -99,7 +97,7 @@ public class WxOrderController extends BaseController {
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
String orderIdStr = paramMap.get("orderId");
if (StringUtils.isBlank(orderIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
}
Long orderId = 0L;
WxCUser user = getUser();
@@ -107,7 +105,7 @@ public class WxOrderController extends BaseController {
orderId = Long.valueOf(orderIdStr);
} catch (NumberFormatException e) {
logger.error(e.getMessage());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL, "orderId: " + orderIdStr + ", e: " + e.getMessage());
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL, "orderId: " + orderIdStr + ", e: " + e.getMessage());
}
wxOrderService.updateOrderStatus(orderId, EnumOrderStatus.ORDER_STATUS_OVERTIME_CANCEL);
return new ResultData();
@@ -120,7 +118,7 @@ public class WxOrderController extends BaseController {
//Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名");
String orderIdStr = paramMap.get("orderId");
if (StringUtils.isBlank(orderIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
}
Long orderId = 0L;
WxCUser user = getUser();
@@ -155,7 +153,7 @@ public class WxOrderController extends BaseController {
public ResultData findById(@RequestBody Map<String, String> paramMap) {
String orderIdStr = paramMap.get("orderId");
if (StringUtils.isBlank(orderIdStr)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
}
Long orderId = 0L;
try {


+ 5
- 5
mallinkCApi/src/main/java/com/simple/controller/WxPayOrderController.java Просмотреть файл

@@ -49,7 +49,7 @@ public class WxPayOrderController extends BaseController {
String orderIdStr = paramMap.get("orderId");
if (StringUtils.isBlank(orderIdStr)) {
logger.info("orderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
}

WxCUser user = getUser();
@@ -59,7 +59,7 @@ public class WxPayOrderController extends BaseController {
try {
orderId = Long.valueOf(orderIdStr);
} catch (NumberFormatException e) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确");
}
WxPayOrder record = new WxPayOrder();
record.setOrderId(orderId);
@@ -86,7 +86,7 @@ public class WxPayOrderController extends BaseController {
Integer status = (Integer)paramMap.get("status");
if (StringUtils.isBlank(orderIdStr)) {
logger.info("orderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
}
Long payOrderId = 0L, orderId = 0L;
try {
@@ -94,14 +94,14 @@ public class WxPayOrderController extends BaseController {
} catch (NumberFormatException e) {
orderId = 0L;
logger.error("orderId参数不正确: " + paramMap.toString() + ", e:" + e.getMessage());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确");
}
if (!StringUtils.isBlank(payOrderIdStr)) {
try {
payOrderId = Long.valueOf(payOrderIdStr);
} catch (NumberFormatException e) {
logger.error("payOrderId参数不正确: " + paramMap.toString() + ", e:" + e.getMessage());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "payOrderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "payOrderId参数不正确");
}
}



+ 3
- 3
mallinkCApi/src/main/java/com/simple/controller/WxRefundOrderController.java Просмотреть файл

@@ -40,18 +40,18 @@ public class WxRefundOrderController extends BaseController
String payOrderIdStr = paramMap.get("payOrderId");
if (StringUtils.isBlank(orderIdStr)) {
logger.error("orderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空");
}
if (StringUtils.isBlank(payOrderIdStr)) {
logger.error("payOrderId不能为空: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "payOrderId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "payOrderId不能为空");
}
Long orderId = 0L;
try {
orderId = Long.valueOf(orderIdStr);
} catch (NumberFormatException e) {
logger.error("orderId参数不正确: " + paramMap.toString());
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "orderId参数不正确");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId参数不正确");
}
WxRefundOrder refundOrder = new WxRefundOrder();
refundOrder.setPayOrderNo(payOrderIdStr);


+ 36
- 6
mallinkCApi/src/main/java/com/simple/controller/WxUserGrantController.java Просмотреть файл

@@ -65,10 +65,10 @@ public class WxUserGrantController extends BaseController {
String sceneAddress = map.get("sceneAddress");
//登录凭证不能为空
if (StringUtils.isBlank(appId)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "appId不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "appId不能为空");
}
if (StringUtils.isBlank(code)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "code不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "code不能为空");
}

// 通过appinfo得到tenant_id
@@ -142,10 +142,10 @@ public class WxUserGrantController extends BaseController {
String iv = map.get("iv");

if (StringUtils.isBlank(encryptedData)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "encryptedData不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "encryptedData不能为空");
}
if (StringUtils.isBlank(iv)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "iv不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv不能为空");
}

WxCUser user = getUser();
@@ -201,10 +201,10 @@ public class WxUserGrantController extends BaseController {

//登录凭证不能为空
if (StringUtils.isBlank(encryptedData)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "encryptedData 不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "encryptedData 不能为空");
}
if (StringUtils.isBlank(iv)) {
return new ResultData(ErrorCode.PARAMETER_NOT_NULL.getCode(), "iv 不能为空");
return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "iv 不能为空");
}

WxCUser user = getUser();
@@ -233,6 +233,36 @@ public class WxUserGrantController extends BaseController {
}
}

/**
* 检查用户状态
* @return
*/
@GetMapping("/checkUserStatus")
@ApiOperation(value = "判断是否是老用户", notes="")
public ResultData checkUserStatus() {
Map resultMap = new HashMap();
WxCUser user = getUser();
if (!StringUtils.isBlank(user.getUnionId())) {
resultMap.put("unionId", user.getUnionId());
}
if (!StringUtils.isBlank(user.getPhone())) {
resultMap.put("phone", user.getPhone());
}
if (StringUtils.isBlank(user.getUnionId())) {
logger.warn("用户昵称未授权,跳转到用户授权页!");
return new ResultData(ErrorCode.NICK_NAME_NOT_FOUND.getCode(), "用户昵称未授权,请跳转到用户昵称授权页!", resultMap);
}
if (StringUtils.isBlank(user.getPhone())) {
logger.warn("用户手机号未授权,跳转到授权手机号页!");
return new ResultData(ErrorCode.PHONE_NOT_FOUND.getCode(), "用户手机号未授权,请跳转到授权手机号页!", resultMap);
}
if (user.getPhone().contains("*")) {
logger.warn("用户手机号已加密,跳转到手工输入手机号页!");
return new ResultData(ErrorCode.PHONE_IS_ENCRYPTED.getCode(), "用户手机号已加密,手工输入手机号页!", resultMap);
}
return new ResultData(Result.SUCCESS, "是老用户,已完成所有授权", resultMap);
}

@ApiOperation("获取当前用户信息")
@GetMapping("/userinfo")
public ResultData getUserInfo() {


+ 2
- 3
mallinkCApi/src/main/java/com/simple/interceptor/AuthorizationInterceptor.java Просмотреть файл

@@ -8,7 +8,6 @@ import com.simple.exception.MallinkException;
import com.simple.service.WxCUserService;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.mail.MailException;
import org.springframework.stereotype.Component;
import org.springframework.web.method.HandlerMethod;
import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
@@ -52,13 +51,13 @@ public class AuthorizationInterceptor extends HandlerInterceptorAdapter {

//token为空
if(StringUtils.isBlank(token)){
throw new MallinkException(ErrorCode.TOKEN_EMPTY);
throw new MallinkException(ErrorCode.NET_TOKEN_EMPTY);
}

// 查询token信息
WxCUser wxCUser = wxCUserService.getByToken(token);
if(wxCUser == null || wxCUser.getExpireTime().getTime() < System.currentTimeMillis()){
throw new MallinkException(ErrorCode.TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录");
throw new MallinkException(ErrorCode.NET_TOKEN_INVALID.getCode(), "URL:" + request.getRequestURL() + " token失效,请重新登录");
}

//设置userId到request里,后续根据userId,获取用户信息


+ 51
- 26
mallinkService/src/main/java/com/simple/common/ErrorCode.java Просмотреть файл

@@ -12,29 +12,35 @@ public enum ErrorCode{
* 系统级别
* 1000-1999
*/
SERVER_ERROR(1000, "服务器请求异常"),
PARAMETER_ERROR(1001, "参数不合法"),
PARAMETER_NOT_NULL(1002, "参数不能为空"),
PARAMETER_TYPE_ERROR(1003, "参数类型异常"),
PARAMETER_CAST_ERROR(1004, "参数转换异常"),
PARAMETER_EMPTY_ERROR(1005, "参数转换异常"),
BEAN_EMPTY_PROPERTY_ERROR(1006, "实体转换异常"),
MEDIATYPE_NOT_SUPPORT(1007, "不支持的媒体类型"),
NULLPOINTER_ERROR(1008, "空指针异常"),
METHOD_NOT_SUPPORT(1009, "不支持的请求类型"),
CLASSCAST_ERROR(1010, "类型转换异常"),
NUMBER_FORMAT_ERROR(1011, "数字转化异常"),
EXTEND_JSON_ERROR(1012, "JSON格式异常"),
REPEAT_SUBMIT_EXCEPTION(1013, "请勿重复操作"),

LOGIN_DENIED(1014, "登录失败"),
TOKEN_INVALID(1015, "TOKEN无效"),
TOKEN_EMPTY(1016, "token不能为空"),
SYS_SERVER_ERROR(1000, "服务器请求异常"),
SYS_PARAMETER_ERROR(1001, "参数不合法"),
SYS_PARAMETER_NOT_NULL(1002, "参数不能为空"),
SYS_PARAMETER_TYPE_ERROR(1003, "参数类型异常"),
SYS_PARAMETER_CAST_ERROR(1004, "参数转换异常"),
SYS_PARAMETER_EMPTY_ERROR(1005, "参数转换异常"),
SYS_BEAN_EMPTY_PROPERTY_ERROR(1006, "实体转换异常"),
SYS_MEDIATYPE_NOT_SUPPORT(1007, "不支持的媒体类型"),
SYS_NULLPOINTER_ERROR(1008, "空指针异常"),
SYS_METHOD_NOT_SUPPORT(1009, "不支持的请求类型"),
SYS_CLASSCAST_ERROR(1010, "类型转换异常"),
SYS_NUMBER_FORMAT_ERROR(1011, "数字转化异常"),
SYS_EXTEND_JSON_ERROR(1012, "JSON格式异常"),
SYS_REPEAT_SUBMIT_EXCEPTION(1013, "请勿重复操作"),

/**
* 数据库
*/
DB_FAIL(1045, "数据库访问出错"),

/**
* 网络
*/
TOO_MANY_REQUEST(1050, "太多的请求访问"),

LOGIN_DENIED(1051, "登录失败"),
NET_TOKEN_INVALID(1052, "TOKEN无效"),
NET_TOKEN_EMPTY(1053, "TOKEN不能为空"),


/**
* 业务级别
@@ -48,9 +54,20 @@ public enum ErrorCode{
USER_IS_LOCKED(2003, "用户已经被锁定不能登录,请与管理员联系"),
NEW_USER_FAILD(2004, "创建新用户失败"),

/**
* 商场/商户
*/
MALL_INFO_NOT_FOUND(2010, "商场信息没找到"),
MERCHANT_INFO_NOT_FOUND(2011, "商户信息没找到"),
MERCHANT_INFO_NOT_EQUAL(2012, "商户信息不对应"),
MERCHANT_INFO_NOT_VALID(2013, "商户信息禁用"),


/**
* 券
*/
COUPON_IS_EMPTY(2020, "券不存在"),
COUPON_IS_NOT_FREE(2021, "券不存在"),
COUPON_IS_NOT_FREE(2021, "券不免费"),

/**
* 车流 2040
@@ -95,7 +112,10 @@ public enum ErrorCode{
*/
SESSION_KEY_DECODE_ERR(11001, "session_key/openId解密失败"),
NICK_NAME_DECODE_ERR(11002, "nickName,unionId解密失败"),
PHONE_DECODE_ERR(11002, "Phoned解密失败"),
PHONE_DECODE_ERR(11003, "Phone解密失败"),
NICK_NAME_NOT_FOUND(11004, "nickName,unionId未授权"),
PHONE_NOT_FOUND(11005, "Phone未授权"),
PHONE_IS_ENCRYPTED(11006, "Phone已加密"),


/**
@@ -114,8 +134,8 @@ public enum ErrorCode{
REFUND_ORDER_NOTIFY_CHECK_SIGN_ERROR(12014, "退款验签失败"),

APP_ID_NOT_FOUND(12020, "APPID没找到"),
MCH_INFO_NOT_FOUND(12021, "商户信息没找到"),
MCH_INFO_NOT_EQUAL(12022, "商户信息不对应"),
MCH_INFO_NOT_FOUND(12021, "微信商户平台信息没找到"),
MCH_INFO_NOT_EQUAL(12022, "微信商户平台信息不对应"),
API_KEY_NOT_FOUND(12023, "支付密钥未配置"),
CERT_PATH_NOT_FOUND(12024, "双向证书未配置"),

@@ -123,14 +143,19 @@ public enum ErrorCode{
PROFIT_SHARING_APPLY_FAILED(12031, "分账业务失败"),
PROFIT_SHARING_RETURN_INVALID(12032, "分账请求返回校验失败"),
PROFIT_SHARING_RECEIVER_INVALID(12033, "分账接受方查寻无效"),
PROFIT_SHARING_QUERY_REQUEST_FAILED(12030, "分账查询请求失败"),
PROFIT_SHARING_QUERY_APPLY_FAILED(12031, "分账查询业务失败"),
PROFIT_SHARING_QUERY_RETURN_INVALID(12032, "分账查询返回校验失败"),
PROFIT_SHARING_QUERY_REQUEST_FAILED(12034, "分账查询请求失败"),
PROFIT_SHARING_QUERY_APPLY_FAILED(12035, "分账查询业务失败"),
PROFIT_SHARING_QUERY_RETURN_INVALID(12036, "分账查询返回校验失败"),
/**
* 核销
*/
VERIFY_ERROR(12050, "核销异常"),
MSG_REPEAT_SEND(12061, "短信重新发送")
MSG_REPEAT_SEND(12061, "短信重新发送"),

/**
* 解单
*/
DALIY_REPORT_VOLUME_TODAY_NULL(12070, "今日解单不存在")

;



+ 5
- 0
mallinkService/src/main/java/com/simple/common/ResultData.java Просмотреть файл

@@ -82,6 +82,11 @@ public class ResultData extends Result {
this.data = data;
}

public ResultData(ErrorCode errorCode) {
this.code = errorCode.getCode();
this.message = errorCode.getMessage();
}

public HashMap<String, Object> toHashMap() {
HashMap<String, Object> map = new HashMap<>(3);
map.put("code", this.code);


+ 80
- 0
mallinkService/src/main/java/com/simple/domain/dto/WxCuerBasicInfoDto.java Просмотреть файл

@@ -0,0 +1,80 @@
package com.simple.domain.dto;
import java.io.Serializable;
import java.util.Date;
import javax.persistence.Transient;
/**
* 用户查询dto
* @author jinguo
*
*/
public class WxCuerBasicInfoDto implements Serializable{
/**
*
*/
private static final long serialVersionUID = -1116465873573690766L;
@io.swagger.annotations.ApiModelProperty(value="开始时间",name="startTime")
private Date startTime;
@io.swagger.annotations.ApiModelProperty(value="结束时间",name="endTime")
private Date endTime;
@io.swagger.annotations.ApiModelProperty(value="手机号",name="phone")
private String phone;
@io.swagger.annotations.ApiModelProperty(value="姓名",name="name")
private String name;
/*租户id**/
// @io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId")
@Transient
private String tenantId;
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getTenantId() {
return tenantId;
}
public void setTenantId(String tenantId) {
this.tenantId = tenantId;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getEndTime() {
return endTime;
}
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
public String getPhone() {
return phone;
}
public void setPhone(String phone) {
this.phone = phone;
}
}

+ 16
- 5
mallinkService/src/main/java/com/simple/domain/po/WxAppinfo.java Просмотреть файл

@@ -1,12 +1,11 @@
package com.simple.domain.po;

import javax.persistence.*;
import java.util.*;
import java.math.*;
import javax.persistence.Transient;
import java.util.List;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Table(name = "wx_appinfo")
public class WxAppinfo implements Serializable {
@@ -75,9 +74,13 @@ public class WxAppinfo implements Serializable {
/*支付ID,参看wx_pay_account**/
@io.swagger.annotations.ApiModelProperty(value="支付ID,参看wx_pay_account",name="payId")
private Long payId;
@io.swagger.annotations.ApiModelProperty(value="1B端2C端",name="type")
private Integer type;

public String getTenantId() {
return tenantId;
}

public void setTenantId(String _tenantId) {
tenantId = _tenantId;
}
@@ -142,7 +145,13 @@ public class WxAppinfo implements Serializable {
payId = _payId;
}

public Integer getType() {
return type;
}

public void setType(Integer type) {
this.type = type;
}

public static enum Field
{
@@ -158,6 +167,8 @@ public class WxAppinfo implements Serializable {
,LastTokenTime_ASC("`lastTokenTime` ASC"),LastTokenTime_DESC("`lastTokenTime` DESC")
,ExpiresIn_ASC("`expiresIn` ASC"),ExpiresIn_DESC("`expiresIn` DESC")
,PayId_ASC("`payId` ASC"),PayId_DESC("`payId` DESC")
,Type_ASC("`type` ASC"),Type_DESC("`type` DESC")

;
private String value;
Field(String value){


+ 11
- 19
mallinkService/src/main/java/com/simple/domain/po/WxCUserBasicInfo.java Просмотреть файл

@@ -78,17 +78,16 @@ public class WxCUserBasicInfo implements Serializable {
/*租户id**/
@io.swagger.annotations.ApiModelProperty(value="租户id",name="tenantId")
private String tenantId;
/*商户id**/
@io.swagger.annotations.ApiModelProperty(value="商户id",name="merchantId")
private Long merchantId;
@io.swagger.annotations.ApiModelProperty(value="标签-传json",name="tags")
/*用户姓名**/
@io.swagger.annotations.ApiModelProperty(value="用户姓名",name="name")
private String name;
@Transient
private String tags ;
private String tags;
@Transient
private List<WxTags> tagList;

public List<WxTags> getTagList() {
return tagList;
}
@@ -97,14 +96,6 @@ public class WxCUserBasicInfo implements Serializable {
this.tagList = tagList;
}

public Long getcUserId() {
return cUserId;
}

public void setcUserId(Long cUserId) {
this.cUserId = cUserId;
}

public String getTags() {
return tags;
}
@@ -185,11 +176,12 @@ public class WxCUserBasicInfo implements Serializable {
public void setTenantId(String _tenantId) {
tenantId = _tenantId;
}
public Long getMerchantId() {
return merchantId;
public String getName() {
return name;
}
public void setMerchantId(Long _merchantId) {
merchantId = _merchantId;
public void setName(String _name) {
name = _name;
}


@@ -209,7 +201,7 @@ public class WxCUserBasicInfo implements Serializable {
,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC")
,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC")
,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
,MerchantId_ASC("`merchantId` ASC"),MerchantId_DESC("`merchantId` DESC")
,Name_ASC("`name` ASC"),Name_DESC("`name` DESC")
;
private String value;
Field(String value){


+ 56
- 45
mallinkService/src/main/java/com/simple/domain/po/WxCouponActionLog.java Просмотреть файл

@@ -11,15 +11,15 @@ import java.io.Serializable;
@Table(name = "wx_coupon_action_log")
public class WxCouponActionLog implements Serializable {
private static final long serialVersionUID = 1L;
@Id
protected Long id;
@Transient
protected List<String> ids;
@Transient
protected String sortColumns;
protected Long id;
@Transient
protected List<Long> ids;
@Transient
protected String sortColumns;
public Long getId() {
return id;
}
@@ -27,35 +27,39 @@ public class WxCouponActionLog implements Serializable {
public void setId(Long id) {
this.id = id;
}
public String getSortColumns() {
return sortColumns;
}
public List<String> getIds() {
public List<Long> getIds() {
return ids;
}
public void setIds(List<String> ids) {

public void setIds(List<Long> ids) {
this.ids = ids;
}
/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
/*coupon id**/
@io.swagger.annotations.ApiModelProperty(value="coupon id",name="couponId")
private Long couponId;
/*用户id**/
@io.swagger.annotations.ApiModelProperty(value="用户id",name="userId")
private Long userId;
/*优惠券操作(领取、支付,使用,核销等)**/
@io.swagger.annotations.ApiModelProperty(value="优惠券操作(领取、支付,使用,核销等)",name="action")
private String action;
/*操作时间**/
@io.swagger.annotations.ApiModelProperty(value="操作时间",name="operationTime")
private Date operationTime;
/***/
@io.swagger.annotations.ApiModelProperty(value="",name="couponOrderId")
private Long couponOrderId;
/*0:精准 1:主动领取 2:用户购买 3:停车 4:核销**/
@io.swagger.annotations.ApiModelProperty(value="0:精准 1:主动领取 2:用户购买 3:停车 4:核销",name="channelType")
private Integer channelType;
/***/
@io.swagger.annotations.ApiModelProperty(value="",name="channelId")
private Long channelId;
/***/
@io.swagger.annotations.ApiModelProperty(value="",name="createtime")
private Date createtime;
public String getTenantId() {
return tenantId;
}
@@ -68,23 +72,29 @@ public class WxCouponActionLog implements Serializable {
public void setCouponId(Long _couponId) {
couponId = _couponId;
}
public Long getUserId() {
return userId;
public Long getCouponOrderId() {
return couponOrderId;
}
public void setCouponOrderId(Long _couponOrderId) {
couponOrderId = _couponOrderId;
}
public Integer getChannelType() {
return channelType;
}
public void setUserId(Long _userId) {
userId = _userId;
public void setChannelType(Integer _channelType) {
channelType = _channelType;
}
public String getAction() {
return action;
public Long getChannelId() {
return channelId;
}
public void setAction(String _action) {
action = _action;
public void setChannelId(Long _channelId) {
channelId = _channelId;
}
public Date getOperationTime() {
return operationTime;
public Date getCreatetime() {
return createtime;
}
public void setOperationTime(Date _operationTime) {
operationTime = _operationTime;
public void setCreatetime(Date _createtime) {
createtime = _createtime;
}


@@ -92,12 +102,13 @@ public class WxCouponActionLog implements Serializable {
public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC")
,UserId_ASC("`userId` ASC"),UserId_DESC("`userId` DESC")
,Action_ASC("`action` ASC"),Action_DESC("`action` DESC")
,OperationTime_ASC("`operationTime` ASC"),OperationTime_DESC("`operationTime` DESC")
;
,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
,CouponId_ASC("`couponId` ASC"),CouponId_DESC("`couponId` DESC")
,CouponOrderId_ASC("`couponOrderId` ASC"),CouponOrderId_DESC("`couponOrderId` DESC")
,ChannelType_ASC("`channelType` ASC"),ChannelType_DESC("`channelType` DESC")
,ChannelId_ASC("`channelId` ASC"),ChannelId_DESC("`channelId` DESC")
,Createtime_ASC("`createtime` ASC"),Createtime_DESC("`createtime` DESC")
;
private String value;
Field(String value){
this.value = value;
@@ -113,7 +124,7 @@ public class WxCouponActionLog implements Serializable {
return this.getValue();
}
}
public void setSortColumns(WxCouponActionLog.Field... fields)
{
if (fields == null || fields.length == 0) {
@@ -129,9 +140,9 @@ public class WxCouponActionLog implements Serializable {
sb.append(",");
sb.append(fields[k].toString());
}
}
public void setSortColumns(String sortColumns)
{
if (sortColumns == null || "".equals(sortColumns.trim())) {


+ 14
- 2
mallinkService/src/main/java/com/simple/domain/po/WxMall.java Просмотреть файл

@@ -82,6 +82,8 @@ public class WxMall implements Serializable {
private Long payId;
@io.swagger.annotations.ApiModelProperty(value="电话",name="servicePhone")
private String servicePhone;
@io.swagger.annotations.ApiModelProperty(value="商场图标",name="imgUrl")
private String imgUrl;

public String getTenantId() {
return tenantId;
@@ -166,8 +168,16 @@ public class WxMall implements Serializable {
return servicePhone;
}

public void setServicePhone(String servicePhone) {
this.servicePhone = servicePhone;
public void setServicePhone(String _servicePhone) {
this.servicePhone = _servicePhone;
}

public String getImgUrl() {
return imgUrl;
}

public void setImgUrl(String _imgUrl) {
this.imgUrl = _imgUrl;
}

public static enum Field
@@ -186,6 +196,8 @@ public class WxMall implements Serializable {
,ParkArea_ASC("`parkArea` ASC"),ParkArea_DESC("`parkArea` DESC")
,ParkPlaceNumber_ASC("`parkPlaceNumber` ASC"),ParkPlaceNumber_DESC("`parkPlaceNumber` DESC")
,PayId_ASC("`payId` ASC"),PayId_DESC("`payId` DESC")
,ServicePhone_ASC("`servicePhone` ASC"),ServicePhone_DESC("`servicePhone` DESC")
,ImgUrl_ASC("`imgUrl` ASC"),ImgUrl_DESC("`imgUrl` DESC")
;
private String value;
Field(String value){


+ 9
- 6
mallinkService/src/main/java/com/simple/domain/po/WxMerchant.java Просмотреть файл

@@ -68,8 +68,8 @@ public class WxMerchant implements Serializable {
@io.swagger.annotations.ApiModelProperty(value="银行开户行",name="bankName")
private String bankName;
/*支付ID,参看wx_pay_account**/
@io.swagger.annotations.ApiModelProperty(value="支付ID,参看wx_pay_account",name="payId")
private Long payId;
@io.swagger.annotations.ApiModelProperty(value="收款帐户",name="receiver_account")
private Long receiverAccount;
/*创建时间**/
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
private Date createDate;
@@ -122,12 +122,15 @@ public class WxMerchant implements Serializable {
public void setBankName(String _bankName) {
bankName = _bankName;
}
public Long getPayId() {
return payId;

public Long getReceiverAccount() {
return receiverAccount;
}
public void setPayId(Long _payId) {
payId = _payId;

public void setReceiverAccount(Long receiverAccount) {
this.receiverAccount = receiverAccount;
}

public Date getCreateDate() {
return createDate;
}


+ 2
- 3
mallinkService/src/main/java/com/simple/domain/po/WxMerchantBUser.java Просмотреть файл

@@ -43,7 +43,6 @@ public class WxMerchantBUser implements Serializable {
}
/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
@@ -143,8 +142,8 @@ public class WxMerchantBUser implements Serializable {
return name;
}

public void setName(String name) {
this.name = name;
public void setName(String _name) {
this.name = _name;
}

public static enum Field


+ 25
- 5
mallinkService/src/main/java/com/simple/domain/po/WxMerchantTradeDaily.java Просмотреть файл

@@ -49,10 +49,17 @@ public class WxMerchantTradeDaily implements Serializable {
private Long merchantId;
/*交易额**/
@io.swagger.annotations.ApiModelProperty(value="交易额",name="tradeAmt")
private BigDecimal tradeAmt;
/*解单日期**/
@io.swagger.annotations.ApiModelProperty(value="解单日期",name="createDate")
private Integer tradeAmt;
/*提交日期**/
@io.swagger.annotations.ApiModelProperty(value="解单提交日期",name="createDate")
private Date createDate;
/*更新日期**/
@io.swagger.annotations.ApiModelProperty(value="解单更新日期",name="updateDate")
private Date updateDate;
/*解单日期**/
@io.swagger.annotations.ApiModelProperty(value="解单日期",name="reportDate")
private String reportDate;

public String getTenantId() {
return tenantId;
}
@@ -65,10 +72,10 @@ public class WxMerchantTradeDaily implements Serializable {
public void setMerchantId(Long _merchantId) {
merchantId = _merchantId;
}
public BigDecimal getTradeAmt() {
public Integer getTradeAmt() {
return tradeAmt;
}
public void setTradeAmt(BigDecimal _tradeAmt) {
public void setTradeAmt(Integer _tradeAmt) {
tradeAmt = _tradeAmt;
}
public Date getCreateDate() {
@@ -77,6 +84,19 @@ public class WxMerchantTradeDaily implements Serializable {
public void setCreateDate(Date _createDate) {
createDate = _createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date _updateDate) {
updateDate = _updateDate;
}

public String getReportDate() {
return reportDate;
}
public void setReportDate(String _reportDate) {
reportDate = _reportDate;
}





+ 161
- 161
mallinkService/src/main/java/com/simple/domain/po/WxTags.java Просмотреть файл

@@ -1,161 +1,161 @@
package com.simple.domain.po;
import javax.persistence.*;
import java.util.*;
import java.math.*;
import javax.persistence.Transient;
import java.util.List;
import javax.persistence.Id;
import java.io.Serializable;
@Table(name = "wx_tags")
public class WxTags implements Serializable {
private static final long serialVersionUID = 1L;
@Id
protected Long id;
@Transient
protected List<Long> ids;
@Transient
protected String sortColumns;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getSortColumns() {
return sortColumns;
}
public List<Long> getIds() {
return ids;
}
public void setIds(List<Long> ids) {
this.ids = ids;
}
/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
/*名称**/
@io.swagger.annotations.ApiModelProperty(value="名称",name="name")
private String name;
/*1基础2生活属性3消费偏好4行为偏好**/
@io.swagger.annotations.ApiModelProperty(value="1基础2生活属性3消费偏好4行为偏好",name="type1")
private String type1;
/*二级属性 性别等**/
@io.swagger.annotations.ApiModelProperty(value="二级属性 性别等",name="type2")
private String type2;
/*创建时间**/
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
private Date createDate;
/*更新时间**/
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
private Date updateDate;
public String getTenantId() {
return tenantId;
}
public void setTenantId(String _tenantId) {
tenantId = _tenantId;
}
public String getName() {
return name;
}
public void setName(String _name) {
name = _name;
}
public String getType1() {
return type1;
}
public void setType1(String _type1) {
type1 = _type1;
}
public String getType2() {
return type2;
}
public void setType2(String _type2) {
type2 = _type2;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date _createDate) {
createDate = _createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date _updateDate) {
updateDate = _updateDate;
}
public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
,Name_ASC("`name` ASC"),Name_DESC("`name` DESC")
,Type1_ASC("`type1` ASC"),Type1_DESC("`type1` DESC")
,Type2_ASC("`type2` ASC"),Type2_DESC("`type2` DESC")
,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC")
,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC")
;
private String value;
Field(String value){
this.value = value;
}
public String getValue() {
return value;
}
public void setCol(String value) {
this.value = value;
}
@Override
public String toString() {
return this.getValue();
}
}
public void setSortColumns(WxTags.Field... fields)
{
if (fields == null || fields.length == 0) {
return;
}
for (int k = 0; k < fields.length; k++) {
if (fields[k] == null) {
return;
}
}
StringBuilder sb = new StringBuilder(fields[0].toString());
for (int k = 1; k < fields.length; k++) {
sb.append(",");
sb.append(fields[k].toString());
}
}
public void setSortColumns(String sortColumns)
{
if (sortColumns == null || "".equals(sortColumns.trim())) {
return;
}
if (sortColumns.contains(",")) {
String[] cols = sortColumns.split(",");
java.util.List<Field> fList = new java.util.ArrayList();
for (int k = 0; k < cols.length; k++) {
fList.add(Field.valueOf(cols[k]));
}
this.setSortColumns(fList.toArray(new Field[fList.size()]));
} else {
this.setSortColumns(Field.valueOf(sortColumns));
}
}
}
package com.simple.domain.po;
import javax.persistence.*;
import java.util.*;
import java.math.*;
import javax.persistence.Transient;
import java.util.List;
import javax.persistence.Id;
import java.io.Serializable;
@Table(name = "wx_tags")
public class WxTags implements Serializable {
private static final long serialVersionUID = 1L;
@Id
protected Long id;
@Transient
protected List<Long> ids;
@Transient
protected String sortColumns;
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getSortColumns() {
return sortColumns;
}
public List<Long> getIds() {
return ids;
}
public void setIds(List<Long> ids) {
this.ids = ids;
}
/*租户ID**/
@io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId")
private String tenantId;
/*名称**/
@io.swagger.annotations.ApiModelProperty(value="名称",name="name")
private String name;
/*1基础2生活属性3消费偏好4行为偏好**/
@io.swagger.annotations.ApiModelProperty(value="1基础2生活属性3消费偏好4行为偏好",name="type1")
private String type1;
/*二级属性 性别等**/
@io.swagger.annotations.ApiModelProperty(value="二级属性 性别等",name="type2")
private String type2;
/*创建时间**/
@io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate")
private Date createDate;
/*更新时间**/
@io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate")
private Date updateDate;
public String getTenantId() {
return tenantId;
}
public void setTenantId(String _tenantId) {
tenantId = _tenantId;
}
public String getName() {
return name;
}
public void setName(String _name) {
name = _name;
}
public String getType1() {
return type1;
}
public void setType1(String _type1) {
type1 = _type1;
}
public String getType2() {
return type2;
}
public void setType2(String _type2) {
type2 = _type2;
}
public Date getCreateDate() {
return createDate;
}
public void setCreateDate(Date _createDate) {
createDate = _createDate;
}
public Date getUpdateDate() {
return updateDate;
}
public void setUpdateDate(Date _updateDate) {
updateDate = _updateDate;
}
public static enum Field
{
Id_ASC("`id` ASC"),Id_DESC("`id` DESC")
,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC")
,Name_ASC("`name` ASC"),Name_DESC("`name` DESC")
,Type1_ASC("`type1` ASC"),Type1_DESC("`type1` DESC")
,Type2_ASC("`type2` ASC"),Type2_DESC("`type2` DESC")
,CreateDate_ASC("`createDate` ASC"),CreateDate_DESC("`createDate` DESC")
,UpdateDate_ASC("`updateDate` ASC"),UpdateDate_DESC("`updateDate` DESC")
;
private String value;
Field(String value){
this.value = value;
}
public String getValue() {
return value;
}
public void setCol(String value) {
this.value = value;
}
@Override
public String toString() {
return this.getValue();
}
}
public void setSortColumns(WxTags.Field... fields)
{
if (fields == null || fields.length == 0) {
return;
}
for (int k = 0; k < fields.length; k++) {
if (fields[k] == null) {
return;
}
}
StringBuilder sb = new StringBuilder(fields[0].toString());
for (int k = 1; k < fields.length; k++) {
sb.append(",");
sb.append(fields[k].toString());
}
}
public void setSortColumns(String sortColumns)
{
if (sortColumns == null || "".equals(sortColumns.trim())) {
return;
}
if (sortColumns.contains(",")) {
String[] cols = sortColumns.split(",");
java.util.List<Field> fList = new java.util.ArrayList();
for (int k = 0; k < cols.length; k++) {
fList.add(Field.valueOf(cols[k]));
}
this.setSortColumns(fList.toArray(new Field[fList.size()]));
} else {
this.setSortColumns(Field.valueOf(sortColumns));
}
}
}

+ 35
- 0
mallinkService/src/main/java/com/simple/enums/EnumETCPCode.java Просмотреть файл

@@ -0,0 +1,35 @@
package com.simple.enums;

/**
* Created by Stormeye on 2018/08/09.
*/
public enum EnumETCPCode {

SUCCESS(0, "ok"),
;

public static EnumETCPCode getEnum(Integer code) {
for (EnumETCPCode value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumETCPCode(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 36
- 0
mallinkService/src/main/java/com/simple/enums/EnumMerchantStatus.java Просмотреть файл

@@ -0,0 +1,36 @@
package com.simple.enums;

/**
* Created by Stormeye on 2018/08/09.
*/
public enum EnumMerchantStatus {

NOT_VALID(0, "已停用"),
VALID(1, "可用"),
;

public static EnumMerchantStatus getEnum(Integer code) {
for (EnumMerchantStatus value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumMerchantStatus(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 36
- 0
mallinkService/src/main/java/com/simple/enums/EnumTJDCode.java Просмотреть файл

@@ -0,0 +1,36 @@
package com.simple.enums;

/**
* Created by Stormeye on 2018/08/09.
*/
public enum EnumTJDCode {

SUCCESS(0, "T"),
FAIL(1, "F"),
;

public static EnumTJDCode getEnum(Integer code) {
for (EnumTJDCode value : values()) {
if (value.getCode().equals(code)) {
return value;
}
}
return null;
}

private Integer code;
private String message;

EnumTJDCode(Integer code, String message) {
this.code = code;
this.message = message;
}

public Integer getCode() {
return code;
}

public String getMessage() {
return message;
}
}

+ 3
- 1
mallinkService/src/main/java/com/simple/mapper/WxCUserBasicInfoMapper.java Просмотреть файл

@@ -3,6 +3,8 @@ package com.simple.mapper;
import java.util.*;
import com.simple.common.CommonMapper;
import org.apache.ibatis.annotations.Param;

import com.simple.domain.dto.WxCuerBasicInfoDto;
import com.simple.domain.po.WxCUserBasicInfo;

public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, String> {
@@ -11,7 +13,7 @@ public interface WxCUserBasicInfoMapper extends CommonMapper<WxCUserBasicInfo, S

List<WxCUserBasicInfo> list(WxCuerBasicInfoDto record);
}

+ 4
- 0
mallinkService/src/main/java/com/simple/mapper/WxCouponOrderMapper.java Просмотреть файл

@@ -8,4 +8,8 @@ import com.simple.domain.po.WxCouponOrder;
public interface WxCouponOrderMapper extends CommonMapper<WxCouponOrder, Long> {

List<WxCouponOrder> findList(WxCouponOrder wxCouponOrder);

List<WxCouponOrder> findListOfOrderedByDate(Map dateMap);
List<WxCouponOrder> findListOfVerifiedByDate(Map dateMap);

}

+ 106
- 0
mallinkService/src/main/java/com/simple/schedule/DaliyAmountSchedule.java Просмотреть файл

@@ -0,0 +1,106 @@
package com.simple.schedule;

import com.simple.domain.po.WxCouponOrder;
import com.simple.domain.po.WxMall;
import com.simple.domain.po.WxMerchant;
import com.simple.mapper.*;
import com.simple.service.WxDateAmountRecordService;
import com.simple.utils.*;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

@Component
public class DaliyAmountSchedule {

private final Logger logger = Logger.getLogger(DaliyAmountSchedule.class);


@Autowired
private WxMallMapper wxMallMapper;

@Autowired
private WxMerchantMapper wxMerchantMapper;


@Autowired
private WxCouponOrderMapper wxCouponOrderMapper;


@Autowired
private WxDateAmountRecordService wxDateAmountRecordService;




@Scheduled(cron = "0 0 23 * * ?") // 每天晚上11点盘点
//@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次
public void daliyAmountSchedule() {


List<WxMall> mallList = wxMallMapper.findList(new WxMall());

if (mallList.size()==0) {
logger.info("No Mall info found");
return;
}

for (int i=0; i < mallList.size(); i++) {

WxMerchant merchant = new WxMerchant();
merchant.setTenantId(mallList.get(i).getTenantId());
List<WxMerchant> merchantList = wxMerchantMapper.findList(merchant);

if (merchantList.size()==0) {
logger.info("No merchant info found in mall" + mallList.get(i).getName());
continue;
}

for (int j=0; j < merchantList.size(); j++) {
merchant = merchantList.get(j);

HashMap dateMap = new HashMap();
SimpleDateFormat fmt = new SimpleDateFormat("yyyy-MM-dd");
String dateString = fmt.format(new Date());
try {
Date startDate = fmt.parse(dateString);
dateMap.put("startDate", startDate);
dateMap.put("endDate", new Date());
dateMap.put("merchantID",merchant.getId());

List<WxCouponOrder> list = wxCouponOrderMapper.findListOfOrderedByDate(dateMap);
logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date());
int total_price = 0;
for(WxCouponOrder couponOrder : list) {
total_price = total_price + couponOrder.getCouponPrice();
}
logger.info("\nFound " + list.size() + " coupon orders \n" +
"for " + merchant.getId() + "\n" +
"from " + startDate + " to " + new Date() +"\n" +
"TOTAL ORDER=" + total_price);


list= wxCouponOrderMapper.findListOfVerifiedByDate(dateMap);
logger.info("find " + list.size() + " coupon order from " + startDate + " to " + new Date());
total_price = 0;
for(WxCouponOrder couponOrder : list) {
total_price = total_price + couponOrder.getCouponPrice();
}
logger.info("\nFound " + list.size() + " coupon orders \n" +
"for " + merchant.getId() + "\n" +
"from " + startDate + " to " + new Date() +"\n" +
"TOTAL VERIFIED=" + total_price);
//daliy amount 落表

} catch (ParseException e) {
logger.error("Parse date string failed");
}
}
}
}
}

+ 112
- 0
mallinkService/src/main/java/com/simple/schedule/MsgSendingSchedule.java Просмотреть файл

@@ -0,0 +1,112 @@
package com.simple.schedule;

import com.alibaba.fastjson.JSONObject;
import com.simple.domain.po.WxMsg;
import com.simple.domain.po.WxMsgConfig;
import com.simple.mapper.WxMsgConfigMapper;
import com.simple.mapper.WxMsgMapper;
import com.simple.utils.*;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.util.*;

@Component
public class MsgSendingSchedule {

private final Logger logger = Logger.getLogger(MsgSendingSchedule.class);

@Autowired
private WxMsgMapper wxMsgMapper;

@Autowired
private WxMsgConfigMapper wxMsgConfigMapper;


@Scheduled(cron = "0 1 * * * ?") // 每小时第一分钟执行
public void sendmsgschedule() {

logger.info("sendmsg定时任务启动");

String systemTime = DateUtils.getSystemTime("yyyy-MM-dd HH:00:00");
WxMsg wxMsg = new WxMsg();
wxMsg.setIsright(0);
wxMsg.setSendtime(systemTime);
List<WxMsg> list = wxMsgMapper.findList(wxMsg);

for(WxMsg msg:list){
sendmsg(msg);
}

logger.info("sendmsg定时任务结束");
}

public void sendmsg(WxMsg wxMsg){
//从短信配置中查询密钥 bid 等信息
WxMsgConfig wxMsgConfig = new WxMsgConfig();
wxMsgConfig.setTenantId("1");
List<WxMsgConfig> wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig);
if (wxMsgConfigs.size() == 0) return;
wxMsgConfig = wxMsgConfigs.get(0);

String secret = wxMsgConfig.getSecret();
String bid = wxMsgConfig.getBid();
String publickey = wxMsgConfig.getPublickey();

String phone = wxMsg.getPhones();
String signature = wxMsg.getSignature();
String msg = wxMsg.getMsg();
String notifyUrl = wxMsgConfig.getNotifyurl();
TreeMap<String, String> message = new TreeMap<>();
message.put("bid", bid);
message.put("phone", phone);
message.put("signature", signature);
message.put("msg", msg);
message.put("notify_url", notifyUrl);

StringBuilder sb = new StringBuilder();
Set<Map.Entry<String, String>> entries = message.entrySet();
for (Map.Entry<String, String> entry : entries) {
sb.append(entry.getKey()).append("=").append(entry.getValue());
}
sb.append("&secret=").append(secret);
String sign = HMACSHA256.sha256_HMAC(sb.toString(), secret);
message.put("sign", sign.toUpperCase());

String str32 = "198b02e8fd704e96198b02e8fd704e96";
String iv = "198b02e8fd704e96";

Map<String, String> params = new HashMap<>();
params.put("iv", iv);
params.put("bid", bid);

try {
String data = AesUtil.AESEncode(str32, JSONObject.toJSONString(message), iv);
String sc = RsaUtil.RSAEncode(str32.getBytes(), publickey);
params.put("data", data);
params.put("sc", sc);
} catch (Exception e) {
e.printStackTrace();
}

String requestUrl = "https://webapp.wiwide.com/apisms/send";
String result = HttpUtil.doPost(requestUrl, params);
JSONObject jsonObjectResult = JSONObject.parseObject(result);
String ret = jsonObjectResult.get("ret").toString();

if (ret.equals("1")) {
wxMsg.setSendstatus(1);
} else {
wxMsg.setSendstatus(0);
}

wxMsg.setStatus(1);
wxMsgMapper.updateByPrimaryKeySelective(wxMsg);

}

}

+ 9
- 105
mallinkService/src/main/java/com/simple/schedule/SchedulingConfig.java Просмотреть файл

@@ -1,114 +1,18 @@
package com.simple.schedule;

import com.alibaba.fastjson.JSONObject;
import com.simple.domain.po.WxMsg;
import com.simple.domain.po.WxMsgConfig;
import com.simple.mapper.WxMsgConfigMapper;
import com.simple.mapper.WxMsgMapper;
import com.simple.utils.*;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;

import java.util.*;

@Configuration
@EnableScheduling
public class SchedulingConfig {

private final Logger logger = Logger.getLogger(SchedulingConfig.class);


@Autowired
private WxMsgMapper wxMsgMapper;

@Autowired
private WxMsgConfigMapper wxMsgConfigMapper;


@Scheduled(cron = "0 1 * * * ?") // 每小时第一分钟执行
public void sendmsgschedule() {

logger.info("sendmsg定时任务启动");

String systemTime = DateUtils.getSystemTime("yyyy-MM-dd HH:00:00");
WxMsg wxMsg = new WxMsg();
wxMsg.setIsright(0);
wxMsg.setSendtime(systemTime);
List<WxMsg> list = wxMsgMapper.findList(wxMsg);

for(WxMsg msg:list){
sendmsg(msg);
}

logger.info("sendmsg定时任务结束");
}

public void sendmsg(WxMsg wxMsg){
//从短信配置中查询密钥 bid 等信息
WxMsgConfig wxMsgConfig = new WxMsgConfig();
wxMsgConfig.setTenantId("1");
List<WxMsgConfig> wxMsgConfigs = wxMsgConfigMapper.findList(wxMsgConfig);
if (wxMsgConfigs.size() == 0) return;
wxMsgConfig = wxMsgConfigs.get(0);

String secret = wxMsgConfig.getSecret();
String bid = wxMsgConfig.getBid();
String publickey = wxMsgConfig.getPublickey();

String phone = wxMsg.getPhones();
String signature = wxMsg.getSignature();
String msg = wxMsg.getMsg();
String notifyUrl = wxMsgConfig.getNotifyurl();
TreeMap<String, String> message = new TreeMap<>();
message.put("bid", bid);
message.put("phone", phone);
message.put("signature", signature);
message.put("msg", msg);
message.put("notify_url", notifyUrl);

StringBuilder sb = new StringBuilder();
Set<Map.Entry<String, String>> entries = message.entrySet();
for (Map.Entry<String, String> entry : entries) {
sb.append(entry.getKey()).append("=").append(entry.getValue());
}
sb.append("&secret=").append(secret);
String sign = HMACSHA256.sha256_HMAC(sb.toString(), secret);
message.put("sign", sign.toUpperCase());

String str32 = "198b02e8fd704e96198b02e8fd704e96";
String iv = "198b02e8fd704e96";

Map<String, String> params = new HashMap<>();
params.put("iv", iv);
params.put("bid", bid);

try {
String data = AesUtil.AESEncode(str32, JSONObject.toJSONString(message), iv);
String sc = RsaUtil.RSAEncode(str32.getBytes(), publickey);
params.put("data", data);
params.put("sc", sc);
} catch (Exception e) {
e.printStackTrace();
}

String requestUrl = "https://webapp.wiwide.com/apisms/send";
String result = HttpUtil.doPost(requestUrl, params);
JSONObject jsonObjectResult = JSONObject.parseObject(result);
String ret = jsonObjectResult.get("ret").toString();

if (ret.equals("1")) {
wxMsg.setSendstatus(1);
} else {
wxMsg.setSendstatus(0);
}

wxMsg.setStatus(1);
wxMsgMapper.updateByPrimaryKeySelective(wxMsg);

}

public class SchedulingConfig { //implements SchedulingConfigurer {

// @Override
// public void configureTasks(ScheduledTaskRegistrar taskRegistrar) {
// ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler();
// scheduler.setPoolSize(10);
// scheduler.initialize();
// taskRegistrar.setTaskScheduler(scheduler);
// }

}

+ 3
- 2
mallinkService/src/main/java/com/simple/service/CouponInjectService.java Просмотреть файл

@@ -1,6 +1,7 @@
package com.simple.service;

import com.github.pagehelper.PageInfo;
import com.simple.common.ResultData;
import com.simple.domain.po.CouponInject;

public interface CouponInjectService {
@@ -37,11 +38,11 @@ public interface CouponInjectService {
*/
void deleteById(Long id);
/**
* 根据Id删除实体
* 精准投(立即投送处理)
*
* @param id
*/
void add(CouponInject record);
ResultData add(CouponInject record);


+ 2
- 2
mallinkService/src/main/java/com/simple/service/WxCUserBasicInfoService.java Просмотреть файл

@@ -1,7 +1,7 @@
package com.simple.service;

import java.util.*;
import com.github.pagehelper.PageInfo;
import com.simple.domain.dto.WxCuerBasicInfoDto;
import com.simple.domain.po.WxCUserBasicInfo;

public interface WxCUserBasicInfoService {
@@ -40,7 +40,7 @@ public interface WxCUserBasicInfoService {
PageInfo<WxCUserBasicInfo> list(WxCuerBasicInfoDto record, Integer pageIndex, Integer pageSize);


+ 2
- 0
mallinkService/src/main/java/com/simple/service/WxCouponActionLogService.java Просмотреть файл

@@ -37,6 +37,8 @@ public interface WxCouponActionLogService {
* @param id
*/
void deleteById(Long id);

void addOne(String tenantId,Long couponId,Long coupon_order_id,int channelType,Long channelId);


+ 4
- 7
mallinkService/src/main/java/com/simple/service/WxMallBuildingService.java Просмотреть файл

@@ -2,6 +2,7 @@ package com.simple.service;

import java.util.*;
import com.github.pagehelper.PageInfo;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMallBuilding;

public interface WxMallBuildingService {
@@ -37,12 +38,8 @@ public interface WxMallBuildingService {
* @param id
*/
void deleteById(Long id);


ResultData getbuildinglist(String tenantId);

}

+ 4
- 7
mallinkService/src/main/java/com/simple/service/WxMallFloorService.java Просмотреть файл

@@ -2,6 +2,7 @@ package com.simple.service;

import java.util.*;
import com.github.pagehelper.PageInfo;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMallFloor;

public interface WxMallFloorService {
@@ -37,12 +38,8 @@ public interface WxMallFloorService {
* @param id
*/
void deleteById(Long id);


ResultData getfloorlist(String tenantId, Long buildingId);

}

+ 16
- 3
mallinkService/src/main/java/com/simple/service/WxMerchantTradeDailyService.java Просмотреть файл

@@ -2,6 +2,7 @@ package com.simple.service;

import java.util.*;
import com.github.pagehelper.PageInfo;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMerchantTradeDaily;

public interface WxMerchantTradeDailyService {
@@ -37,10 +38,22 @@ public interface WxMerchantTradeDailyService {
* @param id
*/
void deleteById(Long id);


/**
* 上传当日解单数据
*
* @param id
* @param volume
*/

public ResultData saveDailyTradingVolume(Long userId, Integer volume);

/**
* 获取当日解单数据
*/

public ResultData getVolume(Long userId);


+ 53
- 31
mallinkService/src/main/java/com/simple/service/impl/CouponInjectServiceImpl.java Просмотреть файл

@@ -4,14 +4,14 @@ import com.alibaba.fastjson.JSON;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simple.common.IdWorker;
import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.po.*;
import com.simple.mapper.CouponInjectMapper;
import com.simple.service.CouponInjectService;
import com.simple.service.WxCUserTagsService;
import com.simple.service.WxCouponOrderService;
import com.simple.service.WxCouponService;
import com.simple.service.*;
import org.apache.commons.lang.time.DateUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@@ -31,6 +31,9 @@ public class CouponInjectServiceImpl implements CouponInjectService {
WxCouponService wxCouponService;
@Autowired
WxCUserTagsService wxCUserTagsService;
@Autowired
WxCouponActionLogService wxCouponActionLogService;
private Logger logger = Logger.getLogger(getClass());


@Override
@@ -61,13 +64,15 @@ public class CouponInjectServiceImpl implements CouponInjectService {
}

@Override
public void add(CouponInject record) {
public ResultData add(CouponInject record) {
ResultData resultData = new ResultData();
WxCoupon wxCoupon = wxCouponService.getById(record.getCouponId());
if (wxCoupon.getValidType() == 1) { //时间范围
if (new Date().after(wxCoupon.getValidEndDate())) {
return;
return new ResultData(Result.ERROR,"已过期");
}
}
//解析前台tags,并转换json
String[] arys = record.getTags().split(",");
List<Long> tagids = new ArrayList<>();
for (int i = 0; i < arys.length; i++) {
@@ -75,6 +80,7 @@ public class CouponInjectServiceImpl implements CouponInjectService {
}
record.setTags(JSON.toJSONString(arys));

//生成雪花id
final IdWorker idWorker = new IdWorker(0, 0);
record.setId(idWorker.nextId());
if(record.getSendType()==0){
@@ -84,44 +90,60 @@ public class CouponInjectServiceImpl implements CouponInjectService {
record.setStatus(0);
}
List<WxCUser> cUsers = wxCUserTagsService.findUserByTag(tagids);
int inventory = wxCoupon.getRemainInventory();//库存数量
if(cUsers.size()>inventory){
return new ResultData(Result.ERROR,"库存不足");
}
record.setSendAmount(cUsers.size());
couponInjectMapper.insertSelective(record);
if(record.getSendType()==0) {
sendNow(wxCoupon,cUsers);
sendNow(wxCoupon,cUsers,record.getId());
}


return new ResultData();
}

private void sendNow(WxCoupon wxCoupon,List<WxCUser> cUsers){
private void sendNow(WxCoupon wxCoupon,List<WxCUser> cUsers,Long couponInjectId){
//查询标签用户

int sendRealAmount=0;
for (WxCUser tempCUser : cUsers) {
sendCouponToUser(tempCUser,wxCoupon);
int result = sendCouponToUser(tempCUser,wxCoupon,couponInjectId);
sendRealAmount=sendRealAmount+result;
}
//修改卡券存库
wxCoupon.setRemainInventory(wxCoupon.getRemainInventory()-sendRealAmount);
wxCouponService.saveOrUpdate(wxCoupon);
}
private void sendCouponToUser(WxCUser tempCUser,WxCoupon wxCoupon){
private int sendCouponToUser(WxCUser tempCUser,WxCoupon wxCoupon,Long couponInjectId) {
int injectResult = 0;//0注入不成功,1注入卡包成功
try {
WxCouponOrder wxCouponOrder = new WxCouponOrder();
wxCouponOrder.setCouponId(wxCoupon.getId());
wxCouponOrder.setCouponOrderStatus(0);
wxCouponOrder.setCUserId(tempCUser.getId());
wxCouponOrder.setCouponPrice(0);
wxCouponOrder.setCreateDate(new Date());
if (wxCoupon.getValidType() == 1) { //时间范围区间
wxCouponOrder.setExpiredTime(wxCoupon.getValidEndDate());
} else {
Date date = DateUtils.addDays(new Date(), wxCoupon.getValidDays());
wxCouponOrder.setExpiredTime(date);
}
wxCouponOrder.setTenantId(wxCoupon.getTenantId());
wxCouponOrderService.saveOrUpdate(wxCouponOrder);
//短信通知
}catch (Exception e){
throw e;

WxCouponOrder wxCouponOrder = new WxCouponOrder();
wxCouponOrder.setCouponId(wxCoupon.getId());
wxCouponOrder.setCouponOrderStatus(0);
wxCouponOrder.setCUserId(tempCUser.getId());
wxCouponOrder.setCouponPrice(0);
wxCouponOrder.setCreateDate(new Date());
if (wxCoupon.getValidType() == 1) { //时间范围区间
wxCouponOrder.setExpiredTime(wxCoupon.getValidEndDate());
} else {
Date date = DateUtils.addDays(new Date(), wxCoupon.getValidDays());
wxCouponOrder.setExpiredTime(date);
}
wxCouponOrder.setTenantId(wxCoupon.getTenantId());
Long couponOrderId = wxCouponOrderService.insertOne(wxCouponOrder);
injectResult = 1;
wxCouponActionLogService.addOne(wxCoupon.getTenantId(), wxCoupon.getId(), couponOrderId, 0, couponInjectId);
return injectResult;
//短信通知
} catch (Exception e) {
if(injectResult==0) {
logger.error("注入用户券包异常 :"+tempCUser.getId()+"|"+e.getMessage());
return injectResult;
}
logger.error("调用短信接口异常 :"+tempCUser.getId()+"|"+e.getMessage());
return injectResult;
}
}


}

+ 10
- 0
mallinkService/src/main/java/com/simple/service/impl/WxCUserBasicInfoServiceImpl.java Просмотреть файл

@@ -3,6 +3,7 @@ package com.simple.service.impl;
import java.util.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simple.domain.dto.WxCuerBasicInfoDto;
import com.simple.domain.po.WxCUserBasicInfo;
import com.simple.mapper.WxCUserBasicInfoMapper;
import com.simple.service.WxCUserBasicInfoService;
@@ -21,8 +22,17 @@ public class WxCUserBasicInfoServiceImpl implements WxCUserBasicInfoService {
public PageInfo<WxCUserBasicInfo> listAsPage(WxCUserBasicInfo record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.findList(record));
}

@Override
public PageInfo<WxCUserBasicInfo> list(WxCuerBasicInfoDto record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxCUserBasicInfoMapper.list(record));
}



@Override
public WxCUserBasicInfo getById(Long id) {
return wxCUserBasicInfoMapper.selectByPrimaryKey(id);
}


+ 5
- 1
mallinkService/src/main/java/com/simple/service/impl/WxCUserCarServiceImpl.java Просмотреть файл

@@ -29,7 +29,11 @@ public class WxCUserCarServiceImpl implements WxCUserCarService {

@Override
public WxCUserCar getOne(WxCUserCar record) {
return wxCUserCarMapper.selectOne(record);
List<WxCUserCar> userCarList = wxCUserCarMapper.findList(record);
if (userCarList.size() > 0) {
return userCarList.get(0);
}
return null;
}




+ 13
- 8
mallinkService/src/main/java/com/simple/service/impl/WxCouponActionLogServiceImpl.java Просмотреть файл

@@ -43,12 +43,17 @@ public class WxCouponActionLogServiceImpl implements WxCouponActionLogService {
public void deleteById(Long id) {
wxCouponActionLogMapper.deleteByPrimaryKey(id);
}

@Override
public void addOne(String tenantId, Long couponId, Long coupon_order_id, int channelType, Long channelId) {
WxCouponActionLog actionLog = new WxCouponActionLog();
actionLog.setTenantId(tenantId);
actionLog.setChannelId(channelId);
actionLog.setCouponOrderId(coupon_order_id);
actionLog.setChannelType(channelType);
actionLog.setCreatetime(new Date());
saveOrUpdate(actionLog);
}


}

+ 11
- 8
mallinkService/src/main/java/com/simple/service/impl/WxMallBuildingServiceImpl.java Просмотреть файл

@@ -3,6 +3,7 @@ package com.simple.service.impl;
import java.util.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMallBuilding;
import com.simple.mapper.WxMallBuildingMapper;
import com.simple.service.WxMallBuildingService;
@@ -43,12 +44,14 @@ public class WxMallBuildingServiceImpl implements WxMallBuildingService {
public void deleteById(Long id) {
wxMallBuildingMapper.deleteByPrimaryKey(id);
}

@Override
public ResultData getbuildinglist(String tenantId) {
WxMallBuilding wxMallBuilding = new WxMallBuilding();
wxMallBuilding.setTenantId(tenantId);
List<WxMallBuilding> list = wxMallBuildingMapper.findList(wxMallBuilding);
return new ResultData(list);
}


}

+ 12
- 3
mallinkService/src/main/java/com/simple/service/impl/WxMallFloorServiceImpl.java Просмотреть файл

@@ -3,6 +3,8 @@ package com.simple.service.impl;
import java.util.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMallBuilding;
import com.simple.domain.po.WxMallFloor;
import com.simple.mapper.WxMallFloorMapper;
import com.simple.service.WxMallFloorService;
@@ -43,9 +45,16 @@ public class WxMallFloorServiceImpl implements WxMallFloorService {
public void deleteById(Long id) {
wxMallFloorMapper.deleteByPrimaryKey(id);
}


@Override
public ResultData getfloorlist(String tenantId,Long buildingId) {
WxMallFloor wxMallFloor = new WxMallFloor();
wxMallFloor.setTenantId(tenantId);
wxMallFloor.setBuildingId(buildingId);
List<WxMallFloor> list = wxMallFloorMapper.findList(wxMallFloor);
return new ResultData(list);
}


+ 1
- 5
mallinkService/src/main/java/com/simple/service/impl/WxMallServiceImpl.java Просмотреть файл

@@ -50,11 +50,7 @@ public class WxMallServiceImpl implements WxMallService {
public WxMall getByTenantId(String id) {
WxMall wxMall = new WxMall();
wxMall.setTenantId(id);
try {
return wxMallMapper.findList(wxMall).get(0);
} catch (Exception e){
return null;
}
return wxMallMapper.findList(wxMall).get(0);
}


+ 20
- 6
mallinkService/src/main/java/com/simple/service/impl/WxMerchantBUserServiceImpl.java Просмотреть файл

@@ -5,20 +5,26 @@ import java.util.stream.Collectors;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simple.common.ErrorCode;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMerchantBUser;
import com.simple.domain.po.WxMsgValidationcode;
import com.simple.exception.MallinkException;
import com.simple.mapper.WxMerchantBUserMapper;
import com.simple.mapper.WxMsgValidationcodeMapper;
import com.simple.service.WxMerchantBUserService;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.simple.common.IdWorker;

@Service
public class WxMerchantBUserServiceImpl implements WxMerchantBUserService {
@Autowired

private Logger logger = Logger.getLogger(WxMerchantBUserServiceImpl.class);


@Autowired
WxMerchantBUserMapper wxMerchantBUserMapper;

@Autowired
@@ -36,7 +42,11 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService {

@Override
public WxMerchantBUser getBUserByAppId(WxMerchantBUser record) {
return wxMerchantBUserMapper.selectOne(record);
List<WxMerchantBUser> userList = wxMerchantBUserMapper.findList(record);
if (userList.size() > 0) {
return userList.get(0);
}
return null;
}

@Override
@@ -95,11 +105,15 @@ public class WxMerchantBUserServiceImpl implements WxMerchantBUserService {
if(list.size()>0){
bUser = list.get(0);
bUser.setBUserPwd(pwd);
wxMerchantBUserMapper.updateByPrimaryKeySelective(bUser);
return new ResultData(200,"操作成功");
try{
wxMerchantBUserMapper.updateByPrimaryKeySelective(bUser);
}catch (Exception e){
logger.error("db failed: 商户-" + bUser.getId() + ", e:" + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL.getCode(), "DB FAILD " + e.getMessage());
}
}
}
return new ResultData(500,"操作失败");
return new ResultData();
}




+ 52
- 30
mallinkService/src/main/java/com/simple/service/impl/WxMerchantServiceImpl.java Просмотреть файл

@@ -1,19 +1,11 @@
package com.simple.service.impl;

import com.alibaba.fastjson.JSONArray;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simple.common.IdWorker;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMerchant;
import com.simple.domain.po.WxMerchantBUser;
import com.simple.domain.po.WxMerchantShop;
import com.simple.domain.po.WxShop;
import com.simple.domain.po.*;
import com.simple.enums.EnumCarVendor;
import com.simple.mapper.WxMerchantBUserMapper;
import com.simple.mapper.WxMerchantMapper;
import com.simple.mapper.WxMerchantShopMapper;
import com.simple.mapper.WxShopMapper;
import com.simple.mapper.*;
import com.simple.service.WxMerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@@ -22,8 +14,6 @@ import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;

@Service
public class WxMerchantServiceImpl implements WxMerchantService {
@@ -40,6 +30,9 @@ public class WxMerchantServiceImpl implements WxMerchantService {
@Autowired
WxMerchantBUserMapper wxMerchantBUserMapper;

@Autowired
WxAppinfoMapper wxAppinfoMapper;

@Override
public PageInfo<WxMerchant> listAsPage(WxMerchant record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMerchantMapper.findList(record));
@@ -91,10 +84,15 @@ public class WxMerchantServiceImpl implements WxMerchantService {
@Override
public void saveOrUpdate(WxMerchant wxMerchant) {

WxAppinfo wxAppinfo = new WxAppinfo();
wxAppinfo.setTenantId(wxMerchant.getTenantId());
wxAppinfo.setType(1);
wxAppinfo = wxAppinfoMapper.findList(wxAppinfo).get(0);

final IdWorker idWorker = IdWorker.get();
long merchantid = idWorker.nextId();
if (wxMerchant.getId() == null) {

if (wxMerchant.getId() == null) {
long merchantid = idWorker.nextId();
wxMerchant.setId(merchantid);
Date date = new Date();
wxMerchant.setStatus(1);
@@ -124,6 +122,28 @@ public class WxMerchantServiceImpl implements WxMerchantService {
WxShopMapper.updateByPrimaryKeySelective(wxShop);
}

//删除之前的关联用户
List<WxMerchantBUser> bUsers = wxMerchant.getbUsers();

for(WxMerchantBUser user:bUsers){
wxMerchantBUserMapper.deleteByPrimaryKey(user.getId());
}

//保存商户关联用户
for(WxMerchantBUser user:bUsers){
long id = idWorker.nextId();
user.setId(id);
user.setBUserId(id);
user.setMerchantId(merchantid);
user.setTenantId(wxMerchant.getTenantId());
user.setAppId(wxAppinfo.getAppId());
date = new Date();
user.setCreateDate(date);
user.setUpdateDate(date);
wxMerchantBUserMapper.insertSelective(user);

}

} else {

//更新商户
@@ -168,25 +188,27 @@ public class WxMerchantServiceImpl implements WxMerchantService {
WxShopMapper.updateByPrimaryKeySelective(wxShop);
}

}
//删除之前的关联用户
List<WxMerchantBUser> bUsers = wxMerchant.getbUsers();

//删除之前的关联用户
List<WxMerchantBUser> bUsers = wxMerchant.getbUsers();
for(WxMerchantBUser user:bUsers){
wxMerchantBUserMapper.deleteByPrimaryKey(user.getId());
}

for(WxMerchantBUser user:bUsers){
wxMerchantBUserMapper.deleteByPrimaryKey(user.getId());
}
//保存商户关联用户
for(WxMerchantBUser user:bUsers){
long id = idWorker.nextId();
user.setId(id);
user.setBUserId(id);
user.setMerchantId(wxMerchant.getId());
user.setTenantId(wxMerchant.getTenantId());
user.setAppId(wxAppinfo.getAppId());
date = new Date();
user.setCreateDate(date);
user.setUpdateDate(date);
wxMerchantBUserMapper.insertSelective(user);

//保存商户关联用户
for(WxMerchantBUser user:bUsers){
long id = idWorker.nextId();
user.setId(id);
user.setBUserId(id);
user.setMerchantId(merchantid);
Date date = new Date();
user.setCreateDate(date);
user.setUpdateDate(date);
wxMerchantBUserMapper.insertSelective(user);
}

}



+ 106
- 2
mallinkService/src/main/java/com/simple/service/impl/WxMerchantTradeDailyServiceImpl.java Просмотреть файл

@@ -1,14 +1,26 @@
package com.simple.service.impl;

import java.text.SimpleDateFormat;
import java.util.*;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.simple.common.ErrorCode;
import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMall;
import com.simple.domain.po.WxMerchant;
import com.simple.domain.po.WxMerchantBUser;
import com.simple.domain.po.WxMerchantTradeDaily;
import com.simple.mapper.WxMerchantTradeDailyMapper;
import com.simple.service.WxMerchantTradeDailyService;
import com.simple.service.WxMallService;
import com.simple.service.WxMerchantBUserService;
import com.simple.service.WxMerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.simple.common.IdWorker;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Service
public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyService {
@@ -16,6 +28,14 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ
@Autowired
WxMerchantTradeDailyMapper wxMerchantTradeDailyMapper;

@Autowired
WxMerchantBUserService wxMerchantBUserService;

@Autowired
WxMerchantService wxMerchantService;

@Autowired
WxMallService wxMallService;

@Override
public PageInfo<WxMerchantTradeDaily> listAsPage(WxMerchantTradeDaily record, Integer pageIndex, Integer pageSize) {
@@ -43,8 +63,92 @@ public class WxMerchantTradeDailyServiceImpl implements WxMerchantTradeDailyServ
public void deleteById(Long id) {
wxMerchantTradeDailyMapper.deleteByPrimaryKey(id);
}

@Override
public ResultData saveDailyTradingVolume(Long userId, Integer volume) {

WxMerchantBUser user = wxMerchantBUserService.getById(userId);

if (user==null)
return new ResultData(ErrorCode.USER_IS_EMPTY);

WxMerchant merchant = wxMerchantService.getById(user.getMerchantId());

if (merchant==null)
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);

WxMall mall = wxMallService.getByTenantId(merchant.getTenantId());
if (mall==null)
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);


WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily();

wxMerchantTradeDaily.setMerchantId(merchant.getId());

SimpleDateFormat fmt=new SimpleDateFormat("yyyy-MM-dd");
wxMerchantTradeDaily.setReportDate(fmt.format(new Date()));


List<WxMerchantTradeDaily> tradeList = wxMerchantTradeDailyMapper.findList(wxMerchantTradeDaily);

if (tradeList.size() > 0 ) {
wxMerchantTradeDaily = tradeList.get(0);
wxMerchantTradeDaily.setTradeAmt(volume);
wxMerchantTradeDaily.setUpdateDate(new Date());
wxMerchantTradeDailyMapper.updateByPrimaryKeySelective(wxMerchantTradeDaily);
return new ResultData(wxMerchantTradeDaily);
}

final IdWorker idWorker = IdWorker.get();
wxMerchantTradeDaily.setId(idWorker.nextId());
wxMerchantTradeDaily.setTenantId(merchant.getTenantId());
wxMerchantTradeDaily.setMerchantId(merchant.getId());
wxMerchantTradeDaily.setTradeAmt(volume);
wxMerchantTradeDaily.setCreateDate(new Date());
wxMerchantTradeDaily.setUpdateDate(new Date());
wxMerchantTradeDailyMapper.insert(wxMerchantTradeDaily);

return new ResultData(wxMerchantTradeDaily);

}

@Override
public ResultData getVolume(Long userId) {

WxMerchantBUser user = wxMerchantBUserService.getById(userId);

if (user==null)
return new ResultData(ErrorCode.USER_IS_EMPTY);

WxMerchant merchant = wxMerchantService.getById(user.getMerchantId());

if (merchant==null)
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);

WxMall mall = wxMallService.getByTenantId(merchant.getTenantId());
if (mall==null)
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);


WxMerchantTradeDaily wxMerchantTradeDaily = new WxMerchantTradeDaily();

wxMerchantTradeDaily.setMerchantId(merchant.getId());

SimpleDateFormat fmt=new SimpleDateFormat("yyyy-MM-dd");
wxMerchantTradeDaily.setReportDate(fmt.format(new Date()));


List<WxMerchantTradeDaily> tradeList = wxMerchantTradeDailyMapper.findList(wxMerchantTradeDaily);

if (tradeList.size() > 0 ) {
wxMerchantTradeDaily = tradeList.get(0);
return new ResultData(wxMerchantTradeDaily);
}

return new ResultData(ErrorCode.DALIY_REPORT_VOLUME_TODAY_NULL);

}


+ 1
- 1
mallinkService/src/main/java/com/simple/service/impl/WxMsgServiceImpl.java Просмотреть файл

@@ -55,7 +55,7 @@ public class WxMsgServiceImpl implements WxMsgService {
}

if(phones.equals("")){
return new ResultData(Result.SUCCESS, "您需要添加要发送的手机号");
return new ResultData(Result.SUCCESS, "您需要添 加要发送的手机号");
}

if (wxMsg.getId() == null) {


+ 40
- 10
mallinkService/src/main/java/com/simple/service/impl/WxMsgValidationcodeServiceImpl.java Просмотреть файл

@@ -7,19 +7,14 @@ import com.simple.common.ErrorCode;
import com.simple.common.IdWorker;
import com.simple.common.Result;
import com.simple.common.ResultData;
import com.simple.domain.po.WxMall;
import com.simple.domain.po.WxMsgConfig;
import com.simple.domain.po.WxMsgValidationcode;
import com.simple.domain.po.WxMsgValidationcodeModel;
import com.simple.mapper.WxMallMapper;
import com.simple.mapper.WxMsgConfigMapper;
import com.simple.mapper.WxMsgValidationcodeMapper;
import com.simple.mapper.WxMsgValidationcodeModelMapper;
import com.simple.domain.po.*;
import com.simple.mapper.*;
import com.simple.service.WxMsgValidationcodeService;
import com.simple.utils.AesUtil;
import com.simple.utils.HMACSHA256;
import com.simple.utils.HttpUtil;
import com.simple.utils.RsaUtil;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@@ -27,9 +22,13 @@ import java.util.*;
import java.util.stream.Collectors;

@Service
public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeService {
public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeService {\

@Autowired

private Logger logger = Logger.getLogger(WxMsgValidationcodeServiceImpl.class);


@Autowired
WxMsgValidationcodeMapper wxMsgValidationcodeMapper;

@Autowired
@@ -41,6 +40,13 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic
@Autowired
WxMsgValidationcodeModelMapper wxMsgValidationcodeModelMapper;

@Autowired
WxMerchantBUserMapper wxMerchantBUserMapper;


@Autowired
WxMerchantMapper wxMerchantMapper;

@Override
public PageInfo<WxMsgValidationcode> listAsPage(WxMsgValidationcode record, Integer pageIndex, Integer pageSize) {
return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxMsgValidationcodeMapper.findList(record));
@@ -72,6 +78,30 @@ public class WxMsgValidationcodeServiceImpl implements WxMsgValidationcodeServic
@Override
public ResultData sendvalidationcode(WxMsgValidationcode wxMsgValidationcode) {

WxMerchantBUser user = new WxMerchantBUser();
user.setAppId(wxMsgValidationcode.getAppid());
user.setPhone(wxMsgValidationcode.getPhone());

List<WxMerchantBUser> userList = wxMerchantBUserMapper.findList(user);
if (userList.size()==0) {
logger.error("B端用户不存在, phone: " + wxMsgValidationcode.getPhone());
return new ResultData(ErrorCode.USER_IS_EMPTY);
}

WxMerchant wxMerchant = new WxMerchant();
wxMerchant.setId(userList.get(0).getId());
List<WxMerchant> merchantList = wxMerchantMapper.findList(wxMerchant);
if (merchantList.size()==0) {
logger.error("B端所在商户不存在, id: " + userList.get(0).getId());
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_FOUND);
}

wxMerchant = merchantList.get(0);
if(wxMerchant.getStatus()==0){
logger.error("B端所在商户已停用, id: " + userList.get(0).getId());
return new ResultData(ErrorCode.MERCHANT_INFO_NOT_VALID);
}

//1、查看是否存在未过期的短信,有返回成功 没有继续
List<WxMsgValidationcode> wxmsgvalidationcodelist = wxMsgValidationcodeMapper.findList(wxMsgValidationcode);
Date currentdate = new Date();


+ 1
- 3
mallinkService/src/main/java/com/simple/service/impl/WxOrderServiceImpl.java Просмотреть файл

@@ -199,10 +199,8 @@ public class WxOrderServiceImpl implements WxOrderService {
@Override
public WxOrder sendUserFreeCoupon(Long userId, Long couponId) {
WxCUser user = null;
WxCUser userQ = new WxCUser();
userQ.setId(userId);
try {
user = wxCUserMapper.selectOne(userQ);
user = wxCUserMapper.selectByPrimaryKey(userId);
} catch (Exception e) {
logger.error("userId : " + userId + ", e: " + e.getMessage());
}


+ 4
- 1
mallinkService/src/main/java/com/simple/service/impl/WxParkServiceImpl.java Просмотреть файл

@@ -29,7 +29,10 @@ public class WxParkServiceImpl implements WxParkService {

@Override
public WxPark getByObj(WxPark record) {
return wxParkMapper.selectOne(record);
List<WxPark> parkList = wxParkMapper.findList(record);
if (parkList.size() > 0)
return parkList.get(0);
return null;
}

@Override


+ 6
- 3
mallinkService/src/main/java/com/simple/service/impl/WxRefundOrderServiceImpl.java Просмотреть файл

@@ -234,7 +234,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
payOrderId = Long.valueOf(record.getPayOrderNo());
} catch (NumberFormatException e) {
logger.error("参数转换异常: payOrderId-" + record.getPayOrderNo());
throw new MallinkException(ErrorCode.PARAMETER_CAST_ERROR.getCode(), "参数转换异常: payOrderId-" + record.getPayOrderNo());
throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "参数转换异常: payOrderId-" + record.getPayOrderNo());
}
try {
WxPayOrder payOrderQ = new WxPayOrder();
@@ -242,7 +242,10 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
payOrderQ.setId(payOrderId);
payOrderQ.setPayOrderNo(record.getPayOrderNo());
payOrderQ.setPayOrderStatus(EnumPayStatus.PAY_WAY_SUCCESS.getCode());
payOrder = wxPayOrderMapper.selectOne(payOrderQ);
List<WxPayOrder> payOrderList = wxPayOrderMapper.findList(payOrderQ);
if (payOrderList.size() > 0) {
payOrder = payOrderList.get(0);
}
} catch (Exception e) {
logger.error("数据库获取异常: " + e.getMessage());
throw new MallinkException(ErrorCode.DB_FAIL);
@@ -302,7 +305,7 @@ public class WxRefundOrderServiceImpl implements WxRefundOrderService {
signMap = BeanUtils.toStringMap(wxRefundOrderP);
} catch (Exception e) {
logger.error("退款签名异常");
throw new MallinkException(ErrorCode.PARAMETER_CAST_ERROR.getCode(), "退款签名异常");
throw new MallinkException(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "退款签名异常");
}
String signAgent = WxPayment.createSign(signMap, payAccount.getApiKey());
signMap.put("sign", signAgent);


+ 17
- 12
mallinkService/src/main/java/com/simple/utils/ETCPUtil.java Просмотреть файл

@@ -215,16 +215,21 @@ public class ETCPUtil {
ETCPUtil caller = new ETCPUtil();
String ret = "";
JSONObject objret = null;
String etcpToken = "44529274-7a31-4fb5-a35d-91d5b0be8641";
String etcpToken = "899e94d7-a3a5-46d4-87a3-288b18d0b189";
String carNumber = "京D12345";
String parkId = "Wj7YdvqyiYM=";
String businessId = "testasfsfsd";
//caller.carSimulation(appId, merchantNo, merchantKey, version, carNumber);
String businessId = "IgWGUtpAX68=";
String couponFreeId = "5627";

caller.getBCouponList(domain, merchantNo, merchantKey, version, parkId, businessId);
//caller.carSimulation(domain, appId, merchantNo, merchantKey, version, carNumber);
/* {"code":0,"message":"ok","data":{"isInPark":0}} */

//caller.getBCouponList(domain, merchantNo, merchantKey, version, parkId, businessId);
// {"code":0,"message":"查询成功","data":{"count":1,"couponPlatformModels":[{"id":5627,"parkId":"Wj7YdvqyiYM=","businessId":"IgWGUtpAX68=","businessName":"fmtest5678","name":"优免现金1元","category":"2","categoryValue":"1.00","amount":100,"status":"1","effectiveStart":"2018-08-20","effectiveEnd":"2018-08-25","couponType":"0","avaliavleNum":100}]}}
//caller.bCouponRecord(domain, merchantNo, merchantKey, version, etcpToken, parkId, businessId, carNumber, couponFreeId);
// 联合登录测试
/*ret = caller.userSignin(appId, merchantNo, merchantKey, version, "13910154397");

/*ret = caller.userSignin(domain, appId, merchantNo, merchantKey, version, "13910154397");

objret = JSON.parseObject(ret);
if (objret.getIntValue("code") != 0)
@@ -232,10 +237,10 @@ public class ETCPUtil {

etcpToken = objret.getJSONObject("data").getString("token");
System.out.println(etcpToken);
*/

// 绑定车牌查询
ret = caller.carNum(merchantNo, merchantKey, version, etcpToken);
ret = caller.carNum(domain, merchantNo, merchantKey, version, etcpToken);
System.out.println(ret);
objret = JSON.parseObject(ret);
if (objret.getIntValue("code") != 0)
@@ -243,7 +248,7 @@ public class ETCPUtil {
JSONObject data = objret.getJSONObject("data");
if (data.getIntValue("number") <= 0) {
// 车牌绑定测试
ret = caller.bindCar(etcpToken, carNumber, null, merchantNo, merchantKey, version);
ret = caller.bindCar(domain, etcpToken, carNumber, null, merchantNo, merchantKey, version);
objret = JSON.parseObject(ret);
if (objret.getIntValue("code") != 0)
return;
@@ -253,7 +258,7 @@ public class ETCPUtil {
carNumber = carNumber.substring(1, carNumber.length() -1);
System.out.println(carNumber);
// 停车费查询
ret = caller.orderUnpay(appId, merchantNo, merchantKey, version, etcpToken, carNumber);
ret = caller.orderUnpay(domain, appId, merchantNo, merchantKey, version, etcpToken, carNumber);
System.out.println(ret);
objret = JSON.parseObject(ret);
if (objret.getIntValue("code") != 0)
@@ -262,9 +267,9 @@ public class ETCPUtil {
JSONObject payObj = payArr.getJSONObject(0);
String orderId = payObj.getString("orderId");
// 微信h5支付
ret = caller.orderPay(merchantNo, merchantKey, version, etcpToken, orderId, "http://test.cn", null);
ret = caller.orderPay(domain, merchantNo, merchantKey, version, etcpToken, orderId, "http://test.cn", null);
System.out.println(ret);
*/
// 车牌解绑测试
//caller.unbindCar(merchantNo, merchantKey, version, etcpToken, carNumber);

@@ -552,7 +557,7 @@ public class ETCPUtil {
String etcpToken, String orderId,
String returnUrl, String couponCode) {
// payType 支付方式(1 微信公众号内支付 2 支付宝 H5 支付 3 微信二维码 4 支付宝二维码 5 微信 H5)(非空)
int payType = 5;
int payType = 1;
JSONObject jsonObject = new JSONObject();
jsonObject.put("token", etcpToken);
jsonObject.put("payType", payType);


+ 8
- 2
mallinkService/src/main/resources/mapper/WxAppinfoMapper.xml Просмотреть файл

@@ -14,10 +14,12 @@
<result column="last_token_time" jdbcType="TIMESTAMP" property="lastTokenTime" />
<result column="expires_in" jdbcType="INTEGER" property="expiresIn" />
<result column="pay_id" jdbcType="BIGINT" property="payId" />
<result column="type" jdbcType="INTEGER" property="type" />

</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`app_id`,`name`,`secret`,`token`,`aes_key`,`msg_data_format`,`access_token`,`last_token_time`,`expires_in`,`pay_id`
`id`,`tenant_id`,`app_id`,`name`,`secret`,`token`,`aes_key`,`msg_data_format`,`access_token`,`last_token_time`,`expires_in`,`pay_id`,`type`
</sql>

<sql id="dynamicWhereConditions">
@@ -81,7 +83,11 @@
<if test=" null != payId ">
and `pay_id` = #{payId}
</if>
</if>
<if test=" null != type ">
and `type` = #{type}

</if>
<if test=" null != ids ">
and id in
<foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")">


+ 27
- 5
mallinkService/src/main/resources/mapper/WxCUserBasicInfoMapper.xml Просмотреть файл

@@ -15,11 +15,11 @@
<result column="create_date" jdbcType="TIMESTAMP" property="createDate" />
<result column="update_date" jdbcType="TIMESTAMP" property="updateDate" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="merchant_id" jdbcType="BIGINT" property="merchantId" />
<result column="name" jdbcType="VARCHAR" property="name" />
</resultMap>
<sql id="allColumns">
`id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,`c_user_id`,`create_date`,`update_date`,`tenant_id`,`merchant_id`
`id`,`phone`,`birthdate`,`education`,`sex`,`email`,`address`,`poins`,`tag_id`,`c_user_id`,`create_date`,`update_date`,`tenant_id`,`name`
</sql>

<sql id="dynamicWhereConditions">
@@ -90,8 +90,9 @@
</if>
<if test=" null != merchantId ">
and `merchant_id` = #{merchantId}
<if test=" null != name ">
and `name` like concat('%', #{name},'%')
</if>
<if test=" null != ids ">
@@ -109,7 +110,28 @@
</select>
<select id="list" parameterType="com.simple.domain.po.WxCUserBasicInfo" resultMap="BaseResultMap">
select <include refid="allColumns" /> from wx_c_user_basic_info where 1=1
<if test=" null != tenantId ">
and `tenant_id` = #{tenantId}
</if>
<if test=" null != phone and phone !='' ">
and `phone` = #{phone}
</if>
<if test=" null != startTime ">
and create_date &gt;= #{startTime}
</if>
<if test=" null != endTime">
and create_date &lt;= #{endTime}
</if>
<if test=" null != name and name != '' ">
and `name` like concat('%', #{name},'%')
</if>
</select>


+ 16
- 10
mallinkService/src/main/resources/mapper/WxCouponActionLogMapper.xml Просмотреть файл

@@ -5,13 +5,14 @@
<id column="id" jdbcType="BIGINT" property="id" />
<result column="tenant_id" jdbcType="VARCHAR" property="tenantId" />
<result column="coupon_id" jdbcType="BIGINT" property="couponId" />
<result column="user_id" jdbcType="BIGINT" property="userId" />
<result column="action" jdbcType="VARCHAR" property="action" />
<result column="operation_time" jdbcType="TIMESTAMP" property="operationTime" />
<result column="coupon_order_id" jdbcType="BIGINT" property="couponOrderId" />
<result column="channel_type" jdbcType="INTEGER" property="channelType" />
<result column="channel_id" jdbcType="BIGINT" property="channelId" />
<result column="createtime" jdbcType="TIMESTAMP" property="createtime" />
</resultMap>
<sql id="allColumns">
`id`,`tenant_id`,`coupon_id`,`user_id`,`action`,`operation_time`
`id`,`tenant_id`,`coupon_id`,`coupon_order_id`,`channel_type`,`channel_id`,`createtime`
</sql>

<sql id="dynamicWhereConditions">
@@ -32,18 +33,23 @@
</if>
<if test=" null != userId ">
and `user_id` = #{userId}
<if test=" null != couponOrderId ">
and `coupon_order_id` = #{couponOrderId}
</if>
<if test=" null != action ">
and `action` like concat('%', #{action},'%')
<if test=" null != channelType ">
and `channel_type` = #{channelType}
</if>
<if test=" null != operationTime ">
and `operation_time` = #{operationTime}
<if test=" null != channelId ">
and `channel_id` = #{channelId}
</if>
<if test=" null != createtime ">
and `createtime` = #{createtime}
</if>
<if test=" null != ids ">


Некоторые файлы не были показаны из-за большого количества измененных файлов

Загрузка…
Отмена
Сохранить