diff --git a/mall-common/pom.xml b/mall-common/pom.xml index 8249aa67..192d2042 100644 --- a/mall-common/pom.xml +++ b/mall-common/pom.xml @@ -1,6 +1,6 @@ - 4.0.0 com.suisung.mall diff --git a/mall-common/src/main/java/com/suisung/mall/common/api/PayType.java b/mall-common/src/main/java/com/suisung/mall/common/api/PayType.java index f0e5d037..4fbe79cc 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/api/PayType.java +++ b/mall-common/src/main/java/com/suisung/mall/common/api/PayType.java @@ -7,7 +7,7 @@ package com.suisung.mall.common.api; */ public enum PayType { - ALIPAY_H5(1), WX_XCX(2), WX_H5(3), WX_JSAPI(4), WX_APP(5), ALIPAY_APP(6),WX_PC_PAY(7),ALI_PC_PAY(8); + ALIPAY_H5(1), WX_XCX(2), WX_H5(3), WX_JSAPI(4), WX_APP(5), ALIPAY_APP(6), WX_PC_PAY(7), ALI_PC_PAY(8); private final int code; diff --git a/mall-common/src/main/java/com/suisung/mall/common/api/StateCode.java b/mall-common/src/main/java/com/suisung/mall/common/api/StateCode.java index 49605225..0ce63060 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/api/StateCode.java +++ b/mall-common/src/main/java/com/suisung/mall/common/api/StateCode.java @@ -1,7 +1,6 @@ package com.suisung.mall.common.api; import com.suisung.mall.common.utils.I18nUtil; -import io.swagger.models.auth.In; import java.math.BigDecimal; import java.util.HashMap; @@ -16,18 +15,18 @@ public class StateCode { public static final int DELIVERY_TYPE_SELF_PICK_UP = 5; // 自提(运费 0 元) public static final int DELIVERY_TYPE_EXP = 10; // 普通快递 public static final int DELIVERY_TYPE_IN_STORE_SERVICE = 15; // 店铺配送 - public static final int DELIVERY_TYPE_SAME_CITY= 16;//顺丰同城配送 + public static final int DELIVERY_TYPE_SAME_CITY = 16;//顺丰同城配送 - public static final Map DELIVERY_TYPE_MAP = new HashMap(){ + public static final Map DELIVERY_TYPE_MAP = new HashMap() { { - put(DELIVERY_TYPE_EXPRESS,"快递配送"); - put(DELIVERY_TYPE_EMS,"EMS"); - put(DELIVERY_TYPE_MAIL,"平邮"); - put(DELIVERY_TYPE_AIR_FREIGHT,"货运"); - put(DELIVERY_TYPE_SELF_PICK_UP,"到店自提"); - put(DELIVERY_TYPE_EXP,"普通快递"); - put(DELIVERY_TYPE_IN_STORE_SERVICE,"店铺配送"); - put(DELIVERY_TYPE_SAME_CITY,"顺丰同城"); + put(DELIVERY_TYPE_EXPRESS, "快递配送"); + put(DELIVERY_TYPE_EMS, "EMS"); + put(DELIVERY_TYPE_MAIL, "平邮"); + put(DELIVERY_TYPE_AIR_FREIGHT, "货运"); + put(DELIVERY_TYPE_SELF_PICK_UP, "到店自提"); + put(DELIVERY_TYPE_EXP, "普通快递"); + put(DELIVERY_TYPE_IN_STORE_SERVICE, "店铺配送"); + put(DELIVERY_TYPE_SAME_CITY, "顺丰同城"); } }; @@ -423,6 +422,29 @@ public class StateCode { public static final Map DELIVERY_TIME_HOUR = new HashMap(); public static final Map DELIVERY_TIME_MINUTE = new HashMap(); + public static final int SUBSCRIBE = 1; // 已订阅讲师 + public static final int NOT_SUBSCRIBE = 0; // 未订阅讲师 + public static final String CLASSES_HAS_NOT_STARTED = "未开始"; // 未开始 + public static final String CLASSES_HAS_OVER = "已结束"; // 已结束 + public static final String CLASSES_HAS_START = "已开始"; // 已开始 + public static final String WX_MP_ACCESSTOKEN = "wx_token:mp_token"; // 公众号Access_Token + public static final String WX_XCX_ACCESSTOKEN = "wx_token:xcx_token"; // 小程序Access_Token + public static final BigDecimal commissionInit = new BigDecimal("0.00"); + // 打票机相关常量定义 + // 打票机模版分类:1-下单打印模版;2-退货打印模版; + public static final int PRINTER_TEMP_CATE_ORDER = 1; + // 打票机模版分类:1-下单打印模版;2-退货打印模版; + public static final int PRINTER_TEMP_CATE_REFUND = 2; + // 顺丰同城订单状态:1-订单创建;2-订单取消;10-配送员接单/配送员改派;12-配送员到店;15-配送员配送中(已取货);17-配送员妥投完单;22-配送员撤单;31-取消中;91-骑士上报异常; + public static final int SF_ORDER_STATUS_CREATED = 1; + public static final int SF_ORDER_STATUS_CANCELED = 2; + public static final int SF_ORDER_STATUS_RECEIVING = 10; + public static final int SF_ORDER_STATUS_ARRIVED = 12; + public static final int SF_ORDER_STATUS_RECEIVED = 15; + public static final int SF_ORDER_STATUS_FINISH = 17; + public static final int SF_ORDER_STATUS_WITHDRAW = 22; + public static final int SF_ORDER_STATUS_EXCEPTION = 91; + public static final int SF_ORDER_STATUS_CANCELING = 31; static { DELIVERY_TIME_NOT_TIMER.put(1, I18nUtil._("不限时段")); @@ -502,33 +524,4 @@ public class StateCode { public static boolean ifOther(Integer source_type) { return source_type != null && SOURCE_TYPE_OTHER == source_type; } - - public static final int SUBSCRIBE = 1; // 已订阅讲师 - public static final int NOT_SUBSCRIBE = 0; // 未订阅讲师 - - public static final String CLASSES_HAS_NOT_STARTED = "未开始"; // 未开始 - public static final String CLASSES_HAS_OVER = "已结束"; // 已结束 - public static final String CLASSES_HAS_START = "已开始"; // 已开始 - - public static final String WX_MP_ACCESSTOKEN = "wx_token:mp_token"; // 公众号Access_Token - public static final String WX_XCX_ACCESSTOKEN = "wx_token:xcx_token"; // 小程序Access_Token - - public static final BigDecimal commissionInit = new BigDecimal("0.00"); - - // 打票机相关常量定义 - // 打票机模版分类:1-下单打印模版;2-退货打印模版; - public static final int PRINTER_TEMP_CATE_ORDER = 1; - // 打票机模版分类:1-下单打印模版;2-退货打印模版; - public static final int PRINTER_TEMP_CATE_REFUND = 2; - - // 顺丰同城订单状态:1-订单创建;2-订单取消;10-配送员接单/配送员改派;12-配送员到店;15-配送员配送中(已取货);17-配送员妥投完单;22-配送员撤单;31-取消中;91-骑士上报异常; - public static final int SF_ORDER_STATUS_CREATED = 1; - public static final int SF_ORDER_STATUS_CANCELED = 2; - public static final int SF_ORDER_STATUS_RECEIVING = 10; - public static final int SF_ORDER_STATUS_ARRIVED = 12; - public static final int SF_ORDER_STATUS_RECEIVED = 15; - public static final int SF_ORDER_STATUS_FINISH = 17; - public static final int SF_ORDER_STATUS_WITHDRAW = 22; - public static final int SF_ORDER_STATUS_EXCEPTION = 91; - public static final int SF_ORDER_STATUS_CANCELING = 31; } diff --git a/mall-common/src/main/java/com/suisung/mall/common/constant/CommonConstant.java b/mall-common/src/main/java/com/suisung/mall/common/constant/CommonConstant.java index 068db484..c43a2c83 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/constant/CommonConstant.java +++ b/mall-common/src/main/java/com/suisung/mall/common/constant/CommonConstant.java @@ -24,14 +24,14 @@ public class CommonConstant { // 店铺角色权限组 public static final String STORE_RIGHT_GROUP_ADMIN = "店铺管理员"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_YYJL = "运营经理"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_DDSHY = "订单审核员"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_CWSHY = "财务审核员"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_FHSHY = "发货审核员"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_YWJL = "业务经理"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_CKGLY = "仓库管理员"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_ZLWHY = "资料维护员"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_KF = "客服"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_KZ1 = "扩展1"; // 店铺管理员; - public static final String STORE_RIGHT_GROUP_KZ2 = "扩展2"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_YYJL = "运营经理"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_DDSHY = "订单审核员"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_CWSHY = "财务审核员"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_FHSHY = "发货审核员"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_YWJL = "业务经理"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_CKGLY = "仓库管理员"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_ZLWHY = "资料维护员"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_KF = "客服"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_KZ1 = "扩展1"; // 店铺管理员; + public static final String STORE_RIGHT_GROUP_KZ2 = "扩展2"; // 店铺管理员; } diff --git a/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java b/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java index 6871182f..6efff581 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java +++ b/mall-common/src/main/java/com/suisung/mall/common/constant/RedisConstant.java @@ -20,12 +20,12 @@ public class RedisConstant { public static final String Config_Cache_Key = "config_cache_key"; - public static final String Config_Cache_Version = "config_cache_version"; + public static final String Config_Cache_Version = "config_cache_version"; public static final String Plat_Category = ConstantRedis.Cache_NameSpace + "plat_category"; public static final String Store_Category_NameSpace = ConstantRedis.Cache_NameSpace + "storeCate:"; - public static final String Product_Cate_Key = ConstantRedis.Cache_NameSpace + "product_cate_Key"; + public static final String Product_Cate_Key = ConstantRedis.Cache_NameSpace + "product_cate_Key"; } diff --git a/mall-common/src/main/java/com/suisung/mall/common/constant/SFExpressConstant.java b/mall-common/src/main/java/com/suisung/mall/common/constant/SFExpressConstant.java index 251e9f62..08a44931 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/constant/SFExpressConstant.java +++ b/mall-common/src/main/java/com/suisung/mall/common/constant/SFExpressConstant.java @@ -26,16 +26,16 @@ public class SFExpressConstant { public static int Cons_ReportException = 91; public static int Cons_CancelingOrder = 31; - public static Map SF_Order_Status_Map = new HashMap(){{ - put(Cons_CreatedOrder,"订单创建"); - put(Cons_CanceledOrder,"订单取消"); - put(Cons_AcceptOrder,"配送员接单/配送员改派"); - put(Cons_ArriveStore,"配送员到店"); - put(Cons_Delivering,"配送员配送中(已取货)"); - put(Cons_DeliverySuccess,"配送员妥投完单"); - put(Cons_WithDrawOrder,"配送员撤单"); - put(Cons_ReportException,"骑士上报异常"); - put(Cons_CancelingOrder,"取消中"); + public static Map SF_Order_Status_Map = new HashMap() {{ + put(Cons_CreatedOrder, "订单创建"); + put(Cons_CanceledOrder, "订单取消"); + put(Cons_AcceptOrder, "配送员接单/配送员改派"); + put(Cons_ArriveStore, "配送员到店"); + put(Cons_Delivering, "配送员配送中(已取货)"); + put(Cons_DeliverySuccess, "配送员妥投完单"); + put(Cons_WithDrawOrder, "配送员撤单"); + put(Cons_ReportException, "骑士上报异常"); + put(Cons_CancelingOrder, "取消中"); }}; } diff --git a/mall-common/src/main/java/com/suisung/mall/common/feignService/PayService.java b/mall-common/src/main/java/com/suisung/mall/common/feignService/PayService.java index 1af1df7b..481af4ee 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/feignService/PayService.java +++ b/mall-common/src/main/java/com/suisung/mall/common/feignService/PayService.java @@ -5,7 +5,6 @@ import com.suisung.mall.common.modules.order.ShopOrderReturn; import com.suisung.mall.common.modules.pay.*; import com.suisung.mall.common.modules.product.ShopProductIndex; import com.suisung.mall.common.pojo.output.TimelineOutput; -import io.swagger.annotations.ApiOperation; import org.springframework.cloud.openfeign.FeignClient; import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.PostMapping; @@ -87,12 +86,12 @@ public interface PayService { @PostMapping(value = "/admin/pay/payController/getOrderNum") long getOrderNum(@RequestParam(name = "order_state_id", required = false) Integer order_state_id, - @RequestParam(name = "store_id", required = false) Integer store_id, - @RequestParam(name = "chain_id", required = false) Integer chain_id, - @RequestParam(name = "day_flag", required = false) Integer day_flag, - @RequestParam(name = "month_flag", required = false) Integer month_flag, - @RequestParam(name = "trade_type_id", required = false) Integer trade_type_id, - @RequestParam(name = "subsite_id", required = false) Integer subsite_id); + @RequestParam(name = "store_id", required = false) Integer store_id, + @RequestParam(name = "chain_id", required = false) Integer chain_id, + @RequestParam(name = "day_flag", required = false) Integer day_flag, + @RequestParam(name = "month_flag", required = false) Integer month_flag, + @RequestParam(name = "trade_type_id", required = false) Integer trade_type_id, + @RequestParam(name = "subsite_id", required = false) Integer subsite_id); @PostMapping(value = "/admin/pay/payController/getOrderPaymentAmount") BigDecimal getOrderPaymentAmount(@RequestParam(name = "trade_is_paid", required = false) Integer trade_is_paid, @@ -171,13 +170,14 @@ public interface PayService { /** * 更改交易订单的订单状态和付款状态 + * * @param orderId * @param orderStateId 空值或0将不更新 - * @param tradeIsPaid 空值或0将不更新 + * @param tradeIsPaid 空值或0将不更新 * @return */ @PostMapping(value = "/admin/pay/pay-consume-trade/change/state") Boolean changePayConsumeTradeState(@RequestParam(name = "order_id") String orderId, - @RequestParam(name = "order_state_id") Integer orderStateId, - @RequestParam(name = "trade_is_paid") Integer tradeIsPaid); + @RequestParam(name = "order_state_id") Integer orderStateId, + @RequestParam(name = "trade_is_paid") Integer tradeIsPaid); } diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserAnalytics.java b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserAnalytics.java index 39c39555..487608e3 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserAnalytics.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserAnalytics.java @@ -51,7 +51,7 @@ public class AccountUserAnalytics implements Serializable { @ApiModelProperty(value = "退货数量") private Integer user_product_return_num; -// @Version + // @Version @ApiModelProperty(value = "乐观锁") private Integer version; diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannel.java b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannel.java index 4a2258f1..76f067d6 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannel.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannel.java @@ -23,7 +23,7 @@ import java.io.Serializable; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("account_user_channel") -@ApiModel(value="AccountUserChannel对象", description="用户渠道表") +@ApiModel(value = "AccountUserChannel对象", description = "用户渠道表") public class AccountUserChannel implements Serializable { private static final long serialVersionUID = 1L; diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannelBring.java b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannelBring.java index 6a607a69..4cb49131 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannelBring.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannelBring.java @@ -19,7 +19,7 @@ import java.util.Date; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("account_user_channel_bring") -@ApiModel(value="AccountUserChannelBring对象", description="渠道引流表") +@ApiModel(value = "AccountUserChannelBring对象", description = "渠道引流表") public class AccountUserChannelBring implements Serializable { private static final long serialVersionUID = 1L; diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannelCode.java b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannelCode.java index 4716dd5f..f19856e3 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannelCode.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserChannelCode.java @@ -24,7 +24,7 @@ import java.io.Serializable; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("account_user_channel_code") -@ApiModel(value="AccountUserChannelCode对象", description="用户渠道邀请码表") +@ApiModel(value = "AccountUserChannelCode对象", description = "用户渠道邀请码表") public class AccountUserChannelCode implements Serializable { private static final long serialVersionUID = 1L; diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserSns.java b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserSns.java index bbb003fa..5bd4c460 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserSns.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/account/AccountUserSns.java @@ -83,7 +83,7 @@ public class AccountUserSns implements Serializable { @ApiModelProperty(value = "帖子转发") private Integer user_story_forward; -// @Version + // @Version @ApiModelProperty(value = "乐观锁") private Integer version; diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/order/ShopOrderUserForm.java b/mall-common/src/main/java/com/suisung/mall/common/modules/order/ShopOrderUserForm.java index 5990fd05..0412cbde 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/order/ShopOrderUserForm.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/order/ShopOrderUserForm.java @@ -13,10 +13,9 @@ import java.io.Serializable; import java.util.Date; - /** *

- * + * *

* * @author Xinze @@ -26,7 +25,7 @@ import java.util.Date; @EqualsAndHashCode(callSuper = false) @Accessors(chain = true) @TableName("shop_order_user_form") -@ApiModel(value="ShopOrderUserForm对象", description="") +@ApiModel(value = "ShopOrderUserForm对象", description = "") public class ShopOrderUserForm implements Serializable { private static final long serialVersionUID = 1L; diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/product/ShopPageUserForm.java b/mall-common/src/main/java/com/suisung/mall/common/modules/product/ShopPageUserForm.java index f955eac1..fb48fa81 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/product/ShopPageUserForm.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/product/ShopPageUserForm.java @@ -42,7 +42,7 @@ public class ShopPageUserForm implements Serializable { @ApiModelProperty(value = "用户昵称") private String user_nickname; - + @ApiModelProperty(value = "采集内容") private String form_data; diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/sns/LiveLiveTag.java b/mall-common/src/main/java/com/suisung/mall/common/modules/sns/LiveLiveTag.java index 2c2e81b9..24739ba0 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/sns/LiveLiveTag.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/sns/LiveLiveTag.java @@ -47,7 +47,7 @@ public class LiveLiveTag implements Serializable { @ApiModelProperty(value = "是否推荐(ENUM):1-是; 0-否") private Integer live_tag_recommend; -// @Version + // @Version @ApiModelProperty(value = "乐观锁") private Integer version; diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStorePrinterLog.java b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStorePrinterLog.java index a6596010..c6b7a685 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStorePrinterLog.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStorePrinterLog.java @@ -34,8 +34,43 @@ import java.util.Date; public class ShopStorePrinterLog implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "日志自增ID") + @TableId(value = "log_id", type = IdType.INPUT) + private Long log_id; + @ApiModelProperty(value = "打印分类") + private Integer category; + @ApiModelProperty(value = "门店ID") + private Integer store_id; + @ApiModelProperty(value = "订单ID") + private String order_id; + @ApiModelProperty(value = "打印模版ID") + private Long template_id; + @ApiModelProperty(value = "模版字符串") + private String template_value; + @ApiModelProperty(value = "模版渲染数据值") + private String template_data; + @ApiModelProperty(value = "最终打印的内容") + private String print_content; + @ApiModelProperty(value = "飞鹅返回到打印编号") + private String feie_print_no; + @ApiModelProperty(value = "打印机编号") + private String printer_sn; + @ApiModelProperty(value = "状态:1-有效;2-无效;") + private Integer status; + @ApiModelProperty(value = "新增用户ID") + private Integer created_by; + @ApiModelProperty(value = "更新用户ID") + private Integer updated_by; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "新增时间") + private Date created_at; + @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") + @ApiModelProperty(value = "修改时间") + private Date updated_at; - public ShopStorePrinterLog(Integer category,Integer storeId,String orderId,Long templateId,String templateValue, String templateData,String printContent,String feiePrintNo,String printerSn) { + public ShopStorePrinterLog(Integer category, Integer storeId, String orderId, Long templateId, String templateValue, String templateData, String printContent, String feiePrintNo, String printerSn) { this.category = category; this.store_id = storeId; this.order_id = orderId; @@ -46,54 +81,4 @@ public class ShopStorePrinterLog implements Serializable { this.feie_print_no = feiePrintNo; this.printer_sn = printerSn; } - - @ApiModelProperty(value = "日志自增ID") - @TableId(value = "log_id", type = IdType.INPUT) - private Long log_id; - - @ApiModelProperty(value = "打印分类") - private Integer category; - - @ApiModelProperty(value = "门店ID") - private Integer store_id; - - @ApiModelProperty(value = "订单ID") - private String order_id; - - @ApiModelProperty(value = "打印模版ID") - private Long template_id; - - @ApiModelProperty(value = "模版字符串") - private String template_value; - - @ApiModelProperty(value = "模版渲染数据值") - private String template_data; - - @ApiModelProperty(value = "最终打印的内容") - private String print_content; - - @ApiModelProperty(value = "飞鹅返回到打印编号") - private String feie_print_no; - - @ApiModelProperty(value = "打印机编号") - private String printer_sn; - - @ApiModelProperty(value = "状态:1-有效;2-无效;") - private Integer status; - - @ApiModelProperty(value = "新增用户ID") - private Integer created_by; - - @ApiModelProperty(value = "更新用户ID") - private Integer updated_by; - - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty(value = "新增时间") - private Date created_at; - - @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") - @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") - @ApiModelProperty(value = "修改时间") - private Date updated_at; } diff --git a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreSfOrder.java b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreSfOrder.java index 780c35bf..2689737b 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreSfOrder.java +++ b/mall-common/src/main/java/com/suisung/mall/common/modules/store/ShopStoreSfOrder.java @@ -15,13 +15,11 @@ import com.fasterxml.jackson.annotation.JsonFormat; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; -import io.swagger.models.auth.In; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; import org.springframework.format.annotation.DateTimeFormat; -import java.math.BigDecimal; import java.util.Date; @Data diff --git a/mall-common/src/main/java/com/suisung/mall/common/pojo/dto/ErrorTypeEnum.java b/mall-common/src/main/java/com/suisung/mall/common/pojo/dto/ErrorTypeEnum.java index 541135da..395a1d92 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/pojo/dto/ErrorTypeEnum.java +++ b/mall-common/src/main/java/com/suisung/mall/common/pojo/dto/ErrorTypeEnum.java @@ -23,8 +23,8 @@ public enum ErrorTypeEnum { ERR_ORDER_SERVICE("订单处理异常", 6001); + private static final List> errorTypes = new ArrayList<>(); private final String label; - private final int value; ErrorTypeEnum(String label, int value) { @@ -32,8 +32,6 @@ public enum ErrorTypeEnum { this.value = value; } - private static final List> errorTypes = new ArrayList<>(); - public static List> getAllValues() { if (CollUtil.isNotEmpty(errorTypes)) { return errorTypes; diff --git a/mall-common/src/main/java/com/suisung/mall/common/pojo/res/FeiePrinterApiRes.java b/mall-common/src/main/java/com/suisung/mall/common/pojo/res/FeiePrinterApiRes.java index 5b67ef33..a585ae90 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/pojo/res/FeiePrinterApiRes.java +++ b/mall-common/src/main/java/com/suisung/mall/common/pojo/res/FeiePrinterApiRes.java @@ -6,7 +6,6 @@ import lombok.Data; import lombok.NoArgsConstructor; import java.io.Serializable; -import java.util.List; /** * 飞鹅云打印机接口响应结果 @@ -35,7 +34,7 @@ public class FeiePrinterApiRes implements Serializable { return this; } -// @Data + // @Data // @NoArgsConstructor // @AllArgsConstructor public class FeiePrinterApiData implements Serializable { diff --git a/mall-common/src/main/java/com/suisung/mall/common/pojo/res/SFExpressApiRes.java b/mall-common/src/main/java/com/suisung/mall/common/pojo/res/SFExpressApiRes.java index 409b58f8..3448ea23 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/pojo/res/SFExpressApiRes.java +++ b/mall-common/src/main/java/com/suisung/mall/common/pojo/res/SFExpressApiRes.java @@ -25,15 +25,14 @@ import java.io.Serializable; @JsonInclude(JsonInclude.Include.NON_NULL) public class SFExpressApiRes implements Serializable { private static final long serialVersionUID = 1L; - @ApiModelProperty(value = "错误码") private Integer error_code; @ApiModelProperty(value = "错误信息") private String error_msg; - @ApiModelProperty(value = "错误数据") - public Object error_data; @ApiModelProperty(value = "响应结果") private Object result; + @ApiModelProperty(value = "错误数据") + public Object error_data; public SFExpressApiRes fail(Integer errorCode, String errorMsg) { return new SFExpressApiRes(errorCode, errorMsg, null, null); diff --git a/mall-common/src/main/java/com/suisung/mall/common/pojo/res/SFExpressFeedRes.java b/mall-common/src/main/java/com/suisung/mall/common/pojo/res/SFExpressFeedRes.java index 4d839f59..86d9337d 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/pojo/res/SFExpressFeedRes.java +++ b/mall-common/src/main/java/com/suisung/mall/common/pojo/res/SFExpressFeedRes.java @@ -26,13 +26,12 @@ import java.util.Date; @JsonInclude(JsonInclude.Include.NON_NULL) public class SFExpressFeedRes implements Serializable { private static final long serialVersionUID = 1L; - + @ApiModelProperty(value = "顺丰订单状态") + public Integer order_status; @ApiModelProperty(value = "顺丰订单号") private String sf_order_id; @ApiModelProperty(value = "商家订单号") private String shop_order_id; - @ApiModelProperty(value = "顺丰订单状态") - public Integer order_status; @ApiModelProperty(value = "操作记录日志") private String operator; @ApiModelProperty(value = "操作员") diff --git a/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStoreOrderProductPrintVO.java b/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStoreOrderProductPrintVO.java index 691c1337..3bce33ac 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStoreOrderProductPrintVO.java +++ b/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStoreOrderProductPrintVO.java @@ -24,12 +24,34 @@ import java.util.List; @ApiModel(value = "订单商品打印对象", description = "订单商品打印对象") public class ShopStoreOrderProductPrintVO implements Serializable { private static final long serialVersionUID = 1L; + @ApiModelProperty(value = "商品名") + private String item_name; + @ApiModelProperty(value = "数量") + private Integer order_item_quantity; + @ApiModelProperty(value = "金额") + private BigDecimal order_item_amount; + @ApiModelProperty(value = "显示的商品名") + private String s_name; + @ApiModelProperty(value = "显示的数量") + private String s_quantity; + @ApiModelProperty(value = "显示的金额") + private String s_amount; + @ApiModelProperty(value = "显示的商品条码") + private String product_sn; + @ApiModelProperty(value = "商品名称分段") + private List s_name_segs; + @ApiModelProperty(value = "标题额定字节长度") + private Integer title_blen; + @ApiModelProperty(value = "数量额定字节长度") + private Integer quantity_blen; + @ApiModelProperty(value = "金额额定字节长度") + private Integer amount_blen; - public ShopStoreOrderProductPrintVO(String itemName, Integer orderItemQuantity,BigDecimal orderItemAmount,String productSn) { - new ShopStoreOrderProductPrintVO(itemName,orderItemQuantity,orderItemAmount,productSn,18,6,8); + public ShopStoreOrderProductPrintVO(String itemName, Integer orderItemQuantity, BigDecimal orderItemAmount, String productSn) { + new ShopStoreOrderProductPrintVO(itemName, orderItemQuantity, orderItemAmount, productSn, 18, 6, 8); } - public ShopStoreOrderProductPrintVO(String itemName, Integer orderItemQuantity,BigDecimal orderItemAmount,String productSn,int titleBlen,int quantityBlen,int amountBlen) { + public ShopStoreOrderProductPrintVO(String itemName, Integer orderItemQuantity, BigDecimal orderItemAmount, String productSn, int titleBlen, int quantityBlen, int amountBlen) { this.item_name = itemName; this.order_item_quantity = orderItemQuantity; this.order_item_amount = orderItemAmount; @@ -65,46 +87,13 @@ public class ShopStoreOrderProductPrintVO implements Serializable { /** * 重构实体类,处理标题,数量,价格适应长度 + * * @return */ - public ShopStoreOrderProductPrintVO rebuild(){ - return new ShopStoreOrderProductPrintVO(this.item_name,this.order_item_quantity,this.order_item_amount,this.product_sn,18,6,8); + public ShopStoreOrderProductPrintVO rebuild() { + return new ShopStoreOrderProductPrintVO(this.item_name, this.order_item_quantity, this.order_item_amount, this.product_sn, 18, 6, 8); } - @ApiModelProperty(value = "商品名") - private String item_name; - - @ApiModelProperty(value = "数量") - private Integer order_item_quantity; - - @ApiModelProperty(value = "金额") - private BigDecimal order_item_amount; - - @ApiModelProperty(value = "显示的商品名") - private String s_name; - - @ApiModelProperty(value = "显示的数量") - private String s_quantity; - - @ApiModelProperty(value = "显示的金额") - private String s_amount; - - @ApiModelProperty(value = "显示的商品条码") - private String product_sn; - - @ApiModelProperty(value = "商品名称分段") - private List s_name_segs; - - @ApiModelProperty(value = "标题额定字节长度") - private Integer title_blen; - - @ApiModelProperty(value = "数量额定字节长度") - private Integer quantity_blen; - - @ApiModelProperty(value = "金额额定字节长度") - private Integer amount_blen; - - /** * 判断字符串是否包含英文? * @@ -236,7 +225,7 @@ public class ShopStoreOrderProductPrintVO implements Serializable { } int cz = size - len; - return StrUtil.repeat(" ",cz) + str; + return StrUtil.repeat(" ", cz) + str; } } \ No newline at end of file diff --git a/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStorePrinterVO.java b/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStorePrinterVO.java index 55e2dd31..01cffaa6 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStorePrinterVO.java +++ b/mall-common/src/main/java/com/suisung/mall/common/pojo/vo/ShopStorePrinterVO.java @@ -1,9 +1,5 @@ package com.suisung.mall.common.pojo.vo; -import com.baomidou.mybatisplus.annotation.IdType; -import com.baomidou.mybatisplus.annotation.TableField; -import com.baomidou.mybatisplus.annotation.TableId; -import com.baomidou.mybatisplus.annotation.TableName; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; import lombok.AllArgsConstructor; diff --git a/mall-common/src/main/java/com/suisung/mall/common/service/impl/BaseControllerImpl.java b/mall-common/src/main/java/com/suisung/mall/common/service/impl/BaseControllerImpl.java index 60f86d0e..7555d048 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/service/impl/BaseControllerImpl.java +++ b/mall-common/src/main/java/com/suisung/mall/common/service/impl/BaseControllerImpl.java @@ -83,7 +83,7 @@ public class BaseControllerImpl extends BaseController implements IBaseControlle } return Convert.convert((Class) defaultValue.getClass(), value); } - + /** * 请求参数的空字符串转为null */ diff --git a/mall-common/src/main/java/com/suisung/mall/common/service/impl/MessageServiceImpl.java b/mall-common/src/main/java/com/suisung/mall/common/service/impl/MessageServiceImpl.java index c4d1e4f0..5635bab2 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/service/impl/MessageServiceImpl.java +++ b/mall-common/src/main/java/com/suisung/mall/common/service/impl/MessageServiceImpl.java @@ -14,12 +14,10 @@ import java.util.Map; @Service public class MessageServiceImpl implements MessageService { + private static final String kerPre = "_msg_|"; @Autowired private RedisService redisService; - private static final String kerPre = "_msg_|"; - - /** * @param k 队列原始值 * @access public diff --git a/mall-common/src/main/java/com/suisung/mall/common/service/impl/TencentServiceImpl.java b/mall-common/src/main/java/com/suisung/mall/common/service/impl/TencentServiceImpl.java index b6b678eb..d09ccdd5 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/service/impl/TencentServiceImpl.java +++ b/mall-common/src/main/java/com/suisung/mall/common/service/impl/TencentServiceImpl.java @@ -22,7 +22,7 @@ public class TencentServiceImpl implements ThirdService { @Override public void send(SmsDto smsDto) { // 短信应用SDK AppID 1400开头 - Integer tengxunAppId =smsDto.getTengxunAppId(); + Integer tengxunAppId = smsDto.getTengxunAppId(); // 短信应用SDK AppKey String tengxunAppkey = smsDto.getTengxunAppkey(); // 短信模板ID,需要在短信应用中申请 diff --git a/mall-common/src/main/java/com/suisung/mall/common/support/AuthInterceptor.java b/mall-common/src/main/java/com/suisung/mall/common/support/AuthInterceptor.java index 29e6bd24..6db888f7 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/support/AuthInterceptor.java +++ b/mall-common/src/main/java/com/suisung/mall/common/support/AuthInterceptor.java @@ -18,6 +18,32 @@ import org.springframework.web.method.support.ModelAndViewContainer; public class AuthInterceptor implements HandlerMethodArgumentResolver, ApplicationContextAware { private static ApplicationContext applicationContext; + public static ApplicationContext getApplicationContext() { + return applicationContext; + } + + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + if (AuthInterceptor.applicationContext == null) { + AuthInterceptor.applicationContext = applicationContext; + } + } + + //通过name获取 Bean. + public static Object getBean(String name) { + return getApplicationContext().getBean(name); + } + + //通过class获取Bean. + public static T getBean(Class clazz) { + return getApplicationContext().getBean(clazz); + } + + //通过name,以及Clazz返回指定的Bean + public static T getBean(String name, Class clazz) { + return getApplicationContext().getBean(name, clazz); + } + @Override public boolean supportsParameter(MethodParameter parameter) { if (parameter.hasParameterAnnotation(Auth.class)) { @@ -60,30 +86,4 @@ public class AuthInterceptor implements HandlerMethodArgumentResolver, Applicati return user; } - @Override - public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { - if (AuthInterceptor.applicationContext == null) { - AuthInterceptor.applicationContext = applicationContext; - } - } - - public static ApplicationContext getApplicationContext() { - return applicationContext; - } - - //通过name获取 Bean. - public static Object getBean(String name) { - return getApplicationContext().getBean(name); - } - - //通过class获取Bean. - public static T getBean(Class clazz) { - return getApplicationContext().getBean(clazz); - } - - //通过name,以及Clazz返回指定的Bean - public static T getBean(String name, Class clazz) { - return getApplicationContext().getBean(name, clazz); - } - } diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/AesEncryptUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/AesEncryptUtil.java index c316f80b..3b9fa215 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/AesEncryptUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/AesEncryptUtil.java @@ -14,6 +14,7 @@ public class AesEncryptUtil { private static final String KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2"; //参数分别代表 算法名称/加密模式/数据填充方式 private static final String ALGORITHMSTR = "AES/ECB/PKCS5Padding"; + /* 加密 * @param content 加密的字符串 * @param encryptKey key值*/ @@ -26,6 +27,7 @@ public class AesEncryptUtil { // 采用base64算法进行转码,避免出现中文乱码 return Base64.encodeBase64String(b); } + /* 解密 * @param encryptStr 解密的字符串 * @param decryptKey 解密的key值*/ @@ -43,6 +45,7 @@ public class AesEncryptUtil { public static String encrypt(String content) throws Exception { return encrypt(content, KEY); } + public static String decrypt(String encryptStr) throws Exception { return decrypt(encryptStr, KEY); } diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/CSVUtils.java b/mall-common/src/main/java/com/suisung/mall/common/utils/CSVUtils.java index aff5b6c2..bba208c5 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/CSVUtils.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/CSVUtils.java @@ -22,11 +22,11 @@ import java.util.List; **/ public class CSVUtils { - private static Logger logger = LoggerFactory.getLogger(CSVUtils.class); //行尾分隔符定义 private final static String NEW_LINE_SEPARATOR = "\n"; //上传文件的存储位置 private final static String PATH = new ApplicationHome().getDir().getPath() + "/"; + private static Logger logger = LoggerFactory.getLogger(CSVUtils.class); /** * @return File @@ -143,7 +143,7 @@ public class CSVUtils { } /** - * @return List> + * @return List> * @Description 读取CSV文件的内容(不含表头) * @Param filePath 文件存储路径,colNum 列数 **/ diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/CheckUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/CheckUtil.java index 0f4941fc..89e6b557 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/CheckUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/CheckUtil.java @@ -278,7 +278,7 @@ public class CheckUtil { } } - public static boolean hasField(Class c, String fieldName){ + public static boolean hasField(Class c, String fieldName) { Field[] fields = c.getDeclaredFields(); for (Field f : fields) { if (fieldName.equals(f.getName())) { diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/CommonUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/CommonUtil.java index e5b1f8dd..12d48927 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/CommonUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/CommonUtil.java @@ -133,6 +133,7 @@ public class CommonUtil { /** * Double 四舍五入,不保留小数点 + * * @param d * @return */ @@ -142,6 +143,7 @@ public class CommonUtil { /** * Decimal 四舍五入,不保留小数点 + * * @param d * @return */ @@ -152,6 +154,7 @@ public class CommonUtil { /** * 根据上一个订单状态和当前状态,获取订单状态变化备注 + * * @param order_state_pre_id * @param order_state_id * @return diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/CompressionUtils.java b/mall-common/src/main/java/com/suisung/mall/common/utils/CompressionUtils.java index b5f047c2..ee7a3b22 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/CompressionUtils.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/CompressionUtils.java @@ -14,6 +14,7 @@ public class CompressionUtils { /** * 压缩 + * * @param data * @return */ @@ -32,6 +33,7 @@ public class CompressionUtils { /** * 解压缩 + * * @param compressedData * @return */ diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/ContextUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/ContextUtil.java index c29c74e0..550c4560 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/ContextUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/ContextUtil.java @@ -12,16 +12,10 @@ import javax.annotation.PostConstruct; @Component @Slf4j public class ContextUtil { + private static UserInfoService staticUserInfoService; @Autowired private UserInfoService userInfoService; - private static UserInfoService staticUserInfoService; - - @PostConstruct - public void init() { - ContextUtil.staticUserInfoService = userInfoService; - } - /** * 获取当前登录用户 * @@ -37,7 +31,6 @@ public class ContextUtil { return null; } - /** * 获取当前登录用户 * @@ -77,4 +70,9 @@ public class ContextUtil { return loginUser.getId(); } + + @PostConstruct + public void init() { + ContextUtil.staticUserInfoService = userInfoService; + } } diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/CookieUtils.java b/mall-common/src/main/java/com/suisung/mall/common/utils/CookieUtils.java index 45f7179f..adc9fe5f 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/CookieUtils.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/CookieUtils.java @@ -23,24 +23,13 @@ public class CookieUtils { private static HttpServletResponse response; - + private static HttpServletRequest request; + private static Logger logger = LoggerFactory.getLogger(CookieUtils.class); @Autowired private HttpServletResponse response2; - - private static HttpServletRequest request; - @Autowired private HttpServletRequest request2; - private static Logger logger = LoggerFactory.getLogger(CookieUtils.class); - - @PostConstruct - public void beforeInit() { - request = request2; - response = response2; - } - - /** * 根据Cookie名称得到Cookie对象,不存在该对象则返回Null * @@ -151,14 +140,7 @@ public class CookieUtils { } return cookieMap; } - /** - * - * 功能描述: - * @param: IM新增cookie操作方法 - * @return: - * @auther: 陈旺 - * @date: 2022/4/24 9:51 - */ + /** * 设置 Cookie(生成时间为1天) * @@ -168,6 +150,14 @@ public class CookieUtils { public static void setCookieIm(String name, String value) { setCookieIm(name, value, COOKIE_ONE_DAY); } + /** + * + * 功能描述: + * @param: IM新增cookie操作方法 + * @return: + * @auther: 陈旺 + * @date: 2022/4/24 9:51 + */ /** * IM新增设置 Cookie @@ -198,4 +188,10 @@ public class CookieUtils { } response.addCookie(cookie); } + + @PostConstruct + public void beforeInit() { + request = request2; + response = response2; + } } \ No newline at end of file diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/ExecutorUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/ExecutorUtil.java index 1c57ab8b..41a7d90e 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/ExecutorUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/ExecutorUtil.java @@ -14,20 +14,46 @@ import java.util.stream.Collectors; /** * 多线程方法调用工具类 * Author: Lwg + * * @desc: 不建议使用这个工具类,一般情况下性能优化不应该涉及到这里,如果有特俗场景遇到性能问题,例如sql in,或接口传输,网关传输数据等需要执行大量数据请求时,可将数据拆分处理 */ public class ExecutorUtil { + /** + * 拆分数据到指定大小的集合中 + * + * @param parentList 数据集合 + * @param splitSize 拆分集合大小 + * @return + */ + private static List> splitList(List parentList, int splitSize) { + List> dividedList = new ArrayList<>(); + + int batchSize = parentList.size() / splitSize; + int remainder = parentList.size() % splitSize; + + int index = 0; + for (int i = 0; i < splitSize; i++) { + int size = batchSize + (i < remainder ? 1 : 0); + List sublist = parentList.subList(index, index + size); + dividedList.add(sublist); + index += size; + } + + return dividedList; + } + /** * 本方法为财务获取报表数据使用 * for东华项目,后续其他业务可做小量改造使用 * 多线程查询:当集合数据过大对集合进行执行数量拆分并使用多线程批量执行,执行完成后将结果返回 + * * @param parentList 数据集合 - * @param splitSize 拆分集合大小 - * @param applyFun 执行函数 - * @param executor 线程池对象 - * @return + * @param splitSize 拆分集合大小 + * @param applyFun 执行函数 + * @param executor 线程池对象 * @param + * @return */ @Deprecated public Object getSaleReport(List parentList, int splitSize, Function applyFun, ThreadPoolExecutor executor) { @@ -71,27 +97,4 @@ public class ExecutorUtil { return resultList; } - /** - * 拆分数据到指定大小的集合中 - * @param parentList 数据集合 - * @param splitSize 拆分集合大小 - * @return - */ - private static List> splitList(List parentList, int splitSize) { - List> dividedList = new ArrayList<>(); - - int batchSize = parentList.size() / splitSize; - int remainder = parentList.size() % splitSize; - - int index = 0; - for (int i = 0; i < splitSize; i++) { - int size = batchSize + (i < remainder ? 1 : 0); - List sublist = parentList.subList(index, index + size); - dividedList.add(sublist); - index += size; - } - - return dividedList; - } - } diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/I18nUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/I18nUtil.java index 0499c2a4..112a8c23 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/I18nUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/I18nUtil.java @@ -18,16 +18,10 @@ import java.util.Locale; @Component @Slf4j public class I18nUtil { + private static MessageSource staticMessageSource; @Resource private MessageSource messageSource; - private static MessageSource staticMessageSource; - - @PostConstruct - public void init() { - I18nUtil.staticMessageSource = messageSource; - } - /** * 通过code 返回对应的提示信息 * @@ -77,4 +71,9 @@ public class I18nUtil { return content; } + + @PostConstruct + public void init() { + I18nUtil.staticMessageSource = messageSource; + } } \ No newline at end of file diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/IdUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/IdUtil.java index 80088a21..60adc578 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/IdUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/IdUtil.java @@ -27,34 +27,7 @@ public class IdUtil { private long lastTimestamp = -1L; /** - * 雪花算法生成分布式唯一ID - * @return - */ - public synchronized long generateId() { - long timestamp = System.currentTimeMillis(); - if (timestamp < lastTimestamp) { - throw new ApiException(I18nUtil._("获取系统时间段错误, 当前系统时间:" + timestamp)); - } - - if (timestamp == lastTimestamp) { - sequence = (sequence + 1) & SEQUENCE_MASK; - if (sequence == 0) { - timestamp = tilNextMillis(lastTimestamp); - } - } else { - sequence = 0L; - } - - lastTimestamp = timestamp; - return ((timestamp - EPOCH) << TIMESTAMP_LEFT_SHIFT) | - (dataCenterId << DATA_CENTER_ID_SHIFT) | - (workerId << WORKER_ID_SHIFT) | - sequence; - } - - /** - * - * @param workerId 工作机器ID + * @param workerId 工作机器ID * @param dataCenterId 数据中心ID */ public IdUtil(long workerId, long dataCenterId) { @@ -68,20 +41,6 @@ public class IdUtil { this.dataCenterId = dataCenterId; } - /** - * 等待直到下一个毫秒,以确保在同一毫秒内生成的雪花算法ID不发生冲突。 - * - * @param lastTimestamp 上一个生成ID的时间戳 - * @return 下一个合适的时间戳 - */ - private long tilNextMillis(long lastTimestamp) { - long timestamp = System.currentTimeMillis(); - while (timestamp <= lastTimestamp) { - timestamp = System.currentTimeMillis(); - } - return timestamp; - } - /** * 自定义生成n位uuid * @@ -116,4 +75,45 @@ public class IdUtil { return null; } + /** + * 雪花算法生成分布式唯一ID + * + * @return + */ + public synchronized long generateId() { + long timestamp = System.currentTimeMillis(); + if (timestamp < lastTimestamp) { + throw new ApiException(I18nUtil._("获取系统时间段错误, 当前系统时间:" + timestamp)); + } + + if (timestamp == lastTimestamp) { + sequence = (sequence + 1) & SEQUENCE_MASK; + if (sequence == 0) { + timestamp = tilNextMillis(lastTimestamp); + } + } else { + sequence = 0L; + } + + lastTimestamp = timestamp; + return ((timestamp - EPOCH) << TIMESTAMP_LEFT_SHIFT) | + (dataCenterId << DATA_CENTER_ID_SHIFT) | + (workerId << WORKER_ID_SHIFT) | + sequence; + } + + /** + * 等待直到下一个毫秒,以确保在同一毫秒内生成的雪花算法ID不发生冲突。 + * + * @param lastTimestamp 上一个生成ID的时间戳 + * @return 下一个合适的时间戳 + */ + private long tilNextMillis(long lastTimestamp) { + long timestamp = System.currentTimeMillis(); + while (timestamp <= lastTimestamp) { + timestamp = System.currentTimeMillis(); + } + return timestamp; + } + } diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/JChardetFacadeUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/JChardetFacadeUtil.java index 0dd5fe2c..c956cb0a 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/JChardetFacadeUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/JChardetFacadeUtil.java @@ -23,6 +23,35 @@ public class JChardetFacadeUtil { return null; } + /** + * + */ + interface ICodepageDetector extends Serializable, Comparable { + Reader open(URL var1) throws IOException; + + Charset detectCodepage(URL var1) throws IOException; + + Charset detectCodepage(InputStream var1, int var2) throws IOException; + } + + /** + * + */ + public interface nsICharsetDetectionObserver { + void Notify(String var1); + } + + /** + * + */ + public interface nsICharsetDetector { + void Init(nsICharsetDetectionObserver var1); + + boolean DoIt(byte[] var1, int var2, boolean var3); + + void Done(); + } + /** * 下面代码来自: https://github.com/r91987/cpdetector */ @@ -146,17 +175,6 @@ public class JChardetFacadeUtil { } } - /** - * - */ - interface ICodepageDetector extends Serializable, Comparable { - Reader open(URL var1) throws IOException; - - Charset detectCodepage(URL var1) throws IOException; - - Charset detectCodepage(InputStream var1, int var2) throws IOException; - } - /** * 以下代码开始是由Mozilla组织提供的JChardet, 它可以检测大多数文件的编码 * http://jchardet.sourceforge.net/ @@ -433,24 +451,6 @@ public class JChardetFacadeUtil { } } - /** - * - */ - public interface nsICharsetDetectionObserver { - void Notify(String var1); - } - - /** - * - */ - public interface nsICharsetDetector { - void Init(nsICharsetDetectionObserver var1); - - boolean DoIt(byte[] var1, int var2, boolean var3); - - void Done(); - } - /** * */ @@ -466,6 +466,10 @@ public class JChardetFacadeUtil { nsVerifier() { } + public static byte getNextState(nsVerifier var0, byte var1, byte var2) { + return (byte) (255 & var0.states()[(var2 * var0.stFactor() + (var0.cclass()[(var1 & 255) >> 3] >> ((var1 & 7) << 2) & 15) & 255) >> 3] >> ((var2 * var0.stFactor() + (var0.cclass()[(var1 & 255) >> 3] >> ((var1 & 7) << 2) & 15) & 255 & 7) << 2) & 15); + } + public abstract String charset(); public abstract int stFactor(); @@ -475,23 +479,19 @@ public class JChardetFacadeUtil { public abstract int[] states(); public abstract boolean isUCS2(); - - public static byte getNextState(nsVerifier var0, byte var1, byte var2) { - return (byte) (255 & var0.states()[(var2 * var0.stFactor() + (var0.cclass()[(var1 & 255) >> 3] >> ((var1 & 7) << 2) & 15) & 255) >> 3] >> ((var2 * var0.stFactor() + (var0.cclass()[(var1 & 255) >> 3] >> ((var1 & 7) << 2) & 15) & 255 & 7) << 2) & 15); - } } /** * */ public static class nsEUCSampler { - int mTotal = 0; - int mThreshold = 200; - int mState = 0; public int[] mFirstByteCnt = new int[94]; public int[] mSecondByteCnt = new int[94]; public float[] mFirstByteFreq = new float[94]; public float[] mSecondByteFreq = new float[94]; + int mTotal = 0; + int mThreshold = 200; + int mState = 0; public nsEUCSampler() { this.Reset(); @@ -588,6 +588,9 @@ public class JChardetFacadeUtil { * */ public static abstract class nsEUCStatistics { + public nsEUCStatistics() { + } + public abstract float[] mFirstByteFreq(); public abstract float mFirstByteStdDev(); @@ -603,9 +606,6 @@ public class JChardetFacadeUtil { public abstract float mSecondByteMean(); public abstract float mSecondByteWeight(); - - public nsEUCStatistics() { - } } /** @@ -621,6 +621,17 @@ public class JChardetFacadeUtil { static float mSecondByteMean; static float mSecondByteWeight; + public EUCJPStatistics() { + mFirstByteFreq = new float[]{0.364808F, 0.0F, 0.0F, 0.145325F, 0.304891F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.001835F, 0.010771F, 0.006462F, 0.001157F, 0.002114F, 0.003231F, 0.001356F, 0.00742F, 0.004189F, 0.003231F, 0.003032F, 0.03319F, 0.006303F, 0.006064F, 0.009973F, 0.002354F, 0.00367F, 0.009135F, 0.001675F, 0.002792F, 0.002194F, 0.01472F, 0.011928F, 8.78E-4F, 0.013124F, 0.001077F, 0.009295F, 0.003471F, 0.002872F, 0.002433F, 9.57E-4F, 0.001636F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0E-5F, 2.79E-4F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0E-5F, 0.0F}; + mFirstByteStdDev = 0.050407F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.640871F; + mSecondByteFreq = new float[]{0.002473F, 0.039134F, 0.152745F, 0.009694F, 3.59E-4F, 0.02218F, 7.58E-4F, 0.004308F, 1.6E-4F, 0.002513F, 0.003072F, 0.001316F, 0.00383F, 0.001037F, 0.00359F, 9.57E-4F, 1.6E-4F, 2.39E-4F, 0.006462F, 0.001596F, 0.031554F, 0.001316F, 0.002194F, 0.016555F, 0.003271F, 6.78E-4F, 5.98E-4F, 0.206438F, 7.18E-4F, 0.001077F, 0.00371F, 0.001356F, 0.001356F, 4.39E-4F, 0.004388F, 0.005704F, 8.78E-4F, 0.010172F, 0.007061F, 0.01468F, 6.38E-4F, 0.02573F, 0.002792F, 7.18E-4F, 0.001795F, 0.091551F, 7.58E-4F, 0.003909F, 5.58E-4F, 0.031195F, 0.007061F, 0.001316F, 0.022579F, 0.006981F, 0.00726F, 0.001117F, 2.39E-4F, 0.012127F, 8.78E-4F, 0.00379F, 0.001077F, 7.58E-4F, 0.002114F, 0.002234F, 6.78E-4F, 0.002992F, 0.003311F, 0.023416F, 0.001237F, 0.002753F, 0.005146F, 0.002194F, 0.007021F, 0.008497F, 0.013763F, 0.011768F, 0.006303F, 0.001915F, 6.38E-4F, 0.008776F, 9.18E-4F, 0.003431F, 0.057603F, 4.39E-4F, 4.39E-4F, 7.58E-4F, 0.002872F, 0.001675F, 0.01105F, 0.0F, 2.79E-4F, 0.012127F, 7.18E-4F, 0.00738F}; + mSecondByteStdDev = 0.028247F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.359129F; + } + public float[] mFirstByteFreq() { return mFirstByteFreq; } @@ -652,17 +663,6 @@ public class JChardetFacadeUtil { public float mSecondByteWeight() { return mSecondByteWeight; } - - public EUCJPStatistics() { - mFirstByteFreq = new float[]{0.364808F, 0.0F, 0.0F, 0.145325F, 0.304891F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.001835F, 0.010771F, 0.006462F, 0.001157F, 0.002114F, 0.003231F, 0.001356F, 0.00742F, 0.004189F, 0.003231F, 0.003032F, 0.03319F, 0.006303F, 0.006064F, 0.009973F, 0.002354F, 0.00367F, 0.009135F, 0.001675F, 0.002792F, 0.002194F, 0.01472F, 0.011928F, 8.78E-4F, 0.013124F, 0.001077F, 0.009295F, 0.003471F, 0.002872F, 0.002433F, 9.57E-4F, 0.001636F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0E-5F, 2.79E-4F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 8.0E-5F, 0.0F}; - mFirstByteStdDev = 0.050407F; - mFirstByteMean = 0.010638F; - mFirstByteWeight = 0.640871F; - mSecondByteFreq = new float[]{0.002473F, 0.039134F, 0.152745F, 0.009694F, 3.59E-4F, 0.02218F, 7.58E-4F, 0.004308F, 1.6E-4F, 0.002513F, 0.003072F, 0.001316F, 0.00383F, 0.001037F, 0.00359F, 9.57E-4F, 1.6E-4F, 2.39E-4F, 0.006462F, 0.001596F, 0.031554F, 0.001316F, 0.002194F, 0.016555F, 0.003271F, 6.78E-4F, 5.98E-4F, 0.206438F, 7.18E-4F, 0.001077F, 0.00371F, 0.001356F, 0.001356F, 4.39E-4F, 0.004388F, 0.005704F, 8.78E-4F, 0.010172F, 0.007061F, 0.01468F, 6.38E-4F, 0.02573F, 0.002792F, 7.18E-4F, 0.001795F, 0.091551F, 7.58E-4F, 0.003909F, 5.58E-4F, 0.031195F, 0.007061F, 0.001316F, 0.022579F, 0.006981F, 0.00726F, 0.001117F, 2.39E-4F, 0.012127F, 8.78E-4F, 0.00379F, 0.001077F, 7.58E-4F, 0.002114F, 0.002234F, 6.78E-4F, 0.002992F, 0.003311F, 0.023416F, 0.001237F, 0.002753F, 0.005146F, 0.002194F, 0.007021F, 0.008497F, 0.013763F, 0.011768F, 0.006303F, 0.001915F, 6.38E-4F, 0.008776F, 9.18E-4F, 0.003431F, 0.057603F, 4.39E-4F, 4.39E-4F, 7.58E-4F, 0.002872F, 0.001675F, 0.01105F, 0.0F, 2.79E-4F, 0.012127F, 7.18E-4F, 0.00738F}; - mSecondByteStdDev = 0.028247F; - mSecondByteMean = 0.010638F; - mSecondByteWeight = 0.359129F; - } } /** @@ -674,22 +674,6 @@ public class JChardetFacadeUtil { static int stFactor; static String charset; - public int[] cclass() { - return cclass; - } - - public int[] states() { - return states; - } - - public int stFactor() { - return stFactor; - } - - public String charset() { - return charset; - } - public nsEUCJPVerifier() { cclass = new int[32]; cclass[0] = 1145324612; @@ -734,6 +718,22 @@ public class JChardetFacadeUtil { stFactor = 6; } + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + public boolean isUCS2() { return false; } @@ -752,6 +752,17 @@ public class JChardetFacadeUtil { static float mSecondByteMean; static float mSecondByteWeight; + public EUCKRStatistics() { + mFirstByteFreq = new float[]{0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 4.12E-4F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.057502F, 0.033182F, 0.002267F, 0.016076F, 0.014633F, 0.032976F, 0.004122F, 0.011336F, 0.058533F, 0.024526F, 0.025969F, 0.054411F, 0.01958F, 0.063273F, 0.113974F, 0.029885F, 0.150041F, 0.059151F, 0.002679F, 0.009893F, 0.014839F, 0.026381F, 0.015045F, 0.069456F, 0.08986F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; + mFirstByteStdDev = 0.025593F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.647437F; + mSecondByteFreq = new float[]{0.016694F, 0.0F, 0.012778F, 0.030091F, 0.002679F, 0.006595F, 0.001855F, 8.24E-4F, 0.005977F, 0.00474F, 0.003092F, 8.24E-4F, 0.01958F, 0.037304F, 0.008244F, 0.014633F, 0.001031F, 0.0F, 0.003298F, 0.002061F, 0.006183F, 0.005977F, 8.24E-4F, 0.021847F, 0.014839F, 0.052968F, 0.017312F, 0.007626F, 4.12E-4F, 8.24E-4F, 0.011129F, 0.0F, 4.12E-4F, 0.001649F, 0.005977F, 0.065746F, 0.020198F, 0.021434F, 0.014633F, 0.004122F, 0.001649F, 8.24E-4F, 8.24E-4F, 0.051937F, 0.01958F, 0.023289F, 0.026381F, 0.040396F, 0.009068F, 0.001443F, 0.00371F, 0.00742F, 0.001443F, 0.01319F, 0.002885F, 4.12E-4F, 0.003298F, 0.025969F, 4.12E-4F, 4.12E-4F, 0.006183F, 0.003298F, 0.066983F, 0.002679F, 0.002267F, 0.011129F, 4.12E-4F, 0.010099F, 0.015251F, 0.007626F, 0.043899F, 0.00371F, 0.002679F, 0.001443F, 0.010923F, 0.002885F, 0.009068F, 0.019992F, 4.12E-4F, 0.00845F, 0.005153F, 0.0F, 0.010099F, 0.0F, 0.001649F, 0.01216F, 0.011542F, 0.006595F, 0.001855F, 0.010923F, 4.12E-4F, 0.023702F, 0.00371F, 0.001855F}; + mSecondByteStdDev = 0.013937F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.352563F; + } + public float[] mFirstByteFreq() { return mFirstByteFreq; } @@ -783,17 +794,6 @@ public class JChardetFacadeUtil { public float mSecondByteWeight() { return mSecondByteWeight; } - - public EUCKRStatistics() { - mFirstByteFreq = new float[]{0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 4.12E-4F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.057502F, 0.033182F, 0.002267F, 0.016076F, 0.014633F, 0.032976F, 0.004122F, 0.011336F, 0.058533F, 0.024526F, 0.025969F, 0.054411F, 0.01958F, 0.063273F, 0.113974F, 0.029885F, 0.150041F, 0.059151F, 0.002679F, 0.009893F, 0.014839F, 0.026381F, 0.015045F, 0.069456F, 0.08986F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; - mFirstByteStdDev = 0.025593F; - mFirstByteMean = 0.010638F; - mFirstByteWeight = 0.647437F; - mSecondByteFreq = new float[]{0.016694F, 0.0F, 0.012778F, 0.030091F, 0.002679F, 0.006595F, 0.001855F, 8.24E-4F, 0.005977F, 0.00474F, 0.003092F, 8.24E-4F, 0.01958F, 0.037304F, 0.008244F, 0.014633F, 0.001031F, 0.0F, 0.003298F, 0.002061F, 0.006183F, 0.005977F, 8.24E-4F, 0.021847F, 0.014839F, 0.052968F, 0.017312F, 0.007626F, 4.12E-4F, 8.24E-4F, 0.011129F, 0.0F, 4.12E-4F, 0.001649F, 0.005977F, 0.065746F, 0.020198F, 0.021434F, 0.014633F, 0.004122F, 0.001649F, 8.24E-4F, 8.24E-4F, 0.051937F, 0.01958F, 0.023289F, 0.026381F, 0.040396F, 0.009068F, 0.001443F, 0.00371F, 0.00742F, 0.001443F, 0.01319F, 0.002885F, 4.12E-4F, 0.003298F, 0.025969F, 4.12E-4F, 4.12E-4F, 0.006183F, 0.003298F, 0.066983F, 0.002679F, 0.002267F, 0.011129F, 4.12E-4F, 0.010099F, 0.015251F, 0.007626F, 0.043899F, 0.00371F, 0.002679F, 0.001443F, 0.010923F, 0.002885F, 0.009068F, 0.019992F, 4.12E-4F, 0.00845F, 0.005153F, 0.0F, 0.010099F, 0.0F, 0.001649F, 0.01216F, 0.011542F, 0.006595F, 0.001855F, 0.010923F, 4.12E-4F, 0.023702F, 0.00371F, 0.001855F}; - mSecondByteStdDev = 0.013937F; - mSecondByteMean = 0.010638F; - mSecondByteWeight = 0.352563F; - } } /** @@ -805,22 +805,6 @@ public class JChardetFacadeUtil { static int stFactor; static String charset; - public int[] cclass() { - return cclass; - } - - public int[] states() { - return states; - } - - public int stFactor() { - return stFactor; - } - - public String charset() { - return charset; - } - public nsEUCKRVerifier() { cclass = new int[32]; cclass[0] = 286331153; @@ -862,6 +846,22 @@ public class JChardetFacadeUtil { stFactor = 4; } + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + public boolean isUCS2() { return false; } @@ -880,6 +880,17 @@ public class JChardetFacadeUtil { static float mSecondByteMean; static float mSecondByteWeight; + public EUCTWStatistics() { + mFirstByteFreq = new float[]{0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.119286F, 0.052233F, 0.044126F, 0.052494F, 0.045906F, 0.019038F, 0.032465F, 0.026252F, 0.025502F, 0.015963F, 0.052493F, 0.019256F, 0.015137F, 0.031782F, 0.01737F, 0.018494F, 0.015575F, 0.016621F, 0.007444F, 0.011642F, 0.013916F, 0.019159F, 0.016445F, 0.007851F, 0.011079F, 0.022842F, 0.015513F, 0.010033F, 0.00995F, 0.010347F, 0.013103F, 0.015371F, 0.012502F, 0.007436F, 0.018253F, 0.014134F, 0.008907F, 0.005411F, 0.00957F, 0.013598F, 0.006092F, 0.007409F, 0.008432F, 0.005816F, 0.009349F, 0.005472F, 0.00717F, 0.00742F, 0.003681F, 0.007523F, 0.00461F, 0.006154F, 0.003348F, 0.005074F, 0.005922F, 0.005254F, 0.004682F, 0.002093F, 0.0F}; + mFirstByteStdDev = 0.016681F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.715599F; + mSecondByteFreq = new float[]{0.028933F, 0.011371F, 0.011053F, 0.007232F, 0.010192F, 0.004093F, 0.015043F, 0.011752F, 0.022387F, 0.00841F, 0.012448F, 0.007473F, 0.003594F, 0.007139F, 0.018912F, 0.006083F, 0.003302F, 0.010215F, 0.008791F, 0.024236F, 0.014107F, 0.014108F, 0.010303F, 0.009728F, 0.007877F, 0.009719F, 0.007952F, 0.021028F, 0.005764F, 0.009341F, 0.006591F, 0.012517F, 0.005921F, 0.008982F, 0.008771F, 0.012802F, 0.005926F, 0.008342F, 0.003086F, 0.006843F, 0.007576F, 0.004734F, 0.016404F, 0.008803F, 0.008071F, 0.005349F, 0.008566F, 0.01084F, 0.015401F, 0.031904F, 0.00867F, 0.011479F, 0.010936F, 0.007617F, 0.008995F, 0.008114F, 0.008658F, 0.005934F, 0.010452F, 0.009142F, 0.004519F, 0.008339F, 0.007476F, 0.007027F, 0.006025F, 0.021804F, 0.024248F, 0.015895F, 0.003768F, 0.010171F, 0.010007F, 0.010178F, 0.008316F, 0.006832F, 0.006364F, 0.009141F, 0.009148F, 0.012081F, 0.011914F, 0.004464F, 0.014257F, 0.006907F, 0.011292F, 0.018622F, 0.008149F, 0.004636F, 0.006612F, 0.013478F, 0.012614F, 0.005186F, 0.048285F, 0.006816F, 0.006743F, 0.008671F}; + mSecondByteStdDev = 0.00663F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.284401F; + } + public float[] mFirstByteFreq() { return mFirstByteFreq; } @@ -911,17 +922,6 @@ public class JChardetFacadeUtil { public float mSecondByteWeight() { return mSecondByteWeight; } - - public EUCTWStatistics() { - mFirstByteFreq = new float[]{0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.119286F, 0.052233F, 0.044126F, 0.052494F, 0.045906F, 0.019038F, 0.032465F, 0.026252F, 0.025502F, 0.015963F, 0.052493F, 0.019256F, 0.015137F, 0.031782F, 0.01737F, 0.018494F, 0.015575F, 0.016621F, 0.007444F, 0.011642F, 0.013916F, 0.019159F, 0.016445F, 0.007851F, 0.011079F, 0.022842F, 0.015513F, 0.010033F, 0.00995F, 0.010347F, 0.013103F, 0.015371F, 0.012502F, 0.007436F, 0.018253F, 0.014134F, 0.008907F, 0.005411F, 0.00957F, 0.013598F, 0.006092F, 0.007409F, 0.008432F, 0.005816F, 0.009349F, 0.005472F, 0.00717F, 0.00742F, 0.003681F, 0.007523F, 0.00461F, 0.006154F, 0.003348F, 0.005074F, 0.005922F, 0.005254F, 0.004682F, 0.002093F, 0.0F}; - mFirstByteStdDev = 0.016681F; - mFirstByteMean = 0.010638F; - mFirstByteWeight = 0.715599F; - mSecondByteFreq = new float[]{0.028933F, 0.011371F, 0.011053F, 0.007232F, 0.010192F, 0.004093F, 0.015043F, 0.011752F, 0.022387F, 0.00841F, 0.012448F, 0.007473F, 0.003594F, 0.007139F, 0.018912F, 0.006083F, 0.003302F, 0.010215F, 0.008791F, 0.024236F, 0.014107F, 0.014108F, 0.010303F, 0.009728F, 0.007877F, 0.009719F, 0.007952F, 0.021028F, 0.005764F, 0.009341F, 0.006591F, 0.012517F, 0.005921F, 0.008982F, 0.008771F, 0.012802F, 0.005926F, 0.008342F, 0.003086F, 0.006843F, 0.007576F, 0.004734F, 0.016404F, 0.008803F, 0.008071F, 0.005349F, 0.008566F, 0.01084F, 0.015401F, 0.031904F, 0.00867F, 0.011479F, 0.010936F, 0.007617F, 0.008995F, 0.008114F, 0.008658F, 0.005934F, 0.010452F, 0.009142F, 0.004519F, 0.008339F, 0.007476F, 0.007027F, 0.006025F, 0.021804F, 0.024248F, 0.015895F, 0.003768F, 0.010171F, 0.010007F, 0.010178F, 0.008316F, 0.006832F, 0.006364F, 0.009141F, 0.009148F, 0.012081F, 0.011914F, 0.004464F, 0.014257F, 0.006907F, 0.011292F, 0.018622F, 0.008149F, 0.004636F, 0.006612F, 0.013478F, 0.012614F, 0.005186F, 0.048285F, 0.006816F, 0.006743F, 0.008671F}; - mSecondByteStdDev = 0.00663F; - mSecondByteMean = 0.010638F; - mSecondByteWeight = 0.284401F; - } } /** @@ -933,22 +933,6 @@ public class JChardetFacadeUtil { static int stFactor; static String charset; - public int[] cclass() { - return cclass; - } - - public int[] states() { - return states; - } - - public int stFactor() { - return stFactor; - } - - public String charset() { - return charset; - } - public nsEUCTWVerifier() { cclass = new int[32]; cclass[0] = 572662306; @@ -994,6 +978,22 @@ public class JChardetFacadeUtil { stFactor = 7; } + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + public boolean isUCS2() { return false; } @@ -1012,6 +1012,17 @@ public class JChardetFacadeUtil { static float mSecondByteMean; static float mSecondByteWeight; + public Big5Statistics() { + mFirstByteFreq = new float[]{0.0F, 0.0F, 0.0F, 0.114427F, 0.061058F, 0.075598F, 0.048386F, 0.063966F, 0.027094F, 0.095787F, 0.029525F, 0.031331F, 0.036915F, 0.021805F, 0.019349F, 0.037496F, 0.018068F, 0.01276F, 0.030053F, 0.017339F, 0.016731F, 0.019501F, 0.01124F, 0.032973F, 0.016658F, 0.015872F, 0.021458F, 0.012378F, 0.017003F, 0.020802F, 0.012454F, 0.009239F, 0.012829F, 0.007922F, 0.010079F, 0.009815F, 0.010104F, 0.0F, 0.0F, 0.0F, 5.3E-5F, 3.5E-5F, 1.05E-4F, 3.1E-5F, 8.8E-5F, 2.7E-5F, 2.7E-5F, 2.6E-5F, 3.5E-5F, 2.4E-5F, 3.4E-5F, 3.75E-4F, 2.5E-5F, 2.8E-5F, 2.0E-5F, 2.4E-5F, 2.8E-5F, 3.1E-5F, 5.9E-5F, 4.0E-5F, 3.0E-5F, 7.9E-5F, 3.7E-5F, 4.0E-5F, 2.3E-5F, 3.0E-5F, 2.7E-5F, 6.4E-5F, 2.0E-5F, 2.7E-5F, 2.5E-5F, 7.4E-5F, 1.9E-5F, 2.3E-5F, 2.1E-5F, 1.8E-5F, 1.7E-5F, 3.5E-5F, 2.1E-5F, 1.9E-5F, 2.5E-5F, 1.7E-5F, 3.7E-5F, 1.8E-5F, 1.8E-5F, 1.9E-5F, 2.2E-5F, 3.3E-5F, 3.2E-5F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; + mFirstByteStdDev = 0.020606F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.675261F; + mSecondByteFreq = new float[]{0.020256F, 0.003293F, 0.045811F, 0.01665F, 0.007066F, 0.004146F, 0.009229F, 0.007333F, 0.003296F, 0.005239F, 0.008282F, 0.003791F, 0.006116F, 0.003536F, 0.004024F, 0.016654F, 0.009334F, 0.005429F, 0.033392F, 0.006121F, 0.008983F, 0.002801F, 0.004221F, 0.010357F, 0.014695F, 0.077937F, 0.006314F, 0.00402F, 0.007331F, 0.00715F, 0.005341F, 0.009195F, 0.00535F, 0.005698F, 0.004472F, 0.007242F, 0.004039F, 0.011154F, 0.016184F, 0.004741F, 0.012814F, 0.007679F, 0.008045F, 0.016631F, 0.009451F, 0.016487F, 0.007287F, 0.012688F, 0.017421F, 0.013205F, 0.03148F, 0.003404F, 0.009149F, 0.008921F, 0.007514F, 0.008683F, 0.008203F, 0.031403F, 0.011733F, 0.015617F, 0.015306F, 0.004004F, 0.010899F, 0.009961F, 0.008388F, 0.01092F, 0.003925F, 0.008585F, 0.009108F, 0.015546F, 0.004659F, 0.006934F, 0.007023F, 0.020252F, 0.005387F, 0.024704F, 0.006963F, 0.002625F, 0.009512F, 0.002971F, 0.008233F, 0.01F, 0.011973F, 0.010553F, 0.005945F, 0.006349F, 0.009401F, 0.008577F, 0.008186F, 0.008159F, 0.005033F, 0.008714F, 0.010614F, 0.006554F}; + mSecondByteStdDev = 0.009909F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.324739F; + } + public float[] mFirstByteFreq() { return mFirstByteFreq; } @@ -1043,17 +1054,6 @@ public class JChardetFacadeUtil { public float mSecondByteWeight() { return mSecondByteWeight; } - - public Big5Statistics() { - mFirstByteFreq = new float[]{0.0F, 0.0F, 0.0F, 0.114427F, 0.061058F, 0.075598F, 0.048386F, 0.063966F, 0.027094F, 0.095787F, 0.029525F, 0.031331F, 0.036915F, 0.021805F, 0.019349F, 0.037496F, 0.018068F, 0.01276F, 0.030053F, 0.017339F, 0.016731F, 0.019501F, 0.01124F, 0.032973F, 0.016658F, 0.015872F, 0.021458F, 0.012378F, 0.017003F, 0.020802F, 0.012454F, 0.009239F, 0.012829F, 0.007922F, 0.010079F, 0.009815F, 0.010104F, 0.0F, 0.0F, 0.0F, 5.3E-5F, 3.5E-5F, 1.05E-4F, 3.1E-5F, 8.8E-5F, 2.7E-5F, 2.7E-5F, 2.6E-5F, 3.5E-5F, 2.4E-5F, 3.4E-5F, 3.75E-4F, 2.5E-5F, 2.8E-5F, 2.0E-5F, 2.4E-5F, 2.8E-5F, 3.1E-5F, 5.9E-5F, 4.0E-5F, 3.0E-5F, 7.9E-5F, 3.7E-5F, 4.0E-5F, 2.3E-5F, 3.0E-5F, 2.7E-5F, 6.4E-5F, 2.0E-5F, 2.7E-5F, 2.5E-5F, 7.4E-5F, 1.9E-5F, 2.3E-5F, 2.1E-5F, 1.8E-5F, 1.7E-5F, 3.5E-5F, 2.1E-5F, 1.9E-5F, 2.5E-5F, 1.7E-5F, 3.7E-5F, 1.8E-5F, 1.8E-5F, 1.9E-5F, 2.2E-5F, 3.3E-5F, 3.2E-5F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; - mFirstByteStdDev = 0.020606F; - mFirstByteMean = 0.010638F; - mFirstByteWeight = 0.675261F; - mSecondByteFreq = new float[]{0.020256F, 0.003293F, 0.045811F, 0.01665F, 0.007066F, 0.004146F, 0.009229F, 0.007333F, 0.003296F, 0.005239F, 0.008282F, 0.003791F, 0.006116F, 0.003536F, 0.004024F, 0.016654F, 0.009334F, 0.005429F, 0.033392F, 0.006121F, 0.008983F, 0.002801F, 0.004221F, 0.010357F, 0.014695F, 0.077937F, 0.006314F, 0.00402F, 0.007331F, 0.00715F, 0.005341F, 0.009195F, 0.00535F, 0.005698F, 0.004472F, 0.007242F, 0.004039F, 0.011154F, 0.016184F, 0.004741F, 0.012814F, 0.007679F, 0.008045F, 0.016631F, 0.009451F, 0.016487F, 0.007287F, 0.012688F, 0.017421F, 0.013205F, 0.03148F, 0.003404F, 0.009149F, 0.008921F, 0.007514F, 0.008683F, 0.008203F, 0.031403F, 0.011733F, 0.015617F, 0.015306F, 0.004004F, 0.010899F, 0.009961F, 0.008388F, 0.01092F, 0.003925F, 0.008585F, 0.009108F, 0.015546F, 0.004659F, 0.006934F, 0.007023F, 0.020252F, 0.005387F, 0.024704F, 0.006963F, 0.002625F, 0.009512F, 0.002971F, 0.008233F, 0.01F, 0.011973F, 0.010553F, 0.005945F, 0.006349F, 0.009401F, 0.008577F, 0.008186F, 0.008159F, 0.005033F, 0.008714F, 0.010614F, 0.006554F}; - mSecondByteStdDev = 0.009909F; - mSecondByteMean = 0.010638F; - mSecondByteWeight = 0.324739F; - } } /** @@ -1065,22 +1065,6 @@ public class JChardetFacadeUtil { static int stFactor; static String charset; - public int[] cclass() { - return cclass; - } - - public int[] states() { - return states; - } - - public int stFactor() { - return stFactor; - } - - public String charset() { - return charset; - } - public nsBIG5Verifier() { cclass = new int[32]; cclass[0] = 286331153; @@ -1123,6 +1107,22 @@ public class JChardetFacadeUtil { stFactor = 5; } + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + public boolean isUCS2() { return false; } @@ -1141,6 +1141,17 @@ public class JChardetFacadeUtil { static float mSecondByteMean; static float mSecondByteWeight; + public GB2312Statistics() { + mFirstByteFreq = new float[]{0.011628F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.011628F, 0.012403F, 0.009302F, 0.003876F, 0.017829F, 0.037209F, 0.008527F, 0.010078F, 0.01938F, 0.054264F, 0.010078F, 0.041085F, 0.02093F, 0.018605F, 0.010078F, 0.013178F, 0.016279F, 0.006202F, 0.009302F, 0.017054F, 0.011628F, 0.008527F, 0.004651F, 0.006202F, 0.017829F, 0.024806F, 0.020155F, 0.013953F, 0.032558F, 0.035659F, 0.068217F, 0.010853F, 0.036434F, 0.117054F, 0.027907F, 0.100775F, 0.010078F, 0.017829F, 0.062016F, 0.012403F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.00155F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; + mFirstByteStdDev = 0.020081F; + mFirstByteMean = 0.010638F; + mFirstByteWeight = 0.586533F; + mSecondByteFreq = new float[]{0.006202F, 0.031008F, 0.005426F, 0.003101F, 0.00155F, 0.003101F, 0.082171F, 0.014729F, 0.006977F, 0.00155F, 0.013953F, 0.0F, 0.013953F, 0.010078F, 0.008527F, 0.006977F, 0.004651F, 0.003101F, 0.003101F, 0.003101F, 0.008527F, 0.003101F, 0.005426F, 0.005426F, 0.005426F, 0.003101F, 0.00155F, 0.006202F, 0.014729F, 0.010853F, 0.0F, 0.011628F, 0.0F, 0.031783F, 0.013953F, 0.030233F, 0.039535F, 0.008527F, 0.015504F, 0.0F, 0.003101F, 0.008527F, 0.016279F, 0.005426F, 0.00155F, 0.013953F, 0.013953F, 0.044961F, 0.003101F, 0.004651F, 0.006977F, 0.00155F, 0.005426F, 0.012403F, 0.00155F, 0.015504F, 0.0F, 0.006202F, 0.00155F, 0.0F, 0.007752F, 0.006977F, 0.00155F, 0.009302F, 0.011628F, 0.004651F, 0.010853F, 0.012403F, 0.017829F, 0.005426F, 0.024806F, 0.0F, 0.006202F, 0.0F, 0.082171F, 0.015504F, 0.004651F, 0.0F, 0.006977F, 0.004651F, 0.0F, 0.008527F, 0.012403F, 0.004651F, 0.003876F, 0.003101F, 0.022481F, 0.024031F, 0.00155F, 0.047287F, 0.009302F, 0.00155F, 0.005426F, 0.017054F}; + mSecondByteStdDev = 0.014156F; + mSecondByteMean = 0.010638F; + mSecondByteWeight = 0.413467F; + } + public float[] mFirstByteFreq() { return mFirstByteFreq; } @@ -1172,17 +1183,6 @@ public class JChardetFacadeUtil { public float mSecondByteWeight() { return mSecondByteWeight; } - - public GB2312Statistics() { - mFirstByteFreq = new float[]{0.011628F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.011628F, 0.012403F, 0.009302F, 0.003876F, 0.017829F, 0.037209F, 0.008527F, 0.010078F, 0.01938F, 0.054264F, 0.010078F, 0.041085F, 0.02093F, 0.018605F, 0.010078F, 0.013178F, 0.016279F, 0.006202F, 0.009302F, 0.017054F, 0.011628F, 0.008527F, 0.004651F, 0.006202F, 0.017829F, 0.024806F, 0.020155F, 0.013953F, 0.032558F, 0.035659F, 0.068217F, 0.010853F, 0.036434F, 0.117054F, 0.027907F, 0.100775F, 0.010078F, 0.017829F, 0.062016F, 0.012403F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.00155F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F, 0.0F}; - mFirstByteStdDev = 0.020081F; - mFirstByteMean = 0.010638F; - mFirstByteWeight = 0.586533F; - mSecondByteFreq = new float[]{0.006202F, 0.031008F, 0.005426F, 0.003101F, 0.00155F, 0.003101F, 0.082171F, 0.014729F, 0.006977F, 0.00155F, 0.013953F, 0.0F, 0.013953F, 0.010078F, 0.008527F, 0.006977F, 0.004651F, 0.003101F, 0.003101F, 0.003101F, 0.008527F, 0.003101F, 0.005426F, 0.005426F, 0.005426F, 0.003101F, 0.00155F, 0.006202F, 0.014729F, 0.010853F, 0.0F, 0.011628F, 0.0F, 0.031783F, 0.013953F, 0.030233F, 0.039535F, 0.008527F, 0.015504F, 0.0F, 0.003101F, 0.008527F, 0.016279F, 0.005426F, 0.00155F, 0.013953F, 0.013953F, 0.044961F, 0.003101F, 0.004651F, 0.006977F, 0.00155F, 0.005426F, 0.012403F, 0.00155F, 0.015504F, 0.0F, 0.006202F, 0.00155F, 0.0F, 0.007752F, 0.006977F, 0.00155F, 0.009302F, 0.011628F, 0.004651F, 0.010853F, 0.012403F, 0.017829F, 0.005426F, 0.024806F, 0.0F, 0.006202F, 0.0F, 0.082171F, 0.015504F, 0.004651F, 0.0F, 0.006977F, 0.004651F, 0.0F, 0.008527F, 0.012403F, 0.004651F, 0.003876F, 0.003101F, 0.022481F, 0.024031F, 0.00155F, 0.047287F, 0.009302F, 0.00155F, 0.005426F, 0.017054F}; - mSecondByteStdDev = 0.014156F; - mSecondByteMean = 0.010638F; - mSecondByteWeight = 0.413467F; - } } /** @@ -1194,22 +1194,6 @@ public class JChardetFacadeUtil { static int stFactor; static String charset; - public int[] cclass() { - return cclass; - } - - public int[] states() { - return states; - } - - public int stFactor() { - return stFactor; - } - - public String charset() { - return charset; - } - public nsGB2312Verifier() { cclass = new int[32]; cclass[0] = 286331153; @@ -1251,20 +1235,6 @@ public class JChardetFacadeUtil { stFactor = 4; } - public boolean isUCS2() { - return false; - } - } - - /** - * - */ - public static class nsGB18030Verifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1281,6 +1251,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsGB18030Verifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsGB18030Verifier() { cclass = new int[32]; cclass[0] = 286331153; @@ -1326,20 +1310,6 @@ public class JChardetFacadeUtil { stFactor = 7; } - public boolean isUCS2() { - return false; - } - } - - /** - * - */ - public static class nsISO2022CNVerifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1356,6 +1326,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsISO2022CNVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsISO2022CNVerifier() { cclass = new int[32]; cclass[0] = 2; @@ -1403,20 +1387,6 @@ public class JChardetFacadeUtil { stFactor = 9; } - public boolean isUCS2() { - return false; - } - } - - /** - * - */ - public static class nsISO2022JPVerifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1433,6 +1403,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsISO2022JPVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsISO2022JPVerifier() { cclass = new int[32]; cclass[0] = 2; @@ -1478,20 +1462,6 @@ public class JChardetFacadeUtil { stFactor = 8; } - public boolean isUCS2() { - return false; - } - } - - /** - * - */ - public static class nsISO2022KRVerifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1508,6 +1478,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsISO2022KRVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsISO2022KRVerifier() { cclass = new int[32]; cclass[0] = 2; @@ -1552,20 +1536,6 @@ public class JChardetFacadeUtil { stFactor = 6; } - public boolean isUCS2() { - return false; - } - } - - /** - * - */ - public static class nsUCS2BEVerifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1582,6 +1552,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsUCS2BEVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsUCS2BEVerifier() { cclass = new int[32]; cclass[0] = 0; @@ -1628,20 +1612,6 @@ public class JChardetFacadeUtil { stFactor = 6; } - public boolean isUCS2() { - return true; - } - } - - /** - * - */ - public static class nsUCS2LEVerifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1658,6 +1628,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return true; + } + } + + /** + * + */ + public static class nsUCS2LEVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsUCS2LEVerifier() { cclass = new int[32]; cclass[0] = 0; @@ -1704,20 +1688,6 @@ public class JChardetFacadeUtil { stFactor = 6; } - public boolean isUCS2() { - return true; - } - } - - /** - * - */ - public static class nsCP1252Verifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1734,6 +1704,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return true; + } + } + + /** + * + */ + public static class nsCP1252Verifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsCP1252Verifier() { cclass = new int[32]; cclass[0] = 572662305; @@ -1776,20 +1760,6 @@ public class JChardetFacadeUtil { stFactor = 3; } - public boolean isUCS2() { - return false; - } - } - - /** - * - */ - public static class nsHZVerifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1806,6 +1776,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsHZVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsHZVerifier() { cclass = new int[32]; cclass[0] = 1; @@ -1851,20 +1835,6 @@ public class JChardetFacadeUtil { stFactor = 6; } - public boolean isUCS2() { - return false; - } - } - - /** - * - */ - public static class nsSJISVerifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1881,6 +1851,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsSJISVerifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsSJISVerifier() { cclass = new int[32]; cclass[0] = 286331152; @@ -1923,20 +1907,6 @@ public class JChardetFacadeUtil { stFactor = 6; } - public boolean isUCS2() { - return false; - } - } - - /** - * - */ - public static class nsUTF8Verifier extends nsVerifier { - static int[] cclass; - static int[] states; - static int stFactor; - static String charset; - public int[] cclass() { return cclass; } @@ -1953,6 +1923,20 @@ public class JChardetFacadeUtil { return charset; } + public boolean isUCS2() { + return false; + } + } + + /** + * + */ + public static class nsUTF8Verifier extends nsVerifier { + static int[] cclass; + static int[] states; + static int stFactor; + static String charset; + public nsUTF8Verifier() { cclass = new int[32]; cclass[0] = 286331153; @@ -2018,6 +2002,22 @@ public class JChardetFacadeUtil { stFactor = 16; } + public int[] cclass() { + return cclass; + } + + public int[] states() { + return states; + } + + public int stFactor() { + return stFactor; + } + + public String charset() { + return charset; + } + public boolean isUCS2() { return false; } diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/JsonUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/JsonUtil.java index 3fc012b1..350102fc 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/JsonUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/JsonUtil.java @@ -82,21 +82,22 @@ public class JsonUtil { /** * 寻找节点下某特定值并替换 + * + * @return void * @author xuzimu * @date 2022/4/6 - * @return void */ public static void flush(JSONObject jsonObject, String containsValue, StringBuilder sb, List sbList) { for (String key : jsonObject.keySet()) { String value = jsonObject.get(key).toString(); - if(JSONUtil.isJson(value)) { + if (JSONUtil.isJson(value)) { if (JSONUtil.isJsonArray(value)) { continue; } else if (JSONUtil.isJsonObj(value)) { sb.append(".").append(key); - flush(JSONUtil.parseObj(value),containsValue,sb,sbList); + flush(JSONUtil.parseObj(value), containsValue, sb, sbList); } - }else { + } else { if (value.contains(containsValue)) { sb.append(".").append(key); sbList.add(sb.toString()); diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/PositionUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/PositionUtil.java index 252c17c6..97b6d050 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/PositionUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/PositionUtil.java @@ -51,7 +51,7 @@ public class PositionUtil { // BigDecimal times = NumberUtil.div(BigDecimal.valueOf(3.01), 1.0).setScale(0, RoundingMode.UP); // System.out.println(times); - GpsDTO g = bd09ToGcj02( 116.418036,39.922861); + GpsDTO g = bd09ToGcj02(116.418036, 39.922861); System.out.printf("%f,%f", g.getWgLon(), g.getWgLat()); } @@ -286,7 +286,7 @@ public class PositionUtil { /** * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 GCJ-02 坐标转换成 BD-09 坐标 */ - public static GpsDTO gcj02ToBd09(double lng,double lat) { + public static GpsDTO gcj02ToBd09(double lng, double lat) { double x = lng, y = lat; double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * pi); double theta = Math.atan2(y, x) + 0.000003 * Math.cos(x * pi); @@ -298,7 +298,7 @@ public class PositionUtil { /** * 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 BD-09 坐标转换成GCJ-02 坐标 */ - public static GpsDTO bd09ToGcj02(double lng,double lat) { + public static GpsDTO bd09ToGcj02(double lng, double lat) { double x = lng - 0.0065, y = lat - 0.006; double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * pi); double theta = Math.atan2(y, x) - 0.000003 * Math.cos(x * pi); @@ -310,7 +310,7 @@ public class PositionUtil { /** * 地球坐标系 (WGS84) 与火星坐标系 (GCJ-02) 的转换算法 将 WGS84 坐标转换成 GCJ-02 坐标 */ - public static GpsDTO gps84ToGcj02( double lon,double lat) { + public static GpsDTO gps84ToGcj02(double lon, double lat) { if (outOfChina(lat, lon)) { return null; } @@ -330,14 +330,14 @@ public class PositionUtil { /** * 地球坐标系 (WGS84) 与火星坐标系 (GCJ-02) 的转换算法 将 GCJ-02 坐标转换成 WGS84 坐标 */ - public static GpsDTO gcjToGps84(double lng,double lat) { + public static GpsDTO gcjToGps84(double lng, double lat) { GpsDTO gps = transform(lat, lng); double lontitude = lng * 2 - gps.getWgLon(); double latitude = lat * 2 - gps.getWgLat(); return new GpsDTO(latitude, lontitude); } - private static GpsDTO transform(double lng,double lat) { + private static GpsDTO transform(double lng, double lat) { if (outOfChina(lat, lng)) return new GpsDTO(lat, lng); double dLat = transformLat(lng - 105.0, lat - 35.0); double dLon = transformLon(lng - 105.0, lat - 35.0); diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/RegexUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/RegexUtil.java index 6c0db373..330b46f8 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/RegexUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/RegexUtil.java @@ -6,6 +6,7 @@ public class RegexUtil { /** * 判断给定的字符串是否符合时间格式 HH:mm。 + * * @param timeStr 给定的时间字符串,格式为 HH:mm。 * @return 如果给定的字符串符合时间格式,则返回 true;否则返回 false。 */ @@ -16,6 +17,7 @@ public class RegexUtil { /** * 判断给出的时间是否在当前时间范围内 + * * @param start * @param end * @return @@ -27,6 +29,7 @@ public class RegexUtil { /** * 判断给出的时间是否不在当前时间范围内 + * * @param start * @param end * @return diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/StringUtils.java b/mall-common/src/main/java/com/suisung/mall/common/utils/StringUtils.java index 05b6a582..18f9b1f7 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/StringUtils.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/StringUtils.java @@ -1,7 +1,6 @@ package com.suisung.mall.common.utils; import cn.hutool.core.util.StrUtil; -import cn.hutool.json.JSONUtil; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -24,10 +23,6 @@ import java.util.regex.Pattern; */ public final class StringUtils extends org.apache.commons.lang3.StringUtils { - public static void main(String[] args) { - System.out.println(removeProvinceCityDistrict("广西壮族自治区贵港市桂平市西山镇新安街粤桂花城1102号")); - } - /** * 随机字符串 */ @@ -37,6 +32,10 @@ public final class StringUtils extends org.apache.commons.lang3.StringUtils { private static final Random RANDOM = new Random(); private static final Logger logger = LoggerFactory.getLogger(StringUtils.class); + public static void main(String[] args) { + System.out.println(removeProvinceCityDistrict("广西壮族自治区贵港市桂平市西山镇新安街粤桂花城1102号")); + } + public static String encode(String str) { String encode = null; try { @@ -226,6 +225,7 @@ public final class StringUtils extends org.apache.commons.lang3.StringUtils { /** * 全地址去除省市区,保留详细地址 + * * @param fullAddress 比如:广西壮族自治区贵港市桂平市西山镇新安街粤桂花城1102号 -> 西山镇新安街粤桂花城1102号 * @return */ diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/TimeRange.java b/mall-common/src/main/java/com/suisung/mall/common/utils/TimeRange.java index 124f5e21..788da4dd 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/TimeRange.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/TimeRange.java @@ -1,4 +1,3 @@ - package com.suisung.mall.common.utils; import com.fasterxml.jackson.annotation.JsonInclude; diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/UserInfoService.java b/mall-common/src/main/java/com/suisung/mall/common/utils/UserInfoService.java index bb201bb5..95d7d52b 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/UserInfoService.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/UserInfoService.java @@ -75,8 +75,8 @@ public class UserInfoService { if (user == null) { return null; } else { - Integer userId = user.getId() ; - Integer siteId = user.getSite_id() ; + Integer userId = user.getId(); + Integer siteId = user.getSite_id(); Integer storeId = Convert.toInt(user.getStore_id()); Integer chainId = Convert.toInt(user.getChain_id()); diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/VideoUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/VideoUtil.java index b4cd2306..2abd92fc 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/VideoUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/VideoUtil.java @@ -12,8 +12,6 @@ import java.util.concurrent.TimeUnit; public class VideoUtil { - private static Logger logger = LoggerFactory.getLogger(VideoUtil.class); - public static List videoAllowFiles = new ArrayList() {{ add("flv"); add("swf"); @@ -33,6 +31,7 @@ public class VideoUtil { add("wav"); add("mid"); }}; + private static Logger logger = LoggerFactory.getLogger(VideoUtil.class); /** * 得到语音或视频文件时长,单位秒 并格式化 diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/WxHttpUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/WxHttpUtil.java index a9577294..8ef18a8d 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/WxHttpUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/WxHttpUtil.java @@ -22,86 +22,75 @@ import java.util.Map; @Component public class WxHttpUtil implements ApplicationContextAware { - private static ApplicationContext applicationContext; - - private static AccountService accountService; - private static final int MAX_RETRIES = 3; // 最大重试次数 - private static final int RETRY_DELAY_MS = 1000; // 重试延迟毫秒数 + private static ApplicationContext applicationContext; + private static AccountService accountService; /** * 封装统一请求,获取token失败后触发重试机制 + * * @param methodType 请求方式 (ENUM):GET; POST; - * @param wxType 微信类型 (ENUM):MP-公众号; XCX-小程序; - * @param token 微信 AccessToken - * @param url 请求地址 - * @param params 请求参数 接收Map类型 - * @param params 请求参数 接收字符串类型 + * @param wxType 微信类型 (ENUM):MP-公众号; XCX-小程序; + * @param token 微信 AccessToken + * @param url 请求地址 + * @param params 请求参数 接收Map类型 + * @param params 请求参数 接收字符串类型 * @return */ - public static String request(MethodType methodType, WxType wxType, String token, String url, Map params, String paramStr) { - accountService = applicationContext.getBean(AccountService.class); - int retries = 0; - String result = null; - while (retries < MAX_RETRIES) { - try { - if (methodType.equals(MethodType.GET)) { - result = HttpUtil.get(url); - } else if (methodType.equals(MethodType.POST)) { + public static String request(MethodType methodType, WxType wxType, String token, String url, Map params, String paramStr) { + accountService = applicationContext.getBean(AccountService.class); + int retries = 0; + String result = null; + while (retries < MAX_RETRIES) { + try { + if (methodType.equals(MethodType.GET)) { + result = HttpUtil.get(url); + } else if (methodType.equals(MethodType.POST)) { - if (StrUtil.isNotEmpty(paramStr) && CollUtil.isNotEmpty(params)) { - throw new ApiException(I18nUtil._("传递参数有误!")); - } + if (StrUtil.isNotEmpty(paramStr) && CollUtil.isNotEmpty(params)) { + throw new ApiException(I18nUtil._("传递参数有误!")); + } - if (StrUtil.isNotEmpty(paramStr)) { - result = HttpUtil.post(url, paramStr); - } else if (CollUtil.isNotEmpty(params)) { - result = HttpUtil.post(url, params); - } - } - JSONObject jsonObject = JSONUtil.parseObj(result); - Integer errcode = Convert.toInt(jsonObject.get("errcode")); - if (errcode.equals(40001)) { - String tempToken = null; - if (wxType.equals(WxType.MP)) { - tempToken = accountService.getMpAccessToken(false); - } else if (wxType.equals(WxType.XCX)) { - tempToken = accountService.getXcxAccessToken(false); - } - url = url.replace(token, tempToken); - token = tempToken; - retries++; - continue; - } - break; - } catch (Exception e) { - retries++; - if (retries == MAX_RETRIES) { - // 最后一次重试失败则抛出异常 - throw new ApiException(I18nUtil._("已达到最大重试次数!")); - } - try { - Thread.sleep(RETRY_DELAY_MS); - } catch (InterruptedException ex) { - Thread.currentThread().interrupt(); - } - } - } - return result; + if (StrUtil.isNotEmpty(paramStr)) { + result = HttpUtil.post(url, paramStr); + } else if (CollUtil.isNotEmpty(params)) { + result = HttpUtil.post(url, params); + } + } + JSONObject jsonObject = JSONUtil.parseObj(result); + Integer errcode = Convert.toInt(jsonObject.get("errcode")); + if (errcode.equals(40001)) { + String tempToken = null; + if (wxType.equals(WxType.MP)) { + tempToken = accountService.getMpAccessToken(false); + } else if (wxType.equals(WxType.XCX)) { + tempToken = accountService.getXcxAccessToken(false); + } + url = url.replace(token, tempToken); + token = tempToken; + retries++; + continue; + } + break; + } catch (Exception e) { + retries++; + if (retries == MAX_RETRIES) { + // 最后一次重试失败则抛出异常 + throw new ApiException(I18nUtil._("已达到最大重试次数!")); + } + try { + Thread.sleep(RETRY_DELAY_MS); + } catch (InterruptedException ex) { + Thread.currentThread().interrupt(); + } + } + } + return result; } - /** - * 定义请求方式 - */ - public enum MethodType { - GET, - POST, - } - - public enum WxType { - MP, - XCX, + public static ApplicationContext getApplicationContext() { + return applicationContext; } @Override @@ -111,10 +100,6 @@ public class WxHttpUtil implements ApplicationContextAware { } } - public static ApplicationContext getApplicationContext() { - return applicationContext; - } - //通过name获取 Bean. public static Object getBean(String name) { return getApplicationContext().getBean(name); @@ -130,4 +115,17 @@ public class WxHttpUtil implements ApplicationContextAware { return getApplicationContext().getBean(name, clazz); } + /** + * 定义请求方式 + */ + public enum MethodType { + GET, + POST, + } + + public enum WxType { + MP, + XCX, + } + } diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/constbank/MCipherDecode.java b/mall-common/src/main/java/com/suisung/mall/common/utils/constbank/MCipherDecode.java index 286e1056..9618c525 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/constbank/MCipherDecode.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/constbank/MCipherDecode.java @@ -25,14 +25,6 @@ public class MCipherDecode { encryptKey = key.substring(0, 8); } - public String getEncryptKey() { - return encryptKey; - } - - public void setEncryptKey(String encryptKey) { - this.encryptKey = encryptKey.substring(0, 8); - } - private static byte[] getSrcBytes(byte[] srcBytes, byte[] wrapKey) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, ShortBufferException, IllegalBlockSizeException, BadPaddingException, NoSuchProviderException, InvalidAlgorithmParameterException { SecretKeySpec key = new SecretKeySpec(wrapKey, "DES"); @@ -46,7 +38,6 @@ public class MCipherDecode { return cipherText; } - public static byte[] DecodeBase64String(String base64Src) throws IOException { Base64.Decoder de = Base64.getDecoder(); byte[] base64Result = de.decode(base64Src); @@ -54,15 +45,6 @@ public class MCipherDecode { } - public String getDecodeString(String urlString) throws IOException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, ShortBufferException, IllegalBlockSizeException, BadPaddingException, NoSuchProviderException, InvalidAlgorithmParameterException { - String tempString = URLDecoder.decode(urlString, "iso-8859-1"); - String basedString = tempString.replaceAll(",", "+"); - byte[] tempBytes = DecodeBase64String(basedString); - byte[] tempSrcBytes = getSrcBytes(tempBytes, encryptKey.getBytes("iso-8859-1")); - return new String(tempSrcBytes, "iso-8859-1"); - - } - public static void main(String[] agrs) { String key = "f6528d5c335b7092fc9ec1b3020111"; String str = "梅九六|6214662020019275"; @@ -80,5 +62,22 @@ public class MCipherDecode { } + public String getEncryptKey() { + return encryptKey; + } + + public void setEncryptKey(String encryptKey) { + this.encryptKey = encryptKey.substring(0, 8); + } + + public String getDecodeString(String urlString) throws IOException, InvalidKeyException, NoSuchAlgorithmException, NoSuchPaddingException, ShortBufferException, IllegalBlockSizeException, BadPaddingException, NoSuchProviderException, InvalidAlgorithmParameterException { + String tempString = URLDecoder.decode(urlString, "iso-8859-1"); + String basedString = tempString.replaceAll(",", "+"); + byte[] tempBytes = DecodeBase64String(basedString); + byte[] tempSrcBytes = getSrcBytes(tempBytes, encryptKey.getBytes("iso-8859-1")); + return new String(tempSrcBytes, "iso-8859-1"); + + } + } diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/constbank/RSAUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/constbank/RSAUtil.java index ce8d4171..342243af 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/constbank/RSAUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/constbank/RSAUtil.java @@ -88,7 +88,7 @@ public class RSAUtil { * @return 密文 * @throws Exception */ - public static String encrypt(String dataStr, String publicKeyStr){ + public static String encrypt(String dataStr, String publicKeyStr) { ByteArrayOutputStream out = null; String encodedDataStr = null; try { @@ -131,12 +131,12 @@ public class RSAUtil { * Method: encrypt
* description: 私钥分段解密
* - * @param dataStr 解密内容,密文 + * @param dataStr 解密内容,密文 * @param PrivateKey 私钥 * @return 明文 * @throws Exception */ - public static String decrypt(String dataStr, String PrivateKey){ + public static String decrypt(String dataStr, String PrivateKey) { ByteArrayOutputStream out = null; String decodedDataStr = null; try { diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/excel/ExcelUtil.java b/mall-common/src/main/java/com/suisung/mall/common/utils/excel/ExcelUtil.java index ea33a545..59f11ea1 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/excel/ExcelUtil.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/excel/ExcelUtil.java @@ -25,11 +25,10 @@ import java.util.regex.Pattern; public class ExcelUtil { /** - * * @param response - * @param classInst 类实例 + * @param classInst 类实例 * @param reportName 文件名称 - * @param data 需要导出的数据 + * @param data 需要导出的数据 * @throws InstantiationException * @throws IllegalAccessException * @throws IOException diff --git a/mall-common/src/main/java/com/suisung/mall/common/utils/excel/ExportFactory.java b/mall-common/src/main/java/com/suisung/mall/common/utils/excel/ExportFactory.java index eb2eb1cf..a4fd7cc0 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/utils/excel/ExportFactory.java +++ b/mall-common/src/main/java/com/suisung/mall/common/utils/excel/ExportFactory.java @@ -21,6 +21,7 @@ public class ExportFactory { /** * 获取实例类 + * * @param classKey * @return */ diff --git a/mall-common/src/main/java/com/suisung/mall/common/weblog/ControllerLogAspect.java b/mall-common/src/main/java/com/suisung/mall/common/weblog/ControllerLogAspect.java index 4bd3a41f..ec6a68c4 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/weblog/ControllerLogAspect.java +++ b/mall-common/src/main/java/com/suisung/mall/common/weblog/ControllerLogAspect.java @@ -35,13 +35,11 @@ import java.util.Map; @Order(0) public class ControllerLogAspect { + private final static int max_str_length = 1000; /** * 日志对象 */ private final Logger logger = LoggerFactory.getLogger("LOG_STASH_RECORD"); - - private final static int max_str_length = 1000; - @Autowired private MessageService messageService; @@ -161,7 +159,7 @@ public class ControllerLogAspect { Map access_map = new HashMap(); for (String key : parameterMap.keySet()) { - if (!parameterMap.containsKey("perm_key") && !parameterMap.containsKey("perm_id") + if (!parameterMap.containsKey("perm_key") && !parameterMap.containsKey("perm_id") && !parameterMap.containsKey("new_pay_password") && !parameterMap.containsKey("pay_password") && !parameterMap.containsKey("password") diff --git a/mall-common/src/main/java/com/suisung/mall/common/weblog/IgnoreLog.java b/mall-common/src/main/java/com/suisung/mall/common/weblog/IgnoreLog.java index d1ebd65e..e7cb5511 100644 --- a/mall-common/src/main/java/com/suisung/mall/common/weblog/IgnoreLog.java +++ b/mall-common/src/main/java/com/suisung/mall/common/weblog/IgnoreLog.java @@ -3,7 +3,7 @@ package com.suisung.mall.common.weblog; import java.lang.annotation.*; @Documented -@Target({ElementType.METHOD,ElementType.TYPE}) +@Target({ElementType.METHOD, ElementType.TYPE}) @Retention(RetentionPolicy.RUNTIME) public @interface IgnoreLog { diff --git a/mall-common/src/test/com/suisung/mall/common/phone/PhoneNumberUtilsTest.java b/mall-common/src/test/com/suisung/mall/common/phone/PhoneNumberUtilsTest.java index e05970dc..7caeed38 100644 --- a/mall-common/src/test/com/suisung/mall/common/phone/PhoneNumberUtilsTest.java +++ b/mall-common/src/test/com/suisung/mall/common/phone/PhoneNumberUtilsTest.java @@ -10,7 +10,7 @@ public class PhoneNumberUtilsTest { * PhoneNumberUtils.getPhoneModelWithCountry(String) * 手机号信息提取方法测试 * 输出参考 {@link PhoneModel} - * + *

* input: +8617865933672 * output: PhoneModel(countryName=中国, provinceName=null, cityName=null, carrier=null, countryCode=86, nationalNumber=17865933672) */ @@ -25,7 +25,7 @@ public class PhoneNumberUtilsTest { /** * PhoneNumberUtils.isValidNumber(String) * 手机号合法检测方法测试 - * + *

* input: +8617865933672 * output: true */ diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/controller/admin/ShopOrderLogisticsController.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/controller/admin/ShopOrderLogisticsController.java index 54e36520..f4dfae24 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/controller/admin/ShopOrderLogisticsController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/controller/admin/ShopOrderLogisticsController.java @@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam; import org.springframework.web.bind.annotation.RestController; import java.util.Arrays; +import java.util.Collections; import java.util.List; import java.util.Map; @@ -42,7 +43,7 @@ public class ShopOrderLogisticsController { long num = invoicingStockBillService.count(new QueryWrapper().eq("order_id", orderLogistics.getOrder_id())); if (num <= 0) { - List orderIds = Arrays.asList(orderLogistics.getOrder_id()); + List orderIds = Collections.singletonList(orderLogistics.getOrder_id()); boolean b = shopOrderBaseService.reviewToState(orderIds, null, StateCode.ORDER_STATE_SHIPPED, orderLogistics); if (b) { diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/controller/mobile/QrcodeController.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/controller/mobile/QrcodeController.java index cc2e9823..74a69d8b 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/controller/mobile/QrcodeController.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/controller/mobile/QrcodeController.java @@ -22,7 +22,7 @@ import java.io.OutputStream; @RequestMapping("/mobile/shop/qrcode") public class QrcodeController extends BaseControllerImpl { - private static Logger logger = LoggerFactory.getLogger(QrcodeController.class); + private static final Logger logger = LoggerFactory.getLogger(QrcodeController.class); @ApiOperation(value = "根据提货码获取二维码", notes = "根据提货码获取二维码") @RequestMapping(value = "/getQrcode", method = RequestMethod.GET) diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/excel/PurchaseInvoiceTempListener.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/excel/PurchaseInvoiceTempListener.java index 6a508286..1b18072d 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/excel/PurchaseInvoiceTempListener.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/excel/PurchaseInvoiceTempListener.java @@ -17,14 +17,14 @@ import java.util.ArrayList; */ public class PurchaseInvoiceTempListener extends AnalysisEventListener { - private ArrayList list = new ArrayList<>(); - public static ShopPurchaseInvoiceService shopPurchaseInvoiceService; static { initDictionary(); } + private final ArrayList list = new ArrayList<>(); + static void initDictionary() { shopPurchaseInvoiceService = SpringUtil.getBean(ShopPurchaseInvoiceService.class); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/MessageListener.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/MessageListener.java index 6165e89a..5b4a4f3d 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/MessageListener.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/MessageListener.java @@ -28,7 +28,7 @@ public class MessageListener { String messageId = message.getMessageProperties().getMessageId(); try { - log.debug("消息监听到:{} ### {}",messageId, msgTO); + log.debug("消息监听到:{} ### {}", messageId, msgTO); boolean flag = messageService.sendNoticeMsg(msgTO.getUser_id(), msgTO.getStore_id(), msgTO.getMessage_id(), msgTO.getArgs()); if (flag) { channel.basicAck(message.getMessageProperties().getDeliveryTag(), false); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/OrderPayedListener.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/OrderPayedListener.java index 9fc8abd3..bbf1014e 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/OrderPayedListener.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/listener/OrderPayedListener.java @@ -5,11 +5,9 @@ import com.rabbitmq.client.Channel; import com.suisung.mall.common.api.StateCode; import com.suisung.mall.common.constant.MqConstant; import com.suisung.mall.common.modules.order.ShopOrderInfo; -import com.suisung.mall.shop.message.service.MqMessageService; import com.suisung.mall.shop.order.service.ShopOrderBaseService; import com.suisung.mall.shop.order.service.ShopOrderInfoService; import com.suisung.mall.shop.sfexpress.service.SFExpressApiService; -import com.suisung.mall.shop.store.service.ShopStorePrinterService; import lombok.extern.slf4j.Slf4j; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -38,7 +36,7 @@ public class OrderPayedListener { private ShopOrderBaseService shopOrderBaseService; @Autowired private ShopOrderInfoService shopOrderInfoService; -// @Autowired + // @Autowired // private ShopStorePrinterService shopStorePrinterService; // @Autowired // private MqMessageService mqMessageService; @@ -90,7 +88,7 @@ public class OrderPayedListener { if (flag) { // TODO 以下仅处理下单打印的情况,还需要处理退单打印分支。 - // 原始状态 2010-待付款;2011--待订单审核;2013-待财务审核 变成 2020-待配货;2016-已经付款 的时候 + // 原始状态 2010-待付款;2011--待订单审核;2013-待财务审核 变成 2020-待配货;2016-已经付款 的时候 // 生成取单号,打票机打印订单,向顺丰同城下单 if (order_state_id == StateCode.ORDER_STATE_WAIT_PAY || order_state_id == StateCode.ORDER_STATE_WAIT_REVIEW diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/mapper/ShopOrderBaseMapper.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/mapper/ShopOrderBaseMapper.java index cf07684d..7a4fb5c6 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/mapper/ShopOrderBaseMapper.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/mapper/ShopOrderBaseMapper.java @@ -52,6 +52,7 @@ public interface ShopOrderBaseMapper extends BaseMapper { /** * 获取已付款订单的打印信息(用于渲染打票机模版) + * * @param orderId * @param payState * @return diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/mapper/ShopOrderItemMapper.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/mapper/ShopOrderItemMapper.java index 3b289330..90c0859e 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/mapper/ShopOrderItemMapper.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/mapper/ShopOrderItemMapper.java @@ -29,6 +29,7 @@ public interface ShopOrderItemMapper extends BaseMapper { /** * 根据订单Id 获取订单子项的打印信息 + * * @param orderId * @return */ diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderBaseService.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderBaseService.java index 1439aabf..31af0105 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderBaseService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderBaseService.java @@ -523,10 +523,11 @@ public interface ShopOrderBaseService extends IBaseService { /** * 根据订单Id,生成顺丰同城的订单实体实例 + * * @param devId * @param orderId * @param orderPickupNum * @return */ - SFCreateOrderReq buildSFOrderData(Integer devId,String orderId, Long orderPickupNum); + SFCreateOrderReq buildSFOrderData(Integer devId, String orderId, Long orderPickupNum); } diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderDeliveryAddressService.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderDeliveryAddressService.java index 38918093..2db9595f 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderDeliveryAddressService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderDeliveryAddressService.java @@ -1,7 +1,6 @@ package com.suisung.mall.shop.order.service; import com.suisung.mall.common.modules.order.ShopOrderDeliveryAddress; -import com.suisung.mall.common.modules.store.ShopStoreBase; import com.suisung.mall.common.pojo.dto.StandardAddressDTO; import com.suisung.mall.core.web.service.IBaseService; import org.springframework.data.util.Pair; @@ -17,6 +16,7 @@ import org.springframework.data.util.Pair; public interface ShopOrderDeliveryAddressService extends IBaseService { /** * 根据订单ID获取订单发货地址 + * * @param orderId * @return */ @@ -24,6 +24,7 @@ public interface ShopOrderDeliveryAddressService extends IBaseService { /** * 获取店铺今日的取货单 + * * @param storeId * @return */ @@ -34,16 +35,18 @@ public interface ShopOrderInfoService extends IBaseService { /** * 更改商家订单的状态,出库状态,发货状态,并写入订单状态更改日志 + * * @param orderId - * @param orderStatus 约定0值不更改 - * @param orderIsOutStatus 出库状态,约定0值不更改 + * @param orderStatus 约定0值不更改 + * @param orderIsOutStatus 出库状态,约定0值不更改 * @param orderIsShippedStatus 发货状态,约定0值不更改 * @return */ - Boolean changeOrderStatus(String orderId, Integer orderStatus,Integer orderIsOutStatus, Integer orderIsShippedStatus); + Boolean changeOrderStatus(String orderId, Integer orderStatus, Integer orderIsOutStatus, Integer orderIsShippedStatus); /** * 已支付的订单,生成取单号,打票机并打印订单 + * * @param storeId * @param orderId * @return 取货单号 diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderItemService.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderItemService.java index d4c0b1f5..67018791 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderItemService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderItemService.java @@ -26,6 +26,7 @@ public interface ShopOrderItemService extends IBaseService { /** * 根据订单Id 获取订单子项的打印信息 + * * @param orderId * @return */ diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderReturnService.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderReturnService.java index 54108342..3d6cfceb 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderReturnService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/ShopOrderReturnService.java @@ -120,7 +120,7 @@ public interface ShopOrderReturnService extends IBaseService { * @param shopProductIndex * @return */ - public boolean ifDenyReturn(ShopOrderInfo shopOrderInfo, ShopOrderItem shopOrderItem, ShopProductIndex shopProductIndex); + boolean ifDenyReturn(ShopOrderInfo shopOrderInfo, ShopOrderItem shopOrderItem, ShopProductIndex shopProductIndex); /** * 是否允许退货 @@ -128,7 +128,7 @@ public interface ShopOrderReturnService extends IBaseService { * @param order_item_id * @return */ - public boolean ifDenyReturn(Long order_item_id); + boolean ifDenyReturn(Long order_item_id); /** * 添加退款退货-整单退货 diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java index 597d947c..0a774ce7 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderBaseServiceImpl.java @@ -284,7 +284,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl itemQueryWrapper = new QueryWrapper<>(); itemQueryWrapper.in("order_id", order_id); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderDeliveryAddressServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderDeliveryAddressServiceImpl.java index 2a08070c..9749bdbd 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderDeliveryAddressServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderDeliveryAddressServiceImpl.java @@ -29,7 +29,7 @@ public class ShopOrderDeliveryAddressServiceImpl extends BaseServiceImpl updateWrapper = new UpdateWrapper<>(); updateWrapper.eq("order_id", orderId); if (orderStatus > 0) { @@ -268,7 +264,7 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl selectOrderItemPrintInfo(String orderId) { - if(StrUtil.isBlank(orderId)){ + if (StrUtil.isBlank(orderId)) { return null; } - List mList= shopOrderItemMapper.selectOrderItemPrintInfo(orderId); - if(CollUtil.isEmpty(mList)){ + List mList = shopOrderItemMapper.selectOrderItemPrintInfo(orderId); + if (CollUtil.isEmpty(mList)) { return null; } - DecimalFormat df2 =new DecimalFormat("#.##"); + DecimalFormat df2 = new DecimalFormat("#.##"); List retList = new ArrayList<>(); for (Map map : mList) { ShopStoreOrderProductPrintVO vo = new ShopStoreOrderProductPrintVO(); diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderLogisticsServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderLogisticsServiceImpl.java index 2373fac1..b39e93ae 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderLogisticsServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/order/service/impl/ShopOrderLogisticsServiceImpl.java @@ -278,10 +278,6 @@ public class ShopOrderLogisticsServiceImpl extends BaseServiceImpl implements ShopOrderReturnService { - @Autowired - private ShopOrderReturnMapper shopOrderReturnMapper; - - @Autowired - private ShopOrderReturnItemService orderReturnItemService; - - @Autowired - private ShopStoreBaseService shopStoreBaseService; - - @Autowired - private ShopOrderItemService shopOrderItemService; - - @Autowired - private ShopProductBaseService shopProductBaseService; - - @Autowired - private ShopProductItemService shopProductItemService; - - @Autowired - private ShopBaseProductUnitService baseProductUnitService; - - @Autowired - private ShopOrderReturnReasonService orderReturnReasonService; - - @Autowired - private ShopOrderInfoService shopOrderInfoService; - - @Autowired - private ShopBaseStateCodeService shopBaseStateCodeService; - - @Autowired - private AccountService accountService; - - @Autowired - private ShopOrderBaseService shopOrderBaseService; - - @Autowired - private ShopOrderDeliveryAddressService orderDeliveryAddressService; - - @Autowired - private ShopProductInfoService shopProductInfoService; - - @Autowired - private ShopBaseStateCodeService stateCodeService; - - @Autowired - private ShopNumberSeqService shopNumberSeqService; - - @Autowired - private ShopOrderDataService shopOrderDataService; - - @Autowired - private ShopStoreConfigService shopStoreConfigService; - - @Autowired - private PayService payService; - - @Autowired - private ShopStoreShippingAddressService shopStoreShippingAddressService; - - @Autowired - private ShopDistributionUserOrderService shopDistributionUserOrderService; - - @Autowired - private ShopDistributionUserCommissionService shopDistributionUserCommissionService; - - @Autowired - private ShopDistributionUserOrderItemService shopDistributionUserOrderItemService; - - @Autowired - private ShopOrderReturnService shopOrderReturnService; - - @Autowired - private ShopProductIndexService shopProductIndexService; - - @Autowired - private AccountBaseConfigService accountBaseConfigService; - - @Autowired - private ShopOrderLogisticsService shopOrderLogisticsService; - - @Autowired - private MessageService messageService; - public static final Map order_is_shipped_row = new HashMap<>(); public static final Map return_state_id_row = new HashMap<>(); public static final Map return_channel_flag_row = new HashMap<>(); @@ -173,6 +89,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl return_type = new HashMap<>(); public static final Map return_item_state_id = new HashMap<>(); public static final Map pay_channel_id_row = new HashMap<>(); + private static final Logger logger = LoggerFactory.getLogger(ShopOrderReturnServiceImpl.class); static { order_is_shipped_row.put("3030", I18nUtil._("未发货")); @@ -210,7 +127,62 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl> statisticState() { @@ -315,7 +287,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl return_ids = Arrays.asList(return_id); + List return_ids = Collections.singletonList(return_id); ShopOrderReturn shopOrderReturn = get(return_id); UserDto user = getCurrentUser(); Integer store_id = Convert.toInt(user.getStore_id()); @@ -903,7 +875,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl { /** * 根据店铺id和角色权限组id获取多条 userId + * * @param storeId * @param groupId * @return diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreEmployeeRightsGroupService.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreEmployeeRightsGroupService.java index 5432872f..654cbef9 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreEmployeeRightsGroupService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreEmployeeRightsGroupService.java @@ -20,6 +20,7 @@ public interface ShopStoreEmployeeRightsGroupService extends IBaseService { /** * 获取店长的手机号码 + * * @param storeId * @return */ diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSameCityTransportBaseService.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSameCityTransportBaseService.java index 47965ce7..ef37d674 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSameCityTransportBaseService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSameCityTransportBaseService.java @@ -35,18 +35,20 @@ public interface ShopStoreSameCityTransportBaseService { /** * 店铺主营商品类型 + * * @return */ CommonResult storeBusinessTypeList(); /** * 下单前检测同城订单配送是否符合要求 + * * @param * @return */ CommonResult checkSameCityDelivery(); - /** + /** * 根据店铺 Id 获取同城配送设置详情信息 * * @param storeId diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSfOrderService.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSfOrderService.java index c0073b2b..892e1841 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSfOrderService.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/ShopStoreSfOrderService.java @@ -16,6 +16,7 @@ public interface ShopStoreSfOrderService extends IBaseService /** * 根据商家订单Id 获取一条记录 + * * @param shopOrderId * @return */ @@ -48,6 +49,7 @@ public interface ShopStoreSfOrderService extends IBaseService /** * 检查顺丰同城开发者id下,某个订单是否已经存在 + * * @param devId * @param shopOrderId 商城订单号 * @return diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreEmployeeRightsGroupServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreEmployeeRightsGroupServiceImpl.java index 87aeb9ed..2164b784 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreEmployeeRightsGroupServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreEmployeeRightsGroupServiceImpl.java @@ -40,6 +40,7 @@ public class ShopStoreEmployeeRightsGroupServiceImpl extends BaseServiceImpl 0) { // 没有一个满足起送距离和起送金额的规则订单 diff --git a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSfOrderServiceImpl.java b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSfOrderServiceImpl.java index 21472c57..457a2848 100644 --- a/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSfOrderServiceImpl.java +++ b/mall-shop/src/main/java/com/suisung/mall/shop/store/service/impl/ShopStoreSfOrderServiceImpl.java @@ -18,7 +18,6 @@ import com.suisung.mall.shop.store.service.ShopStoreSfOrderService; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; import java.util.Date; @@ -66,7 +65,7 @@ public class ShopStoreSfOrderServiceImpl extends BaseServiceImpl