Parcourir la source

'添加加气平台退款'

2297027248@qq.com il y a 2 ans
Parent
commit
c01bf8247e

+ 51 - 65
.idea/workspace.xml

@@ -26,29 +26,15 @@
   </component>
   <component name="ChangeListManager">
     <list default="true" id="d95263d0-9dff-44b4-8deb-343711f78d5d" name="Default Changelist" comment="针对退款时将所有的订单信息进行退款2021-10-15">
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__com_huifu_adapay_adapay_java_sdk_1_2_10.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__com_huifu_adapay_core_adapay_core_sdk_1_2_10.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__com_huifu_dg_demo_3_0_1_sources_3_0_1.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__com_huifu_dg_java_sdk_3_0_1_3_0_1.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__com_huifu_dg_java_sdk_3_0_1_sources_3_0_1.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__junit_junit_4_12.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__org_apache_httpcomponents_httpmime_4_5_12.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__org_eclipse_paho_org_eclipse_paho_client_mqttv3_1_2_0.xml" beforeDir="false" />
-      <change beforePath="$PROJECT_DIR$/.idea/libraries/Maven__org_hamcrest_hamcrest_core_1_3.xml" beforeDir="false" />
       <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
       <change beforePath="$PROJECT_DIR$/out/artifacts/SAAS_AFTEREND2_jar/SAAS-AFTEREND2.jar" beforeDir="false" afterPath="$PROJECT_DIR$/out/artifacts/SAAS_AFTEREND2_jar/SAAS-AFTEREND2.jar" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-admin/target/yijia-admin.jar" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-admin/target/yijia-admin.jar" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-admin/target/yijia-admin.jar.original" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-admin/target/yijia-admin.jar.original" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-admin/yijia-admin.iml" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-admin/yijia-admin.iml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-common/target/yijia-common-1.0.1.jar" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-common/target/yijia-common-1.0.1.jar" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-station/pom.xml" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-station/pom.xml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-station/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-station/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-station/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-station/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-station/target/yijia-station-1.0.1.jar" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-station/target/yijia-station-1.0.1.jar" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-station/yijia-station.iml" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-station/yijia-station.iml" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-system/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" afterDir="false" />
-      <change beforePath="$PROJECT_DIR$/yijia-system/target/yijia-system-1.0.1.jar" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-system/target/yijia-system-1.0.1.jar" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/yijia-common/src/main/java/com/yijia/common/core/domain/entity/ShiftClass.java" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-common/src/main/java/com/yijia/common/core/domain/entity/ShiftClass.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/yijia-common/target/classes/com/yijia/common/core/domain/entity/ShiftClass.class" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-common/target/classes/com/yijia/common/core/domain/entity/ShiftClass.class" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/controller/PayOrderController.java" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/controller/PayOrderController.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/IPayOrderService.java" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/IPayOrderService.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/yijia-system/src/main/resources/mapper/system/ShiftClassMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-system/src/main/resources/mapper/system/ShiftClassMapper.xml" afterDir="false" />
+      <change beforePath="$PROJECT_DIR$/yijia-system/target/classes/mapper/system/ShiftClassMapper.xml" beforeDir="false" afterPath="$PROJECT_DIR$/yijia-system/target/classes/mapper/system/ShiftClassMapper.xml" afterDir="false" />
     </list>
     <option name="SHOW_DIALOG" value="false" />
     <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -322,7 +308,7 @@
       <workItem from="1665190910176" duration="2359000" />
       <workItem from="1665277043309" duration="10334000" />
       <workItem from="1665622771275" duration="5158000" />
-      <workItem from="1665709084314" duration="9290000" />
+      <workItem from="1665709084314" duration="18983000" />
     </task>
     <task id="LOCAL-00001" summary="前端配置文件package-config.json删除">
       <created>1619772586309</created>
@@ -722,62 +708,62 @@
     <option name="LAST_COMMIT_MESSAGE" value="针对退款时将所有的订单信息进行退款2021-10-15" />
   </component>
   <component name="WindowStateProjectService">
