Pine 6 лет назад
Родитель
Сommit
53600c8bf7

+ 1 - 1
pine-admin/src/main/java/com/pine/admin/modules/business/controller/CarBackOrderController.java

@@ -52,7 +52,7 @@ public class CarBackOrderController extends BaseController {
      */
     @ApiOperation(value = "获取选配车退单表数据", notes = "根据id来获取选配车退单表详细信息")
     @RequestMapping(value = "/get/{id}", method = RequestMethod.GET)
-    public Result getCarBackOrderEntity(@PathVariable("id") String id) {
+    public Result getCarBackOrder(@PathVariable("id") String id) {
 
             CarBackOrder data = carBackOrderService.getById(id);
         return Result.success(true, data);

+ 7 - 4
pine-admin/src/main/java/com/pine/admin/modules/business/controller/CarOrderController.java

@@ -146,6 +146,7 @@ public class CarOrderController extends BaseController {
     @ApiOperation(value = "线下审核状态", notes = "线下审核状态")
     public Result offlineReview(@RequestParam(required = true, value = "id") Long id, @RequestParam(required = true, value = "loanStatus") String loanStatus, @RequestParam(required = false, value = "downPaymentRate") BigDecimal downPaymentRate) {
 
+
         boolean num = carOrderService.offlineReview(id, loanStatus, downPaymentRate);
         if (num) {
             return Result.success(true, "线下审核成功");
@@ -188,12 +189,14 @@ public class CarOrderController extends BaseController {
     @PostMapping(value = "/returnorder")
     @ApiOperation(value = "退单", notes = "退单")
     public Result returnorder(@RequestParam(required = true, value = "orderId") String orderId, @RequestParam(required = true, value = "customerId") String customerId) {
-        Boolean refund = carOrderService.refund(orderId, customerId);
-        if (refund) {
-            return Result.success(true, true);
+        String refund = carOrderService.refund(orderId, customerId);
+        if (refund.equals("0")) {
+            return Result.error("不可退款");
+
 
         } else {
-            return Result.error("不可退款");
+            return Result.success(true, refund);
+
         }
     }
 

+ 18 - 4
pine-admin/src/main/java/com/pine/admin/modules/business/entity/CarBackOrder.java

@@ -1,14 +1,18 @@
 package com.pine.admin.modules.business.entity;
 
         import java.math.BigDecimal;
-    import com.fasterxml.jackson.databind.annotation.JsonSerialize;
+
+        import com.fasterxml.jackson.annotation.JsonFormat;
+        import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 import lombok.Data;
-import java.io.Serializable;
+        import org.springframework.format.annotation.DateTimeFormat;
+
+        import java.io.Serializable;
 import java.util.Date;
 
 /**
@@ -16,7 +20,7 @@ import java.util.Date;
  *
  * @author Pine
  * @email 771190883@qq.com
- * @date 2019-07-22 21:11:50
+ * @date 2019-07-29 19:15:44
  */
 @Data
 @JsonSerialize(include = JsonSerialize.Inclusion.NON_NULL)
@@ -83,11 +87,15 @@ public class CarBackOrder implements Serializable {
      * 创建时间
      */
     @ApiModelProperty(value = "创建时间", name = "createTime")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
     /**
      * 审核时间
      */
     @ApiModelProperty(value = "审核时间", name = "auditTime")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date auditTime;
     /**
      * 审核人
@@ -98,7 +106,13 @@ public class CarBackOrder implements Serializable {
      * 完成退定时间
      */
     @ApiModelProperty(value = "完成退定时间", name = "finishTime")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date finishTime;
-
+    /**
+     * 经销商 退款原因 1 1.72小时内,退款  2 线上审核失败,退款  3 线下审核失败,退款 4 72小时后-线下审核前,退款 5 .线下审核后,退款 6  72小时后退款
+     */
+    @ApiModelProperty(value = "经销商 退款原因 1 1.72小时内,退款  2 线上审核失败,退款  3 线下审核失败,退款 4 72小时后-线下审核前,退款 5 .线下审核后,退款 6  72小时后退款", name = "dealerReason")
+    private String dealerReason;
 
 }

+ 8 - 1
pine-admin/src/main/java/com/pine/admin/modules/business/entity/OfflinePayments.java

@@ -1,5 +1,6 @@
 package com.pine.admin.modules.business.entity;
 
+    import com.fasterxml.jackson.annotation.JsonFormat;
     import com.fasterxml.jackson.databind.annotation.JsonSerialize;
 import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
@@ -7,7 +8,9 @@ import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 import lombok.Data;
-import java.io.Serializable;
+    import org.springframework.format.annotation.DateTimeFormat;
+
+    import java.io.Serializable;
 import java.util.Date;
 
 /**
@@ -61,11 +64,15 @@ public class OfflinePayments implements Serializable {
      * 创建时间
      */
     @ApiModelProperty(value = "创建时间", name = "createTime")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date createTime;
     /**
      * 更新时间
      */
     @ApiModelProperty(value = "更新时间", name = "updateTime")
+    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
+    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
     private Date updateTime;
 
 }

+ 1 - 1
pine-admin/src/main/java/com/pine/admin/modules/business/service/CarOrderService.java

@@ -34,6 +34,6 @@ public interface CarOrderService extends BaseService<CarOrder> {
     /**
      * 查询退款
      */
-    Boolean refund(String orderId,String customerId);
+    String refund(String orderId,String customerId);
 }
 

+ 4 - 7
pine-admin/src/main/java/com/pine/admin/modules/business/service/impl/CarOrderServiceImpl.java

@@ -296,7 +296,7 @@ public class CarOrderServiceImpl implements CarOrderService {
             int c = carOrderDao.updateByPrimaryKeySelective(carOrder);
 
             OfflinePayments offlinePayments = new OfflinePayments();
-            offlinePayments.setCarOrderId(carOrder.getCarId());
+            offlinePayments.setCarOrderId(carOrder.getId());
             offlinePayments = offlinePaymentsDao.queryOne(offlinePayments);
             if (null == offlinePayments) {
                 throw new ApiException("非法流程");
@@ -326,7 +326,7 @@ public class CarOrderServiceImpl implements CarOrderService {
     @Override
     @Transactional(rollbackFor = Exception.class)
 
-    public Boolean refund(String orderId, String customerId) {
+    public String refund(String orderId, String customerId) {
         log.info("delivery");
 
         try {
@@ -349,17 +349,14 @@ public class CarOrderServiceImpl implements CarOrderService {
             String s1 = PostUtil.httpPost("http://test.lecshop.cn/admin/offlineaudit.htm", data, "application/json");
             log.info(s1);
             Map maps = (Map) JSON.parse(s1);
+            return maps.get("code").toString();
 
-            if (maps.get("code").equals("1")) {
-                return true;
-            } else {
-                return false;
-            }
         } catch (Exception e) {
             log.info("delivery", e);
             throw new ApiException(e.getMessage());
 
         }
+
     }
 
     private CarOrder getCarOrder(Long id) {

+ 7 - 5
pine-admin/src/main/java/com/pine/admin/shiro/UserRealm.java

@@ -90,15 +90,17 @@ public class UserRealm extends AuthorizingRealm {
         String dealerInfo = (String) token.getPrincipal();
 
         Map dealerMap = (Map) JSON.parse(dealerInfo);
-
+        if (StringUtils.isEmpty(dealerInfo)){
+            throw new AuthenticationException();
+        }
         ShiroUserInfo shiroUserInfo = new ShiroUserInfo(
                 dealerMap.get("name").toString()
                 , dealerMap.get("erp").toString(), dealerMap.get("dealerId").toString(), null);
-        //TODO 后期前段写死
-        List<SysPermission> sysPermissions = new ArrayList<>();
-        sysPermissions.add(sysPermissionService.getSysPermissionById("3"));
+//        //TODO 后期前段写死
+//        List<SysPermission> sysPermissions = new ArrayList<>();
+//        sysPermissions.add(sysPermissionService.getSysPermissionById("3"));
 
-        shiroUserInfo.setMenus(sysPermissions);
+//        shiroUserInfo.setMenus(sysPermissions);
 
         /**
          * 设置权限

+ 14 - 13
pine-admin/src/main/resources/mapper/business/CarBackOrderDao.xml

@@ -20,7 +20,7 @@
         <result property="auditTime" column="audit_time"/>
         <result property="auditor" column="auditor"/>
         <result property="finishTime" column="finish_time"/>
-        <result property="delFlag" column="del_flag"/>
+        <result property="dealerReason" column="dealer_reason"/>
     </resultMap>
 
     <sql id="Base_Column_List">
@@ -38,7 +38,8 @@
                      create_time,
                      audit_time,
                      auditor,
-                     finish_time       </sql>
+                     finish_time,
+                    dealer_reason         </sql>
     <!-- 根据Id查询-->
     <select id="selectByPrimaryKey" resultMap="entityMap" parameterType="java.lang.Integer">
         select
@@ -73,7 +74,7 @@
             <if test="auditTime != null">audit_time,</if>
             <if test="auditor != null">auditor,</if>
             <if test="finishTime != null">finish_time,</if>
-            <if test="delFlag != null">del_flag,</if>
+            <if test="dealerReason != null">dealer_reason,</if>
         </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="id != null">#{id},</if>
@@ -91,7 +92,7 @@
             <if test="auditTime != null">#{auditTime},</if>
             <if test="auditor != null">#{auditor},</if>
             <if test="finishTime != null">#{finishTime},</if>
-            <if test="delFlag != null">#{delFlag},</if>
+            <if test="dealerReason != null">#{dealerReason},</if>
         </trim>
     </insert>
 
@@ -114,7 +115,7 @@
             <if test="auditTime != null">audit_time = #{auditTime},</if>
             <if test="auditor != null">auditor = #{auditor},</if>
             <if test="finishTime != null">finish_time = #{finishTime},</if>
-            <if test="delFlag != null">del_flag = #{delFlag},</if>
+            <if test="dealerReason != null">dealer_reason = #{dealerReason},</if>
         </set>
         where id = #{id,jdbcType=INTEGER}
     </update>
@@ -171,8 +172,8 @@
             <if test="record.finishTime != null and !&quot;&quot;.equals(record.finishTime)">
                 and finish_time = #{record.finishTime}
             </if>
-            <if test="record.delFlag != null and !&quot;&quot;.equals(record.delFlag)">
-                and del_flag = #{record.delFlag}
+            <if test="record.dealerReason != null and !&quot;&quot;.equals(record.dealerReason)">
+                and dealer_reason = #{record.dealerReason}
             </if>
         </where>
         order by id desc
@@ -185,7 +186,7 @@
         <include refid="Base_Column_List"/>
         from ls_car_back_order
         <where>
-            and del_flag = 'N'
+
             <if test="id != null and !&quot;&quot;.equals(id)">
                 and id = #{id}
             </if>
@@ -231,8 +232,8 @@
             <if test="finishTime != null and !&quot;&quot;.equals(finishTime)">
                 and finish_time = #{finishTime}
             </if>
-            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
-                and del_flag = #{delFlag}
+            <if test="dealerReason != null and !&quot;&quot;.equals(dealerReason)">
+                and dealer_reason = #{dealerReason}
             </if>
         </where>
         order by id desc
@@ -245,7 +246,7 @@
         <include refid="Base_Column_List"/>
         from ls_car_back_order
         <where>
-            and del_flag = 'N'
+
             <if test="id != null and !&quot;&quot;.equals(id)">
                 and id = #{id}
             </if>
@@ -291,8 +292,8 @@
             <if test="finishTime != null and !&quot;&quot;.equals(finishTime)">
                 and finish_time = #{finishTime}
             </if>
-            <if test="delFlag != null and !&quot;&quot;.equals(delFlag)">
-                and del_flag = #{delFlag}
+            <if test="dealerReason != null and !&quot;&quot;.equals(dealerReason)">
+                and dealer_reason = #{dealerReason}
             </if>
         </where>
         LIMIT 1

+ 1 - 3
pine-admin/src/main/resources/mapper/business/OfflinePaymentsDao.xml

@@ -94,7 +94,7 @@
         <include refid="Base_Column_List"/>
         from ls_offline_payments
         <where>
-            and del_flag = 'N'
+
             <if test="record.id != null and !&quot;&quot;.equals(record.id)">
                 and id = #{record.id}
             </if>
@@ -133,7 +133,6 @@
         <include refid="Base_Column_List"/>
         from ls_offline_payments
         <where>
-            and del_flag = 'N'
             <if test="id != null and !&quot;&quot;.equals(id)">
                 and id = #{id}
             </if>
@@ -172,7 +171,6 @@
         <include refid="Base_Column_List"/>
         from ls_offline_payments
         <where>
-            and del_flag = 'N'
             <if test="id != null and !&quot;&quot;.equals(id)">
                 and id = #{id}
             </if>