Procházet zdrojové kódy

更新定时任务处理

Huanyi před 1 dnem
rodič
revize
ee48c699a9

+ 77 - 74
.idea/workspace.xml

@@ -4,19 +4,11 @@
     <option name="autoReloadType" value="SELECTIVE" />
   </component>
   <component name="ChangeListManager">
-    <list default="true" id="ffdc641e-daec-4379-97d2-148b9c8f9264" name="Changes" comment="更新 git 索引">
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/分布式事务_8091.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/定时任务_8800.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/定时任务服务_6007.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/履约者服务_6004.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/服务类型服务_6006.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/档案服务_6003.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/注册中心_8848.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/系统服务_6001.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/网关_8080.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/订单服务_6005.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/认证中心_6000.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/runConfigurations/资源服务_6002.xml" beforeDir="false" />
+    <list default="true" id="ffdc641e-daec-4379-97d2-148b9c8f9264" name="Changes" comment="更新运行配置">
+      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/dubbo/RemoteFulfillerServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/dubbo/RemoteFulfillerServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/enums/FlfPointsBizTypeEnum.java" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/enums/FlfPointsBizTypeEnum.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/enums/FlfRewardBizTypeEnum.java" beforeDir="false" afterPath="$PROJECT_DIR$/ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/enums/FlfRewardBizTypeEnum.java" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -60,46 +52,56 @@
     <option name="flattenModules" value="true" />
     <option name="showLibraryContents" value="true" />
   </component>
