diff --git a/crm-admin/src/main/java/com/yb/lb/webapp/thread/records/RecordsThread.java b/crm-admin/src/main/java/com/yb/lb/webapp/thread/records/RecordsThread.java index 4431030..268f2dc 100644 --- a/crm-admin/src/main/java/com/yb/lb/webapp/thread/records/RecordsThread.java +++ b/crm-admin/src/main/java/com/yb/lb/webapp/thread/records/RecordsThread.java @@ -40,34 +40,38 @@ public class RecordsThread implements Runnable { Map 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 map1 = new HashMap<>(); map1.put("type", type); diff --git a/crm-common/src/main/resources/mapper/mapper_oracle/system/PrizeGoodsRuleMapper.xml b/crm-common/src/main/resources/mapper/mapper_oracle/system/PrizeGoodsRuleMapper.xml index 63547db..2bf06ae 100644 --- a/crm-common/src/main/resources/mapper/mapper_oracle/system/PrizeGoodsRuleMapper.xml +++ b/crm-common/src/main/resources/mapper/mapper_oracle/system/PrizeGoodsRuleMapper.xml @@ -35,6 +35,10 @@ AND a.prize_type = #{prizeType} + + AND to_date(#{currentTime},'yyyy-MM-dd') >= to_date(a.start_time,'yyyy-MM-dd') + AND to_date(#{currentTime},'yyyy-MM-dd') <= to_date(a.end_time,'yyyy-MM-dd') + AND a.company_id = #{companyId}