-    <state x="765" y="269" key="#com.intellij.ide.util.MemberChooser" timestamp="1665365073143">
+    <state x="765" y="269" key="#com.intellij.ide.util.MemberChooser" timestamp="1665737205704">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state x="765" y="269" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1160@0.0.1920.1160" timestamp="1665365073143" />
+    <state x="765" y="269" key="#com.intellij.ide.util.MemberChooser/0.0.1920.1160@0.0.1920.1160" timestamp="1665737205704" />
     <state x="740" y="341" key="FileChooserDialogImpl" timestamp="1664420679024">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
     <state x="740" y="341" key="FileChooserDialogImpl/0.0.1920.1160@0.0.1920.1160" timestamp="1664420679024" />
-    <state width="1860" height="337" key="GridCell.Tab.0.bottom" timestamp="1665729905724">
+    <state width="1860" height="337" key="GridCell.Tab.0.bottom" timestamp="1665973506135">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.0.bottom/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905724" />
-    <state width="1860" height="337" key="GridCell.Tab.0.center" timestamp="1665729905723">
+    <state width="1860" height="337" key="GridCell.Tab.0.bottom/0.0.1920.1160@0.0.1920.1160" timestamp="1665973506135" />
+    <state width="1860" height="337" key="GridCell.Tab.0.center" timestamp="1665973506135">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.0.center/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905723" />
-    <state width="1860" height="337" key="GridCell.Tab.0.left" timestamp="1665729905723">
+    <state width="1860" height="337" key="GridCell.Tab.0.center/0.0.1920.1160@0.0.1920.1160" timestamp="1665973506135" />
+    <state width="1860" height="337" key="GridCell.Tab.0.left" timestamp="1665973506134">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.0.left/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905723" />
-    <state width="1860" height="337" key="GridCell.Tab.0.right" timestamp="1665729905724">
+    <state width="1860" height="337" key="GridCell.Tab.0.left/0.0.1920.1160@0.0.1920.1160" timestamp="1665973506134" />
+    <state width="1860" height="337" key="GridCell.Tab.0.right" timestamp="1665973506135">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.0.right/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905724" />
-    <state width="1860" height="337" key="GridCell.Tab.1.bottom" timestamp="1665729905576">
+    <state width="1860" height="337" key="GridCell.Tab.0.right/0.0.1920.1160@0.0.1920.1160" timestamp="1665973506135" />
+    <state width="1860" height="337" key="GridCell.Tab.1.bottom" timestamp="1665973505931">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.1.bottom/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905576" />
-    <state width="1860" height="337" key="GridCell.Tab.1.center" timestamp="1665729905576">
+    <state width="1860" height="337" key="GridCell.Tab.1.bottom/0.0.1920.1160@0.0.1920.1160" timestamp="1665973505931" />
+    <state width="1860" height="337" key="GridCell.Tab.1.center" timestamp="1665973505931">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.1.center/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905576" />
-    <state width="1860" height="337" key="GridCell.Tab.1.left" timestamp="1665729905576">
+    <state width="1860" height="337" key="GridCell.Tab.1.center/0.0.1920.1160@0.0.1920.1160" timestamp="1665973505931" />
+    <state width="1860" height="337" key="GridCell.Tab.1.left" timestamp="1665973505931">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.1.left/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905576" />
-    <state width="1860" height="337" key="GridCell.Tab.1.right" timestamp="1665729905576">
+    <state width="1860" height="337" key="GridCell.Tab.1.left/0.0.1920.1160@0.0.1920.1160" timestamp="1665973505931" />
+    <state width="1860" height="337" key="GridCell.Tab.1.right" timestamp="1665973505931">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.1.right/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905576" />
-    <state width="1860" height="337" key="GridCell.Tab.2.bottom" timestamp="1665729905576">
+    <state width="1860" height="337" key="GridCell.Tab.1.right/0.0.1920.1160@0.0.1920.1160" timestamp="1665973505931" />
+    <state width="1860" height="337" key="GridCell.Tab.2.bottom" timestamp="1665973505932">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.2.bottom/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905576" />
-    <state width="1860" height="337" key="GridCell.Tab.2.center" timestamp="1665729905576">
+    <state width="1860" height="337" key="GridCell.Tab.2.bottom/0.0.1920.1160@0.0.1920.1160" timestamp="1665973505932" />
+    <state width="1860" height="337" key="GridCell.Tab.2.center" timestamp="1665973505932">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.2.center/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905576" />
-    <state width="1860" height="337" key="GridCell.Tab.2.left" timestamp="1665729905576">
+    <state width="1860" height="337" key="GridCell.Tab.2.center/0.0.1920.1160@0.0.1920.1160" timestamp="1665973505932" />
+    <state width="1860" height="337" key="GridCell.Tab.2.left" timestamp="1665973505932">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.2.left/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905576" />
-    <state width="1860" height="337" key="GridCell.Tab.2.right" timestamp="1665729905576">
+    <state width="1860" height="337" key="GridCell.Tab.2.left/0.0.1920.1160@0.0.1920.1160" timestamp="1665973505932" />
+    <state width="1860" height="337" key="GridCell.Tab.2.right" timestamp="1665973505932">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
-    <state width="1860" height="337" key="GridCell.Tab.2.right/0.0.1920.1160@0.0.1920.1160" timestamp="1665729905576" />
+    <state width="1860" height="337" key="GridCell.Tab.2.right/0.0.1920.1160@0.0.1920.1160" timestamp="1665973505932" />
     <state x="461" y="231" key="SettingsEditor" timestamp="1663724002207">
       <screen x="0" y="0" width="1920" height="1160" />
     </state>