-  <component name="PropertiesComponent">{
-  &quot;keyToString&quot;: {
-    &quot;Maven.pet-system [clean].executor&quot;: &quot;Run&quot;,
-    &quot;Maven.pet-system [compile].executor&quot;: &quot;Run&quot;,
-    &quot;Maven.pet-system [install].executor&quot;: &quot;Run&quot;,
-    &quot;Maven.pet-system [package].executor&quot;: &quot;Run&quot;,
-    &quot;Maven.pet-system [validate].executor&quot;: &quot;Run&quot;,
-    &quot;Maven.pet-system [verify].executor&quot;: &quot;Run&quot;,
-    &quot;Maven.ruoyi-seata-server [clean].executor&quot;: &quot;Run&quot;,
-    &quot;Maven.yingpaipay-archieves [clean].executor&quot;: &quot;Run&quot;,
-    &quot;Maven.yingpaipay-order [clean].executor&quot;: &quot;Run&quot;,
-    &quot;ModuleVcsDetector.initialDetectionPerformed&quot;: &quot;true&quot;,
-    &quot;RequestMappingsPanelOrder0&quot;: &quot;0&quot;,
-    &quot;RequestMappingsPanelOrder1&quot;: &quot;1&quot;,
-    &quot;RequestMappingsPanelWidth0&quot;: &quot;75&quot;,
-    &quot;RequestMappingsPanelWidth1&quot;: &quot;75&quot;,
-    &quot;RunOnceActivity.ShowReadmeOnStart&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.git.unshallow&quot;: &quot;true&quot;,
-    &quot;RunOnceActivity.typescript.service.memoryLimit.init&quot;: &quot;true&quot;,
-    &quot;git-widget-placeholder&quot;: &quot;dev/shenliang&quot;,
-    &quot;kotlin-language-version-configured&quot;: &quot;true&quot;,
-    &quot;last_opened_file_path&quot;: &quot;E:/CodeProjects/Yingpaipay/Pet System/pet-system&quot;,
-    &quot;nodejs_package_manager_path&quot;: &quot;npm&quot;,
-    &quot;project.structure.last.edited&quot;: &quot;Modules&quot;,
-    &quot;project.structure.proportion&quot;: &quot;0.0&quot;,
-    &quot;project.structure.side.proportion&quot;: &quot;0.0&quot;,
-    &quot;run.configurations.included.in.services&quot;: &quot;true&quot;,
-    &quot;settings.editor.selected.configurable&quot;: &quot;com.itangcent.idea.plugin.configurable.AccountConfigurable.apifox&quot;,
-    &quot;vue.rearranger.settings.migration&quot;: &quot;true&quot;
+  <component name="PropertiesComponent"><![CDATA[{
+  "keyToString": {
+    "Maven.pet-system [clean].executor": "Run",
+    "Maven.pet-system [compile].executor": "Run",
+    "Maven.pet-system [install].executor": "Run",
+    "Maven.pet-system [package].executor": "Run",
+    "Maven.pet-system [validate].executor": "Run",
+    "Maven.pet-system [verify].executor": "Run",
+    "Maven.ruoyi-seata-server [clean].executor": "Run",
+    "Maven.yingpaipay-archieves [clean].executor": "Run",
+    "Maven.yingpaipay-order [clean].executor": "Run",
+    "ModuleVcsDetector.initialDetectionPerformed": "true",
+    "RequestMappingsPanelOrder0": "0",
+    "RequestMappingsPanelOrder1": "1",
+    "RequestMappingsPanelWidth0": "75",
+    "RequestMappingsPanelWidth1": "75",
+    "RunOnceActivity.ShowReadmeOnStart": "true",
+    "RunOnceActivity.TerminalTabsStorage.copyFrom.TerminalArrangementManager.252": "true",
+    "RunOnceActivity.git.unshallow": "true",
+    "RunOnceActivity.typescript.service.memoryLimit.init": "true",
+    "Spring Boot.6000 - 认证中心.executor": "Run",
+    "Spring Boot.6001 - 系统服务.executor": "Run",
+    "Spring Boot.6002 - 资源服务.executor": "Run",
+    "Spring Boot.6003 - 档案服务.executor": "Run",
+    "Spring Boot.6004 - 履约者服务.executor": "Run",
+    "Spring Boot.6005 - 订单服务.executor": "Run",
+    "Spring Boot.6006 - 服务类型服务.executor": "Run",
+    "Spring Boot.8080 - 网关.executor": "Run",
+    "Spring Boot.8091 - 分布式事务.executor": "Run",
+    "Spring Boot.8848 - 注册中心.executor": "Run",
+    "git-widget-placeholder": "dev/shenliang",
+    "kotlin-language-version-configured": "true",
+    "last_opened_file_path": "E:/CodeProjects/Yingpaipay/Pet System/pet-system",
+    "nodejs_package_manager_path": "npm",
+    "project.structure.last.edited": "Modules",
+    "project.structure.proportion": "0.0",
+    "project.structure.side.proportion": "0.0",
+    "run.configurations.included.in.services": "true",
+    "settings.editor.selected.configurable": "com.itangcent.idea.plugin.configurable.AccountConfigurable.apifox",
+    "vue.rearranger.settings.migration": "true"
   },
-  &quot;keyToStringList&quot;: {
-    &quot;DatabaseDriversLRU&quot;: [
-      &quot;mysql&quot;
+  "keyToStringList": {
+    "DatabaseDriversLRU": [
+      "mysql"
     ],
-    &quot;com.intellij.ide.scratch.LRUPopupBuilder$1/&quot;: [
-      &quot;MySQL&quot;
+    "com.intellij.ide.scratch.LRUPopupBuilder$1/": [
+      "MySQL"
     ]
   }
-}</component>
+}]]></component>
   <component name="RecentsManager">
     <key name="CreateClassDialog.RecentsKey">
       <recent name="org.dromara.order.service.impl" />
@@ -144,11 +146,6 @@
         <entry key="SpringBootApplicationConfigurationType">
           <value>
             <map>
-              <entry key="8848 - 注册中心" value="FAILED" />
-              <entry key="8080 - 网关" value="FAILED" />
-              <entry key="8091 - 分布式事务" value="FAILED" />
-              <entry key="8800 - 定时任务" value="STOPPED" />
-              <entry key="9100 - 监控" value="STOPPED" />
               <entry key="6000 - 认证中心" value="STOPPED" />
               <entry key="6001 - 系统服务" value="STOPPED" />
               <entry key="6002 - 资源服务" value="STOPPED" />
@@ -161,6 +158,11 @@
               <entry key="7002 - 工作流" value="STOPPED" />
               <entry key="7003 - 演示用例" value="STOPPED" />
               <entry key="7004 - 消息队列测试" value="STOPPED" />
+              <entry key="8080 - 网关" value="FAILED" />
+              <entry key="8091 - 分布式事务" value="FAILED" />
+              <entry key="8800 - 定时任务" value="STOPPED" />
+              <entry key="8848 - 注册中心" value="STOPPED" />
+              <entry key="9100 - 监控" value="STOPPED" />
             </map>
           </value>
         </entry>
@@ -577,22 +579,7 @@
       <workItem from="1780456710603" duration="123000" />
       <workItem from="1780456838743" duration="1978000" />
       <workItem from="1780468403239" duration="686000" />
-    </task>
-    <task id="LOCAL-00026" summary="补全">
-      <option name="closed" value="true" />
-      <created>1773112849848</created>
-      <option name="number" value="00026" />
-      <option name="presentableId" value="LOCAL-00026" />
-      <option name="project" value="LOCAL" />
-      <updated>1773112849848</updated>
-    </task>
-    <task id="LOCAL-00027" summary="地图调度基本完成">
-      <option name="closed" value="true" />
-      <created>1773125291161</created>
-      <option name="number" value="00027" />
-      <option name="presentableId" value="LOCAL-00027" />
-      <option name="project" value="LOCAL" />
-      <updated>1773125291161</updated>
+      <workItem from="1780469964642" duration="3819000" />
     </task>
     <task id="LOCAL-00028" summary="服务列表新增备注信息">
       <option name="closed" value="true" />
@@ -970,7 +957,23 @@
       <option name="project" value="LOCAL" />
       <updated>1780465381133</updated>
     </task>
-    <option name="localTasksCounter" value="75" />
+    <task id="LOCAL-00075" summary="修复运行配置">
+      <option name="closed" value="true" />
+      <created>1780469985372</created>
+      <option name="number" value="00075" />
+      <option name="presentableId" value="LOCAL-00075" />
+      <option name="project" value="LOCAL" />
+      <updated>1780469985373</updated>
+    </task>
+    <task id="LOCAL-00076" summary="更新运行配置">
+      <option name="closed" value="true" />
+      <created>1780470194138</created>
+      <option name="number" value="00076" />
+      <option name="presentableId" value="LOCAL-00076" />
+      <option name="project" value="LOCAL" />
+      <updated>1780470194138</updated>
+    </task>
+    <option name="localTasksCounter" value="77" />
     <servers />
   </component>
   <component name="TypeScriptGeneratedFilesManager">
@@ -1033,8 +1036,6 @@
   <component name="VcsManagerConfiguration">
     <option name="CHECK_CODE_SMELLS_BEFORE_PROJECT_COMMIT" value="false" />
     <option name="CHECK_NEW_TODO" value="false" />
-    <MESSAGE value="修复bug" />
-    <MESSAGE value="优化列表查询性能" />
     <MESSAGE value="补全导出功能" />
     <MESSAGE value="删除多余项" />
     <MESSAGE value="补充宠物数据权限;修复站点隔离时的空指针异常" />
@@ -1058,7 +1059,9 @@
     <MESSAGE value="更新 IDEA 运行配置和 git 索引" />
     <MESSAGE value="更新枚举" />
     <MESSAGE value="更新 git 索引" />
-    <option name="LAST_COMMIT_MESSAGE" value="更新 git 索引" />
+    <MESSAGE value="修复运行配置" />
+    <MESSAGE value="更新运行配置" />
+    <option name="LAST_COMMIT_MESSAGE" value="更新运行配置" />
   </component>
   <component name="XSLT-Support.FileAssociations.UIState">
     <expand />

+ 62 - 3
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/dubbo/RemoteFulfillerServiceImpl.java

@@ -16,6 +16,7 @@ import org.dromara.fulfiller.api.RemoteFulfillerService;
 import org.dromara.fulfiller.api.domain.vo.RemoteFulfillerVo;
 import org.dromara.fulfiller.api.model.FulfillerLoginUser;
 import org.dromara.fulfiller.constants.FlfActionTypeConstant;
+import org.dromara.fulfiller.constants.FlfRewardTargetConstant;
 import org.dromara.fulfiller.domain.*;
 import org.dromara.fulfiller.domain.vo.FlfLevelConfigVo;
 import org.dromara.fulfiller.enums.FlfBalanceBizTypeEnum;
@@ -50,6 +51,7 @@ public class RemoteFulfillerServiceImpl implements RemoteFulfillerService {
     private final FlfPointsLogMapper pointsLogMapper;
     private final FlfComplaintLogMapper complaintLogMapper;
     private final FlfViolationLogMapper violationLogMapper;
+    private final FlfRewardLogMapper rewardLogMapper;
 
     private final IFlfLevelConfigService levelConfigService;
 
@@ -210,15 +212,72 @@ public class RemoteFulfillerServiceImpl implements RemoteFulfillerService {
              */
             // 上门准时率低于a%,自动扣罚积分x
             if (onTimeCount * 10000 < config.getDegradeOntimeRate()) {
-                fulfiller.setPoints(fulfiller.getPoints() - config.getDegradeOntimeRateScore());
+                int deduct = config.getDegradeOntimeRateScore();
+                fulfiller.setPoints(fulfiller.getPoints() - deduct);
+                // 记录积分日志
+                FlfPointsLog plog = new FlfPointsLog();
+                plog.setFulfillerId(fulfiller.getId());
+                plog.setType(FlfActionTypeConstant.REDUCE);
+                plog.setBizType(FlfPointsBizTypeEnum.LEVEL_POINTS.getValue());
+                plog.setAmount(deduct);
+                plog.setPointsAfter(fulfiller.getPoints());
+                plog.setReason("上门准时率过低,自动扣罚积分");
+                pointsLogMapper.insert(plog);
+                // 记录奖惩日志
+                FlfRewardLog rlog = new FlfRewardLog();
+                rlog.setFulfillerId(fulfiller.getId());
+                rlog.setType(FlfActionTypeConstant.REDUCE);
+                rlog.setBizType(FlfPointsBizTypeEnum.LEVEL_POINTS.getValue());
+                rlog.setTarget(FlfRewardTargetConstant.POINTS);
+                rlog.setAmount(deduct);
+                rlog.setReason("上门准时率过低,自动扣罚积分");
+                rewardLogMapper.insert(rlog);
             }
             // 完成订单为y,自动扣罚积分y2
             if (count < config.getDegradeCompleteOrderQuality()) {
-                fulfiller.setPoints(fulfiller.getPoints() - config.getDegradeCompleteOrderQualityScore());
+                int deduct = config.getDegradeCompleteOrderQualityScore();
+                fulfiller.setPoints(fulfiller.getPoints() - deduct);
+                // 记录积分日志
+                FlfPointsLog plog = new FlfPointsLog();
+                plog.setFulfillerId(fulfiller.getId());
+                plog.setType(FlfActionTypeConstant.REDUCE);
+                plog.setBizType(FlfPointsBizTypeEnum.LEVEL_POINTS.getValue());
+                plog.setAmount(deduct);
+                plog.setPointsAfter(fulfiller.getPoints());
+                plog.setReason("完成订单数不足,自动扣罚积分");
+                pointsLogMapper.insert(plog);
+                // 记录奖惩日志
+                FlfRewardLog rlog = new FlfRewardLog();
+                rlog.setFulfillerId(fulfiller.getId());
+                rlog.setType(FlfActionTypeConstant.REDUCE);
+                rlog.setBizType(FlfPointsBizTypeEnum.LEVEL_POINTS.getValue());
+                rlog.setTarget(FlfRewardTargetConstant.POINTS);
+                rlog.setAmount(deduct);
+                rlog.setReason("完成订单数不足,自动扣罚积分");
+                rewardLogMapper.insert(rlog);
             }
             // 投诉率达到a%,自动扣罚积分x
             if (complaintCount * 10000 >= config.getDegradeComplaintCount()) {
-                fulfiller.setPoints(fulfiller.getPoints() - config.getDegradeComplaintCountScore());
+                int deduct = config.getDegradeComplaintCountScore();
+                fulfiller.setPoints(fulfiller.getPoints() - deduct);
+                // 记录积分日志
+                FlfPointsLog plog = new FlfPointsLog();
+                plog.setFulfillerId(fulfiller.getId());
+                plog.setType(FlfActionTypeConstant.REDUCE);
+                plog.setBizType(FlfPointsBizTypeEnum.LEVEL_POINTS.getValue());
+                plog.setAmount(deduct);
+                plog.setPointsAfter(fulfiller.getPoints());
+                plog.setReason("投诉率过高,自动扣罚积分");
+                pointsLogMapper.insert(plog);
+                // 记录奖惩日志
+                FlfRewardLog rlog = new FlfRewardLog();
+                rlog.setFulfillerId(fulfiller.getId());
+                rlog.setType(FlfActionTypeConstant.REDUCE);
+                rlog.setBizType(FlfPointsBizTypeEnum.LEVEL_POINTS.getValue());
+                rlog.setTarget(FlfRewardTargetConstant.POINTS);
+                rlog.setAmount(deduct);
+                rlog.setReason("投诉率过高,自动扣罚积分");
+                rewardLogMapper.insert(rlog);
             }
 
             /**

+ 2 - 0
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/enums/FlfPointsBizTypeEnum.java

@@ -17,6 +17,8 @@ public enum FlfPointsBizTypeEnum {
     ORDER_FINISH("order_finish", "订单完成"),
 
     VIOLATION_PUNISH("violation_punish", "违规惩罚"),
+
+    LEVEL_POINTS("level_points", "等级积分处理"),
     ;
     private final String value;
     private final String label;

+ 2 - 0
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/enums/FlfRewardBizTypeEnum.java

@@ -14,6 +14,8 @@ public enum FlfRewardBizTypeEnum {
     ORDER_REWARD("order_reward", "订单奖励"),
     ORDER_PUNISH("admin_punish", "订单惩罚"),
     ORDER_FINISH("order_finish", "订单完成"),
+
+    LEVEL_POINTS("level_points", "等级积分处理"),
     ;
     private final String value;
     private final String label;