规则查询调整

This commit is contained in:
mzr 2024-04-29 16:20:36 +08:00
parent f9d7fa8890
commit 16fdd20676
2 changed files with 33 additions and 25 deletions

View File

@ -40,34 +40,38 @@ public class RecordsThread implements Runnable {
Map<String, Object> addMap = new HashMap<>();
addMap.put("status", "1");
addMap.put("ruleType", "1");
addMap.put("currentTime", DateUtil.getDay());
//日期在当前活动时间内的规则
CrmPrizeGoodsRule activityRules = prizeGoodsRuleService.oneById(addMap, ".findPrizeGoodsRuleByCondition");
addMap.clear();
addMap.put("id", IdUtil.simpleUUID());
addMap.put("qrCode", map.get("qrCode"));
addMap.put("clientId", map.get("clientId"));
addMap.put("clientName", map.get("clientName"));
// 记录类型 1.收入 2.支出
addMap.put("recordType", "1");
addMap.put("createUser", map.get("createUser") + "");
addMap.put("createName", map.get("createUserName") + "");
addMap.put("createTime", DateUtil.getTime());
addMap.put("companyId", map.get("companyId"));
Double dealerPrize = 0d;
String source = "";
if ("3".equals(type)) {
source = "1"; // 经销商扫码入库
if (StringUtil.isNotEmpty(activityRules) && StringUtil.isNotEmpty(activityRules.getDealerInPrize())) {
dealerPrize = activityRules.getDealerInPrize();
}
} else if ("4".equals(type)) {
source = "2";// 经销商扫码出库
if (StringUtil.isNotEmpty(activityRules) && StringUtil.isNotEmpty(activityRules.getDealerOutPrize())) {
dealerPrize = activityRules.getDealerOutPrize();
if (StringUtil.isNotEmpty(activityRules)) {
addMap.clear();
addMap.put("id", IdUtil.simpleUUID());
addMap.put("qrCode", map.get("qrCode"));
addMap.put("clientId", map.get("clientId"));
addMap.put("clientName", map.get("clientName"));
// 记录类型 1.收入 2.支出
addMap.put("recordType", "1");
addMap.put("createUser", map.get("createUser") + "");
addMap.put("createName", map.get("createUserName") + "");
addMap.put("createTime", DateUtil.getTime());
addMap.put("companyId", map.get("companyId"));
Double dealerPrize = 0d;
String source = "";
if ("3".equals(type)) {
source = "1"; // 经销商扫码入库
if (StringUtil.isNotEmpty(activityRules) && StringUtil.isNotEmpty(activityRules.getDealerInPrize())) {
dealerPrize = activityRules.getDealerInPrize();
}
} else if ("4".equals(type)) {
source = "2";// 经销商扫码出库
if (StringUtil.isNotEmpty(activityRules) && StringUtil.isNotEmpty(activityRules.getDealerOutPrize())) {
dealerPrize = activityRules.getDealerOutPrize();
}
}
addMap.put("exchangeAmount", dealerPrize);
addMap.put("source", source);
prizeClientService.addInfo(addMap, ".addCrmPrizeClient");
}
addMap.put("exchangeAmount", dealerPrize);
addMap.put("source", source);
prizeClientService.addInfo(addMap, ".addCrmPrizeClient");
}
Map<String, Object> map1 = new HashMap<>();
map1.put("type", type);

View File

@ -35,6 +35,10 @@
<if test="prizeType != null and prizeType != ''">
AND a.prize_type = #{prizeType}
</if>
<if test="currentTime != null and currentTime != ''">
AND to_date(#{currentTime},'yyyy-MM-dd') &gt;= to_date(a.start_time,'yyyy-MM-dd')
AND to_date(#{currentTime},'yyyy-MM-dd') &lt;= to_date(a.end_time,'yyyy-MM-dd')
</if>
<if test="companyId != null and companyId != ''">
AND a.company_id = #{companyId}
</if>