@@ -1077,87 +1063,87 @@
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>538</line>
+          <line>545</line>
           <option name="timeStamp" value="228" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>540</line>
+          <line>547</line>
           <option name="timeStamp" value="229" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>544</line>
+          <line>551</line>
           <option name="timeStamp" value="230" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>545</line>
+          <line>552</line>
           <option name="timeStamp" value="231" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>546</line>
+          <line>553</line>
           <option name="timeStamp" value="232" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>534</line>
+          <line>541</line>
           <option name="timeStamp" value="233" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>535</line>
+          <line>542</line>
           <option name="timeStamp" value="234" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>536</line>
+          <line>543</line>
           <option name="timeStamp" value="235" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>532</line>
+          <line>539</line>
           <option name="timeStamp" value="236" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>525</line>
+          <line>532</line>
           <option name="timeStamp" value="239" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>550</line>
+          <line>557</line>
           <option name="timeStamp" value="240" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>549</line>
+          <line>556</line>
           <option name="timeStamp" value="241" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>477</line>
+          <line>484</line>
           <option name="timeStamp" value="244" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>478</line>
+          <line>485</line>
           <option name="timeStamp" value="245" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>456</line>
+          <line>463</line>
           <option name="timeStamp" value="246" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>458</line>
+          <line>465</line>
           <option name="timeStamp" value="247" />
         </line-breakpoint>
         <line-breakpoint enabled="true" type="java-line">
           <url>file://$PROJECT_DIR$/yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java</url>
-          <line>475</line>
+          <line>482</line>
           <option name="timeStamp" value="248" />
         </line-breakpoint>
         <line-breakpoint type="java-method">

BIN
out/artifacts/SAAS_AFTEREND2_jar/SAAS-AFTEREND2.jar


+ 11 - 0
yijia-common/src/main/java/com/yijia/common/core/domain/entity/ShiftClass.java

@@ -54,6 +54,17 @@ public class ShiftClass extends BaseEntity
     /** 班次标识 */
     private String delFlag;
 
