| @@ -0,0 +1,31 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | |||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
| <parent> | |||
| <artifactId>mallink</artifactId> | |||
| <groupId>com.iformall</groupId> | |||
| <version>1.0</version> | |||
| </parent> | |||
| <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> | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.common; | |||
| import tk.mybatis.mapper.common.BaseMapper; | |||
| import tk.mybatis.mapper.common.IdsMapper; | |||
| import tk.mybatis.mapper.common.Marker; | |||
| import tk.mybatis.mapper.common.special.InsertListMapper; | |||
| import java.io.Serializable; | |||
| /** | |||
| * @author chenkx | |||
| * @date 2017-12-27 | |||
| */ | |||
| public interface CommonMapper<T, ID extends Serializable> extends BaseMapper<T>, IdsMapper<T>, InsertListMapper<T>, Marker { | |||
| } | |||
| @@ -0,0 +1,403 @@ | |||
| package com.iformall.common; | |||
| import java.text.MessageFormat; | |||
| /** | |||
| * @author chenkx | |||
| * @date 2017-12-28. | |||
| */ | |||
| public enum ErrorCode{ | |||
| /** | |||
| * 系统级别 | |||
| * 1000-1999 | |||
| */ | |||
| SYS_SERVER_ERROR(1000, "服务器请求异常"), | |||
| SYS_PARAMETER_ERROR(1001, "参数不合法"), | |||
| SYS_PARAMETER_NOT_NULL(1002, "参数不能为空"), | |||
| SYS_PARAMETER_TYPE_ERROR(1003, "参数类型异常"), | |||
| SYS_PARAMETER_CAST_ERROR(1004, "参数转换异常"), | |||
| SYS_PARAMETER_EMPTY_ERROR(1005, "参数转换异常"), | |||
| SYS_BEAN_EMPTY_PROPERTY_ERROR(1006, "实体转换异常"), | |||
| SYS_MEDIATYPE_NOT_SUPPORT(1007, "不支持的媒体类型"), | |||
| SYS_NULLPOINTER_ERROR(1008, "空指针异常"), | |||
| SYS_METHOD_NOT_SUPPORT(1009, "不支持的请求类型"), | |||
| SYS_CLASSCAST_ERROR(1010, "类型转换异常"), | |||
| SYS_NUMBER_FORMAT_ERROR(1011, "数字转化异常"), | |||
| SYS_EXTEND_JSON_ERROR(1012, "JSON格式异常"), | |||
| SYS_REPEAT_SUBMIT_EXCEPTION(1013, "请勿重复操作"), | |||
| /** | |||
| * 数据库 | |||
| */ | |||
| DB_FAIL(1045, "数据库访问出错"), | |||
| /** | |||
| * 网络 | |||
| */ | |||
| TOO_MANY_REQUEST(1050, "太多的请求访问"), | |||
| LOGIN_DENIED(1051, "登录失败"), | |||
| NET_TOKEN_INVALID(1052, "TOKEN无效"), | |||
| NET_TOKEN_EMPTY(1053, "TOKEN不能为空"), | |||
| /** | |||
| * 业务级别 | |||
| */ | |||
| /** | |||
| * 用户2000-2099 | |||
| */ | |||
| USER_PASSWD_ERR(1987, "用户名或者密码错误"), | |||
| USER_IS_MULTI(1988, "有多个手机号,请联系富茂管理员"), | |||
| USER_IS_NOT_MEMBER(1989,"用户还未授权手机号成为会员"), | |||
| USER_PHONE_IS_NOT_FOUND(1990,"手机号不存在"), | |||
| USER_DEL_SELF(1991,"用户删除自己"), | |||
| USER_NOT_ADMIN(1992,"用户非超管"), | |||
| USER_NO_PERMISSION(1993,"用户无此权限"), | |||
| USER_USE_ROLE(1994,"用户使用此角色"), | |||
| USER_IS_EMPTY(2000, "用户不存在"), | |||
| PASSWORD_ERROR(2001, "密码错误"), | |||
| USER_IS_LOCKED(2003, "用户已经被禁用不能登录,请与管理员联系"), | |||
| NEW_USER_FAILD(2004, "创建新用户失败"), | |||
| BUSER_NOT_IN_APP(2005, "用户不是此app用户"), | |||
| KAPCHA_NOT_VALID(2006, "验证码已失效"), | |||
| KAPCHA_NOT_EQUAL(2007, "验证码不正确"), | |||
| USER_NAME_IS_FOUND(2008,"用户名已存在"), | |||
| USER_PHONE_IS_FOUND(2009,"手机号已存在"), | |||
| /** | |||
| * 商场/商户 | |||
| */ | |||
| MALL_INFO_NOT_FOUND(2010, "商场信息没找到"), | |||
| MERCHANT_INFO_NOT_FOUND(2011, "商户信息没找到"), | |||
| MERCHANT_INFO_NOT_EQUAL(2012, "商户信息不对应"), | |||
| MERCHANT_INFO_NOT_VALID(2013, "商户信息禁用"), | |||
| /** | |||
| * 券 | |||
| */ | |||
| COUPON_IS_EMPTY(2020, "此券不存在"), | |||
| COUPON_IS_NOT_FREE(2021, "此券不免费"), | |||
| COUPON_IS_TAKE_OFF(2022, "此券已作废"), | |||
| COUPON_IS_EXPIRED(2023, "此券已过期"), | |||
| COUPON_IS_SELL_OUT(2024, "此券已售罄"), | |||
| COUPON_TYPE_IS_NOT_ACTIVE(2025, "此券不能用于主动领取"), | |||
| COUPON_TYPE_IS_NOT_PASSIVE(2026, "此券不能用于定向投放"), | |||
| COUPON_CHANNEL_IS_EXISTED(2027, "此券已投放过"), | |||
| COUPON_SEND_IS_EXISTED(2028, "此券已经添加到该渠道"), | |||
| COUPON_SEND_IS_INVALID(2029, "此发券渠道不存在"), | |||
| COUPON_SEND_IS_INVALID_TIME(2030, "发放时间不能晚于使用时间"), | |||
| COUPON_CHANNEL_IS_TAKE_OFF(2031, "此券已下架"), | |||
| COUPON_MERCHANT_NOT_FOUND(2032, "卡券关联商户未发现"), | |||
| COUPON_CHANNEL_IS_NOT_STARTED(2033, "此券活动未开始"), | |||
| COUPON_CHANNEL_IS_END(2033, "此券活动已结束"), | |||
| PUSH_LIMIT_UP_TO_1DAYLIMIT(2040, "此用户一天内发券到达疲劳度限制"), | |||
| PUSH_LIMIT_UP_TO_COUPONLIMIT(2041, "此用户发此券到达疲劳度限制"), | |||
| PUSH_LIMIT_NOT_INRANG(2042, "不在疲劳度允许的时间段"), | |||
| /** | |||
| * 车流 2040 | |||
| */ | |||
| CAR_PARK_NOT_FOUND(2049, "车场未找到"), | |||
| CAR_VENDOR_NOT_SUPPORT(2050, "不支持的停车厂家"), | |||
| ETCP_LOGIN_FAIL(2051, "ETCP共同登录失败"), | |||
| ETCP_BIND_FAIL(2052, "ETCP绑车牌失败"), | |||
| ETCP_UNBIND_FAIL(2053, "ETCP解绑车牌失败"), | |||
| ETCP_STOP_FEE_FAIL(2054, "ETCP停车费失败"), | |||
| ETCP_QUAN_TEMP_FAIL(2055, "ETCP优免券模板失败"), | |||
| ETCP_QUAN_SEND_FAIL(2056, "ETCP优免券发放失败"), | |||
| ETCP_CMD_FAIL(2057, "ETCP网络异常"), | |||
| TJD_BIND_FAIL(2060,"TJD绑车牌失败"), | |||
| TJD_UNBIND_FAIL(2061,"TJD解绑车牌失败"), | |||
| TJD_STOP_FEE_FAIL(2062, "TJD停车费失败"), | |||
| TJD_DEDUCE_FEE_FAIL(2063, "TJD停车费抵扣失败"), | |||
| /** | |||
| * 游戏 | |||
| */ | |||
| GAME_NOT_FOUND(2070, "游戏未找到"), | |||
| GAME_HAS_BEEN_LIMITED(2071, "游戏次数以达到上限"), | |||
| /** | |||
| * 订单 | |||
| */ | |||
| REMAIN_IS_EMPTY(3000, "库存不足"), | |||
| ORDER_IS_LIMITED(3001, "购买超限"), | |||
| ORDER_IS_FAIL(3002, "订单失败"), | |||
| ORDER_IS_NOT_FIND(3003, "订单不存在"), | |||
| ORDER_IS_NOT_PAY(3004, "订单已不能进行支付"), | |||
| 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, "砍价已完成"), | |||
| /** | |||
| * 卡券 | |||
| */ | |||
| COUPON_ORDER_SAVE_ERR(3999, "卡券保存失败"), | |||
| COUPON_ORDER_IS_NULL(4000, "卡券不存在"), | |||
| COUPON_ORDER_IS_USED(4001, "卡券已核销"), | |||
| COUPON_ORDER_IS_OVER_TIME(4002, "卡券已过期"), | |||
| COUPON_ORDER_IS_INVALID(4003, "卡券已经作废"), | |||
| COUPON_ORDER_BUSER_IS_NULL(4004, "卡券B端用户不存在"), | |||
| COUPON_ORDER_MERANT_IS_NULL(4005, "卡券商户不存在"), | |||
| COUPON_ORDER_IS_EARLIER_THAN_VALIDDATE(4006, "卡券使用期还未开始"), | |||
| COUPON_ORDER_IS_LATER_THAN_VALIDDATE(4007, "卡券使用期已结束"), | |||
| /** | |||
| * 卡 | |||
| */ | |||
| CARD_IS_NOT_FOUND(9001, "优惠卡不存在"), | |||
| CARD_REMAIN_AMOUNT_IS_NOT_ENOUGH(9002, "优惠卡余额不足"), | |||
| CARD_IS_NOT_COST(9003, "优惠卡未消费,退款请用卡券退款,钱直接退回购买人手里"), | |||
| CARD_TRANSFERED(9004, "卡已被领取"), | |||
| CARD_TRANSFER_INVALID(9005, "卡转赠已失效"), | |||
| /** | |||
| * 卡消费 | |||
| */ | |||
| CARD_SPEND_IS_PAID(9050, "卡消费已支付"), | |||
| /** | |||
| * 砍价 | |||
| */ | |||
| COUPON_PRESS_HAD_FINISHED(9070, "砍价已完成"), | |||
| COUPON_PRESS_IS_OVERTIME(9071, "砍价已超时"), | |||
| COUPON_PRESS_IS_EXIST(9072, "此人已参与此次砍价"), | |||
| /** | |||
| * 微信 | |||
| */ | |||
| SESSION_KEY_DECODE_ERR(11001, "session_key/openId解密失败"), | |||
| NICK_NAME_DECODE_ERR(11002, "nickName,unionId解密失败"), | |||
| PHONE_DECODE_ERR(11003, "Phone解密失败"), | |||
| NICK_NAME_NOT_FOUND(11004, "nickName,unionId未授权"), | |||
| PHONE_NOT_FOUND(11005, "Phone未授权"), | |||
| PHONE_IS_ENCRYPTED(11006, "Phone已加密"), | |||
| TEMPLATE_SEND_FAILED(11007, "模板消息发送失败"), | |||
| WE_RUN_DATA_DECODE_ERR(11008, "运动信息解密失败"), | |||
| /** | |||
| * 支付 | |||
| */ | |||
| PAY_ORDER_REFUND(11994, "订单退款中"), | |||
| PAY_ORDER_PAYING(11995, "订单支付中"), | |||
| PAY_ORDER_NOT_PAY(11996, "订单未支付"), | |||
| PAY_ORDER_CLOSED(11997, "订单已关闭"), | |||
| PAY_ORDER_REVERSE(11998, "订单已撤销"), | |||
| PAY_ORDER_NOT_FOUND(12000, "支付订单不存在"), | |||
| PAY_ORDER_EXIST(12001, "支付订单已存在"), | |||
| PAY_ORDER_ERROR(12002, "支付订单异常"), | |||
| PAY_ORDER_NOTIFY_CHECK_SIGN_ERROR(12003 , "支付验签失败"), | |||
| PAY_ORDER_IS_ZERO(12004, "支付订单金额为0"), | |||
| PAY_ORDER_IS_NOT_PAYMENT(12005, "不是支付订单"), | |||
| PREPAY_ID_IS_EMPTY(12006, "prepay_id是空值"), | |||
| PAY_ORDER_QUERY_ERROR(12007, "支付订单查询异常"), | |||
| REFUND_ORDER_EXIST(12010, "退款订单已存在"), | |||
| REFUND_PAY_ORDER_IS_NOT_EXIST(12011, "退款支付订单不存在"), | |||
| REFUND_PAY_ORDER_IS_ZERO(12012, "退款支付订单金额为0"), | |||
| REFUND_ORDER_ERROR(12013, "退款订单异常"), | |||
| REFUND_ORDER_NOTIFY_CHECK_SIGN_ERROR(12014, "退款验签失败"), | |||
| REFUND_ORDER_BUSER_IS_NULL(12015, "B端用户不存在"), | |||
| REFUND_ORDER_BUSER_NOT_EQUAL(12016, "B端用户无操作权限"), | |||
| APP_ID_NOT_FOUND(12020, "APPID没找到"), | |||
| MCH_INFO_NOT_FOUND(12021, "微信商户平台信息没找到"), | |||
| MCH_INFO_NOT_EQUAL(12022, "微信商户平台信息不对应"), | |||
| API_KEY_NOT_FOUND(12023, "支付密钥未配置"), | |||
| CERT_PATH_NOT_FOUND(12024, "双向证书未配置"), | |||
| PROFIT_SHARING_REQUEST_FAILED(12030, "分账请求失败"), | |||
| PROFIT_SHARING_APPLY_FAILED(12031, "分账业务失败"), | |||
| PROFIT_SHARING_RETURN_INVALID(12032, "分账请求返回校验失败"), | |||
| PROFIT_SHARING_RECEIVER_INVALID(12033, "分账接受方查寻无效"), | |||
| PROFIT_SHARING_QUERY_REQUEST_FAILED(12034, "分账查询请求失败"), | |||
| PROFIT_SHARING_QUERY_APPLY_FAILED(12035, "分账查询业务失败"), | |||
| PROFIT_SHARING_QUERY_RETURN_INVALID(12036, "分账查询返回校验失败"), | |||
| PROFIT_SHARING_RECEIVER_ADD_FAILED(12037, "分账账户添加失败"), | |||
| PROFIT_SHARING_RECEIVER_DEL_FAILED(12038, "分账账户删除失败"), | |||
| PROFIT_SHARING_NUM_UP_LIMIT(12039, "分账次数超限"), | |||
| /** | |||
| * 核销 | |||
| */ | |||
| VERIFY_ERROR(12050, "核销异常"), | |||
| MSG_REPEAT_SEND(12061, "短信重新发送"), | |||
| /** | |||
| * 解单 | |||
| */ | |||
| DALIY_REPORT_VOLUME_TODAY_NULL(12070, "今日解单不存在"), | |||
| DALIY_REPORT_VOLUME_WEEK_NULL(12071, "无解单数据"), | |||
| /** | |||
| * 模板消息 | |||
| */ | |||
| TEMPLATE_NOT_FOUND(12090, "模板不存在"), | |||
| /** | |||
| * | |||
| * 短信 | |||
| * | |||
| * */ | |||
| MSG_SERVER_NOT_FIND(12100,"您还未接入短信运营商,请联系平台管理员"), | |||
| MSG_TEMPLATE_REPEAT(12101,"您添加的短信模板已存在"), | |||
| MSG_SIGNATURE_CONTENT_ERROR(12102,"短信签名或内容错误"), | |||
| MSG_TEMPLATE_CREATE_ERROR(12103,"创建模板失败"), | |||
| MSG_VERIFY_CODE_NOT_FOUND(12104,"短信验证码不存在或失效"), | |||
| MSG_TEMPLATE_NOT_FOUND(12105,"短信模板不存在"), | |||
| MSG_REQUEST_PARAMS_ERROR(12106,"参数错误"), | |||
| MSG_SEND_ERROR(12107,"发送短信失败"), | |||
| MSG_METHOD_REQUEST_ERROR(12108,"接口请求错误"), | |||
| MSG_PHONE_NOT_FOUND(12109,"请输入手机号"), | |||
| MSG_SEND_WAY_CHOOSE_ERROR(12110,"请确定发送的方式"), | |||
| MSG_SUM_ZERO(12111,"短信数量为0"), | |||
| MSG_SUM_INSUFFICENT(12112,"短信数量不足"), | |||
| MSG_NO_VALID_PHONE(12113,"没有可以发送的手机号"), | |||
| MSG_SEND_INTERFACE_ERROR(12114,"短信运营商返回错误"), | |||
| /** | |||
| * 会员 | |||
| */ | |||
| MEM_IMPORT_ERR(13000, "模板导入失败,请检查数据,尝试重新导入"), | |||
| MEM_SCORE_NOT_ENOUGH(13001, "成长值不够扣减值"), | |||
| /** | |||
| * 标签 | |||
| */ | |||
| TAGS_MATCHED_NULL(14000, "此标签没命中用户"), | |||
| /** | |||
| * 租赁合同 | |||
| * */ | |||
| RENT_CONTRACT_IS_NOT_FOUND(15000,"租赁合同不存在"), | |||
| RENT_CONTRACT_IS_TERMINATED(15001,"租赁合同已终止"), | |||
| RENT_CONTRACT_WITH_SHOP_IS_FOUND(15002,"店铺存在已关联的合同"), | |||
| /** | |||
| * 物业合同 | |||
| * */ | |||
| PROPERTY_CONTRACT_IS_NOT_FOUND(16000,"物业合同不存在"), | |||
| /** | |||
| * 租赁账单 | |||
| * */ | |||
| BILL_RENT_IS_NOT_FOUND(17000,"租赁账单不存在"), | |||
| /** | |||
| * 租赁押金账单 | |||
| * */ | |||
| BILL_RENT_DEPOSIT_IS_NOT_FOUND(18000,"租赁押金账单不存在"), | |||
| /** | |||
| * 物业账单 | |||
| * */ | |||
| BILL_PROPERTY_IS_NOT_FOUND(19000,"物业账单不存在"), | |||
| /** | |||
| * 押金账单 | |||
| * */ | |||
| BILL_PROPERTY_DEPOSIT_IS_NOT_FOUND(20000,"物业押金账单不存在"), | |||
| BILL_OTHER_DEPOSIT_IS_NOT_FOUND(200001, "其他押金账单不存在"), | |||
| /** | |||
| * 日常费用账单 | |||
| * */ | |||
| BILL_ROUTINE_IS_NOT_FOUND(21000,"账单不存在"), | |||
| BILL_UPDATE_FAILED(21001,"账单更新失败"), | |||
| BILL_OWE_ZERO(21002,"账单欠缴为0"), | |||
| BILL_PAY_ERROR(21003,"账单支付错误"), | |||
| /** | |||
| * 商铺 | |||
| * */ | |||
| SHOP_IS_NOT_FOUND(22000,"商铺不存在"), | |||
| SHOP_IS_RENT(22001,"商铺已出租"), | |||
| WIWIDE_INFO_NOT_FOUND(23001,"迈外迪信息未找到"), | |||
| WIWIDE_INFO_NOT_READY(23002,"迈外迪信息未就绪"), | |||
| /** | |||
| * 审批流 | |||
| */ | |||
| FLOW_FAIL(24000, "审批流操作出错"), | |||
| FLOW_INST_NOT_EXIST(24001, "任务不存在"), | |||
| /** | |||
| * 微信第三方 | |||
| */ | |||
| WEAPP_APPID_NOT_AUTH(24100, "appid未授权"), | |||
| WEAPP_BASIC_SET_ERR(24101, "基础配置错误"), | |||
| WEAPP_BASIC_SET_DOMAIN_ERR(24102, "基础服务器域名配置错误"), | |||
| WEAPP_EXT_SET_ERR(24103, "扩展配置错误"), | |||
| WEAPP_CODE_COMMIT_ERR(24104, "code提交失败"), | |||
| WEAPP_AUDIT_ERR(24105, "提交审核失败"), | |||
| WEAPP_HAD_AUDITING(24106, "已有审核中"), | |||
| WEAPP_NOT_AUDITED(24107, "审核未通过"), | |||
| WEAPP_APP_RELEASEED(24108, "已发布"), | |||
| WECHAT_LOGIN_KEY_OVERTIME(24130, "已过期"), | |||
| WECHAT_LOGIN_USER_SELECT(24131, "请选择要登录的用户"), | |||
| WECHAT_LOGIN_NOT_BIND(24132, "您的微信号未绑定,请登录后绑定"), | |||
| /** | |||
| * 屏广告 | |||
| */ | |||
| SCREENAD_NOT_FOUND(25000, "屏广告未找到"), | |||
| /** | |||
| * IOT设备 | |||
| */ | |||
| DEVICE_NOT_FOUND(26000, "设备未找到"), | |||
| DEVICE_ALREADY_EXIST(26001, "设备已经存在"), | |||
| DEVICE_QRCODE_GET_FAILED(26002, "微信二维码生成失败,请重试"), | |||
| /** | |||
| * 消息组件 | |||
| */ | |||
| MSG_MODEL_NOT_FOUND(27000, "找不到短信模板"), | |||
| MSG_CONFIG_NOT_FOUND(27001, "找不到短信配置"), | |||
| ; | |||
| private int code; | |||
| private String message; | |||
| ErrorCode(int code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public int getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage(Object... param) { | |||
| if (param.length == 0) { | |||
| return message; | |||
| } | |||
| return MessageFormat.format(message, param); | |||
| } | |||
| public static ErrorCode getByCode(int code) { | |||
| ErrorCode[] values = ErrorCode.values(); | |||
| for (ErrorCode value : values) { | |||
| if (value.getCode() == code) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| } | |||
| @@ -0,0 +1,106 @@ | |||
| package com.iformall.common; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.service.MailService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.web.bind.annotation.ControllerAdvice; | |||
| import org.springframework.web.bind.annotation.ExceptionHandler; | |||
| import org.springframework.web.bind.annotation.ResponseBody; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import java.io.PrintWriter; | |||
| import java.io.StringWriter; | |||
| import java.text.SimpleDateFormat; | |||
| import java.util.Date; | |||
| import java.util.Enumeration; | |||
| @ControllerAdvice | |||
| public class GlobalDefultExceptionHandler { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private boolean isFmException; | |||
| @Autowired | |||
| private MailService mailService; | |||
| @ExceptionHandler(Exception.class) | |||
| @ResponseBody | |||
| public ResultData defultExcepitonHandler(HttpServletRequest request, Exception e) { | |||
| log(e, request); | |||
| if(isFmException) { | |||
| // 处理异常,发送邮件 | |||
| if(checkExceptionType(e)) { | |||
| // 某些异常不发邮件 | |||
| MallinkException me = (MallinkException)e; | |||
| return new ResultData(me.getErrorCode(),me.getMessage()); | |||
| } | |||
| StringWriter sw = new StringWriter(); | |||
| PrintWriter pw = new PrintWriter(sw); | |||
| e.printStackTrace(pw); | |||
| SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");//设置日期格式 | |||
| StringBuilder sb = new StringBuilder(); | |||
| sb.append(df.format(new Date())); | |||
| sb.append("\n"); | |||
| sb.append(sw.toString()); | |||
| String[] receivers = new String[] {"hupeng@iformall.com", "wuguoqiang@iformall.com", "gongbiao@iformall.com", "luozukai@iformall.com"}; | |||
| //发送邮件 | |||
| mailService.sendSimpleMail(receivers, "请求地址:" + request.getRequestURL() + "异常", sb.toString()); | |||
| } | |||
| if(checkExceptionType(e)) { | |||
| MallinkException me = (MallinkException)e; | |||
| return new ResultData(me.getErrorCode(),me.getMessage()); | |||
| }else { | |||
| return new ResultData(Result.ERROR, e.getMessage()); | |||
| } | |||
| } | |||
| private void log(Exception ex, HttpServletRequest request) { | |||
| logger.error("************************异常开始*******************************"); | |||
| if(checkExceptionType(ex)) { | |||
| // 特殊异常不打印堆栈 | |||
| logger.error(ex.getMessage()); | |||
| logger.error("************************异常结束*******************************"); | |||
| return; | |||
| } | |||
| logger.error("请求地址:" + request.getRequestURL()); | |||
| logger.error("message:"+ ex.getMessage()); | |||
| Enumeration enumeration = request.getParameterNames(); | |||
| logger.error("请求参数"); | |||
| while (enumeration.hasMoreElements()) { | |||
| String name = enumeration.nextElement().toString(); | |||
| logger.error(name + "---" + request.getParameter(name)); | |||
| } | |||
| StackTraceElement[] error = ex.getStackTrace(); | |||
| for (StackTraceElement stackTraceElement : error) { | |||
| logger.error(stackTraceElement.toString()); | |||
| } | |||
| logger.error("************************异常结束*******************************"); | |||
| } | |||
| private boolean checkExceptionType(Exception e) { | |||
| if(e instanceof MallinkException) { | |||
| MallinkException me = (MallinkException)e; | |||
| if(me.getErrorCode() == ErrorCode.NET_TOKEN_EMPTY.getCode() | |||
| || me.getErrorCode() == ErrorCode.NET_TOKEN_INVALID.getCode()) { | |||
| // token异常问题, 不发邮件 | |||
| return true; | |||
| } else if(me.getErrorCode() == ErrorCode.SYS_REPEAT_SUBMIT_EXCEPTION.getCode()) { | |||
| // 重复访问不打印异常消息 | |||
| return true; | |||
| } | |||
| } | |||
| return false; | |||
| } | |||
| } | |||
| @@ -0,0 +1,152 @@ | |||
| package com.iformall.common; | |||
| public class IdWorker { | |||
| // ==============================Fields=========================================== | |||
| /** 开始时间截 (2015-01-01) */ | |||
| private final long twepoch = 1489111610226L; | |||
| /** 机器id所占的位数 */ | |||
| private final long workerIdBits = 5L; | |||
| /** 数据标识id所占的位数 */ | |||
| private final long dataCenterIdBits = 5L; | |||
| /** 支持的最大机器id,结果是31 (这个移位算法可以很快的计算出几位二进制数所能表示的最大十进制数) */ | |||
| private final long maxWorkerId = -1L ^ (-1L << workerIdBits); | |||
| /** 支持的最大数据标识id,结果是31 */ | |||
| private final long maxDataCenterId = -1L ^ (-1L << dataCenterIdBits); | |||
| /** 序列在id中占的位数 */ | |||
| private final long sequenceBits = 12L; | |||
| /** 机器ID向左移12位 */ | |||
| private final long workerIdShift = sequenceBits; | |||
| /** 数据标识id向左移17位(12+5) */ | |||
| private final long dataCenterIdShift = sequenceBits + workerIdBits; | |||
| /** 时间截向左移22位(5+5+12) */ | |||
| private final long timestampLeftShift = sequenceBits + workerIdBits + dataCenterIdBits; | |||
| /** 生成序列的掩码,这里为4095 (0b111111111111=0xfff=4095) */ | |||
| private final long sequenceMask = -1L ^ (-1L << sequenceBits); | |||
| /** 工作机器ID(0~31) */ | |||
| private long workerId; | |||
| /** 数据中心ID(0~31) */ | |||
| private long dataCenterId; | |||
| /** 毫秒内序列(0~4095) */ | |||
| private long sequence = 0L; | |||
| /** 上次生成ID的时间截 */ | |||
| private long lastTimestamp = -1L; | |||
| ///////////////////////////////////////////////////////////////////////////////// | |||
| private static class IdGenHolder { | |||
| private static final IdWorker instance = new IdWorker(); | |||
| } | |||
| public static IdWorker get(){ | |||
| return IdGenHolder.instance; | |||
| } | |||
| public IdWorker() { | |||
| this(0L, 0L); | |||
| } | |||
| //==============================Constructors===================================== | |||
| /** | |||
| * 构造函数 | |||
| * @param workerId 工作ID (0~31) | |||
| * @param dataCenterId 数据中心ID (0~31) | |||
| */ | |||
| public IdWorker(long workerId, long dataCenterId) { | |||
| if (workerId > maxWorkerId || workerId < 0) { | |||
| throw new IllegalArgumentException(String.format("workerId can't be greater than %d or less than 0", maxWorkerId)); | |||
| } | |||
| if (dataCenterId > maxDataCenterId || dataCenterId < 0) { | |||
| throw new IllegalArgumentException(String.format("dataCenterId can't be greater than %d or less than 0", maxDataCenterId)); | |||
| } | |||
| this.workerId = workerId; | |||
| this.dataCenterId = dataCenterId; | |||
| } | |||
| // ==============================Methods========================================== | |||
| /** | |||
| * 获得下一个ID (该方法是线程安全的) | |||
| * @return SnowflakeId | |||
| */ | |||
| public synchronized long nextId() { | |||
| long timestamp = timeGen(); | |||
| //如果当前时间小于上一次ID生成的时间戳,说明系统时钟回退过这个时候应当抛出异常 | |||
| if (timestamp < lastTimestamp) { | |||
| throw new RuntimeException( | |||
| String.format("Clock moved backwards. Refusing to generate id for %d milliseconds", lastTimestamp - timestamp)); | |||
| } | |||
| //如果是同一时间生成的,则进行毫秒内序列 | |||
| if (lastTimestamp == timestamp) { | |||
| sequence = (sequence + 1) & sequenceMask; | |||
| //毫秒内序列溢出 | |||
| if (sequence == 0) { | |||
| //阻塞到下一个毫秒,获得新的时间戳 | |||
| timestamp = tilNextMillis(lastTimestamp); | |||
| } | |||
| } | |||
| //时间戳改变,毫秒内序列重置 | |||
| else { | |||
| sequence = 0L; | |||
| } | |||
| //上次生成ID的时间截 | |||
| lastTimestamp = timestamp; | |||
| //移位并通过或运算拼到一起组成64位的ID | |||
| return ((timestamp - twepoch) << timestampLeftShift) // | |||
| | (dataCenterId << dataCenterIdShift) // | |||
| | (workerId << workerIdShift) // | |||
| | sequence; | |||
| } | |||
| /** | |||
| * 阻塞到下一个毫秒,直到获得新的时间戳 | |||
| * @param lastTimestamp 上次生成ID的时间截 | |||
| * @return 当前时间戳 | |||
| */ | |||
| protected long tilNextMillis(long lastTimestamp) { | |||
| long timestamp = timeGen(); | |||
| while (timestamp <= lastTimestamp) { | |||
| timestamp = timeGen(); | |||
| } | |||
| return timestamp; | |||
| } | |||
| /** | |||
| * 返回以毫秒为单位的当前时间 | |||
| * @return 当前时间(毫秒) | |||
| */ | |||
| protected long timeGen() { | |||
| return System.currentTimeMillis(); | |||
| } | |||
| //==============================Test============================================= | |||
| /** 测试 */ | |||
| public static void main(String[] args) { | |||
| System.out.println(System.currentTimeMillis()); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| long startTime = System.nanoTime(); | |||
| for (int i = 0; i < 50000; i++) { | |||
| long id = idWorker.nextId(); | |||
| System.out.println(id); | |||
| System.out.println(String.valueOf(id)); | |||
| System.out.println(String.valueOf(id).length()); | |||
| } | |||
| System.out.println((System.nanoTime()-startTime)/1000000+"ms"); | |||
| } | |||
| } | |||
| @@ -0,0 +1,32 @@ | |||
| package com.iformall.common; | |||
| /** | |||
| * @author chenkx | |||
| * @date 2018-01-05. | |||
| */ | |||
| public class Result { | |||
| public int code; | |||
| public String message; | |||
| public static final int SUCCESS = 200; | |||
| public static final int ERROR = 500; | |||
| public static final int UNLOGIN = 701; | |||
| public Result() { | |||
| this.code = 200; | |||
| this.message = "success"; | |||
| } | |||
| public Result(int code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Result(ErrorCode errorCode) { | |||
| this.code = errorCode.getCode(); | |||
| this.message = errorCode.getMessage(); | |||
| } | |||
| } | |||
| @@ -0,0 +1,98 @@ | |||
| package com.iformall.common; | |||
| import java.beans.BeanInfo; | |||
| import java.beans.Introspector; | |||
| import java.beans.PropertyDescriptor; | |||
| import java.util.ArrayList; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| /** | |||
| * @author chenkx | |||
| * @date 2018-01-05. | |||
| */ | |||
| public class ResultData extends Result { | |||
| public Object data; | |||
| public ResultData() { | |||
| super(); | |||
| } | |||
| public ResultData(Object data) { | |||
| this(); | |||
| this.data = data; | |||
| } | |||
| public static ResultData returnResultObject(int code) { | |||
| String value = ErrorCode.getByCode(code).getMessage(); | |||
| return new ResultData(code, value); | |||
| } | |||
| public ResultData(Enum<?>[] ens) { | |||
| List<Map<String, Object>> list = new ArrayList<Map<String, Object>>(); | |||
| for (Enum<?> en : ens) { | |||
| Map<String, Object> map = enumToMap(en); | |||
| list.add(map); | |||
| } | |||
| data = list; | |||
| } | |||
| private Map<String, Object> enumToMap(Enum<?> en) { | |||
| Map<String, Object> map = new HashMap<>(); | |||
| try { | |||
| BeanInfo info = Introspector.getBeanInfo(en.getClass()); | |||
| PropertyDescriptor[] descriptors = info.getPropertyDescriptors(); | |||
| for (PropertyDescriptor property : descriptors) { | |||
| if (property.getPropertyType().getName().equals(Class.class.getName())) { | |||
| continue; | |||
| } | |||
| Object value = property.getReadMethod().invoke(en); | |||
| map.put(property.getName(), value); | |||
| } | |||
| } catch (Exception ex) { | |||
| throw new RuntimeException(ex); | |||
| } | |||
| return map; | |||
| } | |||
| public ResultData(int code, Exception e) { | |||
| super(code, e.toString()); | |||
| } | |||
| public ResultData(int code, String message) { | |||
| super(code, message); | |||
| } | |||
| public ResultData(int code, String message, Object data) { | |||
| this.code = code; | |||
| this.message = message; | |||
| this.data = data; | |||
| } | |||
| public ResultData(ErrorCode errorCode, Object data) { | |||
| this.code = errorCode.getCode(); | |||
| this.message = errorCode.getMessage(); | |||
| this.data = data; | |||
| } | |||
| public ResultData(ErrorCode errorCode) { | |||
| this.code = errorCode.getCode(); | |||
| this.message = errorCode.getMessage(); | |||
| } | |||
| public HashMap<String, Object> toHashMap() { | |||
| HashMap<String, Object> map = new HashMap<>(3); | |||
| map.put("code", this.code); | |||
| map.put("message", this.message); | |||
| map.put("data", data); | |||
| return map; | |||
| } | |||
| } | |||
| @@ -0,0 +1,242 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "mall_permission") | |||
| public class MallPermission 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; | |||
| } | |||
| /*权限名称[LIKE]**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="权限名称[LIKE]",name="name") | |||
| private String name; | |||
| @Transient | |||
| private String nameLike; | |||
| /*是否可用 Y/N**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否可用 Y/N",name="available") | |||
| private String available; | |||
| /*父编号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="父编号",name="parentId") | |||
| private Long parentId; | |||
| /*父编号列表**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="父编号列表",name="parentIds") | |||
| private String parentIds; | |||
| /*权限字符串[LIST]**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="权限字符串[LIST]",name="permission") | |||
| private String permission; | |||
| @Transient | |||
| private List<String> permissions; | |||
| /*资源类型0菜单 1,按钮**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="资源类型0菜单 1,按钮",name="resourceType") | |||
| private String resourceType; | |||
| /*资源路径**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="资源路径",name="url") | |||
| private String url; | |||
| /*排序[FROM][TO][GTE][GT][LTE][LT]**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="排序[FROM][TO][GTE][GT][LTE][LT]",name="sort") | |||
| private Integer sort; | |||
| @Transient | |||
| private Integer sortFrom; | |||
| @Transient | |||
| private Integer sortTo; | |||
| @Transient | |||
| private Integer sortGte; | |||
| @Transient | |||
| private Integer sortGt; | |||
| @Transient | |||
| private Integer sortLte; | |||
| @Transient | |||
| private Integer sortLt; | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public void setName(String _name) { | |||
| name = _name; | |||
| } | |||
| public String getNameLike() { | |||
| return nameLike; | |||
| } | |||
| public void setNameLike( String _nameLike) { | |||
| nameLike = _nameLike; | |||
| } | |||
| public String getAvailable() { | |||
| return available; | |||
| } | |||
| public void setAvailable(String _available) { | |||
| available = _available; | |||
| } | |||
| public Long getParentId() { | |||
| return parentId; | |||
| } | |||
| public void setParentId(Long _parentId) { | |||
| parentId = _parentId; | |||
| } | |||
| public String getParentIds() { | |||
| return parentIds; | |||
| } | |||
| public void setParentIds(String _parentIds) { | |||
| parentIds = _parentIds; | |||
| } | |||
| public String getPermission() { | |||
| return permission; | |||
| } | |||
| public void setPermission(String _permission) { | |||
| permission = _permission; | |||
| } | |||
| public List<String> getPermissions() { | |||
| return permissions; | |||
| } | |||
| public void setPermissions( List<String> _permissions) { | |||
| permissions = _permissions; | |||
| } | |||
| public String getResourceType() { | |||
| return resourceType; | |||
| } | |||
| public void setResourceType(String _resourceType) { | |||
| resourceType = _resourceType; | |||
| } | |||
| public String getUrl() { | |||
| return url; | |||
| } | |||
| public void setUrl(String _url) { | |||
| url = _url; | |||
| } | |||
| public Integer getSort() { | |||
| return sort; | |||
| } | |||
| public void setSort(Integer _sort) { | |||
| sort = _sort; | |||
| } | |||
| public Integer getSortFrom() { | |||
| return sortFrom; | |||
| } | |||
| public void setSortFrom( Integer _sortFrom) { | |||
| sortFrom = _sortFrom; | |||
| } | |||
| public Integer getSortTo() { | |||
| return sortTo; | |||
| } | |||
| public void setSortTo( Integer _sortTo) { | |||
| sortTo = _sortTo; | |||
| } | |||
| public Integer getSortGte() { | |||
| return sortGte; | |||
| } | |||
| public void setSortGte( Integer _sortGte) { | |||
| sortGte = _sortGte; | |||
| } | |||
| public Integer getSortGt() { | |||
| return sortGt; | |||
| } | |||
| public void setSortGt( Integer _sortGt) { | |||
| sortGt = _sortGt; | |||
| } | |||
| public Integer getSortLte() { | |||
| return sortLte; | |||
| } | |||
| public void setSortLte( Integer _sortLte) { | |||
| sortLte = _sortLte; | |||
| } | |||
| public Integer getSortLt() { | |||
| return sortLt; | |||
| } | |||
| public void setSortLt( Integer _sortLt) { | |||
| sortLt = _sortLt; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") | |||
| ,Available_ASC("`available` ASC"),Available_DESC("`available` DESC") | |||
| ,ParentId_ASC("`parentId` ASC"),ParentId_DESC("`parentId` DESC") | |||
| ,ParentIds_ASC("`parentIds` ASC"),ParentIds_DESC("`parentIds` DESC") | |||
| ,Permission_ASC("`permission` ASC"),Permission_DESC("`permission` DESC") | |||
| ,ResourceType_ASC("`resourceType` ASC"),ResourceType_DESC("`resourceType` DESC") | |||
| ,Url_ASC("`url` ASC"),Url_DESC("`url` DESC") | |||
| ,Sort_ASC("`sort` ASC"),Sort_DESC("`sort` 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(MallPermission.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,152 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "mall_role") | |||
| public class MallRole implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /*角色名称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="角色名称",name="name") | |||
| private String name; | |||
| /*是否可用 0可用 1不可用**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="是否可用 0可用 1不可用",name="available") | |||
| private String available; | |||
| /*角色描述**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="角色描述",name="description") | |||
| private String description; | |||
| @Transient | |||
| private String menus; | |||
| public String getMenus() { | |||
| return menus; | |||
| } | |||
| public void setMenus(String menus) { | |||
| this.menus = menus; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public void setName(String _name) { | |||
| name = _name; | |||
| } | |||
| public String getAvailable() { | |||
| return available; | |||
| } | |||
| public void setAvailable(String _available) { | |||
| available = _available; | |||
| } | |||
| public String getDescription() { | |||
| return description; | |||
| } | |||
| public void setDescription(String _description) { | |||
| description = _description; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenantId` ASC"),TenantId_DESC("`tenantId` DESC") | |||
| ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") | |||
| ,Available_ASC("`available` ASC"),Available_DESC("`available` DESC") | |||
| ,Description_ASC("`description` ASC"),Description_DESC("`description` 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(MallRole.Field... fields) | |||
| { | |||
| if (fields == null || fields.length == 0) { | |||
| return; | |||
| } | |||
| for (int k = 0; k < fields.length; k++) { | |||
| if (fields[k] == null) { | |||
| return; | |||
| } | |||
| } | |||
| StringBuilder sb = new StringBuilder(fields[0].toString()); | |||
| for (int k = 1; k < fields.length; k++) { | |||
| sb.append(","); | |||
| sb.append(fields[k].toString()); | |||
| } | |||
| } | |||
| public void setSortColumns(String sortColumns) | |||
| { | |||
| if (sortColumns == null || "".equals(sortColumns.trim())) { | |||
| return; | |||
| } | |||
| if (sortColumns.contains(",")) { | |||
| String[] cols = sortColumns.split(","); | |||
| java.util.List<Field> fList = new java.util.ArrayList(); | |||
| for (int k = 0; k < cols.length; k++) { | |||
| fList.add(Field.valueOf(cols[k])); | |||
| } | |||
| this.setSortColumns(fList.toArray(new Field[fList.size()])); | |||
| } else { | |||
| this.setSortColumns(Field.valueOf(sortColumns)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,326 @@ | |||
| package com.iformall.domain.po; | |||
| import com.iformall.enums.EnumUserWechat; | |||
| import lombok.Data; | |||
| import org.apache.commons.lang3.StringUtils; | |||
| 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 = "mall_user_info") | |||
| @Data | |||
| public class MallUserInfo implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<String> 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<String> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<String> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /**租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /**登录用户名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="登录用户名",name="username") | |||
| private String username; | |||
| /**用户名称**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户名称",name="name") | |||
| private String name; | |||
| /**密码**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="密码",name="password") | |||
| private String password; | |||
| /**创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | |||
| private Date createTime; | |||
| /**最后登录时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="最后登录时间",name="lastLoginTime") | |||
| private Date lastLoginTime; | |||
| /**1:有效,0:禁止登录**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="1:有效,0:禁止登录",name="status") | |||
| private Integer status; | |||
| /**0 不是超管 1是超管**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="0 不是超管 1是超管",name="isAdmin") | |||
| private Integer isAdmin; | |||
| @io.swagger.annotations.ApiModelProperty(value="昵称",name="nickName") | |||
| private String nickName; | |||
| @io.swagger.annotations.ApiModelProperty(value="手机,系统内手机号唯一",name="phone") | |||
| private String phone; | |||
| @io.swagger.annotations.ApiModelProperty(value="B端用户微信openid,领导看数据塔台用",name="bopenId") | |||
| private String bopenId; | |||
| @io.swagger.annotations.ApiModelProperty(value="admin用户微信登录用,可绑定多个账户",name="webOpenId") | |||
| private String webOpenId; | |||
| @io.swagger.annotations.ApiModelProperty(value="1 未绑定wechat,0 绑定微信",name="withWechat") | |||
| @Transient | |||
| private Integer withWechat; | |||
| @Transient | |||
| private Long roleId; | |||
| @Transient | |||
| private String roleName; | |||
| //该用户所有的角色 | |||
| @Transient | |||
| private List<MallRole> role; | |||
| //该用户包含的所有权限 | |||
| @Transient | |||
| private List<MallPermission> permission; | |||
| //拥有的菜单权限 | |||
| @Transient | |||
| private String menus; | |||
| @Transient | |||
| private String captcha; | |||
| /**1合同审批 2账单审批**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="1合同审批 2账单审批",name="flowPermission") | |||
| private String flowPermission; | |||
| public String getFlowPermission() { | |||
| return flowPermission; | |||
| } | |||
| public void setFlowPermission(String flowPermission) { | |||
| this.flowPermission = flowPermission; | |||
| } | |||
| public String getMenus() { | |||
| return menus; | |||
| } | |||
| public void setMenus(String menus) { | |||
| this.menus = menus; | |||
| } | |||
| public String getRoleName() { | |||
| return roleName; | |||
| } | |||
| public void setRoleName(String roleName) { | |||
| this.roleName = roleName; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public String getUsername() { | |||
| return username; | |||
| } | |||
| public void setUsername(String _username) { | |||
| username = _username; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public void setName(String _name) { | |||
| name = _name; | |||
| } | |||
| public String getPassword() { | |||
| return password; | |||
| } | |||
| public void setPassword(String _password) { | |||
| password = _password; | |||
| } | |||
| public Date getCreateTime() { | |||
| return createTime; | |||
| } | |||
| public void setCreateTime(Date _createTime) { | |||
| createTime = _createTime; | |||
| } | |||
| public Date getLastLoginTime() { | |||
| return lastLoginTime; | |||
| } | |||
| public void setLastLoginTime(Date _lastLoginTime) { | |||
| lastLoginTime = _lastLoginTime; | |||
| } | |||
| public Integer getStatus() { | |||
| return status; | |||
| } | |||
| public void setStatus(Integer _status) { | |||
| status = _status; | |||
| } | |||
| public Integer getIsAdmin() { | |||
| return isAdmin; | |||
| } | |||
| public void setIsAdmin(Integer _isAdmin) { | |||
| isAdmin = _isAdmin; | |||
| } | |||
| public List<MallRole> getRole() { | |||
| return role; | |||
| } | |||
| public void setRole(List<MallRole> role) { | |||
| this.role = role; | |||
| } | |||
| public List<MallPermission> getPermission() { | |||
| return permission; | |||
| } | |||
| public void setPermission(List<MallPermission> permission) { | |||
| this.permission = permission; | |||
| } | |||
| public String getNickName() { | |||
| return nickName; | |||
| } | |||
| public void setNickName(String nickName) { | |||
| this.nickName = nickName; | |||
| } | |||
| public Long getRoleId() { | |||
| return roleId; | |||
| } | |||
| public void setRoleId(Long roleId) { | |||
| this.roleId = roleId; | |||
| } | |||
| public String getCaptcha() { | |||
| return captcha; | |||
| } | |||
| public void setCaptcha(String captcha) { | |||
| this.captcha = captcha; | |||
| } | |||
| public Integer getWithWechat() { | |||
| if(StringUtils.isNotBlank(this.webOpenId)) { | |||
| this.withWechat = EnumUserWechat.HAD.getCode(); | |||
| } else { | |||
| this.withWechat = EnumUserWechat.NO.getCode(); | |||
| } | |||
| return this.withWechat; | |||
| } | |||
| public void setWithWechat(Integer withWechat) { | |||
| this.withWechat = withWechat; | |||
| } | |||
| public String getPhone() { | |||
| return phone; | |||
| } | |||
| public void setPhone(String phone) { | |||
| this.phone = phone; | |||
| } | |||
| public String getBopenId() { | |||
| return bopenId; | |||
| } | |||
| public void setBopenId(String bopenId) { | |||
| this.bopenId = bopenId; | |||
| } | |||
| public String getWebOpenId() { | |||
| return webOpenId; | |||
| } | |||
| public void setWebOpenId(String webOpenId) { | |||
| this.webOpenId = webOpenId; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||
| ,Username_ASC("`username` ASC"),Username_DESC("`username` DESC") | |||
| ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") | |||
| ,Password_ASC("`password` ASC"),Password_DESC("`password` DESC") | |||
| ,CreateTime_ASC("`create_time` ASC"),CreateTime_DESC("`create_time` DESC") | |||
| ,LastLoginTime_ASC("`last_login_time` ASC"),LastLoginTime_DESC("`last_login_time` DESC") | |||
| ,Status_ASC("`status` ASC"),Status_DESC("`status` DESC") | |||
| ,IsAdmin_ASC("`is_admin` ASC"),IsAdmin_DESC("`is_admin` DESC") | |||
| ,NickName_ASC("`nick_name` ASC"),NickName_DESC("`nick_name` DESC") | |||
| ,Phone_ASC("`phone` ASC"),Phone_DESC("`phone` DESC") | |||
| ,BOpenId_ASC("`bopen_id` ASC"),BOpenId_DESC("`bopen_id` DESC") | |||
| ,WebOpenId_ASC("`web_open_id` ASC"),WebOpenId_DESC("`web_open_id` 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(MallUserInfo.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,243 @@ | |||
| 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_appinfo") | |||
| public class WxAppinfo 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; | |||
| /*小程序ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序ID",name="appId") | |||
| private String appId; | |||
| /*公众号ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="公众号ID",name="parentAppId") | |||
| private String parentAppId; | |||
| /*小程序名**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序名",name="name") | |||
| private String name; | |||
| /*小程序secret**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序secret",name="secret") | |||
| private String secret; | |||
| /*消息token**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="消息token",name="token") | |||
| private String token; | |||
| /*消息aeskey**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="消息aeskey",name="aesKey") | |||
| private String aesKey; | |||
| /*消息类型**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="消息类型",name="msgDataFormat") | |||
| private String msgDataFormat; | |||
| /*微信访问token**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信访问token",name="accessToken") | |||
| private String accessToken; | |||
| /*上次生成accesstoken时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="上次生成accesstoken时间",name="lastTokenTime") | |||
| private Date lastTokenTime; | |||
| /*微信token有效时间单位(秒)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信token有效时间单位(秒)",name="expiresIn") | |||
| private Integer expiresIn; | |||
| /*支付ID,参看wx_pay_account**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付ID,参看wx_pay_account",name="payId") | |||
| private Long payId; | |||
| @io.swagger.annotations.ApiModelProperty(value="1B端2C端",name="type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付ID,参看wx_pay_account_bill",name="payBillId") | |||
| private Long payBillId; | |||
| public Long getPayBillId() { | |||
| return payBillId; | |||
| } | |||
| public void setPayBillId(Long payBillId) { | |||
| this.payBillId = payBillId; | |||
| } | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public String getAppId() { | |||
| return appId; | |||
| } | |||
| public void setAppId(String _appId) { | |||
| appId = _appId; | |||
| } | |||
| public String getParentAppId() { | |||
| return parentAppId; | |||
| } | |||
| public void setParentAppId(String parentAppId) { | |||
| this.parentAppId = parentAppId; | |||
| } | |||
| public String getName() { | |||
| return name; | |||
| } | |||
| public void setName(String _name) { | |||
| name = _name; | |||
| } | |||
| public String getSecret() { | |||
| return secret; | |||
| } | |||
| public void setSecret(String _secret) { | |||
| secret = _secret; | |||
| } | |||
| public String getToken() { | |||
| return token; | |||
| } | |||
| public void setToken(String _token) { | |||
| token = _token; | |||
| } | |||
| public String getAesKey() { | |||
| return aesKey; | |||
| } | |||
| public void setAesKey(String _aesKey) { | |||
| aesKey = _aesKey; | |||
| } | |||
| public String getMsgDataFormat() { | |||
| return msgDataFormat; | |||
| } | |||
| public void setMsgDataFormat(String _msgDataFormat) { | |||
| msgDataFormat = _msgDataFormat; | |||
| } | |||
| public String getAccessToken() { | |||
| return accessToken; | |||
| } | |||
| public void setAccessToken(String _accessToken) { | |||
| accessToken = _accessToken; | |||
| } | |||
| public Date getLastTokenTime() { | |||
| return lastTokenTime; | |||
| } | |||
| public void setLastTokenTime(Date _lastTokenTime) { | |||
| lastTokenTime = _lastTokenTime; | |||
| } | |||
| public Integer getExpiresIn() { | |||
| return expiresIn; | |||
| } | |||
| public void setExpiresIn(Integer _expiresIn) { | |||
| expiresIn = _expiresIn; | |||
| } | |||
| public Long getPayId() { | |||
| return payId; | |||
| } | |||
| public void setPayId(Long _payId) { | |||
| payId = _payId; | |||
| } | |||
| 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") | |||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||
| ,AppId_ASC("`app_id` ASC"),AppId_DESC("`app_id` DESC") | |||
| ,ParentAppId_ASC("`parent_app_id` ASC"),ParentAppId_DESC("`parent_app_id` DESC") | |||
| ,Name_ASC("`name` ASC"),Name_DESC("`name` DESC") | |||
| ,Secret_ASC("`secret` ASC"),Secret_DESC("`secret` DESC") | |||
| ,Token_ASC("`token` ASC"),Token_DESC("`token` DESC") | |||
| ,AesKey_ASC("`aesKey` ASC"),AesKey_DESC("`aesKey` DESC") | |||
| ,MsgDataFormat_ASC("`msg_data_format` ASC"),MsgDataFormat_DESC("`msg_data_format` DESC") | |||
| ,AccessToken_ASC("`access_token` ASC"),AccessToken_DESC("`access_token` DESC") | |||
| ,LastTokenTime_ASC("`last_token_time` ASC"),LastTokenTime_DESC("`last_token_time` DESC") | |||
| ,ExpiresIn_ASC("`expires_in` ASC"),ExpiresIn_DESC("`expires_in` DESC") | |||
| ,PayId_ASC("`pay_id` ASC"),PayId_DESC("`pay_id` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` 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(WxAppinfo.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,144 @@ | |||
| package com.iformall.domain.po; | |||
| import lombok.Data; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| 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; | |||
| @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; | |||
| @io.swagger.annotations.ApiModelProperty(value="二维码图片的URL,开发者最好自行也进行保存",name="qrcodeUrl") | |||
| private String qrcodeUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | |||
| private Date createTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime") | |||
| private Date updateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="授权状态,0为已授权,1为已取消授权",name="authorizationStatus") | |||
| private Integer authorizationStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="授权时间",name="authTime") | |||
| private Date authTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信基础版本设置状态,0为已设置,1为设置失败",name="baseStatus") | |||
| private Integer baseStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信基础版本设置时间",name="baseTime") | |||
| private Date baseTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信服务器域名版本设置状态,0为已设置,1为设置失败",name="domainStatus") | |||
| private Integer domainStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信服务器域名版本设置时间",name="domainTime") | |||
| private Date domainTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信服务器业务域名版本设置状态,0为已设置,1为设置失败",name="webdomainStatus") | |||
| private Integer webdomainStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信服务器业务域名版本设置时间",name="webdomainTime") | |||
| private Date webdomainTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信小程序模板设置状态,0为已设置,1为设置失败",name="templateStatus") | |||
| private Integer templateStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信小程序模板设置时间",name="templateTime") | |||
| private Date templateTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="当前版本",name="currentVersion") | |||
| private String currentVersion; | |||
| @io.swagger.annotations.ApiModelProperty(value="当前版本描述",name="currentDesc") | |||
| private String currentDesc; | |||
| @io.swagger.annotations.ApiModelProperty(value="当前版本发布时间",name="releaseTime") | |||
| private Date releaseTime; | |||
| @io.swagger.annotations.ApiModelProperty(value="微信开放平台appId",name="openAppid") | |||
| private String openAppid; | |||
| @io.swagger.annotations.ApiModelProperty(value="绑定开发平台时间",name="bindOpenTime") | |||
| private Date bindOpenTime; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`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") | |||
| ,UpdateTime_ASC("`update_time` ASC"),UpdateTime_DESC("`update_time` DESC") | |||
| ,AuthorizationStatus_ASC("`authorization_status` ASC"),AuthorizationStatus_DESC("`authorization_status` DESC") | |||
| ,AuthTime_ASC("`auth_time` ASC"),AuthTime_DESC("`auth_time` DESC") | |||
| ,BaseStatus_ASC("`base_status` ASC"),BaseStatus_DESC("`base_status` DESC") | |||
| ,BaseTime_ASC("`base_time` ASC"),BaseTime_DESC("`base_time` DESC") | |||
| ,DomainStatus_ASC("`domain_status` ASC"),DomainStatus_DESC("`domain_status` DESC") | |||
| ,DomainTime_ASC("`domain_time` ASC"),DomainTime_DESC("`domain_time` DESC") | |||
| ,WebDomainStatus_ASC("`webdomain_status` ASC"),WebDomainStatus_DESC("`webdomain_status` DESC") | |||
| ,WebDomainTime_ASC("`webdomain_time` ASC"),WebDomainTime_DESC("`webdomain_time` DESC") | |||
| ,TemplateStatus_ASC("`template_status` ASC"),TemplateStatus_DESC("`template_status` DESC") | |||
| ,TemplateTime_ASC("`template_time` ASC"),TemplateTime_DESC("`template_time` DESC") | |||
| ,CurrentVersion_ASC("`current_version` ASC"),CurrentVersion_DESC("`current_version` DESC") | |||
| ,CurrentDesc_ASC("`current_desc` ASC"),CurrentDesc_DESC("`current_desc` DESC") | |||
| ,ReleaseTime_ASC("`release_time` ASC"),ReleaseTime_DESC("`release_time` DESC") | |||
| ,OpenAppId_ASC("`open_appid` ASC"),OpenAppId_DESC("`open_appid` DESC") | |||
| ,BindOpenTime_ASC("`bind_open_time` ASC"),BindOpen_DESC("`bind_open_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(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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,97 @@ | |||
| package com.iformall.domain.po; | |||
| import lombok.Data; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_component_verify_ticket") | |||
| @Data | |||
| public class WxComponentVerifyTicket implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| 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; | |||
| 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") | |||
| ; | |||
| 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(WxComponentVerifyTicket.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,211 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_pay_account") | |||
| public class WxPayAccount implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /*租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /**微信商户号/特约服务商号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信商户号/特约服务商号",name="mchId") | |||
| private String mchId; | |||
| /**微信服务商号*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信服务商号",name="subMchId") | |||
| private String subMchId; | |||
| /**支付密钥**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付密钥",name="apiKey") | |||
| private String apiKey; | |||
| /**微信回调,支持3种回调,(1.url/pay 2.url/refund3.url/separate)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信回调,支持3种回调,(1.url/pay 2.url/refund3.url/separate)",name="notifyUrl") | |||
| private String notifyUrl; | |||
| /**证书本地存放位置**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="证书本地存放位置",name="certPath") | |||
| private String certPath; | |||
| /**商户模式**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="商户模式-0:普通商户模式1:服务商模式",name="type") | |||
| private Integer type; | |||
| /**是否开启分账**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="0:未开启分账1:开启分账",name="type") | |||
| private Integer share; | |||
| /**手续费**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="手续费",name="rate") | |||
| private Integer rate; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String tenantId) { | |||
| this.tenantId = tenantId; | |||
| } | |||
| public String getMchId() { | |||
| return mchId; | |||
| } | |||
| public void setMchId(String _mchId) { | |||
| mchId = _mchId; | |||
| } | |||
| public String getSubMchId() { | |||
| return subMchId; | |||
| } | |||
| public void setSubMchId(String subMchId) { | |||
| this.subMchId = subMchId; | |||
| } | |||
| public String getApiKey() { | |||
| return apiKey; | |||
| } | |||
| public void setApiKey(String _apiKey) { | |||
| apiKey = _apiKey; | |||
| } | |||
| public String getNotifyUrl() { | |||
| return notifyUrl; | |||
| } | |||
| public void setNotifyUrl(String _notifyUrl) { | |||
| notifyUrl = _notifyUrl; | |||
| } | |||
| public String getCertPath() { | |||
| return certPath; | |||
| } | |||
| public void setCertPath(String _certPath) { | |||
| certPath = _certPath; | |||
| } | |||
| public Integer getType() { | |||
| return type; | |||
| } | |||
| public void setType(Integer type) { | |||
| this.type = type; | |||
| } | |||
| public Integer getShare() { | |||
| return share; | |||
| } | |||
| public void setShare(Integer share) { | |||
| this.share = share; | |||
| } | |||
| public Integer getRate() { | |||
| return rate; | |||
| } | |||
| public void setRate(Integer rate) { | |||
| this.rate = rate; | |||
| } | |||
| public String getPayNotifyUrl() { | |||
| return notifyUrl + "/pay"; | |||
| } | |||
| public String getRefundNotifyUrl() { | |||
| return notifyUrl + "/refund"; | |||
| } | |||
| public String getSeparateNotifyUrl() { | |||
| return notifyUrl + "/separate"; | |||
| } | |||
| public String getSubsidyNotifyUrl() { | |||
| return notifyUrl + "/subsidyPay"; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||
| ,MchId_ASC("`mch_id` ASC"),MchId_DESC("`mch_id` DESC") | |||
| ,SubMchId_ASC("`sub_mch_id` ASC"),SubMchId_DESC("`sub_mch_id` DESC") | |||
| ,ApiKey_ASC("`api_key` ASC"),ApiKey_DESC("`api_key` DESC") | |||
| ,NotifyUrl_ASC("`notify_url` ASC"),NotifyUrl_DESC("`notify_url` DESC") | |||
| ,CertPath_ASC("`cert_path` ASC"),CertPath_DESC("`cert_path` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,Share_ASC("`share` ASC"),Share_DESC("`share` DESC") | |||
| ,Rate_ASC("`rate` ASC"),Rate_DESC("`rate` 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(WxPayAccount.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,315 @@ | |||
| package com.iformall.domain.po; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_pay_order") | |||
| public class WxPayOrder implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| public Long getId() { | |||
| return id; | |||
| } | |||
| public void setId(Long id) { | |||
| this.id = id; | |||
| } | |||
| public String getSortColumns() { | |||
| return sortColumns; | |||
| } | |||
| public List<Long> getIds() { | |||
| return ids; | |||
| } | |||
| public void setIds(List<Long> ids) { | |||
| this.ids = ids; | |||
| } | |||
| /**租户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="租户ID",name="tenantId") | |||
| private String tenantId; | |||
| /**创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createTime") | |||
| private Date createTime; | |||
| /**更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateTime") | |||
| private Date updateTime; | |||
| /**订单ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="订单ID",name="orderId") | |||
| private Long orderId; | |||
| /**用户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户ID",name="cUserId") | |||
| private Long cUserId; | |||
| /**B端用户ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="B端用户ID",name="bUserId") | |||
| private Long bUserId; | |||
| /**扫码授权编码**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="扫码授权编码",name="authCode") | |||
| private String authCode; | |||
| /**ip地址**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="ip地址",name="ip") | |||
| private String ip; | |||
| /**支付金额(分)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付金额(分)",name="payAmount") | |||
| private Integer payAmount; | |||
| /**支付发起时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付发起时间",name="payTimeStart") | |||
| private Date payTimeStart; | |||
| /**支付结束时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付结束时间",name="payTimeEnd") | |||
| private Date payTimeEnd; | |||
| /**微信预支付交易会话标识**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信预支付交易会话标识",name="prepayId") | |||
| private String prepayId; | |||
| /**微信生成的订单号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="微信生成的订单号",name="transactionId") | |||
| private String transactionId; | |||
| /**支付渠道: 0-微信 1-支付宝 2-银联 **/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付渠道: 0-微信 1-支付宝 2-银联 ",name="payVendor") | |||
| private Integer payVendor; | |||
| /**支付订单号**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付订单号",name="payOrderNo") | |||
| private String payOrderNo; | |||
| /**支付状态: 0-支付中;1-支付成功;2-支付失败**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付状态: 0-支付中;1-支付成功;2-支付失败",name="payOrderStatus") | |||
| private Integer payOrderStatus; | |||
| /**分账状态: 0-未分账;1-分账**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="分账状态: 0-未分账;1-分账",name="payOrderStatus") | |||
| private Integer share; | |||
| /**分账金额(总金额扣除手续费后的金额)**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="分账金额",name="shareAmount") | |||
| private Integer shareAmount; | |||
| /**支付失败原因**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="支付失败原因",name="failReason") | |||
| private String failReason; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付后结果来源(0:callback, 1:query)",name="payEndFrom") | |||
| private Integer payEndFrom; | |||
| public String getTenantId() { | |||
| return tenantId; | |||
| } | |||
| public void setTenantId(String _tenantId) { | |||
| tenantId = _tenantId; | |||
| } | |||
| public Date getCreateTime() { | |||
| return createTime; | |||
| } | |||
| public void setCreateTime(Date _createTime) { | |||
| createTime = _createTime; | |||
| } | |||
| public Date getUpdateTime() { | |||
| return updateTime; | |||
| } | |||
| public void setUpdateTime(Date _updateTime) { | |||
| updateTime = _updateTime; | |||
| } | |||
| public Long getOrderId() { | |||
| return orderId; | |||
| } | |||
| public void setOrderId(Long _orderId) { | |||
| orderId = _orderId; | |||
| } | |||
| public Long getcUserId() { | |||
| return cUserId; | |||
| } | |||
| public void setcUserId(Long cUserId) { | |||
| this.cUserId = cUserId; | |||
| } | |||
| public Long getbUserId() { | |||
| return bUserId; | |||
| } | |||
| public void setbUserId(Long bUserId) { | |||
| this.bUserId = bUserId; | |||
| } | |||
| public String getAuthCode() { | |||
| return authCode; | |||
| } | |||
| public void setAuthCode(String authCode) { | |||
| this.authCode = authCode; | |||
| } | |||
| public String getIp() { | |||
| return ip; | |||
| } | |||
| public void setIp(String _ip) { | |||
| ip = _ip; | |||
| } | |||
| public Integer getPayAmount() { | |||
| return payAmount; | |||
| } | |||
| public void setPayAmount(Integer _payAmount) { | |||
| payAmount = _payAmount; | |||
| } | |||
| public Date getPayTimeStart() { | |||
| return payTimeStart; | |||
| } | |||
| public void setPayTimeStart(Date _payTimeStart) { | |||
| payTimeStart = _payTimeStart; | |||
| } | |||
| public Date getPayTimeEnd() { | |||
| return payTimeEnd; | |||
| } | |||
| public void setPayTimeEnd(Date _payTimeEnd) { | |||
| payTimeEnd = _payTimeEnd; | |||
| } | |||
| public String getPrepayId() { | |||
| return prepayId; | |||
| } | |||
| public void setPrepayId(String prepayId) { | |||
| this.prepayId = prepayId; | |||
| } | |||
| public String getTransactionId() { | |||
| return transactionId; | |||
| } | |||
| public void setTransactionId(String _transactionId) { | |||
| transactionId = _transactionId; | |||
| } | |||
| public Integer getPayVendor() { | |||
| return payVendor; | |||
| } | |||
| public void setPayVendor(Integer _payVendor) { | |||
| payVendor = _payVendor; | |||
| } | |||
| public String getPayOrderNo() { | |||
| return payOrderNo; | |||
| } | |||
| public void setPayOrderNo(String _payOrderNo) { | |||
| payOrderNo = _payOrderNo; | |||
| } | |||
| public Integer getPayOrderStatus() { | |||
| return payOrderStatus; | |||
| } | |||
| public void setPayOrderStatus(Integer _payOrderStatus) { | |||
| payOrderStatus = _payOrderStatus; | |||
| } | |||
| public Integer getShare() { | |||
| return share; | |||
| } | |||
| public void setShare(Integer share) { | |||
| this.share = share; | |||
| } | |||
| public Integer getShareAmount() { | |||
| return shareAmount; | |||
| } | |||
| public void setShareAmount(Integer shareAmount) { | |||
| this.shareAmount = shareAmount; | |||
| } | |||
| public String getFailReason() { | |||
| return failReason; | |||
| } | |||
| public void setFailReason(String _failReason) { | |||
| failReason = _failReason; | |||
| } | |||
| public Integer getPayEndFrom() { | |||
| return payEndFrom; | |||
| } | |||
| public void setPayEndFrom(Integer payEndFrom) { | |||
| this.payEndFrom = payEndFrom; | |||
| } | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||
| ,CreateTime_ASC("`create_time` ASC"),CreateTime_DESC("`create_time` DESC") | |||
| ,UpdateTime_ASC("`update_time` ASC"),UpdateTime_DESC("`update_time` DESC") | |||
| ,OrderId_ASC("`order_id` ASC"),OrderId_DESC("`order_id` DESC") | |||
| ,CUserId_ASC("`c_user_id` ASC"),CUserId_DESC("`c_user_id` DESC") | |||
| ,BUserId_ASC("`b_user_id` ASC"),BUserId_DESC("`b_user_id` DESC") | |||
| ,AuthCode_ASC("`auth_code` ASC"),AuthCode_DESC("`auth_code` DESC") | |||
| ,Ip_ASC("`ip` ASC"),Ip_DESC("`ip` DESC") | |||
| ,PayAmount_ASC("`pay_amount` ASC"),PayAmount_DESC("`pay_amount` DESC") | |||
| ,PayTimeStart_ASC("`pay_time_start` ASC"),PayTimeStart_DESC("`pay_time_start` DESC") | |||
| ,PayTimeEnd_ASC("`pay_time_end` ASC"),PayTimeEnd_DESC("`pay_time_end` DESC") | |||
| ,PrepayId_ASC("`prepay_id` ASC"),PrepayId_DESC("`transaction_id` DESC") | |||
| ,TransactionId_ASC("`transaction_id` ASC"),TransactionId_DESC("`prepay_id` DESC") | |||
| ,PayVendor_ASC("`pay_vendor` ASC"),PayVendor_DESC("`pay_vendor` DESC") | |||
| ,PayOrderNo_ASC("`pay_order_no` ASC"),PayOrderNo_DESC("`pay_order_no` DESC") | |||
| ,PayOrderStatus_ASC("`pay_order_status` ASC"),PayOrderStatus_DESC("`pay_order_status` DESC") | |||
| ,Share_ASC("`share` ASC"),Share_DESC("`share` DESC") | |||
| ,ShareAmount_ASC("`share_amount` ASC"),ShareAmount_DESC("`share_amount` DESC") | |||
| ,FailReason_ASC("`fail_reason` ASC"),FailReason_DESC("`fail_reason` DESC") | |||
| ,PayEndFrom_ASC("`pay_end_from` ASC"),PayEndFrom_DESC("`pay_end_from` 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(WxPayOrder.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,104 @@ | |||
| package com.iformall.domain.po; | |||
| import lombok.Data; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_template_msg") | |||
| @Data | |||
| public class WxTemplateMsg 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="tenantId") | |||
| private String tenantId; | |||
| /**模板ID**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="模板ID",name="templateId") | |||
| private String templateId; | |||
| /**模板类型1:核销成功消息, 2:核销失败消息**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="模板类型1:核销成功消息,2:核销失败消息",name="type") | |||
| private Integer type; | |||
| /**创建时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| /**更新时间**/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,TenantId_ASC("`tenant_id` ASC"),TenantId_DESC("`tenant_id` DESC") | |||
| ,TemplateId_ASC("`template_id` ASC"),TemplateId_DESC("`template_id` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_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(WxTemplateMsg.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,101 @@ | |||
| package com.iformall.domain.po; | |||
| import lombok.Data; | |||
| 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_weapp_audit_status") | |||
| @Data | |||
| public class WxWeappAuditStatus implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序ID",name="appId") | |||
| private String appId; | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序类型(1-B端 2-C端)",name="type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户版本",name="userVersion") | |||
| private String userVersion; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户版本描述",name="versionDesc") | |||
| private String versionDesc; | |||
| @io.swagger.annotations.ApiModelProperty(value="auditid",name="auditid") | |||
| private Long auditid; | |||
| @io.swagger.annotations.ApiModelProperty(value="审核状态(0为审核成功,1:审核失败,2:审核中,3:已撤回)",name="auditStatus") | |||
| private Integer auditStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="审核错误码",name="auditErrCode") | |||
| private String auditErrCode; | |||
| @io.swagger.annotations.ApiModelProperty(value="审核时间",name="auditTime") | |||
| private Date auditTime; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,AppId_ASC("`app_id` ASC"),AppId_DESC("`app_id` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,UserVersion_ASC("`user_version` ASC"),UserVersion_DESC("`user_version` DESC") | |||
| ,AuditTime_ASC("`audit_time` ASC"),AuditTime_DESC("`audit_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(WxWeappAuditStatus.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,109 @@ | |||
| package com.iformall.domain.po; | |||
| import lombok.Data; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_weapp_basic_set") | |||
| @Data | |||
| public class WxWeappBasicSet implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| /**小程序类型(1-B端 2-C端)*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序类型(1-B端 2-C端)",name="type") | |||
| private Integer type; | |||
| /**部署类型(1:dev,2:test,3:prod)*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="部署类型(1:dev,2:test,3:prod)",name="deploy") | |||
| private Integer deploy; | |||
| /**服务器域名*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="服务器域名",name="domainUrl") | |||
| private String domainUrl; | |||
| /**小程序基础版本*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序基础版本",name="version") | |||
| private String version; | |||
| /**模板库信息*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="模板库信息",name="templateInfo") | |||
| private String templateInfo; | |||
| /**创建时间*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| /**更新时间*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,Deploy_ASC("`deploy` ASC"),Deploy_DESC("`deploy` DESC") | |||
| ,DomainUrl_ASC("`domain_url` ASC"),DomainUrl_DESC("`domain_url` DESC") | |||
| ,Version_ASC("`version` ASC"),Version_DESC("`version` DESC") | |||
| ,TemplateInfo_ASC("`template_info` ASC"),TemplateInfo_DESC("`template_info` DESC") | |||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_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(WxWeappBasicSet.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,104 @@ | |||
| package com.iformall.domain.po; | |||
| import lombok.Data; | |||
| 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_weapp_code_status") | |||
| @Data | |||
| public class WxWeappCodeStatus 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="appId") | |||
| private String appId; | |||
| /**小程序类型(1-B端 2-C端)*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序类型(1-B端 2-C端)",name="type") | |||
| private Integer type; | |||
| /**用户版本*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="用户版本",name="userVersion") | |||
| private String userVersion; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户版本描述",name="versionDesc") | |||
| private String versionDesc; | |||
| /**code提交状态*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="code提交状态(0:成功, 1:失败)",name="codeStatus") | |||
| private Integer codeStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="code提交错误码",name="codeErrCode") | |||
| private String codeErrCode; | |||
| /**更新时间*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="code提交时间",name="codeTime") | |||
| private Date codeTime; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,AppId_ASC("`app_id` ASC"),AppId_DESC("`app_id` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,UserVersion_ASC("`user_version` ASC"),UserVersion_DESC("`user_version` DESC") | |||
| ,CodeTime_ASC("`code_time` ASC"),CodeTime_DESC("`code_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(WxWeappCodeStatus.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,105 @@ | |||
| package com.iformall.domain.po; | |||
| import lombok.Data; | |||
| import javax.persistence.*; | |||
| import java.util.*; | |||
| import javax.persistence.Transient; | |||
| import java.util.List; | |||
| import javax.persistence.Id; | |||
| import java.io.Serializable; | |||
| @Table(name = "wx_weapp_ext_set") | |||
| @Data | |||
| public class WxWeappExtSet 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="appId") | |||
| private String appId; | |||
| /**小程序类型(1-B端 2-C端)*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序类型(1-B端 2-C端)",name="type") | |||
| private Integer type; | |||
| /**小程序扩展信息*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序扩展信息",name="extJson") | |||
| private String extJson; | |||
| /**提交审核列表*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="提交审核列表",name="releaseJson") | |||
| private String releaseJson; | |||
| /**创建时间*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="创建时间",name="createDate") | |||
| private Date createDate; | |||
| /**更新时间*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="更新时间",name="updateDate") | |||
| private Date updateDate; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,AppId_ASC("`app_id` ASC"),AppId_DESC("`app_id` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,ExtJson_ASC("`ext_json` ASC"),ExtJson_DESC("`ext_json` DESC") | |||
| ,ReleaseJson_ASC("`release_json` ASC"),ReleaseJson_DESC("`release_json` DESC") | |||
| ,CreateDate_ASC("`create_date` ASC"),CreateDate_DESC("`create_date` DESC") | |||
| ,UpdateDate_ASC("`update_date` ASC"),UpdateDate_DESC("`update_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(WxWeappExtSet.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,99 @@ | |||
| package com.iformall.domain.po; | |||
| import lombok.Data; | |||
| 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_weapp_release_status") | |||
| @Data | |||
| public class WxWeappReleaseStatus implements Serializable { | |||
| private static final long serialVersionUID = 1L; | |||
| @Id | |||
| protected Long id; | |||
| @Transient | |||
| protected List<Long> ids; | |||
| @Transient | |||
| protected String sortColumns; | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序ID",name="appId") | |||
| private String appId; | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序类型(1-B端 2-C端)",name="type") | |||
| private Integer type; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户版本",name="userVersion") | |||
| private String userVersion; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户版本描述",name="versionDesc") | |||
| private String versionDesc; | |||
| @io.swagger.annotations.ApiModelProperty(value="发布状态(0:发布成功, 1:发布失败, 2:发布中, 3:发布撤回)",name="releaseStatus") | |||
| private Integer releaseStatus; | |||
| @io.swagger.annotations.ApiModelProperty(value="发布错误码",name="releaseErrCode") | |||
| private String releaseErrCode; | |||
| @io.swagger.annotations.ApiModelProperty(value="发布时间",name="releaseTime") | |||
| private Date releaseTime; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("`id` ASC"),Id_DESC("`id` DESC") | |||
| ,AppId_ASC("`app_id` ASC"),AppId_DESC("`app_id` DESC") | |||
| ,Type_ASC("`type` ASC"),Type_DESC("`type` DESC") | |||
| ,UserVersion_ASC("`user_version` ASC"),UserVersion_DESC("`user_version` DESC") | |||
| ,ReleaseTime_ASC("`release_time` ASC"),ReleaseTime_DESC("`release_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(WxWeappReleaseStatus.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,46 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| public class MallUserInfoVo extends MallUserInfo { | |||
| @io.swagger.annotations.ApiModelProperty(value="商场名",name="mallName") | |||
| private String mallName; | |||
| @io.swagger.annotations.ApiModelProperty(value="集团",name="mallGroup") | |||
| private String mallGroup; | |||
| @io.swagger.annotations.ApiModelProperty(value="商场图标",name="imgUrl") | |||
| private String imgUrl; | |||
| @io.swagger.annotations.ApiModelProperty(value="商场图标",name="imgUrlH") | |||
| private String imgUrlH; | |||
| public String getMallName() { | |||
| return mallName; | |||
| } | |||
| public void setMallName(String mallName) { | |||
| this.mallName = mallName; | |||
| } | |||
| public String getMallGroup() { | |||
| return mallGroup; | |||
| } | |||
| public void setMallGroup(String mallGroup) { | |||
| this.mallGroup = mallGroup; | |||
| } | |||
| public String getImgUrl() { | |||
| return imgUrl; | |||
| } | |||
| public void setImgUrl(String _imgUrl) { | |||
| this.imgUrl = _imgUrl; | |||
| } | |||
| public String getImgUrlH() { | |||
| return imgUrlH; | |||
| } | |||
| public void setImgUrlH(String imgUrlH) { | |||
| this.imgUrlH = imgUrlH; | |||
| } | |||
| } | |||
| @@ -0,0 +1,39 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.WxPayOrder; | |||
| public class WxPayOrderVo extends WxPayOrder { | |||
| @io.swagger.annotations.ApiModelProperty(value="用户绑定的openId",name="openId") | |||
| private String openId; | |||
| @io.swagger.annotations.ApiModelProperty(value="用户支付appId",name="appId") | |||
| private String appId; | |||
| @io.swagger.annotations.ApiModelProperty(value="支付ID,参看wx_pay_account",name="payId") | |||
| private Long payId; | |||
| public String getOpenId() { | |||
| return openId; | |||
| } | |||
| public void setOpenId(String openId) { | |||
| this.openId = openId; | |||
| } | |||
| public String getAppId() { | |||
| return appId; | |||
| } | |||
| public void setAppId(String appId) { | |||
| this.appId = appId; | |||
| } | |||
| public Long getPayId() { | |||
| return payId; | |||
| } | |||
| public void setPayId(Long payId) { | |||
| this.payId = payId; | |||
| } | |||
| } | |||
| @@ -0,0 +1,14 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.WxWeappAuditStatus; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxWeappAuditStatusVo extends WxWeappAuditStatus { | |||
| /**小程序名称*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序名称",name="name") | |||
| private String name; | |||
| } | |||
| @@ -0,0 +1,14 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.WxWeappCodeStatus; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxWeappCodeStatusVo extends WxWeappCodeStatus { | |||
| /**小程序名称*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序名称",name="name") | |||
| private String name; | |||
| } | |||
| @@ -0,0 +1,99 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.WxAuthorizerInfo; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| import java.util.ArrayList; | |||
| import java.util.List; | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxWeappInfo extends WxAuthorizerInfo { | |||
| /**小程序类型(1-B端 2-C端)*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序类型(1-B端 2-C端)",name="type") | |||
| private Integer type; | |||
| /**小程序名称*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序名称",name="name") | |||
| private String name; | |||
| public static enum Field | |||
| { | |||
| Id_ASC("ai.`id` ASC"),Id_DESC("ai.`id` DESC") | |||
| ,AuthorizerAppid_ASC("ai.`authorizer_appid` ASC"),AuthorizerAppid_DESC("ai.`authorizer_appid` DESC") | |||
| ,HeadImg_ASC("ai.`head_img` ASC"),HeadImg_DESC("ai.`head_img` DESC") | |||
| ,Alias_ASC("ai.`alias` ASC"),Alias_DESC("ai.`alias` DESC") | |||
| ,QrcodeUrl_ASC("ai.`qrcode_url` ASC"),QrcodeUrl_DESC("ai.`qrcode_url` DESC") | |||
| ,CreateTime_ASC("ai.`create_time` ASC"),CreateTime_DESC("ai.`create_time` DESC") | |||
| ,UpdateTime_ASC("ai.`update_time` ASC"),UpdateTime_DESC("ai.`update_time` DESC") | |||
| ,AuthorizationStatus_ASC("ai.`authorization_status` ASC"),AuthorizationStatus_DESC("ai.`authorization_status` DESC") | |||
| ,AuthTime_ASC("ai.`auth_time` ASC"),AuthTime_DESC("ai.`auth_time` DESC") | |||
| ,BaseStatus_ASC("ai.`base_status` ASC"),BaseStatus_DESC("ai.`base_status` DESC") | |||
| ,BaseTime_ASC("ai.`base_time` ASC"),BaseTime_DESC("ai.`base_time` DESC") | |||
| ,DomainStatus_ASC("ai.`domain_status` ASC"),DomainStatus_DESC("ai.`domain_status` DESC") | |||
| ,DomainTime_ASC("ai.`domain_time` ASC"),DomainTime_DESC("ai.`domain_time` DESC") | |||
| ,WebDomainStatus_ASC("ai.`webdomain_status` ASC"),WebDomainStatus_DESC("ai.`webdomain_status` DESC") | |||
| ,WebDomainTime_ASC("ai.`webdomain_time` ASC"),WebDomainTime_DESC("ai.`webdomain_time` DESC") | |||
| ,TemplateStatus_ASC("ai.`template_status` ASC"),TemplateStatus_DESC("ai.`template_status` DESC") | |||
| ,TemplateTime_ASC("ai.`template_time` ASC"),TemplateTime_DESC("ai.`template_time` DESC") | |||
| ,CurrentVersion_ASC("ai.`current_version` ASC"),CurrentVersion_DESC("ai.`current_version` DESC") | |||
| ,CurrentDesc_ASC("ai.`current_desc` ASC"),CurrentDesc_DESC("ai.`current_desc` DESC") | |||
| ,ReleaseTime_ASC("ai.`release_time` ASC"),ReleaseTime_DESC("ai.`release_time` DESC") | |||
| ,OpenAppid_ASC("ai.`open_appid` ASC"),OpenAppid_DESC("ai.`open_appid` DESC") | |||
| ,BindOpenTime_ASC("ai.`bind_open_time` ASC"),BindOpenTime_DESC("ai.`bind_open_time` DESC") | |||
| ,Name_ASC("a.`name` ASC"),Name_DESC("a.`name` DESC") | |||
| ,Type_ASC("a.`type` ASC"),Type_DESC("a.`type` 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(WxWeappInfo.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)); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,14 @@ | |||
| package com.iformall.domain.vo; | |||
| import com.iformall.domain.po.WxWeappReleaseStatus; | |||
| import lombok.Data; | |||
| import lombok.EqualsAndHashCode; | |||
| @Data | |||
| @EqualsAndHashCode(callSuper = true) | |||
| public class WxWeappReleaseStatusVo extends WxWeappReleaseStatus { | |||
| /**小程序名称*/ | |||
| @io.swagger.annotations.ApiModelProperty(value="小程序名称",name="name") | |||
| private String name; | |||
| } | |||
| @@ -0,0 +1,40 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumAppType { | |||
| // 1-B端, 2-C端, 3-服务号, 4-订阅号 | |||
| B(1, "B端"), | |||
| C(2, "C端"), | |||
| MP_S(3,"公众号-服务号"), | |||
| MP_P(4, "公众号-订阅号"), | |||
| ; | |||
| public static EnumAppType getEnum(Integer code) { | |||
| for (EnumAppType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumAppType(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; | |||
| /** | |||
| * Created by Stormeye on 2018/11/16. | |||
| */ | |||
| public enum EnumLoginType { | |||
| // 0-password, 1-nopassword | |||
| PASSWORD(0, "PASSWORD"), | |||
| NOPASSWD(1, "NOPASSWORD") | |||
| ; | |||
| public static EnumLoginType getEnum(Integer code) { | |||
| for (EnumLoginType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumLoginType(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,36 @@ | |||
| package com.iformall.enums; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumMallUserStatus { | |||
| VALID(1, "有效"), | |||
| NOT_VALID(0, "无效") | |||
| ; | |||
| public static EnumMallUserStatus getEnum(Integer code) { | |||
| for (EnumMallUserStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumMallUserStatus(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; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumTemplateType { | |||
| // 1-核销成功消息, 2-核销失败消息 | |||
| VERIFY_SUCCESS(1, "核销成功消息"), | |||
| VERIFY_FAIL(2, "核销失败消息"), | |||
| AUDIT_MESSAGE(3, "审核结果通知") | |||
| ; | |||
| public static EnumTemplateType getEnum(Integer code) { | |||
| for (EnumTemplateType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumTemplateType(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; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumUserWechat { | |||
| // 微信第三方web登录 0-已绑定,1-未绑定 | |||
| HAD(0, "已绑定"), | |||
| NO(1, "未绑定") | |||
| ; | |||
| public static EnumUserWechat getEnum(Integer code) { | |||
| for (EnumUserWechat value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumUserWechat(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; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumWeappAuditStatus { | |||
| // 0为审核成功,1为审核失败,2为审核中,3已撤回 | |||
| SUCCESS(0, "审核成功"), | |||
| FAIL(1, "审核失败"), | |||
| AUDITING(2, "审核中"), | |||
| UNDO(3, "已撤回"), | |||
| ; | |||
| public static EnumWeappAuditStatus getEnum(Integer code) { | |||
| for (EnumWeappAuditStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumWeappAuditStatus(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; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumWeappCodeCommitStatus { | |||
| // 0: 提交成功, 1: 提交失败, ; | |||
| SUCCESS(0, "提交成功"), | |||
| FAIL(1, "提交失败") | |||
| ; | |||
| public static EnumWeappCodeCommitStatus getEnum(Integer code) { | |||
| for (EnumWeappCodeCommitStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumWeappCodeCommitStatus(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; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumWeappReleaseStatus { | |||
| // 0为发布成功,1为发布失败 | |||
| SUCCESS(0, "发布成功"), | |||
| FAIL(1, "发布失败"), | |||
| BACK(2, "发布回退"), | |||
| ; | |||
| public static EnumWeappReleaseStatus getEnum(Integer code) { | |||
| for (EnumWeappReleaseStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumWeappReleaseStatus(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; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumWxAuthorizationInfoType { | |||
| COMPONENT_VERIFY_TICKET(1, "component_verify_ticket"), | |||
| UNAUTHORIZED(2, "unauthorized"), | |||
| AUTHORIZED(3, "authorized"), | |||
| UPDATEAUTHORIZED(4, "updateauthorized") | |||
| ; | |||
| public static EnumWxAuthorizationInfoType getEnum(Integer code) { | |||
| for (EnumWxAuthorizationInfoType value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumWxAuthorizationInfoType(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; | |||
| /** | |||
| * Created by Stormeye on 2018/08/09. | |||
| */ | |||
| public enum EnumWxAuthorizationStatus { | |||
| // 0-authorized, 1-unauthorized | |||
| AUTHORIZED(0, "authorized"), | |||
| UNAUTHORIZED(1, "unauthorized") | |||
| ; | |||
| public static EnumWxAuthorizationStatus getEnum(Integer code) { | |||
| for (EnumWxAuthorizationStatus value : values()) { | |||
| if (value.getCode().equals(code)) { | |||
| return value; | |||
| } | |||
| } | |||
| return null; | |||
| } | |||
| private Integer code; | |||
| private String message; | |||
| EnumWxAuthorizationStatus(Integer code, String message) { | |||
| this.code = code; | |||
| this.message = message; | |||
| } | |||
| public Integer getCode() { | |||
| return code; | |||
| } | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,36 @@ | |||
| package com.iformall.exception; | |||
| import com.iformall.common.ErrorCode; | |||
| /** | |||
| * Created by Stormeye on 2018/8/10. | |||
| */ | |||
| public class MallinkException extends RuntimeException { | |||
| private int errorCode; | |||
| private String message; | |||
| public MallinkException(int errorC, String message) { | |||
| this.errorCode = errorC; | |||
| this.message = message; | |||
| } | |||
| public MallinkException(ErrorCode errCode) { | |||
| this.errorCode = errCode.getCode(); | |||
| this.message = errCode.getMessage(); | |||
| } | |||
| public MallinkException() { | |||
| super(); | |||
| } | |||
| public int getErrorCode() { | |||
| return errorCode; | |||
| } | |||
| @Override | |||
| public String getMessage() { | |||
| return message; | |||
| } | |||
| } | |||
| @@ -0,0 +1,20 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.MallPermission; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| public interface MallPermissionMapper extends CommonMapper<MallPermission, String> { | |||
| List<MallPermission> findList(MallPermission mallPermission); | |||
| List<MallPermission> findPermissionByRoleId(Long roleId); | |||
| List<MallPermission> findPermissionByRoleIds(@Param("roleIds") List<Long> roleIds); | |||
| } | |||
| @@ -0,0 +1,38 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.vo.MallUserInfoVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface MallUserInfoMapper extends CommonMapper<MallUserInfo, String> { | |||
| MallUserInfo selectById(@Param("id") Long id); | |||
| List<MallUserInfo> findList(MallUserInfo mallUserInfo); | |||
| MallUserInfo selectByUserName(@Param("username") String username); | |||
| MallUserInfo selectByUserNameWebOpen(@Param("username") String username, @Param("webOpenId") String webOpenId); | |||
| MallUserInfo selectByBOpenId(@Param("bopenId") String bopenId, @Param("tenantId") String tenantId); | |||
| List<MallUserInfo> selectByWebOpenId(@Param("webOpenId") String webOpenId); | |||
| void removeWebOpenId(MallUserInfo mallUserInfo); | |||
| MallUserInfo selectByPhone(@Param("phone") String phone, @Param("tenantId") String tenantId); | |||
| Integer hasButtonPermission(@Param("userId") Long userId, @Param("permission") String permission); | |||
| long cntByUserName(Map<String,Object> params); | |||
| List<MallUserInfoVo> selectUsersByPhone(@Param("phone") String phone); | |||
| List<MallUserInfoVo> selectUsersByWebOpenId(@Param("webOpenId") String webOpenId); | |||
| } | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| public interface WxAppinfoMapper extends CommonMapper<WxAppinfo, Long> { | |||
| List<WxAppinfo> findList(WxAppinfo wxAppinfo); | |||
| WxAppinfo findByAppId(String appId); | |||
| } | |||
| @@ -0,0 +1,21 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxAuthorizerInfo; | |||
| import com.iformall.domain.vo.WxWeappInfo; | |||
| public interface WxAuthorizerInfoMapper extends CommonMapper<WxAuthorizerInfo, Long> { | |||
| List<WxAuthorizerInfo> findList(WxAuthorizerInfo wxAuthorizerInfo); | |||
| List<WxWeappInfo> findVoList(WxWeappInfo wxWeappInfo); | |||
| void updateReleaseInfo(WxAuthorizerInfo wxAuthorizerInfo); | |||
| } | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxComponentVerifyTicket; | |||
| public interface WxComponentVerifyTicketMapper extends CommonMapper<WxComponentVerifyTicket, Long> { | |||
| List<WxComponentVerifyTicket> findList(WxComponentVerifyTicket wxComponentVerifyTicket); | |||
| } | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxPayAccount; | |||
| public interface WxPayAccountMapper extends CommonMapper<WxPayAccount, Long> { | |||
| List<WxPayAccount> findList(WxPayAccount wxPayAccount); | |||
| } | |||
| @@ -0,0 +1,13 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxPayOrder; | |||
| import com.iformall.domain.vo.WxPayOrderVo; | |||
| public interface WxPayOrderMapper extends CommonMapper<WxPayOrder, Long> { | |||
| List<WxPayOrder> findList(WxPayOrder wxPayOrder); | |||
| List<WxPayOrderVo> findListOfPaidOrderByDate(Map dateMap); | |||
| } | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxTemplateMsg; | |||
| public interface WxTemplateMsgMapper extends CommonMapper<WxTemplateMsg, Long> { | |||
| List<WxTemplateMsg> findList(WxTemplateMsg wxTemplateMsg); | |||
| } | |||
| @@ -0,0 +1,24 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxWeappAuditStatus; | |||
| import com.iformall.domain.vo.WxWeappAuditStatusVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface WxWeappAuditStatusMapper extends CommonMapper<WxWeappAuditStatus, Long> { | |||
| List<WxWeappAuditStatus> findList(WxWeappAuditStatus weappAuditStatus); | |||
| List<WxWeappAuditStatusVo> findVoList(WxWeappAuditStatusVo weappAuditStatusVo); | |||
| List<Map> findUserVersions(@Param(value = "type") Integer type, @Param(value = "auditStatus") Integer auditStatus); | |||
| void updateStatus(WxWeappAuditStatus record); | |||
| } | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxWeappBasicSet; | |||
| public interface WxWeappBasicSetMapper extends CommonMapper<WxWeappBasicSet, Long> { | |||
| List<WxWeappBasicSet> findList(WxWeappBasicSet wxWeappBasicSet); | |||
| } | |||
| @@ -0,0 +1,24 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxWeappCodeStatus; | |||
| import com.iformall.domain.vo.WxWeappCodeStatusVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface WxWeappCodeStatusMapper extends CommonMapper<WxWeappCodeStatus, Long> { | |||
| List<WxWeappCodeStatus> findList(WxWeappCodeStatus weappCodeStatus); | |||
| List<WxWeappCodeStatusVo> findVoList(WxWeappCodeStatusVo weappCodeStatusVo); | |||
| List<Map> findUserVersions(@Param(value = "type") Integer type); | |||
| void updateStatus(WxWeappCodeStatus weappCodeStatus); | |||
| } | |||
| @@ -0,0 +1,16 @@ | |||
| package com.iformall.mapper; | |||
| import java.util.*; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxWeappExtSet; | |||
| public interface WxWeappExtSetMapper extends CommonMapper<WxWeappExtSet, Long> { | |||
| List<WxWeappExtSet> findList(WxWeappExtSet wxWeappReleaseSet); | |||
| } | |||
| @@ -0,0 +1,24 @@ | |||
| package com.iformall.mapper; | |||
| import com.iformall.common.CommonMapper; | |||
| import com.iformall.domain.po.WxWeappReleaseStatus; | |||
| import com.iformall.domain.vo.WxWeappReleaseStatusVo; | |||
| import org.apache.ibatis.annotations.Param; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface WxWeappReleaseStatusMapper extends CommonMapper<WxWeappReleaseStatus, Long> { | |||
| List<WxWeappReleaseStatus> findList(WxWeappReleaseStatus wxWeappReleaseStatus); | |||
| List<WxWeappReleaseStatusVo> findVoList(WxWeappReleaseStatusVo weappReleaseStatusVo); | |||
| List<Map> findUserVersions(@Param(value = "type") Integer type); | |||
| void updateStatus(WxWeappReleaseStatus weappRelaseStatus); | |||
| } | |||
| @@ -0,0 +1,131 @@ | |||
| package com.iformall.service; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.core.io.FileSystemResource; | |||
| import org.springframework.mail.SimpleMailMessage; | |||
| import org.springframework.mail.javamail.JavaMailSender; | |||
| import org.springframework.mail.javamail.MimeMessageHelper; | |||
| import org.springframework.stereotype.Service; | |||
| import javax.mail.MessagingException; | |||
| import javax.mail.internet.MimeMessage; | |||
| import java.io.File; | |||
| @Service | |||
| public class MailService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| private JavaMailSender sender; | |||
| @Value("${spring.mail.username}") | |||
| private String from; | |||
| /** | |||
| * 发送纯文本的简单邮件 | |||
| * @param to | |||
| * @param subject | |||
| * @param content | |||
| */ | |||
| public void sendSimpleMail(String[] to, String subject, String content){ | |||
| SimpleMailMessage message = new SimpleMailMessage(); | |||
| message.setFrom(from); | |||
| message.setTo(to); | |||
| message.setSubject(subject); | |||
| message.setText(content); | |||
| try { | |||
| sender.send(message); | |||
| logger.info("简单邮件已经发送。"); | |||
| } catch (Exception e) { | |||
| logger.error("发送简单邮件时发生异常!", e); | |||
| } | |||
| } | |||
| /** | |||
| * 发送html格式的邮件 | |||
| * @param to | |||
| * @param subject | |||
| * @param content | |||
| */ | |||
| public void sendHtmlMail(String to, String subject, String content){ | |||
| MimeMessage message = sender.createMimeMessage(); | |||
| try { | |||
| //true表示需要创建一个multipart message | |||
| MimeMessageHelper helper = new MimeMessageHelper(message, true); | |||
| helper.setFrom(from); | |||
| helper.setTo(to); | |||
| helper.setSubject(subject); | |||
| helper.setText(content, true); | |||
| sender.send(message); | |||
| logger.info("html邮件已经发送。"); | |||
| } catch (MessagingException e) { | |||
| logger.error("发送html邮件时发生异常!", e); | |||
| } | |||
| } | |||
| /** | |||
| * 发送带附件的邮件 | |||
| * @param to | |||
| * @param subject | |||
| * @param content | |||
| * @param filePath | |||
| */ | |||
| public void sendAttachmentsMail(String to, String subject, String content, String filePath){ | |||
| MimeMessage message = sender.createMimeMessage(); | |||
| try { | |||
| //true表示需要创建一个multipart message | |||
| MimeMessageHelper helper = new MimeMessageHelper(message, true); | |||
| helper.setFrom(from); | |||
| helper.setTo(to); | |||
| helper.setSubject(subject); | |||
| helper.setText(content, true); | |||
| FileSystemResource file = new FileSystemResource(new File(filePath)); | |||
| String fileName = filePath.substring(filePath.lastIndexOf(File.separator)); | |||
| helper.addAttachment(fileName, file); | |||
| sender.send(message); | |||
| logger.info("带附件的邮件已经发送。"); | |||
| } catch (MessagingException e) { | |||
| logger.error("发送带附件的邮件时发生异常!", e); | |||
| } | |||
| } | |||
| /** | |||
| * 发送嵌入静态资源(一般是图片)的邮件 | |||
| * @param to | |||
| * @param subject | |||
| * @param content 邮件内容,需要包括一个静态资源的id,比如:<img src=\"cid:rscId01\" > | |||
| * @param rscPath 静态资源路径和文件名 | |||
| * @param rscId 静态资源id | |||
| */ | |||
| public void sendInlineResourceMail(String to, String subject, String content, String rscPath, String rscId){ | |||
| MimeMessage message = sender.createMimeMessage(); | |||
| try { | |||
| //true表示需要创建一个multipart message | |||
| MimeMessageHelper helper = new MimeMessageHelper(message, true); | |||
| helper.setFrom(from); | |||
| helper.setTo(to); | |||
| helper.setSubject(subject); | |||
| helper.setText(content, true); | |||
| FileSystemResource res = new FileSystemResource(new File(rscPath)); | |||
| helper.addInline(rscId, res); | |||
| sender.send(message); | |||
| logger.info("嵌入静态资源的邮件已经发送。"); | |||
| } catch (MessagingException e) { | |||
| logger.error("发送嵌入静态资源的邮件时发生异常!", e); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,62 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.MallPermission; | |||
| import java.util.List; | |||
| public interface MallPermissionService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param offset | |||
| * @param limit | |||
| * @return | |||
| */ | |||
| PageInfo<MallPermission> listAsPage(MallPermission record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| MallPermission getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(MallPermission record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| /** | |||
| * 根据roleId查询菜单和按钮权限 | |||
| * @param roleId | |||
| * @return | |||
| */ | |||
| List<MallPermission> findPermissionByRoleId(Long roleId); | |||
| /** | |||
| * 根据ruleId权限组查找相应权限 | |||
| * @param roleIds | |||
| * @return | |||
| */ | |||
| List<MallPermission> findPermissionByRoleIds(List<Long> roleIds); | |||
| } | |||
| @@ -0,0 +1,124 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.vo.MallUserInfoVo; | |||
| import java.util.List; | |||
| public interface MallUserInfoService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<MallUserInfo> listAsPage(MallUserInfo record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询列表 | |||
| * @param record | |||
| * @return | |||
| */ | |||
| int cntUserList(MallUserInfo record); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| MallUserInfo getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(MallUserInfo record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| /** | |||
| * 查询用户名总数,用于校验用户名是否重复 | |||
| * @param username | |||
| */ | |||
| long cntByUserName(String username); | |||
| /** | |||
| * 根据用户名查询用户对象 | |||
| * @param username | |||
| * @return | |||
| */ | |||
| MallUserInfo getByUsername(String username); | |||
| /** | |||
| * 检查用户按钮是否有权限 | |||
| * @param userId | |||
| * @param permission | |||
| * @return 是否有权限(true: 有| false: 没有) | |||
| */ | |||
| boolean hasButtonPermission(Long userId, String permission); | |||
| boolean cntByUserName(String username, Long id); | |||
| boolean cntByUserPhone(String phone, Long id); | |||
| /** | |||
| * 根据phone获得实体 | |||
| * | |||
| * @param phone | |||
| * @return | |||
| */ | |||
| MallUserInfo getByPhone(String phone, String tenantId); | |||
| /** | |||
| * 根据phone获得实体列表 | |||
| * | |||
| * @param phone | |||
| * @return | |||
| */ | |||
| List<MallUserInfoVo> getUserByPhone(String phone); | |||
| /** | |||
| * 根据B端OpenId获得实体 | |||
| * | |||
| * @param openId | |||
| * @return | |||
| */ | |||
| MallUserInfo getByBOpenId(String openId, String tenantId); | |||
| void updateBOpenId(MallUserInfo user); | |||
| /** | |||
| * 根据web端OpenId获得实体 | |||
| * | |||
| * @param webOpenId | |||
| * @return | |||
| */ | |||
| List<MallUserInfo> getByWebOpenId(String webOpenId); | |||
| /** | |||
| * 根据phone获得展示列表 | |||
| * | |||
| * @param webOpenId | |||
| * @return | |||
| */ | |||
| List<MallUserInfoVo> getUsersByWebOpenId(String webOpenId); | |||
| /** | |||
| * 根据条件用户列表 | |||
| * @return | |||
| */ | |||
| List<MallUserInfo> findList(MallUserInfo record); | |||
| } | |||
| @@ -0,0 +1,71 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| public interface WxAppinfoService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxAppinfo> listAsPage(WxAppinfo record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxAppinfo getById(Long id); | |||
| /** | |||
| * 根据appId获得实体 | |||
| * | |||
| * @param appId | |||
| * @return | |||
| */ | |||
| WxAppinfo getByAppId(String appId); | |||
| /** | |||
| * 获取c端小程序信息 | |||
| * @return | |||
| */ | |||
| WxAppinfo getCAppInfo(String tenantId); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxAppinfo record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| /** | |||
| * 更新accessToken | |||
| * @param appId | |||
| */ | |||
| void ctokenUpdate(String appId); | |||
| /** | |||
| * 位置码/导购码生成 | |||
| */ | |||
| void exportQrcode(HttpServletRequest request, HttpServletResponse response, | |||
| String appId, int type, String pageUrl, String sceneParam, | |||
| int withText, String text1, String text2); | |||
| } | |||
| @@ -0,0 +1,81 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxAuthorizerInfo; | |||
| import com.iformall.domain.vo.WxWeappInfo; | |||
| import java.util.List; | |||
| public interface WxAuthorizerInfoService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxAuthorizerInfo> listAsPage(WxAuthorizerInfo record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxWeappInfo> listVoAsPage(WxWeappInfo record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询列表 | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<WxWeappInfo> getList(WxWeappInfo record); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxAuthorizerInfo getById(Long id); | |||
| /** | |||
| * 根据appId获得实体 | |||
| * | |||
| * @param appId | |||
| * @return | |||
| */ | |||
| WxAuthorizerInfo getByAppId(String appId); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxAuthorizerInfo record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| void updateReleaseVersion(WxAuthorizerInfo record); | |||
| void updateBaseVersion(WxAuthorizerInfo record); | |||
| void updateDomainUrl(WxAuthorizerInfo record); | |||
| void updateWebDomainUrl(WxAuthorizerInfo record); | |||
| void updateTemplate(WxAuthorizerInfo record); | |||
| void updateOpenAppid(WxAuthorizerInfo record); | |||
| } | |||
| @@ -0,0 +1,41 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxComponentVerifyTicket; | |||
| public interface WxComponentVerifyTicketService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxComponentVerifyTicket> listAsPage(WxComponentVerifyTicket record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxComponentVerifyTicket getById(Long id); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxComponentVerifyTicket record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,55 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxTemplateMsg; | |||
| public interface WxTemplateMsgService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxTemplateMsg> listAsPage(WxTemplateMsg record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxTemplateMsg getById(Long id); | |||
| /** | |||
| * 根据Obj获得实体 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| WxTemplateMsg getByObj(WxTemplateMsg record); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxTemplateMsg record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,75 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxWeappAuditStatus; | |||
| import com.iformall.domain.vo.WxWeappAuditStatusVo; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface WxWeappAuditStatusService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxWeappAuditStatusVo> listAsPage(WxWeappAuditStatusVo record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询列表 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<WxWeappAuditStatusVo> getList(WxWeappAuditStatusVo record); | |||
| /** | |||
| * 查询version列表 | |||
| * | |||
| * @return | |||
| */ | |||
| List<Map> getVersionList(Integer type, Integer auditStatus); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxWeappAuditStatus getById(Long id); | |||
| /** | |||
| * 根据appId获得实体 | |||
| * | |||
| * @param appId | |||
| * @return | |||
| */ | |||
| WxWeappAuditStatus getByAppId(String appId); | |||
| /** | |||
| * 保存实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveStatus(WxWeappAuditStatus record); | |||
| /** | |||
| * 更新audit Status | |||
| * | |||
| * @param record | |||
| */ | |||
| void updateStatus(WxWeappAuditStatus record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,54 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxWeappBasicSet; | |||
| public interface WxWeappBasicSetService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxWeappBasicSet> listAsPage(WxWeappBasicSet record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxWeappBasicSet getById(Long id); | |||
| /** | |||
| * 根据type and deploy获取 | |||
| * @param weappBasicSet | |||
| * @return | |||
| */ | |||
| WxWeappBasicSet getByTypeAndDeploy(WxWeappBasicSet weappBasicSet); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxWeappBasicSet record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,75 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxWeappCodeStatus; | |||
| import com.iformall.domain.vo.WxWeappCodeStatusVo; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface WxWeappCodeStatusService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxWeappCodeStatusVo> listAsPage(WxWeappCodeStatusVo record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询列表 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<WxWeappCodeStatusVo> getList(WxWeappCodeStatusVo record); | |||
| /** | |||
| * 查询version列表 | |||
| * | |||
| * @return | |||
| */ | |||
| List<Map> getVersionList(Integer type); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxWeappCodeStatus getById(Long id); | |||
| /** | |||
| * 根据appId获得实体 | |||
| * | |||
| * @param appId | |||
| * @return | |||
| */ | |||
| WxWeappCodeStatus getByAppId(String appId); | |||
| /** | |||
| * 保存实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveStatus(WxWeappCodeStatus record); | |||
| /** | |||
| * 更新codeCommit Status | |||
| * | |||
| * @param record | |||
| */ | |||
| void updateStatus(WxWeappCodeStatus record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,55 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxWeappExtSet; | |||
| public interface WxWeappExtSetService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxWeappExtSet> listAsPage(WxWeappExtSet record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxWeappExtSet getById(Long id); | |||
| /** | |||
| * 根据Obj获得实体 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| WxWeappExtSet getByObj(WxWeappExtSet record); | |||
| /** | |||
| * 保存或更新实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveOrUpdate(WxWeappExtSet record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,78 @@ | |||
| package com.iformall.service; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxWeappCodeStatus; | |||
| import com.iformall.domain.po.WxWeappReleaseStatus; | |||
| import com.iformall.domain.vo.WxWeappAuditStatusVo; | |||
| import com.iformall.domain.vo.WxWeappCodeStatusVo; | |||
| import com.iformall.domain.vo.WxWeappReleaseStatusVo; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| public interface WxWeappReleaseStatusService { | |||
| /** | |||
| * 根据实体查询分页列表 | |||
| * | |||
| * @param record | |||
| * @param pageIndex | |||
| * @param pageSize | |||
| * @return | |||
| */ | |||
| PageInfo<WxWeappReleaseStatusVo> listAsPage(WxWeappReleaseStatusVo record, Integer pageIndex, Integer pageSize); | |||
| /** | |||
| * 根据实体查询列表 | |||
| * | |||
| * @param record | |||
| * @return | |||
| */ | |||
| List<WxWeappReleaseStatusVo> getList(WxWeappReleaseStatusVo record); | |||
| /** | |||
| * 查询version列表 | |||
| * | |||
| * @return | |||
| */ | |||
| List<Map> getVersionList(Integer type); | |||
| /** | |||
| * 根据Id获得实体 | |||
| * | |||
| * @param id | |||
| * @return | |||
| */ | |||
| WxWeappReleaseStatus getById(Long id); | |||
| /** | |||
| * 根据appId获得实体 | |||
| * | |||
| * @param appId | |||
| * @return | |||
| */ | |||
| WxWeappReleaseStatus getByAppId(String appId); | |||
| /** | |||
| * 保存实体 | |||
| * | |||
| * @param record | |||
| */ | |||
| void saveStatus(WxWeappReleaseStatus record); | |||
| /** | |||
| * 更新release Status | |||
| * | |||
| * @param record | |||
| */ | |||
| void updateStatus(WxWeappReleaseStatus record); | |||
| /** | |||
| * 根据Id删除实体 | |||
| * | |||
| * @param id | |||
| */ | |||
| void deleteById(Long id); | |||
| } | |||
| @@ -0,0 +1,67 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.MallPermission; | |||
| import com.iformall.mapper.MallPermissionMapper; | |||
| import com.iformall.service.MallPermissionService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| @Service | |||
| public class MallPermissionServiceImpl implements MallPermissionService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| MallPermissionMapper mallPermissionMapper; | |||
| @Override | |||
| public PageInfo<MallPermission> listAsPage(MallPermission record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> mallPermissionMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public MallPermission getById(Long id) { | |||
| return mallPermissionMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(MallPermission record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| mallPermissionMapper.insertSelective(record); | |||
| } else { | |||
| mallPermissionMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| mallPermissionMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public List<MallPermission> findPermissionByRoleId(Long roleId) { | |||
| return mallPermissionMapper.findPermissionByRoleId(roleId); | |||
| } | |||
| @Override | |||
| public List<MallPermission> findPermissionByRoleIds(List<Long> roleIds) { | |||
| return mallPermissionMapper.findPermissionByRoleIds(roleIds); | |||
| } | |||
| } | |||
| @@ -0,0 +1,138 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.common.ResultData; | |||
| import com.iformall.domain.po.MallUserInfo; | |||
| import com.iformall.domain.vo.MallUserInfoVo; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.MallUserInfoMapper; | |||
| import com.iformall.service.MallUserInfoService; | |||
| 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.Service; | |||
| import java.util.HashMap; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @Service | |||
| public class MallUserInfoServiceImpl implements MallUserInfoService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| MallUserInfoMapper mallUserInfoMapper; | |||
| @Override | |||
| public PageInfo<MallUserInfo> listAsPage(MallUserInfo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> mallUserInfoMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public int cntUserList(MallUserInfo record) { | |||
| return mallUserInfoMapper.selectCount(record); | |||
| } | |||
| @Override | |||
| public MallUserInfo getById(Long id) { | |||
| return mallUserInfoMapper.selectById(id); | |||
| } | |||
| @Override | |||
| public MallUserInfo getByBOpenId(String openId, String tenantId) { | |||
| return mallUserInfoMapper.selectByBOpenId(openId, tenantId); | |||
| } | |||
| @Override | |||
| public void updateBOpenId(MallUserInfo user) { | |||
| MallUserInfo updateUser = new MallUserInfo(); | |||
| updateUser.setId(user.getId()); | |||
| updateUser.setBopenId(user.getBopenId()); | |||
| mallUserInfoMapper.updateByPrimaryKeySelective(user); | |||
| } | |||
| @Override | |||
| public MallUserInfo getByPhone(String phone, String tenantId) { | |||
| return mallUserInfoMapper.selectByPhone(phone, tenantId); | |||
| } | |||
| @Override | |||
| public List<MallUserInfoVo> getUserByPhone(String phone) { | |||
| return mallUserInfoMapper.selectUsersByPhone(phone); | |||
| } | |||
| @Override | |||
| public List<MallUserInfo> getByWebOpenId(String webOpenId) { | |||
| return mallUserInfoMapper.selectByWebOpenId(webOpenId); | |||
| } | |||
| @Override | |||
| public List<MallUserInfoVo> getUsersByWebOpenId(String webOpenId) { | |||
| return mallUserInfoMapper.selectUsersByWebOpenId(webOpenId); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(MallUserInfo record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| if(StringUtils.isBlank(record.getFlowPermission())){ | |||
| record.setFlowPermission("[]"); | |||
| } | |||
| mallUserInfoMapper.insertSelective(record); | |||
| } else { | |||
| mallUserInfoMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| mallUserInfoMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public MallUserInfo getByUsername(String username) { | |||
| return mallUserInfoMapper.selectByUserName(username); | |||
| } | |||
| @Override | |||
| public long cntByUserName(String username) { | |||
| MallUserInfo userInfo = new MallUserInfo(); | |||
| userInfo.setUsername(username); | |||
| return PageHelper.count(() -> mallUserInfoMapper.select(userInfo)); | |||
| } | |||
| @Override | |||
| public boolean hasButtonPermission(Long userId, String permission) { | |||
| return mallUserInfoMapper.hasButtonPermission(userId, permission) == null ? false : true; | |||
| } | |||
| @Override | |||
| public boolean cntByUserName(String username, Long id) { | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("username", username); | |||
| params.put("id", id); | |||
| return mallUserInfoMapper.cntByUserName(params) > 0 ? true : false; | |||
| } | |||
| @Override | |||
| public boolean cntByUserPhone(String phone, Long id) { | |||
| Map<String, Object> params = new HashMap<>(); | |||
| params.put("phone", phone); | |||
| params.put("id", id); | |||
| return mallUserInfoMapper.cntByUserName(params) > 0 ? true : false; | |||
| } | |||
| @Override | |||
| public List<MallUserInfo> findList(MallUserInfo record){ | |||
| return mallUserInfoMapper.findList(record); | |||
| } | |||
| } | |||
| @@ -0,0 +1,243 @@ | |||
| package com.iformall.service.impl; | |||
| import cn.binarywang.wx.miniapp.api.WxMaService; | |||
| import cn.binarywang.wx.miniapp.api.impl.WxMaServiceImpl; | |||
| import cn.binarywang.wx.miniapp.bean.WxMaCodeLineColor; | |||
| import cn.binarywang.wx.miniapp.config.WxMaInMemoryConfig; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.ErrorCode; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.enums.EnumAppType; | |||
| import com.iformall.exception.MallinkException; | |||
| import com.iformall.mapper.WxAppinfoMapper; | |||
| import com.iformall.service.WxAppinfoService; | |||
| import com.iformall.utils.Constant; | |||
| import com.iformall.utils.QRCodeUtils; | |||
| import me.chanjar.weixin.common.error.WxErrorException; | |||
| 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.Service; | |||
| import com.iformall.common.IdWorker; | |||
| 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.Date; | |||
| import java.util.List; | |||
| @Service | |||
| public class WxAppinfoServiceImpl implements WxAppinfoService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxAppinfoMapper wxAppinfoMapper; | |||
| @Override | |||
| public WxAppinfo getCAppInfo(String tenantId) { | |||
| WxAppinfo appInfo = null; | |||
| WxAppinfo appinfoQ = new WxAppinfo(); | |||
| appinfoQ.setTenantId(tenantId); | |||
| appinfoQ.setType(EnumAppType.C.getCode()); | |||
| List<WxAppinfo> appList = wxAppinfoMapper.select(appinfoQ); | |||
| if (appList.size() > 0) { | |||
| appInfo = appList.get(0); | |||
| } | |||
| return appInfo; | |||
| } | |||
| @Override | |||
| public WxAppinfo getByAppId(String appId) { | |||
| return wxAppinfoMapper.findByAppId(appId); | |||
| } | |||
| @Override | |||
| public PageInfo<WxAppinfo> listAsPage(WxAppinfo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxAppinfoMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxAppinfo getById(Long id) { | |||
| return wxAppinfoMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxAppinfo record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxAppinfoMapper.insertSelective(record); | |||
| } else { | |||
| wxAppinfoMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxAppinfoMapper.deleteByPrimaryKey(id); | |||
| } | |||
| /** | |||
| * 租户c端小程序更新token | |||
| * @param tenantId | |||
| */ | |||
| @Override | |||
| public void ctokenUpdate(String tenantId) { | |||
| WxAppinfo appQ = new WxAppinfo(); | |||
| appQ.setTenantId(tenantId); | |||
| appQ.setType(EnumAppType.C.getCode()); | |||
| List<WxAppinfo> appList = wxAppinfoMapper.findList(appQ); | |||
| if (appList.size() <= 0) { | |||
| return; | |||
| } | |||
| WxAppinfo appinfo = appList.get(0); | |||
| // get access_token | |||
| WxMaInMemoryConfig config = new WxMaInMemoryConfig(); | |||
| config.setAppid(appinfo.getAppId()); | |||
| config.setSecret(appinfo.getSecret()); | |||
| if (null != appinfo.getAccessToken()) { | |||
| config.setAccessToken(appinfo.getAccessToken()); | |||
| config.setExpiresTime(appinfo.getLastTokenTime().getTime()); | |||
| } | |||
| WxMaService wxMaService = new WxMaServiceImpl(); | |||
| wxMaService.setWxMaConfig(config); | |||
| String access_token = ""; | |||
| try{ | |||
| access_token = wxMaService.getAccessToken(); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| Date date = new Date(); | |||
| // update db | |||
| appinfo.setAccessToken(access_token); | |||
| appinfo.setLastTokenTime(date); | |||
| wxAppinfoMapper.updateByPrimaryKeySelective(appinfo); | |||
| } | |||
| private void downFile(String filePath, String filename, HttpServletResponse response, HttpServletRequest req) throws IOException { | |||
| try { | |||
| response.reset(); | |||
| response.setContentType("bin"); | |||
| String agent = req.getHeader("user-agent"); | |||
| 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(filePath); | |||
| while ((len = inStream.read(b)) > 0) | |||
| response.getOutputStream().write(b, 0, len); | |||
| inStream.close(); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| @Override | |||
| public void exportQrcode(HttpServletRequest request, HttpServletResponse response, | |||
| String tenantId, int type, String pageUrl, String sceneParam, | |||
| int withText, String text1, String text2 ) { | |||
| // type 0 有限二维码, 1 无限制二维码 | |||
| // withText 0 不带字 1. 带下面的字,2 带下面的两行字 | |||
| WxAppinfo appQ = new WxAppinfo(); | |||
| appQ.setTenantId(tenantId); | |||
| appQ.setType(EnumAppType.C.getCode()); | |||
| List<WxAppinfo> appList = wxAppinfoMapper.findList(appQ); | |||
| if (appList.size() <= 0) { | |||
| return; | |||
| } | |||
| WxAppinfo appinfo = appList.get(0); | |||
| boolean autoColor = false; | |||
| boolean isHyaline = true; | |||
| WxMaCodeLineColor color = new WxMaCodeLineColor("0", "0", "0"); | |||
| WxMaInMemoryConfig config = new WxMaInMemoryConfig(); | |||
| config.setAppid(appinfo.getAppId()); | |||
| config.setSecret(appinfo.getSecret()); | |||
| WxMaService wxMaService = new WxMaServiceImpl(); | |||
| wxMaService.setWxMaConfig(config); | |||
| String pathStr = ""; | |||
| if (StringUtils.isNotBlank(sceneParam)) { | |||
| pathStr = pageUrl + "?scene="+sceneParam; | |||
| } else { | |||
| pathStr = pageUrl; | |||
| } | |||
| String filepath = Constant.fileDirectory; | |||
| String fileName = sceneParam + ".png"; | |||
| String destPath1 = filepath + "1_" + fileName; | |||
| String destPath = filepath + fileName; | |||
| File dest = new File(destPath); | |||
| File pDest = dest.getParentFile(); | |||
| if (!pDest.exists()) { | |||
| pDest.mkdirs(); | |||
| } | |||
| try { | |||
| Date imgDate = new Date(); | |||
| if(type == 0) { | |||
| final File codeFile = wxMaService.getQrcodeService().createQrcode(pathStr, QRCodeUtils.QR_WIDTH); | |||
| if (withText == 1) { | |||
| File dest1 = new File(destPath1); | |||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||
| QRCodeUtils.graphicsGeneration(dest1, dest, text1); | |||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||
| } else if (withText == 2) { | |||
| File dest1 = new File(destPath1); | |||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||
| QRCodeUtils.graphicsGeneration2(dest1, dest, text1, text2); | |||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||
| } else { | |||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest); | |||
| } | |||
| org.apache.commons.io.FileUtils.forceDelete(codeFile); | |||
| } else { | |||
| final File codeFile = wxMaService.getQrcodeService().createWxaCodeUnlimit(sceneParam, pageUrl, QRCodeUtils.QR_WIDTH, autoColor, color, isHyaline); | |||
| if (withText == 1) { | |||
| File dest1 = new File(destPath1); | |||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||
| QRCodeUtils.graphicsGeneration(dest1, dest, text1); | |||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||
| } else if (withText == 2) { | |||
| File dest1 = new File(destPath1); | |||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest1); | |||
| QRCodeUtils.graphicsGeneration2(dest1, dest, text1, text2); | |||
| org.apache.commons.io.FileUtils.forceDelete(dest1); | |||
| } else { | |||
| org.apache.commons.io.FileUtils.copyFile(codeFile, dest); | |||
| } | |||
| org.apache.commons.io.FileUtils.forceDelete(codeFile); | |||
| } | |||
| } catch (WxErrorException e) { | |||
| logger.error(e.getMessage()); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| try { | |||
| downFile(destPath, fileName, response, request); | |||
| org.apache.commons.io.FileUtils.forceDelete(dest); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| } | |||
| @@ -0,0 +1,184 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxAppinfo; | |||
| import com.iformall.domain.po.WxAuthorizerInfo; | |||
| import com.iformall.domain.po.WxWeappExtSet; | |||
| import com.iformall.domain.vo.WxWeappInfo; | |||
| import com.iformall.mapper.WxAppinfoMapper; | |||
| import com.iformall.mapper.WxAuthorizerInfoMapper; | |||
| import com.iformall.mapper.WxWeappExtSetMapper; | |||
| import com.iformall.service.WxAuthorizerInfoService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.common.IdWorker; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| @Service | |||
| public class WxAuthorizerInfoServiceImpl implements WxAuthorizerInfoService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxAuthorizerInfoMapper authorizerInfoMapper; | |||
| @Autowired | |||
| WxWeappExtSetMapper weappExtSetMapper; | |||
| @Autowired | |||
| WxAppinfoMapper appinfoMapper; | |||
| @Override | |||
| public PageInfo<WxAuthorizerInfo> listAsPage(WxAuthorizerInfo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> authorizerInfoMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public PageInfo<WxWeappInfo> listVoAsPage(WxWeappInfo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> authorizerInfoMapper.findVoList(record)); | |||
| } | |||
| @Override | |||
| public List<WxWeappInfo> getList(WxWeappInfo record) { | |||
| return authorizerInfoMapper.findVoList(record); | |||
| } | |||
| @Override | |||
| public WxAuthorizerInfo getById(Long id) { | |||
| return authorizerInfoMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public WxAuthorizerInfo getByAppId(String appId) { | |||
| WxAuthorizerInfo authQ = new WxAuthorizerInfo(); | |||
| authQ.setAuthorizerAppid(appId); | |||
| try { | |||
| WxAuthorizerInfo authorizerInfo = authorizerInfoMapper.selectOne(authQ); | |||
| return authorizerInfo; | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| return null; | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxAuthorizerInfo record) { | |||
| // 1. 添加到wx_authorizer_info表中 | |||
| // 2. 同时在wx_weapp_ext_set中添加一条记录 | |||
| // 3. 同时在wx_weapp_code_status中添加一条记录 | |||
| Date curDate = new Date(); | |||
| logger.info(record.toString()); | |||
| WxAuthorizerInfo authorizerInfo = null; | |||
| try { | |||
| WxAuthorizerInfo aiQ = new WxAuthorizerInfo(); | |||
| aiQ.setAuthorizerAppid(record.getAuthorizerAppid()); | |||
| authorizerInfo = authorizerInfoMapper.selectOne(aiQ); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| if (authorizerInfo == null) { | |||
| WxAppinfo appinfo = appinfoMapper.findByAppId(record.getAuthorizerAppid()); | |||
| if(appinfo != null) { | |||
| record.setId(appinfo.getId()); | |||
| } else { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| } | |||
| record.setCreateTime(curDate); | |||
| record.setUpdateTime(curDate); | |||
| // 授权表 添加 | |||
| authorizerInfoMapper.insertSelective(record); | |||
| // 扩展配置表添加 | |||
| WxWeappExtSet weappExtSet = new WxWeappExtSet(); | |||
| weappExtSet.setId(record.getId()); | |||
| weappExtSet.setAppId(record.getAuthorizerAppid()); | |||
| if(appinfo != null) { | |||
| weappExtSet.setType(appinfo.getType()); | |||
| } | |||
| weappExtSet.setCreateDate(curDate); | |||
| weappExtSet.setUpdateDate(curDate); | |||
| weappExtSetMapper.insertSelective(weappExtSet); | |||
| } else { | |||
| record.setId(authorizerInfo.getId()); | |||
| record.setUpdateTime(curDate); | |||
| logger.info(record.toString()); | |||
| authorizerInfoMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| authorizerInfoMapper.deleteByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void updateReleaseVersion(WxAuthorizerInfo record) { | |||
| authorizerInfoMapper.updateReleaseInfo(record); | |||
| } | |||
| @Override | |||
| public void updateBaseVersion(WxAuthorizerInfo record) { | |||
| Date curDate = new Date(); | |||
| WxAuthorizerInfo info = new WxAuthorizerInfo(); | |||
| info.setId(record.getId()); | |||
| info.setBaseStatus(record.getBaseStatus()); | |||
| info.setBaseTime(curDate); | |||
| info.setUpdateTime(curDate); | |||
| authorizerInfoMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| @Override | |||
| public void updateDomainUrl(WxAuthorizerInfo record) { | |||
| Date curDate = new Date(); | |||
| WxAuthorizerInfo info = new WxAuthorizerInfo(); | |||
| info.setId(record.getId()); | |||
| info.setDomainStatus(record.getDomainStatus()); | |||
| info.setDomainTime(curDate); | |||
| info.setUpdateTime(curDate); | |||
| authorizerInfoMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| @Override | |||
| public void updateWebDomainUrl(WxAuthorizerInfo record) { | |||
| Date curDate = new Date(); | |||
| WxAuthorizerInfo info = new WxAuthorizerInfo(); | |||
| info.setId(record.getId()); | |||
| info.setWebdomainStatus(record.getWebdomainStatus()); | |||
| info.setWebdomainTime(curDate); | |||
| info.setUpdateTime(curDate); | |||
| authorizerInfoMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| @Override | |||
| public void updateTemplate(WxAuthorizerInfo record) { | |||
| Date curDate = new Date(); | |||
| WxAuthorizerInfo info = new WxAuthorizerInfo(); | |||
| info.setId(record.getId()); | |||
| info.setTemplateStatus(record.getTemplateStatus()); | |||
| info.setTemplateTime(curDate); | |||
| info.setUpdateTime(curDate); | |||
| authorizerInfoMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| @Override | |||
| public void updateOpenAppid(WxAuthorizerInfo record) { | |||
| Date curDate = new Date(); | |||
| WxAuthorizerInfo info = new WxAuthorizerInfo(); | |||
| info.setId(record.getId()); | |||
| info.setOpenAppid(record.getOpenAppid()); | |||
| info.setBindOpenTime(curDate); | |||
| authorizerInfoMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @@ -0,0 +1,64 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxComponentVerifyTicket; | |||
| import com.iformall.mapper.WxComponentVerifyTicketMapper; | |||
| import com.iformall.service.WxComponentVerifyTicketService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.common.IdWorker; | |||
| @Service | |||
| public class WxComponentVerifyTicketServiceImpl implements WxComponentVerifyTicketService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxComponentVerifyTicketMapper wxComponentVerifyTicketMapper; | |||
| @Override | |||
| public PageInfo<WxComponentVerifyTicket> listAsPage(WxComponentVerifyTicket record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxComponentVerifyTicketMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxComponentVerifyTicket getById(Long id) { | |||
| return wxComponentVerifyTicketMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxComponentVerifyTicket record) { | |||
| WxComponentVerifyTicket wxComponentVerifyTicket = null; | |||
| try { | |||
| WxComponentVerifyTicket ctQ = new WxComponentVerifyTicket(); | |||
| ctQ.setComponentAppid(record.getComponentAppid()); | |||
| wxComponentVerifyTicket = wxComponentVerifyTicketMapper.selectOne(ctQ); | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| if (wxComponentVerifyTicket == null) { | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxComponentVerifyTicketMapper.insertSelective(record); | |||
| } else { | |||
| record.setId(wxComponentVerifyTicket.getId()); | |||
| wxComponentVerifyTicketMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxComponentVerifyTicketMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,67 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxTemplateMsg; | |||
| import com.iformall.mapper.WxTemplateMsgMapper; | |||
| import com.iformall.service.WxTemplateMsgService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.common.IdWorker; | |||
| import java.util.Date; | |||
| @Service | |||
| public class WxTemplateMsgServiceImpl implements WxTemplateMsgService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxTemplateMsgMapper wxTemplateMsgMapper; | |||
| @Override | |||
| public PageInfo<WxTemplateMsg> listAsPage(WxTemplateMsg record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxTemplateMsgMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxTemplateMsg getById(Long id) { | |||
| return wxTemplateMsgMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public WxTemplateMsg getByObj(WxTemplateMsg record) { | |||
| return wxTemplateMsgMapper.selectOne(record); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxTemplateMsg record) { | |||
| Date curDate = new Date(); | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| record.setCreateDate(curDate); | |||
| record.setUpdateDate(curDate); | |||
| wxTemplateMsgMapper.insertSelective(record); | |||
| } else { | |||
| record.setUpdateDate(curDate); | |||
| wxTemplateMsgMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxTemplateMsgMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,77 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxWeappAuditStatus; | |||
| import com.iformall.domain.vo.WxWeappAuditStatusVo; | |||
| import com.iformall.mapper.WxWeappAuditStatusMapper; | |||
| import com.iformall.service.WxWeappAuditStatusService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @Service | |||
| public class WxWeappAuditStatusServiceImpl implements WxWeappAuditStatusService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxWeappAuditStatusMapper weappAuditStatusMapper; | |||
| @Override | |||
| public PageInfo<WxWeappAuditStatusVo> listAsPage(WxWeappAuditStatusVo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> weappAuditStatusMapper.findVoList(record)); | |||
| } | |||
| @Override | |||
| public List<WxWeappAuditStatusVo> getList(WxWeappAuditStatusVo record) { | |||
| return weappAuditStatusMapper.findVoList(record); | |||
| } | |||
| @Override | |||
| public List<Map> getVersionList(Integer type, Integer auditStatus) { | |||
| return weappAuditStatusMapper.findUserVersions(type, auditStatus); | |||
| } | |||
| @Override | |||
| public WxWeappAuditStatus getById(Long id) { | |||
| return weappAuditStatusMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public WxWeappAuditStatus getByAppId(String appId) { | |||
| WxWeappAuditStatus statusQ = new WxWeappAuditStatus(); | |||
| statusQ.setAppId(appId); | |||
| return weappAuditStatusMapper.selectOne(statusQ); | |||
| } | |||
| @Override | |||
| public void saveStatus(WxWeappAuditStatus record) { | |||
| logger.info("AUDIT: " + record.toString()); | |||
| weappAuditStatusMapper.insertSelective(record); | |||
| } | |||
| @Override | |||
| public void updateStatus(WxWeappAuditStatus record) { | |||
| logger.info("AUDIT: " + record.toString()); | |||
| weappAuditStatusMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| weappAuditStatusMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,59 @@ | |||
| package com.iformall.service.impl; | |||
| import java.util.*; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxWeappBasicSet; | |||
| import com.iformall.mapper.WxWeappBasicSetMapper; | |||
| import com.iformall.service.WxWeappBasicSetService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.common.IdWorker; | |||
| @Service | |||
| public class WxWeappBasicSetServiceImpl implements WxWeappBasicSetService { | |||
| @Autowired | |||
| WxWeappBasicSetMapper wxWeappBasicSetMapper; | |||
| @Override | |||
| public PageInfo<WxWeappBasicSet> listAsPage(WxWeappBasicSet record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxWeappBasicSetMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxWeappBasicSet getById(Long id) { | |||
| return wxWeappBasicSetMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public WxWeappBasicSet getByTypeAndDeploy(WxWeappBasicSet weappBasicSet) { | |||
| return wxWeappBasicSetMapper.selectOne(weappBasicSet); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxWeappBasicSet record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxWeappBasicSetMapper.insertSelective(record); | |||
| } else { | |||
| wxWeappBasicSetMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxWeappBasicSetMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,79 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.common.IdWorker; | |||
| import com.iformall.domain.po.WxWeappCodeStatus; | |||
| import com.iformall.domain.vo.WxWeappCodeStatusVo; | |||
| import com.iformall.mapper.WxAuthorizerInfoMapper; | |||
| import com.iformall.mapper.WxWeappCodeStatusMapper; | |||
| import com.iformall.service.WxWeappCodeStatusService; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @Service | |||
| public class WxWeappCodeStatusServiceImpl implements WxWeappCodeStatusService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxWeappCodeStatusMapper weappCodeStatusMapper; | |||
| @Override | |||
| public PageInfo<WxWeappCodeStatusVo> listAsPage(WxWeappCodeStatusVo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> weappCodeStatusMapper.findVoList(record)); | |||
| } | |||
| @Override | |||
| public List<WxWeappCodeStatusVo> getList(WxWeappCodeStatusVo record) { | |||
| return weappCodeStatusMapper.findVoList(record); | |||
| } | |||
| @Override | |||
| public List<Map> getVersionList(Integer type) { | |||
| return weappCodeStatusMapper.findUserVersions(type); | |||
| } | |||
| @Override | |||
| public WxWeappCodeStatus getById(Long id) { | |||
| return weappCodeStatusMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public WxWeappCodeStatus getByAppId(String appId) { | |||
| WxWeappCodeStatus weappCodeStatusQ = new WxWeappCodeStatus(); | |||
| weappCodeStatusQ.setAppId(appId); | |||
| return weappCodeStatusMapper.selectOne(weappCodeStatusQ); | |||
| } | |||
| @Override | |||
| public void saveStatus(WxWeappCodeStatus record) { | |||
| logger.info("CODE-COMMIT: " + record.toString()); | |||
| weappCodeStatusMapper.insertSelective(record); | |||
| } | |||
| @Override | |||
| public void updateStatus(WxWeappCodeStatus record) { | |||
| logger.info("CODE-COMMIT: " + record.toString()); | |||
| weappCodeStatusMapper.updateStatus(record); | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| weappCodeStatusMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,58 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxWeappExtSet; | |||
| import com.iformall.mapper.WxWeappExtSetMapper; | |||
| import com.iformall.service.WxWeappExtSetService; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import com.iformall.common.IdWorker; | |||
| @Service | |||
| public class WxWeappExtSetServiceImpl implements WxWeappExtSetService { | |||
| @Autowired | |||
| WxWeappExtSetMapper wxWeappExtSetMapper; | |||
| @Override | |||
| public PageInfo<WxWeappExtSet> listAsPage(WxWeappExtSet record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> wxWeappExtSetMapper.findList(record)); | |||
| } | |||
| @Override | |||
| public WxWeappExtSet getById(Long id) { | |||
| return wxWeappExtSetMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public WxWeappExtSet getByObj(WxWeappExtSet record) { | |||
| return wxWeappExtSetMapper.selectOne(record); | |||
| } | |||
| @Override | |||
| public void saveOrUpdate(WxWeappExtSet record) { | |||
| if (record.getId() == null) { | |||
| //record.setId(UUID.randomUUID().toString().replaceAll("-", "")); | |||
| final IdWorker idWorker = IdWorker.get(); | |||
| record.setId(idWorker.nextId()); | |||
| wxWeappExtSetMapper.insertSelective(record); | |||
| } else { | |||
| wxWeappExtSetMapper.updateByPrimaryKeySelective(record); | |||
| } | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| wxWeappExtSetMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,110 @@ | |||
| package com.iformall.service.impl; | |||
| import com.github.pagehelper.PageHelper; | |||
| import com.github.pagehelper.PageInfo; | |||
| import com.iformall.domain.po.WxAuthorizerInfo; | |||
| import com.iformall.domain.po.WxWeappReleaseStatus; | |||
| import com.iformall.domain.vo.WxWeappReleaseStatusVo; | |||
| import com.iformall.enums.EnumWeappReleaseStatus; | |||
| import com.iformall.mapper.WxAuthorizerInfoMapper; | |||
| import com.iformall.mapper.WxWeappReleaseStatusMapper; | |||
| import com.iformall.service.WxWeappReleaseStatusService; | |||
| import org.omg.CORBA.INTERNAL; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.stereotype.Service; | |||
| import java.util.Date; | |||
| import java.util.List; | |||
| import java.util.Map; | |||
| @Service | |||
| public class WxWeappReleaseStatusServiceImpl implements WxWeappReleaseStatusService { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| @Autowired | |||
| WxWeappReleaseStatusMapper weappReleaseStatusMapper; | |||
| @Autowired | |||
| WxAuthorizerInfoMapper authorizerInfoMapper; | |||
| @Override | |||
| public PageInfo<WxWeappReleaseStatusVo> listAsPage(WxWeappReleaseStatusVo record, Integer pageIndex, Integer pageSize) { | |||
| return PageHelper.startPage(pageIndex, pageSize).doSelectPageInfo(() -> weappReleaseStatusMapper.findVoList(record)); | |||
| } | |||
| @Override | |||
| public List<WxWeappReleaseStatusVo> getList(WxWeappReleaseStatusVo record) { | |||
| return weappReleaseStatusMapper.findVoList(record); | |||
| } | |||
| @Override | |||
| public List<Map> getVersionList(Integer type) { | |||
| return weappReleaseStatusMapper.findUserVersions(type); | |||
| } | |||
| @Override | |||
| public WxWeappReleaseStatus getById(Long id) { | |||
| return weappReleaseStatusMapper.selectByPrimaryKey(id); | |||
| } | |||
| @Override | |||
| public WxWeappReleaseStatus getByAppId(String appId) { | |||
| WxWeappReleaseStatus weappCodeStatusQ = new WxWeappReleaseStatus(); | |||
| weappCodeStatusQ.setAppId(appId); | |||
| return weappReleaseStatusMapper.selectOne(weappCodeStatusQ); | |||
| } | |||
| @Override | |||
| public void saveStatus(WxWeappReleaseStatus record) { | |||
| logger.info("RELEASE: " + record.toString()); | |||
| weappReleaseStatusMapper.insertSelective(record); | |||
| } | |||
| @Override | |||
| public void updateStatus(WxWeappReleaseStatus record) { | |||
| Date curDate = new Date(); | |||
| logger.info("RELEASE: " + record.toString()); | |||
| // 更新 小程序 状态 | |||
| if(record.getReleaseStatus().equals(EnumWeappReleaseStatus.SUCCESS.getCode())) { // 发布成功 | |||
| WxAuthorizerInfo updateInfo = new WxAuthorizerInfo(); | |||
| updateInfo.setAuthorizerAppid(record.getAppId()); | |||
| updateInfo.setCurrentVersion(record.getUserVersion()); | |||
| updateInfo.setCurrentDesc(record.getVersionDesc()); | |||
| updateInfo.setReleaseTime(curDate); | |||
| updateInfo.setUpdateTime(curDate); | |||
| authorizerInfoMapper.updateReleaseInfo(updateInfo); | |||
| } | |||
| // 发布回退,退回上次发布状态 | |||
| if(record.getReleaseStatus().equals(EnumWeappReleaseStatus.BACK.getCode())) { | |||
| try { | |||
| WxAuthorizerInfo appQ = new WxAuthorizerInfo(); | |||
| appQ.setAuthorizerAppid(record.getAppId()); | |||
| WxAuthorizerInfo authorizerInfo = authorizerInfoMapper.selectOne(appQ); | |||
| if(authorizerInfo != null) { | |||
| record.setUserVersion(authorizerInfo.getCurrentVersion()); | |||
| record.setVersionDesc(authorizerInfo.getCurrentDesc()); | |||
| record.setReleaseTime(authorizerInfo.getReleaseTime()); | |||
| } | |||
| } catch (Exception e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| } | |||
| weappReleaseStatusMapper.updateStatus(record); | |||
| } | |||
| @Override | |||
| public void deleteById(Long id) { | |||
| weappReleaseStatusMapper.deleteByPrimaryKey(id); | |||
| } | |||
| } | |||
| @@ -0,0 +1,8 @@ | |||
| package com.iformall.utils; | |||
| public class Constant { | |||
| public static final String fileDirectory = "./uploads/"; | |||
| public static final String importMemPrev = "importmem/"; | |||
| public static final String adminPage = "http://admin.malls.iformall.com"; | |||
| } | |||
| @@ -0,0 +1,52 @@ | |||
| package com.iformall.utils; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import java.net.InetAddress; | |||
| import java.net.UnknownHostException; | |||
| public class IPUtil { | |||
| private final static Logger logger = LoggerFactory.getLogger(IPUtil.class); | |||
| private final static String UNKNOWN = "unknown"; | |||
| public static String getIpAddr(HttpServletRequest request) { | |||
| String ipAddress = request.getHeader("x-forwarded-for"); | |||
| if (ipAddress == null || ipAddress.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddress)) { | |||
| ipAddress = request.getHeader("Proxy-Client-IP"); | |||
| } | |||
| if (ipAddress == null || ipAddress.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddress)) { | |||
| ipAddress = request.getHeader("WL-Proxy-Client-IP"); | |||
| } | |||
| if (ipAddress == null || ipAddress.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddress)) { | |||
| ipAddress = request.getHeader("HTTP_CLIENT_IP"); | |||
| } | |||
| if (ipAddress == null || ipAddress.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddress)) { | |||
| ipAddress = request.getHeader("HTTP_X_FORWARDED_FOR"); | |||
| } | |||
| if (ipAddress == null || ipAddress.length() == 0 || UNKNOWN.equalsIgnoreCase(ipAddress)) { | |||
| ipAddress = request.getRemoteAddr(); | |||
| if (ipAddress.equals("127.0.0.1") || ipAddress.equals("0:0:0:0:0:0:0:1")) { | |||
| //根据网卡获取本机配置的IP地址 | |||
| InetAddress inetAddress = null; | |||
| try { | |||
| inetAddress = InetAddress.getLocalHost(); | |||
| } catch (UnknownHostException e) { | |||
| logger.error(e.getMessage()); | |||
| } | |||
| ipAddress = inetAddress.getHostAddress(); | |||
| } | |||
| } | |||
| //对于通过多个代理的情况,第一个IP为客户端真实的IP地址,多个IP按照','分割 | |||
| if (null != ipAddress && ipAddress.length() > 15) { | |||
| //"***.***.***.***".length() = 15 | |||
| if (ipAddress.indexOf(",") > 0) { | |||
| ipAddress = ipAddress.substring(0, ipAddress.indexOf(",")); | |||
| } | |||
| } | |||
| return ipAddress; | |||
| } | |||
| } | |||
| @@ -0,0 +1,147 @@ | |||
| package com.iformall.utils; | |||
| import javax.imageio.ImageIO; | |||
| import java.awt.*; | |||
| import java.awt.font.FontRenderContext; | |||
| import java.awt.geom.Rectangle2D; | |||
| import java.awt.image.BufferedImage; | |||
| import java.io.File; | |||
| /** | |||
| * Created by Stormeye on 2017/8/7. | |||
| */ | |||
| public class QRCodeUtils { | |||
| public static String PAGE_URL = "pages/index/index"; | |||
| public static final int QR_WIDTH = 430; | |||
| public static final int QR_HIGHT = 430; | |||
| public static final int QR_FONT_SIZE = 19; | |||
| public static final int QR_H_TIP = 90; | |||
| public static final int QR_H_TIP2 = 120; | |||
| /** | |||
| * 二维码 + 文字1 | |||
| * | |||
| * @param oldimg | |||
| * @param newimg | |||
| * @param pressText | |||
| */ | |||
| public static void graphicsGeneration(File oldimg, File newimg, String pressText) { | |||
| int H_tip = QR_H_TIP; // 文字的高度 | |||
| int imageWidth = QR_WIDTH; // 图片的宽度 | |||
| int imageHeight = QR_HIGHT + QR_H_TIP; // 图片的高度 | |||
| BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB); | |||
| // 设置图片的背景色 | |||
| Graphics2D main = image.createGraphics(); | |||
| main.setColor(Color.white); | |||
| main.fillRect(0, 0, imageWidth, imageHeight); | |||
| Graphics mainPic = image.getGraphics(); | |||
| BufferedImage bimg = null; | |||
| try { | |||
| bimg = ImageIO.read(oldimg); | |||
| if (bimg != null) { | |||
| mainPic.drawImage(bimg, 0, 0, QR_WIDTH, QR_HIGHT, null); | |||
| mainPic.dispose(); | |||
| } | |||
| Graphics2D tip = image.createGraphics(); | |||
| // 设置区域颜色 | |||
| tip.setColor(Color.white); | |||
| // 填充区域并确定区域大小位置 | |||
| tip.fillRect(0, QR_HIGHT, QR_WIDTH, H_tip); | |||
| // 设置字体颜色,先设置颜色,再填充内容 | |||
| tip.setColor(Color.black); | |||
| // 设置字体 | |||
| Font tipFont = new Font("宋体", Font.PLAIN, QR_FONT_SIZE); | |||
| tip.setFont(tipFont); | |||
| FontRenderContext context = tip.getFontRenderContext(); | |||
| Rectangle2D bounds = tipFont.getStringBounds(pressText, context); | |||
| double x = (QR_WIDTH - bounds.getWidth()) / 2; | |||
| tip.drawString(pressText, (int) x, QR_HIGHT + 50); | |||
| // 分割线 | |||
| tip.drawLine(0, QR_HIGHT, QR_WIDTH, QR_HIGHT); | |||
| //FileOutputStream out = new FileOutputStream(newimg); | |||
| ImageIO.write(image, "png", newimg); | |||
| //JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out); | |||
| //encoder.encode(image); | |||
| //out.close(); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| System.out.println(e); | |||
| } | |||
| } | |||
| /** | |||
| * 二维码 + 文字1 + 文字2 | |||
| * | |||
| * @param oldimg | |||
| * @param newimg | |||
| * @param pressText1 | |||
| * @param pressText2 | |||
| */ | |||
| public static void graphicsGeneration2(File oldimg, File newimg, String pressText1, String pressText2) { | |||
| int H_tip = QR_H_TIP2; // 文字的高度 | |||
| int imageWidth = QR_WIDTH; // 图片的宽度 | |||
| int imageHeight = QR_HIGHT + QR_H_TIP2; // 图片的高度 | |||
| BufferedImage image = new BufferedImage(imageWidth, imageHeight, BufferedImage.TYPE_INT_RGB); | |||
| // 设置图片的背景色 | |||
| Graphics2D main = image.createGraphics(); | |||
| main.setColor(Color.white); | |||
| main.fillRect(0, 0, imageWidth, imageHeight); | |||
| Graphics mainPic = image.getGraphics(); | |||
| BufferedImage bimg = null; | |||
| try { | |||
| bimg = ImageIO.read(oldimg); | |||
| if (bimg != null) { | |||
| mainPic.drawImage(bimg, 0, 0, QR_WIDTH, QR_HIGHT, null); | |||
| mainPic.dispose(); | |||
| } | |||
| Graphics2D tip = image.createGraphics(); | |||
| // 设置区域颜色 | |||
| tip.setColor(Color.white); | |||
| // 填充区域并确定区域大小位置 | |||
| tip.fillRect(0, QR_HIGHT, QR_WIDTH, H_tip); | |||
| // 设置字体颜色,先设置颜色,再填充内容 | |||
| tip.setColor(Color.black); | |||
| // 设置字体 | |||
| Font tipFont = new Font("粗体", Font.BOLD, QR_FONT_SIZE); | |||
| tip.setFont(tipFont); | |||
| FontRenderContext context = tip.getFontRenderContext(); | |||
| Rectangle2D bounds1 = tipFont.getStringBounds(pressText1, context); | |||
| double x = (QR_WIDTH - bounds1.getWidth()) / 2; | |||
| tip.drawString(pressText1, (int) x, QR_HIGHT + 50); | |||
| Rectangle2D bounds2 = tipFont.getStringBounds(pressText2, context); | |||
| x = (QR_WIDTH - bounds2.getWidth()) / 2; | |||
| tip.drawString(pressText2, (int) x, QR_HIGHT + 90); | |||
| //FileOutputStream out = new FileOutputStream(newimg); | |||
| ImageIO.write(image, "png", newimg); | |||
| //JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(out); | |||
| //encoder.encode(image); | |||
| //out.close(); | |||
| } catch (Exception e) { | |||
| e.printStackTrace(); | |||
| System.out.println(e); | |||
| } | |||
| } | |||
| public static void main(String[] args) { | |||
| File souce = new File("./uploads/null.png"); | |||
| File dest = new File("./uploads/new.png"); | |||
| graphicsGeneration(souce, dest, "长融世贸广场停车专用"); | |||
| } | |||
| } | |||
| @@ -0,0 +1,99 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.MallPermissionMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallPermission"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="name" jdbcType="VARCHAR" property="name" /> | |||
| <result column="available" jdbcType="VARCHAR" property="available" /> | |||
| <result column="parent_id" jdbcType="BIGINT" property="parentId" /> | |||
| <result column="parent_ids" jdbcType="VARCHAR" property="parentIds" /> | |||
| <result column="permission" jdbcType="VARCHAR" property="permission" /> | |||
| <result column="resource_type" jdbcType="VARCHAR" property="resourceType" /> | |||
| <result column="url" jdbcType="VARCHAR" property="url" /> | |||
| <result column="sort" jdbcType="INTEGER" property="sort" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`name`,`available`,`parent_id`,`parent_ids`,`permission`,`resource_type`,`url`,`sort` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != name "> | |||
| and `name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != nameLike and '' != nameLike "> and `name` like concat('%', #{nameLike},'%')</if> | |||
| <if test=" null != available "> | |||
| and `available` like concat('%', #{available},'%') | |||
| </if> | |||
| <if test=" null != parentId "> | |||
| and `parent_id` = #{parentId} | |||
| </if> | |||
| <if test=" null != parentIds "> | |||
| and `parent_ids` like concat('%', #{parentIds},'%') | |||
| </if> | |||
| <if test=" null != permission "> | |||
| and `permission` like concat('%', #{permission},'%') | |||
| </if> | |||
| <if test=" null != permissions "> | |||
| and `permission` in | |||
| <foreach collection="permissions" item="item_permission" open="(" close=")" separator=","> | |||
| #{item_permission} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != resourceType "> | |||
| and `resource_type` like concat('%', #{resourceType},'%') | |||
| </if> | |||
| <if test=" null != url "> | |||
| and `url` like concat('%', #{url},'%') | |||
| </if> | |||
| <if test=" null != sort "> | |||
| and `sort` = #{sort} | |||
| </if> | |||
| <if test=" null != sortFrom "> and `sort` >= #{sortFrom} </if> | |||
| <if test=" null != sortTo "> and #{sortTo} >= `sort` </if> | |||
| <if test=" null != sortGte "> and `sort` >= #{sortGte} </if> | |||
| <if test=" null != sortGt "> and `sort` > #{sortGt} </if> | |||
| <if test=" null != sortLte "> and #{sortLte} >= `sort` </if> | |||
| <if test=" null != sortLt "> and #{sortLt} > `sort` </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.MallPermission" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from mall_permission | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,264 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.MallUserInfoMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.MallUserInfo"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="username" jdbcType="VARCHAR" property="username"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| <result column="password" jdbcType="VARCHAR" property="password"/> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime"/> | |||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||
| <result column="is_admin" jdbcType="INTEGER" property="isAdmin"/> | |||
| <result column="nick_name" jdbcType="VARCHAR" property="nickName"/> | |||
| <result column="phone" jdbcType="VARCHAR" property="phone"/> | |||
| <result column="bopen_id" jdbcType="VARCHAR" property="bopenId"/> | |||
| <result column="web_open_id" jdbcType="VARCHAR" property="webOpenId"/> | |||
| <result column="flow_permission" property="flowPermission"/> | |||
| </resultMap> | |||
| <sql id="allSafeColumns"> | |||
| `id`,`tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`nick_name`,`phone`,`flow_permission`,`web_open_id` | |||
| </sql> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`username`,`name`,`password`,`create_time`,`last_login_time`,`status`,`is_admin`,`nick_name`,`phone`,`flow_permission`, | |||
| `bopen_id`,`web_open_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != username "> | |||
| and `username` like concat('%', #{username},'%') | |||
| </if> | |||
| <if test=" null != nickName "> | |||
| and `nick_name` like concat('%', #{nickName},'%') | |||
| </if> | |||
| <if test=" null != name "> | |||
| and `name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != password "> | |||
| and `password` like concat('%', #{password},'%') | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <if test=" null != lastLoginTime "> | |||
| and `last_login_time` = #{lastLoginTime} | |||
| </if> | |||
| <if test=" null != status "> | |||
| and `status` = #{status} | |||
| </if> | |||
| <if test=" null != isAdmin "> | |||
| and `is_admin` = #{isAdmin} | |||
| </if> | |||
| <if test=" null != phone "> | |||
| and `phone` = #{phone} | |||
| </if> | |||
| <if test=" null != bopenId "> | |||
| and `bopen_id` = #{bopenId} | |||
| </if> | |||
| <if test=" null != webOpenId "> | |||
| and `web_open_id` = #{webOpenId} | |||
| </if> | |||
| <if test=" null != flowPermission "> | |||
| and JSON_CONTAINS(flow_permission->'$[*]', #{flowPermission}, '$') | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.MallUserInfo" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allSafeColumns"/> | |||
| from mall_user_info | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="selectByUserName" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != username "> | |||
| and username=#{username} | |||
| </if> | |||
| </select> | |||
| <select id="selectById" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allSafeColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != id "> | |||
| and id=#{id} | |||
| </if> | |||
| </select> | |||
| <select id="selectByUserNameWebOpen" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != username "> | |||
| and username=#{username} | |||
| </if> | |||
| <if test=" null != webOpenId "> | |||
| and `web_open_id`=#{webOpenId} | |||
| </if> | |||
| </select> | |||
| <select id="selectByBOpenId" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allSafeColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| </if> | |||
| <if test=" null != bopenId "> | |||
| and `bopen_id`=#{bopenId} | |||
| </if> | |||
| </select> | |||
| <select id="selectByWebOpenId" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != webOpenId "> | |||
| and `web_open_id`=#{webOpenId} | |||
| </if> | |||
| </select> | |||
| <update id="removeWebOpenId" > | |||
| update mall_user_info | |||
| set `web_open_id` = null | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| </if> | |||
| <if test=" null != username "> | |||
| and username=#{username} | |||
| </if> | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| </update> | |||
| <select id="selectByPhone" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from mall_user_info | |||
| where 1=1 | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id`=#{tenantId} | |||
| </if> | |||
| <if test=" null != phone "> | |||
| and `phone`=#{phone} | |||
| </if> | |||
| </select> | |||
| <select id="hasButtonPermission" resultType="java.lang.Integer"> | |||
| SELECT 1 | |||
| FROM mall_user_role ur, mall_user_role_permission rp, mall_permission p | |||
| WHERE rp.role_id = ur.role_id | |||
| AND rp.permission_id = p.id | |||
| AND p.resource_type = 1 | |||
| AND ur.uid = #{userId} | |||
| AND p.permission = #{permission} | |||
| </select> | |||
| <select id="cntByUserName" resultType="java.lang.Long"> | |||
| select count(*) from mall_user_info where 1=1 | |||
| <if test=" null != username "> | |||
| and username=#{username} | |||
| </if> | |||
| <if test=" null != phone "> | |||
| and `phone` = #{phone} | |||
| </if> | |||
| <if test=" null != id "> | |||
| and `id` != #{id} | |||
| </if> | |||
| </select> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.MallUserInfoVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="username" jdbcType="VARCHAR" property="username"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| <result column="password" jdbcType="VARCHAR" property="password"/> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="last_login_time" jdbcType="TIMESTAMP" property="lastLoginTime"/> | |||
| <result column="status" jdbcType="INTEGER" property="status"/> | |||
| <result column="is_admin" jdbcType="INTEGER" property="isAdmin"/> | |||
| <result column="nick_name" jdbcType="VARCHAR" property="nickName"/> | |||
| <result column="phone" jdbcType="VARCHAR" property="phone"/> | |||
| <result column="bopen_id" jdbcType="VARCHAR" property="bopenId"/> | |||
| <result column="web_open_id" jdbcType="VARCHAR" property="webOpenId"/> | |||
| <result column="flow_permission" property="flowPermission"/> | |||
| <result column="mall_name" jdbcType="VARCHAR" property="mallName"/> | |||
| <result column="mall_group" jdbcType="VARCHAR" property="mallGroup"/> | |||
| <result column="img_url" jdbcType="VARCHAR" property="imgUrl"/> | |||
| <result column="img_url_h" jdbcType="VARCHAR" property="imgUrlH"/> | |||
| </resultMap> | |||
| <sql id="allSafeVColumns"> | |||
| u.`id`,u.`tenant_id`,u.`username`,u.`name`,u.`password`,u.`create_time`,u.`last_login_time`,u.`status`,u.`is_admin`,u.`nick_name`,u.`phone`,u.`flow_permission`, | |||
| m.`name` as mall_name, m.`group` as mall_group, m.`img_url`, m.`img_url_h` | |||
| </sql> | |||
| <sql id="allVColumns"> | |||
| u.`id`,u.`tenant_id`,u.`username`,u.`name`,u.`password`,u.`create_time`,u.`last_login_time`,u.`status`,u.`is_admin`,u.`nick_name`,u.`phone`,u.`flow_permission`, | |||
| u.`bopen_id`,u.`web_open_id`, | |||
| m.`name` as mall_name, m.`group` as mall_group, m.`img_url`, m.`img_url_h` | |||
| </sql> | |||
| <select id="selectUsersByPhone" resultMap="VBaseResultMap"> | |||
| select | |||
| <include refid="allSafeVColumns"/> | |||
| from mall_user_info u | |||
| left join wx_mall m on m.`tenant_id` = u.`tenant_id` | |||
| where 1=1 | |||
| <if test=" null != phone "> | |||
| and u.`phone` = #{phone} | |||
| </if> | |||
| </select> | |||
| <select id="selectUsersByWebOpenId" resultMap="VBaseResultMap"> | |||
| select | |||
| <include refid="allSafeVColumns"/> | |||
| from mall_user_info u | |||
| left join wx_mall m on m.`tenant_id` = u.`tenant_id` | |||
| where 1=1 | |||
| <if test=" null != webOpenId "> | |||
| and u.`web_open_id` = #{webOpenId} | |||
| </if> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,107 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxAppinfoMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAppinfo"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="parent_app_id" jdbcType="VARCHAR" property="parentAppId"/> | |||
| <result column="name" jdbcType="VARCHAR" property="name"/> | |||
| <result column="secret" jdbcType="VARCHAR" property="secret"/> | |||
| <result column="token" jdbcType="VARCHAR" property="token"/> | |||
| <result column="aes_key" jdbcType="VARCHAR" property="aesKey"/> | |||
| <result column="msg_data_format" jdbcType="VARCHAR" property="msgDataFormat"/> | |||
| <result column="access_token" jdbcType="VARCHAR" property="accessToken"/> | |||
| <result column="last_token_time" jdbcType="TIMESTAMP" property="lastTokenTime"/> | |||
| <result column="expires_in" jdbcType="INTEGER" property="expiresIn"/> | |||
| <result column="pay_id" jdbcType="BIGINT" property="payId"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="pay_bill_id" jdbcType="BIGINT" property="payBillId"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`app_id`,`parent_app_id`,`name`,`secret`,`token`,`aes_key`,`msg_data_format`,`access_token`,`last_token_time`,`expires_in`,`pay_id`,`type`,`pay_bill_id` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != parentAppId "> | |||
| and `parent_app_id` like concat('%', #{parentAppId},'%') | |||
| </if> | |||
| <if test=" null != name "> | |||
| and `name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != secret "> | |||
| and `secret` like concat('%', #{secret},'%') | |||
| </if> | |||
| <if test=" null != token "> | |||
| and `token` like concat('%', #{token},'%') | |||
| </if> | |||
| <if test=" null != aesKey "> | |||
| and `aes_key` like concat('%', #{aesKey},'%') | |||
| </if> | |||
| <if test=" null != msgDataFormat "> | |||
| and `msg_data_format` like concat('%', #{msgDataFormat},'%') | |||
| </if> | |||
| <if test=" null != accessToken "> | |||
| and `access_token` like concat('%', #{accessToken},'%') | |||
| </if> | |||
| <if test=" null != lastTokenTime "> | |||
| and `last_token_time` = #{lastTokenTime} | |||
| </if> | |||
| <if test=" null != expiresIn "> | |||
| and `expires_in` = #{expiresIn} | |||
| </if> | |||
| <if test=" null != payId "> | |||
| and `pay_id` = #{payId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != payBillId "> | |||
| and `pay_bill_id` = #{payBillId} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxAppinfo" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_appinfo | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <select id="findByAppId" parameterType="java.lang.String" resultMap="BaseResultMap"> | |||
| SELECT * | |||
| FROM wx_appinfo | |||
| WHERE `app_id` = #{appId} | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,234 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxAuthorizerInfoMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxAuthorizerInfo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="authorizer_appid" jdbcType="VARCHAR" property="authorizerAppid" /> | |||
| <result column="head_img" jdbcType="VARCHAR" property="headImg" /> | |||
| <result column="alias" jdbcType="VARCHAR" property="alias" /> | |||
| <result column="qrcode_url" jdbcType="VARCHAR" property="qrcodeUrl" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | |||
| <result column="authorization_status" jdbcType="INTEGER" property="authorizationStatus" /> | |||
| <result column="auth_time" jdbcType="TIMESTAMP" property="authTime" /> | |||
| <result column="base_status" jdbcType="INTEGER" property="baseStatus" /> | |||
| <result column="base_time" jdbcType="TIMESTAMP" property="baseTime" /> | |||
| <result column="domain_status" jdbcType="INTEGER" property="domainStatus" /> | |||
| <result column="domain_time" jdbcType="TIMESTAMP" property="domainTime" /> | |||
| <result column="webdomain_status" jdbcType="INTEGER" property="webdomainStatus" /> | |||
| <result column="webdomain_time" jdbcType="TIMESTAMP" property="webdomainTime" /> | |||
| <result column="template_status" jdbcType="INTEGER" property="templateStatus" /> | |||
| <result column="template_time" jdbcType="TIMESTAMP" property="templateTime" /> | |||
| <result column="current_version" jdbcType="VARCHAR" property="currentVersion" /> | |||
| <result column="current_desc" jdbcType="VARCHAR" property="currentDesc" /> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" /> | |||
| <result column="open_appid" jdbcType="VARCHAR" property="openAppid" /> | |||
| <result column="bind_open_time" jdbcType="TIMESTAMP" property="bindOpenTime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`authorizer_appid`,`head_img`,`alias`,`qrcode_url`,`create_time`,`authorization_status`,`auth_time`, | |||
| `base_status`, `base_time`, `domain_status`, `domain_time`, `webdomain_status`, `webdomain_time`, `template_status`, `template_time`, | |||
| `current_version`,`current_desc`,`release_time`, | |||
| `open_appid`,`bind_open_time` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != authorizerAppid "> | |||
| and `authorizer_appid` = #{authorizerAppid} | |||
| </if> | |||
| <if test=" null != headImg "> | |||
| and `head_img` like concat('%', #{headImg},'%') | |||
| </if> | |||
| <if test=" null != alias "> | |||
| and `alias` like concat('%', #{alias},'%') | |||
| </if> | |||
| <if test=" null != qrcodeUrl "> | |||
| and `qrcode_url` like concat('%', #{qrcodeUrl},'%') | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <if test=" null != updateTime "> | |||
| and `update_time` = #{updateTime} | |||
| </if> | |||
| <if test=" null != authorizationStatus "> | |||
| and `authorization_status` = #{authorizationStatus} | |||
| </if> | |||
| <if test=" null != authTime "> | |||
| and `auth_time` = #{authTime} | |||
| </if> | |||
| <if test=" null != baseStatus "> | |||
| and `base_status` = #{baseStatus} | |||
| </if> | |||
| <if test=" null != baseTime "> | |||
| and `base_time` = #{baseTime} | |||
| </if> | |||
| <if test=" null != domainStatus "> | |||
| and `domain_status` = #{domainStatus} | |||
| </if> | |||
| <if test=" null != domainTime "> | |||
| and `domain_time` = #{domainTime} | |||
| </if> | |||
| <if test=" null != webdomainStatus "> | |||
| and `webdomain_status` = #{webdomainStatus} | |||
| </if> | |||
| <if test=" null != webdomainTime "> | |||
| and `webdomain_time` = #{webdomainTime} | |||
| </if> | |||
| <if test=" null != templateStatus "> | |||
| and `template_status` = #{templateStatus} | |||
| </if> | |||
| <if test=" null != templateTime "> | |||
| and `template_time` = #{templateTime} | |||
| </if> | |||
| <if test=" null != currentVersion "> | |||
| and `current_version` = #{currentVersion} | |||
| </if> | |||
| <if test=" null != currentDesc "> | |||
| and `current_desc` like concat('%', #{currentDesc},'%') | |||
| </if> | |||
| <if test=" null != releaseTime "> | |||
| and `release_time` = #{releaseTime} | |||
| </if> | |||
| <if test=" null != openAppid "> | |||
| and `open_appid` = #{openAppid} | |||
| </if> | |||
| <if test=" null != bindOpenTime "> | |||
| and `bind_open_time` = #{bindOpenTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxAuthorizerInfo" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_authorizer_info | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <update id="updateReleaseInfo" parameterType="com.iformall.domain.po.WxAuthorizerInfo" > | |||
| update wx_authorizer_info | |||
| set `current_version` = #{currentVersion}, `current_desc` = #{currentDesc}, `release_time` = #{releaseTime}, `update_time` = #{updateTime} | |||
| where `authorizer_appid` = #{authorizerAppid} | |||
| </update> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappInfo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="authorizer_appid" jdbcType="VARCHAR" property="authorizerAppid" /> | |||
| <result column="head_img" jdbcType="VARCHAR" property="headImg" /> | |||
| <result column="alias" jdbcType="VARCHAR" property="alias" /> | |||
| <result column="qrcode_url" jdbcType="VARCHAR" property="qrcodeUrl" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime" /> | |||
| <result column="authorization_status" jdbcType="INTEGER" property="authorizationStatus" /> | |||
| <result column="auth_time" jdbcType="TIMESTAMP" property="authTime" /> | |||
| <result column="base_status" jdbcType="INTEGER" property="baseStatus" /> | |||
| <result column="base_time" jdbcType="TIMESTAMP" property="baseTime" /> | |||
| <result column="domain_status" jdbcType="INTEGER" property="domainStatus" /> | |||
| <result column="domain_time" jdbcType="TIMESTAMP" property="domainTime" /> | |||
| <result column="webdomain_status" jdbcType="INTEGER" property="webdomainStatus" /> | |||
| <result column="webdomain_time" jdbcType="TIMESTAMP" property="webdomainTime" /> | |||
| <result column="template_status" jdbcType="INTEGER" property="templateStatus" /> | |||
| <result column="template_time" jdbcType="TIMESTAMP" property="templateTime" /> | |||
| <result column="current_version" jdbcType="VARCHAR" property="currentVersion" /> | |||
| <result column="current_desc" jdbcType="VARCHAR" property="currentDesc" /> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" /> | |||
| <result column="open_appid" jdbcType="VARCHAR" property="openAppid" /> | |||
| <result column="bind_open_time" jdbcType="TIMESTAMP" property="bindOpenTime" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="name" jdbcType="TIMESTAMP" property="name" /> | |||
| </resultMap> | |||
| <sql id="allVColumns"> | |||
| ai.`id`,ai.`authorizer_appid`,ai.`head_img`,ai.`alias`,ai.`qrcode_url`,ai.`create_time`,ai.`update_time`, | |||
| ai.`authorization_status`,ai.`auth_time`, | |||
| ai.`base_status`,ai.`base_time`, | |||
| ai.`domain_status`,ai.`domain_time`, | |||
| ai.`webdomain_status`,ai.`webdomain_time`, | |||
| ai.`template_status`,ai.`template_time`, | |||
| ai.`current_version`,ai.`current_desc`,ai.`release_time`, | |||
| ai.`open_appid`,ai.`bind_open_time`, | |||
| a.`type`,a.`name` | |||
| </sql> | |||
| <sql id="dynamicVWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and ai.`id` = #{id} | |||
| </if> | |||
| <if test=" null != name "> | |||
| and a.`name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != type "> | |||
| and a.`type` = #{type} | |||
| </if> | |||
| <if test=" null != authorizerAppid "> | |||
| and ai.`authorizer_appid` = #{authorizerAppid} | |||
| </if> | |||
| <if test=" null != authorizationStatus "> | |||
| and ai.`authorization_status` = #{authorizationStatus} | |||
| </if> | |||
| <if test=" null != authTime "> | |||
| and ai.`auth_time` = #{authTime} | |||
| </if> | |||
| <if test=" null != baseStatus "> | |||
| and ai.`base_status` = #{baseStatus} | |||
| </if> | |||
| <if test=" null != baseTime "> | |||
| and ai.`base_time` = #{baseTime} | |||
| </if> | |||
| <if test=" null != domainStatus "> | |||
| and ai.`domain_status` = #{domainStatus} | |||
| </if> | |||
| <if test=" null != domainTime "> | |||
| and ai.`domain_time` = #{domainTime} | |||
| </if> | |||
| <if test=" null != webdomainStatus "> | |||
| and ai.`webdomain_status` = #{webdomainStatus} | |||
| </if> | |||
| <if test=" null != webdomainTime "> | |||
| and ai.`webdomain_time` = #{webdomainTime} | |||
| </if> | |||
| <if test=" null != templateStatus "> | |||
| and ai.`template_status` = #{templateStatus} | |||
| </if> | |||
| <if test=" null != templateTime "> | |||
| and ai.`template_time` = #{templateTime} | |||
| </if> | |||
| <if test=" null != currentVersion "> | |||
| and ai.`current_version` = #{currentVersion} | |||
| </if> | |||
| <if test=" null != openAppid "> | |||
| and ai.`open_appid` = #{openAppid} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and ai.id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappInfo" resultMap="VBaseResultMap"> | |||
| select <include refid="allVColumns" /> | |||
| from wx_authorizer_info ai | |||
| left join wx_appinfo a on ai.`authorizer_appid` = a.app_id | |||
| <include refid="dynamicVWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,52 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxComponentVerifyTicketMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxComponentVerifyTicket"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="component_appid" jdbcType="VARCHAR" property="componentAppid" /> | |||
| <result column="component_verify_ticket" jdbcType="VARCHAR" property="componentVerifyTicket" /> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime" /> | |||
| <result column="deadline" jdbcType="TIMESTAMP" property="deadline" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`component_appid`,`component_verify_ticket`,`create_time`,`deadline` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != componentAppid "> | |||
| and `component_appid` like concat('%', #{componentAppid},'%') | |||
| </if> | |||
| <if test=" null != componentVerifyTicket "> | |||
| and `component_verify_ticket` like concat('%', #{componentVerifyTicket},'%') | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <if test=" null != deadline "> | |||
| and `deadline` = #{deadline} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxComponentVerifyTicket" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_component_verify_ticket | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,72 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxPayAccountMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPayAccount"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="mch_id" jdbcType="VARCHAR" property="mchId"/> | |||
| <result column="parent_mch_id" jdbcType="VARCHAR" property="parentMchId"/> | |||
| <result column="api_key" jdbcType="VARCHAR" property="apiKey"/> | |||
| <result column="notify_url" jdbcType="VARCHAR" property="notifyUrl"/> | |||
| <result column="cert_path" jdbcType="VARCHAR" property="certPath"/> | |||
| <result column="type" jdbcType="INTEGER" property="type"/> | |||
| <result column="share" jdbcType="INTEGER" property="share"/> | |||
| <result column="rate" jdbcType="INTEGER" property="rate"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`mch_id`,`parent_mch_id`,`api_key`,`notify_url`,`cert_path`,`type`,`share`,`rate` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != mchId "> | |||
| and `mch_id` like concat('%', #{mchId},'%') | |||
| </if> | |||
| <if test=" null != parentMchId "> | |||
| and `parent_mch_id` like concat('%', #{parentMchId},'%') | |||
| </if> | |||
| <if test=" null != apiKey "> | |||
| and `api_key` like concat('%', #{apiKey},'%') | |||
| </if> | |||
| <if test=" null != notifyUrl "> | |||
| and `notify_url` like concat('%', #{notifyUrl},'%') | |||
| </if> | |||
| <if test=" null != certPath "> | |||
| and `cert_path` like concat('%', #{certPath},'%') | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != share "> | |||
| and `share` = #{share} | |||
| </if> | |||
| <if test=" null != rate "> | |||
| and `rate` = #{rate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxPayAccount" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_pay_account | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,178 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxPayOrderMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxPayOrder"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="order_id" jdbcType="BIGINT" property="orderId"/> | |||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> | |||
| <result column="b_user_id" jdbcType="BIGINT" property="bUserId"/> | |||
| <result column="auth_code" jdbcType="VARCHAR" property="authCode"/> | |||
| <result column="ip" jdbcType="VARCHAR" property="ip"/> | |||
| <result column="pay_amount" jdbcType="INTEGER" property="payAmount"/> | |||
| <result column="pay_time_start" jdbcType="TIMESTAMP" property="payTimeStart"/> | |||
| <result column="pay_time_end" jdbcType="TIMESTAMP" property="payTimeEnd"/> | |||
| <result column="prepay_id" jdbcType="VARCHAR" property="prepayId"/> | |||
| <result column="transaction_id" jdbcType="VARCHAR" property="transactionId"/> | |||
| <result column="pay_vendor" jdbcType="INTEGER" property="payVendor"/> | |||
| <result column="pay_order_no" jdbcType="VARCHAR" property="payOrderNo"/> | |||
| <result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus"/> | |||
| <result column="share" jdbcType="INTEGER" property="share"/> | |||
| <result column="share_amount" jdbcType="INTEGER" property="shareAmount"/> | |||
| <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`create_time`,`update_time`,`order_id`,`c_user_id`,`b_user_id`, | |||
| `auth_code`,`ip`,`pay_amount`,`pay_time_start`,`pay_time_end`, | |||
| `prepay_id`,`transaction_id`,`pay_vendor`,`pay_order_no`, | |||
| `pay_order_status`,`share`,`share_amount`,`fail_reason` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != createTime "> | |||
| and `create_time` = #{createTime} | |||
| </if> | |||
| <if test=" null != updateTime "> | |||
| and `update_time` = #{updateTime} | |||
| </if> | |||
| <if test=" null != orderId "> | |||
| and `order_id` = #{orderId} | |||
| </if> | |||
| <if test=" null != cUserId "> | |||
| and `c_user_id` = #{cUserId} | |||
| </if> | |||
| <if test=" null != bUserId "> | |||
| and `b_user_id` = #{bUserId} | |||
| </if> | |||
| <if test=" null != authCode "> | |||
| and `auth_code` = #{authCode} | |||
| </if> | |||
| <if test=" null != ip "> | |||
| and `ip` like concat('%', #{ip},'%') | |||
| </if> | |||
| <if test=" null != payAmount "> | |||
| and `pay_amount` = #{payAmount} | |||
| </if> | |||
| <if test=" null != payTimeStart "> | |||
| and `pay_time_start` = #{payTimeStart} | |||
| </if> | |||
| <if test=" null != payTimeEnd "> | |||
| and `pay_time_end` = #{payTimeEnd} | |||
| </if> | |||
| <if test=" null != prepayId "> | |||
| and `prepay_id` like concat('%', #{prepayId},'%') | |||
| </if> | |||
| <if test=" null != transactionId "> | |||
| and `transaction_id` like concat('%', #{transactionId},'%') | |||
| </if> | |||
| <if test=" null != payVendor "> | |||
| and `pay_vendor` = #{payVendor} | |||
| </if> | |||
| <if test=" null != payOrderNo "> | |||
| and `pay_order_no` like concat('%', #{payOrderNo},'%') | |||
| </if> | |||
| <if test=" null != payOrderStatus "> | |||
| and `pay_order_status` = #{payOrderStatus} | |||
| </if> | |||
| <if test=" null != share "> | |||
| and `share` = #{share} | |||
| </if> | |||
| <if test=" null != shareAmount "> | |||
| and `share_amount` = #{shareAmount} | |||
| </if> | |||
| <if test=" null != failReason "> | |||
| and `fail_reason` like concat('%', #{failReason},'%') | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns">order by ${sortColumns}</if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxPayOrder" resultMap="BaseResultMap"> | |||
| select | |||
| <include refid="allColumns"/> | |||
| from wx_pay_order | |||
| <include refid="dynamicWhereConditions"/> | |||
| </select> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxPayOrderVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id"/> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId"/> | |||
| <result column="create_time" jdbcType="TIMESTAMP" property="createTime"/> | |||
| <result column="update_time" jdbcType="TIMESTAMP" property="updateTime"/> | |||
| <result column="order_id" jdbcType="BIGINT" property="orderId"/> | |||
| <result column="c_user_id" jdbcType="BIGINT" property="cUserId"/> | |||
| <result column="b_user_id" jdbcType="BIGINT" property="bUserId"/> | |||
| <result column="auth_code" jdbcType="VARCHAR" property="authCode"/> | |||
| <result column="ip" jdbcType="VARCHAR" property="ip"/> | |||
| <result column="pay_amount" jdbcType="INTEGER" property="payAmount"/> | |||
| <result column="pay_time_start" jdbcType="TIMESTAMP" property="payTimeStart"/> | |||
| <result column="pay_time_end" jdbcType="TIMESTAMP" property="payTimeEnd"/> | |||
| <result column="prepay_id" jdbcType="VARCHAR" property="prepayId"/> | |||
| <result column="transaction_id" jdbcType="VARCHAR" property="transactionId"/> | |||
| <result column="pay_vendor" jdbcType="INTEGER" property="payVendor"/> | |||
| <result column="pay_order_no" jdbcType="VARCHAR" property="payOrderNo"/> | |||
| <result column="pay_order_status" jdbcType="INTEGER" property="payOrderStatus"/> | |||
| <result column="share" jdbcType="INTEGER" property="share"/> | |||
| <result column="share_amount" jdbcType="INTEGER" property="shareAmount"/> | |||
| <result column="fail_reason" jdbcType="VARCHAR" property="failReason"/> | |||
| <result column="open_id" jdbcType="VARCHAR" property="openId"/> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId"/> | |||
| <result column="pay_id" jdbcType="BIGINT" property="payId"/> | |||
| </resultMap> | |||
| <sql id="allVColumns"> | |||
| p.`id`,p.`tenant_id`,p.`create_time`,p.`update_time`,p.`order_id`,p.`c_user_id`,p.`b_user_id`, | |||
| p.`auth_code`,p.`ip`,p.`pay_amount`,p.`pay_time_start`,p.`pay_time_end`, | |||
| p.`prepay_id`,p.`transaction_id`,p.`pay_vendor`,p.`pay_order_no`, | |||
| p.`pay_order_status`,p.`share`,p.`share_amount`,p.`fail_reason`, | |||
| u.`open_id`, | |||
| a.`app_id`, a.`pay_id` | |||
| </sql> | |||
| <select id="findListOfPaidOrderByDate" parameterType="map" resultMap="VBaseResultMap"> | |||
| select | |||
| <include refid="allVColumns"/> | |||
| from wx_pay_order p | |||
| left join wx_c_user u on p.`c_user_id` = u.`id` | |||
| left join wx_appinfo a on a.`tenant_id` = p.`tenant_id` and a.`type` = 2 | |||
| where p.`pay_order_status` = '1' and p.`pay_vendor` = 0 and u.`union_id` is null | |||
| <if test="startDate != null"> | |||
| AND unix_timestamp(p.`pay_time_end`) > unix_timestamp(#{startDate,jdbcType=TIMESTAMP}) | |||
| </if> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,68 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxTemplateMsgMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxTemplateMsg"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="tenant_id" jdbcType="VARCHAR" property="tenantId" /> | |||
| <result column="template_id" jdbcType="VARCHAR" property="templateId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`tenant_id`,`template_id`,`type`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != tenantId "> | |||
| and `tenant_id` = #{tenantId} | |||
| </if> | |||
| <if test=" null != templateId "> | |||
| and `template_id` like concat('%', #{templateId},'%') | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxTemplateMsg" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_template_msg | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,135 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappAuditStatusMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappAuditStatus"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="auditid" jdbcType="INTEGER" property="auditid" /> | |||
| <result column="audit_status" jdbcType="INTEGER" property="auditStatus" /> | |||
| <result column="audit_err_code" jdbcType="VARCHAR" property="auditErrCode" /> | |||
| <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`app_id`,`type`,`user_version`,`version_desc`, `audit_status`,`audit_err_code`,`audit_time` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != userVersion "> | |||
| and `user_version` = #{userVersion} | |||
| </if> | |||
| <if test=" null != auditid "> | |||
| and `auditid` = #{auditid} | |||
| </if> | |||
| <if test=" null != auditStatus "> | |||
| and `audit_status` = #{auditStatus} | |||
| </if> | |||
| <if test=" null != auditTime "> | |||
| and `audit_time` = #{auditTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappAuditStatus" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> | |||
| from wx_weapp_audit_status | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappReleaseStatus" > | |||
| update wx_weapp_audit_status | |||
| set `user_version` = #{userVersion}, `version_desc` = #{versionDesc}, | |||
| `audit_status` = #{auditStatus}, `audit_err_code` = #{auditErrCode}, `audit_time` = #{auditTime} | |||
| where `app_id` = #{appId} and `type` = #{type} | |||
| </update> | |||
| <select id="findUserVersions" resultType="hashmap" > | |||
| select user_version as version | |||
| from wx_weapp_audit_status | |||
| where 1=1 | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != auditStatus "> | |||
| and `audit_status` = #{auditStatus} | |||
| </if> | |||
| group by user_version | |||
| </select> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappAuditStatusVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="audit_status" jdbcType="INTEGER" property="auditStatus" /> | |||
| <result column="audit_err_code" jdbcType="VARCHAR" property="auditErrCode" /> | |||
| <result column="audit_time" jdbcType="TIMESTAMP" property="auditTime" /> | |||
| <result column="name" jdbcType="VARCHAR" property="name" /> | |||
| </resultMap> | |||
| <sql id="allVoColumns"> | |||
| c.`id`,c.`app_id`,c.`type`,c.`user_version`,`version_desc`, | |||
| c.`audit_status`,c.`audit_err_code`,c.`audit_time`, | |||
| a.`name` | |||
| </sql> | |||
| <sql id="dynamicVoWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and c.`id` = #{id} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and c.`app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and c.`type` = #{type} | |||
| </if> | |||
| <if test=" null != userVersion "> | |||
| and c.`user_version` = #{userVersion} | |||
| </if> | |||
| <if test=" null != auditStatus "> | |||
| and c.`audit_status` = #{auditStatus} | |||
| </if> | |||
| <if test=" null != auditTime "> | |||
| and c.`audit_time` = #{auditTime} | |||
| </if> | |||
| <if test=" null != name "> | |||
| and a.`name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappAuditStatusVo" resultMap="VBaseResultMap"> | |||
| select <include refid="allVoColumns" /> | |||
| from wx_weapp_audit_status c | |||
| left join wx_appinfo a on c.`app_id` = a.`app_id` | |||
| <include refid="dynamicVoWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,55 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappBasicSetMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappBasicSet"> | |||
| <id column="id" jdbcType="INTEGER" property="id" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="deploy" jdbcType="INTEGER" property="deploy" /> | |||
| <result column="domain_url" jdbcType="VARCHAR" property="domainUrl" /> | |||
| <result column="version" jdbcType="VARCHAR" property="version" /> | |||
| <result column="template_info" jdbcType="VARCHAR" property="templateInfo" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`type`,`domain_url`,`version`,`template_info`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != deploy "> | |||
| and `deploy` = #{deploy} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappBasicSet" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_weapp_basic_set | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,121 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappCodeStatusMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappCodeStatus"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="code_status" jdbcType="INTEGER" property="codeStatus" /> | |||
| <result column="code_err_code" jdbcType="VARCHAR" property="codeErrCode" /> | |||
| <result column="code_time" jdbcType="TIMESTAMP" property="codeTime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`app_id`,`type`,`user_version`,`version_desc`,`code_status`,`code_err_code`,`code_time` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != userVersion "> | |||
| and `user_version` = #{userVersion} | |||
| </if> | |||
| <if test=" null != codeStatus "> | |||
| and `code_status` = #{codeStatus} | |||
| </if> | |||
| <if test=" null != codeTime "> | |||
| and `code_time` = #{codeTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappCodeStatus" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_weapp_code_status | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappCodeStatus" > | |||
| update wx_weapp_code_status | |||
| set `user_version` = #{userVersion}, `version_desc`= #{versionDesc}, | |||
| `code_status` = #{codeStatus}, `code_err_code` = #{codeErrCode}, `code_time` = #{codeTime} | |||
| where `app_id` = #{appId} and `type` = #{type} | |||
| </update> | |||
| <select id="findUserVersions" resultType="hashmap" > | |||
| select user_version as version | |||
| from wx_weapp_code_status | |||
| where 1=1 | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| group by user_version | |||
| </select> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappCodeStatusVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="code_status" jdbcType="INTEGER" property="codeStatus" /> | |||
| <result column="code_err_code" jdbcType="VARCHAR" property="codeErrCode" /> | |||
| <result column="code_time" jdbcType="TIMESTAMP" property="codeTime" /> | |||
| <result column="name" jdbcType="VARCHAR" property="name" /> | |||
| </resultMap> | |||
| <sql id="allVoColumns"> | |||
| c.`id`,c.`app_id`,c.`type`,c.`user_version`,c.`version_desc`,c.`code_status`,c.`code_err_code`,c.`code_time`, a.`name` | |||
| </sql> | |||
| <sql id="dynamicVoWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and c.`id` = #{id} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and c.`app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and c.`type` = #{type} | |||
| </if> | |||
| <if test=" null != userVersion "> | |||
| and c.`user_version` = #{userVersion} | |||
| </if> | |||
| <if test=" null != codeStatus "> | |||
| and c.`code_status` = #{codeStatus} | |||
| </if> | |||
| <if test=" null != name "> | |||
| and a.`name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappCodeStatusVo" resultMap="VBaseResultMap"> | |||
| select <include refid="allVoColumns" /> | |||
| from wx_weapp_code_status c | |||
| left join wx_appinfo a on c.`app_id` = a.`app_id` | |||
| <include refid="dynamicVoWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,54 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappExtSetMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappExtSet"> | |||
| <id column="id" jdbcType="INTEGER" property="id" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="ext_json" jdbcType="VARCHAR" property="extJson" /> | |||
| <result column="release_json" jdbcType="VARCHAR" property="releaseJson" /> | |||
| <result column="create_date" jdbcType="TIMESTAMP" property="createDate" /> | |||
| <result column="update_date" jdbcType="TIMESTAMP" property="updateDate" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`app_id`,`type`,`ext_json`,`release_json`,`create_date`,`update_date` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != createDate "> | |||
| and `create_date` = #{createDate} | |||
| </if> | |||
| <if test=" null != updateDate "> | |||
| and `update_date` = #{updateDate} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappExtSet" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_weapp_ext_set | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,127 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> | |||
| <mapper namespace="com.iformall.mapper.WxWeappReleaseStatusMapper"> | |||
| <resultMap id="BaseResultMap" type="com.iformall.domain.po.WxWeappReleaseStatus"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="release_status" jdbcType="VARCHAR" property="releaseStatus" /> | |||
| <result column="release_err_code" jdbcType="INTEGER" property="releaseErrCode" /> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" /> | |||
| </resultMap> | |||
| <sql id="allColumns"> | |||
| `id`,`app_id`,`type`,`user_version`,`version_desc`,`release_status`,`release_err_code`,`release_time` | |||
| </sql> | |||
| <sql id="dynamicWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and `id` = #{id} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and `app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| <if test=" null != userVersion "> | |||
| and `user_version` = #{userVersion} | |||
| </if> | |||
| <if test=" null != releaseStatus "> | |||
| and `release_status` = #{releaseStatus} | |||
| </if> | |||
| <if test=" null != releaseTime "> | |||
| and `release_time` = #{releaseTime} | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findList" parameterType="com.iformall.domain.po.WxWeappReleaseStatus" resultMap="BaseResultMap"> | |||
| select <include refid="allColumns" /> from wx_weapp_release_status | |||
| <include refid="dynamicWhereConditions" /> | |||
| </select> | |||
| <update id="updateStatus" parameterType="com.iformall.domain.po.WxWeappReleaseStatus" > | |||
| update wx_weapp_release_status | |||
| set `user_version` = #{userVersion}, `version_desc` = #{versionDesc}, | |||
| `release_status` = #{releaseStatus}, `release_err_code` = #{releaseErrCode}, `release_time` = #{releaseTime} | |||
| where `app_id` = #{appId} and `type` = #{type} | |||
| </update> | |||
| <select id="findUserVersions" resultType="hashmap" > | |||
| select user_version as version | |||
| from wx_weapp_release_status | |||
| where 1 = 1 | |||
| <if test=" null != type "> | |||
| and `type` = #{type} | |||
| </if> | |||
| group by user_version | |||
| </select> | |||
| <resultMap id="VBaseResultMap" type="com.iformall.domain.vo.WxWeappReleaseStatusVo"> | |||
| <id column="id" jdbcType="BIGINT" property="id" /> | |||
| <result column="app_id" jdbcType="VARCHAR" property="appId" /> | |||
| <result column="type" jdbcType="INTEGER" property="type" /> | |||
| <result column="user_version" jdbcType="VARCHAR" property="userVersion" /> | |||
| <result column="version_desc" jdbcType="VARCHAR" property="versionDesc" /> | |||
| <result column="release_status" jdbcType="INTEGER" property="releaseStatus" /> | |||
| <result column="release_err_code" jdbcType="VARCHAR" property="releaseErrCode" /> | |||
| <result column="release_time" jdbcType="TIMESTAMP" property="releaseTime" /> | |||
| <result column="name" jdbcType="TIMESTAMP" property="name" /> | |||
| </resultMap> | |||
| <sql id="allVoColumns"> | |||
| c.`id`,c.`app_id`,c.`type`,c.`user_version`,c.`version_desc`, | |||
| c.`release_status`,c.`release_err_code`,c.`release_time`, | |||
| a.`name` | |||
| </sql> | |||
| <sql id="dynamicVoWhereConditions"> | |||
| where 1 = 1 | |||
| <if test=" null != id "> | |||
| and c.`id` = #{id} | |||
| </if> | |||
| <if test=" null != appId "> | |||
| and c.`app_id` = #{appId} | |||
| </if> | |||
| <if test=" null != type "> | |||
| and c.`type` = #{type} | |||
| </if> | |||
| <if test=" null != userVersion "> | |||
| and c.`user_version` = #{userVersion} | |||
| </if> | |||
| <if test=" null != releaseStatus "> | |||
| and c.`release_status` = #{releaseStatus} | |||
| </if> | |||
| <if test=" null != releaseTime "> | |||
| and c.`release_time` = #{releaseTime} | |||
| </if> | |||
| <if test=" null != name "> | |||
| and a.`name` like concat('%', #{name},'%') | |||
| </if> | |||
| <if test=" null != ids "> | |||
| and id in | |||
| <foreach collection="ids" index="index" item="idItem" open="(" separator="," close=")"> | |||
| #{idItem} | |||
| </foreach> | |||
| </if> | |||
| <if test=" null != sortColumns"> order by ${sortColumns} </if> | |||
| </sql> | |||
| <select id="findVoList" parameterType="com.iformall.domain.vo.WxWeappReleaseStatusVo" resultMap="VBaseResultMap"> | |||
| select <include refid="allVoColumns" /> | |||
| from wx_weapp_release_status c | |||
| left join wx_appinfo a on c.`app_id` = a.`app_id` | |||
| <include refid="dynamicVoWhereConditions" /> | |||
| </select> | |||
| </mapper> | |||
| @@ -0,0 +1,61 @@ | |||
| <?xml version="1.0" encoding="UTF-8"?> | |||
| <project xmlns="http://maven.apache.org/POM/4.0.0" | |||
| xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
| xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
| <modelVersion>4.0.0</modelVersion> | |||
| <parent> | |||
| <artifactId>mallink</artifactId> | |||
| <groupId>com.iformall</groupId> | |||
| <version>1.0</version> | |||
| </parent> | |||
| <artifactId>malWechatOpen</artifactId> | |||
| <properties> | |||
| <weixin-java-mp.version>3.3.0.A</weixin-java-mp.version> | |||
| <weixin-java-open.version>3.3.0.A</weixin-java-open.version> | |||
| </properties> | |||
| <dependencies> | |||
| <dependency> | |||
| <groupId>com.iformall</groupId> | |||
| <artifactId>mallinkService</artifactId> | |||
| <version>1.0</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.github.binarywang</groupId> | |||
| <artifactId>weixin-java-open</artifactId> | |||
| <version>${weixin-java-open.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.github.binarywang</groupId> | |||
| <artifactId>weixin-java-mp</artifactId> | |||
| <version>${weixin-java-mp.version}</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.google.zxing</groupId> | |||
| <artifactId>core</artifactId> | |||
| <version>3.3.3</version> | |||
| </dependency> | |||
| <dependency> | |||
| <groupId>com.github.axet</groupId> | |||
| <artifactId>kaptcha</artifactId> | |||
| <version>0.0.9</version> | |||
| </dependency> | |||
| </dependencies> | |||
| <build> | |||
| <plugins> | |||
| <plugin> | |||
| <groupId>org.springframework.boot</groupId> | |||
| <artifactId>spring-boot-maven-plugin</artifactId> | |||
| <configuration> | |||
| <executable>true</executable> | |||
| </configuration> | |||
| </plugin> | |||
| </plugins> | |||
| </build> | |||
| </project> | |||
| @@ -0,0 +1,41 @@ | |||
| package com.iformall; | |||
| import com.ulisesbocchio.jasyptspringboot.annotation.EnableEncryptableProperties; | |||
| import io.swagger.models.auth.In; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.boot.SpringApplication; | |||
| import org.springframework.boot.autoconfigure.SpringBootApplication; | |||
| import org.springframework.context.annotation.Bean; | |||
| import springfox.documentation.swagger2.annotations.EnableSwagger2; | |||
| import tk.mybatis.spring.annotation.MapperScan; | |||
| /** | |||
| * @author stormeye | |||
| * @date 2019-01-14 | |||
| */ | |||
| @SpringBootApplication | |||
| @MapperScan(basePackages = {"com.iformall.mapper"}) | |||
| @EnableSwagger2 | |||
| @EnableEncryptableProperties | |||
| public class WechatOpenApplication { | |||
| @Value("${fm.exception}") | |||
| private boolean fmException; | |||
| @Bean | |||
| public boolean isFmException() { | |||
| return fmException; | |||
| } | |||
| @Value("${fm.delay}") | |||
| private Integer fmDelay; | |||
| @Bean | |||
| public Integer getFmDelay() { return fmDelay; } | |||
| public static void main(String[] args) { | |||
| SpringApplication.run(WechatOpenApplication.class, args); | |||
| } | |||
| } | |||
| @@ -0,0 +1,52 @@ | |||
| package com.iformall.config; | |||
| import org.springframework.boot.context.properties.ConfigurationProperties; | |||
| import org.springframework.stereotype.Component; | |||
| /** | |||
| * @author Stormeye | |||
| */ | |||
| @Component | |||
| @ConfigurationProperties(prefix = "aws") | |||
| public class AwsProperty { | |||
| // AWS ACCESS KEY | |||
| private String access; | |||
| private String secret; | |||
| private String clientRegion; | |||
| private String bucketName; | |||
| public String getAccess() { | |||
| return access; | |||
| } | |||
| public void setAccess(String access) { | |||
| this.access = access; | |||
| } | |||
| public String getSecret() { | |||
| return secret; | |||
| } | |||
| public void setSecret(String secret) { | |||
| this.secret = secret; | |||
| } | |||
| public String getClientRegion() { | |||
| return clientRegion; | |||
| } | |||
| public void setClientRegion(String clientRegion) { | |||
| this.clientRegion = clientRegion; | |||
| } | |||
| public String getBucketName() { | |||
| return bucketName; | |||
| } | |||
| public void setBucketName(String bucketName) { | |||
| this.bucketName = bucketName; | |||
| } | |||
| } | |||
| @@ -0,0 +1,32 @@ | |||
| package com.iformall.config; | |||
| import com.google.code.kaptcha.impl.DefaultKaptcha; | |||
| import com.google.code.kaptcha.util.Config; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import java.util.Properties; | |||
| /** | |||
| * 生成验证码配置 | |||
| * | |||
| * @author stormeye.wu | |||
| * @email wugq@mippoint.com | |||
| * @date 2017-04-20 19:22 | |||
| */ | |||
| @Configuration | |||
| public class KaptchaConfig { | |||
| @Bean | |||
| public DefaultKaptcha producer() { | |||
| Properties properties = new Properties(); | |||
| properties.put("kaptcha.border", "no"); | |||
| properties.put("kaptcha.textproducer.font.color", "black"); | |||
| properties.put("kaptcha.textproducer.char.space", "5"); | |||
| Config config = new Config(properties); | |||
| DefaultKaptcha defaultKaptcha = new DefaultKaptcha(); | |||
| defaultKaptcha.setConfig(config); | |||
| return defaultKaptcha; | |||
| } | |||
| } | |||
| @@ -0,0 +1,72 @@ | |||
| package com.iformall.config; | |||
| import org.slf4j.Logger; | |||
| import org.slf4j.LoggerFactory; | |||
| import org.springframework.cache.CacheManager; | |||
| import org.springframework.cache.annotation.CachingConfigurerSupport; | |||
| import org.springframework.cache.annotation.EnableCaching; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.data.redis.cache.RedisCacheConfiguration; | |||
| import org.springframework.data.redis.cache.RedisCacheManager; | |||
| import org.springframework.data.redis.connection.RedisConnectionFactory; | |||
| import java.time.Duration; | |||
| import java.util.HashMap; | |||
| import java.util.HashSet; | |||
| import java.util.Map; | |||
| import java.util.Set; | |||
| /** | |||
| * Created by Stormeye on 2018/10/1. | |||
| */ | |||
| @Configuration | |||
| @EnableCaching | |||
| public class RedisConfig extends CachingConfigurerSupport { | |||
| private final Logger logger = LoggerFactory.getLogger(this.getClass()); | |||
| //缓存管理器 | |||
| @Bean | |||
| public CacheManager cacheManager(RedisConnectionFactory connectionFactory) { | |||
| /* | |||
| //user信息缓存配置 | |||
| RedisCacheConfiguration userCacheConfiguration = RedisCacheConfiguration.defaultCacheConfig().entryTtl(Duration.ofSeconds(10)).disableCachingNullValues().prefixKeysWith("user"); | |||
| Map<String, RedisCacheConfiguration> redisCacheConfigurationMap = new HashMap<>(); | |||
| redisCacheConfigurationMap.put("user", userCacheConfiguration); | |||
| //初始化一个RedisCacheWriter | |||
| RedisCacheWriter redisCacheWriter = RedisCacheWriter.nonLockingRedisCacheWriter(connectionFactory); | |||
| // 设置CacheManager的值序列化方式为JdkSerializationRedisSerializer,但其实RedisCacheConfiguration默认就是使用StringRedisSerializer序列化key,JdkSerializationRedisSerializer序列化value,所以以下注释代码为默认实现 | |||
| // ClassLoader loader = this.getClass().getClassLoader(); | |||
| // JdkSerializationRedisSerializer jdkSerializer = new JdkSerializationRedisSerializer(loader); | |||
| // RedisSerializationContext.SerializationPair<Object> pair = RedisSerializationContext.SerializationPair.fromSerializer(jdkSerializer); | |||
| // RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig().serializeValuesWith(pair); | |||
| RedisCacheConfiguration defaultCacheConfig = RedisCacheConfiguration.defaultCacheConfig(); | |||
| //设置默认超过期时间是30秒 | |||
| defaultCacheConfig.entryTtl(Duration.ofSeconds(30)); | |||
| //初始化RedisCacheManager | |||
| RedisCacheManager cacheManager = new RedisCacheManager(redisCacheWriter, defaultCacheConfig, redisCacheConfigurationMap); | |||
| return cacheManager; | |||
| */ | |||
| RedisCacheConfiguration config = RedisCacheConfiguration.defaultCacheConfig(); // 生成一个默认配置,通过config对象即可对缓存进行自定义配置 | |||
| config = config.entryTtl(Duration.ofMinutes(1)) // 设置缓存的默认过期时间,也是使用Duration设置 | |||
| .disableCachingNullValues(); // 不缓存空值 | |||
| // 设置一个初始化的缓存空间set集合 | |||
| Set<String> cacheNames = new HashSet<>(); | |||
| cacheNames.add("my-redis-cache1"); | |||
| cacheNames.add("my-redis-cache2"); | |||
| // 对每个缓存空间应用不同的配置 | |||
| Map<String, RedisCacheConfiguration> configMap = new HashMap<>(); | |||
| configMap.put("my-redis-cache1", config); | |||
| configMap.put("my-redis-cache2", config.entryTtl(Duration.ofSeconds(120))); | |||
| RedisCacheManager cacheManager = RedisCacheManager.builder(connectionFactory) // 使用自定义的缓存配置初始化一个cacheManager | |||
| .initialCacheNames(cacheNames) // 注意这两句的调用顺序,一定要先调用该方法设置初始化的缓存名,再初始化相关的配置 | |||
| .withInitialCacheConfigurations(configMap) | |||
| .build(); | |||
| return cacheManager; | |||
| } | |||
| } | |||
| @@ -0,0 +1,124 @@ | |||
| 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; | |||
| } | |||
| } | |||
| @@ -0,0 +1,58 @@ | |||
| package com.iformall.config; | |||
| import java.io.IOException; | |||
| import java.util.Optional; | |||
| import javax.servlet.Filter; | |||
| import javax.servlet.FilterChain; | |||
| import javax.servlet.FilterConfig; | |||
| import javax.servlet.ServletException; | |||
| import javax.servlet.ServletRequest; | |||
| import javax.servlet.ServletResponse; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import javax.servlet.http.HttpServletResponse; | |||
| /** | |||
| * 前后端分离RESTful接口过滤器 | |||
| * | |||
| * @author xuguoqin | |||
| * | |||
| */ | |||
| public class RestFilter implements Filter { | |||
| @Override | |||
| public void init(FilterConfig filterConfig) throws ServletException { | |||
| } | |||
| @Override | |||
| public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) | |||
| throws IOException, ServletException { | |||
| HttpServletRequest req = null; | |||
| if (request instanceof HttpServletRequest) { | |||
| req = (HttpServletRequest) request; | |||
| } | |||
| HttpServletResponse res = null; | |||
| if (response instanceof HttpServletResponse) { | |||
| res = (HttpServletResponse) response; | |||
| } | |||
| if (req != null && res != null) { | |||
| //设置允许传递的参数 | |||
| res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorization"); | |||
| //设置允许带上cookie | |||
| res.setHeader("Access-Control-Allow-Credentials", "true"); | |||
| String origin = Optional.ofNullable(req.getHeader("Origin")).orElse(req.getHeader("Referer")); | |||
| //设置允许的请求来源 | |||
| res.setHeader("Access-Control-Allow-Origin", origin); | |||
| //设置允许的请求方法 | |||
| res.setHeader("Access-Control-Allow-Methods", "GET, POST, PATCH, PUT, DELETE, OPTIONS"); | |||
| } | |||
| chain.doFilter(request, response); | |||
| } | |||
| @Override | |||
| public void destroy() { | |||
| } | |||
| } | |||
| @@ -0,0 +1,24 @@ | |||
| package com.iformall.config; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import org.springframework.http.client.ClientHttpRequestFactory; | |||
| import org.springframework.http.client.SimpleClientHttpRequestFactory; | |||
| import org.springframework.web.client.RestTemplate; | |||
| @Configuration | |||
| public class RestTemplateConfig { | |||
| @Bean | |||
| public RestTemplate restTemplate(ClientHttpRequestFactory factory) { | |||
| return new RestTemplate(factory); | |||
| } | |||
| @Bean | |||
| public ClientHttpRequestFactory simpleClientHttpRequestFactory() { | |||
| SimpleClientHttpRequestFactory factory = new SimpleClientHttpRequestFactory(); | |||
| factory.setReadTimeout(5000);//ms | |||
| factory.setConnectTimeout(10000);//ms | |||
| return factory; | |||
| } | |||
| } | |||
| @@ -0,0 +1,303 @@ | |||
| package com.iformall.config; | |||
| import com.iformall.service.MallPermissionService; | |||
| import com.iformall.shiro.MyRetryLimitCredentialsMatcher; | |||
| import com.iformall.shiro.MyShiroRealm; | |||
| import org.apache.shiro.mgt.SecurityManager; | |||
| import org.apache.shiro.spring.LifecycleBeanPostProcessor; | |||
| import org.apache.shiro.spring.security.interceptor.AuthorizationAttributeSourceAdvisor; | |||
| import org.apache.shiro.spring.web.ShiroFilterFactoryBean; | |||
| import org.apache.shiro.web.mgt.DefaultWebSecurityManager; | |||
| import org.apache.shiro.web.servlet.SimpleCookie; | |||
| import org.apache.shiro.web.session.mgt.DefaultWebSessionManager; | |||
| import org.crazycake.shiro.RedisCacheManager; | |||
| import org.crazycake.shiro.RedisManager; | |||
| import org.crazycake.shiro.RedisSessionDAO; | |||
| import org.springframework.beans.factory.annotation.Autowired; | |||
| import org.springframework.beans.factory.annotation.Qualifier; | |||
| import org.springframework.beans.factory.annotation.Value; | |||
| import org.springframework.context.annotation.Bean; | |||
| import org.springframework.context.annotation.Configuration; | |||
| import javax.servlet.Filter; | |||
| import javax.servlet.ServletRequest; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| import java.util.LinkedHashMap; | |||
| import java.util.Map; | |||
| /** | |||
| * Created by yangqj on 2017/4/23. | |||
| */ | |||
| @Configuration | |||
| public class ShiroConfig { | |||
| @Autowired(required = false) | |||
| private MallPermissionService resourcesService; | |||
| @Value("${spring.redis.host}") | |||
| private String host; | |||
| @Value("${spring.redis.port}") | |||
| private int port; | |||
| @Value("${spring.redis.timeout}") | |||
| private int timeout; | |||
| @Value("${spring.redis.expire}") | |||
| private int expire; | |||
| @Value("${spring.redis.password}") | |||
| private String password; | |||
| @Bean | |||
| public static LifecycleBeanPostProcessor getLifecycleBeanPostProcessor() { | |||
| return new LifecycleBeanPostProcessor(); | |||
| } | |||
| /** | |||
| * ShiroDialect,为了在thymeleaf里使用shiro的标签的bean | |||
| * @return | |||
| */ | |||
| // @Bean | |||
| // public ShiroDialect shiroDialect() { | |||
| // return new ShiroDialect(); | |||
| // } | |||
| /** | |||
| * ShiroFilterFactoryBean 处理拦截资源文件问题。 | |||
| * 注意:单独一个ShiroFilterFactoryBean配置是或报错的,因为在 | |||
| * 初始化ShiroFilterFactoryBean的时候需要注入:SecurityManager | |||
| * <p> | |||
| * Filter Chain定义说明 | |||
| * 1、一个URL可以配置多个Filter,使用逗号分隔 | |||
| * 2、当设置多个过滤器时,全部验证通过,才视为通过 | |||
| * 3、部分过滤器可指定参数,如perms,roles | |||
| */ | |||
| @Bean | |||
| public ShiroFilterFactoryBean shirFilter(SecurityManager securityManager) { | |||
| System.out.println("ShiroConfiguration.shirFilter()"); | |||
| ShiroFilterFactoryBean shiroFilterFactoryBean = new ShiroFilterFactoryBean(); | |||
| // 必须设置 SecurityManager | |||
| shiroFilterFactoryBean.setSecurityManager(securityManager); | |||
| Map<String, Filter> filters = new LinkedHashMap<String, Filter>(); | |||
| filters.put("token", new ShiroLoginFilter()); | |||
| filters.put("corsFilter", new RestFilter()); | |||
| //filters.put("authc", new MyFormAuthenticationFilter()); | |||
| shiroFilterFactoryBean.setFilters(filters); | |||
| // 如果不设置默认会自动寻找Web工程根目录下的"/login.jsp"页面 | |||
| shiroFilterFactoryBean.setLoginUrl("/#/"); | |||
| // 登录成功后要跳转的链接 | |||
| shiroFilterFactoryBean.setSuccessUrl("/usersPage"); | |||
| //未授权界面; | |||
| shiroFilterFactoryBean.setUnauthorizedUrl("/403"); | |||
| //拦截器. | |||
| Map<String, String> filterChainDefinitionMap = new LinkedHashMap<String, String>(); | |||
| //配置退出 过滤器,其中的具体的退出代码Shiro已经替我们实现了 | |||
| //filterChainDefinitionMap.put("/ue/**", "anon"); | |||
| //filterChainDefinitionMap.put("/config.json", "anon"); | |||
| // 静态文件 | |||
| filterChainDefinitionMap.put("/css/**", "anon"); | |||
| filterChainDefinitionMap.put("/js/**", "anon"); | |||
| filterChainDefinitionMap.put("/img/**", "anon"); | |||
| filterChainDefinitionMap.put("/font-awesome/**", "anon"); | |||
| //<!-- 过滤链定义,从上向下顺序执行,一般将 /**放在最为下边 -->:这是一个坑呢,一不小心代码就不好使了; | |||
| //<!-- authc:所有url都必须认证通过才可以访问; anon:所有url都都可以匿名访问--> | |||
| //自定义加载权限资源关系 | |||
| // Map<String,Object> map = new HashMap<>(); | |||
| // List<SysPermission> resourcesList = resourcesService.list(map); | |||
| // for(SysPermission resources:resourcesList){ | |||
| // | |||
| // if (StringUtil.isNotEmpty(resources.getUrl())) { | |||
| // String permission = "perms[" + resources.getUrl()+ "]"; | |||
| // filterChainDefinitionMap.put(resources.getUrl(),permission); | |||
| // } | |||
| // } | |||
| // 登录 | |||
| filterChainDefinitionMap.put("/captcha.jpg", "anon"); | |||
| filterChainDefinitionMap.put("/doLogin/**", "anon"); | |||
| filterChainDefinitionMap.put("/version", "anon"); | |||
| /// swagger-ui.html | |||
| filterChainDefinitionMap.put("/swagger-ui.html", "anon"); | |||
| filterChainDefinitionMap.put("/v2/**", "anon"); | |||
| filterChainDefinitionMap.put("/swagger-resources/**", "anon"); | |||
| filterChainDefinitionMap.put("/webjars/**", "anon"); | |||
| // 第三方平台 | |||
| filterChainDefinitionMap.put("/wxOpen/**", "anon"); | |||
| // filterChainDefinitionMap.put("/role/**", "corsFilter,token"); | |||
| filterChainDefinitionMap.put("/**", "corsFilter,token,authc"); | |||
| // filterChainDefinitionMap.put("/**", "anon"); | |||
| shiroFilterFactoryBean.setFilterChainDefinitionMap(filterChainDefinitionMap); | |||
| return shiroFilterFactoryBean; | |||
| } | |||
| public static boolean isAjax(ServletRequest request) { | |||
| String header = ((HttpServletRequest) request).getHeader("X-Requested-With"); | |||
| if ("XMLHttpRequest".equalsIgnoreCase(header)) { | |||
| System.out.println("当前请求为Ajax请求"); | |||
| return Boolean.TRUE; | |||
| } | |||
| System.out.println("当前请求非Ajax请求"); | |||
| return Boolean.FALSE; | |||
| } | |||
| @Bean | |||
| public SecurityManager securityManager(@Qualifier("myRetryLimitCredentialsMatcher") MyRetryLimitCredentialsMatcher matcher) { | |||
| DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); | |||
| //设置realm. | |||
| securityManager.setRealm(myShiroRealm(matcher)); | |||
| // 自定义缓存实现 使用redis | |||
| //securityManager.setCacheManager(cacheManager()); | |||
| // 自定义session管理 使用redis | |||
| securityManager.setSessionManager(sessionManager()); | |||
| return securityManager; | |||
| } | |||
| @Bean | |||
| public MyShiroRealm myShiroRealm(MyRetryLimitCredentialsMatcher matcher) { | |||
| MyShiroRealm myShiroRealm = new MyShiroRealm(); | |||
| myShiroRealm.setCredentialsMatcher(matcher); | |||
| return myShiroRealm; | |||
| } | |||
| /** | |||
| * 密码匹配凭证管理器 凭证匹配器 | |||
| * (由于我们的密码校验交给Shiro的SimpleAuthenticationInfo进行处理了 | |||
| * 所以我们需要修改下doGetAuthenticationInfo中的代码; | |||
| * ) | |||
| * | |||
| * @return | |||
| */ | |||
| @Bean(name = "myRetryLimitCredentialsMatcher") | |||
| public MyRetryLimitCredentialsMatcher hashedCredentialsMatcher() { | |||
| MyRetryLimitCredentialsMatcher hashedCredentialsMatcher = new MyRetryLimitCredentialsMatcher(); | |||
| hashedCredentialsMatcher.setHashAlgorithmName("md5");//散列算法:这里使用MD5算法; | |||
| hashedCredentialsMatcher.setHashIterations(2);//散列的次数,比如散列两次,相当于 md5(md5("")); | |||
| return hashedCredentialsMatcher; | |||
| } | |||
| /** | |||
| * 开启shiro aop注解支持. | |||
| * 使用代理方式;所以需要开启代码支持; | |||
| * | |||
| * @param securityManager | |||
| * @return | |||
| */ | |||
| @Bean | |||
| public AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor(SecurityManager securityManager) { | |||
| AuthorizationAttributeSourceAdvisor authorizationAttributeSourceAdvisor = new AuthorizationAttributeSourceAdvisor(); | |||
| authorizationAttributeSourceAdvisor.setSecurityManager(securityManager); | |||
| return authorizationAttributeSourceAdvisor; | |||
| } | |||
| /** | |||
| * 配置shiro redisManager | |||
| * 使用的是shiro-redis开源插件 | |||
| * | |||
| * @return | |||
| */ | |||
| public RedisManager redisManager() { | |||
| RedisManager redisManager = new RedisManager(); | |||
| redisManager.setHost(host); | |||
| redisManager.setPort(port); | |||
| //redisManager.setExpire(expire);// 配置缓存过期时间 | |||
| redisManager.setTimeout(timeout); | |||
| redisManager.setPassword(password); | |||
| return redisManager; | |||
| } | |||
| /** | |||
| * cacheManager 缓存 redis实现 | |||
| * 使用的是shiro-redis开源插件 | |||
| * | |||
| * @return | |||
| */ | |||
| public RedisCacheManager cacheManager() { | |||
| RedisCacheManager redisCacheManager = new RedisCacheManager(); | |||
| redisCacheManager.setRedisManager(redisManager()); | |||
| return redisCacheManager; | |||
| } | |||
| /** | |||
| * RedisSessionDAO shiro sessionDao层的实现 通过redis | |||
| * 使用的是shiro-redis开源插件 | |||
| */ | |||
| @Bean | |||
| public RedisSessionDAO redisSessionDAO() { | |||
| RedisSessionDAO redisSessionDAO = new RedisSessionDAO(); | |||
| redisSessionDAO.setRedisManager(redisManager()); | |||
| return redisSessionDAO; | |||
| } | |||
| /** | |||
| * shiro session的管理 | |||
| */ | |||
| @Bean | |||
| public DefaultWebSessionManager sessionManager() { | |||
| DefaultWebSessionManager sessionManager = new DefaultWebSessionManager(); | |||
| //设置session过期时间为1小时(单位:毫秒),默认为30分钟 | |||
| sessionManager.setGlobalSessionTimeout(60 * 60 * 1000); | |||
| sessionManager.setSessionValidationSchedulerEnabled(true); | |||
| sessionManager.setSessionIdUrlRewritingEnabled(false); | |||
| sessionManager.setSessionDAO(redisSessionDAO()); | |||
| sessionManager.setSessionIdCookie(simpleCookie()); | |||
| return sessionManager; | |||
| } | |||
| @Bean | |||
| public SimpleCookie simpleCookie() { | |||
| SimpleCookie simpleCookie = new SimpleCookie("SSID"); | |||
| simpleCookie.setDomain(""); | |||
| return simpleCookie; | |||
| } | |||
| // @Bean | |||
| // public SimpleCookie rememberMeCookie(){ | |||
| // //System.out.println("ShiroConfiguration.rememberMeCookie()"); | |||
| // //这个参数是cookie的名称,对应前端的checkbox的name = rememberMe | |||
| // SimpleCookie simpleCookie = new SimpleCookie("rememberMe"); | |||
| // //<!-- 记住我cookie生效时间30天 ,单位秒;--> | |||
| // simpleCookie.setMaxAge(60*30); | |||
| // return simpleCookie; | |||
| // } | |||
| // @Bean | |||
| // public CookieRememberMeManager rememberMeManager(){ | |||
| // //System.out.println("ShiroConfiguration.rememberMeManager()"); | |||
| // CookieRememberMeManager cookieRememberMeManager = new CookieRememberMeManager(); | |||
| // cookieRememberMeManager.setCookie(rememberMeCookie()); | |||
| // //rememberMe cookie加密的密钥 建议每个项目都不一样 默认AES算法 密钥长度(128 256 512 位) | |||
| // cookieRememberMeManager.setCipherKey(Base64.decodeBytes("2AvVhdsgUs0FSA3SDFAdag==")); | |||
| // return cookieRememberMeManager; | |||
| // } | |||
| // @Bean(name = "securityManager") | |||
| // public DefaultWebSecurityManager defaultWebSecurityManager(MyShiroRealm realm){ | |||
| // DefaultWebSecurityManager securityManager = new DefaultWebSecurityManager(); | |||
| // //设置realm | |||
| // securityManager.setRealm(realm); | |||
| // //用户授权/认证信息Cache, 采用EhCache缓存 | |||
| // securityManager.setCacheManager(cacheManager()); | |||
| // //注入记住我管理器 | |||
| // securityManager.setRememberMeManager(rememberMeManager()); | |||
| // return securityManager; | |||
| // } | |||
| } | |||
| @@ -0,0 +1,31 @@ | |||
| package com.iformall.config; | |||
| import com.alibaba.fastjson.JSON; | |||
| import com.iformall.common.ResultData; | |||
| import org.apache.shiro.web.filter.authc.FormAuthenticationFilter; | |||
| import javax.servlet.ServletRequest; | |||
| import javax.servlet.ServletResponse; | |||
| import javax.servlet.http.HttpServletRequest; | |||
| public class ShiroLoginFilter extends FormAuthenticationFilter { | |||
| @Override | |||
| protected boolean onAccessDenied(ServletRequest request, ServletResponse response) throws Exception { | |||
| response.setCharacterEncoding("UTF-8"); | |||
| response.setContentType("application/json"); | |||
| ResultData resultData = new ResultData(ResultData.UNLOGIN,"用户未登录"); | |||
| response.getWriter().write(JSON.toJSONString(resultData)); | |||
| return false; | |||
| } | |||
| /** | |||
| * 判断ajax请求 | |||
| * @param request | |||
| * @return | |||
| */ | |||
| boolean isAjax(HttpServletRequest request){ | |||
| return (request.getHeader("X-Requested-With") != null && "XMLHttpRequest".equals( request.getHeader("X-Requested-With").toString()) ) ; | |||
| } | |||
| } | |||