# Conflicts: # mallinkService/src/main/java/com/iformall/service/impl/WxCUserBasicInfoServiceImpl.javarelease_toaliyun_real
| @@ -28,27 +28,12 @@ | |||
| <artifactId>mybatis-multi-tenancy</artifactId> | |||
| <version>1.0</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.github.binarywang</groupId> | |||
| <artifactId>weixin-java-mp</artifactId> | |||
| <version>${weixin-java-mp.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.github.binarywang</groupId> | |||
| <artifactId>weixin-java-open</artifactId> | |||
| <version>${weixin-java-open.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>commons-fileupload</groupId> | |||
| <artifactId>commons-fileupload</artifactId> | |||
| <version>1.3.3</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.google.zxing</groupId> | |||
| <artifactId>core</artifactId> | |||
| <version>3.3.3</version> | |||
| </dependency> | |||
| </dependencies> | |||
| <build> | |||
| @@ -1,124 +0,0 @@ | |||
| package com.iformall.config; | |||
| import org.springframework.boot.context.properties.ConfigurationProperties; | |||
| import redis.clients.jedis.JedisPoolConfig; | |||
| import redis.clients.jedis.Protocol; | |||
| import javax.net.ssl.HostnameVerifier; | |||
| import javax.net.ssl.SSLParameters; | |||
| import javax.net.ssl.SSLSocketFactory; | |||
| /** | |||
| * Stormeye | |||
| */ | |||
| @ConfigurationProperties(prefix = "wechat.redis") | |||
| public class RedisProperies extends JedisPoolConfig { | |||
| private String host = Protocol.DEFAULT_HOST; | |||
| private int port = Protocol.DEFAULT_PORT; | |||
| private String password; | |||
| private int database = 1; | |||
| private int connectionTimeout = Protocol.DEFAULT_TIMEOUT; | |||
| private int soTimeout = Protocol.DEFAULT_TIMEOUT; | |||
| private String clientName; | |||
| private boolean ssl; | |||
| private SSLSocketFactory sslSocketFactory; | |||
| private SSLParameters sslParameters; | |||
| private HostnameVerifier hostnameVerifier; | |||
| public boolean isSsl() { | |||
| return ssl; | |||
| } | |||
| public void setSsl(boolean ssl) { | |||
| this.ssl = ssl; | |||
| } | |||
| public SSLSocketFactory getSslSocketFactory() { | |||
| return sslSocketFactory; | |||
| } | |||
| public void setSslSocketFactory(SSLSocketFactory sslSocketFactory) { | |||
| this.sslSocketFactory = sslSocketFactory; | |||
| } | |||
| public SSLParameters getSslParameters() { | |||
| return sslParameters; | |||
| } | |||
| public void setSslParameters(SSLParameters sslParameters) { | |||
| this.sslParameters = sslParameters; | |||
| } | |||
| public HostnameVerifier getHostnameVerifier() { | |||
| return hostnameVerifier; | |||
| } | |||
| public void setHostnameVerifier(HostnameVerifier hostnameVerifier) { | |||
| this.hostnameVerifier = hostnameVerifier; | |||
| } | |||
| public String getHost() { | |||
| return host; | |||
| } | |||
| public void setHost(String host) { | |||
| if (host == null || "".equals(host)) { | |||
| host = Protocol.DEFAULT_HOST; | |||
| } | |||
| this.host = host; | |||
| } | |||
| public int getPort() { | |||
| return port; | |||
| } | |||
| public void setPort(int port) { | |||
| this.port = port; | |||
| } | |||
| public String getPassword() { | |||
| return password; | |||
| } | |||
| public void setPassword(String password) { | |||
| if ("".equals(password)) { | |||
| password = null; | |||
| } | |||
| this.password = password; | |||
| } | |||
| public int getDatabase() { | |||
| return database; | |||
| } | |||
| public void setDatabase(int database) { | |||
| this.database = database; | |||
| } | |||
| public String getClientName() { | |||
| return clientName; | |||
| } | |||
| public void setClientName(String clientName) { | |||
| if ("".equals(clientName)) { | |||
| clientName = null; | |||
| } | |||
| this.clientName = clientName; | |||
| } | |||
| public int getConnectionTimeout() { | |||
| return connectionTimeout; | |||
| } | |||
| public void setConnectionTimeout(int connectionTimeout) { | |||
| this.connectionTimeout = connectionTimeout; | |||
| } | |||
| public int getSoTimeout() { | |||
| return soTimeout; | |||
| } | |||
| public void setSoTimeout(int soTimeout) { | |||
| this.soTimeout = soTimeout; | |||
| } | |||
| } | |||
| @@ -1,69 +0,0 @@ | |||
| package com.iformall.config; | |||
| import org.apache.commons.lang3.builder.ToStringBuilder; | |||
| import org.apache.commons.lang3.builder.ToStringStyle; | |||
| import org.springframework.boot.context.properties.ConfigurationProperties; | |||
| /** | |||
| * Stormeye | |||
| */ | |||
| @ConfigurationProperties(prefix = "wechat.open") | |||
| public class WechatOpenProperties { | |||
| /** | |||
| * 设置微信三方平台的appid | |||
| */ | |||
| private String componentAppId; | |||
| /** | |||
| * 设置微信三方平台的app secret | |||
| */ | |||
| private String componentSecret; | |||
| /** | |||
| * 设置微信三方平台的token | |||
| */ | |||
| private String componentToken; | |||
| /** | |||
| * 设置微信三方平台的EncodingAESKey | |||
| */ | |||
| private String componentAesKey; | |||
| public String getComponentAppId() { | |||
| return componentAppId; | |||
| } | |||
| public void setComponentAppId(String componentAppId) { | |||
| this.componentAppId = componentAppId; | |||
| } | |||
| public String getComponentSecret() { | |||
| return componentSecret; | |||
| } | |||
| public void setComponentSecret(String componentSecret) { | |||
| this.componentSecret = componentSecret; | |||
| } | |||
| public String getComponentToken() { | |||
| return componentToken; | |||
| } | |||
| public void setComponentToken(String componentToken) { | |||
| this.componentToken = componentToken; | |||
| } | |||
| public String getComponentAesKey() { | |||
| return componentAesKey; | |||
| } | |||
| public void setComponentAesKey(String componentAesKey) { | |||
| this.componentAesKey = componentAesKey; | |||
| } | |||
| @Override | |||
| public String toString() { | |||
| return ToStringBuilder.reflectionToString(this, | |||
| ToStringStyle.MULTI_LINE_STYLE); | |||
| } | |||
| } | |||
| @@ -7,10 +7,7 @@ import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestBody; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Map; | |||
| @@ -25,7 +22,7 @@ public class DataTowerController extends BaseController { | |||
| private DataTowerService dataTowerService; | |||
| @ApiOperation("查询运营") | |||
| @PostMapping("/queryRunningPotal") | |||
| @GetMapping("/queryRunningPotal") | |||
| public ResultData queryRunningPotal() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunningPotal"); | |||
| @@ -35,7 +32,7 @@ public class DataTowerController extends BaseController { | |||
| } | |||
| @ApiOperation("查询运营") | |||
| @PostMapping("/queryRunningMobile") | |||
| @GetMapping("/queryRunningMobile") | |||
| public ResultData queryRunningMobile() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunningMobile"); | |||
| @@ -46,7 +43,7 @@ public class DataTowerController extends BaseController { | |||
| @ApiOperation("查询运营") | |||
| @PostMapping("/queryRunning") | |||
| @GetMapping("/queryRunning") | |||
| public ResultData queryRunning() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryRunning"); | |||
| @@ -57,7 +54,7 @@ public class DataTowerController extends BaseController { | |||
| @ApiOperation("查询车流") | |||
| @PostMapping("/queryCar") | |||
| @GetMapping("/queryCar") | |||
| public ResultData queryCar() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryCar"); | |||
| @@ -67,7 +64,7 @@ public class DataTowerController extends BaseController { | |||
| } | |||
| @ApiOperation("查询客流") | |||
| @PostMapping("/queryCustomer") | |||
| @GetMapping("/queryCustomer") | |||
| public ResultData queryCustomer() { | |||
| logger.debug("[" + getIpAddr() + "] DataTowerController::queryCustomer"); | |||
| @@ -170,13 +170,13 @@ public class HomeController extends BaseController { | |||
| if(StringUtils.isNotBlank(user.getPhone())) { | |||
| // 领导登录 | |||
| user = mallUserInfoService.getByPhone(user.getPhone()); | |||
| if(user == null && !isInMobileAdmin(user)) { | |||
| if(user == null || !isInMobileAdmin(user)) { | |||
| return new ResultData(ErrorCode.USER_NOT_ADMIN); | |||
| } | |||
| } else if(StringUtils.isNotBlank(user.getOpenId())) { | |||
| // 领导登录 | |||
| user = mallUserInfoService.getByOpenId(user.getOpenId()); | |||
| if(!isInMobileAdmin(user)) { | |||
| if(user == null || !isInMobileAdmin(user)) { | |||
| return new ResultData(ErrorCode.USER_NOT_ADMIN); | |||
| } | |||
| } else { | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.enums.EnumMallUserStatus; | |||
| import com.iformall.enums.EnumUserAdmin; | |||
| import com.iformall.enums.EnumFlowPermissionType; | |||
| import com.iformall.service.*; | |||
| import com.iformall.shiro.PasswordHelper; | |||
| import com.iformall.shiro.UserSession; | |||
| @@ -14,6 +15,7 @@ import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.collections.map.HashedMap; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.apache.shiro.SecurityUtils; | |||
| import org.slf4j.Logger; | |||
| @@ -23,6 +25,7 @@ import org.springframework.util.Assert; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| @@ -163,6 +166,7 @@ public class MallUserInfoController extends BaseController { | |||
| // 超管 | |||
| boolean bModify = false; | |||
| MallUserInfo adminUser = new MallUserInfo(); | |||
| adminUser.setFlowPermission(userInfo.getFlowPermission()); | |||
| adminUser.setId(userInfo.getId()); | |||
| if (StringUtils.isNotBlank(userInfo.getPassword()) && userInfo.getPassword().length() > 0) { | |||
| adminUser.setPassword(userInfo.getPassword()); | |||
| @@ -372,4 +376,20 @@ public class MallUserInfoController extends BaseController { | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation(value = "审批权限用户列表", response = String.class) | |||
| @GetMapping("getFlowPermissionList") | |||
| public ResultData getFlowPermissionList() { | |||
| logger.debug("[" + getIpAddr() + "] MallUserInfoController::getFlowPermissionList"); | |||
| MallUserInfo mallUserInfo = new MallUserInfo(); | |||
| mallUserInfo.setFlowPermission(EnumFlowPermissionType.CONTRACT.getCode()+""); | |||
| List<MallUserInfo> contractUserList = userInfoService.findList(mallUserInfo); | |||
| mallUserInfo.setFlowPermission(EnumFlowPermissionType.BILL.getCode()+""); | |||
| List<MallUserInfo> billUserList = userInfoService.findList(mallUserInfo); | |||
| Map<String,Object> resultMap = new HashedMap(); | |||
| resultMap.put("contractUserList",contractUserList); | |||
| resultMap.put("billUserList",billUserList); | |||
| return new ResultData(resultMap); | |||
| } | |||
| } | |||
| @@ -1,104 +0,0 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxAuthorizerInfo; | |||
| import com.iformall.enums.EnumWxAuthorizationInfoType; | |||
| import com.iformall.enums.EnumWxAuthorizationStatus; | |||
| import com.iformall.service.WxAuthorizerInfoService; | |||
| import com.iformall.service.wechat.WxOpenService; | |||
| import io.swagger.annotations.Api; | |||
| import me.chanjar.weixin.common.error.WxErrorException; | |||
| import me.chanjar.weixin.open.api.WxOpenMaService; | |||
| import me.chanjar.weixin.open.bean.WxOpenMaCodeTemplate; | |||
| import me.chanjar.weixin.open.bean.ma.WxMaOpenCommitExtInfo; | |||
| import me.chanjar.weixin.open.bean.result.WxOpenAuthorizerInfoResult; | |||
| import me.chanjar.weixin.open.bean.result.WxOpenQueryAuthResult; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Controller; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.io.IOException; | |||
| import java.util.List; | |||
| /** | |||
| * Stormeye Wu | |||
| */ | |||
| @Controller | |||
| @RequestMapping("/wt_auth") | |||
| @Api(description = "微信第三方开放平台授权相关接口") | |||
| public class WechatAuthController { | |||
| private final Logger logger = LoggerFactory.getLogger(getClass()); | |||
| @Autowired | |||
| private WxOpenService openService; | |||
| @Autowired | |||
| private WxAuthorizerInfoService authorizerInfoService; | |||
| @GetMapping("/goto_auth_url_show") | |||
| @ResponseBody | |||
| public String gotoPreAuthUrlShow() { | |||
| return "<html>" + | |||
| "<body>" + | |||
| "<a href='/api/wt_auth/goto_auth_url'>go</a>" + | |||
| "</body>" + | |||
| "</html>"; | |||
| } | |||
| @GetMapping("/goto_auth_url") | |||
| public void gotoPreAuthUrl(HttpServletRequest request, HttpServletResponse response) { | |||
| String host = request.getHeader("host"); | |||
| String url = "https://" + host + "/api/wt_auth/jump"; | |||
| try { | |||
| url = openService.getWxOpenComponentService().getPreAuthUrl(url); | |||
| response.sendRedirect(url); | |||
| } catch (WxErrorException | IOException e) { | |||
| logger.error("gotoPreAuthUrl", e); | |||
| throw new RuntimeException(e); | |||
| } | |||
| } | |||
| @GetMapping("/jump") | |||
| @ResponseBody | |||
| public WxOpenQueryAuthResult jump(@RequestParam("auth_code") String authorizationCode) { | |||
| try { | |||
| WxOpenQueryAuthResult queryAuthResult = openService.getWxOpenComponentService().getQueryAuth(authorizationCode); | |||
| logger.info("getQueryAuth", queryAuthResult); | |||
| WxOpenAuthorizerInfoResult openAuthorizerInfoResult = openService.getWxOpenComponentService().getAuthorizerInfo( | |||
| queryAuthResult.getAuthorizationInfo().getAuthorizerAppid()); | |||
| // save auth info | |||
| authorizerInfoService.saveOrUpdate(new WxAuthorizerInfo(){ | |||
| { | |||
| setAuthorizerAppid(openAuthorizerInfoResult.getAuthorizationInfo().getAuthorizerAppid()); | |||
| setAlias(openAuthorizerInfoResult.getAuthorizerInfo().getAlias()); | |||
| setHeadImg(openAuthorizerInfoResult.getAuthorizerInfo().getHeadImg()); | |||
| setQrcodeUrl(openAuthorizerInfoResult.getAuthorizerInfo().getQrcodeUrl()); | |||
| setAuthorizationStatus(EnumWxAuthorizationStatus.AUTHORIZED.getCode()); | |||
| } | |||
| }); | |||
| return queryAuthResult; | |||
| } catch (WxErrorException e) { | |||
| logger.error("gotoPreAuthUrl", e); | |||
| throw new RuntimeException(e); | |||
| } | |||
| } | |||
| @GetMapping("/getMobilePreAuthUrl") | |||
| @ResponseBody | |||
| public String getMobilePreAuthUrl(HttpServletRequest request, HttpServletResponse response) { | |||
| String host = request.getHeader("host"); | |||
| String url = "https://" + host + "/api/wt_auth/jump"; | |||
| try { | |||
| url = openService.getWxOpenComponentService().getMobilePreAuthUrl(url); | |||
| return url; | |||
| } catch (WxErrorException e) { | |||
| logger.error("getMobilePreAuthUrl", e); | |||
| throw new RuntimeException(e); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,242 +0,0 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.domain.po.WxAuthorizerInfo; | |||
| import com.iformall.domain.po.WxComponentVerifyTicket; | |||
| import com.iformall.enums.EnumWxAuthorizationInfoType; | |||
| import com.iformall.enums.EnumWxAuthorizationStatus; | |||
| import com.iformall.service.WxAuthorizerInfoService; | |||
| import com.iformall.service.WxComponentVerifyTicketService; | |||
| import com.iformall.service.wechat.WxOpenService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import me.chanjar.weixin.common.error.WxErrorException; | |||
| import me.chanjar.weixin.mp.bean.kefu.WxMpKefuMessage; | |||
| import me.chanjar.weixin.mp.bean.message.WxMpXmlMessage; | |||
| import me.chanjar.weixin.mp.bean.message.WxMpXmlOutMessage; | |||
| import me.chanjar.weixin.open.bean.message.WxOpenXmlMessage; | |||
| import me.chanjar.weixin.open.bean.result.WxOpenAuthorizerInfoResult; | |||
| import me.chanjar.weixin.open.bean.result.WxOpenQueryAuthResult; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Controller; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import java.io.ByteArrayOutputStream; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.nio.charset.Charset; | |||
| import java.util.Date; | |||
| @Controller | |||
| @RequestMapping("/wxOpen") | |||
| @Api(description = "微信第三方开放平台回调相关接口") | |||
| public class WechatCalllbackController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| protected WxOpenService wxOpenService; | |||
| @Autowired | |||
| private WxComponentVerifyTicketService componentVerifyTicketService; | |||
| @Autowired | |||
| private WxAuthorizerInfoService authorizerInfoService; | |||
| @RequestMapping(value = "/notify", method = RequestMethod.POST) | |||
| @ApiOperation("接收ticket回调") | |||
| public Object receiveTicket(HttpServletRequest request) throws IOException { | |||
| logger.info("[" +getIpAddr() + "]接收微信请求 /wxOpen/notify"); | |||
| InputStream inStream = request.getInputStream(); | |||
| ByteArrayOutputStream outSteam = new ByteArrayOutputStream(); | |||
| byte[] buffer = new byte[1024]; | |||
| int len = 0; | |||
| while ((len = inStream.read(buffer)) != -1) { | |||
| outSteam.write(buffer, 0, len); | |||
| } | |||
| String resultxml = new String(outSteam.toByteArray(), Charset.forName("UTF-8")); | |||
| logger.info(resultxml); | |||
| outSteam.close(); | |||
| inStream.close(); | |||
| String timestamp = request.getParameter("timestamp"); | |||
| String nonce = request.getParameter("nonce"); | |||
| String signature = request.getParameter("signature"); | |||
| String encType = request.getParameter("encrypt_type"); | |||
| String msgSignature= request.getParameter("msg_signature"); | |||
| /* | |||
| // 测试数据 | |||
| String timestamp = "1545708083"; | |||
| String nonce = "1052028699"; | |||
| String signature = "b5fa8296b46c726cbed35f744944f20f682776a6"; | |||
| String encType = "aes"; | |||
| String msgSignature= "54bec4c513f447cb312fd091bea48326f87aedde"; | |||
| String resultxml = "<xml>\n" + | |||
| " <AppId><![CDATA[wx897e4673286c915d]]></AppId>\n" + | |||
| " <Encrypt><![CDATA[92gl+PCgxooLh85YZ74VX8gNPV3tq2w8br4tuBl2UIc9uJuJiSNBgohFxgS7tRXSMUtr5t+75MiLKlaMKvv4FH5iF3WdYbxjF6ojnA1+MBzD7mf9fo6KkWUdDq+1V0OtrooP4s8iuAC0Lx3elCtWUZXYGnCeP5Y/2A8ZZBwpvcBz73d7n2Kv8QVvLsw2dmrej1b8KGdmRAEbm/oYoVthlAkmoTTAAx+Gj10XTMem1wp1vT/a0mGxN88oJxNZoHdFvAbmc24A7VD4i5VDOt9FqwerqlGXnBX5pBAmOx8ZUsndM8yuf3I54GE9hEPRvdWBiyLb96Lb8ZnjEBlvc9kvs7PpFOSQhkbGMNQKWGW1os8UImr7O3+IiKLuBv2G1pJBb2/kIeZn5v9NuxYLOsXQmb2XijHYMXwCNHCI3Eji22k9XDiiuK1miHlUuL8Gz8X7lN9JuVcE24jd7Ty4H0pThQ==]]></Encrypt>\n" + | |||
| "</xml>"; | |||
| */ | |||
| logger.info("\n接收微信请求:[signature=[{}], encType=[{}], msgSignature=[{}]," | |||
| + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", | |||
| signature, encType, msgSignature, timestamp, nonce, resultxml); | |||
| if (!StringUtils.equalsIgnoreCase("aes", encType) | |||
| || !wxOpenService.getWxOpenComponentService().checkSignature(timestamp, nonce, signature)) { | |||
| throw new IllegalArgumentException("非法请求,可能属于伪造的请求!"); | |||
| } | |||
| // aes加密的消息 | |||
| WxOpenXmlMessage inMessage = WxOpenXmlMessage.fromEncryptedXml(resultxml, | |||
| wxOpenService.getWxOpenConfigStorage(), timestamp, nonce, msgSignature); | |||
| this.logger.debug("\n消息解密后内容为:\n{} ", inMessage.toString()); | |||
| if(inMessage.getInfoType().equals(EnumWxAuthorizationInfoType.COMPONENT_VERIFY_TICKET.getMessage())) { | |||
| // 保存component_verify_ticket | |||
| componentVerifyTicketService.saveOrUpdate(new WxComponentVerifyTicket(){ | |||
| { | |||
| setComponentVerifyTicket(inMessage.getComponentVerifyTicket()); | |||
| setCreateTime(new Date(Long.valueOf(inMessage.getCreateTime() * 1000))); | |||
| setComponentAppid(inMessage.getAppId()); | |||
| setDeadline(new Date(Long.valueOf(System.currentTimeMillis() + (60*60*1000)))); | |||
| } | |||
| }); | |||
| } else if (inMessage.getInfoType().equals(EnumWxAuthorizationInfoType.AUTHORIZED.getMessage()) || | |||
| inMessage.getInfoType().equals(EnumWxAuthorizationInfoType.UPDATEAUTHORIZED.getMessage()) | |||
| ) { | |||
| try { | |||
| WxOpenQueryAuthResult queryAuthResult = wxOpenService.getWxOpenComponentService().getQueryAuth(inMessage.getAuthorizationCode()); | |||
| logger.info("getQueryAuth", queryAuthResult); | |||
| WxOpenAuthorizerInfoResult openAuthorizerInfoResult = wxOpenService.getWxOpenComponentService().getAuthorizerInfo( | |||
| queryAuthResult.getAuthorizationInfo().getAuthorizerAppid()); | |||
| // save auth info | |||
| authorizerInfoService.saveOrUpdate(new WxAuthorizerInfo(){ | |||
| { | |||
| setAuthorizerAppid(openAuthorizerInfoResult.getAuthorizationInfo().getAuthorizerAppid()); | |||
| setAlias(openAuthorizerInfoResult.getAuthorizerInfo().getAlias()); | |||
| setHeadImg(openAuthorizerInfoResult.getAuthorizerInfo().getHeadImg()); | |||
| setQrcodeUrl(openAuthorizerInfoResult.getAuthorizerInfo().getQrcodeUrl()); | |||
| setAuthorizationStatus(EnumWxAuthorizationStatus.AUTHORIZED.getCode()); | |||
| } | |||
| }); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } else if (inMessage.getInfoType().equals(EnumWxAuthorizationInfoType.UNAUTHORIZED.getMessage())) { | |||
| authorizerInfoService.saveOrUpdate(new WxAuthorizerInfo(){ | |||
| { | |||
| setAuthorizerAppid(inMessage.getAuthorizerAppid()); | |||
| setAuthorizationStatus(EnumWxAuthorizationStatus.UNAUTHORIZED.getCode()); | |||
| } | |||
| }); | |||
| } | |||
| try { | |||
| String out = wxOpenService.getWxOpenComponentService().route(inMessage); | |||
| this.logger.debug("\n组装回复信息:{}", out); | |||
| } catch (WxErrorException e) { | |||
| this.logger.error("notify", e); | |||
| } | |||
| return "success"; | |||
| } | |||
| @RequestMapping(value = "/{appId}/callback") | |||
| @ApiOperation("消息回调") | |||
| public Object callback(@PathVariable("appId") String appId, HttpServletRequest request) throws IOException { | |||
| logger.info("[" +getIpAddr() + "]接收微信请求 /{appId}/callback"); | |||
| InputStream inStream = request.getInputStream(); | |||
| ByteArrayOutputStream outSteam = new ByteArrayOutputStream(); | |||
| byte[] buffer = new byte[1024]; | |||
| int len = 0; | |||
| while ((len = inStream.read(buffer)) != -1) { | |||
| outSteam.write(buffer, 0, len); | |||
| } | |||
| String resultxml = new String(outSteam.toByteArray(), Charset.forName("UTF-8")); | |||
| logger.info(resultxml); | |||
| outSteam.close(); | |||
| inStream.close(); | |||
| String timestamp = request.getParameter("timestamp"); | |||
| String nonce = request.getParameter("nonce"); | |||
| String signature = request.getParameter("signature"); | |||
| String encType = request.getParameter("encrypt_type"); | |||
| String openid = request.getParameter("openid"); | |||
| String msgSignature= request.getParameter("msg_signature"); | |||
| logger.info( | |||
| "\n接收微信请求:[appId=[{}], openid=[{}], signature=[{}], encType=[{}], msgSignature=[{}]," | |||
| + " timestamp=[{}], nonce=[{}], requestBody=[\n{}\n] ", | |||
| appId, openid, signature, encType, msgSignature, timestamp, nonce, resultxml); | |||
| if (!StringUtils.equalsIgnoreCase("aes", encType) | |||
| || !wxOpenService.getWxOpenComponentService().checkSignature(timestamp, nonce, signature)) { | |||
| throw new IllegalArgumentException("非法请求,可能属于伪造的请求!"); | |||
| } | |||
| String out = ""; | |||
| // aes加密的消息 | |||
| WxMpXmlMessage inMessage = WxOpenXmlMessage.fromEncryptedMpXml(resultxml, | |||
| wxOpenService.getWxOpenConfigStorage(), timestamp, nonce, msgSignature); | |||
| logger.debug("\n消息解密后内容为:\n{} ", inMessage.toString()); | |||
| // 全网发布测试用例 | |||
| if (StringUtils.equalsAnyIgnoreCase(appId, "wx570bc396a51b8ff8", "wxd101a85aa106f53e")) { | |||
| try { | |||
| if (StringUtils.equals(inMessage.getMsgType(), "text")) { | |||
| if (StringUtils.equals(inMessage.getContent(), "TESTCOMPONENT_MSG_TYPE_TEXT")) { | |||
| out = WxOpenXmlMessage.wxMpOutXmlMessageToEncryptedXml( | |||
| WxMpXmlOutMessage.TEXT().content("TESTCOMPONENT_MSG_TYPE_TEXT_callback") | |||
| .fromUser(inMessage.getToUser()) | |||
| .toUser(inMessage.getFromUser()) | |||
| .build(), | |||
| wxOpenService.getWxOpenConfigStorage() | |||
| ); | |||
| } else if (StringUtils.startsWith(inMessage.getContent(), "QUERY_AUTH_CODE:")) { | |||
| String msg = inMessage.getContent().replace("QUERY_AUTH_CODE:", "") + "_from_api"; | |||
| WxMpKefuMessage kefuMessage = WxMpKefuMessage.TEXT().content(msg).toUser(inMessage.getFromUser()).build(); | |||
| wxOpenService.getWxOpenComponentService().getWxMpServiceByAppid(appId).getKefuService().sendKefuMessage(kefuMessage); | |||
| } | |||
| } else if (StringUtils.equals(inMessage.getMsgType(), "event")) { | |||
| WxMpKefuMessage kefuMessage = WxMpKefuMessage.TEXT().content(inMessage.getEvent() + "from_callback").toUser(inMessage.getFromUser()).build(); | |||
| wxOpenService.getWxOpenComponentService().getWxMpServiceByAppid(appId).getKefuService().sendKefuMessage(kefuMessage); | |||
| } | |||
| } catch (WxErrorException e) { | |||
| logger.error("callback", e); | |||
| } | |||
| } else { | |||
| /**判断消息类型,调用对应的方法*/ | |||
| switch (inMessage.getMsgType()){ | |||
| case "event": | |||
| case "text": | |||
| WxMpXmlOutMessage outMessage = wxOpenService.getWxOpenMessageRouter().route(inMessage, appId); | |||
| if (outMessage != null) { | |||
| out = WxOpenXmlMessage.wxMpOutXmlMessageToEncryptedXml(outMessage, wxOpenService.getWxOpenConfigStorage()); | |||
| } | |||
| /* | |||
| else { | |||
| WxMpXmlOutMessage outMsg = new WxMpXmlOutTextMessage(); | |||
| outMsg.setCreateTime(System.currentTimeMillis()); | |||
| outMsg.setToUserName(inMessage.getFromUser()); | |||
| outMsg.setFromUserName(inMessage.getToUser()); | |||
| outMsg.setMsgType("text"); | |||
| ((WxMpXmlOutTextMessage) outMsg).setContent(inMessage.getContent()); | |||
| out = WxOpenXmlMessage.wxMpOutXmlMessageToEncryptedXml(outMsg, wxOpenService.getWxOpenConfigStorage()); | |||
| } | |||
| */ | |||
| else { | |||
| out = "success"; | |||
| } | |||
| break; | |||
| default: | |||
| return "success"; | |||
| } | |||
| } | |||
| logger.info(out); | |||
| return out; | |||
| } | |||
| } | |||
| @@ -1,236 +0,0 @@ | |||
| package com.iformall.controller; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.google.gson.Gson; | |||
| import com.google.gson.GsonBuilder; | |||
| import com.google.gson.reflect.TypeToken; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.service.wechat.WxOpenService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import me.chanjar.weixin.common.error.WxErrorException; | |||
| import me.chanjar.weixin.open.api.WxOpenMaService; | |||
| import me.chanjar.weixin.open.bean.ma.WxMaOpenCommitExtInfo; | |||
| import me.chanjar.weixin.open.bean.message.WxOpenMaSubmitAuditMessage; | |||
| import me.chanjar.weixin.open.bean.result.*; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.PostMapping; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import javax.servlet.ServletOutputStream; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.io.File; | |||
| import java.io.FileInputStream; | |||
| import java.io.IOException; | |||
| import java.io.InputStream; | |||
| import java.util.Map; | |||
| /** | |||
| * Stormeye Wu | |||
| */ | |||
| @RestController | |||
| @RequestMapping("/weappCode") | |||
| @Api(description = "微信第三方开发平台-小程序-代码管理") | |||
| public class WechatWeappCodeController { | |||
| private final Logger logger = LoggerFactory.getLogger(getClass()); | |||
| @Autowired | |||
| private WxOpenService openService; | |||
| @ApiOperation(value = "为授权的小程序帐号上传小程序代码", notes = "extInfo参考https://mp.weixin.qq.com/debug/wxadoc/dev/framework/config.html") | |||
| @PostMapping("/codeCommit") | |||
| public ResultData codeCommit(Long templateId, String userVersion, String userDesc, String extInfoStr) { | |||
| try { | |||
| Gson gson= new GsonBuilder().create(); | |||
| WxMaOpenCommitExtInfo extInfo = gson.fromJson(extInfoStr, new TypeToken<WxMaOpenCommitExtInfo>() { }.getType()); | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(extInfo.getExtAppid()); | |||
| logger.info(extInfo.toString()); | |||
| WxOpenResult openRet = openMaService.codeCommit(templateId, userVersion, userDesc, extInfo); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation("获取体验小程序的体验二维码") | |||
| @GetMapping("/getQrcode") | |||
| public void getQrcode(String appId, String pagePath, Map<String, String> params, HttpServletResponse response, HttpServletRequest req) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| File file = openMaService.getTestQrcode(pagePath, params); | |||
| ServletOutputStream out = response.getOutputStream(); | |||
| response.reset(); | |||
| response.setContentType("bin"); | |||
| String agent = req.getHeader("user-agent"); | |||
| String filename = "qrcode"; | |||
| if (agent.contains("Firefox")) { | |||
| response.setHeader("Content-disposition", | |||
| "attachment; filename=" | |||
| + new String(filename.getBytes("GB2312"),"ISO-8859-1")); | |||
| } else { | |||
| response.setHeader("Content-disposition", | |||
| "attachment; filename=" | |||
| + java.net.URLEncoder.encode(filename,"UTF-8")); | |||
| } | |||
| // 循环取出流中的数据 | |||
| byte[] b = new byte[1024]; | |||
| int len; | |||
| InputStream inStream = new FileInputStream(file); | |||
| while ((len = inStream.read(b)) > 0) | |||
| response.getOutputStream().write(b, 0, len); | |||
| inStream.close(); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } catch (IOException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("获取授权小程序帐号已设置的类目") | |||
| @GetMapping("/getCategory") | |||
| public ResultData getCategory(String appId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenMaCategoryListResult openRet = openMaService.getCategoryList(); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation("获取小程序的第三方提交代码的页面配置") | |||
| @GetMapping("/getPage") | |||
| public ResultData getPage(String appId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenMaPageListResult openRet = openMaService.getPageList(); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation("将第三方提交的代码包提交审核") | |||
| @PostMapping("/submitAudit") | |||
| public ResultData submitAudit(String appId, String subMesgStr) { | |||
| try { | |||
| WxOpenMaSubmitAuditMessage subMessage = JSON.parseObject(subMesgStr, WxOpenMaSubmitAuditMessage.class); | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenMaSubmitAuditResult openRet = openMaService.submitAudit(subMessage); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation("查询某个指定版本的审核状态") | |||
| @PostMapping("/getAuditstatus") | |||
| public ResultData getAuditstatus(String appId, String auditidStr) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenMaQueryAuditResult openRet = openMaService.getAuditStatus(Long.valueOf(auditidStr)); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation("查询最新一次提交的审核状态") | |||
| @GetMapping("/getLatestAuditstatus") | |||
| public ResultData get_latest_auditstatus(String appId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenMaQueryAuditResult openRet = openMaService.getLatestAuditStatus(); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation("发布已通过审核的小程序") | |||
| @PostMapping("/releaesAudited") | |||
| public ResultData releaesAudited(String appId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenResult openRet = openMaService.releaesAudited(); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation("小程序版本回退") | |||
| @GetMapping("/revertCodeRelease") | |||
| public ResultData revertCodeRelease(String appId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenResult openRet = openMaService.revertCodeReleaes(); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation("查询当前设置的最低基础库版本及各版本用户占比") | |||
| @GetMapping("/getSupportVersion") | |||
| public ResultData getSupportVersion(String appId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| String openRet = openMaService.getSupportVersion(); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation("设置最低基础库版本") | |||
| @GetMapping("/setSupportVersion") | |||
| public ResultData setSupportVersion(String appId, String version) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| String openRet = openMaService.setSupportVersion(version); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation(value = "小程序审核撤回", notes = "单个帐号每天审核撤回次数最多不超过1次,一个月不超过10次。") | |||
| @GetMapping("/undoCodeAudit") | |||
| public ResultData undoCodeAudit(String appId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| openMaService.undoCodeAudit(); | |||
| return new ResultData(); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| } | |||
| @@ -1,83 +0,0 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxAuthorizerInfo; | |||
| import com.iformall.enums.EnumWxAuthorizationStatus; | |||
| import com.iformall.service.WxAuthorizerInfoService; | |||
| import com.iformall.service.wechat.WxOpenService; | |||
| import io.swagger.annotations.Api; | |||
| import me.chanjar.weixin.common.error.WxErrorException; | |||
| import me.chanjar.weixin.open.api.WxOpenMaService; | |||
| import me.chanjar.weixin.open.bean.WxOpenMaCodeTemplate; | |||
| import me.chanjar.weixin.open.bean.ma.WxMaOpenCommitExtInfo; | |||
| import me.chanjar.weixin.open.bean.result.WxOpenAuthorizerInfoResult; | |||
| import me.chanjar.weixin.open.bean.result.WxOpenQueryAuthResult; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Controller; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.io.IOException; | |||
| import java.util.List; | |||
| /** | |||
| * Stormeye Wu | |||
| */ | |||
| @RestController | |||
| @RequestMapping("/weappDraftTemplate") | |||
| @Api(description = "微信第三方开发平台-小程序-代码模版库管理") | |||
| public class WechatWeappDraftTemplateController { | |||
| private final Logger logger = LoggerFactory.getLogger(getClass()); | |||
| @Autowired | |||
| private WxOpenService openService; | |||
| @GetMapping("/tempDraftList") | |||
| public ResultData getTempDraftList() { | |||
| try { | |||
| List<WxOpenMaCodeTemplate> list = openService.getWxOpenComponentService().getTemplateDraftList(); | |||
| return new ResultData(list); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| @GetMapping("/tempList") | |||
| public ResultData getTempList() { | |||
| try { | |||
| List<WxOpenMaCodeTemplate> list = openService.getWxOpenComponentService().getTemplateList(); | |||
| return new ResultData(list); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| @PostMapping("/addToTemplate") | |||
| public ResultData addToTemplate(Long draftId) { | |||
| try { | |||
| openService.getWxOpenComponentService().addToTemplate(draftId); | |||
| return new ResultData(); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| @PostMapping("/deleteTemplate") | |||
| public ResultData deleteTemplate(Long templateId) { | |||
| try { | |||
| openService.getWxOpenComponentService().deleteTemplate(templateId); | |||
| return new ResultData(); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,115 +0,0 @@ | |||
| package com.iformall.controller; | |||
| import cn.binarywang.wx.miniapp.api.WxMaService; | |||
| import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateAddResult; | |||
| import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateLibraryGetResult; | |||
| import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateLibraryListResult; | |||
| import cn.binarywang.wx.miniapp.bean.template.WxMaTemplateListResult; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.service.wechat.WxOpenService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import me.chanjar.weixin.common.error.WxErrorException; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.List; | |||
| /** | |||
| * Stormeye Wu | |||
| */ | |||
| @RestController | |||
| @RequestMapping("/weappMsgTemplate") | |||
| @Api(description = "微信第三方开发平台-小程序-消息模板设置") | |||
| public class WechatWeappMsgTemplateController { | |||
| private final Logger logger = LoggerFactory.getLogger(getClass()); | |||
| @Autowired | |||
| private WxOpenService openService; | |||
| @ApiOperation("获取小程序模板库标题列表") | |||
| @GetMapping("getTmpLibList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData getTmpLibList(String appId, Integer pageNum, Integer pageSize) { | |||
| try { | |||
| WxMaService maService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxMaTemplateLibraryListResult ret = maService.getTemplateService().findTemplateLibraryList(pageNum, pageSize); | |||
| return new ResultData(ret); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("获取模板库某个模板标题下关键词库") | |||
| @GetMapping("getTemplateLibraryKeywordList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "id", value = "页数", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData findTemplateLibraryKeywordList(String appId, String id) { | |||
| try { | |||
| WxMaService maService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxMaTemplateLibraryGetResult ret = maService.getTemplateService().findTemplateLibraryKeywordList(id); | |||
| return new ResultData(ret); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("组合模板并添加至帐号下的个人模板库") | |||
| @PostMapping("addTemplate") | |||
| public ResultData addTemplate( | |||
| @RequestParam(value = "appId") String appId, | |||
| @RequestParam(value = "id") String id, | |||
| @RequestParam(value = "keywordIdList")List<Integer> keywordIdList) { | |||
| try { | |||
| WxMaService maService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxMaTemplateAddResult ret = maService.getTemplateService().addTemplate(id, keywordIdList); | |||
| return new ResultData(ret); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("获取帐号下已存在的模板列表") | |||
| @GetMapping("getTemplateList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "appId", value = "appId", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData findTemplateList(String appId, Integer pageNum, Integer pageSize) { | |||
| try { | |||
| WxMaService maService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxMaTemplateListResult ret = maService.getTemplateService().findTemplateList(pageNum, pageSize); | |||
| return new ResultData(ret); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| @ApiOperation("删除帐号下的某个模板") | |||
| @PostMapping("delTemplate") | |||
| public ResultData delTemplate(@RequestParam(value = "appId") String appId, @RequestParam(value = "templateId") String templateId) { | |||
| try { | |||
| WxMaService maService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| maService.getTemplateService().delTemplate(templateId); | |||
| return new ResultData(); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,126 +0,0 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.service.wechat.WxOpenService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import me.chanjar.weixin.common.error.WxErrorException; | |||
| import me.chanjar.weixin.open.api.WxOpenMaService; | |||
| import me.chanjar.weixin.open.bean.result.*; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.List; | |||
| /** | |||
| * Stormeye Wu | |||
| */ | |||
| @RestController | |||
| @RequestMapping("/weappSet") | |||
| @Api(description = "微信第三方开发平台-小程序设置") | |||
| public class WechatWeappSetController { | |||
| private final Logger logger = LoggerFactory.getLogger(getClass()); | |||
| @Autowired | |||
| private WxOpenService openService; | |||
| @ApiOperation("获取小程序服务器域名") | |||
| @GetMapping("/getDomain") | |||
| public ResultData modifyDomain(String appId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenResult openRet = openMaService.getDomain(); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation(value = "设置小程序服务器域名", notes = "{\n" + | |||
| " \"action\":\"add\",\n" + | |||
| " \"requestdomain\":[\"https://www.qq.com\",\"https://www.qq.com\"],\n" + | |||
| " \"wsrequestdomain\":[\"wss://www.qq.com\",\"wss://www.qq.com\"],\n" + | |||
| " \"uploaddomain\":[\"https://www.qq.com\",\"https://www.qq.com\"],\n" + | |||
| " \"downloaddomain\":[\"https://www.qq.com\",\"https://www.qq.com\"],\n" + | |||
| " }") | |||
| @PostMapping("/modifyDomain") | |||
| public ResultData modifyDomain(@RequestParam(value = "appId") String appId, @RequestParam(value = "action") String action, | |||
| @RequestParam(value = "requestDomain") List<String> requestDomain, @RequestParam(value = "wsrequestdomain") List<String> wsrequestdomain, | |||
| @RequestParam(value = "uploaddomain") List<String> uploaddomain, @RequestParam(value = "downloaddomain") List<String> downloaddomain) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenMaDomainResult openRet = openMaService.modifyDomain(action, | |||
| requestDomain, wsrequestdomain, | |||
| uploaddomain, downloaddomain); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation(value = "设置小程序业务域名", notes = "{\n" + | |||
| " \"action\":\"add\",\n" + | |||
| " \"webviewdomain\":[\"https://www.qq.com\",\"https://m.qq.com\"]\n" + | |||
| " }") | |||
| @PostMapping("/setWebViewDomain") | |||
| public ResultData setWebViewDomain(@RequestParam(value = "appId") String appId, @RequestParam(value = "action") String action, | |||
| @RequestParam(value = "urlList") List<String> urlList) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| String openRet = openMaService.setWebViewDomain(action, urlList); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation(value = "绑定微信用户为小程序体验者", notes = "") | |||
| @PostMapping("/bindTester") | |||
| public ResultData bindTester(@RequestParam(value = "appId") String appId, @RequestParam(value = "wechatId") String wechatId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenResult openRet = openMaService.bindTester(wechatId); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation(value = "解除绑定小程序的体验者", notes = "") | |||
| @PostMapping("/unbindTester") | |||
| public ResultData unbindTester(@RequestParam(value = "appId") String appId, @RequestParam(value = "wechatId") String wechatId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenResult openRet = openMaService.unbindTester(wechatId); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| @ApiOperation(value = "获取体验者列表", notes = "") | |||
| @PostMapping("/getTesterList") | |||
| public ResultData getTesterList(@RequestParam(value = "appId") String appId) { | |||
| try { | |||
| WxOpenMaService openMaService = openService.getWxOpenComponentService().getWxMaServiceByAppid(appId); | |||
| WxOpenResult openRet = openMaService.getTesterList(); | |||
| logger.info(openRet.toString()); | |||
| return new ResultData(openRet); | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return new ResultData(Result.ERROR); | |||
| } | |||
| } | |||
| @@ -0,0 +1,80 @@ | |||
| package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxBillOtherDeposit; | |||
| import com.iformall.service.WxBillOtherDepositService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.Map; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @RestController | |||
| @RequestMapping("wxBillOtherDeposit") | |||
| public class WxBillOtherDepositController extends BaseController { | |||
| @Autowired | |||
| private WxBillOtherDepositService wxBillOtherDepositService; | |||
| private Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @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 WxBillOtherDeposit wxBillOtherDeposit, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::list"); | |||
| if (null == wxBillOtherDeposit) { | |||
| wxBillOtherDeposit = new WxBillOtherDeposit(); | |||
| } | |||
| wxBillOtherDeposit.setTenantId(getTenantId()); | |||
| final PageInfo<Map<String, Object>> page = wxBillOtherDepositService.listAsPage(wxBillOtherDeposit, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxBillOtherDeposit wxBillOtherDeposit) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::add"); | |||
| wxBillOtherDeposit.setTenantId(getTenantId()); | |||
| wxBillOtherDeposit.setUserId(getUser().getId()); | |||
| return wxBillOtherDepositService.saveOrUpdate(wxBillOtherDeposit); | |||
| } | |||
| @PostMapping("update") | |||
| public ResultData update(@RequestBody WxBillOtherDeposit wxBillOtherDeposit) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::update"); | |||
| wxBillOtherDeposit.setUserId(getUser().getId()); | |||
| return wxBillOtherDepositService.saveOrUpdate(wxBillOtherDeposit); | |||
| } | |||
| @GetMapping("/del") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData delete(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::delete"); | |||
| wxBillOtherDepositService.deleteById(id); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::findById"); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxBillOtherDepositService.getById(id)); | |||
| } | |||
| @GetMapping("/updatePaid") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData updatePaid(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxBillOtherDepositController::updatePaid"); | |||
| return wxBillOtherDepositService.updatePaid(id); | |||
| } | |||
| } | |||
| @@ -62,7 +62,8 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| @Autowired | |||
| private WxLevelConfigService wxLevelConfigService; | |||
| @Autowired | |||
| WxCarPayRecordService wxCarPayRecordService; | |||
| @Autowired | |||
| StringRedisTemplate stringRedisTemplate; | |||
| @@ -73,9 +74,9 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| private void setUserInfoLevel(WxCUserBasicInfo info) { | |||
| if (info.getPoins() == null || info.getPoins() == 0) { | |||
| info.setLevel("无"); | |||
| info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | |||
| } else { | |||
| info.setLevel("无"); | |||
| info.setLevel(WxLevelConfigService.DEFAULT_LEVEL); | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(info.getTenantId()); | |||
| for (WxLevelConfig levelConfig : levelList) { | |||
| if (info.getPoins() >= levelConfig.getPoints()) { | |||
| @@ -132,7 +133,7 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| } | |||
| String tenantId = getTenantId(); | |||
| wxCUserBasicInfo.setTenantId(tenantId); | |||
| wxCUserBasicInfo.setSortColumns(WxCUserBasicInfo.Field.Id_DESC); | |||
| wxCUserBasicInfo.setSortColumns(WxCUserBasicInfo.Field.UpdateDate_DESC); | |||
| PageInfo<WxCUserBasicInfo> page = wxCUserBasicInfoService.listAsPage(wxCUserBasicInfo, pageNum, pageSize); | |||
| if (page.getSize() > 0) { | |||
| @@ -411,4 +412,31 @@ public class WxCUserBasicInfoController extends BaseController { | |||
| return new ResultData(Result.SUCCESS, "查询成功", entries); | |||
| } | |||
| @ApiOperation("进出场车辆分页列表接口") | |||
| @GetMapping("carPayList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "endDate", value = "结束时间", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "isPay", value = "是否缴费 1是", dataType = "int", paramType = "query") | |||
| }) | |||
| public ResultData carPayList(@ModelAttribute WxCarPayRecord record, Integer pageNum, Integer pageSize){ | |||
| record.setTenantId(super.getTenantId()); | |||
| return new ResultData(wxCarPayRecordService.findCarPayListByPage(record,pageNum,pageSize)); | |||
| } | |||
| @ApiOperation("停车会员记录导出") | |||
| @GetMapping("/exportCarPayData") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "startDate", value = "开始时间", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "endDate", value = "结束时间", dataType = "string", paramType = "query"), | |||
| @ApiImplicitParam(name = "isPay", value = "是否缴费 1是", dataType = "int", paramType = "query") | |||
| }) | |||
| public void exportCarPayData(@ModelAttribute WxCarPayRecord record,HttpServletRequest request, HttpServletResponse response) { | |||
| logger.debug("[" + getIpAddr() + "] WxCUserBasicInfoController::exportData"); | |||
| record.setTenantId(getTenantId()); | |||
| wxCUserBasicInfoService.exportCarPayData(record, request, response); | |||
| } | |||
| } | |||
| @@ -3,9 +3,7 @@ package com.iformall.controller; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.domain.po.WxCUserCar; | |||
| import com.iformall.domain.po.WxCarCmdLog; | |||
| import com.iformall.domain.po.WxPark; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.enums.EnumCarCmd; | |||
| import com.iformall.enums.EnumCarVendor; | |||
| import com.iformall.enums.EnumCouponSendSendType; | |||
| @@ -22,6 +20,7 @@ import org.springframework.web.bind.annotation.RequestBody; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| @@ -51,6 +50,12 @@ public class WxCarCallBackController extends BaseController { | |||
| @Autowired | |||
| WxCouponSendService wxCouponSendService; | |||
| @Autowired | |||
| WxCarPayRecordService wxCarPayRecordService; | |||
| @Autowired | |||
| WxCUserService wxCUserService; | |||
| /** | |||
| * ETCP 车辆入场通知 | |||
| * { | |||
| @@ -85,7 +90,7 @@ public class WxCarCallBackController extends BaseController { | |||
| WxPark park = wxParkService.getByObj(parkQ); | |||
| if (park == null) { | |||
| logger.error("etcpParkInCallback: ETCP车场未找到" + etcpParkId); | |||
| return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | |||
| //return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | |||
| } else { | |||
| tenantId = park.getTenantId(); | |||
| wxCarCmdLog.setTenantId(park.getTenantId()); | |||
| @@ -98,6 +103,8 @@ public class WxCarCallBackController extends BaseController { | |||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||
| } | |||
| String phoneStrs = ""; | |||
| // 停车发券 | |||
| String carNumber = paramMap.get("plateNumber"); | |||
| if (!StringUtils.isBlank(carNumber)) { | |||
| @@ -110,9 +117,40 @@ public class WxCarCallBackController extends BaseController { | |||
| List<WxCUserCar> userCarList = wxCUserCarService.getList(userCarQ); | |||
| for (WxCUserCar userCar : userCarList) { | |||
| wxCouponSendService.sendCouponToUser(EnumCouponSendSendType.CAR_STOP, userCar); | |||
| WxCUser cUser = wxCUserService.getById(userCar.getCUserId()); | |||
| if(cUser != null){ | |||
| phoneStrs += cUser.getPhone() + ","; | |||
| } | |||
| } | |||
| } | |||
| // 替换最后一个逗号 | |||
| if(StringUtils.isNotBlank(phoneStrs)){ | |||
| phoneStrs = phoneStrs.substring(0,phoneStrs.length() - 1); | |||
| } | |||
| try { | |||
| // 保存WxCarPayRecord | |||
| WxCarPayRecord record = new WxCarPayRecord(); | |||
| record.setVendorType(wxCarCmdLog.getVendorType()); | |||
| Map<String,String> jsonMap = (Map)JSON.parseObject(wxCarCmdLog.getCmdJson()); | |||
| record.setSynId(jsonMap.get("synId")); | |||
| record.setParkId(jsonMap.get("parkId")); | |||
| record.setParkName(jsonMap.get("parkName")); | |||
| record.setUserType(jsonMap.get("userType")); | |||
| record.setPlateNumber(jsonMap.get("plateNumber")); | |||
| if(StringUtils.isNotBlank(jsonMap.get("entranceTime"))) { | |||
| record.setEntranceTime(new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(jsonMap.get("entranceTime"))); | |||
| } | |||
| record.setFixParkingId(jsonMap.get("fixParkingId")); | |||
| record.setRemainingDays(jsonMap.get("remainingDays")); | |||
| record.setPhone(phoneStrs); | |||
| record.setTenantId(park.getTenantId()); | |||
| wxCarPayRecordService.saveOrUpdate(record); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| logger.error("WxCarPayRecord: 入库错误 " + paramMap.toString()); | |||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||
| } | |||
| return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage()); | |||
| } | |||
| @@ -154,7 +192,7 @@ public class WxCarCallBackController extends BaseController { | |||
| WxPark park = wxParkService.getByObj(parkQ); | |||
| if (park == null) { | |||
| logger.error("etcpParkOutCallback: ETCP车场未找到 " + etcpParkId); | |||
| return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | |||
| // return new Result(ErrorCode.CAR_PARK_NOT_FOUND.getCode(), "ETCP车场未找到"+ etcpParkId); | |||
| } else { | |||
| wxCarCmdLog.setTenantId(park.getTenantId()); | |||
| } | |||
| @@ -166,6 +204,23 @@ public class WxCarCallBackController extends BaseController { | |||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||
| } | |||
| try { | |||
| // 保存WxCarPayRecord | |||
| WxCarPayRecord record = new WxCarPayRecord(); | |||
| record.setSynId(paramMap.get("synId")); | |||
| if(StringUtils.isNotBlank(paramMap.get("exitTime"))) { | |||
| record.setExitTime(new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(paramMap.get("exitTime"))); | |||
| } | |||
| if(StringUtils.isNotBlank(paramMap.get("stayedTime"))) { | |||
| record.setStayedTime(Long.parseLong(paramMap.get("stayedTime"))); | |||
| } | |||
| wxCarPayRecordService.updateBySynId(record); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| logger.error("WxCarPayRecord: 出场更新错误 " + paramMap.toString()); | |||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||
| } | |||
| // TODO 如果此车关联了停车优免券,自动把优免券设为已使用 | |||
| return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage()); | |||
| @@ -251,6 +306,22 @@ public class WxCarCallBackController extends BaseController { | |||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||
| } | |||
| try { | |||
| // 保存WxCarPayRecord | |||
| WxCarPayRecord record = new WxCarPayRecord(); | |||
| record.setSynId(paramMap.get("orderId")); | |||
| record.setPaidServiceFee(paramMap.get("paidServiceFee")); | |||
| if(StringUtils.isNotBlank(paramMap.get("time"))) { | |||
| record.setFeeTime(new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(paramMap.get("time"))); | |||
| } | |||
| record.setFee(paramMap.get("fee")); | |||
| wxCarPayRecordService.updateBySynId(record); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| logger.error("WxCarPayRecord: 缴费更新错误 " + paramMap.toString()); | |||
| return new Result(ErrorCode.DB_FAIL.getCode(), "入库错误" + paramMap.toString()); | |||
| } | |||
| // 营销 - 短信 | |||
| return new Result(EnumETCPCode.SUCCESS.getCode(), EnumETCPCode.SUCCESS.getMessage()); | |||
| } | |||
| @@ -282,12 +282,16 @@ public class WxCarController extends BaseController { | |||
| WxPark park = getCurrentPark(user); | |||
| if (park.getVendorType() == EnumCarVendor.CAR_ETCP.getCode()) { | |||
| String params = park.getVendorParams(); | |||
| if(params == null) { | |||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "车场不支持"); | |||
| } | |||
| JSONObject objParams = JSON.parseObject(params); | |||
| String url = objParams.getString("url"); | |||
| String merchantNo = objParams.getString("merchantNo"); | |||
| String merchantKey = objParams.getString("merchantKey"); | |||
| String version = objParams.getString("version"); | |||
| if (park.getParkingId() == null) { | |||
| // those code is not supported | |||
| String lat = objParams.getString("lat"); | |||
| String lon = objParams.getString("lon"); | |||
| String radius = objParams.getString("radius"); | |||
| @@ -315,7 +319,6 @@ public class WxCarController extends BaseController { | |||
| if (park.getParkingId() != null) { | |||
| String ret = etcp.parkingStatus(url, merchantNo, merchantKey, version, park.getParkingId()); | |||
| JSONObject retObj = JSON.parseObject(ret); | |||
| if (retObj.getIntValue("code") == EnumETCPCode.SUCCESS.getCode()) { | |||
| if (retObj.get("data") != null) { | |||
| @@ -102,7 +102,7 @@ public class WxCouponController extends BaseController { | |||
| return listType(wxCoupon, pageNum, pageSize, 0); //券列表 | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @ApiOperation("卡分页列表接口") | |||
| @GetMapping("listCard") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @@ -112,6 +112,16 @@ public class WxCouponController extends BaseController { | |||
| return listType(wxCoupon, pageNum, pageSize, EnumCouponType.CARD_MULTIMCH.getCode()); //卡列表 | |||
| } | |||
| @ApiOperation("砍价分页列表接口") | |||
| @GetMapping("listPress") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData listPress(@ModelAttribute WxCoupon wxCoupon, Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] WxCouponController::listPress"); | |||
| return listType(wxCoupon, pageNum, pageSize, EnumCouponType.COUPON_PRESS.getCode()); //砍价列表 | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("list") | |||
| @ApiImplicitParams({ | |||
| @@ -6,6 +6,7 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxCouponSend; | |||
| import com.iformall.domain.vo.WxCouponSendVo; | |||
| import com.iformall.enums.EnumCouponSendStatus; | |||
| import com.iformall.enums.EnumCouponSendType; | |||
| import com.iformall.enums.EnumCouponStatus; | |||
| @@ -46,9 +47,9 @@ public class WxCouponSendController extends BaseController { | |||
| wxCouponSend.setTenantId(getTenantId()); | |||
| wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode()); | |||
| wxCouponSend.setSortColumns(WxCouponSend.Field.CreateDate_DESC); | |||
| final PageInfo<WxCouponSend> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize); | |||
| final PageInfo<WxCouponSendVo> page = wxCouponSendService.listAsPage(wxCouponSend, pageNum, pageSize); | |||
| for (WxCouponSend cs:page.getList()) | |||
| for (WxCouponSendVo cs:page.getList()) | |||
| cs.setSendCount(wxCouponActionLogService.getCountByChannelId(getTenantId(), cs.getSendType(), cs.getId())); | |||
| return new ResultData(page); | |||
| @@ -63,7 +64,7 @@ public class WxCouponSendController extends BaseController { | |||
| } | |||
| wxCouponSend.setTenantId(getTenantId()); | |||
| wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode()); | |||
| List<WxCouponSend> wxCouponSendList = wxCouponSendService.listAsPage(wxCouponSend, 1, 1).getList(); | |||
| List<WxCouponSendVo> wxCouponSendList = wxCouponSendService.listAsPage(wxCouponSend, 1, 1).getList(); | |||
| if (wxCouponSendList != null && wxCouponSendList.size() > 0) { | |||
| return new ResultData(ErrorCode.COUPON_SEND_IS_EXISTED); | |||
| } | |||
| @@ -0,0 +1,107 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.service.WxFlowService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| import java.util.*; | |||
| @RestController | |||
| @Api(description = "工作流相关接口") | |||
| @RequestMapping(value = "workflow") | |||
| public class WxFlowAbleController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxFlowService wxFlowService; | |||
| @ApiOperation(value = "启动流程",notes = "{\"businessId\":\"221178539888607232\",\"businessType\":1,\"remark\":\"意见意见。\",\"taskAssignee\":[{\"taskKey\":\"firstTaskUser\",\"assignee\":\"243650055783841792\"},{\"taskKey\":\"secondTaskUser\",\"assignee\":\"\"}],\"variables\":[{\"key\":\"contractType\",\"value\":\"1\"},{\"key\":\"contractNumber\",\"value\":\"1111\"}]}") | |||
| @PostMapping("/start") | |||
| public ResultData start(@RequestBody Map<String, Object> params) { | |||
| logger.debug("[" + getIpAddr() + "] FlowAbleController::start"); | |||
| return wxFlowService.start(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId()); | |||
| } | |||
| /** | |||
| * 用户代办列表 | |||
| */ | |||
| @ApiOperation("用户代办列表") | |||
| @GetMapping(value = "/list") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "flowType", value = "流程类型,1合同流程 2账单流程", dataType = "int", paramType = "query", required = true) | |||
| }) | |||
| public ResultData list(Integer flowType,Integer pageNum, Integer pageSize) { | |||
| logger.debug("[" + getIpAddr() + "] FlowAbleController::list"); | |||
| return wxFlowService.list(flowType,pageNum,pageSize,super.getUser().getId()); | |||
| } | |||
| /** | |||
| * 审批历史 | |||
| */ | |||
| @ApiOperation("审批历史") | |||
| @GetMapping(value = "/applyHistory") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "businessId", value = "业务id", dataType = "long", paramType = "query", required = true), | |||
| }) | |||
| public ResultData applyHistory(Long businessId) { | |||
| logger.debug("[" + getIpAddr() + "] FlowAbleController::applyHistory"); | |||
| return wxFlowService.applyHistory(businessId,super.getTenantId()); | |||
| } | |||
| /** | |||
| * 审批历史和代办 | |||
| */ | |||
| @ApiOperation("审批历史和代办") | |||
| @GetMapping(value = "/applyHistoryAndAssignee") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "businessId", value = "业务id", dataType = "long", paramType = "query", required = true), | |||
| }) | |||
| public ResultData applyHistoryAndAssignee(Long businessId) { | |||
| logger.debug("[" + getIpAddr() + "] FlowAbleController::applyHistoryAndAssignee"); | |||
| return wxFlowService.getTaskStatusList(businessId,super.getTenantId()); | |||
| } | |||
| /** | |||
| * 审批 | |||
| */ | |||
| @ApiOperation(value = "审批",notes = "{\"taskId\":\"\",\"processInstanceId\":\"\",\"remark\":\"\"}") | |||
| @PostMapping(value = "apply") | |||
| public ResultData apply(@RequestBody Map<String, String> params) { | |||
| return wxFlowService.apply(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId()); | |||
| } | |||
| /** | |||
| * 驳回 | |||
| */ | |||
| @ApiOperation(value = "驳回",notes = "{\"taskId\":\"\",\"processInstanceId\":\"\",\"remark\":\"\"}") | |||
| @PostMapping(value = "reject") | |||
| public ResultData reject(@RequestBody Map<String, String> params) { | |||
| return wxFlowService.reject(params,super.getUser().getId(),super.getUser().getName(),super.getTenantId()); | |||
| } | |||
| /** | |||
| * 生成流程图 | |||
| * | |||
| */ | |||
| @GetMapping(value = "processDiagram") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "businessId", value = "业务id", dataType = "String", paramType = "query", required = true) | |||
| }) | |||
| public void genProcessDiagram(HttpServletResponse httpServletResponse, String businessId) throws Exception { | |||
| wxFlowService.genProcessDiagram(httpServletResponse,businessId); | |||
| } | |||
| } | |||
| @@ -51,8 +51,6 @@ public class WxLevelConfigController extends BaseController { | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody List<WxLevelConfig> levelConfigs) { | |||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); | |||
| //Assert.notNull(wxLevelConfig.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| String tenantId = getTenantId(); | |||
| try { | |||
| wxLevelConfigService.batchSave(tenantId, levelConfigs); | |||
| @@ -63,31 +61,34 @@ public class WxLevelConfigController extends BaseController { | |||
| return new ResultData(); | |||
| } | |||
| // @ApiOperation("根据id更新接口") | |||
| // @PostMapping("update") | |||
| // public ResultData update(@RequestBody WxLevelConfig wxLevelConfig) { | |||
| // wxLevelConfig.setTenantId(getTenantId()); | |||
| // wxLevelConfigService.saveOrUpdate(wxLevelConfig); | |||
| // return new ResultData(); | |||
| // } | |||
| @ApiOperation("更改会员权益") | |||
| @PostMapping("updateCapabilities") | |||
| public ResultData updateCapabilities(@RequestBody List<WxLevelConfig> levelConfigs) { | |||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::add"); | |||
| String tenantId = getTenantId(); | |||
| try { | |||
| wxLevelConfigService.batchUpdateCapabilities(tenantId, levelConfigs); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(ErrorCode.DB_FAIL); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("根据id删除接口") | |||
| @PostMapping("/del") | |||
| // @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData delete(@RequestBody WxLevelConfig wxLevelConfig) { | |||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::delete"); | |||
| wxLevelConfigService.deleteById(wxLevelConfig.getId()); | |||
| return new ResultData(Result.SUCCESS, "删除成功", null); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/findById") | |||
| @ApiImplicitParam(name="id",value="id",dataType="Long", paramType = "query",required=true) | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxLevelConfigController::findById"); | |||
| return new ResultData(Result.SUCCESS,"查询成功",wxLevelConfigService.getById(id)); | |||
| } | |||
| } | |||
| @@ -68,6 +68,13 @@ public class WxMallController extends BaseController { | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxMallService.getById(id)); | |||
| } | |||
| @ApiOperation("根据id查询接口") | |||
| @GetMapping("/mallinfoExt") | |||
| public ResultData mallinfoExt() { | |||
| logger.debug("[" + getIpAddr() + "] WxMallController::mallinfoExt"); | |||
| return new ResultData(wxMallService.getByTenantIdExt(getTenantId())); | |||
| } | |||
| @ApiOperation("查询当前mall的信息") | |||
| @GetMapping("/mallinfo") | |||
| public ResultData mallinfo() { | |||
| @@ -3,6 +3,7 @@ package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxLevelConfig; | |||
| import com.iformall.domain.po.WxMerchant; | |||
| import com.iformall.domain.po.WxProfitSharingReceiver; | |||
| import com.iformall.service.WxMerchantService; | |||
| @@ -71,14 +72,7 @@ public class WxMerchantController extends BaseController { | |||
| public ResultData findById(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::findById"); | |||
| WxMerchant wxMerchant = wxMerchantService.getById(id); | |||
| if (wxMerchant != null) { | |||
| WxProfitSharingReceiver receiver = wxProfitSharingReceiverService.findReceiver(wxMerchant); | |||
| if (receiver != null){ | |||
| wxMerchant.setAccountId(receiver.getReceiverAccount()); | |||
| wxMerchant.setAccountName(receiver.getTrueName()); | |||
| wxMerchant.setAccountTypeValue(receiver.getReceiverType()); | |||
| } | |||
| } | |||
| return new ResultData(wxMerchant); | |||
| } | |||
| @@ -139,5 +133,12 @@ public class WxMerchantController extends BaseController { | |||
| return wxMerchantService.updateMerchantTax(wxMerchant); | |||
| } | |||
| @ApiOperation("更新会员等级权益接口") | |||
| @PostMapping("updateMerchantLevel") | |||
| public ResultData updateMerchantLevel(@RequestBody WxMerchant wxMerchant) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantController::updateMerchantLevel"); | |||
| wxMerchant.setTenantId(getTenantId()); | |||
| return wxMerchantService.updateMerchantLevel(wxMerchant); | |||
| } | |||
| } | |||
| @@ -51,8 +51,6 @@ public class WxMerchantShopController extends BaseController { | |||
| @PostMapping("add") | |||
| public ResultData add(@RequestBody WxMerchantShop wxMerchantShop) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantShopController::add"); | |||
| //Assert.notNull(wxMerchantShop.getName(), "角色名不能为空"); | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| wxMerchantShopService.saveOrUpdate(wxMerchantShop); | |||
| return new ResultData(); | |||
| } | |||
| @@ -2,7 +2,6 @@ package com.iformall.controller; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxMerchantTradeDaily; | |||
| import com.iformall.domain.vo.WxMerchantTradeDailyVo; | |||
| import com.iformall.service.WxMerchantTradeDailyService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| @@ -60,5 +59,22 @@ public class WxMerchantTradeDailyController extends BaseController { | |||
| return wxMerchantTradeDailyService.getVolumeTotalOfMonth(getTenantId()); | |||
| } | |||
| @ApiOperation("更新解单数据") | |||
| @PostMapping("/updateYesterday") | |||
| public ResultData updateYesterday(@RequestBody WxMerchantTradeDailyVo wxMerchantTradeDaily) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::updateYesterday"); | |||
| wxMerchantTradeDaily.setTenantId(getTenantId()); | |||
| return wxMerchantTradeDailyService.updateYesterday(wxMerchantTradeDaily); | |||
| } | |||
| @ApiOperation("查询解单数据") | |||
| @GetMapping("/queryTradeDaily") | |||
| public ResultData queryTradeDaily(@ModelAttribute WxMerchantTradeDailyVo wxMerchantTradeDaily) { | |||
| logger.debug("[" + getIpAddr() + "] WxMerchantTradeDailyController::queryTradeDaily"); | |||
| wxMerchantTradeDaily.setTenantId(getTenantId()); | |||
| return wxMerchantTradeDailyService.queryTradeDaily(wxMerchantTradeDaily); | |||
| } | |||
| } | |||
| @@ -77,9 +77,10 @@ public class WxPropertyContractController extends BaseController | |||
| } | |||
| @GetMapping("/getPropertyContractStatusInfo") | |||
| public ResultData getPropertyContractStatusInfo() { | |||
| public ResultData getPropertyContractStatusInfo(@ModelAttribute WxPropertyContract wxPropertyContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getPropertyContractStatusInfo"); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractStatusInfo(getTenantId())); | |||
| wxPropertyContract.setTenantId(getTenantId()); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractStatusInfo(wxPropertyContract)); | |||
| } | |||
| @GetMapping("/endPropertyContract") | |||
| @@ -90,9 +91,10 @@ public class WxPropertyContractController extends BaseController | |||
| } | |||
| @GetMapping("/getRentContractList") | |||
| public ResultData getRentContractList() { | |||
| public ResultData getRentContractList(@ModelAttribute WxPropertyContract wxPropertyContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxPropertyContractController::getRentContractList"); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractList(getTenantId())); | |||
| wxPropertyContract.setTenantId(getTenantId()); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxPropertyContractService.getRentContractList(wxPropertyContract)); | |||
| } | |||
| @GetMapping("/endPropertyContractByRentContractId") | |||
| @@ -109,4 +111,11 @@ public class WxPropertyContractController extends BaseController | |||
| return wxPropertyContractService.hasRentContract(rentContractId); | |||
| } | |||
| @GetMapping("updatePropertyContractStatus") | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query", required = true) | |||
| public ResultData updatePropertyContractStatus(Long id) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::updateRentContractStatus"); | |||
| return wxPropertyContractService.updatePropertyContractStatus(id); | |||
| } | |||
| } | |||
| @@ -90,9 +90,10 @@ public class WxRentContractController extends BaseController { | |||
| } | |||
| @GetMapping("/getRentContractStatusInfo") | |||
| public ResultData getRentContractStatusInfo() { | |||
| public ResultData getRentContractStatusInfo(@ModelAttribute WxRentContract wxRentContract) { | |||
| logger.debug("[" + getIpAddr() + "] WxRentContractController::getRentContractStatusInfo"); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxRentContractService.getRentContractStatusInfo(getTenantId())); | |||
| wxRentContract.setTenantId(getTenantId()); | |||
| return new ResultData(Result.SUCCESS, "查询成功", wxRentContractService.getRentContractStatusInfo(wxRentContract)); | |||
| } | |||
| @GetMapping("/endRentContract") | |||
| @@ -95,10 +95,11 @@ public class WxShopController extends BaseController { | |||
| @GetMapping("hasShopNumber") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "shopNumber", value = "shopNumber", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query")}) | |||
| public ResultData hasShopNumber(String shopNumber,Long id) { | |||
| @ApiImplicitParam(name = "id", value = "id", dataType = "Long", paramType = "query"), | |||
| @ApiImplicitParam(name = "type", value = "type", dataType = "Integer", paramType = "query", required = true)}) | |||
| public ResultData hasShopNumber(String shopNumber, Long id, Integer type) { | |||
| logger.debug("[" + getIpAddr() + "] WxShopController::hasShopNumber"); | |||
| return wxShopService.hasShopNumber(getTenantId(), shopNumber,id); | |||
| return wxShopService.hasShopNumber(getTenantId(), shopNumber, id, type); | |||
| } | |||
| @@ -0,0 +1,44 @@ | |||
| package com.iformall.flowable; | |||
| import com.iformall.enums.EnumRentContractAppStatus; | |||
| import com.iformall.service.WxFlowService; | |||
| import com.iformall.service.WxPropertyContractService; | |||
| import com.iformall.service.impl.WxFlowServiceImpl; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.flowable.engine.delegate.TaskListener; | |||
| import org.flowable.task.service.delegate.DelegateTask; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Component; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * 合同审批完成,修改状态 | |||
| * | |||
| */ | |||
| @Component(value="contractTaskFinishListener") | |||
| public class ContractTaskFinishHandler implements TaskListener { | |||
| @Autowired | |||
| private WxFlowService wxFlowService; | |||
| @Autowired | |||
| private WxPropertyContractService wxPropertyContractService; | |||
| @Override | |||
| public void notify(DelegateTask delegateTask) { | |||
| // Long businessId = (Long)delegateTask.getVariable("businessId"); | |||
| // List<Map<String,String>> variables = (List)delegateTask.getVariable("variables"); | |||
| // Integer flowType = (Integer)delegateTask.getVariable("flowType"); | |||
| // | |||
| // Integer contractType = 0; | |||
| // String str = WxFlowServiceImpl.getVariableByKey(variables,"contractType"); | |||
| // if(StringUtils.isNotBlank(str)){ | |||
| // contractType = Integer.parseInt(str); | |||
| // | |||
| // if(3==contractType){ | |||
| // wxPropertyContractService.updatePropertyContractStatus(businessId); | |||
| // } | |||
| // } | |||
| // wxFlowService.updateBusinessStatus(businessId,flowType,contractType,EnumRentContractAppStatus.FINISH.getCode()); | |||
| } | |||
| } | |||
| @@ -0,0 +1,22 @@ | |||
| package com.iformall.flowable; | |||
| import org.flowable.spring.SpringProcessEngineConfiguration; | |||
| import org.flowable.spring.boot.EngineConfigurationConfigurer; | |||
| import org.springframework.context.annotation.Configuration; | |||
| /** | |||
| * @author haiyangp | |||
| * date: 2018/4/7 | |||
| * desc: flowable配置----为放置生成的流程图中中文乱码 | |||
| */ | |||
| @Configuration | |||
| public class FlowableConfig implements EngineConfigurationConfigurer<SpringProcessEngineConfiguration> { | |||
| @Override | |||
| public void configure(SpringProcessEngineConfiguration engineConfiguration) { | |||
| engineConfiguration.setActivityFontName("宋体"); | |||
| engineConfiguration.setLabelFontName("宋体"); | |||
| engineConfiguration.setAnnotationFontName("宋体"); | |||
| } | |||
| } | |||
| @@ -1,225 +0,0 @@ | |||
| package com.iformall.service.wechat; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxComponentVerifyTicket; | |||
| import com.iformall.mapper.WxComponentVerifyTicketMapper; | |||
| import me.chanjar.weixin.open.api.impl.WxOpenInMemoryConfigStorage; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import redis.clients.jedis.Jedis; | |||
| import redis.clients.jedis.JedisPool; | |||
| import redis.clients.util.Pool; | |||
| public class WxOpenInRedisDBConfigStorage extends WxOpenInMemoryConfigStorage { | |||
| private final static String COMPONENT_VERIFY_TICKET_KEY = "wechat_component_verify_ticket:"; | |||
| private final static String COMPONENT_ACCESS_TOKEN_KEY = "wechat_component_access_token:"; | |||
| private final static String AUTHORIZER_REFRESH_TOKEN_KEY = "wechat_authorizer_refresh_token:"; | |||
| private final static String AUTHORIZER_ACCESS_TOKEN_KEY = "wechat_authorizer_access_token:"; | |||
| private final static String JSAPI_TICKET_KEY = "wechat_jsapi_ticket:"; | |||
| private final static String CARD_API_TICKET_KEY = "wechat_card_api_ticket:"; | |||
| protected final Pool<Jedis> jedisPool; | |||
| /** | |||
| * redis 存储的 key 的前缀,可为空 | |||
| */ | |||
| private String keyPrefix; | |||
| private String componentVerifyTicketKey; | |||
| private String componentAccessTokenKey; | |||
| private String authorizerRefreshTokenKey; | |||
| private String authorizerAccessTokenKey; | |||
| private String jsapiTicketKey; | |||
| private String cardApiTicket; | |||
| @Autowired | |||
| WxComponentVerifyTicketMapper wxComponentVerifyTicketMapper; | |||
| public WxOpenInRedisDBConfigStorage(Pool<Jedis> jedisPool) { | |||
| this.jedisPool = jedisPool; | |||
| } | |||
| public WxOpenInRedisDBConfigStorage(Pool<Jedis> jedisPool, String keyPrefix) { | |||
| this.jedisPool = jedisPool; | |||
| this.keyPrefix = keyPrefix; | |||
| } | |||
| public WxOpenInRedisDBConfigStorage(JedisPool jedisPool) { | |||
| this.jedisPool = jedisPool; | |||
| } | |||
| @Override | |||
| public void setComponentAppId(String componentAppId) { | |||
| super.setComponentAppId(componentAppId); | |||
| String prefix = StringUtils.isBlank(keyPrefix) ? "" : | |||
| (StringUtils.endsWith(keyPrefix, ":") ? keyPrefix : (keyPrefix + ":")); | |||
| componentVerifyTicketKey = prefix + COMPONENT_VERIFY_TICKET_KEY.concat(componentAppId); | |||
| componentAccessTokenKey = prefix + COMPONENT_ACCESS_TOKEN_KEY.concat(componentAppId); | |||
| authorizerRefreshTokenKey = prefix + AUTHORIZER_REFRESH_TOKEN_KEY.concat(componentAppId); | |||
| authorizerAccessTokenKey = prefix + AUTHORIZER_ACCESS_TOKEN_KEY.concat(componentAppId); | |||
| this.jsapiTicketKey = JSAPI_TICKET_KEY.concat(componentAppId); | |||
| this.cardApiTicket = CARD_API_TICKET_KEY.concat(componentAppId); | |||
| } | |||
| @Override | |||
| public String getComponentVerifyTicket() { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.get(this.componentVerifyTicketKey); | |||
| } | |||
| } | |||
| @Override | |||
| public void setComponentVerifyTicket(String componentVerifyTicket) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.set(this.componentVerifyTicketKey, componentVerifyTicket); | |||
| } | |||
| // TODO update to DB | |||
| } | |||
| @Override | |||
| public String getComponentAccessToken() { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.get(this.componentAccessTokenKey); | |||
| } | |||
| } | |||
| @Override | |||
| public boolean isComponentAccessTokenExpired() { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.ttl(this.componentAccessTokenKey) < 2; | |||
| } | |||
| } | |||
| @Override | |||
| public void expireComponentAccessToken(){ | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.expire(this.componentAccessTokenKey, 0); | |||
| } | |||
| } | |||
| @Override | |||
| public void updateComponentAccessTokent(String componentAccessToken, int expiresInSeconds) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.setex(this.componentAccessTokenKey, expiresInSeconds - 200, componentAccessToken); | |||
| } | |||
| // TODO update to DB | |||
| } | |||
| private String getKey(String prefix, String appId) { | |||
| return prefix.endsWith(":") ? prefix.concat(appId) : prefix.concat(":").concat(appId); | |||
| } | |||
| @Override | |||
| public String getAuthorizerRefreshToken(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.get(this.getKey(this.authorizerRefreshTokenKey, appId)); | |||
| } | |||
| } | |||
| @Override | |||
| public void setAuthorizerRefreshToken(String appId, String authorizerRefreshToken) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.set(this.getKey(this.authorizerRefreshTokenKey, appId), authorizerRefreshToken); | |||
| } | |||
| // TODO update to DB | |||
| } | |||
| @Override | |||
| public String getAuthorizerAccessToken(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.get(this.getKey(this.authorizerAccessTokenKey, appId)); | |||
| } | |||
| } | |||
| @Override | |||
| public boolean isAuthorizerAccessTokenExpired(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.ttl(this.getKey(this.authorizerAccessTokenKey, appId)) < 2; | |||
| } | |||
| } | |||
| @Override | |||
| public void expireAuthorizerAccessToken(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.expire(this.getKey(this.authorizerAccessTokenKey, appId), 0); | |||
| } | |||
| // TODO update to DB | |||
| } | |||
| @Override | |||
| public void updateAuthorizerAccessToken(String appId, String authorizerAccessToken, int expiresInSeconds) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.setex(this.getKey(this.authorizerAccessTokenKey, appId), expiresInSeconds - 200, authorizerAccessToken); | |||
| } | |||
| // TODO update to DB | |||
| } | |||
| /* | |||
| @Override | |||
| public void changeAuthorizationStatus(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.expire(this.getKey(this.authorizerAccessTokenKey, appId), 0); | |||
| } | |||
| // TODO update to DB | |||
| } | |||
| */ | |||
| @Override | |||
| public String getJsapiTicket(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.get(this.getKey(this.jsapiTicketKey, appId)); | |||
| } | |||
| } | |||
| @Override | |||
| public boolean isJsapiTicketExpired(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.ttl(this.getKey(this.jsapiTicketKey, appId)) < 2; | |||
| } | |||
| } | |||
| @Override | |||
| public void expireJsapiTicket(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.expire(this.getKey(this.jsapiTicketKey, appId), 0); | |||
| } | |||
| } | |||
| @Override | |||
| public void updateJsapiTicket(String appId, String jsapiTicket, int expiresInSeconds) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.setex(this.getKey(this.jsapiTicketKey, appId), expiresInSeconds - 200, jsapiTicket); | |||
| } | |||
| // TODO update to DB | |||
| } | |||
| @Override | |||
| public String getCardApiTicket(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.get(this.getKey(this.cardApiTicket, appId)); | |||
| } | |||
| } | |||
| @Override | |||
| public boolean isCardApiTicketExpired(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| return jedis.ttl(this.getKey(this.cardApiTicket, appId)) < 2; | |||
| } | |||
| } | |||
| @Override | |||
| public void expireCardApiTicket(String appId) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.expire(this.getKey(this.cardApiTicket, appId), 0); | |||
| } | |||
| } | |||
| @Override | |||
| public void updateCardApiTicket(String appId, String cardApiTicket, int expiresInSeconds) { | |||
| try (Jedis jedis = this.jedisPool.getResource()) { | |||
| jedis.setex(this.getKey(this.cardApiTicket, appId), expiresInSeconds - 200, cardApiTicket); | |||
| } | |||
| // TODO update to DB | |||
| } | |||
| } | |||
| @@ -1,64 +0,0 @@ | |||
| package com.iformall.service.wechat; | |||
| import com.iformall.config.RedisProperies; | |||
| import com.iformall.config.WechatOpenProperties; | |||
| import me.chanjar.weixin.open.api.impl.WxOpenMessageRouter; | |||
| import me.chanjar.weixin.open.api.impl.WxOpenServiceImpl; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.boot.context.properties.EnableConfigurationProperties; | |||
| import org.springframework.stereotype.Service; | |||
| import redis.clients.jedis.JedisPool; | |||
| import javax.annotation.PostConstruct; | |||
| /** | |||
| * Stormeye WU | |||
| */ | |||
| @Service | |||
| @EnableConfigurationProperties({WechatOpenProperties.class, RedisProperies.class}) | |||
| public class WxOpenService extends WxOpenServiceImpl { | |||
| private Logger logger = LoggerFactory.getLogger(getClass()); | |||
| @Autowired | |||
| private WechatOpenProperties wechatProperties; | |||
| @Autowired | |||
| private RedisProperies redisProperies; | |||
| private static JedisPool pool; | |||
| private WxOpenMessageRouter wxOpenMessageRouter; | |||
| @PostConstruct | |||
| public void init() { | |||
| WxOpenInRedisDBConfigStorage configStorage = new WxOpenInRedisDBConfigStorage(getJedisPool()); | |||
| configStorage.setComponentAppId(wechatProperties.getComponentAppId()); | |||
| configStorage.setComponentAppSecret(wechatProperties.getComponentSecret()); | |||
| configStorage.setComponentToken(wechatProperties.getComponentToken()); | |||
| configStorage.setComponentAesKey(wechatProperties.getComponentAesKey()); | |||
| setWxOpenConfigStorage(configStorage); | |||
| wxOpenMessageRouter = new WxOpenMessageRouter(this); | |||
| wxOpenMessageRouter.rule().handler((wxMpXmlMessage, map, wxMpService, wxSessionManager) -> { | |||
| logger.info("\n接收到 {} 公众号请求消息,内容:{}", wxMpService.getWxMpConfigStorage().getAppId(), wxMpXmlMessage); | |||
| return null; | |||
| }).next(); | |||
| } | |||
| public WxOpenMessageRouter getWxOpenMessageRouter() { | |||
| return wxOpenMessageRouter; | |||
| } | |||
| private JedisPool getJedisPool() { | |||
| if (pool == null) { | |||
| synchronized (WxOpenService.class) { | |||
| if (pool == null) { | |||
| pool = new JedisPool(redisProperies, redisProperies.getHost(), | |||
| redisProperies.getPort(), redisProperies.getConnectionTimeout(), | |||
| redisProperies.getSoTimeout(), redisProperies.getPassword(), | |||
| redisProperies.getDatabase(), redisProperies.getClientName(), | |||
| redisProperies.isSsl(), redisProperies.getSslSocketFactory(), | |||
| redisProperies.getSslParameters(), redisProperies.getHostnameVerifier()); | |||
| } | |||
| } | |||
| } | |||
| return pool; | |||
| } | |||
| } | |||
| @@ -22,6 +22,8 @@ spring: | |||
| connectionProperties: "druid.stat.mergeSql=true;druid.stat.slowSqlMillis=6000" | |||
| #jackson: | |||
| #date-format: yyyy-MM-dd HH:mm:ss | |||
| flowable: | |||
| async-executor-activate: false | |||
| # REDIS | |||
| redis: | |||
| @@ -55,27 +57,6 @@ aws: | |||
| access: ENC(3gx5ghDFBqGrEhO3Wf8aYmXsnwHO7Cj3HNKJGOeUj0o=) | |||
| secret: ENC(HVKIJwCJKVXLlUpGlQPwNqJOlnpxn4xYuy91SH0seTSm2uAttIQHvA49fXWWax90v5wloIk0QuU=) | |||
| wechat: | |||
| open: | |||
| componentAppId: "wx897e4673286c915d" | |||
| componentSecret: "cdfdfda65c45689beb6766c4c427eed2" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| redis: | |||
| host: 202.165.179.86 | |||
| port: 6379 | |||
| password: ENC(aYJ3Wr2UWtkORRQjjrWWpz2ZeTISsHOA) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 500 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| jasypt: | |||
| encryptor: | |||
| password: oRqdnDbK5pj3eMmB | |||
| @@ -93,4 +74,4 @@ logging: | |||
| level: | |||
| tk.mybatis: debug | |||
| com.iformall: debug | |||
| path: ./logs/admin | |||
| path: ./logs/admin | |||
| @@ -46,6 +46,8 @@ spring: | |||
| auth: true | |||
| starttls: | |||
| enable: true | |||
| flowable: | |||
| async-executor-activate: false | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| @@ -53,29 +55,6 @@ aws: | |||
| access: ENC(a6SN1sZ1enNL49ypiOXkg/pPPAnZD8H4buQFTTKN08s=) | |||
| secret: ENC(5P5ff4bTMJUbXVR4ZsM03UHzOKZ4+Zg5Iutcdkyp/Quny/oXg+A4KpfwEyGarlLu3vQMJahGP5M=) | |||
| wechat: | |||
| open: | |||
| componentAppId: "wx897e4673286c915d" | |||
| componentSecret: "cdfdfda65c45689beb6766c4c427eed2" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| redis: | |||
| host: 127.0.0.1 | |||
| port: 6379 | |||
| password: ENC(8gYU47Fu93NUJPhwPCiPbAT+6VFA1YDx1egK4Z0Nl6w=) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| fm: | |||
| exception: true | |||
| @@ -89,4 +68,4 @@ logging: | |||
| level: | |||
| tk.mybatis: debug | |||
| com.iformall.mapper: debug | |||
| path: ./logs/admin | |||
| path: ./logs/admin | |||
| @@ -46,6 +46,8 @@ spring: | |||
| auth: true | |||
| starttls: | |||
| enable: true | |||
| flowable: | |||
| async-executor-activate: false | |||
| aws: | |||
| clientRegion: cn-northwest-1 | |||
| @@ -53,27 +55,6 @@ aws: | |||
| access: ENC(NCLcmjwKpAWdn/abD17OKIY7yKepVLWzEpqRYUlURCw=) | |||
| secret: ENC(TRcZqql0Rq5PExlMeH/4WiZ/i02b8FXKmLTBChJmbluTa1uoLS9LrHyNEMrqe1DK+QgOAdvqGBo=) | |||
| wechat: | |||
| open: | |||
| componentAppId: "wx897e4673286c915d" | |||
| componentSecret: "cdfdfda65c45689beb6766c4c427eed2" | |||
| componentToken: "formall2018" | |||
| componentAesKey: "htKq8EjBMPNndfZQK9JiFojFaqFwFpw42VfeWFtx7HN" | |||
| redis: | |||
| host: 127.0.0.1 | |||
| port: 6379 | |||
| password: ENC(QFwqv3NshvvGhFPiP8rwhvbnxk+rFSqhJi8Pw6TogSg=) | |||
| timeout: 3600 | |||
| expire: 1800 #30分钟 | |||
| database: 1 | |||
| defaultExpiration: 2592000 # 默认生命周期30天 | |||
| jedis: | |||
| pool: | |||
| max-active: 100 | |||
| max-idle: 100 | |||
| max-wait: -1 | |||
| min-idle: 10 | |||
| fm: | |||
| exception: true | |||
| @@ -54,4 +54,4 @@ pay: | |||
| real: true | |||
| version: @project.version@ | |||
| version: @project.version@ | |||
| @@ -0,0 +1,50 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <definitions xmlns="http://www.omg.org/spec/BPMN/20100524/MODEL" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:flowable="http://flowable.org/bpmn" xmlns:bpmndi="http://www.omg.org/spec/BPMN/20100524/DI" xmlns:omgdc="http://www.omg.org/spec/DD/20100524/DC" xmlns:omgdi="http://www.omg.org/spec/DD/20100524/DI" typeLanguage="http://www.w3.org/2001/XMLSchema" expressionLanguage="http://www.w3.org/1999/XPath" targetNamespace="http://www.flowable.org/processdef"> | |||
| <process id="contract_flow" name="contractflow" isExecutable="true"> | |||
| <documentation>合同审批流程</documentation> | |||
| <startEvent id="startEvent1"></startEvent> | |||
| <userTask id="firstTaskUser" name="初审" flowable:candidateUsers="${firstTaskUser}"> | |||
| <documentation>初审</documentation> | |||
| </userTask> | |||
| <endEvent id="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"></endEvent> | |||
| <sequenceFlow id="sid-AA24EF6A-4416-4FAF-9FF5-E15E46D87BD9" sourceRef="startEvent1" targetRef="firstTaskUser"></sequenceFlow> | |||
| <sequenceFlow id="sid-C4925653-8894-42FF-81F4-412B3D11A3C9" sourceRef="firstTaskUser" targetRef="secondTaskUser"></sequenceFlow> | |||
| <sequenceFlow id="sid-9FCAF465-99E7-4EFE-BEEA-7D59481E684C" sourceRef="secondTaskUser" targetRef="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"></sequenceFlow> | |||
| <userTask id="secondTaskUser" name="复审" flowable:candidateUsers="${secondTaskUser}"> | |||
| <documentation>复审</documentation> | |||
| <!-- | |||
| <extensionElements> | |||
| <flowable:taskListener event="complete" delegateExpression="${contractTaskFinishListener}"></flowable:taskListener> | |||
| </extensionElements> | |||
| --> | |||
| </userTask> | |||
| </process> | |||
| <bpmndi:BPMNDiagram id="BPMNDiagram_contract_flow"> | |||
| <bpmndi:BPMNPlane bpmnElement="contract_flow" id="BPMNPlane_contract_flow"> | |||
| <bpmndi:BPMNShape bpmnElement="startEvent1" id="BPMNShape_startEvent1"> | |||
| <omgdc:Bounds height="30.0" width="30.0" x="100.0" y="157.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="firstTaskUser" id="BPMNShape_firstTask"> | |||
| <omgdc:Bounds height="80.0" width="100.0" x="285.0" y="132.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F" id="BPMNShape_sid-9692A856-E39A-4B8C-95C2-7C04A3646D6F"> | |||
| <omgdc:Bounds height="28.0" width="28.0" x="835.0" y="158.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNShape bpmnElement="secondTaskUser" id="BPMNShape_secondTask"> | |||
| <omgdc:Bounds height="80.0" width="100.0" x="554.0" y="132.0"></omgdc:Bounds> | |||
| </bpmndi:BPMNShape> | |||
| <bpmndi:BPMNEdge bpmnElement="sid-C4925653-8894-42FF-81F4-412B3D11A3C9" id="BPMNEdge_sid-C4925653-8894-42FF-81F4-412B3D11A3C9"> | |||
| <omgdi:waypoint x="384.94999999987203" y="172.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="553.9999999998877" y="172.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="sid-9FCAF465-99E7-4EFE-BEEA-7D59481E684C" id="BPMNEdge_sid-9FCAF465-99E7-4EFE-BEEA-7D59481E684C"> | |||
| <omgdi:waypoint x="653.9499999999999" y="172.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="835.0" y="172.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| <bpmndi:BPMNEdge bpmnElement="sid-AA24EF6A-4416-4FAF-9FF5-E15E46D87BD9" id="BPMNEdge_sid-AA24EF6A-4416-4FAF-9FF5-E15E46D87BD9"> | |||
| <omgdi:waypoint x="129.9499996223143" y="172.0"></omgdi:waypoint> | |||
| <omgdi:waypoint x="284.9999999998994" y="172.0"></omgdi:waypoint> | |||
| </bpmndi:BPMNEdge> | |||
| </bpmndi:BPMNPlane> | |||
| </bpmndi:BPMNDiagram> | |||
| </definitions> | |||
| @@ -4,6 +4,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCUserVo; | |||
| import com.iformall.domain.vo.WxLevelMerchantCVo; | |||
| import com.iformall.enums.EnumLevelConfigDiscountStatus; | |||
| import com.iformall.service.WxCUserBasicInfoService; | |||
| import com.iformall.service.WxCUserService; | |||
| import com.iformall.service.WxLevelConfigService; | |||
| @@ -71,42 +73,44 @@ public class WxMemController extends BaseController { | |||
| WxCUserVo userVo = new WxCUserVo(); | |||
| org.springframework.beans.BeanUtils.copyProperties(cUser, userVo); | |||
| if (userVo.getScore() == null || userVo.getScore() == 0) { | |||
| userVo.setLevelName("无"); | |||
| userVo.setDiscountRate(10000); // 无折扣 | |||
| } else { | |||
| userVo.setLevelName("无"); | |||
| Integer levelConfigDiscount = null; | |||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUser.getId()); | |||
| if (wxCUserBasicInfo != null) { | |||
| userVo.setName(wxCUserBasicInfo.getName()); | |||
| userVo.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||
| userVo.setSex(wxCUserBasicInfo.getSex()); | |||
| userVo.setAddress(wxCUserBasicInfo.getAddress()); | |||
| } | |||
| userVo.setLevelName(WxLevelConfigService.DEFAULT_LEVEL); | |||
| userVo.setDiscountRate(WxLevelConfigService.DEFAULT_MERCHANT_DISCOUNT); | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(bUser.getTenantId()); | |||
| if (userVo.getScore() != null) { | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(userVo.getTenantId()); | |||
| String level = WxLevelConfigService.DEFAULT_LEVEL; | |||
| Long levelId = 0L; | |||
| for(WxLevelConfig levelConfig: levelList) { | |||
| if (userVo.getScore() >= levelConfig.getPoints()) { | |||
| userVo.setLevelId(levelConfig.getId()); | |||
| userVo.setLevelName(levelConfig.getLevel()); | |||
| levelConfigDiscount = levelConfig.getDiscountEnable(); | |||
| if(levelConfig.getDiscountEnable().equals(EnumLevelConfigDiscountStatus.ENABLE.getCode())) | |||
| levelId = levelConfig.getId(); | |||
| level = levelConfig.getLevel(); | |||
| } | |||
| } | |||
| WxCUserBasicInfo wxCUserBasicInfo = wxCUserBasicInfoService.getById(cUser.getId()); | |||
| if (wxCUserBasicInfo != null) { | |||
| userVo.setName(wxCUserBasicInfo.getName()); | |||
| userVo.setBirthdate(wxCUserBasicInfo.getBirthdate()); | |||
| userVo.setSex(wxCUserBasicInfo.getSex()); | |||
| userVo.setAddress(wxCUserBasicInfo.getAddress()); | |||
| } | |||
| if(levelConfigDiscount > 0) { | |||
| // 用户折扣率 | |||
| WxMerchant wxMerchant = wxMerchantService.getById(bUser.getMerchantId()); | |||
| if(wxMerchant != null) { | |||
| if(levelConfigDiscount.equals(1)) { // first level | |||
| userVo.setDiscountRate(wxMerchant.getVipDiscountRate1()); | |||
| } else if(levelConfigDiscount.equals(2)) { // second level | |||
| userVo.setDiscountRate(wxMerchant.getVipDiscountRate2()); | |||
| } else if(levelConfigDiscount.equals(3)) { // third level | |||
| userVo.setDiscountRate(wxMerchant.getVipDiscountRate3()); | |||
| } | |||
| } | |||
| userVo.setLevelId(levelId); | |||
| userVo.setLevelName(level); | |||
| WxLevelMerchant levelMerchant = new WxLevelMerchant(); | |||
| levelMerchant.setLevelId(levelId); | |||
| levelMerchant.setMerchantId(bUser.getMerchantId()); | |||
| List<WxLevelMerchantCVo> levelMerchantList = wxLevelConfigService.findListCVo(levelMerchant); | |||
| if (levelMerchantList.size() > 0) { | |||
| WxLevelMerchantCVo l = levelMerchantList.get(0); | |||
| userVo.setDiscountRate(l.getDiscount()); | |||
| } else { | |||
| userVo.setDiscountRate(WxLevelConfigService.DEFAULT_MERCHANT_DISCOUNT); | |||
| } | |||
| } | |||
| @@ -6,6 +6,8 @@ import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCUserVo; | |||
| import com.iformall.domain.vo.WxLevelMerchantCVo; | |||
| import com.iformall.enums.EnumLevelConfigDiscountStatus; | |||
| import com.iformall.enums.EnumMerchantBUserStatus; | |||
| import com.iformall.enums.EnumMerchantStatus; | |||
| import com.iformall.interceptor.AuthorizationInterceptor; | |||
| @@ -95,84 +97,6 @@ public class WxMerchantBUserController extends BaseController { | |||
| return new ResultData(resultMap); | |||
| } | |||
| @GetMapping("/getUserInfo") | |||
| @ApiOperation(value="获取用户等级及在此商户的折扣率及折扣后的金额", notes="{\"id\":\"string\", \"amount\":\"string\"}") | |||
| public ResultData getDiscountRate(@RequestBody Map<String, String> map) { | |||
| WxMerchantBUser bUser = getUser(); | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(bUser.getTenantId()); | |||
| String idStr = map.get("id"); | |||
| String amountStr = map.get("amount"); | |||
| if (StringUtils.isBlank(idStr)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "id不能为空"); | |||
| } | |||
| if (StringUtils.isBlank(amountStr)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "amount不能为空"); | |||
| } | |||
| Long id = Long.valueOf(idStr); | |||
| Integer amount = Integer.valueOf(amountStr) * 100; // 元->分 | |||
| WxCUserBasicInfo userInfo = null; | |||
| WxCUser user = wxCUserService.getById(id); | |||
| if(user == null) { | |||
| userInfo = wxCUserBasicInfoService.getById(id); | |||
| } | |||
| if(user == null && userInfo == null) { | |||
| logger.error("C端用户不存在"); | |||
| return new ResultData(ErrorCode.USER_IS_EMPTY); | |||
| } | |||
| WxCUserVo userVo = new WxCUserVo(); | |||
| if(user != null) { | |||
| org.springframework.beans.BeanUtils.copyProperties(user, userVo); | |||
| } else if(userInfo != null) { | |||
| userVo.setId(userInfo.getId()); | |||
| userVo.setName(userInfo.getName()); | |||
| userVo.setScore(userInfo.getPoins()); | |||
| } | |||
| WxLevelConfig curLConfig = null; | |||
| int curDiscountRateIndex = 0; | |||
| int curDiscountRate = 0; | |||
| for(WxLevelConfig levelConfig: levelList) { | |||
| if (userVo.getScore() >= levelConfig.getPoints()) { | |||
| curLConfig = levelConfig; | |||
| } | |||
| } | |||
| if (curLConfig != null) { | |||
| userVo.setLevelId(curLConfig.getId()); | |||
| userVo.setLevelName(curLConfig.getLevel()); | |||
| curDiscountRateIndex = curLConfig.getDiscountEnable(); | |||
| if(curLConfig.getDiscountEnable() == 0) { // 未启用等级折扣 | |||
| userVo.setDiscountRate(0); // 折扣率为0 | |||
| userVo.setAmount(amount); | |||
| } else { | |||
| // 当前商户折扣率 | |||
| WxMerchant merchant = wxMerchantService.getById(bUser.getMerchantId()); | |||
| if (merchant == null){ | |||
| return new ResultData(ErrorCode.MCH_INFO_NOT_FOUND); | |||
| } | |||
| if(curDiscountRateIndex == 1) { | |||
| curDiscountRate = merchant.getVipDiscountRate1(); | |||
| } else if(curDiscountRateIndex == 2) { | |||
| curDiscountRate = merchant.getVipDiscountRate2(); | |||
| } else if(curDiscountRateIndex == 3) { | |||
| curDiscountRate = merchant.getVipDiscountRate3(); | |||
| } | |||
| userVo.setDiscountRate(curDiscountRate); | |||
| userVo.setAmount(amount*curDiscountRate/10000); | |||
| } | |||
| } | |||
| return new ResultData(userVo); | |||
| } | |||
| /** | |||
| * 用户登录 | |||
| @@ -65,4 +65,4 @@ logging: | |||
| level: | |||
| tk.mybatis: debug | |||
| com.iformall.mapper: debug | |||
| path: ./logs/b | |||
| path: ./logs/b | |||
| @@ -729,12 +729,16 @@ public class WxCarController extends BaseController { | |||
| WxPark park = getCurrentPark(user); | |||
| if (park.getVendorType() == EnumCarVendor.CAR_ETCP.getCode()) { | |||
| String params = park.getVendorParams(); | |||
| if(params == null) { | |||
| return new ResultData(ErrorCode.CAR_VENDOR_NOT_SUPPORT.getCode(), "车场不支持"); | |||
| } | |||
| JSONObject objParams = JSON.parseObject(params); | |||
| String url = objParams.getString("url"); | |||
| String merchantNo = objParams.getString("merchantNo"); | |||
| String merchantKey = objParams.getString("merchantKey"); | |||
| String version = objParams.getString("version"); | |||
| if (park.getParkingId() == null) { | |||
| // those code is not supported | |||
| String lat = objParams.getString("lat"); | |||
| String lon = objParams.getString("lon"); | |||
| String radius = objParams.getString("radius"); | |||
| @@ -1,15 +1,12 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.domain.vo.WxCouponChannelVo; | |||
| import com.iformall.enums.EnumCouponChannelStatus; | |||
| import com.iformall.enums.EnumCouponChannelType; | |||
| import io.swagger.annotations.Api; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| @@ -41,4 +38,16 @@ public class WxCouponChannelController extends BaseController { | |||
| return new ResultData(wxCouponChannelService.listPageCVo(wxCouponChannel, pageNum, pageSize)); | |||
| } | |||
| @ApiOperation("分页列表接口") | |||
| @GetMapping("getCouponChannel") | |||
| public ResultData getCouponChannel(@ModelAttribute WxCouponChannel wxCouponChannel) { | |||
| if (null == wxCouponChannel) wxCouponChannel = new WxCouponChannel(); | |||
| wxCouponChannel.setTenantId(getTenantId()); | |||
| wxCouponChannel.setStatus(EnumCouponChannelStatus.STATUS_THROW_IN.getCode()); | |||
| wxCouponChannel.setIsCRequest(0);//标记为C端调用 | |||
| return new ResultData(wxCouponChannelService.findCouponChannelVo(wxCouponChannel)); | |||
| } | |||
| } | |||
| @@ -1,20 +1,25 @@ | |||
| package com.iformall.controller; | |||
| import com.github.pagehelper.Page; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCouponOrder; | |||
| import com.iformall.domain.po.WxGame; | |||
| import com.iformall.domain.po.WxGameActionLog; | |||
| import com.iformall.domain.po.WxGameTemplate; | |||
| import com.iformall.enums.EnumGameStatus; | |||
| import com.iformall.service.WxCouponOrderService; | |||
| import com.iformall.service.WxGameService; | |||
| import com.iformall.service.WxGameTemplateService; | |||
| import com.iformall.service.WxOrderService; | |||
| import io.swagger.annotations.ApiImplicitParam; | |||
| import io.swagger.annotations.ApiImplicitParams; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.GetMapping; | |||
| import org.springframework.web.bind.annotation.ModelAttribute; | |||
| import org.springframework.web.bind.annotation.RequestMapping; | |||
| import org.springframework.web.bind.annotation.RestController; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.HashMap; | |||
| import java.util.Map; | |||
| @@ -28,7 +33,7 @@ public class WxGameController extends BaseController { | |||
| private WxGameService wxGameService; | |||
| @Autowired | |||
| private WxGameTemplateService wxGameTemplateService; | |||
| private WxCouponOrderService wxCouponOrderService; | |||
| @ApiOperation("蒙层/游戏入口获取游戏信息") | |||
| @GetMapping("getOne") | |||
| @@ -45,4 +50,52 @@ public class WxGameController extends BaseController { | |||
| return new ResultData(record); | |||
| } | |||
| @ApiOperation("添加游戏参与记录") | |||
| @PostMapping("addActionLog") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "gameId", value = "游戏ID", dataType = "String", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "couponOrderId", value = "券ID", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData addActionLog(String gameId, String orderId) { | |||
| Long gameIdL = null; | |||
| Long orderIdL = null; | |||
| Long couponOrderIdL = null; | |||
| try { | |||
| gameIdL = Long.valueOf(gameId); | |||
| if (orderId != null) { | |||
| orderIdL = Long.valueOf(orderId); | |||
| WxCouponOrder wxCouponOrder = new WxCouponOrder(); | |||
| wxCouponOrder.setCUserId(getUserId()); | |||
| wxCouponOrder.setOrderId(orderIdL); | |||
| PageInfo<WxCouponOrder> page = wxCouponOrderService.listAsPage(wxCouponOrder,1,1); | |||
| if (page.getList().size()>0) { | |||
| couponOrderIdL = page.getList().get(0).getId(); | |||
| } | |||
| } | |||
| } catch (Exception e){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| WxGameActionLog wxGameActionLog = new WxGameActionLog(); | |||
| wxGameActionLog.setUserId(getUserId()); | |||
| wxGameActionLog.setTenantId(getTenantId()); | |||
| wxGameActionLog.setGameId(gameIdL); | |||
| wxGameActionLog.setCouponOrderId(couponOrderIdL); | |||
| wxGameService.addActionLog(wxGameActionLog); | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation("添加游戏参与记录") | |||
| @PostMapping("checkLimit") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "gameId", value = "游戏ID", dataType = "String", paramType = "query", required = true)}) | |||
| public ResultData checkLimit(String gameId) { | |||
| Long gameIdL = null; | |||
| try { | |||
| gameIdL = Long.valueOf(gameId); | |||
| } catch (Exception e){ | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_ERROR); | |||
| } | |||
| return wxGameService.checkLimit(gameIdL,getUserId()); | |||
| } | |||
| } | |||
| @@ -44,10 +44,6 @@ public class WxMallController extends BaseController { | |||
| @Autowired | |||
| private WxLevelConfigService wxLevelConfigService; | |||
| @Autowired | |||
| private WxMerchantService wxMerchantService; | |||
| @AuthIgnore | |||
| @ApiOperation("商场图标") | |||
| @GetMapping("/getAppIcon") | |||
| @@ -116,16 +112,6 @@ public class WxMallController extends BaseController { | |||
| return new ResultData(Result.SUCCESS, "查询成功", map); | |||
| } | |||
| @ApiOperation("获取打折商户列表") | |||
| @GetMapping("/discountMerchantList") | |||
| public ResultData getMerchantId() { | |||
| WxCUser user = getUser(); | |||
| WxMerchant merchantQ = new WxMerchant(); | |||
| merchantQ.setTenantId(user.getTenantId()); | |||
| merchantQ.setStatus(EnumMerchantStatus.VALID.getCode()); | |||
| List<WxMerchantVo> list = wxMerchantService.getDisCountList(merchantQ); | |||
| return new ResultData(Result.SUCCESS, "查询成功", list); | |||
| } | |||
| @AuthIgnore | |||
| @ApiOperation("获取后端版本号") | |||
| @@ -7,6 +7,7 @@ import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCouponChannel; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.vo.WxOrderCouponPressVo; | |||
| import com.iformall.domain.vo.WxOrderCouponVo; | |||
| import com.iformall.enums.EnumCouponChannelStatus; | |||
| import com.iformall.enums.EnumOrderStatus; | |||
| @@ -23,6 +24,7 @@ import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.*; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @RestController | |||
| @@ -72,7 +74,7 @@ public class WxOrderController extends BaseController { | |||
| WxOrder order = null; | |||
| try { | |||
| order = wxOrderService.saveFreeCouponOrder(user.getId(), couponId); | |||
| order = wxOrderService.saveFreeCouponOrder(user.getId(), couponChannelId, couponId); | |||
| return new ResultData(order); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| @@ -83,7 +85,7 @@ public class WxOrderController extends BaseController { | |||
| } | |||
| } | |||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\"}") | |||
| @ApiOperation(value = "下订单", notes = "{\"couponChannelId\":\"String\",\"couponId\":\"String\",\"press\":\"String\"}") | |||
| @PostMapping("save") | |||
| public ResultData saveOrder(@RequestBody Map<String, String> paramMap) { | |||
| logger.info("OrderSave: " + paramMap.toString()); | |||
| @@ -91,11 +93,13 @@ public class WxOrderController extends BaseController { | |||
| //Assert.isTrue(!checkUnique(sysRole.getName(), null), "重复的角色名"); | |||
| String couponChannelIdStr = paramMap.get("couponChannelId"); | |||
| String couponIdStr = paramMap.get("couponId"); | |||
| String pressStr = paramMap.get("press"); | |||
| if (StringUtils.isBlank(couponChannelIdStr)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId不能为空"); | |||
| } | |||
| Long couponChannelId = 0L, couponId = 0L; | |||
| boolean isPress = false; | |||
| if (StringUtils.isNotBlank(couponChannelIdStr)) { | |||
| try { | |||
| @@ -131,10 +135,18 @@ public class WxOrderController extends BaseController { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "couponChannelId或者couponId不能为空"); | |||
| } | |||
| if(pressStr != null) { | |||
| try{ | |||
| isPress = Boolean.valueOf(pressStr); | |||
| } catch (Exception e) { | |||
| logger.error("press转换失败"); | |||
| } | |||
| } | |||
| WxCUser user = getUser(); | |||
| try { | |||
| WxOrder order = wxOrderService.saveCouponOrder(user, couponChannelId, couponId); | |||
| WxOrder order = wxOrderService.saveCouponOrder(user, couponChannelId, couponId, isPress); | |||
| return new ResultData(order); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| @@ -270,5 +282,45 @@ public class WxOrderController extends BaseController { | |||
| } | |||
| } | |||
| @ApiOperation("我的砍价-分页列表接口") | |||
| @GetMapping("pressOrderList") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "pageNum", value = "页数", dataType = "int", paramType = "query", required = true), | |||
| @ApiImplicitParam(name = "pageSize", value = "每页条数", dataType = "int", paramType = "query", required = true)}) | |||
| public ResultData pressOrderList(@ModelAttribute WxOrder wxOrder, Integer pageNum, Integer pageSize) { | |||
| // c端用户应该只能看到自己的订单 | |||
| if (wxOrder == null) wxOrder = new WxOrder(); | |||
| WxCUser user = getUser(); | |||
| wxOrder.setcUserId(user.getId()); | |||
| wxOrder.setSortColumns(WxOrder.Field.CreateDate_DESC); | |||
| final PageInfo<WxOrderCouponPressVo> page = wxOrderService.listPressVoAsPage(wxOrder, pageNum, pageSize); | |||
| return new ResultData(page); | |||
| } | |||
| @ApiOperation("砍价订单-详情接口") | |||
| @GetMapping("pressOrderDetail") | |||
| @ApiImplicitParams({ | |||
| @ApiImplicitParam(name = "orderId", value = "订单id", dataType = "String", paramType = "query", required = true) | |||
| }) | |||
| public ResultData pressOrderDetail(String orderId) { | |||
| // c端用户应该只能看到自己的订单细节 | |||
| WxOrder wxOrder = new WxOrder(); | |||
| if(StringUtils.isBlank(orderId)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID不能为空"); | |||
| } | |||
| Long id = 0L; | |||
| try { | |||
| id = Long.valueOf(orderId); | |||
| } catch (NumberFormatException e) { | |||
| logger.error("parse orderId failed"); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "订单ID转换异常"); | |||
| } | |||
| wxOrder.setId(id); | |||
| final WxOrderCouponPressVo orderCouponPressVo = wxOrderService.detailPressVo(wxOrder); | |||
| if (orderCouponPressVo == null) | |||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| return new ResultData(orderCouponPressVo); | |||
| } | |||
| } | |||
| @@ -0,0 +1,144 @@ | |||
| package com.iformall.controller; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.WxCUser; | |||
| import com.iformall.domain.po.WxCoupon; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.enums.EnumOrderPressStatus; | |||
| import com.iformall.enums.EnumOrderStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.WxCouponService; | |||
| import com.iformall.service.WxOrderPressService; | |||
| import com.iformall.service.WxOrderService; | |||
| import io.swagger.annotations.Api; | |||
| import io.swagger.annotations.ApiOperation; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| 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("/api/press") | |||
| @Api(description = "砍价接口") | |||
| public class WxPressOrderController extends BaseController { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxOrderService wxOrderService; | |||
| @Autowired | |||
| WxCouponService wxCouponService; | |||
| @Autowired | |||
| WxOrderPressService wxOrderPressService; | |||
| // 砍价列表 - /api/wxCouponChannel/list | |||
| // 我的砍价 - /api/order/pressOrderList | |||
| // 砍价订单详情 - /api/order/pressOrderDetail | |||
| // 发起砍价 - /api/order/save | |||
| // 砍价券详情 - /api/order/pressOrderDetail | |||
| @ApiOperation(value = "参与砍价", notes = "{\"orderId\":\"String\"}") | |||
| @PostMapping("pressOrderJoin") | |||
| public ResultData pressOrderJoin(@RequestBody Map<String, String> paramMap) { | |||
| Date curDate = new Date(); | |||
| String orderIdStr = paramMap.get("orderId"); | |||
| if (StringUtils.isBlank(orderIdStr)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||
| } | |||
| Long orderId = 0L; | |||
| try { | |||
| orderId = Long.valueOf(orderIdStr); | |||
| } catch (NumberFormatException e) { | |||
| logger.error("orderId convert error, " + orderIdStr + ", e:" + e.getMessage()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "orderId: " + orderIdStr + ", e:" + e.getMessage()); | |||
| } | |||
| WxCUser user = getUser(); | |||
| WxOrder order = wxOrderService.getById(orderId); | |||
| if(order == null) { | |||
| logger.error("订单不存在:" + orderId); | |||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| } | |||
| WxCoupon coupon = wxCouponService.getById(order.getProductId()); | |||
| if(coupon == null) { | |||
| logger.error("券不存在:" + order.getProductId()); | |||
| return new ResultData(ErrorCode.COUPON_IS_EMPTY); | |||
| } | |||
| if(curDate.after(order.getPressEndDate())) { | |||
| logger.error("砍价已超时:" + orderId); | |||
| return new ResultData(ErrorCode.COUPON_PRESS_IS_OVERTIME); | |||
| } | |||
| if(order.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_PAYMENT_SUCCESS.getCode())) { | |||
| logger.error("砍价已支付:" + orderId); | |||
| return new ResultData(ErrorCode.ORDER_HAD_PAY); | |||
| } | |||
| if(order.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_PRESS_COMPLETE.getCode())) { | |||
| logger.error("砍价已完成:" + orderId); | |||
| return new ResultData(ErrorCode.ORDER_PRESS_IS_COMPLETE); | |||
| } | |||
| if(order.getOrderStatus().equals(EnumOrderStatus.ORDER_STATUS_PRESS_CANCEL.getCode())) { | |||
| logger.error("砍价已取消:" + orderId); | |||
| return new ResultData(ErrorCode.ORDER_HAD_CANCEL); | |||
| } | |||
| if(order.getPressCurrentNum() + 1 > coupon.getPressLimitNum()) { | |||
| logger.error("砍价已结束:" + orderId); | |||
| return new ResultData(ErrorCode.COUPON_PRESS_HAD_FINISHED); | |||
| } | |||
| try { | |||
| wxOrderPressService.pressCouponJoin(order, coupon, user); | |||
| } catch (MallinkException e) { | |||
| logger.error(e.getMessage()); | |||
| return new ResultData(e.getErrorCode(), e.getMessage()); | |||
| } | |||
| return new ResultData(); | |||
| } | |||
| @ApiOperation(value = "砍价状态(1:我发起的砍价,2:未参与的砍价, 3:已参与的砍价)", notes = "{\"orderId\":\"String\"}") | |||
| @PostMapping("getPressOrderStatus") | |||
| public ResultData getPressOrderStatus(@RequestBody Map<String, String> paramMap) { | |||
| Map ret = new HashMap(); | |||
| String orderIdStr = paramMap.get("orderId"); | |||
| if (StringUtils.isBlank(orderIdStr)) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL.getCode(), "orderId不能为空"); | |||
| } | |||
| Long orderId = 0L; | |||
| try { | |||
| orderId = Long.valueOf(orderIdStr); | |||
| } catch (NumberFormatException e) { | |||
| logger.error("orderId convert error, " + orderIdStr + ", e:" + e.getMessage()); | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_CAST_ERROR.getCode(), "orderId: " + orderIdStr + ", e:" + e.getMessage()); | |||
| } | |||
| WxCUser user = getUser(); | |||
| WxOrder order = wxOrderService.getById(orderId); | |||
| if(order == null) { | |||
| logger.error("订单不存在:" + orderId); | |||
| return new ResultData(ErrorCode.ORDER_IS_NOT_FIND); | |||
| } | |||
| if(order.getcUserId().equals(user.getId())) { | |||
| ret.put("status", EnumOrderPressStatus.FIRST.getCode()); | |||
| return new ResultData(ret); | |||
| } | |||
| int status = wxOrderPressService.pressCouponStatus(order, user); | |||
| ret.put("status", status); | |||
| return new ResultData(ret); | |||
| } | |||
| /// 砍价 - 统计 相关 ?????? | |||
| } | |||
| @@ -13,7 +13,9 @@ import com.iformall.common.Result; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCUserVo; | |||
| import com.iformall.domain.vo.WxLevelMerchantCVo; | |||
| import com.iformall.enums.EnumAssignTagsTrigger; | |||
| import com.iformall.enums.EnumLevelConfigDiscountStatus; | |||
| import com.iformall.enums.EnumScoreType; | |||
| import com.iformall.interceptor.AuthorizationInterceptor; | |||
| import com.iformall.service.*; | |||
| @@ -70,6 +72,7 @@ public class WxUserGrantController extends BaseController { | |||
| @Autowired | |||
| WxMerchantService wxMerchantService; | |||
| /** | |||
| * 用户登录 | |||
| * @param map | |||
| @@ -409,9 +412,9 @@ public class WxUserGrantController extends BaseController { | |||
| WxCUserVo userVo = new WxCUserVo(); | |||
| org.springframework.beans.BeanUtils.copyProperties(user, userVo); | |||
| if (userVo.getScore() == null || userVo.getScore() == 0) { | |||
| userVo.setLevelName("无"); | |||
| userVo.setLevelName(WxLevelConfigService.DEFAULT_LEVEL); | |||
| } else { | |||
| userVo.setLevelName("无"); | |||
| userVo.setLevelName(WxLevelConfigService.DEFAULT_LEVEL); | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(user.getTenantId()); | |||
| for(WxLevelConfig levelConfig: levelList) { | |||
| if (userVo.getScore() >= levelConfig.getPoints()) { | |||
| @@ -565,47 +568,31 @@ public class WxUserGrantController extends BaseController { | |||
| * 获取用户折扣率 | |||
| * @return | |||
| */ | |||
| @PostMapping("/getDiscount") | |||
| @PostMapping("/getDiscountInfo") | |||
| @ApiOperation(value = "获取用户折扣率", notes="") | |||
| public ResultData updateUserInfo(@RequestBody WxMerchant wxMerchant) { | |||
| if (wxMerchant == null) { | |||
| return new ResultData(ErrorCode.SYS_PARAMETER_NOT_NULL); | |||
| } | |||
| public ResultData getDiscountInfo() { | |||
| WxCUser user = getUser(); | |||
| WxCUserVo userVo = new WxCUserVo(); | |||
| org.springframework.beans.BeanUtils.copyProperties(user, userVo); | |||
| if (userVo.getScore() == null || userVo.getScore() == 0) { | |||
| userVo.setLevelName("无"); | |||
| userVo.setDiscountRate(10000); // 无折扣 | |||
| } else { | |||
| Integer levelConfigDiscount = null; | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(user.getTenantId()); | |||
| List<WxLevelConfig> levelList = wxLevelConfigService.getByTenantId(user.getTenantId()); | |||
| for(WxLevelConfig levelConfig: levelList) { | |||
| if (userVo.getScore() >= levelConfig.getPoints()) { | |||
| userVo.setLevelId(levelConfig.getId()); | |||
| userVo.setLevelName(levelConfig.getLevel()); | |||
| levelConfigDiscount = levelConfig.getDiscountEnable(); | |||
| } | |||
| } | |||
| if(levelConfigDiscount > 0) { | |||
| // 用户折扣率 | |||
| WxMerchant merchant = wxMerchantService.getById(wxMerchant.getId()); | |||
| if(merchant != null) { | |||
| if(levelConfigDiscount.equals(1)) { // first level | |||
| userVo.setDiscountRate(merchant.getVipDiscountRate1()); | |||
| } else if(levelConfigDiscount.equals(2)) { // second level | |||
| userVo.setDiscountRate(merchant.getVipDiscountRate2()); | |||
| } else if(levelConfigDiscount.equals(3)) { // third level | |||
| userVo.setDiscountRate(merchant.getVipDiscountRate3()); | |||
| } | |||
| } | |||
| String level = WxLevelConfigService.DEFAULT_LEVEL; | |||
| Long levelId = 0L; | |||
| for(WxLevelConfig levelConfig: levelList) { | |||
| if (user.getScore() >= levelConfig.getPoints()) { | |||
| if(levelConfig.getDiscountEnable().equals(EnumLevelConfigDiscountStatus.ENABLE.getCode())) | |||
| levelId = levelConfig.getId(); | |||
| level = levelConfig.getLevel(); | |||
| } | |||
| } | |||
| return new ResultData(userVo); | |||
| WxLevelMerchant levelMerchant = new WxLevelMerchant(); | |||
| levelMerchant.setLevelId(levelId); | |||
| List<WxLevelMerchantCVo> levelMerchantList = wxLevelConfigService.findListCVo(levelMerchant); | |||
| Map<String,Object> result = new HashMap(); | |||
| result.put("level",level); | |||
| result.put("levelMerchantList",levelMerchantList); | |||
| return new ResultData(result); | |||
| } | |||
| } | |||
| @@ -65,4 +65,4 @@ logging: | |||
| level: | |||
| tk.mybatis: debug | |||
| com.iformall.mapper: debug | |||
| path: ./logs/c | |||
| path: ./logs/c | |||
| @@ -0,0 +1,169 @@ | |||
| package com.iformall.schedule; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.domain.dto.WxCUserBasicInfoDto; | |||
| import com.iformall.domain.po.*; | |||
| import com.iformall.domain.vo.WxCouponSendVo; | |||
| import com.iformall.enums.EnumCouponSendSendType; | |||
| import com.iformall.enums.EnumCouponSendStatus; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.*; | |||
| import com.iformall.service.WxCouponActionLogService; | |||
| import com.iformall.service.WxCouponSendService; | |||
| import com.iformall.service.WxLevelConfigService; | |||
| import com.iformall.service.WxOrderService; | |||
| import io.swagger.models.auth.In; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.scheduling.annotation.Scheduled; | |||
| import org.springframework.stereotype.Component; | |||
| import java.time.LocalDateTime; | |||
| import java.time.LocalTime; | |||
| import java.time.ZoneId; | |||
| import java.time.temporal.TemporalAdjusters; | |||
| import java.util.*; | |||
| import java.util.stream.Collectors; | |||
| @Component | |||
| public class CouponSendSchedule { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private WxMallMapper wxMallMapper; | |||
| @Autowired | |||
| private WxLevelConfigMapper WxLevelConfigMapper; | |||
| @Autowired | |||
| private WxLevelConfigService wxLevelConfigService; | |||
| @Autowired | |||
| private WxCUserBasicInfoMapper wxCUserBasicInfoMapper; | |||
| @Autowired | |||
| private WxCouponSendMapper wxCouponSendMapper; | |||
| @Autowired | |||
| private WxCouponActionLogMapper wxCouponActionLogMapper; | |||
| @Autowired | |||
| private WxOrderService wxOrderService; | |||
| @Autowired | |||
| private WxCouponActionLogService wxCouponActionLogService; | |||
| //@Scheduled(cron = "0 0 6 1 * ?") // 每月1号发放会员的权益券 | |||
| @Scheduled(cron = "0 0 6 * * ?") // 测试每天6点发券 | |||
| //@Scheduled(cron = "*/10 * * * * ?") // 测试10秒中一次 | |||
| public void couponSendSchedule() { | |||
| List<WxMall> mallList = wxMallMapper.findList(new WxMall()); | |||
| if (mallList.size()==0) { | |||
| logger.info("定时发券: No Mall info found"); | |||
| return; | |||
| } | |||
| Date startTime = Date.from(LocalDateTime.now() | |||
| .with(TemporalAdjusters.firstDayOfMonth()) | |||
| .with(LocalTime.MIN) | |||
| .atZone(ZoneId.systemDefault()) | |||
| .toInstant()); | |||
| Date endTime = Date.from(LocalDateTime.now() | |||
| .with(TemporalAdjusters.lastDayOfMonth()) | |||
| .with(LocalTime.MAX) | |||
| .atZone(ZoneId.systemDefault()) | |||
| .toInstant()); | |||
| mallList.stream().forEach(mall-> { | |||
| WxLevelConfig wxLevelConfig = new WxLevelConfig(); | |||
| wxLevelConfig.setTenantId(mall.getTenantId()); | |||
| List<WxLevelConfig> levelConfigList = WxLevelConfigMapper.findList(wxLevelConfig); | |||
| levelConfigList = levelConfigList.stream() | |||
| .sorted(Comparator.comparing(WxLevelConfig::getPoints)) | |||
| .collect(Collectors.toList()); | |||
| for (int i = 0; i < levelConfigList.size(); i++) { | |||
| WxLevelConfig l = levelConfigList.get(i); | |||
| if (l.getCapability() == null) | |||
| continue; | |||
| Integer levelStartScore = l.getPoints(); | |||
| Integer levelEndScore = levelConfigList.size() < i+1? levelConfigList.get(i+1).getPoints() : null; | |||
| JSONObject jo = null; | |||
| Long result = null; | |||
| try { | |||
| jo = JSONObject.parseObject(l.getCapability()); | |||
| result = wxLevelConfigService.getCapabilitiesOfSendCarConpon(jo); | |||
| } catch (Exception e) { | |||
| logger.error("定时发券: 不能解析发券规则 levelId=" + l.getId() + e.getMessage()); | |||
| continue; | |||
| } | |||
| Long sendCount = result; | |||
| if (sendCount > 0) { | |||
| WxCouponSend wxCouponSend = new WxCouponSend(); | |||
| wxCouponSend.setTenantId(l.getTenantId()); | |||
| wxCouponSend.setSendType(EnumCouponSendSendType.TIMED.getCode()); | |||
| wxCouponSend.setStatus(EnumCouponSendStatus.VALID.getCode()); | |||
| List<WxCouponSendVo> couponSendList = wxCouponSendMapper.findListVo(wxCouponSend); | |||
| couponSendList.stream().forEach(cs->{ | |||
| if (cs.getRemainInventory() < sendCount){ | |||
| logger.error("定时发券:库存不足 levelId="+ l.getId() +" couponId="+ cs.getCouponId()); | |||
| return; //下一个券 | |||
| } | |||
| WxCUserBasicInfoDto wxCUserBasicInfoDto = new WxCUserBasicInfoDto(); | |||
| wxCUserBasicInfoDto.setTenantId(l.getTenantId()); | |||
| wxCUserBasicInfoDto.setLevelStartScore(levelStartScore); | |||
| wxCUserBasicInfoDto.setLevelEndScore(levelEndScore); | |||
| List<WxCUserBasicInfo> wxCUserBasicInfoList = wxCUserBasicInfoMapper.findListByScore(wxCUserBasicInfoDto); | |||
| wxCUserBasicInfoList.stream().forEach(cu->{ | |||
| if (cs.getRemainInventory() < sendCount){ | |||
| logger.error("定时发券:库存不足 levelId="+ l.getId() +" couponId="+ cs.getCouponId()+"userId="+cu.getId()); | |||
| return; //下一个券 | |||
| } | |||
| Map params = new HashMap<String, Object>(); | |||
| params.put("tenantId", cs.getTenantId()); | |||
| params.put("cUserId", cu.getId()); | |||
| params.put("couponId", cs.getCouponId()); | |||
| params.put("startTime", startTime); | |||
| params.put("endTime", endTime); | |||
| params.put("channelType", EnumCouponSendSendType.TIMED.getCode()); | |||
| int sentCount = wxCouponActionLogMapper.getCountByUserAndCouponAndDate(params); | |||
| logger.info("定时发券:给["+ cu.getNickName() + | |||
| "]已发送券[" + cs.getTitle() + "] " + | |||
| sentCount +"张,还需发"+ (sendCount-sentCount) +"张"); | |||
| for (int count = 0; count<sendCount-sentCount; count++) { | |||
| // 发放免费券 | |||
| try { | |||
| WxCouponOrder couponOrder = wxOrderService.sendFreeCouponToUser(cu.getId(), cs.getCouponId()); | |||
| wxCouponActionLogService.addOne(l.getTenantId(), cs.getCouponId(), couponOrder.getId(), cs.getSendType(), cs.getId()); | |||
| } catch (Exception e) { | |||
| logger.error("定时发券:发券失败 levelId=" + l.getId() + " couponId=" + cs.getCouponId() + " userId=" + cu.getId() + e.getMessage()); | |||
| return; | |||
| } | |||
| logger.info("定时发券:商场[" + mall.getName() + | |||
| "]会员等级[" + l.getLevel() + | |||
| "]发送券[" + cs.getTitle() + | |||
| "]给:" + cu.getNickName() + | |||
| " 电话-" + cu.getPhone() + | |||
| " id-" + cu.getId()); | |||
| } | |||
| }); | |||
| }); | |||
| } | |||
| } | |||
| }); | |||
| } | |||
| } | |||
| @@ -4,12 +4,13 @@ import com.alibaba.fastjson.JSONArray; | |||
| import com.alibaba.fastjson.JSONObject; | |||
| import com.iformall.domain.po.WxMsg; | |||
| import com.iformall.domain.po.WxMsgConfig; | |||
| import com.iformall.domain.po.WxMsgModel; | |||
| import com.iformall.enums.EnumMsgSendStatus; | |||
| import com.iformall.enums.EnumMsgStatus; | |||
| import com.iformall.enums.EnumVerifyCode; | |||
| import com.iformall.mapper.WxMsgConfigMapper; | |||
| import com.iformall.mapper.WxMsgMapper; | |||
| import com.iformall.service.PushLimitService; | |||
| import com.iformall.mapper.WxMsgModelMapper; | |||
| import com.iformall.utils.DateUtils; | |||
| import com.iformall.utils.WiwideUtil; | |||
| import org.slf4j.Logger; | |||
| @@ -34,6 +35,9 @@ public class MsgSendingSchedule { | |||
| @Autowired | |||
| private WxMsgConfigMapper wxMsgConfigMapper; | |||
| @Autowired | |||
| private WxMsgModelMapper wxMsgModelMapper; | |||
| /** | |||
| * 每小时第一分钟执行 | |||
| */ | |||
| @@ -78,7 +82,13 @@ public class MsgSendingSchedule { | |||
| String signature = wxMsg.getSignature(); | |||
| String msg = wxMsg.getMsg(); | |||
| String notifyUrl = wxMsgConfig.getNotifyurl(); | |||
| String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.NO.getCode().toString()); | |||
| Integer modelId = null; | |||
| Long modelIdParam = wxMsg.getModelId(); | |||
| if (modelIdParam != null) { | |||
| WxMsgModel wxMsgModel = wxMsgModelMapper.selectByPrimaryKey(modelIdParam); | |||
| modelId = wxMsgModel.getModelId(); | |||
| } | |||
| String result = WiwideUtil.sendMsg(secret, bid, publickey, phone, signature, msg, notifyUrl, EnumVerifyCode.NO.getCode().toString(), modelId); | |||
| logger.info("短信返回结果:" + result); | |||
| JSONObject jsonObjectResult = JSONObject.parseObject(result); | |||
| String ret = jsonObjectResult.get("ret").toString(); | |||
| @@ -46,6 +46,14 @@ public class OrderExpiringSchedule { | |||
| orderCoupons.parallelStream().forEach( o -> { | |||
| orderExpired(o); | |||
| }); | |||
| // 砍价相关订单 | |||
| dateMap.put("type", EnumOrderType.COUPON.getCode()); | |||
| dateMap.put("endDate", curDate); | |||
| List<WxOrder> orderPresss = wxOrderMapper.findListOfUnpaidPressOrderByDate(dateMap); | |||
| orderPresss.parallelStream().forEach( o -> { | |||
| orderPressExpired(o); | |||
| }); | |||
| } | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| @@ -61,4 +69,14 @@ public class OrderExpiringSchedule { | |||
| + " create at " + order.getCreateDate() +"\n" | |||
| + " expired at " + new Date()); | |||
| } | |||
| @Transactional(propagation = Propagation.REQUIRED, readOnly = false, rollbackFor = {Exception.class}) | |||
| public void orderPressExpired(WxOrder order) { | |||
| Date curDate = new Date(); | |||
| order.setUpdateDate(curDate); | |||
| order.setOrderStatus(EnumOrderStatus.ORDER_STATUS_PRESS_OVERTIME.getCode()); | |||
| wxOrderMapper.updateByPrimaryKeySelective(order); | |||
| logger.info("\n砍价订单: " + order.getId() + " create at " + order.getCreateDate() + " expired at " + curDate); | |||
| } | |||
| } | |||
| @@ -10,14 +10,22 @@ | |||
| <modelVersion>4.0.0</modelVersion> | |||
| <artifactId>mallinkService</artifactId> | |||
| <!-- | |||
| <dependencies> | |||
| <!-- | |||
| <dependency> | |||
| <groupId>com.iformall</groupId> | |||
| <artifactId>mybatis-tenant</artifactId> | |||
| <version>1.0</version> | |||
| <scope>compile</scope> | |||
| </dependency> | |||
| --> | |||
| <dependency> | |||
| <groupId>org.flowable</groupId> | |||
| <artifactId>flowable-spring-boot-starter-basic</artifactId> | |||
| <version>6.4.0</version> | |||
| </dependency> | |||
| </dependencies> | |||
| --> | |||
| </project> | |||
| @@ -118,10 +118,10 @@ public enum ErrorCode{ | |||
| TJD_DEDUCE_FEE_FAIL(2063, "TJD停车费抵扣失败"), | |||
| /** | |||
| * 券 | |||
| * 游戏 | |||
| */ | |||
| GAME_NOT_FOUND(2070, "游戏未找到"), | |||
| GAME_HAS_BEEN_LIMITED(2071, "游戏次数以达到上限"), | |||
| /** | |||
| * 订单 | |||
| */ | |||
| @@ -133,6 +133,10 @@ public enum ErrorCode{ | |||
| ORDER_SAVE_ERR(3005,"订单保存失败"), | |||
| ORDER_UPDATE_ERR(3006,"订单更新失败"), | |||
| REMAIN_BACK_FAIL(3007, "库存恢复失败"), | |||
| ORDER_HAD_PAY(3008, "订单已支付"), | |||
| ORDER_HAD_CANCEL(3009, "订单已取消"), | |||
| ORDER_PRESS_IS_OVERTIME(3010, "砍价已过期"), | |||
| ORDER_PRESS_IS_COMPLETE(3011, "砍价已完成"), | |||
| /** | |||
| * 卡券 | |||
| @@ -157,6 +161,14 @@ public enum ErrorCode{ | |||
| */ | |||
| CARD_SPEND_IS_PAID(9050, "卡消费已支付"), | |||
| /** | |||
| * 砍价 | |||
| */ | |||
| COUPON_PRESS_HAD_FINISHED(9070, "砍价已完成"), | |||
| COUPON_PRESS_IS_OVERTIME(9071, "砍价已超时"), | |||
| COUPON_PRESS_IS_EXIST(9072, "此人已参与此次砍价"), | |||
| /** | |||
| @@ -41,8 +41,8 @@ public class MallUserInfo implements Serializable { | |||
| public void setIds(List<String> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /**租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| @@ -94,7 +94,19 @@ public class MallUserInfo implements Serializable { | |||
| @Transient | |||
| private String captcha; | |||
| /**1合同审批 2账单审批**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="flowPermission") | |||
| private String flowPermission; | |||
| public String getFlowPermission() { | |||
| return flowPermission; | |||
| } | |||
| public void setFlowPermission(String flowPermission) { | |||
| this.flowPermission = flowPermission; | |||
| } | |||
| public String getMenus() { | |||
| return menus; | |||
| } | |||
| @@ -1,110 +0,0 @@ | |||
| package com.iformall.domain.po; | |||
| import lombok.Data; | |||
| 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_authorizer_info") | |||
| @Data | |||
| public class WxAuthorizerInfo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| /**微信公众账号基本信息表id,关联微信公众号基本信息表*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信公众账号基本信息表id,关联微信公众号基本信息表",name="officialAccountId") | |||
| private Long officialAccountId; | |||
| /**授权方appid*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="授权方appid",name="authorizerAppid") | |||
| private String authorizerAppid; | |||
| /**授权方头像*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="授权方头像",name="headImg") | |||
| private String headImg; | |||
| /**授权方公众号所设置的微信号,可能为空*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="授权方公众号所设置的微信号,可能为空",name="alias") | |||
| private String alias; | |||
| /**二维码图片的URL,开发者最好自行也进行保存*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="二维码图片的URL,开发者最好自行也进行保存",name="qrcodeUrl") | |||
| private String qrcodeUrl; | |||
| /**创建时间*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | |||
| private Date createTime; | |||
| /**授权状态,0为已授权,1为已取消授权*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="授权状态,0为已授权,1为已取消授权",name="authorizationStatus") | |||
| private Integer authorizationStatus; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,OfficialAccountId_ASC("`official_account_id` ASC"),OfficialAccountId_DESC("`official_account_id` DESC") | |||
| ,AuthorizerAppid_ASC("`authorizer_appid` ASC"),AuthorizerAppid_DESC("`authorizer_appid` DESC") | |||
| ,HeadImg_ASC("`head_img` ASC"),HeadImg_DESC("`head_img` DESC") | |||
| ,Alias_ASC("`alias` ASC"),Alias_DESC("`alias` DESC") | |||
| ,QrcodeUrl_ASC("`qrcode_url` ASC"),QrcodeUrl_DESC("`qrcode_url` DESC") | |||
| ,CreateTime_ASC("`create_time` ASC"),CreateTime_DESC("`create_time` DESC") | |||
| ,AuthorizationStatus_ASC("`authorization_status` ASC"),AuthorizationStatus_DESC("`authorization_status` 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(WxAuthorizerInfo.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()); | |||
| } | |||
| this.sortColumns = sb.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -104,6 +104,10 @@ public class WxBillDaily implements Serializable { | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Integer getReceivePay() { | |||
| return receivePay; | |||
| } | |||
| @@ -189,7 +193,13 @@ public class WxBillDaily implements Serializable { | |||
| updatetime = _updatetime; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| @@ -98,6 +98,9 @@ public class WxBillDeposit implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| @@ -219,6 +222,14 @@ public class WxBillDeposit implements Serializable { | |||
| this.merchantName = merchantName; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -115,6 +115,10 @@ public class WxBillOther implements Serializable { | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updatetime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Integer getReceivePay() { | |||
| return receivePay; | |||
| } | |||
| @@ -200,7 +204,13 @@ public class WxBillOther implements Serializable { | |||
| updatetime = _updatetime; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| @@ -0,0 +1,299 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| @Table(name = "wx_bill_other_deposit") | |||
| public class WxBillOtherDeposit 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; | |||
| } | |||
| @Transient | |||
| private String merchantName; | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| public void setMerchantName(String merchantName) { | |||
| this.merchantName = merchantName; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单名称", name = "name") | |||
| private String name; | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public void setName(String name) { | |||
| this.name = name; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单备注", name = "comments") | |||
| private String comments; | |||
| public String getComments() { | |||
| return comments; | |||
| } | |||
| public void setComments(String comments) { | |||
| this.comments = comments; | |||
| } | |||
| /*实际应收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "实际应收金额", name = "receivePay") | |||
| private Integer receivePay; | |||
| /*实收金额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "实收金额", name = "pay") | |||
| private Integer pay; | |||
| /*截止收款日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "截止收款日期", name = "receiveDate") | |||
| private Date receiveDate; | |||
| /*到账日期**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "到账日期", name = "payDate") | |||
| private Date payDate; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "创建时间", name = "createtime") | |||
| private Date createtime; | |||
| /*逾期天数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "逾期天数", name = "expiredDay") | |||
| private Long expiredDay; | |||
| /*租户**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "租户", name = "tenantId") | |||
| private String tenantId; | |||
| /*欠缴**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "欠缴", name = "owe") | |||
| private Integer owe; | |||
| /*账单状态1待缴2欠缴3已结清**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "账单状态1未到期2待缴3欠缴4已结清5已退还", name = "status") | |||
| private Integer status; | |||
| /*删除 是1否0**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "删除 是1否0", name = "isDel") | |||
| private Integer isDel; | |||
| /*商户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "商户ID", name = "merchantId") | |||
| private Long merchantId; | |||
| /*账号ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "账号ID", name = "userId") | |||
| private Long userId; | |||
| /*商铺ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "商铺ID", name = "shopId") | |||
| private Long shopId; | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "更新时间", name = "updatetime") | |||
| private Date updatetime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Integer getReceivePay() { | |||
| return receivePay; | |||
| } | |||
| public void setReceivePay(Integer _receivePay) { | |||
| receivePay = _receivePay; | |||
| } | |||
| public Integer getPay() { | |||
| return pay; | |||
| } | |||
| public void setPay(Integer _pay) { | |||
| pay = _pay; | |||
| } | |||
| public Date getReceiveDate() { | |||
| return receiveDate; | |||
| } | |||
| public void setReceiveDate(Date _receiveDate) { | |||
| receiveDate = _receiveDate; | |||
| } | |||
| public Date getPayDate() { | |||
| return payDate; | |||
| } | |||
| public void setPayDate(Date _payDate) { | |||
| payDate = _payDate; | |||
| } | |||
| public Date getCreatetime() { | |||
| return createtime; | |||
| } | |||
| public void setCreatetime(Date _createtime) { | |||
| createtime = _createtime; | |||
| } | |||
| public Long getExpiredDay() { | |||
| return expiredDay; | |||
| } | |||
| public void setExpiredDay(Long _expiredDay) { | |||
| expiredDay = _expiredDay; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Integer getOwe() { | |||
| return owe; | |||
| } | |||
| public void setOwe(Integer _owe) { | |||
| owe = _owe; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setStatus(Integer _status) { | |||
| status = _status; | |||
| } | |||
| public Integer getIsDel() { | |||
| return isDel; | |||
| } | |||
| public void setIsDel(Integer _isDel) { | |||
| isDel = _isDel; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long _merchantId) { | |||
| merchantId = _merchantId; | |||
| } | |||
| public Long getUserId() { | |||
| return userId; | |||
| } | |||
| public void setUserId(Long _userId) { | |||
| userId = _userId; | |||
| } | |||
| public Long getShopId() { | |||
| return shopId; | |||
| } | |||
| public void setShopId(Long _shopId) { | |||
| shopId = _shopId; | |||
| } | |||
| public Date getUpdatetime() { | |||
| return updatetime; | |||
| } | |||
| public void setUpdatetime(Date _updatetime) { | |||
| updatetime = _updatetime; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field { | |||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), ReceivePay_ASC("`receivePay` ASC"), ReceivePay_DESC("`receivePay` DESC"), Pay_ASC("`pay` ASC"), Pay_DESC("`pay` DESC"), ReceiveDate_ASC("`receiveDate` ASC"), ReceiveDate_DESC("`receiveDate` DESC"), PayDate_ASC("`payDate` ASC"), PayDate_DESC("`payDate` DESC"), Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC"), ExpiredDay_ASC("`expiredDay` ASC"), ExpiredDay_DESC("`expiredDay` DESC"), TenantId_ASC("`tenantId` ASC"), TenantId_DESC("`tenantId` DESC"), Owe_ASC("`owe` ASC"), Owe_DESC("`owe` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), IsDel_ASC("`isDel` ASC"), IsDel_DESC("`isDel` DESC"), MerchantId_ASC("`merchantId` ASC"), MerchantId_DESC("`merchantId` DESC"), UserId_ASC("`userId` ASC"), UserId_DESC("`userId` DESC"), ShopId_ASC("`shopId` ASC"), ShopId_DESC("`shopId` DESC"), Updatetime_ASC("`updatetime` ASC"), Updatetime_DESC("`updatetime` 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(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(","); | |||
| List<Field> fList = new 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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -98,6 +98,9 @@ public class WxBillProperty implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| @@ -222,6 +225,14 @@ public class WxBillProperty implements Serializable { | |||
| this.merchantName = merchantName; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -98,6 +98,9 @@ public class WxBillPropertyDeposit implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| @@ -221,6 +224,14 @@ public class WxBillPropertyDeposit implements Serializable { | |||
| this.merchantName = merchantName; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -100,6 +100,9 @@ public class WxBillRent implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="结束时间",name="endtime") | |||
| private Date endtime; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Date getStarttime() { | |||
| return starttime; | |||
| } | |||
| @@ -223,6 +226,14 @@ public class WxBillRent implements Serializable { | |||
| this.updatetime = updatetime; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -57,8 +57,8 @@ public class WxCUser implements Serializable { | |||
| /*用户昵称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户昵称",name="nickName") | |||
| private String nickName; | |||
| /*用户头像地址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户头像地址",name="gender") | |||
| /*用户性别**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户性别",name="gender") | |||
| private Integer gender; | |||
| /*用户头像地址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户头像地址",name="avatarUrl") | |||
| @@ -0,0 +1,246 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| @Table(name = "wx_car_pay_record") | |||
| public class WxCarPayRecord implements Serializable { | |||
| private static final long serialVersionUID = 1243232432423L; | |||
| @Id | |||
| private Long id; | |||
| private String tenantId; | |||
| private Integer vendorType; | |||
| private String synId; | |||
| private String parkId; | |||
| private String parkName; | |||
| private String userType; | |||
| private String plateNumber; | |||
| private Date entranceTime; | |||
| private Date exitTime; | |||
| private String fee; | |||
| private Date feeTime; | |||
| private String coupon; | |||
| private String couponCode; | |||
| private String fixParkingId; | |||
| private String remainingDays; | |||
| private String discountAmount; | |||
| private String paidServiceFee; | |||
| private String phone; | |||
| private Date createDate; | |||
| private Date updateDate; | |||
| private Long stayedTime; | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="开始日期",name="startDate") | |||
| private String startDate; | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="结束日期",name="endDate") | |||
| private String endDate; | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value="是否缴费",name="isPay") | |||
| private Integer isPay; | |||
| public Date getFeeTime() { | |||
| return feeTime; | |||
| } | |||
| public void setFeeTime(Date feeTime) { | |||
| this.feeTime = feeTime; | |||
| } | |||
| public Long getStayedTime() { | |||
| return stayedTime; | |||
| } | |||
| public void setStayedTime(Long stayedTime) { | |||
| this.stayedTime = stayedTime; | |||
| } | |||
| public String getStartDate() { | |||
| return startDate; | |||
| } | |||
| public void setStartDate(String startDate) { | |||
| this.startDate = startDate; | |||
| } | |||
| public String getEndDate() { | |||
| return endDate; | |||
| } | |||
| public void setEndDate(String endDate) { | |||
| this.endDate = endDate; | |||
| } | |||
| public Integer getIsPay() { | |||
| return isPay; | |||
| } | |||
| public void setIsPay(Integer isPay) { | |||
| this.isPay = isPay; | |||
| } | |||
| public String getPhone() { | |||
| return phone; | |||
| } | |||
| public void setPhone(String phone) { | |||
| this.phone = phone; | |||
| } | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String tenantId) { | |||
| this.tenantId = tenantId; | |||
| } | |||
| public Integer getVendorType() { | |||
| return vendorType; | |||
| } | |||
| public void setVendorType(Integer vendorType) { | |||
| this.vendorType = vendorType; | |||
| } | |||
| public String getSynId() { | |||
| return synId; | |||
| } | |||
| public void setSynId(String synId) { | |||
| this.synId = synId; | |||
| } | |||
| public String getParkId() { | |||
| return parkId; | |||
| } | |||
| public void setParkId(String parkId) { | |||
| this.parkId = parkId; | |||
| } | |||
| public String getParkName() { | |||
| return parkName; | |||
| } | |||
| public void setParkName(String parkName) { | |||
| this.parkName = parkName; | |||
| } | |||
| public String getUserType() { | |||
| return userType; | |||
| } | |||
| public void setUserType(String userType) { | |||
| this.userType = userType; | |||
| } | |||
| public String getPlateNumber() { | |||
| return plateNumber; | |||
| } | |||
| public void setPlateNumber(String plateNumber) { | |||
| this.plateNumber = plateNumber; | |||
| } | |||
| public Date getEntranceTime() { | |||
| return entranceTime; | |||
| } | |||
| public void setEntranceTime(Date entranceTime) { | |||
| this.entranceTime = entranceTime; | |||
| } | |||
| public Date getExitTime() { | |||
| return exitTime; | |||
| } | |||
| public void setExitTime(Date exitTime) { | |||
| this.exitTime = exitTime; | |||
| } | |||
| public String getFee() { | |||
| return fee; | |||
| } | |||
| public void setFee(String fee) { | |||
| this.fee = fee; | |||
| } | |||
| public String getCoupon() { | |||
| return coupon; | |||
| } | |||
| public void setCoupon(String coupon) { | |||
| this.coupon = coupon; | |||
| } | |||
| public String getCouponCode() { | |||
| return couponCode; | |||
| } | |||
| public void setCouponCode(String couponCode) { | |||
| this.couponCode = couponCode; | |||
| } | |||
| public String getFixParkingId() { | |||
| return fixParkingId; | |||
| } | |||
| public void setFixParkingId(String fixParkingId) { | |||
| this.fixParkingId = fixParkingId; | |||
| } | |||
| public String getRemainingDays() { | |||
| return remainingDays; | |||
| } | |||
| public void setRemainingDays(String remainingDays) { | |||
| this.remainingDays = remainingDays; | |||
| } | |||
| public String getDiscountAmount() { | |||
| return discountAmount; | |||
| } | |||
| public void setDiscountAmount(String discountAmount) { | |||
| this.discountAmount = discountAmount; | |||
| } | |||
| public String getPaidServiceFee() { | |||
| return paidServiceFee; | |||
| } | |||
| public void setPaidServiceFee(String paidServiceFee) { | |||
| this.paidServiceFee = paidServiceFee; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| public void setCreateDate(Date createDate) { | |||
| this.createDate = createDate; | |||
| } | |||
| public Date getUpdateDate() { | |||
| return updateDate; | |||
| } | |||
| public void setUpdateDate(Date updateDate) { | |||
| this.updateDate = updateDate; | |||
| } | |||
| } | |||
| @@ -66,76 +66,76 @@ public class WxCoupon implements Serializable { | |||
| @Transient | |||
| private String merchantParams; | |||
| /*租户ID**/ | |||
| /**租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | |||
| /**券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)",name="type") | |||
| private Integer type; | |||
| /*封面图**/ | |||
| /**封面图**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| /*券名称**/ | |||
| /**券名称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||
| private String title; | |||
| /*副标题**/ | |||
| /**副标题**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | |||
| private String subTitle; | |||
| /*售价(适用于类型2,3,4,5)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | |||
| /**售价(适用于类型2,3,4,5, 6, 8, 100)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5, 6, 8, 9, 100)",name="salePrice") | |||
| private Integer salePrice; | |||
| /*使用条件金额(适用于类型1,2,3,4)**/ | |||
| /**使用条件金额(适用于类型1,2,3,4)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||
| private Integer usePrice; | |||
| /*限领张数**/ | |||
| /**限领张数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="限领张数",name="useLimitQuantity") | |||
| private Integer useLimitQuantity; | |||
| /*1.主动领取2.定向投放**/ | |||
| /**1.主动领取2.定向投放**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="1.主动领取2.定向投放",name="sendType") | |||
| private Integer sendType; | |||
| /*有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)**/ | |||
| /**有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="有效时间类型1.时间范围(valid_start_date,valid_end_date). 2领取后几日有效(valid_days)",name="validType") | |||
| private Integer validType; | |||
| /*有效日期-开始**/ | |||
| /**有效日期-开始**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-开始",name="validStartDate") | |||
| private Date validStartDate; | |||
| /*有效日期-结束**/ | |||
| /**有效日期-结束**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-结束",name="validEndDate") | |||
| private Date validEndDate; | |||
| /*自领取之日几日有效,(停车券当天有效)**/ | |||
| /**自领取之日几日有效,(停车券当天有效)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="自领取之日几日有效,(停车券当天有效)",name="validDays") | |||
| private Integer validDays; | |||
| /*须知**/ | |||
| /**须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | |||
| private String detail; | |||
| /*面额**/ | |||
| /**面额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||
| private Integer price; | |||
| /*单位**/ | |||
| /**单位**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="单位(0:rmb分 1:小时)",name="unit") | |||
| private Integer unit; | |||
| /*剩余库存**/ | |||
| /**剩余库存**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") | |||
| private Integer remainInventory; | |||
| /*总库存**/ | |||
| /**总库存**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") | |||
| private Integer inventory; | |||
| /*购买须知**/ | |||
| /**购买须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | |||
| private String remark; | |||
| /*状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)**/ | |||
| /**状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="状态(-1:全部,0:草稿/待生效,1:已生效,2:已失效,3:已作废)",name="status") | |||
| private Integer status; | |||
| /*创建时间**/ | |||
| /**创建时间**/ | |||
| @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="business") | |||
| private Integer business; | |||
| /*是否支持转送(0:不支持,1支持)**/ | |||
| /**是否支持转送(0:不支持,1支持)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否支持转送(0:不支持,1支持)",name="supportTransfer") | |||
| private Integer supportTransfer; | |||
| /**补贴类型(0:不支持, 1:微信支付立减与折扣, 2:线下结算, 3:微信付款到银行卡 )**/ | |||
| @@ -145,6 +145,14 @@ public class WxCoupon implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="补贴额",name="subsidyNum") | |||
| private Integer subsidyNum; | |||
| /**砍价/团购限制人数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="砍价/团购限制人数",name="pressLimitNum") | |||
| private Integer pressLimitNum; | |||
| /**砍价限制时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="砍价限制时间",name="pressLimitHours") | |||
| private Integer pressLimitHours; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| @@ -385,6 +393,21 @@ public class WxCoupon implements Serializable { | |||
| this.subsidyNum = subsidyNum; | |||
| } | |||
| public Integer getPressLimitNum() { | |||
| return pressLimitNum; | |||
| } | |||
| public void setPressLimitNum(Integer pressLimitNum) { | |||
| this.pressLimitNum = pressLimitNum; | |||
| } | |||
| public Integer getPressLimitHours() { | |||
| return pressLimitHours; | |||
| } | |||
| public void setPressLimitHours(Integer pressLimitHours) { | |||
| this.pressLimitHours = pressLimitHours; | |||
| } | |||
| public static enum Field | |||
| { | |||
| @@ -47,8 +47,8 @@ public class WxCouponOrder implements Serializable { | |||
| /**卡券ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "卡券ID", name = "couponId") | |||
| private Long couponId; | |||
| /**券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,7.类储值卡) */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,7.类储值卡)", name = "couponType") | |||
| /**券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡) */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)", name = "couponType") | |||
| private Integer couponType; | |||
| /*c端用户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value = "c端用户id", name = "cUserId") | |||
| @@ -68,6 +68,7 @@ public class WxCouponSend implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| /*场景发券计数**/ | |||
| @Transient | |||
| protected int sendCount; | |||
| @@ -126,6 +127,7 @@ public class WxCouponSend implements Serializable { | |||
| updateDate = _updateDate; | |||
| } | |||
| public int getSendCount() { | |||
| return sendCount; | |||
| } | |||
| @@ -0,0 +1,173 @@ | |||
| package com.iformall.domain.po; | |||
| 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_flow_record") | |||
| public class WxFlowRecord implements Serializable { | |||
| private static final long serialVersionUID = 1849242743274278L; | |||
| @Id | |||
| private Long id; | |||
| private Long businessId; //业务id | |||
| private Integer businessType;//业务类型 1合同审批2账单审批 | |||
| private Long userId;//用户id | |||
| private String userName;//姓名 | |||
| private String remark;//审批意见 | |||
| private Integer status;//状态 1新建2审批3驳回4审批通过 | |||
| private String taskId;//任务id | |||
| private String processInstanceId;//流程实例id | |||
| private Date createDate; | |||
| private Date updateDate; | |||
| private String tenantId; | |||
| private String taskKey; // key | |||
| private String taskName;// 名称 | |||
| @Transient | |||
| protected List<Long> ids; | |||
| //是否最后一个启动节点 | |||
| @Transient | |||
| private Integer isLastStart; | |||
| public WxFlowRecord(){} | |||
| public WxFlowRecord(Long businessId){ | |||
| this.businessId = businessId; | |||
| } | |||
| public WxFlowRecord(Long businessId,String tenantId){ | |||
| this.businessId = businessId; | |||
| this.tenantId = tenantId; | |||
| } | |||
| public Integer getIsLastStart() { | |||
| return isLastStart; | |||
| } | |||
| public void setIsLastStart(Integer isLastStart) { | |||
| this.isLastStart = isLastStart; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| public String getTaskKey() { | |||
| return taskKey; | |||
| } | |||
| public void setTaskKey(String taskKey) { | |||
| this.taskKey = taskKey; | |||
| } | |||
| public String getTaskName() { | |||
| return taskName; | |||
| } | |||
| public void setTaskName(String taskName) { | |||
| this.taskName = taskName; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String tenantId) { | |||
| this.tenantId = tenantId; | |||
| } | |||
| public String getUserName() { | |||
| return userName; | |||
| } | |||
| public void setUserName(String userName) { | |||
| this.userName = userName; | |||
| } | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public Long getBusinessId() { | |||
| return businessId; | |||
| } | |||
| public void setBusinessId(Long businessId) { | |||
| this.businessId = businessId; | |||
| } | |||
| public Integer getBusinessType() { | |||
| return businessType; | |||
| } | |||
| public void setBusinessType(Integer businessType) { | |||
| this.businessType = businessType; | |||
| } | |||
| public Long getUserId() { | |||
| return userId; | |||
| } | |||
| public void setUserId(Long userId) { | |||
| this.userId = userId; | |||
| } | |||
| public String getRemark() { | |||
| return remark; | |||
| } | |||
| public void setRemark(String remark) { | |||
| this.remark = remark; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setStatus(Integer status) { | |||
| this.status = status; | |||
| } | |||
| public String getTaskId() { | |||
| return taskId; | |||
| } | |||
| public void setTaskId(String taskId) { | |||
| this.taskId = taskId; | |||
| } | |||
| public String getProcessInstanceId() { | |||
| return processInstanceId; | |||
| } | |||
| public void setProcessInstanceId(String processInstanceId) { | |||
| this.processInstanceId = processInstanceId; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| public void setCreateDate(Date createDate) { | |||
| this.createDate = createDate; | |||
| } | |||
| public Date getUpdateDate() { | |||
| return updateDate; | |||
| } | |||
| public void setUpdateDate(Date updateDate) { | |||
| this.updateDate = updateDate; | |||
| } | |||
| } | |||
| @@ -57,6 +57,12 @@ public class WxGame implements Serializable { | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "触发条件(-1:不受限制,1:登录触发)", name = "triggleAction") | |||
| private Integer triggleAction; | |||
| /** | |||
| * 玩次数限制 | |||
| */ | |||
| @io.swagger.annotations.ApiModelProperty(value = "触发条件(0:不受限制,n:限玩次数)", name = "playLimit") | |||
| private Integer playLimit; | |||
| @Transient | |||
| @io.swagger.annotations.ApiModelProperty(value = "已投放券信息") | |||
| @@ -167,6 +173,14 @@ public class WxGame implements Serializable { | |||
| this.triggleAction = triggleAction; | |||
| } | |||
| public Integer getPlayLimit() { | |||
| return playLimit; | |||
| } | |||
| public void setPlayLimit(Integer playLimit) { | |||
| this.playLimit = playLimit; | |||
| } | |||
| public List<Object> getCouponIdsList() { | |||
| return couponIdsList; | |||
| } | |||
| @@ -175,6 +189,7 @@ public class WxGame implements Serializable { | |||
| this.couponIdsList = couponIdsList; | |||
| } | |||
| public void setGameTemplate(WxGameTemplate gameTemplate) { | |||
| if (gameTemplate != null) { | |||
| this.imgUrl = gameTemplate.getImgUrl(); | |||
| @@ -193,7 +208,8 @@ public class WxGame implements Serializable { | |||
| , Status_ASC("`status` ASC"), Status_DESC("`status` DESC") | |||
| , ValidStartDate_ASC("`valid_start_date` ASC"), ValidStartDate_DESC("`valid_start_date` DESC") | |||
| , ValidEndDate_ASC("`valid_end_date` ASC"), ValidEndDate_DESC("`valid_end_date` DESC") | |||
| , TriggleAction_ASC("`triggle_action` ASC"), TriggleAction_DESC("`triggle_action` DESC"); | |||
| , TriggleAction_ASC("`triggle_action` ASC"), TriggleAction_DESC("`triggle_action` DESC") | |||
| , PlayLimit_ASC("`play_limit` ASC"), PlayLimit_DESC("`play_limit` DESC"); | |||
| private String value; | |||
| Field(String value) { | |||
| @@ -0,0 +1,183 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.Id; | |||
| import javax.persistence.Table; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.ArrayList; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @Table(name = "wx_game_action_log") | |||
| public class WxGameActionLog implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| @Transient | |||
| protected Date startTime; | |||
| @Transient | |||
| protected Date endTime; | |||
| 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; | |||
| } | |||
| 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; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*coupon id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="游戏ID",name="gameId") | |||
| private Long gameId; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="couponOrderId") | |||
| private Long couponOrderId; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="userId") | |||
| private Long userId; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="createTime") | |||
| private Date createTime; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Long getCouponOrderId() { | |||
| return couponOrderId; | |||
| } | |||
| public void setCouponOrderId(Long _couponOrderId) { | |||
| couponOrderId = _couponOrderId; | |||
| } | |||
| public Long getGameId() { | |||
| return gameId; | |||
| } | |||
| public void setGameId(Long gameId) { | |||
| this.gameId = gameId; | |||
| } | |||
| public Long getUserId() { | |||
| return userId; | |||
| } | |||
| public void setUserId(Long userId) { | |||
| this.userId = userId; | |||
| } | |||
| public Date getCreateTime() { | |||
| return createTime; | |||
| } | |||
| public void setCreateTime(Date createTime) { | |||
| this.createTime = createTime; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||
| ,GameId_ASC("`game_id` ASC"),GameId_DESC("`game_id` DESC") | |||
| ,UserId_ASC("`user_id` ASC"),UserId_DESC("`user_id` DESC") | |||
| ,CouponOrderId_ASC("`coupon_order_id` ASC"),CouponOrderId_DESC("`coupon_order_id` DESC") | |||
| ,CreateTime_ASC("`create_time` ASC"),CreateTime_DESC("`create_time` 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(WxGameActionLog.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()); | |||
| } | |||
| this.sortColumns = sb.toString(); | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| List<Field> fList = new 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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -55,6 +55,13 @@ public class WxLevelConfig implements Serializable { | |||
| /**创建时间**/ | |||
| @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="capability") | |||
| private String capability; | |||
| /**是否启用,0:未启用,启用1,2,3,分别对应wx_merchant_discount里的rate_vip1, rate_vip2, rate_vip3**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否启用",name="discountEnable") | |||
| @@ -63,6 +70,9 @@ public class WxLevelConfig implements Serializable { | |||
| @Transient | |||
| protected Long count; | |||
| @Transient | |||
| protected Long userCount; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| @@ -112,6 +122,30 @@ public class WxLevelConfig implements Serializable { | |||
| this.discountEnable = discountEnable; | |||
| } | |||
| public Date getUpdateDate() { | |||
| return updateDate; | |||
| } | |||
| public void setUpdateDate(Date updateDate) { | |||
| this.updateDate = updateDate; | |||
| } | |||
| public String getCapability() { | |||
| return capability; | |||
| } | |||
| public void setCapability(String capability) { | |||
| this.capability = capability; | |||
| } | |||
| public Long getUserCount() { | |||
| return userCount; | |||
| } | |||
| public void setUserCount(Long userCount) { | |||
| this.userCount = userCount; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -0,0 +1,161 @@ | |||
| package com.iformall.domain.po; | |||
| 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_level_merchant") | |||
| public class WxLevelMerchant 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="等级ID",name="levelId") | |||
| private Long levelId; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户ID",name="merchantId") | |||
| private Long merchantId; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| /*折扣率**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="0-100折扣",name="discount") | |||
| private Integer discount; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String tenantId) { | |||
| this.tenantId = tenantId; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| public void setMerchantId(Long merchantId) { | |||
| this.merchantId = merchantId; | |||
| } | |||
| public Date getCreateDate() { | |||
| return createDate; | |||
| } | |||
| public void setCreateDate(Date createDate) { | |||
| this.createDate = createDate; | |||
| } | |||
| public Long getLevelId() { | |||
| return levelId; | |||
| } | |||
| public void setLevelId(Long levelId) { | |||
| this.levelId = levelId; | |||
| } | |||
| public Integer getDiscount() { | |||
| return discount; | |||
| } | |||
| public void setDiscount(Integer discount) { | |||
| this.discount = discount; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,LevelId_ASC("`level_id` ASC"),LevelId_DESC("`product_id` DESC") | |||
| ,Discount_ASC("`discount` ASC"),Discount_DESC("`discount` DESC") | |||
| ,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC") | |||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` 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(WxLevelMerchant.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()); | |||
| } | |||
| this.sortColumns = sb.toString(); | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| 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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -85,6 +85,9 @@ public class WxMall implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序提示",name="weapNote") | |||
| private String weapNote; | |||
| @Transient | |||
| protected List<WxMallBuilding> buildings; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| @@ -184,6 +187,14 @@ public class WxMall implements Serializable { | |||
| this.weapNote = weapNote; | |||
| } | |||
| public List<WxMallBuilding> getBuildings() { | |||
| return buildings; | |||
| } | |||
| public void setBuildings(List<WxMallBuilding> buildings) { | |||
| this.buildings = buildings; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -61,6 +61,10 @@ public class WxMallFloor implements Serializable { | |||
| /*更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| @Transient | |||
| protected List<WxMallFloor> floors; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| @@ -105,7 +109,6 @@ public class WxMallFloor implements Serializable { | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -49,7 +49,7 @@ public class WxMerchant implements Serializable { | |||
| private List<WxShop> shops; | |||
| @Transient | |||
| private List<WxMerchantBUser> bUsers; | |||
| private List<WxMerchantBUser> users; | |||
| @Transient | |||
| private Long rentContractId; | |||
| @@ -94,6 +94,8 @@ public class WxMerchant implements Serializable { | |||
| @Transient | |||
| private WxMerchantTax wxMerchantTax; | |||
| @Transient | |||
| private List<WxLevelConfig> levelConfigList; | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| @@ -135,14 +137,16 @@ public class WxMerchant implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="品牌",name="brand") | |||
| private Long brand; | |||
| @io.swagger.annotations.ApiModelProperty(value="VIP折扣率1",name="vipDiscountRate1") | |||
| private Integer vipDiscountRate1; | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型", name = "type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="VIP折扣率2",name="vipDiscountRate2") | |||
| private Integer vipDiscountRate2; | |||
| public List<WxLevelConfig> getLevelConfigList() { | |||
| return levelConfigList; | |||
| } | |||
| @io.swagger.annotations.ApiModelProperty(value="VIP折扣率3",name="vipDiscountRate3") | |||
| private Integer vipDiscountRate3; | |||
| public void setLevelConfigList(List<WxLevelConfig> levelConfigList) { | |||
| this.levelConfigList = levelConfigList; | |||
| } | |||
| public List<Map<String, Object>> getShoplist() { | |||
| return shoplist; | |||
| @@ -234,12 +238,12 @@ public class WxMerchant implements Serializable { | |||
| this.shops = shops; | |||
| } | |||
| public List<WxMerchantBUser> getbUsers() { | |||
| return bUsers; | |||
| } | |||
| public List<WxMerchantBUser> getUsers() { | |||
| return users; | |||
| } | |||
| public void setbUsers(List<WxMerchantBUser> bUsers) { | |||
| this.bUsers = bUsers; | |||
| public void setUsers(List<WxMerchantBUser> users) { | |||
| this.users = users; | |||
| } | |||
| public Date getRentalStartDate() { | |||
| @@ -356,29 +360,6 @@ public class WxMerchant implements Serializable { | |||
| this.wxMerchantTax = wxMerchantTax; | |||
| } | |||
| public Integer getVipDiscountRate1() { | |||
| return vipDiscountRate1; | |||
| } | |||
| public void setVipDiscountRate1(Integer vipDiscountRate1) { | |||
| this.vipDiscountRate1 = vipDiscountRate1; | |||
| } | |||
| public Integer getVipDiscountRate2() { | |||
| return vipDiscountRate2; | |||
| } | |||
| public void setVipDiscountRate2(Integer vipDiscountRate2) { | |||
| this.vipDiscountRate2 = vipDiscountRate2; | |||
| } | |||
| public Integer getVipDiscountRate3() { | |||
| return vipDiscountRate3; | |||
| } | |||
| public void setVipDiscountRate3(Integer vipDiscountRate3) { | |||
| this.vipDiscountRate3 = vipDiscountRate3; | |||
| } | |||
| public String getAccountParameter() { | |||
| return accountParameter; | |||
| @@ -388,6 +369,14 @@ public class WxMerchant implements Serializable { | |||
| this.accountParameter = accountParameter; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer type) { | |||
| this.type = type; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -40,8 +40,8 @@ public class WxMerchantSubsidy implements Serializable { | |||
| /**券包ID/存储卡ID*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券包ID/存储卡ID",name="couponOrderId") | |||
| private Long couponOrderId; | |||
| /**券包类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,7.类储值卡)*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券包类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,7.类储值卡)",name="couponType") | |||
| /**券包类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券包类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)",name="couponType") | |||
| private Integer couponType; | |||
| /**订单金额*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单金额",name="orderPayment") | |||
| @@ -48,8 +48,8 @@ public class WxMsgValidationcode implements Serializable { | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="createtime") | |||
| private Date createtime; | |||
| /*场景 1 登录 2买券 3停车**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="场景 1 登录 2买券 3停车",name="type") | |||
| /*场景 1 登录 2买券 3停车 4审批流通知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="场景 1 登录 2买券 3停车 4审批流通知",name="type") | |||
| private Integer type; | |||
| /***/ | |||
| @io.swagger.annotations.ApiModelProperty(value="",name="tenantId") | |||
| @@ -48,43 +48,65 @@ public class WxOrder implements Serializable { | |||
| @Transient | |||
| private String phone; | |||
| /*订单码;正反向交易保持一致。**/ | |||
| /**订单码;正反向交易保持一致。**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单码;正反向交易保持一致。",name="orderNumber") | |||
| private Long orderNumber; | |||
| /*租户ID**/ | |||
| /**租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*c端用户id**/ | |||
| /**c端用户id**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="c端用户id",name="cUserId") | |||
| private Long cUserId; | |||
| /*产品ID,根据order type**/ | |||
| /**渠道ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="渠道ID",name="couponChannelId") | |||
| private Long couponChannelId; | |||
| /**产品ID,根据order type**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="产品ID",name="productId") | |||
| private Long productId; | |||
| /*类型0:券,1:B刷卡支付,2:C扫码支付,3:储值卡**/ | |||
| /**类型0:券,1:B刷卡支付,2:C扫码支付,3:储值卡**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="类型",name="type") | |||
| private Integer type; | |||
| /*0: 付款 1: 退款**/ | |||
| /**0: 付款 1: 退款**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="0: 付款 1: 退款",name="paymentType") | |||
| private Integer paymentType; | |||
| /*支付金额(分):允许有负数,退款时为负值。**/ | |||
| /**支付金额(分):允许有负数,退款时为负值。**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分):允许有负数,退款时为负值。",name="payment") | |||
| private Integer payment; | |||
| /*支付时间**/ | |||
| /**支付时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付时间",name="paymentTime") | |||
| private Date paymentTime; | |||
| /*订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款;4-退款失败**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款;4-退款失败",name="orderStatus") | |||
| /**订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-待退款;4-已退款,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单状态:-1全部;正向交易:0-已下单/待付款;1-已支付;2-已取消(限定时间内未付款)反向交易:3-已退款; 4-退款失败,5-退款失败; 砍价:6-砍价中,7-砍价完成,8-砍价失败",name="orderStatus") | |||
| private Integer orderStatus; | |||
| /*创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| /**创建时间/砍价开始时间**/ | |||
| @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="detail") | |||
| private String detail; | |||
| /**砍价结束时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="砍价结束时间",name="pressEndDate") | |||
| private Date pressEndDate; | |||
| /**砍价人数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="砍价人数",name="pressCurrentNum") | |||
| private Integer pressCurrentNum; | |||
| /**已砍价格**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="已砍价格",name="pressCurrentValue") | |||
| private Integer pressCurrentValue; | |||
| @Transient | |||
| protected List<Integer> statusS; | |||
| @Transient | |||
| protected String statusStr; | |||
| public Long getOrderNumber() { | |||
| return orderNumber; | |||
| } | |||
| @@ -164,7 +186,15 @@ public class WxOrder implements Serializable { | |||
| this.cUserId = cUserId; | |||
| } | |||
| public Long getProductId() { | |||
| public Long getCouponChannelId() { | |||
| return couponChannelId; | |||
| } | |||
| public void setCouponChannelId(Long couponChannelId) { | |||
| this.couponChannelId = couponChannelId; | |||
| } | |||
| public Long getProductId() { | |||
| return productId; | |||
| } | |||
| @@ -188,7 +218,47 @@ public class WxOrder implements Serializable { | |||
| this.phone = phone; | |||
| } | |||
| public static enum Field | |||
| public Date getPressEndDate() { | |||
| return pressEndDate; | |||
| } | |||
| public void setPressEndDate(Date pressEndDate) { | |||
| this.pressEndDate = pressEndDate; | |||
| } | |||
| public Integer getPressCurrentNum() { | |||
| return pressCurrentNum; | |||
| } | |||
| public void setPressCurrentNum(Integer pressCurrentNum) { | |||
| this.pressCurrentNum = pressCurrentNum; | |||
| } | |||
| public Integer getPressCurrentValue() { | |||
| return pressCurrentValue; | |||
| } | |||
| public void setPressCurrentValue(Integer pressCurrentValue) { | |||
| this.pressCurrentValue = pressCurrentValue; | |||
| } | |||
| public List<Integer> getStatusS() { | |||
| return statusS; | |||
| } | |||
| public void setStatusS(List<Integer> statusS) { | |||
| this.statusS = statusS; | |||
| } | |||
| public String getStatusStr() { | |||
| return statusStr; | |||
| } | |||
| public void setStatusStr(String statusStr) { | |||
| this.statusStr = statusStr; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,OrderNumber_ASC("`order_number` ASC"),OrderNumber_DESC("`order_number` DESC") | |||
| @@ -196,6 +266,7 @@ public class WxOrder implements Serializable { | |||
| ,CUserId_ASC("`c_user_id` ASC"),CUserId_DESC("`c_user_id` DESC") | |||
| ,MerchantId_ASC("`merchant_id` ASC"),MerchantId_DESC("`merchant_id` DESC") | |||
| ,BUserId_ASC("`b_user_id` ASC"),BUserId_DESC("`b_user_id` DESC") | |||
| ,CouponChannelId_ASC("`coupon_channel_id` ASC"),CouponChannelId_DESC("`coupon_channel_id` DESC") | |||
| ,ProductId_ASC("`product_id` ASC"),ProductId_DESC("`product_id` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,PaymentType_ASC("`payment_type` ASC"),PaymentType_DESC("`payment_type` DESC") | |||
| @@ -9,9 +9,9 @@ import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_component_verify_ticket") | |||
| @Table(name = "wx_order_press") | |||
| @Data | |||
| public class WxComponentVerifyTicket implements Serializable { | |||
| public class WxOrderPress implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| @@ -21,29 +21,36 @@ public class WxComponentVerifyTicket implements Serializable { | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| /**微信第三方componentAppid*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信第三方componentAppid",name="componentAppid") | |||
| private String componentAppid; | |||
| /**微信第三方component_verify_ticket*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信第三方component_verify_ticket",name="componentVerifyTicket") | |||
| private String componentVerifyTicket; | |||
| /**创建时间*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | |||
| private Date createTime; | |||
| /**失效时间*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="失效时间",name="deadline") | |||
| private Date deadline; | |||
| /**租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /**订单ID*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") | |||
| private Long orderId; | |||
| /**砍价参与人ID*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="砍价参与人ID",name="userId") | |||
| private Long userId; | |||
| /**砍下来的价值*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="砍下来的价值",name="pressValue") | |||
| private Integer pressValue; | |||
| /**砍价时间*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="砍价时间",name="createDate") | |||
| private Date createDate; | |||
| /**是否发起人*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否发起人",name="first") | |||
| private Integer first; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,ComponentAppid_ASC("`component_appid` ASC"),ComponentAppid_DESC("`component_appid` DESC") | |||
| ,ComponentVerifyTicket_ASC("`component_verify_ticket` ASC"),ComponentVerifyTicket_DESC("`component_verify_ticket` DESC") | |||
| ,CreateTime_ASC("`create_time` ASC"),CreateTime_DESC("`create_time` DESC") | |||
| ,Deadline_ASC("`deadline` ASC"),Deadline_DESC("`deadline` DESC") | |||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||
| ,OrderId_ASC("`order_id` ASC"),OrderId_DESC("`order_id` DESC") | |||
| ,UserId_ASC("`user_id` ASC"),UserId_DESC("`user_id` DESC") | |||
| ,PressValue_ASC("`press_value` ASC"),PressValue_DESC("`press_value` DESC") | |||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||
| ; | |||
| private String value; | |||
| Field(String value){ | |||
| @@ -61,7 +68,7 @@ public class WxComponentVerifyTicket implements Serializable { | |||
| } | |||
| } | |||
| public void setSortColumns(WxComponentVerifyTicket.Field... fields) | |||
| public void setSortColumns(WxOrderPress.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| @@ -17,6 +17,9 @@ public class WxPropertyContract implements Serializable { | |||
| @Id | |||
| protected Long id; | |||
| // 审核状态,0未审核 1审核中 2审核完成 3驳回 4合同作废 | |||
| private Integer applyStatus; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @@ -150,6 +153,20 @@ public class WxPropertyContract implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value = "起租结束时间", name = "rentalEndDate") | |||
| private Date endDate; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "计租周期", name = "计租周期") | |||
| private Integer adjustPeriod; | |||
| public Integer getApplyStatus() { | |||
| return applyStatus; | |||
| } | |||
| public void setApplyStatus(Integer applyStatus) { | |||
| this.applyStatus = applyStatus; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| @@ -329,6 +346,22 @@ public class WxPropertyContract implements Serializable { | |||
| this.endDate = endDate; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public Integer getAdjustPeriod() { | |||
| return adjustPeriod; | |||
| } | |||
| public void setAdjustPeriod(Integer adjustPeriod) { | |||
| this.adjustPeriod = adjustPeriod; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -163,9 +163,9 @@ public class WxRentContract implements Serializable { | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value = "调整比例", name = "adjustRatio") | |||
| private Integer adjustRatio; | |||
| private String adjustRatio; | |||
| @io.swagger.annotations.ApiModelProperty(value = "调整周期", name = "adjustPeriod") | |||
| @io.swagger.annotations.ApiModelProperty(value = "计租周期 1日2月", name = "adjustPeriod") | |||
| private Integer adjustPeriod; | |||
| @io.swagger.annotations.ApiModelProperty(value = "支付比例", name = "payRatio") | |||
| @@ -180,6 +180,24 @@ public class WxRentContract implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value = "起租结束时间", name = "rentalEndDate") | |||
| private Date endDate; | |||
| //审核状态,0未审核 1审核中 2审核通过 3驳回 | |||
| @io.swagger.annotations.ApiModelProperty(value = "审核状态", name = "applyStatus") | |||
| private Integer applyStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value = "开户行", name = "bankName") | |||
| private String bankName; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁商铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Integer getApplyStatus() { | |||
| return applyStatus; | |||
| } | |||
| public void setApplyStatus(Integer applyStatus) { | |||
| this.applyStatus = applyStatus; | |||
| } | |||
| public Long getMerchantId() { | |||
| return merchantId; | |||
| } | |||
| @@ -396,11 +414,11 @@ public class WxRentContract implements Serializable { | |||
| this.type = type; | |||
| } | |||
| public Integer getAdjustRatio() { | |||
| public String getAdjustRatio() { | |||
| return adjustRatio; | |||
| } | |||
| public void setAdjustRatio(Integer adjustRatio) { | |||
| public void setAdjustRatio(String adjustRatio) { | |||
| this.adjustRatio = adjustRatio; | |||
| } | |||
| @@ -444,6 +462,30 @@ public class WxRentContract implements Serializable { | |||
| this.endDate = endDate; | |||
| } | |||
| public String getBrandName() { | |||
| return brandName; | |||
| } | |||
| public void setBrandName(String brandName) { | |||
| this.brandName = brandName; | |||
| } | |||
| public String getBankName() { | |||
| return bankName; | |||
| } | |||
| public void setBankName(String bankName) { | |||
| this.bankName = bankName; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| public static enum Field { | |||
| Id_ASC("`id` ASC"), Id_DESC("`id` DESC"), MerchantId_ASC("`merchant_id` ASC"), MerchantId_DESC("`merchant_id` DESC"), Price_ASC("`price` ASC"), Price_DESC("`price` DESC"), RentalStartDate_ASC("`rental_start_date` ASC"), RentalStartDate_DESC("`rental_start_date` DESC"), RentalEndDate_ASC("`rental_end_date` ASC"), RentalEndDate_DESC("`rental_end_date` DESC"), SignDate_ASC("`sign_date` ASC"), SignDate_DESC("`sign_date` DESC"), ReceivePeriod_ASC("`receive_period` ASC"), ReceivePeriod_DESC("`receive_period` DESC"), TenantId_ASC("`tenant_id` ASC"), TenantId_DESC("`tenant_id` DESC"), Filepath_ASC("`filepath` ASC"), Filepath_DESC("`filepath` DESC"), Status_ASC("`status` ASC"), Status_DESC("`status` DESC"), ContractNumber_ASC("`contract_number` ASC"), ContractNumber_DESC("`contract_number` DESC"), Deposit_ASC("`deposit` ASC"), Deposit_DESC("`deposit` DESC"), PayDate_ASC("`pay_date` ASC"), PayDate_DESC("`pay_date` DESC"), IsDel_ASC("`is_del` ASC"), IsDel_DESC("`is_del` DESC"), MerchantName_ASC("`merchant_name` ASC"), MerchantName_DESC("`merchant_name` DESC"), Brand_ASC("`brand` ASC"), Brand_DESC("`brand` DESC"), BusinessId_ASC("`business_id` ASC"), BusinessId_DESC("`business_id` DESC"), ShopType_ASC("`shop_type` ASC"), ShopType_DESC("`shop_type` DESC"), ShopId_ASC("`shop_id` ASC"), ShopId_DESC("`shop_id` DESC"), Updatetime_ASC("`updatetime` ASC"), Updatetime_DESC("`updatetime` DESC"), Createtime_ASC("`createtime` ASC"), Createtime_DESC("`createtime` DESC"); | |||
| private String value; | |||
| @@ -104,6 +104,15 @@ public class WxShop implements Serializable { | |||
| @io.swagger.annotations.ApiModelProperty(value="管理人电话",name="managerPhone") | |||
| private String managerPhone; | |||
| @io.swagger.annotations.ApiModelProperty(value = "类型", name = "type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value = "点位类型", name = "pointType") | |||
| private Integer pointType; | |||
| @io.swagger.annotations.ApiModelProperty(value = "备注", name = "comments") | |||
| private String comments; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| @@ -243,6 +252,30 @@ public class WxShop implements Serializable { | |||
| this.managerPhone = managerPhone; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer type) { | |||
| this.type = type; | |||
| } | |||
| public Integer getPointType() { | |||
| return pointType; | |||
| } | |||
| public void setPointType(Integer pointType) { | |||
| this.pointType = pointType; | |||
| } | |||
| public String getComments() { | |||
| return comments; | |||
| } | |||
| public void setComments(String comments) { | |||
| this.comments = comments; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| @@ -50,6 +50,9 @@ public class WxBillAll { | |||
| @io.swagger.annotations.ApiModelProperty(value="id",name="id") | |||
| private Long id; | |||
| @io.swagger.annotations.ApiModelProperty(value = "租赁店铺类型", name = "rentShopType") | |||
| private Integer rentShopType; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| @@ -161,4 +164,12 @@ public class WxBillAll { | |||
| public void setMonth(String month) { | |||
| this.month = month; | |||
| } | |||
| public Integer getRentShopType() { | |||
| return rentShopType; | |||
| } | |||
| public void setRentShopType(Integer rentShopType) { | |||
| this.rentShopType = rentShopType; | |||
| } | |||
| } | |||
| @@ -0,0 +1,70 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.WxCouponSend; | |||
| import com.iformall.domain.po.WxLevelConfig; | |||
| import com.iformall.domain.po.WxTags; | |||
| import com.iformall.domain.po.WxTagsType; | |||
| import javax.persistence.Transient; | |||
| import java.io.Serializable; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| public class WxCouponSendVo extends WxCouponSend implements Serializable{ | |||
| /*有效日期-开始**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-开始",name="validStartDate") | |||
| private Date validStartDate; | |||
| /*有效日期-结束**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="有效日期-结束",name="validEndDate") | |||
| private Date validEndDate; | |||
| /*剩余库存**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="剩余库存",name="remainInventory") | |||
| private Integer remainInventory; | |||
| /*总库存**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="总库存",name="inventory") | |||
| private Integer inventory; | |||
| /*发卷所属商户名**/ | |||
| private String merchantName; | |||
| public Date getValidStartDate() { | |||
| return validStartDate; | |||
| } | |||
| public void setValidStartDate(Date validStartDate) { | |||
| this.validStartDate = validStartDate; | |||
| } | |||
| public Date getValidEndDate() { | |||
| return validEndDate; | |||
| } | |||
| public void setValidEndDate(Date validEndDate) { | |||
| this.validEndDate = validEndDate; | |||
| } | |||
| public Integer getRemainInventory() { | |||
| return remainInventory; | |||
| } | |||
| public void setRemainInventory(Integer remainInventory) { | |||
| this.remainInventory = remainInventory; | |||
| } | |||
| public Integer getInventory() { | |||
| return inventory; | |||
| } | |||
| public void setInventory(Integer inventory) { | |||
| this.inventory = inventory; | |||
| } | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| public void setMerchantName(String merchantName) { | |||
| this.merchantName = merchantName; | |||
| } | |||
| } | |||
| @@ -0,0 +1,73 @@ | |||
| package com.iformall.domain.vo; | |||
| import javax.persistence.Id; | |||
| public class WxLevelMerchantCVo { | |||
| private static final long serialVersionUID = 6687964942922444531L; | |||
| @Id | |||
| protected Long id; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| /**商户名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户名",name="name") | |||
| private String merchantName; | |||
| /**联系方式**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户联系方式",name="linkPhone") | |||
| private String merchantLinkPhone; | |||
| @io.swagger.annotations.ApiModelProperty(value="商铺编号",name="shopNumber") | |||
| private String shopNumber; | |||
| /**楼座号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼座",name="buildingName") | |||
| private String buildingName; | |||
| /**楼层号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName") | |||
| private String floorName; | |||
| /**折扣**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="折扣",name="discount") | |||
| private Integer discount; | |||
| public String getBuildingName() {return buildingName; } | |||
| public void setBuildingName(String _building) { | |||
| buildingName = _building; | |||
| } | |||
| public String getFloorName() { | |||
| return floorName; | |||
| } | |||
| public void setFloorName(String _floor) { | |||
| floorName = _floor; | |||
| } | |||
| public String getShopNumber() { | |||
| return shopNumber; | |||
| } | |||
| public void setShopNumber(String _shopNumber) { | |||
| shopNumber = _shopNumber; | |||
| } | |||
| public String getMerchantName() { | |||
| return merchantName; | |||
| } | |||
| public void setMerchantName(String _name) { | |||
| merchantName = _name; | |||
| } | |||
| public String getMerchantLinkPhone() { | |||
| return merchantLinkPhone; | |||
| } | |||
| public void setMerchantLinkPhone(String _linkPhone) { | |||
| merchantLinkPhone = _linkPhone; | |||
| } | |||
| public Integer getDiscount() { | |||
| return discount; | |||
| } | |||
| public void setDiscount(Integer discount) { | |||
| this.discount = discount; | |||
| } | |||
| } | |||
| @@ -52,15 +52,6 @@ public class WxMerchantVo { | |||
| @io.swagger.annotations.ApiModelProperty(value="楼层",name="floorName") | |||
| private String floorName; | |||
| @io.swagger.annotations.ApiModelProperty(value="VIP折扣率1",name="vipDiscountRate1") | |||
| private Integer vipDiscountRate1; | |||
| @io.swagger.annotations.ApiModelProperty(value="VIP折扣率2",name="vipDiscountRate2") | |||
| private Integer vipDiscountRate2; | |||
| @io.swagger.annotations.ApiModelProperty(value="VIP折扣率3",name="vipDiscountRate3") | |||
| private Integer vipDiscountRate3; | |||
| public String getBuildingName() {return buildingName; } | |||
| public void setBuildingName(String _building) { | |||
| @@ -134,29 +125,4 @@ public class WxMerchantVo { | |||
| } | |||
| public Integer getVipDiscountRate1() { | |||
| return vipDiscountRate1; | |||
| } | |||
| public void setVipDiscountRate1(Integer vipDiscountRate1) { | |||
| this.vipDiscountRate1 = vipDiscountRate1; | |||
| } | |||
| public Integer getVipDiscountRate2() { | |||
| return vipDiscountRate2; | |||
| } | |||
| public void setVipDiscountRate2(Integer vipDiscountRate2) { | |||
| this.vipDiscountRate2 = vipDiscountRate2; | |||
| } | |||
| public Integer getVipDiscountRate3() { | |||
| return vipDiscountRate3; | |||
| } | |||
| public void setVipDiscountRate3(Integer vipDiscountRate3) { | |||
| this.vipDiscountRate3 = vipDiscountRate3; | |||
| } | |||
| } | |||
| @@ -0,0 +1,175 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.fasterxml.jackson.annotation.JsonIgnoreProperties; | |||
| import com.iformall.domain.po.WxOrder; | |||
| import com.iformall.domain.po.WxOrderPress; | |||
| import java.util.List; | |||
| @JsonIgnoreProperties(value = {"handler"}) | |||
| public class WxOrderCouponPressVo extends WxOrder { | |||
| /** 券ID-产品ID将来的产品都会放在coupon表里**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券包中券ID",name="couponOrderId") | |||
| private Long couponOrderId; | |||
| /** 0: 未使用 1: 已核销 2:已过期 3:已退款**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="0: 未使用 1: 已核销 2:已过期 3:已退款",name="couponOrderStatus") | |||
| private Integer couponOrderStatus; | |||
| /**券类型信息 */ | |||
| /**商户id**/ | |||
| /**券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)",name="couponType") | |||
| private Integer couponType; | |||
| /**封面图**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| private String coverImg; | |||
| /**券名称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券名称",name="title") | |||
| private String title; | |||
| /**副标题**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="副标题",name="subTitle") | |||
| private String subTitle; | |||
| /**售价(适用于类型2,3,4,5)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="售价(适用于类型2,3,4,5)",name="salePrice") | |||
| private Integer salePrice; | |||
| /**使用条件金额(适用于类型1,2,3,4)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="使用条件金额(适用于类型1,2,3,4)",name="usePrice") | |||
| private Integer usePrice; | |||
| /**面额**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="面额",name="price") | |||
| private Integer price; | |||
| /**单位**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="单位0:钱分,1:小时",name="unit") | |||
| private Integer unit; | |||
| /**须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="须知",name="detail") | |||
| private String detail; | |||
| /**购买须知**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="购买须知",name="remark") | |||
| private String remark; | |||
| /**砍价/团购限制人数**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="砍价/团购限制人数",name="pressLimitNum") | |||
| private Integer pressLimitNum; | |||
| /**砍价信息列表*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户列表",name="orderPressList") | |||
| private List<WxOrderPressVo> orderPressList; | |||
| public Long getCouponOrderId() { | |||
| return couponOrderId; | |||
| } | |||
| public void setCouponOrderId(Long couponOrderId) { | |||
| this.couponOrderId = couponOrderId; | |||
| } | |||
| public Integer getCouponOrderStatus() { | |||
| return couponOrderStatus; | |||
| } | |||
| public void setCouponOrderStatus(Integer couponOrderStatus) { | |||
| this.couponOrderStatus = couponOrderStatus; | |||
| } | |||
| public Integer getCouponType() { | |||
| return couponType; | |||
| } | |||
| public void setCouponType(Integer couponType) { | |||
| this.couponType = couponType; | |||
| } | |||
| public String getCoverImg() { | |||
| return coverImg; | |||
| } | |||
| public void setCoverImg(String coverImg) { | |||
| this.coverImg = coverImg; | |||
| } | |||
| public String getTitle() { | |||
| return title; | |||
| } | |||
| public void setTitle(String title) { | |||
| this.title = title; | |||
| } | |||
| public String getSubTitle() { | |||
| return subTitle; | |||
| } | |||
| public void setSubTitle(String subTitle) { | |||
| this.subTitle = subTitle; | |||
| } | |||
| public Integer getSalePrice() { | |||
| return salePrice; | |||
| } | |||
| public void setSalePrice(Integer salePrice) { | |||
| this.salePrice = salePrice; | |||
| } | |||
| public Integer getUsePrice() { | |||
| return usePrice; | |||
| } | |||
| public void setUsePrice(Integer usePrice) { | |||
| this.usePrice = usePrice; | |||
| } | |||
| public Integer getPrice() { | |||
| return price; | |||
| } | |||
| public void setPrice(Integer price) { | |||
| this.price = price; | |||
| } | |||
| public Integer getUnit() { | |||
| return unit; | |||
| } | |||
| public void setUnit(Integer unit) { | |||
| this.unit = unit; | |||
| } | |||
| @Override | |||
| public String getDetail() { | |||
| return detail; | |||
| } | |||
| @Override | |||
| public void setDetail(String detail) { | |||
| this.detail = detail; | |||
| } | |||
| public String getRemark() { | |||
| return remark; | |||
| } | |||
| public void setRemark(String remark) { | |||
| this.remark = remark; | |||
| } | |||
| public Integer getPressLimitNum() { | |||
| return pressLimitNum; | |||
| } | |||
| public void setPressLimitNum(Integer pressLimitNum) { | |||
| this.pressLimitNum = pressLimitNum; | |||
| } | |||
| public List<WxOrderPressVo> getOrderPressList() { | |||
| return orderPressList; | |||
| } | |||
| public void setOrderPressList(List<WxOrderPressVo> orderPressList) { | |||
| this.orderPressList = orderPressList; | |||
| } | |||
| } | |||
| @@ -37,6 +37,9 @@ public class WxOrderCouponVo { | |||
| private Long cUserId; | |||
| /*商户ID**/ | |||
| /**渠道ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="渠道ID",name="couponChannelId") | |||
| private Long couponChannelId; | |||
| /*产品ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="产品ID",name="productId") | |||
| private Long productId; | |||
| @@ -69,8 +72,8 @@ public class WxOrderCouponVo { | |||
| /* 券类型信息 */ | |||
| /*商户id**/ | |||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券)",name="type") | |||
| /*券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="券类型(1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.多商户券,8.砍价券,9.团购券,100.消费卡)",name="type") | |||
| private Integer type; | |||
| /*封面图**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="封面图",name="coverImg") | |||
| @@ -127,7 +130,15 @@ public class WxOrderCouponVo { | |||
| cUserId = _cUserId; | |||
| } | |||
| public Long getProductId() { | |||
| public Long getCouponChannelId() { | |||
| return couponChannelId; | |||
| } | |||
| public void setCouponChannelId(Long couponChannelId) { | |||
| this.couponChannelId = couponChannelId; | |||
| } | |||
| public Long getProductId() { | |||
| return productId; | |||
| } | |||
| public void setProductId(Long _productId) { | |||
| @@ -0,0 +1,18 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.WxOrderPress; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxOrderPressVo extends WxOrderPress { | |||
| /**用户昵称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户昵称",name="nickName") | |||
| private String nickName; | |||
| /**用户头像地址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户头像地址",name="avatarUrl") | |||
| private String avatarUrl; | |||
| } | |||
| @@ -10,6 +10,7 @@ public enum EnumBillRentStatus { | |||
| WAIT_PAY(2,"待缴"), | |||
| PAID(3, "已结清"), | |||
| NOT_EXPIRED(4,"未到期"), | |||
| RETURN(5, "已退还"), | |||
| ; | |||
| public static EnumBillRentStatus getEnum(Integer code) { | |||
| @@ -9,7 +9,8 @@ public enum EnumCouponChannelType { | |||
| COUPON_CHANNEL_ID_TIMED(2, "限时抢购"), | |||
| COUPON_CHANNEL_ID_CAMPAIN(3, "幻灯片"), // banner图, 宣传页,轮播图,走马灯 | |||
| COUPON_CHANNEL_ID_GAME(4, "游戏"), | |||
| COUPON_CHANNEL_ID_CARD(5, "卡频道") | |||
| COUPON_CHANNEL_ID_CARD(5, "卡频道"), | |||
| COUPON_CHANNEL_ID_PRESS(6, "砍价频道") | |||
| ; | |||
| public static EnumCouponChannelType getEnum(Integer code) { | |||
| @@ -12,7 +12,8 @@ public enum EnumCouponSendSendType { | |||
| CAR_STOP(2, "停车发券"), | |||
| COUPON_VERIFY(3, "核销发券"), | |||
| B_MICROPAY(4, "B端刷卡发券"), | |||
| C_ORDER(5, "购买发券") | |||
| C_ORDER(5, "购买发券"), | |||
| TIMED(6, "定时发券"), | |||
| ; | |||
| public static EnumCouponSendSendType getEnum(Integer code) { | |||
| @@ -5,14 +5,18 @@ package com.iformall.enums; | |||
| */ | |||
| public enum EnumCouponType { | |||
| // 1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.通用券,7.消费卡 | |||
| // 1.满减券,2.代金券,3.团购券,4.礼品券,5.停车券,6.通用券, 8.砍价券 | |||
| // 100.消费卡 | |||
| COUPON_MANJIAN(1, "满减券"), | |||
| COUPON_DAIJIN(2, "代金券"), | |||
| COUPON_TUANGOU(3, "团购券"), | |||
| COUPON_LIPIN(4, "礼品券"), | |||
| COUPON_TINGCHE(5, "停车券"), | |||
| COUPON_MULTIMCH(6, "通用券"), | |||
| CARD_MULTIMCH(7, "消费卡"), | |||
| COUPON_PRESS(8, "砍价券"), | |||
| // COUPON_GROUP(9, "团购券"), | |||
| CARD_MULTIMCH(100, "消费卡"), | |||
| ; | |||
| public static EnumCouponType getEnum(Integer code) { | |||
| @@ -0,0 +1,37 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by luozukai | |||
| * 流程key | |||
| */ | |||
| public enum EnumFlowKey { | |||
| CONTRACT("contract_flow", "合同审批流程key"), | |||
| BILL("bill_flow", "账单审批流程key") | |||
| ; | |||
| public static EnumFlowKey getEnum(Integer code) { | |||
| for (EnumFlowKey value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private String code; | |||
| private String message; | |||
| EnumFlowKey(String code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public String getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by luozukai | |||
| */ | |||
| public enum EnumFlowPermissionType { | |||
| // 0无权限 1合同审批 2账单审批 | |||
| DEFAULT(0, "无权限"), | |||
| CONTRACT(1, "合同审批权限"), | |||
| BILL(2, "账单审批权限") | |||
| ; | |||
| public static EnumFlowPermissionType getEnum(Integer code) { | |||
| for (EnumFlowPermissionType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumFlowPermissionType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,40 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by luozukai | |||
| */ | |||
| public enum EnumFlowRecordStatus { | |||
| // 1发起申请2审批通过3审批驳回 | |||
| NEW(1, "发起申请"), | |||
| APPLY(2, "审批通过"), | |||
| REJECT(3, "审批驳回"), | |||
| ASSIGNEE(4, "待审批"), | |||
| CANCLE(5, "合同作废") | |||
| ; | |||
| public static EnumFlowRecordStatus getEnum(Integer code) { | |||
| for (EnumFlowRecordStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumFlowRecordStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -3,16 +3,14 @@ package com.iformall.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumWxAuthorizationStatus { | |||
| public enum EnumLevelConfigDiscountStatus { | |||
| // 0-authorized, 1-unauthorized | |||
| AUTHORIZED(0, "authorized"), | |||
| UNAUTHORIZED(1, "unauthorized") | |||
| DISABLE(0, "停用"), | |||
| ENABLE(1, "启用"), | |||
| ; | |||
| public static EnumWxAuthorizationStatus getEnum(Integer code) { | |||
| for (EnumWxAuthorizationStatus value : values()) { | |||
| public static EnumLevelConfigDiscountStatus getEnum(Integer code) { | |||
| for (EnumLevelConfigDiscountStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| @@ -23,7 +21,7 @@ public enum EnumWxAuthorizationStatus { | |||
| private Integer code; | |||
| private String message; | |||
| EnumWxAuthorizationStatus(Integer code, String message) { | |||
| EnumLevelConfigDiscountStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| @@ -0,0 +1,37 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by luozukai | |||
| * 消息模板类型 1登录 2工作流通知 | |||
| */ | |||
| public enum EnumMsgModelType { | |||
| LOGIN(1, "登录"), | |||
| FLOW(2, "工作流通知") | |||
| ; | |||
| public static EnumMsgModelType getEnum(Integer code) { | |||
| for (EnumMsgModelType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumMsgModelType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,39 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public enum EnumOrderPressStatus { | |||
| FIRST(1,"我发起的砍价"), | |||
| NOT_JOIN(2,"未参与的砍价"), | |||
| HAD_JOIN(3, "已参与的砍价") | |||
| ; | |||
| public static EnumOrderPressStatus getEnum(Integer code) { | |||
| for (EnumOrderPressStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumOrderPressStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * @author gongbiao | |||
| */ | |||
| public enum EnumOrderPressType { | |||
| FIRST(1,"首次砍价/发起砍价"), | |||
| NORMAL(0,"非首次砍价") | |||
| ; | |||
| public static EnumOrderPressType getEnum(Integer code) { | |||
| for (EnumOrderPressType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumOrderPressType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -12,7 +12,11 @@ public enum EnumOrderStatus { | |||
| ORDER_STATUS_OVERTIME_CANCEL(2, "已取消"), | |||
| ORDER_STATUS_PENDING_REFUND(3, "待退款"), | |||
| ORDER_STATUS_REFUND_SUCCESS(4,"已退款"), | |||
| ORDER_STATUS_REFUND_FAILD(5, "退款失败") | |||
| ORDER_STATUS_REFUND_FAILD(5, "退款失败"), | |||
| ORDER_STATUS_PRESSING(6, "砍价中"), | |||
| ORDER_STATUS_PRESS_COMPLETE(7, "砍价完成"), | |||
| ORDER_STATUS_PRESS_OVERTIME(8, "砍价已过期"), | |||
| ORDER_STATUS_PRESS_CANCEL(9, "砍价已取消") | |||
| ; | |||
| public static EnumOrderStatus getEnum(Integer code) { | |||