+    /** 班次标识 */
+    private String stationName;
+
+
+    public String getStationName() {
+        return stationName;
+    }
+
+    public void setStationName(String stationName) {
+        this.stationName = stationName;
+    }
 
     public Integer getStationId() {
         return stationId;

BIN
yijia-common/target/classes/com/yijia/common/core/domain/entity/ShiftClass.class


+ 23 - 0
yijia-station/src/main/java/com/yijia/station/controller/PayOrderController.java

@@ -474,6 +474,29 @@ public class PayOrderController extends BaseController
 
 
     /**
+     * lng线上退款
+     */
+    @GetMapping(value = "/examinRefundLNGSuccess")
+    public AjaxResult refund(@RequestBody PayOrder payOrder)
+    {
+
+        PayOrder payOrder1=payOrderService.selectPayOrderById(payOrder.getOrderId());
+        if(payOrder1.getStatus().equals("3")){
+            return AjaxResult.error("已经被线上退款,不能重复退款");
+        }
+        if(payOrder1.getStatus().equals("2")){
+            return AjaxResult.error("已经被退款,不能重复退款");
+        }
+        try {
+            AjaxResult ajaxResult=payOrderService.lngRefund(payOrder);
+            return ajaxResult;
+        } catch (Exception e) {
+            return AjaxResult.error(e.getMessage());
+        }
+    }
+
+
+    /**
      * 线上订单退款
      */
 

+ 3 - 0
yijia-station/src/main/java/com/yijia/station/service/IPayOrderService.java

@@ -280,4 +280,7 @@ public interface IPayOrderService
     public List<PayOrder> selectUserPayOrderList(PayOrder payOrder);
 
     public AjaxResult sxfRefund(PayOrder payOrder) throws  Exception;
+
+
+    public AjaxResult lngRefund(PayOrder payOrder) throws  Exception;
 }

+ 80 - 0
yijia-station/src/main/java/com/yijia/station/service/impl/PayOrderServiceImpl.java

@@ -13,6 +13,8 @@ import com.saobei.open.sdk.model.requst.trade.SaobeiTradeRefundRequest;
 import com.saobei.open.sdk.model.response.trade.SaobeiTradeRefundResponse;
 import com.yijia.common.core.domain.AjaxResult;
 import com.yijia.common.core.domain.entity.SysDept;
+import com.yijia.common.core.domain.model.LoginUser;
+import com.yijia.common.utils.SecurityUtils;
 import com.yijia.customer.domain.CustomerGradeSetting;
 import com.yijia.customer.domain.CustomerManage;
 import com.yijia.customer.service.ICustomerGradeSettingService;
@@ -24,8 +26,10 @@ import com.yijia.integral.service.ICustomerPointsService;
 import com.yijia.station.controller.RSASignature;
 import com.yijia.station.controller.SXFPaySign;
 import com.yijia.station.domain.PayOrder;
+import com.yijia.station.domain.StationBalanceChange;
 import com.yijia.station.mapper.PayOrderMapper;
 import com.yijia.station.service.IPayOrderService;
+import com.yijia.station.service.IStationBalanceChangeService;
 import com.yijia.station.utils.ConsumeType;
 import com.yijia.station.utils.HttpUtils;
 import com.yijia.station.utils.Request;
@@ -78,6 +82,9 @@ public class PayOrderServiceImpl implements IPayOrderService
     @Autowired
     private PayOrderMapper payOrderMapper;
 
