Explorar o código

Merge branch 'feature/支付单重推和bug修复1213' of qng/kmall-haikong into master

更换小票图
钱能归 %!s(int64=3) %!d(string=hai) anos
pai
achega
b60e73ac17

+ 14 - 0
kmall-admin/src/main/java/com/kmall/admin/dao/HaiKongResendMsgDao.java

@@ -2,6 +2,8 @@ package com.kmall.admin.dao;
 
 import com.kmall.admin.entity.HaiKongResendMsgEntity;
 
+import java.util.List;
+
 public interface HaiKongResendMsgDao {
 
     /**
@@ -9,4 +11,16 @@ public interface HaiKongResendMsgDao {
      * @param haiKongResendMsgEntity
      */
     public void saveResendMsg(HaiKongResendMsgEntity haiKongResendMsgEntity);
+
+    /**
+     * 获取需要重推的数据
+     * @return
+     */
+    List<HaiKongResendMsgEntity> queryResendMsg();
+
+    /**
+     * 修改重推信息
+     * @param haiKongResendMsgEntity
+     */
+    void updateResendMsg(HaiKongResendMsgEntity haiKongResendMsgEntity);
 }

+ 5 - 0
kmall-admin/src/main/java/com/kmall/admin/service/OrderService.java

@@ -251,4 +251,9 @@ public interface OrderService {
      * @return
      */
     R resendWayHkBill(String orderSn) throws Exception;
+
+    /**
+     * 重推退款积分,最多五次
+     */
+    void integralTask();
 }

+ 41 - 0
kmall-admin/src/main/java/com/kmall/admin/service/impl/OrderServiceImpl.java

@@ -3604,6 +3604,7 @@ public class OrderServiceImpl implements OrderService {
                 haiKongResendMsgEntity.setInterfaceType(HaiKongMemberSystemUrlEnum.ROLLBACK_MEMBER_SCORE.getUrl());
                 haiKongResendMsgEntity.setRequestMsg(JSON.toJSONString(integralGoBackEntity));
                 haiKongResendMsgEntity.setResponseMsg(responseMsg);
+                haiKongResendMsgEntity.setResendNum(0);
                 haiKongResendMsgEntity.setIsValid(1);
                 haiKongResendMsgDao.saveResendMsg(haiKongResendMsgEntity);
             }
@@ -5248,4 +5249,44 @@ public class OrderServiceImpl implements OrderService {
         }
         return R.ok();
     }
+
+    /**
+     *
+     * 重推退款积分,最多五次
+     */
+    @Override
+    public void integralTask() {
+        //获取重推积分数据
+        List<HaiKongResendMsgEntity> haiKongResendMsgEntities = haiKongResendMsgDao.queryResendMsg();
+        try {
+            if(haiKongResendMsgEntities.size()>0){
+                for(HaiKongResendMsgEntity haiKongResendMsg:haiKongResendMsgEntities) {
+                    Date date = new Date();
+                    String integralGoBackEntityMsg = haiKongResendMsg.getRequestMsg();
+                    String responseMsg = haiKongMemberTemplate.rollbackMemberScore(integralGoBackEntityMsg);
+                    Map<String, Object> res = JSON.parseObject(responseMsg, Map.class);
+                    LOGGER.info("=======> [integralTask-----重推退款积分]" + responseMsg);
+
+                    //解析数据
+                    if ("true".equals(res.get("success").toString())) {
+                        LOGGER.info("=======> [integralTask-----重推退款积分]" + responseMsg);
+                    } else {
+                        LOGGER.error("=======> [integralTask-----重推退款积分]" + responseMsg);
+                        HaiKongResendMsgEntity haiKongResendMsgEntity = new HaiKongResendMsgEntity();
+                        haiKongResendMsgEntity.setResponseMsg(responseMsg);
+                        haiKongResendMsgEntity.setResendNum(haiKongResendMsg.getResendNum()+1);
+                        haiKongResendMsgEntity.setResendTime(date);
+                        haiKongResendMsgEntity.setId(haiKongResendMsg.getId());
+                        haiKongResendMsgDao.updateResendMsg(haiKongResendMsgEntity);
+                    }
+
+                }
+            }
+
+        } catch (Exception e) {
+            e.printStackTrace();
+            LOGGER.info("重推退款积分-----integralTask",e);
+        }
+
+    }
 }

