Merge #111 into master from cc_20260417_bonus

fix:工资奖金

* cc_20260417_bonus: (28 commits squashed)

  - feat:工资奖金发放

  - fix:工资奖金发放

  - fix:工资奖金发放

  - fix:工资奖金发放

  - fix:工资奖金发放

  - fix:门店实收相关接口

  - fix:新品销售门店级接口

  - fix:新品销售菜品列表接口;规则新增返回id

  - fix:新品销售菜品详情接口

  - fix:新品销售菜品接口补充

  - fix:小程序接口补充

  - fix

  - fix:新增实收、新品销售测试接口

  - fix:新增实收、新品销售测试接口

  - fix

  - fix:新增门店菜品列表接口

  - fix:同规则下无法新增相同菜品规则;新增小程序门店列表接口

  - fix

  - fix:小程序用户获取来源修改

  - fix:实收规则新增上月日均实收字段

  - fix:规则限制

  - fix:小程序上月日均实收

  - fix:查询异常

  - fix:查询异常

  - fix:菜品员工明细字段赋值异常

  - fix:排序

  - fix:排序

  - fix:员工实收列表新增门店筛选条件

Signed-off-by: 王非凡 <accounts_67eba0c5fee9c49c80c8e2b4@mail.teambition.com>
Merged-by: 正新 <accounts_6964c7bcd2a2c377c5bbd01b@mail.teambition.com>

CR-link: https://codeup.aliyun.com/692ea314dec569489f6f167c/hangzhou/java/custom_zxjp/change/111
This commit is contained in:
王非凡
2026-04-27 10:41:08 +00:00
committed by 正新
parent 97f8a8669c
commit 22fcfc6a90
95 changed files with 5466 additions and 8 deletions

View File

@@ -493,6 +493,13 @@ public enum ErrorCodeEnum {
CLOSE_UP_CLOSED_AUDIT_NOT_PASS(1840008, "歇业申请未通过", null),
CLOSE_UP_EXIST_OPEN_APPLY(1840009, "该歇业申请单已存在开业申请", null),
CLOSE_UP_APPROVED(1840010, "该申请单已审批", null),
BONUS_EXIST_OVERLAP_RULE(1850000, "门店该有效期范围内存在相同类型的启用规则", null),
BONUS_RULE_NOT_EXIST(1850001, "不存在该奖金发放规则", null),
BONUS_RULE_NOT_CONFIG(1850002, "奖金规则或分配规则未配置", null),
BONUS_DISTRIBUTE_RATIO_OVER_100(1850003, "分配规则员工比例之和大于100", null),
BONUS_PRODUCT_CONFIG_DUPLICATE(1850004, "奖金规则配置存在重复菜品", null),
BONUS_RULE_CONFIG_ERROR(1850005, "规则配置异常", null),
;

View File

@@ -0,0 +1,78 @@
package com.cool.store.utils;
import java.nio.charset.StandardCharsets;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
import java.security.SecureRandom;
/**
* 门店开放数据签名工具类
*
* @author wangff
* @since 2026/4/20
*/
public class StoreOpenSigner {
private static final SecureRandom RANDOM = new SecureRandom();
/**
* 构建签名串
*
* @param method HTTP方法如POST
* @param requestPath 请求路径,如/open/v1/store/monthRevenue
* @param rawJsonBody 原始JSON请求体
* @param signTime 签名时间戳
* @param signRandom 随机串
* @return 签名串
*/
public static String buildSigningString(String method, String requestPath, String rawJsonBody,
String signTime, String signRandom) {
return method + "&" + requestPath + "&" + rawJsonBody + "&" + signTime + "&" + signRandom;
}
/**
* HMAC-SHA256签名返回小写十六进制字符串
*
* @param signingString 签名串
* @param secret 密钥
* @return 签名结果
*/
public static String sign(String signingString, String secret) {
try {
Mac mac = Mac.getInstance("HmacSHA256");
mac.init(new SecretKeySpec(secret.getBytes(StandardCharsets.UTF_8), "HmacSHA256"));
byte[] digest = mac.doFinal(signingString.getBytes(StandardCharsets.UTF_8));
StringBuilder sb = new StringBuilder(digest.length * 2);
for (byte b : digest) {
sb.append(String.format("%02x", b));
}
return sb.toString();
} catch (Exception e) {
throw new RuntimeException("签名失败", e);
}
}
/**
* 生成随机串
*
* @param length 随机串长度
* @return 随机串
*/
public static String generateRandom(int length) {
String chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
StringBuilder sb = new StringBuilder(length);
for (int i = 0; i < length; i++) {
sb.append(chars.charAt(RANDOM.nextInt(chars.length())));
}
return sb.toString();
}
/**
* 生成签名时间戳(秒)
*
* @return Unix秒时间戳字符串
*/
public static String generateSignTime() {
return String.valueOf(System.currentTimeMillis() / 1000);
}
}