+    @Autowired
+    private IStationBalanceChangeService stationBalanceChangeService;
+
     /**
      * 查询订单支付
      *
@@ -660,6 +667,79 @@ public class PayOrderServiceImpl implements IPayOrderService
     }
 
 
+    /**
+     *
+     * 将退款的订单关联信息取消
+     *
+     * */
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public AjaxResult lngRefund( PayOrder payOrder1) throws  Exception
+    {
+        int i=0;
+        PayOrder payOrder=payOrderMapper.selectPayOrderById(payOrder1.getOrderId());
+        SysDept sysDept=deptService.selectDeptById(payOrder.getStationId());
+
+        //添加退款记录
+        LoginUser currentUser = SecurityUtils.getLoginUser();
+
+        StationBalanceChange stationBalanceChange=new StationBalanceChange();
+        stationBalanceChange.setAmt(payOrder1.getSellAmt());
+        stationBalanceChange.setStationId(payOrder1.getStationId());
+        stationBalanceChange.setType("+");
+        stationBalanceChange.setCreateBy(currentUser.getUser().getUserId()+"");
+
+        Long deptId=payOrder1.getStationId();
+        SysDept dept1=deptService.selectDeptById(deptId);
+
+        Float Balance1= Float.parseFloat(dept1.getBalance().toString());
+        Float value=Float.parseFloat(payOrder1.getSellAmt().toString());
+        stationBalanceChange.setNowAmt(dept1.getBalance());
+        stationBalanceChangeService.insertStationBalanceChange(stationBalanceChange);
+          //更新站点余额
+        SysDept dept=new SysDept();
+        dept.setDeptId(deptId);
+        dept.setBalance(BigDecimal.valueOf(Balance1+value));
+
+         deptService.updateDept(dept);
+
+        payOrder.setStatus("3");
+        payOrder.setExaminUser(currentUser.getUser().getUserId());
+        payOrder.setExaminDate( new Date());
+        payOrder.setExaminStatus("2");
+        i= payOrderMapper.updatePayOrder(payOrder);
+        if(i==0){
+            throw  new SQLException("订单更新失败");
+        }
+        SysRespon respon= new SysRespon();
+        if("02".equals(payOrder.getThirdPayment())){
+            String  amt= payOrder.getAmt().multiply(BigDecimal.valueOf(100))+"";
+            amt=amt.substring(0,amt.length()-3);
+            respon= saoBeiRefund(sysDept.getYunKey(),sysDept.getMerchantNo(),sysDept.getTerminalId(),payOrder.getOrderNo(),amt);
+            if (!"0000".equals(respon.getResponCode())) {
+                throw new SQLException(respon.getResponMessage());
+            }
+        }else if("01".equals(payOrder.getThirdPayment())) {
+            respon= sendSxfRefund(payOrder);
+            if (!"0000".equals(respon.getResponCode())) {
+                throw new SQLException(respon.getResponMessage());
+            }
+        }else if("03".equals(payOrder.getThirdPayment())){
+            respon= HuiFuRefund(sysDept.getMno(),payOrder.getOrderNo(),payOrder.getAmt()+"",payOrder.getPayDate());
+            if (!"0000".equals(respon.getResponCode())) {
+                throw new SQLException(respon.getResponMessage());
+            }
+        }else{
+            BigDecimal  amt= payOrder.getAmt().multiply(BigDecimal.valueOf(100));
+            Long amtvalue=amt.longValue();;
+            respon= tLFusClassPayApply(payOrder,sysDept,amtvalue);
+            if (!"0000".equals(respon.getResponCode())) {
+                throw new SQLException(respon.getResponMessage());
+            }
+        }
+        return AjaxResult.success(1);
+    }
+
 
     //**
     //

+ 18 - 15
yijia-system/src/main/resources/mapper/system/ShiftClassMapper.xml

@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateUser"    column="update_user"    />
         <result property="shiftMask"    column="shift_mask"    />
         <result property="delFlag"    column="del_flag"    />
+        <result property="stationName"    column="station_name"    />
     </resultMap>
 
     <sql id="selectShiftClassVo">
@@ -22,30 +23,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	shift_class_id,
 	shift_start_time,
 	shift_end_time,
-	create_time,
-	create_user,
-	update_time,
-	update_user,
+	a.create_time,
+	a.create_user,
+	a.update_time,
+	a.update_user,
 	station_id,
 	shift_mask,
-	del_flag
+	a.del_flag,
+	b.dept_name as  station_name
 FROM
-	shift_class
+	shift_class  a
+	left join sys_dept b on  a.station_id=b.dept_id
     </sql>
 
     <select id="selectShiftClassList" parameterType="ShiftClass" resultMap="ShiftClassResult">
         <include refid="selectShiftClassVo"/>
         <where>
-            <if test="shiftStartTime != null  and shiftStartTime != ''"> and shift_start_time = #{shiftStartTime}</if>
-            <if test="shiftEndTime != null  and shiftEndTime != ''"> and shift_end_time = #{shiftEndTime}</if>
-            <if test="createTime != null  and createTime != ''"> and create_time = #{createTime}</if>
-            <if test="stationId != null  and stationId != ''"> and station_id = #{stationId}</if>
-            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
-            <if test="updateTime != null  and updateTime != ''"> and update_time = #{updateTime}</if>
-            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
+            <if test="shiftStartTime != null  and shiftStartTime != ''"> and a.shift_start_time = #{shiftStartTime}</if>
+            <if test="shiftEndTime != null  and shiftEndTime != ''"> and a.shift_end_time = #{shiftEndTime}</if>
+            <if test="createTime != null  and createTime != ''"> and a.create_time = #{createTime}</if>
+            <if test="stationId != null  and stationId != ''"> and a.station_id = #{stationId}</if>
+            <if test="createUser != null  and createUser != ''"> and a.create_user = #{createUser}</if>
+            <if test="updateTime != null  and updateTime != ''"> and a.update_time = #{updateTime}</if>
+            <if test="updateUser != null  and updateUser != ''"> and a.update_user = #{updateUser}</if>
 
