格式化了 common 类
This commit is contained in:
parent
8314d2d202
commit
24c131802c
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns="http://maven.apache.org/POM/4.0.0"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>com.suisung.mall</groupId>
|
<groupId>com.suisung.mall</groupId>
|
||||||
|
|||||||
@ -7,7 +7,7 @@ package com.suisung.mall.common.api;
|
|||||||
*/
|
*/
|
||||||
public enum PayType {
|
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;
|
private final int code;
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package com.suisung.mall.common.api;
|
package com.suisung.mall.common.api;
|
||||||
|
|
||||||
import com.suisung.mall.common.utils.I18nUtil;
|
import com.suisung.mall.common.utils.I18nUtil;
|
||||||
import io.swagger.models.auth.In;
|
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.HashMap;
|
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_SELF_PICK_UP = 5; // 自提(运费 0 元)
|
||||||
public static final int DELIVERY_TYPE_EXP = 10; // 普通快递
|
public static final int DELIVERY_TYPE_EXP = 10; // 普通快递
|
||||||
public static final int DELIVERY_TYPE_IN_STORE_SERVICE = 15; // 店铺配送
|
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<Integer,String> DELIVERY_TYPE_MAP = new HashMap(){
|
public static final Map<Integer, String> DELIVERY_TYPE_MAP = new HashMap() {
|
||||||
{
|
{
|
||||||
put(DELIVERY_TYPE_EXPRESS,"快递配送");
|
put(DELIVERY_TYPE_EXPRESS, "快递配送");
|
||||||
put(DELIVERY_TYPE_EMS,"EMS");
|
put(DELIVERY_TYPE_EMS, "EMS");
|
||||||
put(DELIVERY_TYPE_MAIL,"平邮");
|
put(DELIVERY_TYPE_MAIL, "平邮");
|
||||||
put(DELIVERY_TYPE_AIR_FREIGHT,"货运");
|
put(DELIVERY_TYPE_AIR_FREIGHT, "货运");
|
||||||
put(DELIVERY_TYPE_SELF_PICK_UP,"到店自提");
|
put(DELIVERY_TYPE_SELF_PICK_UP, "到店自提");
|
||||||
put(DELIVERY_TYPE_EXP,"普通快递");
|
put(DELIVERY_TYPE_EXP, "普通快递");
|
||||||
put(DELIVERY_TYPE_IN_STORE_SERVICE,"店铺配送");
|
put(DELIVERY_TYPE_IN_STORE_SERVICE, "店铺配送");
|
||||||
put(DELIVERY_TYPE_SAME_CITY,"顺丰同城");
|
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_HOUR = new HashMap();
|
||||||
|
|
||||||
public static final Map DELIVERY_TIME_MINUTE = 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 {
|
static {
|
||||||
DELIVERY_TIME_NOT_TIMER.put(1, I18nUtil._("不限时段"));
|
DELIVERY_TIME_NOT_TIMER.put(1, I18nUtil._("不限时段"));
|
||||||
@ -502,33 +524,4 @@ public class StateCode {
|
|||||||
public static boolean ifOther(Integer source_type) {
|
public static boolean ifOther(Integer source_type) {
|
||||||
return source_type != null && SOURCE_TYPE_OTHER == 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;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,14 +24,14 @@ public class CommonConstant {
|
|||||||
|
|
||||||
// 店铺角色权限组
|
// 店铺角色权限组
|
||||||
public static final String STORE_RIGHT_GROUP_ADMIN = "店铺管理员"; // 店铺管理员;
|
public static final String STORE_RIGHT_GROUP_ADMIN = "店铺管理员"; // 店铺管理员;
|
||||||
public static final String STORE_RIGHT_GROUP_YYJL = "运营经理"; // 店铺管理员;
|
public static final String STORE_RIGHT_GROUP_YYJL = "运营经理"; // 店铺管理员;
|
||||||
public static final String STORE_RIGHT_GROUP_DDSHY = "订单审核员"; // 店铺管理员;
|
public static final String STORE_RIGHT_GROUP_DDSHY = "订单审核员"; // 店铺管理员;
|
||||||
public static final String STORE_RIGHT_GROUP_CWSHY = "财务审核员"; // 店铺管理员;
|
public static final String STORE_RIGHT_GROUP_CWSHY = "财务审核员"; // 店铺管理员;
|
||||||
public static final String STORE_RIGHT_GROUP_FHSHY = "发货审核员"; // 店铺管理员;
|
public static final String STORE_RIGHT_GROUP_FHSHY = "发货审核员"; // 店铺管理员;
|
||||||
public static final String STORE_RIGHT_GROUP_YWJL = "业务经理"; // 店铺管理员;
|
public static final String STORE_RIGHT_GROUP_YWJL = "业务经理"; // 店铺管理员;
|
||||||
public static final String STORE_RIGHT_GROUP_CKGLY = "仓库管理员"; // 店铺管理员;
|
public static final String STORE_RIGHT_GROUP_CKGLY = "仓库管理员"; // 店铺管理员;
|
||||||
public static final String STORE_RIGHT_GROUP_ZLWHY = "资料维护员"; // 店铺管理员;
|
public static final String STORE_RIGHT_GROUP_ZLWHY = "资料维护员"; // 店铺管理员;
|
||||||
public static final String STORE_RIGHT_GROUP_KF = "客服"; // 店铺管理员;
|
public static final String STORE_RIGHT_GROUP_KF = "客服"; // 店铺管理员;
|
||||||
public static final String STORE_RIGHT_GROUP_KZ1 = "扩展1"; // 店铺管理员;
|
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_KZ2 = "扩展2"; // 店铺管理员;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -20,12 +20,12 @@ public class RedisConstant {
|
|||||||
|
|
||||||
public static final String Config_Cache_Key = "config_cache_key";
|
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 Plat_Category = ConstantRedis.Cache_NameSpace + "plat_category";
|
||||||
|
|
||||||
public static final String Store_Category_NameSpace = ConstantRedis.Cache_NameSpace + "storeCate:";
|
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";
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -26,16 +26,16 @@ public class SFExpressConstant {
|
|||||||
public static int Cons_ReportException = 91;
|
public static int Cons_ReportException = 91;
|
||||||
public static int Cons_CancelingOrder = 31;
|
public static int Cons_CancelingOrder = 31;
|
||||||
|
|
||||||
public static Map SF_Order_Status_Map = new HashMap<Integer,String>(){{
|
public static Map SF_Order_Status_Map = new HashMap<Integer, String>() {{
|
||||||
put(Cons_CreatedOrder,"订单创建");
|
put(Cons_CreatedOrder, "订单创建");
|
||||||
put(Cons_CanceledOrder,"订单取消");
|
put(Cons_CanceledOrder, "订单取消");
|
||||||
put(Cons_AcceptOrder,"配送员接单/配送员改派");
|
put(Cons_AcceptOrder, "配送员接单/配送员改派");
|
||||||
put(Cons_ArriveStore,"配送员到店");
|
put(Cons_ArriveStore, "配送员到店");
|
||||||
put(Cons_Delivering,"配送员配送中(已取货)");
|
put(Cons_Delivering, "配送员配送中(已取货)");
|
||||||
put(Cons_DeliverySuccess,"配送员妥投完单");
|
put(Cons_DeliverySuccess, "配送员妥投完单");
|
||||||
put(Cons_WithDrawOrder,"配送员撤单");
|
put(Cons_WithDrawOrder, "配送员撤单");
|
||||||
put(Cons_ReportException,"骑士上报异常");
|
put(Cons_ReportException, "骑士上报异常");
|
||||||
put(Cons_CancelingOrder,"取消中");
|
put(Cons_CancelingOrder, "取消中");
|
||||||
}};
|
}};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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.pay.*;
|
||||||
import com.suisung.mall.common.modules.product.ShopProductIndex;
|
import com.suisung.mall.common.modules.product.ShopProductIndex;
|
||||||
import com.suisung.mall.common.pojo.output.TimelineOutput;
|
import com.suisung.mall.common.pojo.output.TimelineOutput;
|
||||||
import io.swagger.annotations.ApiOperation;
|
|
||||||
import org.springframework.cloud.openfeign.FeignClient;
|
import org.springframework.cloud.openfeign.FeignClient;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.GetMapping;
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
||||||
@ -87,12 +86,12 @@ public interface PayService {
|
|||||||
|
|
||||||
@PostMapping(value = "/admin/pay/payController/getOrderNum")
|
@PostMapping(value = "/admin/pay/payController/getOrderNum")
|
||||||
long getOrderNum(@RequestParam(name = "order_state_id", required = false) Integer order_state_id,
|
long getOrderNum(@RequestParam(name = "order_state_id", required = false) Integer order_state_id,
|
||||||
@RequestParam(name = "store_id", required = false) Integer store_id,
|
@RequestParam(name = "store_id", required = false) Integer store_id,
|
||||||
@RequestParam(name = "chain_id", required = false) Integer chain_id,
|
@RequestParam(name = "chain_id", required = false) Integer chain_id,
|
||||||
@RequestParam(name = "day_flag", required = false) Integer day_flag,
|
@RequestParam(name = "day_flag", required = false) Integer day_flag,
|
||||||
@RequestParam(name = "month_flag", required = false) Integer month_flag,
|
@RequestParam(name = "month_flag", required = false) Integer month_flag,
|
||||||
@RequestParam(name = "trade_type_id", required = false) Integer trade_type_id,
|
@RequestParam(name = "trade_type_id", required = false) Integer trade_type_id,
|
||||||
@RequestParam(name = "subsite_id", required = false) Integer subsite_id);
|
@RequestParam(name = "subsite_id", required = false) Integer subsite_id);
|
||||||
|
|
||||||
@PostMapping(value = "/admin/pay/payController/getOrderPaymentAmount")
|
@PostMapping(value = "/admin/pay/payController/getOrderPaymentAmount")
|
||||||
BigDecimal getOrderPaymentAmount(@RequestParam(name = "trade_is_paid", required = false) Integer trade_is_paid,
|
BigDecimal getOrderPaymentAmount(@RequestParam(name = "trade_is_paid", required = false) Integer trade_is_paid,
|
||||||
@ -171,13 +170,14 @@ public interface PayService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更改交易订单的订单状态和付款状态
|
* 更改交易订单的订单状态和付款状态
|
||||||
|
*
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @param orderStateId 空值或0将不更新
|
* @param orderStateId 空值或0将不更新
|
||||||
* @param tradeIsPaid 空值或0将不更新
|
* @param tradeIsPaid 空值或0将不更新
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@PostMapping(value = "/admin/pay/pay-consume-trade/change/state")
|
@PostMapping(value = "/admin/pay/pay-consume-trade/change/state")
|
||||||
Boolean changePayConsumeTradeState(@RequestParam(name = "order_id") String orderId,
|
Boolean changePayConsumeTradeState(@RequestParam(name = "order_id") String orderId,
|
||||||
@RequestParam(name = "order_state_id") Integer orderStateId,
|
@RequestParam(name = "order_state_id") Integer orderStateId,
|
||||||
@RequestParam(name = "trade_is_paid") Integer tradeIsPaid);
|
@RequestParam(name = "trade_is_paid") Integer tradeIsPaid);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class AccountUserAnalytics implements Serializable {
|
|||||||
@ApiModelProperty(value = "退货数量")
|
@ApiModelProperty(value = "退货数量")
|
||||||
private Integer user_product_return_num;
|
private Integer user_product_return_num;
|
||||||
|
|
||||||
// @Version
|
// @Version
|
||||||
@ApiModelProperty(value = "乐观锁")
|
@ApiModelProperty(value = "乐观锁")
|
||||||
private Integer version;
|
private Integer version;
|
||||||
|
|
||||||
|
|||||||
@ -23,7 +23,7 @@ import java.io.Serializable;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("account_user_channel")
|
@TableName("account_user_channel")
|
||||||
@ApiModel(value="AccountUserChannel对象", description="用户渠道表")
|
@ApiModel(value = "AccountUserChannel对象", description = "用户渠道表")
|
||||||
public class AccountUserChannel implements Serializable {
|
public class AccountUserChannel implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@ -19,7 +19,7 @@ import java.util.Date;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("account_user_channel_bring")
|
@TableName("account_user_channel_bring")
|
||||||
@ApiModel(value="AccountUserChannelBring对象", description="渠道引流表")
|
@ApiModel(value = "AccountUserChannelBring对象", description = "渠道引流表")
|
||||||
public class AccountUserChannelBring implements Serializable {
|
public class AccountUserChannelBring implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@ -24,7 +24,7 @@ import java.io.Serializable;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("account_user_channel_code")
|
@TableName("account_user_channel_code")
|
||||||
@ApiModel(value="AccountUserChannelCode对象", description="用户渠道邀请码表")
|
@ApiModel(value = "AccountUserChannelCode对象", description = "用户渠道邀请码表")
|
||||||
public class AccountUserChannelCode implements Serializable {
|
public class AccountUserChannelCode implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@ -83,7 +83,7 @@ public class AccountUserSns implements Serializable {
|
|||||||
@ApiModelProperty(value = "帖子转发")
|
@ApiModelProperty(value = "帖子转发")
|
||||||
private Integer user_story_forward;
|
private Integer user_story_forward;
|
||||||
|
|
||||||
// @Version
|
// @Version
|
||||||
@ApiModelProperty(value = "乐观锁")
|
@ApiModelProperty(value = "乐观锁")
|
||||||
private Integer version;
|
private Integer version;
|
||||||
|
|
||||||
|
|||||||
@ -13,10 +13,9 @@ import java.io.Serializable;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
*
|
*
|
||||||
* </p>
|
* </p>
|
||||||
*
|
*
|
||||||
* @author Xinze
|
* @author Xinze
|
||||||
@ -26,7 +25,7 @@ import java.util.Date;
|
|||||||
@EqualsAndHashCode(callSuper = false)
|
@EqualsAndHashCode(callSuper = false)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@TableName("shop_order_user_form")
|
@TableName("shop_order_user_form")
|
||||||
@ApiModel(value="ShopOrderUserForm对象", description="")
|
@ApiModel(value = "ShopOrderUserForm对象", description = "")
|
||||||
public class ShopOrderUserForm implements Serializable {
|
public class ShopOrderUserForm implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|||||||
@ -42,7 +42,7 @@ public class ShopPageUserForm implements Serializable {
|
|||||||
|
|
||||||
@ApiModelProperty(value = "用户昵称")
|
@ApiModelProperty(value = "用户昵称")
|
||||||
private String user_nickname;
|
private String user_nickname;
|
||||||
|
|
||||||
@ApiModelProperty(value = "采集内容")
|
@ApiModelProperty(value = "采集内容")
|
||||||
private String form_data;
|
private String form_data;
|
||||||
|
|
||||||
|
|||||||
@ -47,7 +47,7 @@ public class LiveLiveTag implements Serializable {
|
|||||||
@ApiModelProperty(value = "是否推荐(ENUM):1-是; 0-否")
|
@ApiModelProperty(value = "是否推荐(ENUM):1-是; 0-否")
|
||||||
private Integer live_tag_recommend;
|
private Integer live_tag_recommend;
|
||||||
|
|
||||||
// @Version
|
// @Version
|
||||||
@ApiModelProperty(value = "乐观锁")
|
@ApiModelProperty(value = "乐观锁")
|
||||||
private Integer version;
|
private Integer version;
|
||||||
|
|
||||||
|
|||||||
@ -34,8 +34,43 @@ import java.util.Date;
|
|||||||
public class ShopStorePrinterLog implements Serializable {
|
public class ShopStorePrinterLog implements Serializable {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
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.category = category;
|
||||||
this.store_id = storeId;
|
this.store_id = storeId;
|
||||||
this.order_id = orderId;
|
this.order_id = orderId;
|
||||||
@ -46,54 +81,4 @@ public class ShopStorePrinterLog implements Serializable {
|
|||||||
this.feie_print_no = feiePrintNo;
|
this.feie_print_no = feiePrintNo;
|
||||||
this.printer_sn = printerSn;
|
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;
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,13 +15,11 @@ import com.fasterxml.jackson.annotation.JsonFormat;
|
|||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import io.swagger.models.auth.In;
|
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.EqualsAndHashCode;
|
import lombok.EqualsAndHashCode;
|
||||||
import lombok.experimental.Accessors;
|
import lombok.experimental.Accessors;
|
||||||
import org.springframework.format.annotation.DateTimeFormat;
|
import org.springframework.format.annotation.DateTimeFormat;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
|
|||||||
@ -23,8 +23,8 @@ public enum ErrorTypeEnum {
|
|||||||
|
|
||||||
ERR_ORDER_SERVICE("订单处理异常", 6001);
|
ERR_ORDER_SERVICE("订单处理异常", 6001);
|
||||||
|
|
||||||
|
private static final List<Map<String, Object>> errorTypes = new ArrayList<>();
|
||||||
private final String label;
|
private final String label;
|
||||||
|
|
||||||
private final int value;
|
private final int value;
|
||||||
|
|
||||||
ErrorTypeEnum(String label, int value) {
|
ErrorTypeEnum(String label, int value) {
|
||||||
@ -32,8 +32,6 @@ public enum ErrorTypeEnum {
|
|||||||
this.value = value;
|
this.value = value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final List<Map<String, Object>> errorTypes = new ArrayList<>();
|
|
||||||
|
|
||||||
public static List<Map<String, Object>> getAllValues() {
|
public static List<Map<String, Object>> getAllValues() {
|
||||||
if (CollUtil.isNotEmpty(errorTypes)) {
|
if (CollUtil.isNotEmpty(errorTypes)) {
|
||||||
return errorTypes;
|
return errorTypes;
|
||||||
|
|||||||
@ -6,7 +6,6 @@ import lombok.Data;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 飞鹅云打印机接口响应结果
|
* 飞鹅云打印机接口响应结果
|
||||||
@ -35,7 +34,7 @@ public class FeiePrinterApiRes<T> implements Serializable {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
// @Data
|
// @Data
|
||||||
// @NoArgsConstructor
|
// @NoArgsConstructor
|
||||||
// @AllArgsConstructor
|
// @AllArgsConstructor
|
||||||
public class FeiePrinterApiData implements Serializable {
|
public class FeiePrinterApiData implements Serializable {
|
||||||
|
|||||||
@ -25,15 +25,14 @@ import java.io.Serializable;
|
|||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class SFExpressApiRes implements Serializable {
|
public class SFExpressApiRes implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty(value = "错误码")
|
@ApiModelProperty(value = "错误码")
|
||||||
private Integer error_code;
|
private Integer error_code;
|
||||||
@ApiModelProperty(value = "错误信息")
|
@ApiModelProperty(value = "错误信息")
|
||||||
private String error_msg;
|
private String error_msg;
|
||||||
@ApiModelProperty(value = "错误数据")
|
|
||||||
public Object error_data;
|
|
||||||
@ApiModelProperty(value = "响应结果")
|
@ApiModelProperty(value = "响应结果")
|
||||||
private Object result;
|
private Object result;
|
||||||
|
@ApiModelProperty(value = "错误数据")
|
||||||
|
public Object error_data;
|
||||||
|
|
||||||
public SFExpressApiRes fail(Integer errorCode, String errorMsg) {
|
public SFExpressApiRes fail(Integer errorCode, String errorMsg) {
|
||||||
return new SFExpressApiRes(errorCode, errorMsg, null, null);
|
return new SFExpressApiRes(errorCode, errorMsg, null, null);
|
||||||
|
|||||||
@ -26,13 +26,12 @@ import java.util.Date;
|
|||||||
@JsonInclude(JsonInclude.Include.NON_NULL)
|
@JsonInclude(JsonInclude.Include.NON_NULL)
|
||||||
public class SFExpressFeedRes implements Serializable {
|
public class SFExpressFeedRes implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
@ApiModelProperty(value = "顺丰订单状态")
|
||||||
|
public Integer order_status;
|
||||||
@ApiModelProperty(value = "顺丰订单号")
|
@ApiModelProperty(value = "顺丰订单号")
|
||||||
private String sf_order_id;
|
private String sf_order_id;
|
||||||
@ApiModelProperty(value = "商家订单号")
|
@ApiModelProperty(value = "商家订单号")
|
||||||
private String shop_order_id;
|
private String shop_order_id;
|
||||||
@ApiModelProperty(value = "顺丰订单状态")
|
|
||||||
public Integer order_status;
|
|
||||||
@ApiModelProperty(value = "操作记录日志")
|
@ApiModelProperty(value = "操作记录日志")
|
||||||
private String operator;
|
private String operator;
|
||||||
@ApiModelProperty(value = "操作员")
|
@ApiModelProperty(value = "操作员")
|
||||||
|
|||||||
@ -24,12 +24,34 @@ import java.util.List;
|
|||||||
@ApiModel(value = "订单商品打印对象", description = "订单商品打印对象")
|
@ApiModel(value = "订单商品打印对象", description = "订单商品打印对象")
|
||||||
public class ShopStoreOrderProductPrintVO implements Serializable {
|
public class ShopStoreOrderProductPrintVO implements Serializable {
|
||||||
private static final long serialVersionUID = 1L;
|
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<String> 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) {
|
public ShopStoreOrderProductPrintVO(String itemName, Integer orderItemQuantity, BigDecimal orderItemAmount, String productSn) {
|
||||||
new ShopStoreOrderProductPrintVO(itemName,orderItemQuantity,orderItemAmount,productSn,18,6,8);
|
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.item_name = itemName;
|
||||||
this.order_item_quantity = orderItemQuantity;
|
this.order_item_quantity = orderItemQuantity;
|
||||||
this.order_item_amount = orderItemAmount;
|
this.order_item_amount = orderItemAmount;
|
||||||
@ -65,46 +87,13 @@ public class ShopStoreOrderProductPrintVO implements Serializable {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 重构实体类,处理标题,数量,价格适应长度
|
* 重构实体类,处理标题,数量,价格适应长度
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ShopStoreOrderProductPrintVO rebuild(){
|
public ShopStoreOrderProductPrintVO rebuild() {
|
||||||
return new ShopStoreOrderProductPrintVO(this.item_name,this.order_item_quantity,this.order_item_amount,this.product_sn,18,6,8);
|
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<String> 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;
|
int cz = size - len;
|
||||||
return StrUtil.repeat(" ",cz) + str;
|
return StrUtil.repeat(" ", cz) + str;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -1,9 +1,5 @@
|
|||||||
package com.suisung.mall.common.pojo.vo;
|
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.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
|
|||||||
@ -83,7 +83,7 @@ public class BaseControllerImpl extends BaseController implements IBaseControlle
|
|||||||
}
|
}
|
||||||
return Convert.convert((Class<T>) defaultValue.getClass(), value);
|
return Convert.convert((Class<T>) defaultValue.getClass(), value);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 请求参数的空字符串转为null
|
* 请求参数的空字符串转为null
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -14,12 +14,10 @@ import java.util.Map;
|
|||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class MessageServiceImpl implements MessageService {
|
public class MessageServiceImpl implements MessageService {
|
||||||
|
private static final String kerPre = "_msg_|";
|
||||||
@Autowired
|
@Autowired
|
||||||
private RedisService redisService;
|
private RedisService redisService;
|
||||||
|
|
||||||
private static final String kerPre = "_msg_|";
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param k 队列原始值
|
* @param k 队列原始值
|
||||||
* @access public
|
* @access public
|
||||||
|
|||||||
@ -22,7 +22,7 @@ public class TencentServiceImpl implements ThirdService {
|
|||||||
@Override
|
@Override
|
||||||
public void send(SmsDto smsDto) {
|
public void send(SmsDto smsDto) {
|
||||||
// 短信应用SDK AppID 1400开头
|
// 短信应用SDK AppID 1400开头
|
||||||
Integer tengxunAppId =smsDto.getTengxunAppId();
|
Integer tengxunAppId = smsDto.getTengxunAppId();
|
||||||
// 短信应用SDK AppKey
|
// 短信应用SDK AppKey
|
||||||
String tengxunAppkey = smsDto.getTengxunAppkey();
|
String tengxunAppkey = smsDto.getTengxunAppkey();
|
||||||
// 短信模板ID,需要在短信应用中申请
|
// 短信模板ID,需要在短信应用中申请
|
||||||
|
|||||||
@ -18,6 +18,32 @@ import org.springframework.web.method.support.ModelAndViewContainer;
|
|||||||
public class AuthInterceptor implements HandlerMethodArgumentResolver, ApplicationContextAware {
|
public class AuthInterceptor implements HandlerMethodArgumentResolver, ApplicationContextAware {
|
||||||
private static ApplicationContext applicationContext;
|
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> T getBean(Class<T> clazz) {
|
||||||
|
return getApplicationContext().getBean(clazz);
|
||||||
|
}
|
||||||
|
|
||||||
|
//通过name,以及Clazz返回指定的Bean
|
||||||
|
public static <T> T getBean(String name, Class<T> clazz) {
|
||||||
|
return getApplicationContext().getBean(name, clazz);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean supportsParameter(MethodParameter parameter) {
|
public boolean supportsParameter(MethodParameter parameter) {
|
||||||
if (parameter.hasParameterAnnotation(Auth.class)) {
|
if (parameter.hasParameterAnnotation(Auth.class)) {
|
||||||
@ -60,30 +86,4 @@ public class AuthInterceptor implements HandlerMethodArgumentResolver, Applicati
|
|||||||
return user;
|
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> T getBean(Class<T> clazz) {
|
|
||||||
return getApplicationContext().getBean(clazz);
|
|
||||||
}
|
|
||||||
|
|
||||||
//通过name,以及Clazz返回指定的Bean
|
|
||||||
public static <T> T getBean(String name, Class<T> clazz) {
|
|
||||||
return getApplicationContext().getBean(name, clazz);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,6 +14,7 @@ public class AesEncryptUtil {
|
|||||||
private static final String KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2";
|
private static final String KEY = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2";
|
||||||
//参数分别代表 算法名称/加密模式/数据填充方式
|
//参数分别代表 算法名称/加密模式/数据填充方式
|
||||||
private static final String ALGORITHMSTR = "AES/ECB/PKCS5Padding";
|
private static final String ALGORITHMSTR = "AES/ECB/PKCS5Padding";
|
||||||
|
|
||||||
/* 加密
|
/* 加密
|
||||||
* @param content 加密的字符串
|
* @param content 加密的字符串
|
||||||
* @param encryptKey key值*/
|
* @param encryptKey key值*/
|
||||||
@ -26,6 +27,7 @@ public class AesEncryptUtil {
|
|||||||
// 采用base64算法进行转码,避免出现中文乱码
|
// 采用base64算法进行转码,避免出现中文乱码
|
||||||
return Base64.encodeBase64String(b);
|
return Base64.encodeBase64String(b);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 解密
|
/* 解密
|
||||||
* @param encryptStr 解密的字符串
|
* @param encryptStr 解密的字符串
|
||||||
* @param decryptKey 解密的key值*/
|
* @param decryptKey 解密的key值*/
|
||||||
@ -43,6 +45,7 @@ public class AesEncryptUtil {
|
|||||||
public static String encrypt(String content) throws Exception {
|
public static String encrypt(String content) throws Exception {
|
||||||
return encrypt(content, KEY);
|
return encrypt(content, KEY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String decrypt(String encryptStr) throws Exception {
|
public static String decrypt(String encryptStr) throws Exception {
|
||||||
return decrypt(encryptStr, KEY);
|
return decrypt(encryptStr, KEY);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,11 +22,11 @@ import java.util.List;
|
|||||||
**/
|
**/
|
||||||
|
|
||||||
public class CSVUtils {
|
public class CSVUtils {
|
||||||
private static Logger logger = LoggerFactory.getLogger(CSVUtils.class);
|
|
||||||
//行尾分隔符定义
|
//行尾分隔符定义
|
||||||
private final static String NEW_LINE_SEPARATOR = "\n";
|
private final static String NEW_LINE_SEPARATOR = "\n";
|
||||||
//上传文件的存储位置
|
//上传文件的存储位置
|
||||||
private final static String PATH = new ApplicationHome().getDir().getPath() + "/";
|
private final static String PATH = new ApplicationHome().getDir().getPath() + "/";
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(CSVUtils.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return File
|
* @return File
|
||||||
@ -143,7 +143,7 @@ public class CSVUtils {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return List<List < String>>
|
* @return List<List < String>>
|
||||||
* @Description 读取CSV文件的内容(不含表头)
|
* @Description 读取CSV文件的内容(不含表头)
|
||||||
* @Param filePath 文件存储路径,colNum 列数
|
* @Param filePath 文件存储路径,colNum 列数
|
||||||
**/
|
**/
|
||||||
|
|||||||
@ -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();
|
Field[] fields = c.getDeclaredFields();
|
||||||
for (Field f : fields) {
|
for (Field f : fields) {
|
||||||
if (fieldName.equals(f.getName())) {
|
if (fieldName.equals(f.getName())) {
|
||||||
|
|||||||
@ -133,6 +133,7 @@ public class CommonUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Double 四舍五入,不保留小数点
|
* Double 四舍五入,不保留小数点
|
||||||
|
*
|
||||||
* @param d
|
* @param d
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -142,6 +143,7 @@ public class CommonUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Decimal 四舍五入,不保留小数点
|
* Decimal 四舍五入,不保留小数点
|
||||||
|
*
|
||||||
* @param d
|
* @param d
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -152,6 +154,7 @@ public class CommonUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据上一个订单状态和当前状态,获取订单状态变化备注
|
* 根据上一个订单状态和当前状态,获取订单状态变化备注
|
||||||
|
*
|
||||||
* @param order_state_pre_id
|
* @param order_state_pre_id
|
||||||
* @param order_state_id
|
* @param order_state_id
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -14,6 +14,7 @@ public class CompressionUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 压缩
|
* 压缩
|
||||||
|
*
|
||||||
* @param data
|
* @param data
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -32,6 +33,7 @@ public class CompressionUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 解压缩
|
* 解压缩
|
||||||
|
*
|
||||||
* @param compressedData
|
* @param compressedData
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -12,16 +12,10 @@ import javax.annotation.PostConstruct;
|
|||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class ContextUtil {
|
public class ContextUtil {
|
||||||
|
private static UserInfoService staticUserInfoService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private UserInfoService userInfoService;
|
private UserInfoService userInfoService;
|
||||||
|
|
||||||
private static UserInfoService staticUserInfoService;
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
ContextUtil.staticUserInfoService = userInfoService;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录用户
|
* 获取当前登录用户
|
||||||
*
|
*
|
||||||
@ -37,7 +31,6 @@ public class ContextUtil {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取当前登录用户
|
* 获取当前登录用户
|
||||||
*
|
*
|
||||||
@ -77,4 +70,9 @@ public class ContextUtil {
|
|||||||
|
|
||||||
return loginUser.getId();
|
return loginUser.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
ContextUtil.staticUserInfoService = userInfoService;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,24 +23,13 @@ public class CookieUtils {
|
|||||||
|
|
||||||
|
|
||||||
private static HttpServletResponse response;
|
private static HttpServletResponse response;
|
||||||
|
private static HttpServletRequest request;
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(CookieUtils.class);
|
||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletResponse response2;
|
private HttpServletResponse response2;
|
||||||
|
|
||||||
private static HttpServletRequest request;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private HttpServletRequest request2;
|
private HttpServletRequest request2;
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(CookieUtils.class);
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void beforeInit() {
|
|
||||||
request = request2;
|
|
||||||
response = response2;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据Cookie名称得到Cookie对象,不存在该对象则返回Null
|
* 根据Cookie名称得到Cookie对象,不存在该对象则返回Null
|
||||||
*
|
*
|
||||||
@ -151,14 +140,7 @@ public class CookieUtils {
|
|||||||
}
|
}
|
||||||
return cookieMap;
|
return cookieMap;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
*
|
|
||||||
* 功能描述:
|
|
||||||
* @param: IM新增cookie操作方法
|
|
||||||
* @return:
|
|
||||||
* @auther: 陈旺
|
|
||||||
* @date: 2022/4/24 9:51
|
|
||||||
*/
|
|
||||||
/**
|
/**
|
||||||
* 设置 Cookie(生成时间为1天)
|
* 设置 Cookie(生成时间为1天)
|
||||||
*
|
*
|
||||||
@ -168,6 +150,14 @@ public class CookieUtils {
|
|||||||
public static void setCookieIm(String name, String value) {
|
public static void setCookieIm(String name, String value) {
|
||||||
setCookieIm(name, value, COOKIE_ONE_DAY);
|
setCookieIm(name, value, COOKIE_ONE_DAY);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* 功能描述:
|
||||||
|
* @param: IM新增cookie操作方法
|
||||||
|
* @return:
|
||||||
|
* @auther: 陈旺
|
||||||
|
* @date: 2022/4/24 9:51
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* IM新增设置 Cookie
|
* IM新增设置 Cookie
|
||||||
@ -198,4 +188,10 @@ public class CookieUtils {
|
|||||||
}
|
}
|
||||||
response.addCookie(cookie);
|
response.addCookie(cookie);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void beforeInit() {
|
||||||
|
request = request2;
|
||||||
|
response = response2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -14,20 +14,46 @@ import java.util.stream.Collectors;
|
|||||||
/**
|
/**
|
||||||
* 多线程方法调用工具类
|
* 多线程方法调用工具类
|
||||||
* Author: Lwg
|
* Author: Lwg
|
||||||
|
*
|
||||||
* @desc: 不建议使用这个工具类,一般情况下性能优化不应该涉及到这里,如果有特俗场景遇到性能问题,例如sql in,或接口传输,网关传输数据等需要执行大量数据请求时,可将数据拆分处理
|
* @desc: 不建议使用这个工具类,一般情况下性能优化不应该涉及到这里,如果有特俗场景遇到性能问题,例如sql in,或接口传输,网关传输数据等需要执行大量数据请求时,可将数据拆分处理
|
||||||
*/
|
*/
|
||||||
public class ExecutorUtil {
|
public class ExecutorUtil {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 拆分数据到指定大小的集合中
|
||||||
|
*
|
||||||
|
* @param parentList 数据集合
|
||||||
|
* @param splitSize 拆分集合大小
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
private static List<List<String>> splitList(List<String> parentList, int splitSize) {
|
||||||
|
List<List<String>> 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<String> sublist = parentList.subList(index, index + size);
|
||||||
|
dividedList.add(sublist);
|
||||||
|
index += size;
|
||||||
|
}
|
||||||
|
|
||||||
|
return dividedList;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 本方法为财务获取报表数据使用
|
* 本方法为财务获取报表数据使用
|
||||||
* for东华项目,后续其他业务可做小量改造使用
|
* for东华项目,后续其他业务可做小量改造使用
|
||||||
* 多线程查询:当集合数据过大对集合进行执行数量拆分并使用多线程批量执行,执行完成后将结果返回
|
* 多线程查询:当集合数据过大对集合进行执行数量拆分并使用多线程批量执行,执行完成后将结果返回
|
||||||
|
*
|
||||||
* @param parentList 数据集合
|
* @param parentList 数据集合
|
||||||
* @param splitSize 拆分集合大小
|
* @param splitSize 拆分集合大小
|
||||||
* @param applyFun 执行函数
|
* @param applyFun 执行函数
|
||||||
* @param executor 线程池对象
|
* @param executor 线程池对象
|
||||||
* @return
|
|
||||||
* @param <T>
|
* @param <T>
|
||||||
|
* @return
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public <T> Object getSaleReport(List<String> parentList, int splitSize, Function<byte[], Object> applyFun, ThreadPoolExecutor executor) {
|
public <T> Object getSaleReport(List<String> parentList, int splitSize, Function<byte[], Object> applyFun, ThreadPoolExecutor executor) {
|
||||||
@ -71,27 +97,4 @@ public class ExecutorUtil {
|
|||||||
return resultList;
|
return resultList;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 拆分数据到指定大小的集合中
|
|
||||||
* @param parentList 数据集合
|
|
||||||
* @param splitSize 拆分集合大小
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
private static List<List<String>> splitList(List<String> parentList, int splitSize) {
|
|
||||||
List<List<String>> 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<String> sublist = parentList.subList(index, index + size);
|
|
||||||
dividedList.add(sublist);
|
|
||||||
index += size;
|
|
||||||
}
|
|
||||||
|
|
||||||
return dividedList;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,16 +18,10 @@ import java.util.Locale;
|
|||||||
@Component
|
@Component
|
||||||
@Slf4j
|
@Slf4j
|
||||||
public class I18nUtil {
|
public class I18nUtil {
|
||||||
|
private static MessageSource staticMessageSource;
|
||||||
@Resource
|
@Resource
|
||||||
private MessageSource messageSource;
|
private MessageSource messageSource;
|
||||||
|
|
||||||
private static MessageSource staticMessageSource;
|
|
||||||
|
|
||||||
@PostConstruct
|
|
||||||
public void init() {
|
|
||||||
I18nUtil.staticMessageSource = messageSource;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 通过code 返回对应的提示信息
|
* 通过code 返回对应的提示信息
|
||||||
*
|
*
|
||||||
@ -77,4 +71,9 @@ public class I18nUtil {
|
|||||||
|
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@PostConstruct
|
||||||
|
public void init() {
|
||||||
|
I18nUtil.staticMessageSource = messageSource;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -27,34 +27,7 @@ public class IdUtil {
|
|||||||
private long lastTimestamp = -1L;
|
private long lastTimestamp = -1L;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 雪花算法生成分布式唯一ID
|
* @param workerId 工作机器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 dataCenterId 数据中心ID
|
* @param dataCenterId 数据中心ID
|
||||||
*/
|
*/
|
||||||
public IdUtil(long workerId, long dataCenterId) {
|
public IdUtil(long workerId, long dataCenterId) {
|
||||||
@ -68,20 +41,6 @@ public class IdUtil {
|
|||||||
this.dataCenterId = dataCenterId;
|
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
|
* 自定义生成n位uuid
|
||||||
*
|
*
|
||||||
@ -116,4 +75,45 @@ public class IdUtil {
|
|||||||
return null;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -23,6 +23,35 @@ public class JChardetFacadeUtil {
|
|||||||
return null;
|
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
|
* 下面代码来自: 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, 它可以检测大多数文件的编码
|
* 以下代码开始是由Mozilla组织提供的JChardet, 它可以检测大多数文件的编码
|
||||||
* http://jchardet.sourceforge.net/
|
* 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() {
|
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 String charset();
|
||||||
|
|
||||||
public abstract int stFactor();
|
public abstract int stFactor();
|
||||||
@ -475,23 +479,19 @@ public class JChardetFacadeUtil {
|
|||||||
public abstract int[] states();
|
public abstract int[] states();
|
||||||
|
|
||||||
public abstract boolean isUCS2();
|
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 {
|
public static class nsEUCSampler {
|
||||||
int mTotal = 0;
|
|
||||||
int mThreshold = 200;
|
|
||||||
int mState = 0;
|
|
||||||
public int[] mFirstByteCnt = new int[94];
|
public int[] mFirstByteCnt = new int[94];
|
||||||
public int[] mSecondByteCnt = new int[94];
|
public int[] mSecondByteCnt = new int[94];
|
||||||
public float[] mFirstByteFreq = new float[94];
|
public float[] mFirstByteFreq = new float[94];
|
||||||
public float[] mSecondByteFreq = new float[94];
|
public float[] mSecondByteFreq = new float[94];
|
||||||
|
int mTotal = 0;
|
||||||
|
int mThreshold = 200;
|
||||||
|
int mState = 0;
|
||||||
|
|
||||||
public nsEUCSampler() {
|
public nsEUCSampler() {
|
||||||
this.Reset();
|
this.Reset();
|
||||||
@ -588,6 +588,9 @@ public class JChardetFacadeUtil {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static abstract class nsEUCStatistics {
|
public static abstract class nsEUCStatistics {
|
||||||
|
public nsEUCStatistics() {
|
||||||
|
}
|
||||||
|
|
||||||
public abstract float[] mFirstByteFreq();
|
public abstract float[] mFirstByteFreq();
|
||||||
|
|
||||||
public abstract float mFirstByteStdDev();
|
public abstract float mFirstByteStdDev();
|
||||||
@ -603,9 +606,6 @@ public class JChardetFacadeUtil {
|
|||||||
public abstract float mSecondByteMean();
|
public abstract float mSecondByteMean();
|
||||||
|
|
||||||
public abstract float mSecondByteWeight();
|
public abstract float mSecondByteWeight();
|
||||||
|
|
||||||
public nsEUCStatistics() {
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -621,6 +621,17 @@ public class JChardetFacadeUtil {
|
|||||||
static float mSecondByteMean;
|
static float mSecondByteMean;
|
||||||
static float mSecondByteWeight;
|
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() {
|
public float[] mFirstByteFreq() {
|
||||||
return mFirstByteFreq;
|
return mFirstByteFreq;
|
||||||
}
|
}
|
||||||
@ -652,17 +663,6 @@ public class JChardetFacadeUtil {
|
|||||||
public float mSecondByteWeight() {
|
public float mSecondByteWeight() {
|
||||||
return 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 int stFactor;
|
||||||
static String charset;
|
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() {
|
public nsEUCJPVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 1145324612;
|
cclass[0] = 1145324612;
|
||||||
@ -734,6 +718,22 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 6;
|
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() {
|
public boolean isUCS2() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -752,6 +752,17 @@ public class JChardetFacadeUtil {
|
|||||||
static float mSecondByteMean;
|
static float mSecondByteMean;
|
||||||
static float mSecondByteWeight;
|
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() {
|
public float[] mFirstByteFreq() {
|
||||||
return mFirstByteFreq;
|
return mFirstByteFreq;
|
||||||
}
|
}
|
||||||
@ -783,17 +794,6 @@ public class JChardetFacadeUtil {
|
|||||||
public float mSecondByteWeight() {
|
public float mSecondByteWeight() {
|
||||||
return 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 int stFactor;
|
||||||
static String charset;
|
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() {
|
public nsEUCKRVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 286331153;
|
cclass[0] = 286331153;
|
||||||
@ -862,6 +846,22 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 4;
|
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() {
|
public boolean isUCS2() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -880,6 +880,17 @@ public class JChardetFacadeUtil {
|
|||||||
static float mSecondByteMean;
|
static float mSecondByteMean;
|
||||||
static float mSecondByteWeight;
|
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() {
|
public float[] mFirstByteFreq() {
|
||||||
return mFirstByteFreq;
|
return mFirstByteFreq;
|
||||||
}
|
}
|
||||||
@ -911,17 +922,6 @@ public class JChardetFacadeUtil {
|
|||||||
public float mSecondByteWeight() {
|
public float mSecondByteWeight() {
|
||||||
return 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 int stFactor;
|
||||||
static String charset;
|
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() {
|
public nsEUCTWVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 572662306;
|
cclass[0] = 572662306;
|
||||||
@ -994,6 +978,22 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 7;
|
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() {
|
public boolean isUCS2() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1012,6 +1012,17 @@ public class JChardetFacadeUtil {
|
|||||||
static float mSecondByteMean;
|
static float mSecondByteMean;
|
||||||
static float mSecondByteWeight;
|
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() {
|
public float[] mFirstByteFreq() {
|
||||||
return mFirstByteFreq;
|
return mFirstByteFreq;
|
||||||
}
|
}
|
||||||
@ -1043,17 +1054,6 @@ public class JChardetFacadeUtil {
|
|||||||
public float mSecondByteWeight() {
|
public float mSecondByteWeight() {
|
||||||
return 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 int stFactor;
|
||||||
static String charset;
|
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() {
|
public nsBIG5Verifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 286331153;
|
cclass[0] = 286331153;
|
||||||
@ -1123,6 +1107,22 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 5;
|
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() {
|
public boolean isUCS2() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1141,6 +1141,17 @@ public class JChardetFacadeUtil {
|
|||||||
static float mSecondByteMean;
|
static float mSecondByteMean;
|
||||||
static float mSecondByteWeight;
|
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() {
|
public float[] mFirstByteFreq() {
|
||||||
return mFirstByteFreq;
|
return mFirstByteFreq;
|
||||||
}
|
}
|
||||||
@ -1172,17 +1183,6 @@ public class JChardetFacadeUtil {
|
|||||||
public float mSecondByteWeight() {
|
public float mSecondByteWeight() {
|
||||||
return 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 int stFactor;
|
||||||
static String charset;
|
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() {
|
public nsGB2312Verifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 286331153;
|
cclass[0] = 286331153;
|
||||||
@ -1251,20 +1235,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 4;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1281,6 +1251,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsGB18030Verifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 286331153;
|
cclass[0] = 286331153;
|
||||||
@ -1326,20 +1310,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 7;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1356,6 +1326,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsISO2022CNVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 2;
|
cclass[0] = 2;
|
||||||
@ -1403,20 +1387,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 9;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1433,6 +1403,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsISO2022JPVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 2;
|
cclass[0] = 2;
|
||||||
@ -1478,20 +1462,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 8;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1508,6 +1478,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsISO2022KRVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 2;
|
cclass[0] = 2;
|
||||||
@ -1552,20 +1536,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 6;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1582,6 +1552,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsUCS2BEVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 0;
|
cclass[0] = 0;
|
||||||
@ -1628,20 +1612,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 6;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1658,6 +1628,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsUCS2LEVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 0;
|
cclass[0] = 0;
|
||||||
@ -1704,20 +1688,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 6;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1734,6 +1704,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsCP1252Verifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 572662305;
|
cclass[0] = 572662305;
|
||||||
@ -1776,20 +1760,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 3;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1806,6 +1776,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsHZVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 1;
|
cclass[0] = 1;
|
||||||
@ -1851,20 +1835,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 6;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1881,6 +1851,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsSJISVerifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 286331152;
|
cclass[0] = 286331152;
|
||||||
@ -1923,20 +1907,6 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 6;
|
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() {
|
public int[] cclass() {
|
||||||
return cclass;
|
return cclass;
|
||||||
}
|
}
|
||||||
@ -1953,6 +1923,20 @@ public class JChardetFacadeUtil {
|
|||||||
return charset;
|
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() {
|
public nsUTF8Verifier() {
|
||||||
cclass = new int[32];
|
cclass = new int[32];
|
||||||
cclass[0] = 286331153;
|
cclass[0] = 286331153;
|
||||||
@ -2018,6 +2002,22 @@ public class JChardetFacadeUtil {
|
|||||||
stFactor = 16;
|
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() {
|
public boolean isUCS2() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,21 +82,22 @@ public class JsonUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 寻找节点下某特定值并替换
|
* 寻找节点下某特定值并替换
|
||||||
|
*
|
||||||
|
* @return void
|
||||||
* @author xuzimu
|
* @author xuzimu
|
||||||
* @date 2022/4/6
|
* @date 2022/4/6
|
||||||
* @return void
|
|
||||||
*/
|
*/
|
||||||
public static void flush(JSONObject jsonObject, String containsValue, StringBuilder sb, List<String> sbList) {
|
public static void flush(JSONObject jsonObject, String containsValue, StringBuilder sb, List<String> sbList) {
|
||||||
for (String key : jsonObject.keySet()) {
|
for (String key : jsonObject.keySet()) {
|
||||||
String value = jsonObject.get(key).toString();
|
String value = jsonObject.get(key).toString();
|
||||||
if(JSONUtil.isJson(value)) {
|
if (JSONUtil.isJson(value)) {
|
||||||
if (JSONUtil.isJsonArray(value)) {
|
if (JSONUtil.isJsonArray(value)) {
|
||||||
continue;
|
continue;
|
||||||
} else if (JSONUtil.isJsonObj(value)) {
|
} else if (JSONUtil.isJsonObj(value)) {
|
||||||
sb.append(".").append(key);
|
sb.append(".").append(key);
|
||||||
flush(JSONUtil.parseObj(value),containsValue,sb,sbList);
|
flush(JSONUtil.parseObj(value), containsValue, sb, sbList);
|
||||||
}
|
}
|
||||||
}else {
|
} else {
|
||||||
if (value.contains(containsValue)) {
|
if (value.contains(containsValue)) {
|
||||||
sb.append(".").append(key);
|
sb.append(".").append(key);
|
||||||
sbList.add(sb.toString());
|
sbList.add(sb.toString());
|
||||||
|
|||||||
@ -51,7 +51,7 @@ public class PositionUtil {
|
|||||||
// BigDecimal times = NumberUtil.div(BigDecimal.valueOf(3.01), 1.0).setScale(0, RoundingMode.UP);
|
// BigDecimal times = NumberUtil.div(BigDecimal.valueOf(3.01), 1.0).setScale(0, RoundingMode.UP);
|
||||||
// System.out.println(times);
|
// 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());
|
System.out.printf("%f,%f", g.getWgLon(), g.getWgLat());
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -286,7 +286,7 @@ public class PositionUtil {
|
|||||||
/**
|
/**
|
||||||
* 火星坐标系 (GCJ-02) 与百度坐标系 (BD-09) 的转换算法 将 GCJ-02 坐标转换成 BD-09 坐标
|
* 火星坐标系 (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 x = lng, y = lat;
|
||||||
double z = Math.sqrt(x * x + y * y) + 0.00002 * Math.sin(y * pi);
|
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);
|
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 坐标
|
* 火星坐标系 (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 x = lng - 0.0065, y = lat - 0.006;
|
||||||
double z = Math.sqrt(x * x + y * y) - 0.00002 * Math.sin(y * pi);
|
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);
|
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 坐标
|
* 地球坐标系 (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)) {
|
if (outOfChina(lat, lon)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@ -330,14 +330,14 @@ public class PositionUtil {
|
|||||||
/**
|
/**
|
||||||
* 地球坐标系 (WGS84) 与火星坐标系 (GCJ-02) 的转换算法 将 GCJ-02 坐标转换成 WGS84 坐标
|
* 地球坐标系 (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);
|
GpsDTO gps = transform(lat, lng);
|
||||||
double lontitude = lng * 2 - gps.getWgLon();
|
double lontitude = lng * 2 - gps.getWgLon();
|
||||||
double latitude = lat * 2 - gps.getWgLat();
|
double latitude = lat * 2 - gps.getWgLat();
|
||||||
return new GpsDTO(latitude, lontitude);
|
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);
|
if (outOfChina(lat, lng)) return new GpsDTO(lat, lng);
|
||||||
double dLat = transformLat(lng - 105.0, lat - 35.0);
|
double dLat = transformLat(lng - 105.0, lat - 35.0);
|
||||||
double dLon = transformLon(lng - 105.0, lat - 35.0);
|
double dLon = transformLon(lng - 105.0, lat - 35.0);
|
||||||
|
|||||||
@ -6,6 +6,7 @@ public class RegexUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断给定的字符串是否符合时间格式 HH:mm。
|
* 判断给定的字符串是否符合时间格式 HH:mm。
|
||||||
|
*
|
||||||
* @param timeStr 给定的时间字符串,格式为 HH:mm。
|
* @param timeStr 给定的时间字符串,格式为 HH:mm。
|
||||||
* @return 如果给定的字符串符合时间格式,则返回 true;否则返回 false。
|
* @return 如果给定的字符串符合时间格式,则返回 true;否则返回 false。
|
||||||
*/
|
*/
|
||||||
@ -16,6 +17,7 @@ public class RegexUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断给出的时间是否在当前时间范围内
|
* 判断给出的时间是否在当前时间范围内
|
||||||
|
*
|
||||||
* @param start
|
* @param start
|
||||||
* @param end
|
* @param end
|
||||||
* @return
|
* @return
|
||||||
@ -27,6 +29,7 @@ public class RegexUtil {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 判断给出的时间是否不在当前时间范围内
|
* 判断给出的时间是否不在当前时间范围内
|
||||||
|
*
|
||||||
* @param start
|
* @param start
|
||||||
* @param end
|
* @param end
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package com.suisung.mall.common.utils;
|
package com.suisung.mall.common.utils;
|
||||||
|
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
@ -24,10 +23,6 @@ import java.util.regex.Pattern;
|
|||||||
*/
|
*/
|
||||||
public final class StringUtils extends org.apache.commons.lang3.StringUtils {
|
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 Random RANDOM = new Random();
|
||||||
private static final Logger logger = LoggerFactory.getLogger(StringUtils.class);
|
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) {
|
public static String encode(String str) {
|
||||||
String encode = null;
|
String encode = null;
|
||||||
try {
|
try {
|
||||||
@ -226,6 +225,7 @@ public final class StringUtils extends org.apache.commons.lang3.StringUtils {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 全地址去除省市区,保留详细地址
|
* 全地址去除省市区,保留详细地址
|
||||||
|
*
|
||||||
* @param fullAddress 比如:广西壮族自治区贵港市桂平市西山镇新安街粤桂花城1102号 -> 西山镇新安街粤桂花城1102号
|
* @param fullAddress 比如:广西壮族自治区贵港市桂平市西山镇新安街粤桂花城1102号 -> 西山镇新安街粤桂花城1102号
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
|
|
||||||
package com.suisung.mall.common.utils;
|
package com.suisung.mall.common.utils;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonInclude;
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
||||||
|
|||||||
@ -75,8 +75,8 @@ public class UserInfoService {
|
|||||||
if (user == null) {
|
if (user == null) {
|
||||||
return null;
|
return null;
|
||||||
} else {
|
} else {
|
||||||
Integer userId = user.getId() ;
|
Integer userId = user.getId();
|
||||||
Integer siteId = user.getSite_id() ;
|
Integer siteId = user.getSite_id();
|
||||||
Integer storeId = Convert.toInt(user.getStore_id());
|
Integer storeId = Convert.toInt(user.getStore_id());
|
||||||
Integer chainId = Convert.toInt(user.getChain_id());
|
Integer chainId = Convert.toInt(user.getChain_id());
|
||||||
|
|
||||||
|
|||||||
@ -12,8 +12,6 @@ import java.util.concurrent.TimeUnit;
|
|||||||
|
|
||||||
public class VideoUtil {
|
public class VideoUtil {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(VideoUtil.class);
|
|
||||||
|
|
||||||
public static List<String> videoAllowFiles = new ArrayList<String>() {{
|
public static List<String> videoAllowFiles = new ArrayList<String>() {{
|
||||||
add("flv");
|
add("flv");
|
||||||
add("swf");
|
add("swf");
|
||||||
@ -33,6 +31,7 @@ public class VideoUtil {
|
|||||||
add("wav");
|
add("wav");
|
||||||
add("mid");
|
add("mid");
|
||||||
}};
|
}};
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(VideoUtil.class);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 得到语音或视频文件时长,单位秒 并格式化
|
* 得到语音或视频文件时长,单位秒 并格式化
|
||||||
|
|||||||
@ -22,86 +22,75 @@ import java.util.Map;
|
|||||||
@Component
|
@Component
|
||||||
public class WxHttpUtil implements ApplicationContextAware {
|
public class WxHttpUtil implements ApplicationContextAware {
|
||||||
|
|
||||||
private static ApplicationContext applicationContext;
|
|
||||||
|
|
||||||
private static AccountService accountService;
|
|
||||||
|
|
||||||
private static final int MAX_RETRIES = 3; // 最大重试次数
|
private static final int MAX_RETRIES = 3; // 最大重试次数
|
||||||
|
|
||||||
private static final int RETRY_DELAY_MS = 1000; // 重试延迟毫秒数
|
private static final int RETRY_DELAY_MS = 1000; // 重试延迟毫秒数
|
||||||
|
private static ApplicationContext applicationContext;
|
||||||
|
private static AccountService accountService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 封装统一请求,获取token失败后触发重试机制
|
* 封装统一请求,获取token失败后触发重试机制
|
||||||
|
*
|
||||||
* @param methodType 请求方式 (ENUM):GET; POST;
|
* @param methodType 请求方式 (ENUM):GET; POST;
|
||||||
* @param wxType 微信类型 (ENUM):MP-公众号; XCX-小程序;
|
* @param wxType 微信类型 (ENUM):MP-公众号; XCX-小程序;
|
||||||
* @param token 微信 AccessToken
|
* @param token 微信 AccessToken
|
||||||
* @param url 请求地址
|
* @param url 请求地址
|
||||||
* @param params 请求参数 接收Map类型
|
* @param params 请求参数 接收Map类型
|
||||||
* @param params 请求参数 接收字符串类型
|
* @param params 请求参数 接收字符串类型
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public static String request(MethodType methodType, WxType wxType, String token, String url, Map<String, Object> params, String paramStr) {
|
public static String request(MethodType methodType, WxType wxType, String token, String url, Map<String, Object> params, String paramStr) {
|
||||||
accountService = applicationContext.getBean(AccountService.class);
|
accountService = applicationContext.getBean(AccountService.class);
|
||||||
int retries = 0;
|
int retries = 0;
|
||||||
String result = null;
|
String result = null;
|
||||||
while (retries < MAX_RETRIES) {
|
while (retries < MAX_RETRIES) {
|
||||||
try {
|
try {
|
||||||
if (methodType.equals(MethodType.GET)) {
|
if (methodType.equals(MethodType.GET)) {
|
||||||
result = HttpUtil.get(url);
|
result = HttpUtil.get(url);
|
||||||
} else if (methodType.equals(MethodType.POST)) {
|
} else if (methodType.equals(MethodType.POST)) {
|
||||||
|
|
||||||
if (StrUtil.isNotEmpty(paramStr) && CollUtil.isNotEmpty(params)) {
|
if (StrUtil.isNotEmpty(paramStr) && CollUtil.isNotEmpty(params)) {
|
||||||
throw new ApiException(I18nUtil._("传递参数有误!"));
|
throw new ApiException(I18nUtil._("传递参数有误!"));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StrUtil.isNotEmpty(paramStr)) {
|
if (StrUtil.isNotEmpty(paramStr)) {
|
||||||
result = HttpUtil.post(url, paramStr);
|
result = HttpUtil.post(url, paramStr);
|
||||||
} else if (CollUtil.isNotEmpty(params)) {
|
} else if (CollUtil.isNotEmpty(params)) {
|
||||||
result = HttpUtil.post(url, params);
|
result = HttpUtil.post(url, params);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
JSONObject jsonObject = JSONUtil.parseObj(result);
|
JSONObject jsonObject = JSONUtil.parseObj(result);
|
||||||
Integer errcode = Convert.toInt(jsonObject.get("errcode"));
|
Integer errcode = Convert.toInt(jsonObject.get("errcode"));
|
||||||
if (errcode.equals(40001)) {
|
if (errcode.equals(40001)) {
|
||||||
String tempToken = null;
|
String tempToken = null;
|
||||||
if (wxType.equals(WxType.MP)) {
|
if (wxType.equals(WxType.MP)) {
|
||||||
tempToken = accountService.getMpAccessToken(false);
|
tempToken = accountService.getMpAccessToken(false);
|
||||||
} else if (wxType.equals(WxType.XCX)) {
|
} else if (wxType.equals(WxType.XCX)) {
|
||||||
tempToken = accountService.getXcxAccessToken(false);
|
tempToken = accountService.getXcxAccessToken(false);
|
||||||
}
|
}
|
||||||
url = url.replace(token, tempToken);
|
url = url.replace(token, tempToken);
|
||||||
token = tempToken;
|
token = tempToken;
|
||||||
retries++;
|
retries++;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
retries++;
|
retries++;
|
||||||
if (retries == MAX_RETRIES) {
|
if (retries == MAX_RETRIES) {
|
||||||
// 最后一次重试失败则抛出异常
|
// 最后一次重试失败则抛出异常
|
||||||
throw new ApiException(I18nUtil._("已达到最大重试次数!"));
|
throw new ApiException(I18nUtil._("已达到最大重试次数!"));
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Thread.sleep(RETRY_DELAY_MS);
|
Thread.sleep(RETRY_DELAY_MS);
|
||||||
} catch (InterruptedException ex) {
|
} catch (InterruptedException ex) {
|
||||||
Thread.currentThread().interrupt();
|
Thread.currentThread().interrupt();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public static ApplicationContext getApplicationContext() {
|
||||||
* 定义请求方式
|
return applicationContext;
|
||||||
*/
|
|
||||||
public enum MethodType {
|
|
||||||
GET,
|
|
||||||
POST,
|
|
||||||
}
|
|
||||||
|
|
||||||
public enum WxType {
|
|
||||||
MP,
|
|
||||||
XCX,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -111,10 +100,6 @@ public class WxHttpUtil implements ApplicationContextAware {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ApplicationContext getApplicationContext() {
|
|
||||||
return applicationContext;
|
|
||||||
}
|
|
||||||
|
|
||||||
//通过name获取 Bean.
|
//通过name获取 Bean.
|
||||||
public static Object getBean(String name) {
|
public static Object getBean(String name) {
|
||||||
return getApplicationContext().getBean(name);
|
return getApplicationContext().getBean(name);
|
||||||
@ -130,4 +115,17 @@ public class WxHttpUtil implements ApplicationContextAware {
|
|||||||
return getApplicationContext().getBean(name, clazz);
|
return getApplicationContext().getBean(name, clazz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义请求方式
|
||||||
|
*/
|
||||||
|
public enum MethodType {
|
||||||
|
GET,
|
||||||
|
POST,
|
||||||
|
}
|
||||||
|
|
||||||
|
public enum WxType {
|
||||||
|
MP,
|
||||||
|
XCX,
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -25,14 +25,6 @@ public class MCipherDecode {
|
|||||||
encryptKey = key.substring(0, 8);
|
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 {
|
private static byte[] getSrcBytes(byte[] srcBytes, byte[] wrapKey) throws NoSuchAlgorithmException, NoSuchPaddingException, InvalidKeyException, ShortBufferException, IllegalBlockSizeException, BadPaddingException, NoSuchProviderException, InvalidAlgorithmParameterException {
|
||||||
SecretKeySpec key = new SecretKeySpec(wrapKey, "DES");
|
SecretKeySpec key = new SecretKeySpec(wrapKey, "DES");
|
||||||
|
|
||||||
@ -46,7 +38,6 @@ public class MCipherDecode {
|
|||||||
return cipherText;
|
return cipherText;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public static byte[] DecodeBase64String(String base64Src) throws IOException {
|
public static byte[] DecodeBase64String(String base64Src) throws IOException {
|
||||||
Base64.Decoder de = Base64.getDecoder();
|
Base64.Decoder de = Base64.getDecoder();
|
||||||
byte[] base64Result = de.decode(base64Src);
|
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) {
|
public static void main(String[] agrs) {
|
||||||
String key = "f6528d5c335b7092fc9ec1b3020111";
|
String key = "f6528d5c335b7092fc9ec1b3020111";
|
||||||
String str = "梅九六|6214662020019275";
|
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");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,7 +88,7 @@ public class RSAUtil {
|
|||||||
* @return 密文
|
* @return 密文
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static String encrypt(String dataStr, String publicKeyStr){
|
public static String encrypt(String dataStr, String publicKeyStr) {
|
||||||
ByteArrayOutputStream out = null;
|
ByteArrayOutputStream out = null;
|
||||||
String encodedDataStr = null;
|
String encodedDataStr = null;
|
||||||
try {
|
try {
|
||||||
@ -131,12 +131,12 @@ public class RSAUtil {
|
|||||||
* Method: encrypt <br/>
|
* Method: encrypt <br/>
|
||||||
* description: 私钥分段解密 <br/>
|
* description: 私钥分段解密 <br/>
|
||||||
*
|
*
|
||||||
* @param dataStr 解密内容,密文
|
* @param dataStr 解密内容,密文
|
||||||
* @param PrivateKey 私钥
|
* @param PrivateKey 私钥
|
||||||
* @return 明文
|
* @return 明文
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
*/
|
*/
|
||||||
public static String decrypt(String dataStr, String PrivateKey){
|
public static String decrypt(String dataStr, String PrivateKey) {
|
||||||
ByteArrayOutputStream out = null;
|
ByteArrayOutputStream out = null;
|
||||||
String decodedDataStr = null;
|
String decodedDataStr = null;
|
||||||
try {
|
try {
|
||||||
|
|||||||
@ -25,11 +25,10 @@ import java.util.regex.Pattern;
|
|||||||
public class ExcelUtil {
|
public class ExcelUtil {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
|
||||||
* @param response
|
* @param response
|
||||||
* @param classInst 类实例
|
* @param classInst 类实例
|
||||||
* @param reportName 文件名称
|
* @param reportName 文件名称
|
||||||
* @param data 需要导出的数据
|
* @param data 需要导出的数据
|
||||||
* @throws InstantiationException
|
* @throws InstantiationException
|
||||||
* @throws IllegalAccessException
|
* @throws IllegalAccessException
|
||||||
* @throws IOException
|
* @throws IOException
|
||||||
|
|||||||
@ -21,6 +21,7 @@ public class ExportFactory {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取实例类
|
* 获取实例类
|
||||||
|
*
|
||||||
* @param classKey
|
* @param classKey
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -35,13 +35,11 @@ import java.util.Map;
|
|||||||
@Order(0)
|
@Order(0)
|
||||||
public class ControllerLogAspect {
|
public class ControllerLogAspect {
|
||||||
|
|
||||||
|
private final static int max_str_length = 1000;
|
||||||
/**
|
/**
|
||||||
* 日志对象
|
* 日志对象
|
||||||
*/
|
*/
|
||||||
private final Logger logger = LoggerFactory.getLogger("LOG_STASH_RECORD");
|
private final Logger logger = LoggerFactory.getLogger("LOG_STASH_RECORD");
|
||||||
|
|
||||||
private final static int max_str_length = 1000;
|
|
||||||
|
|
||||||
@Autowired
|
@Autowired
|
||||||
private MessageService messageService;
|
private MessageService messageService;
|
||||||
|
|
||||||
@ -161,7 +159,7 @@ public class ControllerLogAspect {
|
|||||||
Map<String, String> access_map = new HashMap<String, String>();
|
Map<String, String> access_map = new HashMap<String, String>();
|
||||||
|
|
||||||
for (String key : parameterMap.keySet()) {
|
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("new_pay_password")
|
||||||
&& !parameterMap.containsKey("pay_password")
|
&& !parameterMap.containsKey("pay_password")
|
||||||
&& !parameterMap.containsKey("password")
|
&& !parameterMap.containsKey("password")
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.suisung.mall.common.weblog;
|
|||||||
import java.lang.annotation.*;
|
import java.lang.annotation.*;
|
||||||
|
|
||||||
@Documented
|
@Documented
|
||||||
@Target({ElementType.METHOD,ElementType.TYPE})
|
@Target({ElementType.METHOD, ElementType.TYPE})
|
||||||
@Retention(RetentionPolicy.RUNTIME)
|
@Retention(RetentionPolicy.RUNTIME)
|
||||||
public @interface IgnoreLog {
|
public @interface IgnoreLog {
|
||||||
|
|
||||||
|
|||||||
@ -10,7 +10,7 @@ public class PhoneNumberUtilsTest {
|
|||||||
* PhoneNumberUtils.getPhoneModelWithCountry(String)
|
* PhoneNumberUtils.getPhoneModelWithCountry(String)
|
||||||
* 手机号信息提取方法测试
|
* 手机号信息提取方法测试
|
||||||
* 输出参考 {@link PhoneModel}
|
* 输出参考 {@link PhoneModel}
|
||||||
*
|
* <p>
|
||||||
* input: +8617865933672
|
* input: +8617865933672
|
||||||
* output: PhoneModel(countryName=中国, provinceName=null, cityName=null, carrier=null, countryCode=86, nationalNumber=17865933672)
|
* output: PhoneModel(countryName=中国, provinceName=null, cityName=null, carrier=null, countryCode=86, nationalNumber=17865933672)
|
||||||
*/
|
*/
|
||||||
@ -25,7 +25,7 @@ public class PhoneNumberUtilsTest {
|
|||||||
/**
|
/**
|
||||||
* PhoneNumberUtils.isValidNumber(String)
|
* PhoneNumberUtils.isValidNumber(String)
|
||||||
* 手机号合法检测方法测试
|
* 手机号合法检测方法测试
|
||||||
*
|
* <p>
|
||||||
* input: +8617865933672
|
* input: +8617865933672
|
||||||
* output: true
|
* output: true
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -18,6 +18,7 @@ import org.springframework.web.bind.annotation.RequestParam;
|
|||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
@ -42,7 +43,7 @@ public class ShopOrderLogisticsController {
|
|||||||
long num = invoicingStockBillService.count(new QueryWrapper<InvoicingStockBill>().eq("order_id", orderLogistics.getOrder_id()));
|
long num = invoicingStockBillService.count(new QueryWrapper<InvoicingStockBill>().eq("order_id", orderLogistics.getOrder_id()));
|
||||||
|
|
||||||
if (num <= 0) {
|
if (num <= 0) {
|
||||||
List<String> orderIds = Arrays.asList(orderLogistics.getOrder_id());
|
List<String> orderIds = Collections.singletonList(orderLogistics.getOrder_id());
|
||||||
boolean b = shopOrderBaseService.reviewToState(orderIds, null, StateCode.ORDER_STATE_SHIPPED, orderLogistics);
|
boolean b = shopOrderBaseService.reviewToState(orderIds, null, StateCode.ORDER_STATE_SHIPPED, orderLogistics);
|
||||||
|
|
||||||
if (b) {
|
if (b) {
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import java.io.OutputStream;
|
|||||||
@RequestMapping("/mobile/shop/qrcode")
|
@RequestMapping("/mobile/shop/qrcode")
|
||||||
public class QrcodeController extends BaseControllerImpl {
|
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 = "根据提货码获取二维码")
|
@ApiOperation(value = "根据提货码获取二维码", notes = "根据提货码获取二维码")
|
||||||
@RequestMapping(value = "/getQrcode", method = RequestMethod.GET)
|
@RequestMapping(value = "/getQrcode", method = RequestMethod.GET)
|
||||||
|
|||||||
@ -17,14 +17,14 @@ import java.util.ArrayList;
|
|||||||
*/
|
*/
|
||||||
public class PurchaseInvoiceTempListener extends AnalysisEventListener<PurchaseInvoiceTemp> {
|
public class PurchaseInvoiceTempListener extends AnalysisEventListener<PurchaseInvoiceTemp> {
|
||||||
|
|
||||||
private ArrayList<ShopPurchaseInvoice> list = new ArrayList<>();
|
|
||||||
|
|
||||||
public static ShopPurchaseInvoiceService shopPurchaseInvoiceService;
|
public static ShopPurchaseInvoiceService shopPurchaseInvoiceService;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
initDictionary();
|
initDictionary();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final ArrayList<ShopPurchaseInvoice> list = new ArrayList<>();
|
||||||
|
|
||||||
static void initDictionary() {
|
static void initDictionary() {
|
||||||
shopPurchaseInvoiceService = SpringUtil.getBean(ShopPurchaseInvoiceService.class);
|
shopPurchaseInvoiceService = SpringUtil.getBean(ShopPurchaseInvoiceService.class);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -28,7 +28,7 @@ public class MessageListener {
|
|||||||
String messageId = message.getMessageProperties().getMessageId();
|
String messageId = message.getMessageProperties().getMessageId();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
log.debug("消息监听到:{} ### {}",messageId, msgTO);
|
log.debug("消息监听到:{} ### {}", messageId, msgTO);
|
||||||
boolean flag = messageService.sendNoticeMsg(msgTO.getUser_id(), msgTO.getStore_id(), msgTO.getMessage_id(), msgTO.getArgs());
|
boolean flag = messageService.sendNoticeMsg(msgTO.getUser_id(), msgTO.getStore_id(), msgTO.getMessage_id(), msgTO.getArgs());
|
||||||
if (flag) {
|
if (flag) {
|
||||||
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
channel.basicAck(message.getMessageProperties().getDeliveryTag(), false);
|
||||||
|
|||||||
@ -5,11 +5,9 @@ import com.rabbitmq.client.Channel;
|
|||||||
import com.suisung.mall.common.api.StateCode;
|
import com.suisung.mall.common.api.StateCode;
|
||||||
import com.suisung.mall.common.constant.MqConstant;
|
import com.suisung.mall.common.constant.MqConstant;
|
||||||
import com.suisung.mall.common.modules.order.ShopOrderInfo;
|
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.ShopOrderBaseService;
|
||||||
import com.suisung.mall.shop.order.service.ShopOrderInfoService;
|
import com.suisung.mall.shop.order.service.ShopOrderInfoService;
|
||||||
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStorePrinterService;
|
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
@ -38,7 +36,7 @@ public class OrderPayedListener {
|
|||||||
private ShopOrderBaseService shopOrderBaseService;
|
private ShopOrderBaseService shopOrderBaseService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ShopOrderInfoService shopOrderInfoService;
|
private ShopOrderInfoService shopOrderInfoService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private ShopStorePrinterService shopStorePrinterService;
|
// private ShopStorePrinterService shopStorePrinterService;
|
||||||
// @Autowired
|
// @Autowired
|
||||||
// private MqMessageService mqMessageService;
|
// private MqMessageService mqMessageService;
|
||||||
@ -90,7 +88,7 @@ public class OrderPayedListener {
|
|||||||
if (flag) {
|
if (flag) {
|
||||||
// TODO 以下仅处理下单打印的情况,还需要处理退单打印分支。
|
// TODO 以下仅处理下单打印的情况,还需要处理退单打印分支。
|
||||||
|
|
||||||
// 原始状态 2010-待付款;2011--待订单审核;2013-待财务审核 变成 2020-待配货;2016-已经付款 的时候
|
// 原始状态 2010-待付款;2011--待订单审核;2013-待财务审核 变成 2020-待配货;2016-已经付款 的时候
|
||||||
// 生成取单号,打票机打印订单,向顺丰同城下单
|
// 生成取单号,打票机打印订单,向顺丰同城下单
|
||||||
if (order_state_id == StateCode.ORDER_STATE_WAIT_PAY
|
if (order_state_id == StateCode.ORDER_STATE_WAIT_PAY
|
||||||
|| order_state_id == StateCode.ORDER_STATE_WAIT_REVIEW
|
|| order_state_id == StateCode.ORDER_STATE_WAIT_REVIEW
|
||||||
|
|||||||
@ -52,6 +52,7 @@ public interface ShopOrderBaseMapper extends BaseMapper<ShopOrderBase> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取已付款订单的打印信息(用于渲染打票机模版)
|
* 获取已付款订单的打印信息(用于渲染打票机模版)
|
||||||
|
*
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @param payState
|
* @param payState
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -29,6 +29,7 @@ public interface ShopOrderItemMapper extends BaseMapper<ShopOrderItem> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单Id 获取订单子项的打印信息
|
* 根据订单Id 获取订单子项的打印信息
|
||||||
|
*
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -523,10 +523,11 @@ public interface ShopOrderBaseService extends IBaseService<ShopOrderBase> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单Id,生成顺丰同城的订单实体实例
|
* 根据订单Id,生成顺丰同城的订单实体实例
|
||||||
|
*
|
||||||
* @param devId
|
* @param devId
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @param orderPickupNum
|
* @param orderPickupNum
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
SFCreateOrderReq buildSFOrderData(Integer devId,String orderId, Long orderPickupNum);
|
SFCreateOrderReq buildSFOrderData(Integer devId, String orderId, Long orderPickupNum);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
package com.suisung.mall.shop.order.service;
|
package com.suisung.mall.shop.order.service;
|
||||||
|
|
||||||
import com.suisung.mall.common.modules.order.ShopOrderDeliveryAddress;
|
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.common.pojo.dto.StandardAddressDTO;
|
||||||
import com.suisung.mall.core.web.service.IBaseService;
|
import com.suisung.mall.core.web.service.IBaseService;
|
||||||
import org.springframework.data.util.Pair;
|
import org.springframework.data.util.Pair;
|
||||||
@ -17,6 +16,7 @@ import org.springframework.data.util.Pair;
|
|||||||
public interface ShopOrderDeliveryAddressService extends IBaseService<ShopOrderDeliveryAddress> {
|
public interface ShopOrderDeliveryAddressService extends IBaseService<ShopOrderDeliveryAddress> {
|
||||||
/**
|
/**
|
||||||
* 根据订单ID获取订单发货地址
|
* 根据订单ID获取订单发货地址
|
||||||
|
*
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -24,6 +24,7 @@ public interface ShopOrderDeliveryAddressService extends IBaseService<ShopOrderD
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检测地址是否有效,返回规范全地址
|
* 检测地址是否有效,返回规范全地址
|
||||||
|
*
|
||||||
* @param shopOrderDeliveryAddress
|
* @param shopOrderDeliveryAddress
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -26,6 +26,7 @@ public interface ShopOrderInfoService extends IBaseService<ShopOrderInfo> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取店铺今日的取货单
|
* 获取店铺今日的取货单
|
||||||
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -34,16 +35,18 @@ public interface ShopOrderInfoService extends IBaseService<ShopOrderInfo> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 更改商家订单的状态,出库状态,发货状态,并写入订单状态更改日志
|
* 更改商家订单的状态,出库状态,发货状态,并写入订单状态更改日志
|
||||||
|
*
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @param orderStatus 约定0值不更改
|
* @param orderStatus 约定0值不更改
|
||||||
* @param orderIsOutStatus 出库状态,约定0值不更改
|
* @param orderIsOutStatus 出库状态,约定0值不更改
|
||||||
* @param orderIsShippedStatus 发货状态,约定0值不更改
|
* @param orderIsShippedStatus 发货状态,约定0值不更改
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
Boolean changeOrderStatus(String orderId, Integer orderStatus,Integer orderIsOutStatus, Integer orderIsShippedStatus);
|
Boolean changeOrderStatus(String orderId, Integer orderStatus, Integer orderIsOutStatus, Integer orderIsShippedStatus);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 已支付的订单,生成取单号,打票机并打印订单
|
* 已支付的订单,生成取单号,打票机并打印订单
|
||||||
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @return 取货单号
|
* @return 取货单号
|
||||||
|
|||||||
@ -26,6 +26,7 @@ public interface ShopOrderItemService extends IBaseService<ShopOrderItem> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据订单Id 获取订单子项的打印信息
|
* 根据订单Id 获取订单子项的打印信息
|
||||||
|
*
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -120,7 +120,7 @@ public interface ShopOrderReturnService extends IBaseService<ShopOrderReturn> {
|
|||||||
* @param shopProductIndex
|
* @param shopProductIndex
|
||||||
* @return
|
* @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<ShopOrderReturn> {
|
|||||||
* @param order_item_id
|
* @param order_item_id
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public boolean ifDenyReturn(Long order_item_id);
|
boolean ifDenyReturn(Long order_item_id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 添加退款退货-整单退货
|
* 添加退款退货-整单退货
|
||||||
|
|||||||
@ -284,7 +284,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
|||||||
@Resource
|
@Resource
|
||||||
private ShopMessageTemplateService shopMessageTemplateService;
|
private ShopMessageTemplateService shopMessageTemplateService;
|
||||||
@Resource
|
@Resource
|
||||||
private ShopStoreSfOrderService shopStoreSfOrderService;
|
private ShopStoreSfOrderService shopStoreSfOrderService;
|
||||||
|
|
||||||
|
|
||||||
@Value("${sf-express.enable}")
|
@Value("${sf-express.enable}")
|
||||||
@ -965,10 +965,10 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
|||||||
base_row.put("delivery_time_name", delivery_time == null || index != -1 ? I18nUtil._("正常配送") : delivery_time_name);
|
base_row.put("delivery_time_name", delivery_time == null || index != -1 ? I18nUtil._("正常配送") : delivery_time_name);
|
||||||
|
|
||||||
// 顺丰同城的订单信息
|
// 顺丰同城的订单信息
|
||||||
if(!is_virtual && base_row.get("delivery_type_id")!=null && Convert.toInt(base_row.get("delivery_type_id")).equals(StateCode.DELIVERY_TYPE_SAME_CITY)){
|
if (!is_virtual && base_row.get("delivery_type_id") != null && Convert.toInt(base_row.get("delivery_type_id")).equals(StateCode.DELIVERY_TYPE_SAME_CITY)) {
|
||||||
// 非虚拟商品,如果是顺丰同城配送的,返回顺丰的订单Id
|
// 非虚拟商品,如果是顺丰同城配送的,返回顺丰的订单Id
|
||||||
ShopStoreSfOrder shopStoreSfOrder = shopStoreSfOrderService.getByShopOrderId(order_id);
|
ShopStoreSfOrder shopStoreSfOrder = shopStoreSfOrderService.getByShopOrderId(order_id);
|
||||||
if(shopStoreSfOrder!=null){
|
if (shopStoreSfOrder != null) {
|
||||||
base_row.put("sf_order_id", shopStoreSfOrder.getSf_order_id());
|
base_row.put("sf_order_id", shopStoreSfOrder.getSf_order_id());
|
||||||
base_row.put("sf_bill_id", shopStoreSfOrder.getSf_bill_id());
|
base_row.put("sf_bill_id", shopStoreSfOrder.getSf_bill_id());
|
||||||
base_row.put("sf_order_status", shopStoreSfOrder.getOrder_status());
|
base_row.put("sf_order_status", shopStoreSfOrder.getOrder_status());
|
||||||
@ -1265,7 +1265,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
|||||||
Map checkout_row = new HashMap();
|
Map checkout_row = new HashMap();
|
||||||
// 配送方式:5-门店自提;10-普通快递;16-同城配送;
|
// 配送方式:5-门店自提;10-普通快递;16-同城配送;
|
||||||
Integer delivery_type_id = getParameter("delivery_type_id", StateCode.DELIVERY_TYPE_SAME_CITY);
|
Integer delivery_type_id = getParameter("delivery_type_id", StateCode.DELIVERY_TYPE_SAME_CITY);
|
||||||
logger.debug("提交订单时,配送方式 delivery_type_id:{}",delivery_type_id);
|
logger.debug("提交订单时,配送方式 delivery_type_id:{}", delivery_type_id);
|
||||||
|
|
||||||
if (getParameter("checkout_row") == null) {
|
if (getParameter("checkout_row") == null) {
|
||||||
Date cur_date = new Date();
|
Date cur_date = new Date();
|
||||||
@ -3076,10 +3076,10 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
|||||||
if (bind_row == null || bind_row.get("bind_id") == null) {
|
if (bind_row == null || bind_row.get("bind_id") == null) {
|
||||||
// 补偿手机号码
|
// 补偿手机号码
|
||||||
AccountUserInfo accountUserInfo = accountService.getUserInfo(userId);
|
AccountUserInfo accountUserInfo = accountService.getUserInfo(userId);
|
||||||
if(accountUserInfo!=null && StrUtil.isNotBlank(accountUserInfo.getUser_mobile()) ){
|
if (accountUserInfo != null && StrUtil.isNotBlank(accountUserInfo.getUser_mobile())) {
|
||||||
mobile = accountUserInfo.getUser_mobile();
|
mobile = accountUserInfo.getUser_mobile();
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
mobile = bind_row.get("bind_id").toString();
|
mobile = bind_row.get("bind_id").toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7711,6 +7711,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据条件获取用户的订单列表
|
* 根据条件获取用户的订单列表
|
||||||
|
*
|
||||||
* @param params
|
* @param params
|
||||||
* @param page
|
* @param page
|
||||||
* @param rows
|
* @param rows
|
||||||
@ -8316,7 +8317,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
|||||||
// 配送时间= 支付时间+25分钟
|
// 配送时间= 支付时间+25分钟
|
||||||
m.put("delivery_time", DateUtil.offsetMinute((Date) m.get("payment_time"), 25));
|
m.put("delivery_time", DateUtil.offsetMinute((Date) m.get("payment_time"), 25));
|
||||||
// 配送方式
|
// 配送方式
|
||||||
String deliveryTypeName = StateCode.DELIVERY_TYPE_MAP.getOrDefault(m.getOrDefault("delivery_type_id",StateCode.DELIVERY_TYPE_SAME_CITY),"普通快递");
|
String deliveryTypeName = StateCode.DELIVERY_TYPE_MAP.getOrDefault(m.getOrDefault("delivery_type_id", StateCode.DELIVERY_TYPE_SAME_CITY), "普通快递");
|
||||||
m.put("delivery_type_name", deliveryTypeName);
|
m.put("delivery_type_name", deliveryTypeName);
|
||||||
|
|
||||||
// 预留字段
|
// 预留字段
|
||||||
@ -8380,7 +8381,7 @@ public class ShopOrderBaseServiceImpl extends BaseServiceImpl<ShopOrderBaseMappe
|
|||||||
if (enable_sf_express.equals(CommonConstant.Enable)) {//开启正式配送服务的时候
|
if (enable_sf_express.equals(CommonConstant.Enable)) {//开启正式配送服务的时候
|
||||||
// 顺丰同城业务员给的店铺id
|
// 顺丰同城业务员给的店铺id
|
||||||
shopId = shopStoreSameCityTransportBase.getShop_id();
|
shopId = shopStoreSameCityTransportBase.getShop_id();
|
||||||
if(StrUtil.isBlank(shopId)){
|
if (StrUtil.isBlank(shopId)) {
|
||||||
logger.error("请联系站长配置顺丰同城店铺ID!");
|
logger.error("请联系站长配置顺丰同城店铺ID!");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -29,10 +29,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.Arrays;
|
import java.util.*;
|
||||||
import java.util.Date;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -86,7 +83,7 @@ public class ShopOrderChainCodeServiceImpl extends BaseServiceImpl<ShopOrderChai
|
|||||||
throw new ApiException(I18nUtil._("提货已被冻结!"));
|
throw new ApiException(I18nUtil._("提货已被冻结!"));
|
||||||
} else {
|
} else {
|
||||||
if (ObjectUtil.equal(order_chain_code, chain_code)) {
|
if (ObjectUtil.equal(order_chain_code, chain_code)) {
|
||||||
shopOrderBaseService.reviewPickUp(Arrays.asList(order_id), null, StateCode.ORDER_STATE_SHIPPED, null);
|
shopOrderBaseService.reviewPickUp(Collections.singletonList(order_id), null, StateCode.ORDER_STATE_SHIPPED, null);
|
||||||
// 根据订单编号获取商品id
|
// 根据订单编号获取商品id
|
||||||
QueryWrapper<ShopOrderItem> itemQueryWrapper = new QueryWrapper<>();
|
QueryWrapper<ShopOrderItem> itemQueryWrapper = new QueryWrapper<>();
|
||||||
itemQueryWrapper.in("order_id", order_id);
|
itemQueryWrapper.in("order_id", order_id);
|
||||||
|
|||||||
@ -29,7 +29,7 @@ public class ShopOrderDeliveryAddressServiceImpl extends BaseServiceImpl<ShopOrd
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public ShopOrderDeliveryAddress selectByOrderId(String orderId) {
|
public ShopOrderDeliveryAddress selectByOrderId(String orderId) {
|
||||||
if(StrUtil.isBlank(orderId)){
|
if (StrUtil.isBlank(orderId)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -49,26 +49,26 @@ public class ShopOrderDeliveryAddressServiceImpl extends BaseServiceImpl<ShopOrd
|
|||||||
}
|
}
|
||||||
|
|
||||||
StringBuffer sb = new StringBuffer();
|
StringBuffer sb = new StringBuffer();
|
||||||
if(StrUtil.isNotBlank(shopOrderDeliveryAddress.getDa_province())){
|
if (StrUtil.isNotBlank(shopOrderDeliveryAddress.getDa_province())) {
|
||||||
sb.append(shopOrderDeliveryAddress.getDa_province());
|
sb.append(shopOrderDeliveryAddress.getDa_province());
|
||||||
}
|
}
|
||||||
if(StrUtil.isNotBlank(shopOrderDeliveryAddress.getDa_city())){
|
if (StrUtil.isNotBlank(shopOrderDeliveryAddress.getDa_city())) {
|
||||||
sb.append(shopOrderDeliveryAddress.getDa_city());
|
sb.append(shopOrderDeliveryAddress.getDa_city());
|
||||||
}
|
}
|
||||||
if(StrUtil.isNotBlank(shopOrderDeliveryAddress.getDa_county())){
|
if (StrUtil.isNotBlank(shopOrderDeliveryAddress.getDa_county())) {
|
||||||
sb.append(shopOrderDeliveryAddress.getDa_county());
|
sb.append(shopOrderDeliveryAddress.getDa_county());
|
||||||
}
|
}
|
||||||
if(StrUtil.isNotBlank(shopOrderDeliveryAddress.getDa_address())){
|
if (StrUtil.isNotBlank(shopOrderDeliveryAddress.getDa_address())) {
|
||||||
sb.append(StringUtils.removeProvinceCityDistrict(shopOrderDeliveryAddress.getDa_address()));
|
sb.append(StringUtils.removeProvinceCityDistrict(shopOrderDeliveryAddress.getDa_address()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
StandardAddressDTO standardAddressDTO = new StandardAddressDTO();
|
StandardAddressDTO standardAddressDTO = new StandardAddressDTO();
|
||||||
if ( StrUtil.isBlank(shopOrderDeliveryAddress.getDa_address()) || StrUtil.isBlank(shopOrderDeliveryAddress.getDa_longitude()) || StrUtil.isBlank(shopOrderDeliveryAddress.getDa_latitude())) {
|
if (StrUtil.isBlank(shopOrderDeliveryAddress.getDa_address()) || StrUtil.isBlank(shopOrderDeliveryAddress.getDa_longitude()) || StrUtil.isBlank(shopOrderDeliveryAddress.getDa_latitude())) {
|
||||||
if(StrUtil.isBlank(shopOrderDeliveryAddress.getDa_longitude())){
|
if (StrUtil.isBlank(shopOrderDeliveryAddress.getDa_longitude())) {
|
||||||
shopOrderDeliveryAddress.setDa_longitude("0");
|
shopOrderDeliveryAddress.setDa_longitude("0");
|
||||||
}
|
}
|
||||||
if(StrUtil.isBlank(shopOrderDeliveryAddress.getDa_latitude())){
|
if (StrUtil.isBlank(shopOrderDeliveryAddress.getDa_latitude())) {
|
||||||
shopOrderDeliveryAddress.setDa_latitude("0");
|
shopOrderDeliveryAddress.setDa_latitude("0");
|
||||||
}
|
}
|
||||||
standardAddressDTO.setFullAddress(sb.toString());
|
standardAddressDTO.setFullAddress(sb.toString());
|
||||||
|
|||||||
@ -8,7 +8,6 @@ import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
|
||||||
import com.suisung.mall.common.api.StateCode;
|
import com.suisung.mall.common.api.StateCode;
|
||||||
import com.suisung.mall.common.constant.CommonConstant;
|
import com.suisung.mall.common.constant.CommonConstant;
|
||||||
import com.suisung.mall.common.exception.ApiException;
|
|
||||||
import com.suisung.mall.common.feignService.AccountService;
|
import com.suisung.mall.common.feignService.AccountService;
|
||||||
import com.suisung.mall.common.feignService.PayService;
|
import com.suisung.mall.common.feignService.PayService;
|
||||||
import com.suisung.mall.common.feignService.SnsService;
|
import com.suisung.mall.common.feignService.SnsService;
|
||||||
@ -17,7 +16,6 @@ import com.suisung.mall.common.modules.order.ShopOrderBase;
|
|||||||
import com.suisung.mall.common.modules.order.ShopOrderInfo;
|
import com.suisung.mall.common.modules.order.ShopOrderInfo;
|
||||||
import com.suisung.mall.common.modules.order.ShopOrderInvoice;
|
import com.suisung.mall.common.modules.order.ShopOrderInvoice;
|
||||||
import com.suisung.mall.common.modules.order.ShopOrderStateLog;
|
import com.suisung.mall.common.modules.order.ShopOrderStateLog;
|
||||||
import com.suisung.mall.common.modules.pay.PayConsumeTrade;
|
|
||||||
import com.suisung.mall.common.modules.pay.PayPlantformResource;
|
import com.suisung.mall.common.modules.pay.PayPlantformResource;
|
||||||
import com.suisung.mall.common.modules.plantform.ShopPlantformFeedback;
|
import com.suisung.mall.common.modules.plantform.ShopPlantformFeedback;
|
||||||
import com.suisung.mall.common.modules.product.ShopProductComment;
|
import com.suisung.mall.common.modules.product.ShopProductComment;
|
||||||
@ -35,7 +33,6 @@ import com.suisung.mall.shop.product.service.ShopProductBaseService;
|
|||||||
import com.suisung.mall.shop.product.service.ShopProductCommentService;
|
import com.suisung.mall.shop.product.service.ShopProductCommentService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStorePrinterService;
|
import com.suisung.mall.shop.store.service.ShopStorePrinterService;
|
||||||
import com.sun.jna.platform.win32.WinDef;
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
@ -48,7 +45,6 @@ import javax.annotation.Resource;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.concurrent.CompletableFuture;
|
import java.util.concurrent.CompletableFuture;
|
||||||
import java.util.concurrent.ExecutionException;
|
|
||||||
import java.util.concurrent.ThreadPoolExecutor;
|
import java.util.concurrent.ThreadPoolExecutor;
|
||||||
|
|
||||||
import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
||||||
@ -119,7 +115,7 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
|||||||
@Autowired
|
@Autowired
|
||||||
private ThreadPoolExecutor executor;
|
private ThreadPoolExecutor executor;
|
||||||
|
|
||||||
private Logger logger = LoggerFactory.getLogger(ShopOrderInfoServiceImpl.class);
|
private final Logger logger = LoggerFactory.getLogger(ShopOrderInfoServiceImpl.class);
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Map dashboard() {
|
public Map dashboard() {
|
||||||
@ -250,7 +246,7 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
|||||||
|
|
||||||
Integer preOrderStatus = shopOrderInfo.getOrder_state_id();
|
Integer preOrderStatus = shopOrderInfo.getOrder_state_id();
|
||||||
|
|
||||||
int paramsCnt =0;
|
int paramsCnt = 0;
|
||||||
UpdateWrapper<ShopOrderInfo> updateWrapper = new UpdateWrapper<>();
|
UpdateWrapper<ShopOrderInfo> updateWrapper = new UpdateWrapper<>();
|
||||||
updateWrapper.eq("order_id", orderId);
|
updateWrapper.eq("order_id", orderId);
|
||||||
if (orderStatus > 0) {
|
if (orderStatus > 0) {
|
||||||
@ -268,7 +264,7 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
|||||||
paramsCnt++;
|
paramsCnt++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(paramsCnt<=0){
|
if (paramsCnt <= 0) {
|
||||||
// 无修改的状态
|
// 无修改的状态
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -309,6 +305,7 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 已支付的订单,生成取单号,打票机并打印订单
|
* 已支付的订单,生成取单号,打票机并打印订单
|
||||||
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @param orderId
|
* @param orderId
|
||||||
* @return 取货单号
|
* @return 取货单号
|
||||||
@ -500,7 +497,7 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
|||||||
order.put("total_num", total_num);
|
order.put("total_num", total_num);
|
||||||
// 今日订单完成数
|
// 今日订单完成数
|
||||||
|
|
||||||
long day_fin_num = shopOrderBaseService.getOrderNum(Arrays.asList(StateCode.ORDER_STATE_FINISH), store_id, chain_id, 0, null, null, null, null, null);
|
long day_fin_num = shopOrderBaseService.getOrderNum(Collections.singletonList(StateCode.ORDER_STATE_FINISH), store_id, chain_id, 0, null, null, null, null, null);
|
||||||
order.put("day_fin_num", day_fin_num);
|
order.put("day_fin_num", day_fin_num);
|
||||||
|
|
||||||
// 评论订单数
|
// 评论订单数
|
||||||
@ -576,7 +573,7 @@ public class ShopOrderInfoServiceImpl extends BaseServiceImpl<ShopOrderInfoMappe
|
|||||||
data.put("return", return_orders);
|
data.put("return", return_orders);
|
||||||
|
|
||||||
long return_total_num = shopOrderReturnService.getReturnNum(null, store_id, subsite_id);
|
long return_total_num = shopOrderReturnService.getReturnNum(null, store_id, subsite_id);
|
||||||
long return_fin_num = shopOrderReturnService.getReturnNum(Arrays.asList(StateCode.RETURN_PROCESS_FINISH), store_id, subsite_id);
|
long return_fin_num = shopOrderReturnService.getReturnNum(Collections.singletonList(StateCode.RETURN_PROCESS_FINISH), store_id, subsite_id);
|
||||||
long review_num = shopOrderReturnService.getReturnNum(Arrays.asList(StateCode.RETURN_PROCESS_SUBMIT
|
long review_num = shopOrderReturnService.getReturnNum(Arrays.asList(StateCode.RETURN_PROCESS_SUBMIT
|
||||||
, StateCode.RETURN_PROCESS_CHECK), store_id, subsite_id);
|
, StateCode.RETURN_PROCESS_CHECK), store_id, subsite_id);
|
||||||
long un_fin_num = shopOrderReturnService.getReturnNum(Arrays.asList(StateCode.RETURN_PROCESS_RECEIVED,
|
long un_fin_num = shopOrderReturnService.getReturnNum(Arrays.asList(StateCode.RETURN_PROCESS_RECEIVED,
|
||||||
|
|||||||
@ -9,7 +9,6 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||||
import com.fasterxml.jackson.datatype.jsr310.DecimalUtils;
|
|
||||||
import com.suisung.mall.common.api.StateCode;
|
import com.suisung.mall.common.api.StateCode;
|
||||||
import com.suisung.mall.common.domain.UserDto;
|
import com.suisung.mall.common.domain.UserDto;
|
||||||
import com.suisung.mall.common.modules.activity.ShopActivityGroupbookingHistory;
|
import com.suisung.mall.common.modules.activity.ShopActivityGroupbookingHistory;
|
||||||
@ -29,7 +28,6 @@ import com.suisung.mall.shop.order.service.ShopOrderItemService;
|
|||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
|
||||||
import java.text.DecimalFormat;
|
import java.text.DecimalFormat;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
@ -230,16 +228,16 @@ public class ShopOrderItemServiceImpl extends BaseServiceImpl<ShopOrderItemMappe
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<ShopStoreOrderProductPrintVO> selectOrderItemPrintInfo(String orderId) {
|
public List<ShopStoreOrderProductPrintVO> selectOrderItemPrintInfo(String orderId) {
|
||||||
if(StrUtil.isBlank(orderId)){
|
if (StrUtil.isBlank(orderId)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
List<Map> mList= shopOrderItemMapper.selectOrderItemPrintInfo(orderId);
|
List<Map> mList = shopOrderItemMapper.selectOrderItemPrintInfo(orderId);
|
||||||
if(CollUtil.isEmpty(mList)){
|
if (CollUtil.isEmpty(mList)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
DecimalFormat df2 =new DecimalFormat("#.##");
|
DecimalFormat df2 = new DecimalFormat("#.##");
|
||||||
List<ShopStoreOrderProductPrintVO> retList = new ArrayList<>();
|
List<ShopStoreOrderProductPrintVO> retList = new ArrayList<>();
|
||||||
for (Map map : mList) {
|
for (Map map : mList) {
|
||||||
ShopStoreOrderProductPrintVO vo = new ShopStoreOrderProductPrintVO();
|
ShopStoreOrderProductPrintVO vo = new ShopStoreOrderProductPrintVO();
|
||||||
|
|||||||
@ -278,10 +278,6 @@ public class ShopOrderLogisticsServiceImpl extends BaseServiceImpl<ShopOrderLogi
|
|||||||
.eq("logistics_enable", 1);
|
.eq("logistics_enable", 1);
|
||||||
long order_logistics_num = count(logisticsQueryWrapper);
|
long order_logistics_num = count(logisticsQueryWrapper);
|
||||||
|
|
||||||
if (stock_bill_id_rows.size() != order_logistics_num) {
|
return stock_bill_id_rows.size() == order_logistics_num;
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -82,90 +82,6 @@ import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
|||||||
@Service
|
@Service
|
||||||
public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnMapper, ShopOrderReturn> implements ShopOrderReturnService {
|
public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnMapper, ShopOrderReturn> 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<String, String> order_is_shipped_row = new HashMap<>();
|
public static final Map<String, String> order_is_shipped_row = new HashMap<>();
|
||||||
public static final Map<String, String> return_state_id_row = new HashMap<>();
|
public static final Map<String, String> return_state_id_row = new HashMap<>();
|
||||||
public static final Map<String, String> return_channel_flag_row = new HashMap<>();
|
public static final Map<String, String> return_channel_flag_row = new HashMap<>();
|
||||||
@ -173,6 +89,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
public static final Map<String, String> return_type = new HashMap<>();
|
public static final Map<String, String> return_type = new HashMap<>();
|
||||||
public static final Map<String, String> return_item_state_id = new HashMap<>();
|
public static final Map<String, String> return_item_state_id = new HashMap<>();
|
||||||
public static final Map<String, String> pay_channel_id_row = new HashMap<>();
|
public static final Map<String, String> pay_channel_id_row = new HashMap<>();
|
||||||
|
private static final Logger logger = LoggerFactory.getLogger(ShopOrderReturnServiceImpl.class);
|
||||||
|
|
||||||
static {
|
static {
|
||||||
order_is_shipped_row.put("3030", I18nUtil._("未发货"));
|
order_is_shipped_row.put("3030", I18nUtil._("未发货"));
|
||||||
@ -210,7 +127,62 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
pay_channel_id_row.put("1413", I18nUtil._("线下付款"));
|
pay_channel_id_row.put("1413", I18nUtil._("线下付款"));
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final Logger logger = LoggerFactory.getLogger(ShopOrderReturnServiceImpl.class);
|
@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;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Map<String, Object>> statisticState() {
|
public List<Map<String, Object>> statisticState() {
|
||||||
@ -315,7 +287,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
public CommonResult returnItem() {
|
public CommonResult returnItem() {
|
||||||
|
|
||||||
String order_id = ObjectUtil.defaultIfNull(getParameter("order_id"), "");
|
String order_id = ObjectUtil.defaultIfNull(getParameter("order_id"), "");
|
||||||
Long order_item_id = Convert.toLong(getParameter("order_item_id"), 0l);
|
Long order_item_id = Convert.toLong(getParameter("order_item_id"), 0L);
|
||||||
|
|
||||||
UserDto user = getCurrentUser();
|
UserDto user = getCurrentUser();
|
||||||
if (user == null) {
|
if (user == null) {
|
||||||
@ -375,12 +347,12 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
Long stime = getParameter("stime", 0l);
|
Long stime = getParameter("stime", 0L);
|
||||||
if (CheckUtil.isNotEmpty(stime)) {
|
if (CheckUtil.isNotEmpty(stime)) {
|
||||||
queryWrapper.ge("return_add_time", new Date(stime));
|
queryWrapper.ge("return_add_time", new Date(stime));
|
||||||
}
|
}
|
||||||
|
|
||||||
Long etime = getParameter("etime", 0l);
|
Long etime = getParameter("etime", 0L);
|
||||||
if (CheckUtil.isNotEmpty(etime)) {
|
if (CheckUtil.isNotEmpty(etime)) {
|
||||||
queryWrapper.le("return_add_time", new Date(etime));
|
queryWrapper.le("return_add_time", new Date(etime));
|
||||||
}
|
}
|
||||||
@ -884,7 +856,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
@GlobalTransactional
|
@GlobalTransactional
|
||||||
public CommonResult doForceRefund(String return_id, Integer return_flag) {
|
public CommonResult doForceRefund(String return_id, Integer return_flag) {
|
||||||
|
|
||||||
List<String> return_ids = Arrays.asList(return_id);
|
List<String> return_ids = Collections.singletonList(return_id);
|
||||||
ShopOrderReturn shopOrderReturn = get(return_id);
|
ShopOrderReturn shopOrderReturn = get(return_id);
|
||||||
UserDto user = getCurrentUser();
|
UserDto user = getCurrentUser();
|
||||||
Integer store_id = Convert.toInt(user.getStore_id());
|
Integer store_id = Convert.toInt(user.getStore_id());
|
||||||
@ -903,7 +875,7 @@ public class ShopOrderReturnServiceImpl extends BaseServiceImpl<ShopOrderReturnM
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 订单审核
|
// 订单审核
|
||||||
review(return_ids, Arrays.asList(shopOrderReturn), StateCode.RETURN_PROCESS_CHECK, null);
|
review(return_ids, Collections.singletonList(shopOrderReturn), StateCode.RETURN_PROCESS_CHECK, null);
|
||||||
} else {
|
} else {
|
||||||
throw new ApiException(ResultCode.FORBIDDEN);
|
throw new ApiException(ResultCode.FORBIDDEN);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,19 +8,14 @@
|
|||||||
|
|
||||||
package com.suisung.mall.shop.sfexpress.controller.api;
|
package com.suisung.mall.shop.sfexpress.controller.api;
|
||||||
|
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
|
||||||
import com.suisung.mall.common.pojo.res.SFExpressApiRes;
|
import com.suisung.mall.common.pojo.res.SFExpressApiRes;
|
||||||
import com.suisung.mall.common.utils.SseEmitterUtil;
|
|
||||||
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
import com.suisung.mall.shop.sfexpress.service.SFExpressApiService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.http.MediaType;
|
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.concurrent.CopyOnWriteArrayList;
|
import java.util.concurrent.CopyOnWriteArrayList;
|
||||||
|
|
||||||
@Api(tags = "顺丰同城Api端")
|
@Api(tags = "顺丰同城Api端")
|
||||||
|
|||||||
@ -15,10 +15,8 @@ import cn.hutool.core.util.StrUtil;
|
|||||||
import cn.hutool.http.HttpUtil;
|
import cn.hutool.http.HttpUtil;
|
||||||
import cn.hutool.json.JSONObject;
|
import cn.hutool.json.JSONObject;
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
|
||||||
import com.suisung.mall.common.api.StateCode;
|
import com.suisung.mall.common.api.StateCode;
|
||||||
import com.suisung.mall.common.constant.SFExpressConstant;
|
import com.suisung.mall.common.constant.SFExpressConstant;
|
||||||
import com.suisung.mall.common.domain.UserDto;
|
|
||||||
import com.suisung.mall.common.exception.ApiException;
|
import com.suisung.mall.common.exception.ApiException;
|
||||||
import com.suisung.mall.common.modules.store.ShopStoreSfOrder;
|
import com.suisung.mall.common.modules.store.ShopStoreSfOrder;
|
||||||
import com.suisung.mall.common.pojo.req.*;
|
import com.suisung.mall.common.pojo.req.*;
|
||||||
@ -46,8 +44,6 @@ import java.util.HashMap;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import static com.suisung.mall.common.utils.ContextUtil.getCurrentUser;
|
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class SFExpressApiServiceImpl implements SFExpressApiService {
|
public class SFExpressApiServiceImpl implements SFExpressApiService {
|
||||||
|
|
||||||
|
|||||||
@ -1,10 +1,8 @@
|
|||||||
package com.suisung.mall.shop.store.controller.admin;
|
package com.suisung.mall.shop.store.controller.admin;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import cn.hutool.json.JSONUtil;
|
import cn.hutool.json.JSONUtil;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.modules.store.ShopStorePrinter;
|
import com.suisung.mall.common.modules.store.ShopStorePrinter;
|
||||||
import com.suisung.mall.common.utils.PositionUtil;
|
|
||||||
import com.suisung.mall.common.utils.SseEmitterUtil;
|
import com.suisung.mall.common.utils.SseEmitterUtil;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreEmployeeService;
|
import com.suisung.mall.shop.store.service.ShopStoreEmployeeService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStorePrinterService;
|
import com.suisung.mall.shop.store.service.ShopStorePrinterService;
|
||||||
@ -15,15 +13,9 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
|||||||
import org.springframework.web.bind.annotation.RequestMethod;
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
import org.springframework.web.servlet.mvc.method.annotation.SseEmitter;
|
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
@Api(tags = "门店打票机打印业务")
|
@Api(tags = "门店打票机打印业务")
|
||||||
@RestController
|
@RestController
|
||||||
|
|||||||
@ -4,7 +4,10 @@ import com.suisung.mall.common.api.CommonResult;
|
|||||||
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportBaseService;
|
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportBaseService;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
||||||
|
import org.springframework.web.bind.annotation.RequestMethod;
|
||||||
|
import org.springframework.web.bind.annotation.RequestParam;
|
||||||
|
import org.springframework.web.bind.annotation.RestController;
|
||||||
|
|
||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
|
|
||||||
@ -18,7 +21,7 @@ public class ShopStoreSameCityTransportBaseMobileController {
|
|||||||
|
|
||||||
@ApiOperation(value = "下单前检测同城订单配送是否符合要求", notes = "下单前检测同城订单配送是否符合要求")
|
@ApiOperation(value = "下单前检测同城订单配送是否符合要求", notes = "下单前检测同城订单配送是否符合要求")
|
||||||
@RequestMapping(value = "/check/same-city/delivery", method = {RequestMethod.POST})
|
@RequestMapping(value = "/check/same-city/delivery", method = {RequestMethod.POST})
|
||||||
public CommonResult checkSameCityDelivery(@RequestParam(name = "store_id", defaultValue = "0") Integer storeId) {
|
public CommonResult checkSameCityDelivery(@RequestParam(name = "store_id", defaultValue = "0") Integer storeId) {
|
||||||
return transportBaseService.ShopStoreSameCityTransportBaseDetail();
|
return transportBaseService.ShopStoreSameCityTransportBaseDetail();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -21,6 +21,7 @@ public interface ShopStoreEmployeeMapper extends BaseMapper<ShopStoreEmployee> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据店铺id和角色权限组id获取多条 userId
|
* 根据店铺id和角色权限组id获取多条 userId
|
||||||
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @param groupId
|
* @param groupId
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -20,6 +20,7 @@ public interface ShopStoreEmployeeRightsGroupService extends IBaseService<ShopSt
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据店铺id和角色权限组名称获取一条记录
|
* 根据店铺id和角色权限组名称获取一条记录
|
||||||
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @param groupName
|
* @param groupName
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -31,6 +31,7 @@ public interface ShopStoreEmployeeService extends IBaseService<ShopStoreEmployee
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据店铺id和角色权限组名称,获取多条 userId
|
* 根据店铺id和角色权限组名称,获取多条 userId
|
||||||
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @param rightsGroupName
|
* @param rightsGroupName
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -24,6 +24,7 @@ public interface ShopStoreInfoService extends IBaseService<ShopStoreInfo> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取店长的手机号码
|
* 获取店长的手机号码
|
||||||
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -35,18 +35,20 @@ public interface ShopStoreSameCityTransportBaseService {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 店铺主营商品类型
|
* 店铺主营商品类型
|
||||||
|
*
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CommonResult storeBusinessTypeList();
|
CommonResult storeBusinessTypeList();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 下单前检测同城订单配送是否符合要求
|
* 下单前检测同城订单配送是否符合要求
|
||||||
|
*
|
||||||
* @param
|
* @param
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
CommonResult checkSameCityDelivery();
|
CommonResult checkSameCityDelivery();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据店铺 Id 获取同城配送设置详情信息
|
* 根据店铺 Id 获取同城配送设置详情信息
|
||||||
*
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
|
|||||||
@ -16,6 +16,7 @@ public interface ShopStoreSfOrderService extends IBaseService<ShopStoreSfOrder>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据商家订单Id 获取一条记录
|
* 根据商家订单Id 获取一条记录
|
||||||
|
*
|
||||||
* @param shopOrderId
|
* @param shopOrderId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@ -48,6 +49,7 @@ public interface ShopStoreSfOrderService extends IBaseService<ShopStoreSfOrder>
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 检查顺丰同城开发者id下,某个订单是否已经存在
|
* 检查顺丰同城开发者id下,某个订单是否已经存在
|
||||||
|
*
|
||||||
* @param devId
|
* @param devId
|
||||||
* @param shopOrderId 商城订单号
|
* @param shopOrderId 商城订单号
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -40,6 +40,7 @@ public class ShopStoreEmployeeRightsGroupServiceImpl extends BaseServiceImpl<Sho
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据店铺id和角色权限组名称获取一条记录
|
* 根据店铺id和角色权限组名称获取一条记录
|
||||||
|
*
|
||||||
* @param storeId
|
* @param storeId
|
||||||
* @param rightsGroupName
|
* @param rightsGroupName
|
||||||
* @return
|
* @return
|
||||||
|
|||||||
@ -23,7 +23,6 @@ import com.suisung.mall.shop.store.mapper.ShopStoreEmployeeMapper;
|
|||||||
import com.suisung.mall.shop.store.service.ShopStoreEmployeeRightsGroupService;
|
import com.suisung.mall.shop.store.service.ShopStoreEmployeeRightsGroupService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreEmployeeService;
|
import com.suisung.mall.shop.store.service.ShopStoreEmployeeService;
|
||||||
import io.seata.spring.annotation.GlobalTransactional;
|
import io.seata.spring.annotation.GlobalTransactional;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|||||||
@ -9,12 +9,10 @@
|
|||||||
package com.suisung.mall.shop.store.service.impl;
|
package com.suisung.mall.shop.store.service.impl;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.comparator.FieldComparator;
|
|
||||||
import cn.hutool.core.comparator.FieldsComparator;
|
import cn.hutool.core.comparator.FieldsComparator;
|
||||||
import cn.hutool.core.convert.Convert;
|
import cn.hutool.core.convert.Convert;
|
||||||
import cn.hutool.core.util.NumberUtil;
|
import cn.hutool.core.util.NumberUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
import cn.hutool.json.JSONUtil;
|
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.suisung.mall.common.api.CommonResult;
|
import com.suisung.mall.common.api.CommonResult;
|
||||||
import com.suisung.mall.common.api.ResultCode;
|
import com.suisung.mall.common.api.ResultCode;
|
||||||
@ -31,9 +29,7 @@ import com.suisung.mall.common.pojo.dto.ShopStoreSameCityTransportBaseDTO;
|
|||||||
import com.suisung.mall.common.utils.CommonUtil;
|
import com.suisung.mall.common.utils.CommonUtil;
|
||||||
import com.suisung.mall.common.utils.I18nUtil;
|
import com.suisung.mall.common.utils.I18nUtil;
|
||||||
import com.suisung.mall.common.utils.PositionUtil;
|
import com.suisung.mall.common.utils.PositionUtil;
|
||||||
import com.suisung.mall.common.utils.StringUtils;
|
|
||||||
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
import com.suisung.mall.core.web.service.impl.BaseServiceImpl;
|
||||||
import com.suisung.mall.shop.chain.controller.admin.ShopChainUserController;
|
|
||||||
import com.suisung.mall.shop.store.mapper.ShopStoreSameCityTransportBaseMapper;
|
import com.suisung.mall.shop.store.mapper.ShopStoreSameCityTransportBaseMapper;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
import com.suisung.mall.shop.store.service.ShopStoreBaseService;
|
||||||
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportBaseService;
|
import com.suisung.mall.shop.store.service.ShopStoreSameCityTransportBaseService;
|
||||||
@ -48,7 +44,6 @@ import javax.annotation.Resource;
|
|||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Comparator;
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ -419,7 +414,7 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
|||||||
}
|
}
|
||||||
// 实际配送距离,单位米
|
// 实际配送距离,单位米
|
||||||
Integer distance = distanceD.intValue();
|
Integer distance = distanceD.intValue();
|
||||||
logger.debug(storeName + "下单时,店铺与收货地址两地,经纬度:{},{}|{},{} 距离:{} 米", storeLng, storeLat, orderLongitude, orderLatitude, distance);
|
logger.debug(storeName + "下单时,店铺与收货地址经纬度是{},{},{},{} 距离为{}米。", storeLng, storeLat, orderLongitude, orderLatitude, distance);
|
||||||
|
|
||||||
// ### 基础配送费计算
|
// ### 基础配送费计算
|
||||||
BigDecimal deliveryBaseFee = transportBase.getDelivery_base_fee();
|
BigDecimal deliveryBaseFee = transportBase.getDelivery_base_fee();
|
||||||
@ -457,7 +452,7 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
|||||||
deliveryBaseFee = deliveryBaseFee.add(transportBase.getWeight_increase_fee().multiply(times));
|
deliveryBaseFee = deliveryBaseFee.add(transportBase.getWeight_increase_fee().multiply(times));
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug(storeName + "下单时,店铺与收货地址超出基础距离和重量:额外增加 {} 元运费。", deliveryBaseFee);
|
logger.debug(storeName + "下单时,因超出基础距离或重量,所以额外增加{}元运费。", deliveryBaseFee);
|
||||||
// #### 基础配送费计算完毕
|
// #### 基础配送费计算完毕
|
||||||
|
|
||||||
|
|
||||||
@ -480,7 +475,7 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
|||||||
for (ShopStoreSameCityTransport transport : transportList) {
|
for (ShopStoreSameCityTransport transport : transportList) {
|
||||||
DeliveryFeeResultDTO deliveryFeeResultDTO = new DeliveryFeeResultDTO();
|
DeliveryFeeResultDTO deliveryFeeResultDTO = new DeliveryFeeResultDTO();
|
||||||
deliveryFeeResultDTO.setId(transport.getTransport_id());
|
deliveryFeeResultDTO.setId(transport.getTransport_id());
|
||||||
logger.debug(storeName + "下单时,店铺与收货地址的距离是{}米,最大配送范围是{}米以内", distance, transport.getMax_delivery_radius());
|
logger.debug(storeName + "下单时,配送范围为{}米内,店铺与收货地址距离是{}米。", distance, transport.getMax_delivery_radius());
|
||||||
|
|
||||||
// 判断订单距离在不在配送范围内?
|
// 判断订单距离在不在配送范围内?
|
||||||
if (transport.getMax_delivery_radius() < distance) {
|
if (transport.getMax_delivery_radius() < distance) {
|
||||||
@ -557,8 +552,8 @@ public class ShopStoreSameCityTransportBaseServiceImpl extends BaseServiceImpl<S
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.debug(storeName + "下单时,根据商家运费设置规则减免{}元运费", reduceDeliveryFee);
|
// logger.debug(storeName + "下单时,根据商家运费设置规则减免{}元运费", reduceDeliveryFee);
|
||||||
logger.debug(storeName + "下单时,不符合规则的:\n {}\n符合规则的:{}", JSONUtil.toJsonStr(noPassed), JSONUtil.toJsonStr(passed));
|
// logger.debug(storeName + "下单时,不符合规则的:\n {}\n符合规则的:{}", JSONUtil.toJsonStr(noPassed), JSONUtil.toJsonStr(passed));
|
||||||
|
|
||||||
if (passed.size() == 0 && noPassed.size() > 0) {
|
if (passed.size() == 0 && noPassed.size() > 0) {
|
||||||
// 没有一个满足起送距离和起送金额的规则订单
|
// 没有一个满足起送距离和起送金额的规则订单
|
||||||
|
|||||||
@ -18,7 +18,6 @@ import com.suisung.mall.shop.store.service.ShopStoreSfOrderService;
|
|||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
import org.springframework.util.StringUtils;
|
|
||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
|
|
||||||
@ -66,7 +65,7 @@ public class ShopStoreSfOrderServiceImpl extends BaseServiceImpl<ShopStoreSfOrde
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
if(StrUtil.startWith(shopOrderId,"JS")){ // 顺丰同城的订单号标志
|
if (StrUtil.startWith(shopOrderId, "JS")) { // 顺丰同城的订单号标志
|
||||||
return shopOrderId;
|
return shopOrderId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user