+ 25 - 0
kmall-admin/src/main/java/com/kmall/admin/task/IntegralComeBackTask.java

@@ -0,0 +1,25 @@
+package com.kmall.admin.task;
+
+
+import com.kmall.admin.service.OrderService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.scheduling.annotation.Scheduled;
+import org.springframework.stereotype.Component;
+
+
+/**
+ * 积分回退重推定时任务,重推退款积分,最多五次
+ */
+@Component
+public class IntegralComeBackTask {
+
+    @Autowired
+    private OrderService orderService;
+
+
+
+//    @Scheduled(fixedDelay = 5000L)
+//    public void task() {
+//        orderService.integralTask();
+//    }
+}

+ 1 - 10
kmall-admin/src/main/java/com/kmall/admin/task/OrderRemindsTask.java

@@ -1,21 +1,12 @@
 package com.kmall.admin.task;
 
-import com.kmall.admin.fromcomm.service.SysUserService;
 import com.kmall.admin.service.alarm.Mall2OrderingEarlyWarningRemindsService;
-import com.kmall.admin.websocket.WebSocketServer;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.scheduling.annotation.EnableScheduling;
-import org.springframework.scheduling.annotation.Scheduled;
 import org.springframework.stereotype.Component;
 
-/**
- * 订货提醒定时器
- * @author Scott
- * @email
- * @date 2016年11月30日 下午1:34:24
- */
+
 @Component("orderRemindsTask")
 public class OrderRemindsTask {
     private Logger logger = LoggerFactory.getLogger(getClass());

+ 15 - 0
kmall-admin/src/main/resources/mybatis/mapper/HaiKongResendMsgDao.xml

@@ -11,6 +11,7 @@
 			interface_type,
 			request_msg,
 			response_msg,
+			resend_num,
 			resend_time,
 			is_valid
 		)
@@ -21,10 +22,24 @@
 			#{interfaceType},
 			#{requestMsg},
 			#{responseMsg},
+			#{resendNum},
 			sysdate(),
 			#{isValid}
 		)
 	</insert>
+
+	<select id="queryResendMsg" resultType="com.kmall.admin.entity.HaiKongResendMsgEntity">
+		select id,request_msg as requestMsg,resend_num as resendNum from haikong_resend_msg where resend_num&lt;5 limit 20
+	</select>
+
+	<update id="updateResendMsg"  parameterType="com.kmall.admin.entity.HaiKongResendMsgEntity">
+       update haikong_resend_msg
+              set
+				  response_msg=#{responseMsg},
+				  resend_num=#{resendNum},
+				  last_resend_time=#{lastResendTime}
+              where id=#{id}
+	</update>
 	 
 
 

+ 2 - 2
kmall-admin/src/main/webapp/js/sale/sale.js

@@ -1539,7 +1539,7 @@ function getPrintContentOrder(ticket, callback) {
     var content = "<div style=\"width: 270px;font-family: 微软雅黑;font-size: 8px;\">";
     // 打印ogo
     content += "<div style=\"text-align: center;width: 100%;height: 260px;\">";
-    content += "<img src='/statics/img/cw_logo2.png' style='width: 100%;height: 100%;' />";
+    content += "<img src='/statics/img/zmhk.png' style='width: 100%;height: 100%;' />";
     content += "</div>";
     //小票头
     content += "<div style=\"text-align: center;width: 100%;font-weight:bold;font-size: 13px;\">";
@@ -1689,7 +1689,7 @@ function getPrintContentOrder(ticket, callback) {
     content +=  `<img src='${ticket.ticketMailInfo.storeImgUrl}' style='width: 100%;height: 100%;' />`;
     content += "</div>";
     content += "<div style=\"width: 100%;text-align: center;\">";
-    content += "关注CW大药房客服号,获取更多优惠信息"
+    content += "关注公众号,获取更多优惠信息"
     content += "</div>";
     content += "<div style=\"width: 100%;overflow:hidden;white-space: nowrap;\">--------------------------------------------------</div>";
     content += "<div style=\"width: 100%;height: 50px;\"></div>";

BIN=BIN
kmall-admin/src/main/webapp/statics/img/zmhk.png