-            <if test="shiftMask != null  and shiftMask != ''"> and shift_mask = #{shiftMask}</if>
-            <if test="delFlag != null  and delFlag != ''"> and del_flag = #{delFlag}</if>
+            <if test="shiftMask != null  and shiftMask != ''"> and a.shift_mask = #{shiftMask}</if>
+            <if test="delFlag != null  and delFlag != ''"> and a.del_flag = #{delFlag}</if>
         </where>
         order by shift_class_id desc
     </select>

+ 18 - 15
yijia-system/target/classes/mapper/system/ShiftClassMapper.xml

@@ -15,6 +15,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="updateUser"    column="update_user"    />
         <result property="shiftMask"    column="shift_mask"    />
         <result property="delFlag"    column="del_flag"    />
+        <result property="stationName"    column="station_name"    />
     </resultMap>
 
     <sql id="selectShiftClassVo">
@@ -22,30 +23,32 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 	shift_class_id,
 	shift_start_time,
 	shift_end_time,
-	create_time,
-	create_user,
-	update_time,
-	update_user,
+	a.create_time,
+	a.create_user,
+	a.update_time,
+	a.update_user,
 	station_id,
 	shift_mask,
-	del_flag
+	a.del_flag,
+	b.dept_name as  station_name
 FROM
-	shift_class
+	shift_class  a
+	left join sys_dept b on  a.station_id=b.dept_id
     </sql>
 
     <select id="selectShiftClassList" parameterType="ShiftClass" resultMap="ShiftClassResult">
         <include refid="selectShiftClassVo"/>
         <where>
-            <if test="shiftStartTime != null  and shiftStartTime != ''"> and shift_start_time = #{shiftStartTime}</if>
-            <if test="shiftEndTime != null  and shiftEndTime != ''"> and shift_end_time = #{shiftEndTime}</if>
-            <if test="createTime != null  and createTime != ''"> and create_time = #{createTime}</if>
-            <if test="stationId != null  and stationId != ''"> and station_id = #{stationId}</if>
-            <if test="createUser != null  and createUser != ''"> and create_user = #{createUser}</if>
-            <if test="updateTime != null  and updateTime != ''"> and update_time = #{updateTime}</if>
-            <if test="updateUser != null  and updateUser != ''"> and update_user = #{updateUser}</if>
+            <if test="shiftStartTime != null  and shiftStartTime != ''"> and a.shift_start_time = #{shiftStartTime}</if>
+            <if test="shiftEndTime != null  and shiftEndTime != ''"> and a.shift_end_time = #{shiftEndTime}</if>
+            <if test="createTime != null  and createTime != ''"> and a.create_time = #{createTime}</if>
+            <if test="stationId != null  and stationId != ''"> and a.station_id = #{stationId}</if>
+            <if test="createUser != null  and createUser != ''"> and a.create_user = #{createUser}</if>
+            <if test="updateTime != null  and updateTime != ''"> and a.update_time = #{updateTime}</if>
+            <if test="updateUser != null  and updateUser != ''"> and a.update_user = #{updateUser}</if>
 
-            <if test="shiftMask != null  and shiftMask != ''"> and shift_mask = #{shiftMask}</if>
-            <if test="delFlag != null  and delFlag != ''"> and del_flag = #{delFlag}</if>
+            <if test="shiftMask != null  and shiftMask != ''"> and a.shift_mask = #{shiftMask}</if>
+            <if test="delFlag != null  and delFlag != ''"> and a.del_flag = #{delFlag}</if>
         </where>
         order by shift_class_id desc
     </select>