From cf17c2f7012fc4351f66c71d66a4aa3a9fe9e34a Mon Sep 17 00:00:00 2001
From: rk <94314517@qq.com>
Date: 星期四, 30 四月 2026 15:24:17 +0800
Subject: [PATCH] 代码生成
---
server/services/src/main/java/com/doumee/service/business/impl/DriverInfoServiceImpl.java | 95 ++
server/services/src/main/java/com/doumee/service/business/AppVersionService.java | 10
server/services/src/main/java/com/doumee/service/business/ShopInfoService.java | 15
server/web/src/main/java/com/doumee/api/web/ConfigApi.java | 9
server/services/src/main/java/com/doumee/config/xyy/vo/OrderStatisResult.java | 36 +
server/services/src/main/java/com/doumee/service/business/impl/PrinterInfoServiceImpl.java | 18
server/admin/src/main/java/com/doumee/api/business/ShopInfoController.java | 27
server/services/src/main/java/com/doumee/config/xyy/dto/AddPrinterRequest.java | 19
server/services/src/main/java/com/doumee/service/business/impl/AreasServiceImpl.java | 19
server/services/src/main/java/com/doumee/dao/business/model/DriverInfo.java | 7
server/services/src/main/java/com/doumee/core/constants/Constants.java | 1
server/services/src/main/java/com/doumee/dao/dto/ShopPrinterDTO.java | 17
server/services/src/main/java/com/doumee/service/business/impl/OrdersRefundServiceImpl.java | 2
server/services/src/main/java/com/doumee/service/business/impl/AppVersionServiceImpl.java | 50 +
server/services/src/main/java/com/doumee/config/xyy/dto/SetVoiceTypeRequest.java | 37 +
server/services/src/main/java/com/doumee/dao/vo/DriverCenterVO.java | 4
server/services/src/main/java/com/doumee/config/xyy/dto/PrinterStatusType.java | 43 +
server/services/src/main/java/com/doumee/config/xyy/vo/PrinterResult.java | 37 +
server/services/src/main/java/com/doumee/config/xyy/dto/UpdPrinterRequest.java | 60 ++
server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java | 12
server/services/src/main/java/com/doumee/dao/business/model/AppVersion.java | 4
server/services/src/main/java/com/doumee/config/xyy/dto/VoiceRequest.java | 61 ++
server/services/src/main/java/com/doumee/dao/dto/DriverVerifyRequest.java | 3
server/services/src/main/java/com/doumee/dao/vo/OrderDetailVO.java | 2
server/services/src/main/resources/application-pro.yml | 5
server/services/src/main/java/com/doumee/dao/vo/ShopWebDetailVO.java | 3
server/services/src/main/java/com/doumee/service/business/DriverInfoService.java | 14
server/services/src/main/java/com/doumee/config/xyy/dto/QueryOrderStateRequest.java | 23
server/services/src/main/java/com/doumee/config/xyy/dto/PrinterRequest.java | 23
server/services/src/main/java/com/doumee/config/xyy/dto/PrintersRequest.java | 24
server/services/src/main/java/com/doumee/config/xyy/dto/PrintRequest.java | 56 +
server/services/src/main/java/com/doumee/config/xyy/XyyConfig.java | 30 +
server/admin/src/main/java/com/doumee/api/business/DriverInfoController.java | 8
server/services/src/main/java/com/doumee/config/xyy/dto/OrderStatusType.java | 43 +
server/services/src/main/java/com/doumee/config/xyy/dto/DelPrinterRequest.java | 19
server/services/src/main/java/com/doumee/config/xyy/dto/RestRequest.java | 59 +
server/services/src/main/java/com/doumee/service/business/OrdersService.java | 5
server/services/src/main/java/com/doumee/config/xyy/dto/QueryOrderStatisRequest.java | 35 +
server/services/src/main/java/com/doumee/service/business/AreasService.java | 2
server/admin/src/main/java/com/doumee/api/business/AppVersionController.java | 49 +
server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java | 108 ++-
server/services/src/main/java/com/doumee/config/xyy/HashSignUtil.java | 49 +
server/services/src/main/resources/application-dev.yml | 4
server/services/src/main/java/com/doumee/config/xyy/dto/AddPrinterRequestItem.java | 23
server/services/src/main/java/com/doumee/service/business/impl/PrintService.java | 297 +++++++++
server/web/src/main/java/com/doumee/api/web/DriverInfoApi.java | 23
/dev/null | 25
server/services/src/main/java/com/doumee/config/xyy/vo/ObjectRestResponse.java | 68 ++
server/services/db/db_change.sql | 12
server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java | 5
server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java | 151 ++++
51 files changed, 1,585 insertions(+), 166 deletions(-)
diff --git a/server/admin/src/main/java/com/doumee/api/business/AppVersionController.java b/server/admin/src/main/java/com/doumee/api/business/AppVersionController.java
index 6c18c4c..9ec971c 100644
--- a/server/admin/src/main/java/com/doumee/api/business/AppVersionController.java
+++ b/server/admin/src/main/java/com/doumee/api/business/AppVersionController.java
@@ -14,11 +14,14 @@
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
+import org.springframework.web.multipart.MultipartFile;
+import org.springframework.web.multipart.MultipartHttpServletRequest;
+import org.springframework.web.multipart.commons.CommonsMultipartResolver;
+import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
+import java.io.PrintWriter;
+import java.util.*;
/**
* APP鐗堟湰绠$悊
@@ -100,4 +103,44 @@
return ApiResponse.success(appVersionService.findById(id));
}
+ @ApiOperation("涓婁紶APP鏂囦欢")
+ @PostMapping(value = "/uploadFile", headers = "content-type=multipart/form-data")
+ public void uploadFile(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ Map<String, Object> context = new HashMap<>();
+ try {
+ CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver();
+ if (multipartResolver.isMultipart(request)) {
+ MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
+ Iterator<String> it = multipartRequest.getFileNames();
+ while (it.hasNext()) {
+ MultipartFile file = multipartRequest.getFile(it.next());
+ if (file != null && !file.isEmpty()) {
+ Map<String, Object> data = appVersionService.uploadFile(file);
+ context.put("success", true);
+ context.put("code", 200);
+ context.put("errno", 0);
+ context.put("data", data);
+ context.put("message", "璇锋眰鎴愬姛");
+ response.setCharacterEncoding("UTF-8");
+ response.setContentType("application/json");
+ PrintWriter out = response.getWriter();
+ out.print(com.alibaba.fastjson.JSONObject.toJSONString(context));
+ out.flush();
+ out.close();
+ return;
+ }
+ }
+ }
+ } catch (Exception e) {
+ context.put("code", 0);
+ context.put("message", "涓婁紶澶辫触");
+ }
+ response.setCharacterEncoding("UTF-8");
+ response.setContentType("application/json");
+ PrintWriter out = response.getWriter();
+ out.print(com.alibaba.fastjson.JSONObject.toJSONString(context));
+ out.flush();
+ out.close();
+ }
+
}
diff --git a/server/admin/src/main/java/com/doumee/api/business/DriverInfoController.java b/server/admin/src/main/java/com/doumee/api/business/DriverInfoController.java
index e83a307..e196dda 100644
--- a/server/admin/src/main/java/com/doumee/api/business/DriverInfoController.java
+++ b/server/admin/src/main/java/com/doumee/api/business/DriverInfoController.java
@@ -9,6 +9,7 @@
import com.doumee.dao.business.model.DriverInfo;
import com.doumee.dao.dto.AuditDTO;
import com.doumee.dao.dto.ChangeStatusDTO;
+import com.doumee.dao.dto.DriverVerifyRequest;
import com.doumee.service.business.DriverInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@@ -99,6 +100,13 @@
return ApiResponse.success(driverInfoService.getDetail(id));
}
+ @ApiOperation("淇敼鍙告満娉ㄥ唽淇℃伅")
+ @PostMapping("/updateDriverInfo")
+ @RequiresPermissions("business:driverInfo:update")
+ public ApiResponse updateDriverInfo(@RequestBody DriverVerifyRequest request) {
+ return ApiResponse.success(driverInfoService.updateDriverInfo(request));
+ }
+
@ApiOperation("瀹℃壒鍙告満瀹炲悕璁よ瘉")
@PostMapping("/audit")
@RequiresPermissions("business:driverInfo:update")
diff --git a/server/admin/src/main/java/com/doumee/api/business/ShopInfoController.java b/server/admin/src/main/java/com/doumee/api/business/ShopInfoController.java
index 55e0888..2e75f13 100644
--- a/server/admin/src/main/java/com/doumee/api/business/ShopInfoController.java
+++ b/server/admin/src/main/java/com/doumee/api/business/ShopInfoController.java
@@ -9,8 +9,8 @@
import com.doumee.dao.business.model.ShopInfo;
import com.doumee.dao.dto.AuditDTO;
import com.doumee.dao.dto.ChangeStatusDTO;
-import com.doumee.dao.dto.PrinterBindDTO;
import com.doumee.dao.dto.ResetPasswordDTO;
+import com.doumee.dao.dto.ShopPrinterDTO;
import com.doumee.dao.dto.ShopUpdateDTO;
import com.doumee.dao.vo.ShopDetailVO;
import com.doumee.service.business.ShopInfoService;
@@ -136,27 +136,12 @@
return ApiResponse.success("淇敼鎴愬姛");
}
- @ApiOperation("缁戝畾鎵撳嵃鏈�")
- @PostMapping("/bindPrinter")
+ @ApiOperation("缁存姢闂ㄥ簵鎵撳嵃鏈篠N")
+ @PostMapping("/maintainPrinter")
@RequiresPermissions("business:shopInfo:update")
- public ApiResponse bindPrinter(@RequestBody @javax.validation.Valid PrinterBindDTO dto) {
- shopInfoService.bindPrinter(dto);
- return ApiResponse.success("缁戝畾鎴愬姛");
- }
-
- @ApiOperation("瑙g粦鎵撳嵃鏈�")
- @PostMapping("/unbindPrinter/{shopId}")
- @RequiresPermissions("business:shopInfo:update")
- public ApiResponse unbindPrinter(@PathVariable Integer shopId) {
- shopInfoService.unbindPrinter(shopId);
- return ApiResponse.success("瑙g粦鎴愬姛");
- }
-
- @ApiOperation("鏌ヨ鎵撳嵃鏈虹姸鎬�")
- @GetMapping("/printerStatus/{shopId}")
- @RequiresPermissions("business:shopInfo:query")
- public ApiResponse queryPrinterStatus(@PathVariable Integer shopId) {
- return ApiResponse.success(shopInfoService.queryPrinterStatus(shopId));
+ public ApiResponse maintainPrinter(@RequestBody ShopPrinterDTO dto) {
+ shopInfoService.maintainPrinterSn(dto);
+ return ApiResponse.success("鎿嶄綔鎴愬姛");
}
}
diff --git a/server/services/db/db_change.sql b/server/services/db/db_change.sql
index 2d5ddb2..37d5d8a 100644
--- a/server/services/db/db_change.sql
+++ b/server/services/db/db_change.sql
@@ -5,9 +5,10 @@
-- ============================================================
--- 2026/04/28 APP鐗堟湰鏂囦欢璺緞瀛楀吀
+-- 2026/04/30 APP鐗堟湰鏂囦欢涓婁紶瀛楀吀閰嶇疆
-- ============================================================
-INSERT INTO `system_dict_data` (`DICT_ID`, `CODE`, `LABEL`, `REMARK`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `DELETED`) VALUES ((SELECT `id` FROM `system_dict` WHERE `code` = 'OSS'), '', 'APP_FILES', 'APP鐗堟湰鏂囦欢璺緞', 0, 0, 1, NOW(), 0);
+INSERT INTO `system_dict_data` (`DICT_ID`, `CODE`, `LABEL`, `REMARK`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `DELETED`) VALUES ((SELECT `id` FROM `system_dict` WHERE `code` = 'OSS'), '', 'APP_FILES', 'APP鐗堟湰鏂囦欢瀛樺偍璺緞', 0, 0, 1, NOW(), 0);
+INSERT INTO `system_dict_data` (`DICT_ID`, `CODE`, `LABEL`, `REMARK`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `DELETED`) VALUES ((SELECT `id` FROM `system_dict` WHERE `code` = 'OSS'), '', 'APP_FILES_URL', 'APP鐗堟湰鏂囦欢璁块棶璺緞鍓嶇紑', 0, 0, 1, NOW(), 0);
-- ============================================================
@@ -20,15 +21,14 @@
INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `MODULE`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:printerInfo:query', '鏌ヨ鎵撳嵃鏈�', '鎵撳嵃鏈轰俊鎭�', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0);
-
-- ============================================================
--- 2026/04/28 鑺儴浜戞墦鍗版満闆嗘垚锛氶棬搴楄〃澧炲姞鎵撳嵃鏈篠N瀛楁
+-- 2026/04/29 鍙告満琛ㄥ鍔犳瀬鍏夋帹閫佸埆鍚嶅瓧娈�
-- ============================================================
-ALTER TABLE `shop_info` ADD COLUMN `PRINTER_SN` VARCHAR(64) DEFAULT NULL COMMENT '鑺儴浜戞墦鍗版満SN缂栧彿' AFTER `BUSINESS_TYPE`;
+ALTER TABLE `driver_info` ADD COLUMN `JPUSH_ALIAS` VARCHAR(64) DEFAULT NULL COMMENT '鏋佸厜鎺ㄩ�佸埆鍚�' AFTER `AUDIT_REMARK`;
-- ============================================================
--- 2026/04/28 鑺儴浜戞墦鍗版満閰嶇疆瀛楀吀锛堣处鍙蜂俊鎭悗缁墜鍔ㄧ淮鎶ODE鍊硷級
+-- 2026/04/28 鑺儴浜戞墦鍗版満閰嶇疆瀛楀吀
-- ============================================================
INSERT INTO `system_dict` (`id`, `code`, `name`, `disabled`, `deleted`) VALUES (106, 'XPYUN_CONFIG', '鑺儴浜戦厤缃�', 0, 0);
INSERT INTO `system_dict_data` (`DICT_ID`, `CODE`, `LABEL`, `REMARK`, `SORT`, `DISABLED`, `CREATE_USER`, `CREATE_TIME`, `DELETED`) VALUES (106, '', 'XPYUN_USER', '鑺儴浜戝紑鍙戣�匢D', 0, 0, 1, NOW(), 0);
diff --git a/server/services/src/main/java/com/doumee/config/xyy/HashSignUtil.java b/server/services/src/main/java/com/doumee/config/xyy/HashSignUtil.java
new file mode 100644
index 0000000..2b04e4d
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/HashSignUtil.java
@@ -0,0 +1,49 @@
+package com.doumee.config.xyy;
+
+import java.io.UnsupportedEncodingException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Formatter;
+
+/**
+ * 鍝堢█绛惧悕宸ュ叿绫�
+ *
+ * @author RabyGao
+ * @date Aug 9, 2019
+ */
+public class HashSignUtil {
+
+ /**
+ * 鍝堢█绛惧悕
+ * @param signSource - 婧愬瓧绗︿覆
+ * @return
+ */
+ public static String sign(String signSource) {
+ String signature = "";
+ try {
+ MessageDigest crypt = MessageDigest.getInstance("SHA-1");
+ crypt.reset();
+ crypt.update(signSource.getBytes("UTF-8"));
+ signature = byteToHex(crypt.digest());
+ }
+ catch (NoSuchAlgorithmException e) {
+ e.printStackTrace();
+ }
+ catch (UnsupportedEncodingException e) {
+ e.printStackTrace();
+ }
+ return signature;
+ }
+
+ private static String byteToHex(final byte[] hash) {
+ Formatter formatter = new Formatter();
+ for (byte b : hash)
+ {
+ formatter.format("%02x", b);
+ }
+ String result = formatter.toString();
+ formatter.close();
+ return result;
+ }
+
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/XyyConfig.java b/server/services/src/main/java/com/doumee/config/xyy/XyyConfig.java
new file mode 100644
index 0000000..c512886
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/XyyConfig.java
@@ -0,0 +1,30 @@
+package com.doumee.config.xyy;
+
+
+import com.doumee.biz.system.SystemDictDataBiz;
+import com.doumee.config.xyy.dto.RestRequest;
+import com.doumee.core.constants.Constants;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Component;
+
+/**
+ * 鑺儴浜戝叕鍏遍厤缃被
+ */
+@Component
+public class XyyConfig {
+
+ @Autowired
+ private SystemDictDataBiz systemDictDataBiz;
+
+ /**
+ * 鐢熸垚閫氱敤鐨勮姹傚ご
+ */
+ public void createRequestHeader(RestRequest request) {
+ String user = systemDictDataBiz.queryByCode(Constants.XPYUN_CONFIG, Constants.XPYUN_USER).getCode();
+ String userKey = systemDictDataBiz.queryByCode(Constants.XPYUN_CONFIG, Constants.XPYUN_USER_KEY).getCode();
+ request.setUser(user);
+ request.setTimestamp(System.currentTimeMillis() + "");
+ request.setSign(HashSignUtil.sign(request.getUser() + userKey + request.getTimestamp()));
+ request.setDebug("0");
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/AddPrinterRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/AddPrinterRequest.java
new file mode 100644
index 0000000..0309383
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/AddPrinterRequest.java
@@ -0,0 +1,19 @@
+package com.doumee.config.xyy.dto;
+
+import lombok.Data;
+
+/**
+ * 娣诲姞鎵撳嵃鏈鸿姹傚弬鏁�
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+@Data
+public class AddPrinterRequest extends RestRequest {
+
+ /**
+ * 璇锋眰椤归泦鍚�
+ */
+ private AddPrinterRequestItem[] items;
+
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/AddPrinterRequestItem.java b/server/services/src/main/java/com/doumee/config/xyy/dto/AddPrinterRequestItem.java
new file mode 100644
index 0000000..503f6d0
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/AddPrinterRequestItem.java
@@ -0,0 +1,23 @@
+package com.doumee.config.xyy.dto;
+
+import lombok.Data;
+
+/**
+ * 娣诲姞鎵撳嵃鏈鸿姹傞」
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+@Data
+public class AddPrinterRequestItem {
+
+ /**
+ * 鎵撳嵃鏈虹紪鍙�
+ */
+ private String sn;
+ /**
+ * 鎵撳嵃鏈哄悕绉�
+ */
+ private String name;
+
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/DelPrinterRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/DelPrinterRequest.java
new file mode 100644
index 0000000..3add3d7
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/DelPrinterRequest.java
@@ -0,0 +1,19 @@
+package com.doumee.config.xyy.dto;
+
+import lombok.Data;
+
+/**
+ * 鍒犻櫎鎵撳嵃鏈鸿姹傚弬鏁�
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+@Data
+public class DelPrinterRequest extends RestRequest {
+
+ /**
+ * 鎵撳嵃鏈虹紪鍙烽泦鍚�
+ */
+ private String[] snlist;
+
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/OrderStatusType.java b/server/services/src/main/java/com/doumee/config/xyy/dto/OrderStatusType.java
new file mode 100644
index 0000000..dc0d782
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/OrderStatusType.java
@@ -0,0 +1,43 @@
+package com.doumee.config.xyy.dto;
+
+/**
+ * 璁㈠崟鐘舵��
+ *
+ * @author RabyGao
+ * @date Aug 8, 2019
+ */
+public enum OrderStatusType {
+
+ /**
+ * 澶勭悊涓�
+ */
+ Processing(0),
+ /**
+ * 瀹屾垚
+ */
+ Completed(1),
+ /**
+ * 澶辫触
+ */
+ Failed(2);
+
+ private final int val;
+
+ public int getVal() {
+ return val;
+ }
+
+ OrderStatusType(int num) {
+ this.val = num;
+ }
+
+ public static OrderStatusType getOrderStatusType(int val) {
+ for (OrderStatusType type : OrderStatusType.values()) {
+ if (type.getVal() == val) {
+ return type;
+ }
+ }
+ return Processing;
+ }
+
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/PrintRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/PrintRequest.java
new file mode 100644
index 0000000..08fe9f2
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/PrintRequest.java
@@ -0,0 +1,56 @@
+package com.doumee.config.xyy.dto;
+
+import lombok.Data;
+
+/**
+ * 鎵撳嵃鏈烘墦鍗拌姹傚弬鏁�
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+@Data
+public class PrintRequest extends RestRequest {
+
+ /**
+ * 鎵撳嵃鏈虹紪鍙�
+ */
+ private String sn;
+
+ /**
+ * 鎵撳嵃鍐呭,涓嶈兘瓒呰繃5000瀛楄妭
+ */
+ private String content;
+
+ /**
+ * 鎵撳嵃浠芥暟锛岄粯璁や负1
+ */
+ private int copies = 1;
+
+ /**
+ * 鎵撳嵃妯″紡锛岄粯璁や负0
+ */
+ private int mode = 0;
+
+ /**
+ * 鏀粯鏂瑰紡41~55锛氭敮浠樺疂 寰俊 ...
+ */
+ private Integer payType;
+ /**
+ * 鏀粯涓庡惁59~61锛氶��娆� 鍒拌处 娑堣垂
+ */
+ private Integer payMode;
+ /**
+ * 鏀粯閲戦
+ */
+ private Double money;
+ /**
+ * 澹伴煶鎾斁妯″紡锛�0 涓哄彇娑堣鍗曟ā寮忥紝1 涓洪潤闊虫ā寮忥紝2 涓烘潵鍗曟挱鏀炬ā寮忥紝榛樿涓� 2 鏉ュ崟鎾斁妯″紡
+ */
+ private Integer voice;
+
+ /**
+ * 鎵撳嵃鎺ュ彛鍥炶皟鍦板潃瀵瑰簲鏍囪瘑(鍙栧�艰寖鍥� [ 1 - 5 ] 鐨勬暣鏁�)锛屽浜巜eb绠$悊鍚庡彴 鈥滃姛鑳借缃�� 鑿滃崟璁剧疆鐣岄潰鐨勬墦鍗版帴鍙e洖璋冩爣璇嗐��
+ */
+ private Integer backurlFlag;
+
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/PrinterRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/PrinterRequest.java
new file mode 100644
index 0000000..91a9e15
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/PrinterRequest.java
@@ -0,0 +1,23 @@
+package com.doumee.config.xyy.dto;
+
+/**
+ * 鎵撳嵃鏈鸿姹傚弬鏁�
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+public class PrinterRequest extends RestRequest {
+
+ /**
+ * 鎵撳嵃鏈虹紪鍙�
+ */
+ private String sn;
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/PrinterStatusType.java b/server/services/src/main/java/com/doumee/config/xyy/dto/PrinterStatusType.java
new file mode 100644
index 0000000..4810118
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/PrinterStatusType.java
@@ -0,0 +1,43 @@
+package com.doumee.config.xyy.dto;
+
+/**
+ * 鎵撳嵃鏈虹姸鎬�
+ *
+ * @author RabyGao
+ * @date Aug 8, 2019
+ */
+public enum PrinterStatusType {
+
+ /**
+ * 绂荤嚎
+ */
+ Offline(0),
+ /**
+ * 鍦ㄧ嚎姝e父
+ */
+ OnlinNormal(1),
+ /**
+ * 鍦ㄧ嚎缂虹焊
+ */
+ OnlineMissingPaper(2);
+
+ private final int val;
+
+ public int getVal() {
+ return val;
+ }
+
+ private PrinterStatusType(int num) {
+ this.val = num;
+ }
+
+ public static PrinterStatusType getPrinterStatusType(int val) {
+ for (PrinterStatusType type : PrinterStatusType.values()) {
+ if (type.getVal() == val) {
+ return type;
+ }
+ }
+ return Offline;
+ }
+
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/PrintersRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/PrintersRequest.java
new file mode 100644
index 0000000..9c7ea55
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/PrintersRequest.java
@@ -0,0 +1,24 @@
+package com.doumee.config.xyy.dto;
+
+import java.util.List;
+
+/**
+ * @author LylJavas
+ * @create 2021/4/14 18:01
+ * @description 鎵归噺鎵撳嵃鏈鸿姹傚弬鏁�
+ */
+public class PrintersRequest extends RestRequest {
+
+ /**
+ * 鎵撳嵃鏈虹紪鍙峰垪琛�
+ */
+ private List<String> snlist;
+
+ public List<String> getSnlist() {
+ return snlist;
+ }
+
+ public void setSnlist(List<String> snlist) {
+ this.snlist = snlist;
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/QueryOrderStateRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/QueryOrderStateRequest.java
new file mode 100644
index 0000000..8f2779d
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/QueryOrderStateRequest.java
@@ -0,0 +1,23 @@
+package com.doumee.config.xyy.dto;
+
+/**
+ * 鏌ヨ璁㈠崟鐘舵�佽姹傚弬鏁�
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+public class QueryOrderStateRequest extends RestRequest {
+
+ /**
+ * 璁㈠崟缂栧彿
+ */
+ private String orderId;
+
+ public String getOrderId() {
+ return orderId;
+ }
+
+ public void setOrderId(String orderId) {
+ this.orderId = orderId;
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/QueryOrderStatisRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/QueryOrderStatisRequest.java
new file mode 100644
index 0000000..c706524
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/QueryOrderStatisRequest.java
@@ -0,0 +1,35 @@
+package com.doumee.config.xyy.dto;
+
+/**
+ * 鏌ヨ璁㈠崟缁熻璇锋眰鍙傛暟
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+public class QueryOrderStatisRequest extends RestRequest {
+
+ /**
+ * 鎵撳嵃鏈虹紪鍙�
+ */
+ private String sn;
+ /**
+ * 鏌ヨ鏃ユ湡锛屾牸寮廦Y-MM-DD锛屽锛�2016-09-20
+ */
+ private String date;
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ public String getDate() {
+ return date;
+ }
+
+ public void setDate(String date) {
+ this.date = date;
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/RestRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/RestRequest.java
new file mode 100644
index 0000000..b23f457
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/RestRequest.java
@@ -0,0 +1,59 @@
+package com.doumee.config.xyy.dto;
+
+/**
+ * 璇锋眰鍏叡鍙傛暟
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+public class RestRequest {
+
+ /**
+ * 鑺儴浜戝悗鍙版敞鍐岀敤鎴峰悕
+ */
+ private String user;
+ /**
+ * 褰撳墠UNIX鏃堕棿鎴筹紝10浣嶏紝绮剧‘鍒扮
+ */
+ private String timestamp;
+ /**
+ * 瀵瑰弬鏁� user + UKEY + timestamp 鎷兼帴鍚庯紙+鍙疯〃绀鸿繛鎺ョ锛夎繘琛孲HA1鍔犲瘑寰楀埌绛惧悕锛屽�间负40浣嶅皬鍐欏瓧绗︿覆
+ */
+ private String sign;
+ /**
+ * debug=1杩斿洖闈瀓son鏍煎紡鐨勬暟鎹�備粎娴嬭瘯鏃跺�欎娇鐢�
+ */
+ private String debug;
+
+ public String getUser() {
+ return user;
+ }
+
+ public void setUser(String user) {
+ this.user = user;
+ }
+
+ public String getTimestamp() {
+ return timestamp;
+ }
+
+ public void setTimestamp(String timestamp) {
+ this.timestamp = timestamp;
+ }
+
+ public String getSign() {
+ return sign;
+ }
+
+ public void setSign(String sign) {
+ this.sign = sign;
+ }
+
+ public String getDebug() {
+ return debug;
+ }
+
+ public void setDebug(String debug) {
+ this.debug = debug;
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/SetVoiceTypeRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/SetVoiceTypeRequest.java
new file mode 100644
index 0000000..da869c4
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/SetVoiceTypeRequest.java
@@ -0,0 +1,37 @@
+package com.doumee.config.xyy.dto;
+
+
+/**
+ * 璁剧疆鎵撳嵃鏈鸿闊崇被鍨嬭姹傚弬鏁�
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+public class SetVoiceTypeRequest extends RestRequest {
+
+ /**
+ * 鎵撳嵃鏈虹紪鍙�
+ */
+ private String sn;
+
+ /**
+ * 澹伴煶绫诲瀷锛� 0鐪熶汉璇煶锛堝ぇ锛� 1鐪熶汉璇煶锛堜腑锛� 2鐪熶汉璇煶锛堝皬锛� 3 鍢�鍢�澹� 4 闈欓煶
+ */
+ private Integer voiceType;
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ public Integer getVoiceType() {
+ return voiceType;
+ }
+
+ public void setVoiceType(Integer voiceType) {
+ this.voiceType = voiceType;
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/UpdPrinterRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/UpdPrinterRequest.java
new file mode 100644
index 0000000..280f77a
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/UpdPrinterRequest.java
@@ -0,0 +1,60 @@
+package com.doumee.config.xyy.dto;
+
+
+/**
+ * 淇敼鎵撳嵃鏈鸿姹傚弬鏁�
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+public class UpdPrinterRequest extends RestRequest {
+
+ /**
+ * 鎵撳嵃鏈虹紪鍙�
+ */
+ private String sn;
+ /**
+ * 鎵撳嵃鏈哄悕绉�
+ */
+ private String name;
+ /**
+ * 鎵撳嵃鏈鸿瘑鍒爜
+ */
+ private String idcode;
+ /**
+ * 娴侀噺鍗″彿鐮�
+ */
+ private String cardno;
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getIdcode() {
+ return idcode;
+ }
+
+ public void setIdcode(String idcode) {
+ this.idcode = idcode;
+ }
+
+ public String getCardno() {
+ return cardno;
+ }
+
+ public void setCardno(String cardno) {
+ this.cardno = cardno;
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/dto/VoiceRequest.java b/server/services/src/main/java/com/doumee/config/xyy/dto/VoiceRequest.java
new file mode 100644
index 0000000..438144d
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/dto/VoiceRequest.java
@@ -0,0 +1,61 @@
+package com.doumee.config.xyy.dto;
+
+
+/**
+ * 浜戝枃鍙挱鏀捐闊宠姹傚弬鏁�
+ *
+ * @author RabyGao
+ * @date Aug 5, 2020
+ */
+public class VoiceRequest extends RestRequest {
+
+ /**
+ * 鎵撳嵃鏈虹紪鍙�
+ */
+ private String sn;
+
+ /**
+ * 鏀粯鏂瑰紡41~55锛氭敮浠樺疂 寰俊 ...
+ */
+ private Integer payType;
+ /**
+ * 鏀粯涓庡惁59~61锛氶��娆� 鍒拌处 娑堣垂
+ */
+ private Integer payMode;
+ /**
+ * 鏀粯閲戦
+ */
+ private Double money;
+
+ public String getSn() {
+ return sn;
+ }
+
+ public void setSn(String sn) {
+ this.sn = sn;
+ }
+
+ public Integer getPayType() {
+ return payType;
+ }
+
+ public void setPayType(Integer payType) {
+ this.payType = payType;
+ }
+
+ public Integer getPayMode() {
+ return payMode;
+ }
+
+ public void setPayMode(Integer payMode) {
+ this.payMode = payMode;
+ }
+
+ public Double getMoney() {
+ return money;
+ }
+
+ public void setMoney(Double money) {
+ this.money = money;
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/vo/ObjectRestResponse.java b/server/services/src/main/java/com/doumee/config/xyy/vo/ObjectRestResponse.java
new file mode 100644
index 0000000..eb5f52f
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/vo/ObjectRestResponse.java
@@ -0,0 +1,68 @@
+package com.doumee.config.xyy.vo;
+
+import lombok.Data;
+
+/**
+ * 杩斿洖鍏叡鍙傛暟
+ *
+ * @param <T>
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+@Data
+public class ObjectRestResponse<T> {
+
+ public static final String REST_RESPONSE_OK = "ok";
+
+ /**
+ * 杩斿洖鐮侊紝姝g‘杩斿洖0锛屻�愭敞鎰忥細缁撴灉姝g‘涓庡惁鐨勫垽鏂鐢ㄦ杩斿洖鍙傛暟銆戯紝閿欒杩斿洖闈為浂
+ */
+ private int code;
+ /**
+ * 缁撴灉鎻愮ず淇℃伅锛屾纭繑鍥炩�漮k鈥濓紝濡傛灉鏈夐敊璇紝杩斿洖閿欒淇℃伅
+ */
+ private String msg;
+ /**
+ * 鏁版嵁绫诲瀷鍜屽唴瀹硅鐪嬬鏈夎繑鍥炲弬鏁癲ata锛屽鏋滄湁閿欒锛岃繑鍥瀗ull
+ */
+ private T data;
+ /**
+ * 鏈嶅姟鍣ㄧ▼搴忔墽琛屾椂闂达紝鍗曚綅锛氭绉�
+ */
+ private long serverExecutedTime;
+
+ public ObjectRestResponse() {
+ this.setCode(0);
+ this.setMsg(REST_RESPONSE_OK);
+ }
+
+ public ObjectRestResponse code(int code) {
+ this.setCode(code);
+ return this;
+ }
+
+ public ObjectRestResponse data(T data) {
+ this.setData(data);
+ return this;
+ }
+
+ public ObjectRestResponse msg(String msg) {
+ this.setMsg(msg);
+ return this;
+ }
+
+ public ObjectRestResponse setResult(int code, T data) {
+ this.setCode(code);
+ this.setData(data);
+ return this;
+ }
+
+ public ObjectRestResponse setResult(int code, T data, String msg) {
+ this.setCode(code);
+ this.setData(data);
+ this.setMsg(msg);
+ return this;
+ }
+
+
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/vo/OrderStatisResult.java b/server/services/src/main/java/com/doumee/config/xyy/vo/OrderStatisResult.java
new file mode 100644
index 0000000..8799092
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/vo/OrderStatisResult.java
@@ -0,0 +1,36 @@
+package com.doumee.config.xyy.vo;
+
+
+/**
+ * 璁㈠崟缁熻缁撴灉
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+public class OrderStatisResult {
+
+ /**
+ * 宸叉墦鍗拌鍗曟暟
+ */
+ private int printed;
+ /**
+ * 绛夊緟鎵撳嵃璁㈠崟鏁�
+ */
+ private int waiting;
+
+ public int getPrinted() {
+ return printed;
+ }
+
+ public void setPrinted(int printed) {
+ this.printed = printed;
+ }
+
+ public int getWaiting() {
+ return waiting;
+ }
+
+ public void setWaiting(int waiting) {
+ this.waiting = waiting;
+ }
+}
diff --git a/server/services/src/main/java/com/doumee/config/xyy/vo/PrinterResult.java b/server/services/src/main/java/com/doumee/config/xyy/vo/PrinterResult.java
new file mode 100644
index 0000000..31a8f15
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/config/xyy/vo/PrinterResult.java
@@ -0,0 +1,37 @@
+package com.doumee.config.xyy.vo;
+
+import lombok.Data;
+
+import java.util.ArrayList;
+import java.util.List;
+
+/**
+ * 鎵归噺娣诲姞鎴栧垹闄ゆ墦鍗版満缁撴灉
+ *
+ * @author RabyGao
+ * @date Aug 7, 2019
+ */
+@Data
+public class PrinterResult {
+
+ public PrinterResult() {
+ success = new ArrayList<>();
+ fail = new ArrayList<>();
+ failMsg=new ArrayList<>();
+ }
+
+ /**
+ * 鎴愬姛鐨勬墦鍗版満缂栧彿闆嗗悎
+ */
+ private List<String> success;
+
+ /**
+ * 澶辫触鐨勬墦鍗版満缂栧彿闆嗗悎
+ */
+ private List<String> fail;
+ /**
+ * 澶辫触鍘熷洜闆嗗悎 璁惧缂栧彿锛氬け璐ュ師鍥�
+ */
+ private List<String> failMsg ;
+
+}
diff --git a/server/services/src/main/java/com/doumee/core/constants/Constants.java b/server/services/src/main/java/com/doumee/core/constants/Constants.java
index 467cfc2..35a15b7 100644
--- a/server/services/src/main/java/com/doumee/core/constants/Constants.java
+++ b/server/services/src/main/java/com/doumee/core/constants/Constants.java
@@ -89,6 +89,7 @@
public static final String BANNER_FILES = "BANNER_FILES";
public static final String ORDERS_FILES = "ORDERS_FILES";
public static final String APP_FILES = "APP_FILES";
+ public static final String APP_FILES_URL = "APP_FILES_URL";
// 杩愯惀閰嶇疆
public static final String OPERATION_CONFIG = "OPERATION_CONFIG";
diff --git a/server/services/src/main/java/com/doumee/core/utils/xpyun/XpyunPrintService.java b/server/services/src/main/java/com/doumee/core/utils/xpyun/XpyunPrintService.java
deleted file mode 100644
index d059d4e..0000000
--- a/server/services/src/main/java/com/doumee/core/utils/xpyun/XpyunPrintService.java
+++ /dev/null
@@ -1,199 +0,0 @@
-package com.doumee.core.utils.xpyun;
-
-import com.alibaba.fastjson.JSON;
-import com.alibaba.fastjson.JSONArray;
-import com.alibaba.fastjson.JSONObject;
-import com.doumee.biz.system.SystemDictDataBiz;
-import com.doumee.core.constants.Constants;
-import com.doumee.core.utils.HttpsUtil;
-import lombok.extern.slf4j.Slf4j;
-import org.apache.commons.lang3.StringUtils;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Service;
-
-import java.nio.charset.StandardCharsets;
-import java.security.MessageDigest;
-import java.text.SimpleDateFormat;
-import java.util.Date;
-import java.util.List;
-
-/**
- * 鑺儴浜戞墦鍗版満API鏈嶅姟
- */
-@Slf4j
-@Service
-public class XpyunPrintService {
-
- private static final String BASE_URL = "https://open.xpyun.net/api/openapi/xprinter/";
-
- @Autowired
- private SystemDictDataBiz systemDictDataBiz;
-
- /**
- * 娣诲姞鎵撳嵃鏈�
- */
- public XpyunResponse addPrinter(String sn, String name) {
- JSONObject body = buildBaseRequest();
- JSONArray printerContent = new JSONArray();
- JSONObject printer = new JSONObject();
- printer.put("sn", sn);
- printer.put("name", name);
- printerContent.add(printer);
- body.put("printerContent", printerContent);
- return callApi("addPrinters", body);
- }
-
- /**
- * 鍒犻櫎鎵撳嵃鏈�
- */
- public XpyunResponse deletePrinter(String sn) {
- JSONObject body = buildBaseRequest();
- JSONArray snlist = new JSONArray();
- snlist.add(sn);
- body.put("snlist", snlist);
- return callApi("delPrinters", body);
- }
-
- /**
- * 鏌ヨ鎵撳嵃鏈虹姸鎬�
- */
- public XpyunResponse queryPrinterStatus(String sn) {
- JSONObject body = buildBaseRequest();
- body.put("sn", sn);
- return callApi("queryPrinterStatus", body);
- }
-
- /**
- * 鎵撳嵃鏍囩
- */
- public XpyunResponse printLabel(String sn, String content) {
- JSONObject body = buildBaseRequest();
- body.put("sn", sn);
- body.put("content", content);
- return callApi("printLabel", body);
- }
-
- /**
- * 鏋勫缓璁㈠崟鏍囩鍐呭 (60mm 脳 60mm = 480 脳 480 dots)
- *
- * 甯冨眬:
- * shopName sn/countSn
- * 璁㈠崟缂栧彿锛歝ode 涓嬪崟鏃堕棿锛歺xx
- * 鏀朵欢淇℃伅锛氬紶涓夛紙鎵嬫満灏惧彿1234锛�
- * 璁㈠崟琛屾潕锛�
- * 琛屾潕绠泵�1 鍙岃偐鍖吤�2
- * 璁㈠崟澶囨敞
- * xxxxxxx
- */
- public String buildOrderLabel(String shopName, String orderCode, String createTime,
- String takeUser, String takePhone,
- String goodsInfo, String remark,
- String snLabel) {
- StringBuilder sb = new StringBuilder();
- sb.append("<PAGE>");
- sb.append("<WIDTH>480</WIDTH>");
- sb.append("<HEIGHT>480</HEIGHT>");
-
- // 绗�1琛�: shopName 宸︿晶, snLabel 鍙充晶
- sb.append("<TEXT X=\"8\" Y=\"8\" W=\"320\" H=\"28\" T=\"16\">")
- .append(escapeXml(shopName)).append("</TEXT>");
- sb.append("<TEXT X=\"340\" Y=\"8\" W=\"140\" H=\"28\" T=\"14\">")
- .append(escapeXml(snLabel)).append("</TEXT>");
-
- // 绗�2琛�: 璁㈠崟缂栧彿 + 涓嬪崟鏃堕棿
- sb.append("<TEXT X=\"8\" Y=\"44\" W=\"340\" H=\"24\" T=\"13\">")
- .append("璁㈠崟缂栧彿锛�").append(escapeXml(orderCode)).append("</TEXT>");
- sb.append("<TEXT X=\"356\" Y=\"44\" W=\"124\" H=\"24\" T=\"13\">")
- .append(escapeXml(createTime)).append("</TEXT>");
-
- // 璁㈠崟缂栧彿鏉″舰鐮�
- sb.append("<C128 X=\"8\" Y=\"72\" W=\"464\" H=\"56\" T=\"")
- .append(escapeXml(orderCode)).append("\"/>");
-
- // 绗�4琛�: 鏀朵欢淇℃伅
- String contactInfo = takeUser != null ? takeUser : "";
- if (takePhone != null && takePhone.length() >= 4) {
- contactInfo += "锛堟墜鏈哄熬鍙�" + takePhone.substring(takePhone.length() - 4) + "锛�";
- }
- sb.append("<TEXT X=\"8\" Y=\"140\" W=\"464\" H=\"24\" T=\"13\">")
- .append("鏀朵欢淇℃伅锛�").append(escapeXml(contactInfo)).append("</TEXT>");
-
- // 绗�5琛�: 璁㈠崟琛屾潕
- sb.append("<TEXT X=\"8\" Y=\"172\" W=\"464\" H=\"24\" T=\"13\">")
- .append("璁㈠崟琛屾潕锛�</TEXT>");
- if (StringUtils.isNotBlank(goodsInfo)) {
- sb.append("<TEXT X=\"8\" Y=\"200\" W=\"464\" H=\"24\" T=\"12\">")
- .append(escapeXml(goodsInfo)).append("</TEXT>");
- }
-
- // 璁㈠崟澶囨敞
- if (StringUtils.isNotBlank(remark)) {
- sb.append("<TEXT X=\"8\" Y=\"240\" W=\"464\" H=\"24\" T=\"13\">")
- .append("璁㈠崟澶囨敞锛�</TEXT>");
- sb.append("<TEXT X=\"8\" Y=\"268\" W=\"464\" H=\"48\" T=\"12\">")
- .append(escapeXml(remark)).append("</TEXT>");
- }
-
- sb.append("</PAGE>");
- return sb.toString();
- }
-
- // ========== 绉佹湁鏂规硶 ==========
-
- private JSONObject buildBaseRequest() {
- String user = systemDictDataBiz.queryByCode(Constants.XPYUN_CONFIG, Constants.XPYUN_USER).getCode();
- String userKey = systemDictDataBiz.queryByCode(Constants.XPYUN_CONFIG, Constants.XPYUN_USER_KEY).getCode();
- long timestamp = System.currentTimeMillis() / 1000;
- String sign = sha1(user + userKey + timestamp);
-
- JSONObject body = new JSONObject();
- body.put("user", user);
- body.put("timestamp", timestamp);
- body.put("sign", sign);
- return body;
- }
-
- private XpyunResponse callApi(String endpoint, JSONObject body) {
- try {
- String url = BASE_URL + endpoint;
- String result = HttpsUtil.postJson(url, body.toJSONString());
- if (result == null) {
- log.error("鑺儴浜慉PI璋冪敤澶辫触: endpoint={}, 鍝嶅簲涓虹┖", endpoint);
- XpyunResponse resp = new XpyunResponse();
- resp.setCode(-1);
- resp.setMsg("鍝嶅簲涓虹┖");
- return resp;
- }
- return JSON.parseObject(result, XpyunResponse.class);
- } catch (Exception e) {
- log.error("鑺儴浜慉PI璋冪敤寮傚父: endpoint={}, error={}", endpoint, e.getMessage(), e);
- XpyunResponse resp = new XpyunResponse();
- resp.setCode(-1);
- resp.setMsg(e.getMessage());
- return resp;
- }
- }
-
- private static String sha1(String input) {
- try {
- MessageDigest md = MessageDigest.getInstance("SHA-1");
- byte[] digest = md.digest(input.getBytes(StandardCharsets.UTF_8));
- StringBuilder sb = new StringBuilder();
- for (byte b : digest) {
- sb.append(String.format("%02x", b));
- }
- return sb.toString();
- } catch (Exception e) {
- throw new RuntimeException("SHA-1璁$畻澶辫触", e);
- }
- }
-
- private static String escapeXml(String text) {
- if (text == null) return "";
- return text.replace("&", "&")
- .replace("<", "<")
- .replace(">", ">")
- .replace("\"", """)
- .replace("'", "'");
- }
-}
diff --git a/server/services/src/main/java/com/doumee/core/utils/xpyun/XpyunResponse.java b/server/services/src/main/java/com/doumee/core/utils/xpyun/XpyunResponse.java
deleted file mode 100644
index 94ef363..0000000
--- a/server/services/src/main/java/com/doumee/core/utils/xpyun/XpyunResponse.java
+++ /dev/null
@@ -1,18 +0,0 @@
-package com.doumee.core.utils.xpyun;
-
-import lombok.Data;
-
-/**
- * 鑺儴浜慉PI鍝嶅簲
- */
-@Data
-public class XpyunResponse {
-
- private Integer code;
-
- private String msg;
-
- private Object data;
-
- private Long serverExecutedTime;
-}
diff --git a/server/services/src/main/java/com/doumee/dao/business/model/AppVersion.java b/server/services/src/main/java/com/doumee/dao/business/model/AppVersion.java
index e1a5367..ce36830 100644
--- a/server/services/src/main/java/com/doumee/dao/business/model/AppVersion.java
+++ b/server/services/src/main/java/com/doumee/dao/business/model/AppVersion.java
@@ -96,4 +96,8 @@
@TableField(exist = false)
private String createUserName;
+ @ApiModelProperty(value = "APP鏂囦欢鍏ㄨ矾寰�")
+ @TableField(exist = false)
+ private String fileFullUrl;
+
}
diff --git a/server/services/src/main/java/com/doumee/dao/business/model/DriverInfo.java b/server/services/src/main/java/com/doumee/dao/business/model/DriverInfo.java
index d7c54ae..c656970 100644
--- a/server/services/src/main/java/com/doumee/dao/business/model/DriverInfo.java
+++ b/server/services/src/main/java/com/doumee/dao/business/model/DriverInfo.java
@@ -186,6 +186,10 @@
private Long memberAmount;
@TableField(exist = false)
+ @ApiModelProperty(value = "椹鹃┒杞﹁締绫诲瀷锛� 鏈哄姩杞� = driving 闈炴満鍔ㄨ溅 = bicycling")
+ private String driverType;
+
+ @TableField(exist = false)
@ApiModelProperty(value = "鍥剧墖鍓嶇紑鍦板潃")
private String imgPrefix;
@@ -233,4 +237,7 @@
@ApiModelProperty(value = "瀹℃壒浜哄悕绉�")
private String auditUserName;
+ @ApiModelProperty(value = "鏋佸厜鎺ㄩ�佸埆鍚�")
+ private String jpushAlias;
+
}
diff --git a/server/services/src/main/java/com/doumee/dao/dto/DriverVerifyRequest.java b/server/services/src/main/java/com/doumee/dao/dto/DriverVerifyRequest.java
index 26e4eb1..8446b73 100644
--- a/server/services/src/main/java/com/doumee/dao/dto/DriverVerifyRequest.java
+++ b/server/services/src/main/java/com/doumee/dao/dto/DriverVerifyRequest.java
@@ -20,6 +20,9 @@
@ApiModel("鍙告満瀹炲悕璁よ瘉璇锋眰绫�")
public class DriverVerifyRequest implements Serializable {
+ @ApiModelProperty(value = "鍙告満涓婚敭锛堢鐞嗙淇敼鏃跺繀浼狅級")
+ private Integer id;
+
@NotEmpty(message = "濮撳悕涓嶈兘涓虹┖")
@ApiModelProperty(value = "濮撳悕", required = true)
private String name;
diff --git a/server/services/src/main/java/com/doumee/dao/dto/PrinterBindDTO.java b/server/services/src/main/java/com/doumee/dao/dto/PrinterBindDTO.java
deleted file mode 100644
index f5a02bc..0000000
--- a/server/services/src/main/java/com/doumee/dao/dto/PrinterBindDTO.java
+++ /dev/null
@@ -1,25 +0,0 @@
-package com.doumee.dao.dto;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-import lombok.Data;
-
-import javax.validation.constraints.NotBlank;
-import javax.validation.constraints.NotNull;
-
-@Data
-@ApiModel("鎵撳嵃鏈虹粦瀹氳姹�")
-public class PrinterBindDTO {
-
- @ApiModelProperty(value = "闂ㄥ簵ID", required = true)
- @NotNull(message = "闂ㄥ簵ID涓嶈兘涓虹┖")
- private Integer shopId;
-
- @ApiModelProperty(value = "鎵撳嵃鏈篠N缂栧彿", required = true)
- @NotBlank(message = "鎵撳嵃鏈篠N涓嶈兘涓虹┖")
- private String printerSn;
-
- @ApiModelProperty(value = "鎵撳嵃鏈篕EY", required = true)
- @NotBlank(message = "鎵撳嵃鏈篕EY涓嶈兘涓虹┖")
- private String printerKey;
-}
diff --git a/server/services/src/main/java/com/doumee/dao/dto/ShopPrinterDTO.java b/server/services/src/main/java/com/doumee/dao/dto/ShopPrinterDTO.java
new file mode 100644
index 0000000..3ba5663
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/dao/dto/ShopPrinterDTO.java
@@ -0,0 +1,17 @@
+package com.doumee.dao.dto;
+
+import io.swagger.annotations.ApiModel;
+import io.swagger.annotations.ApiModelProperty;
+import lombok.Data;
+
+@Data
+@ApiModel("闂ㄥ簵鎵撳嵃鏈虹淮鎶よ姹�")
+public class ShopPrinterDTO {
+
+ @ApiModelProperty(value = "闂ㄥ簵涓婚敭", required = true)
+ private Integer id;
+
+ @ApiModelProperty(value = "鎵撳嵃鏈篠N缂栧彿锛堜笉浼犲垯涓哄垹闄わ級")
+ private String printerSn;
+
+}
diff --git a/server/services/src/main/java/com/doumee/dao/vo/DriverCenterVO.java b/server/services/src/main/java/com/doumee/dao/vo/DriverCenterVO.java
index 929217f..bf8dbd4 100644
--- a/server/services/src/main/java/com/doumee/dao/vo/DriverCenterVO.java
+++ b/server/services/src/main/java/com/doumee/dao/vo/DriverCenterVO.java
@@ -31,6 +31,10 @@
@ApiModelProperty(value = "鍙告満瀹氱骇锛�5=S 4=A 3=B 2=C 1=D")
private Integer driverLevel;
+ @ApiModelProperty(value = "椹鹃┒杞﹁締绫诲瀷锛� 鏈哄姩杞� = driving 闈炴満鍔ㄨ溅 = bicycling")
+ private String driverType;
+
+
@ApiModelProperty(value = "鍙告満瀹氱骇鍚嶇О锛歋/A/B/C/D")
private String driverLevelName;
diff --git a/server/services/src/main/java/com/doumee/dao/vo/OrderDetailVO.java b/server/services/src/main/java/com/doumee/dao/vo/OrderDetailVO.java
index babd1a1..5412971 100644
--- a/server/services/src/main/java/com/doumee/dao/vo/OrderDetailVO.java
+++ b/server/services/src/main/java/com/doumee/dao/vo/OrderDetailVO.java
@@ -53,7 +53,7 @@
@ApiModelProperty(value = "鍙告満瀹屾垚鍥剧墖")
private List<String> driverDoneImages;
- @ApiModelProperty(value = "闂ㄥ簵鍏ュ簱鍥剧墖")
+ @ApiModelProperty(value = "鍙栦欢闂ㄥ簵鍏ュ簱鍥剧墖")
private List<String> storeInImages;
@ApiModelProperty(value = "闂ㄥ簵鍑哄簱鍥剧墖")
diff --git a/server/services/src/main/java/com/doumee/dao/vo/ShopWebDetailVO.java b/server/services/src/main/java/com/doumee/dao/vo/ShopWebDetailVO.java
index efeebf1..76e20cc 100644
--- a/server/services/src/main/java/com/doumee/dao/vo/ShopWebDetailVO.java
+++ b/server/services/src/main/java/com/doumee/dao/vo/ShopWebDetailVO.java
@@ -45,4 +45,7 @@
@ApiModelProperty(value = "闂ㄥ簵缁忓害")
private Double longitude;
+
+ @ApiModelProperty(value = "闂ㄥ簵鑱旂郴鐢佃瘽")
+ private String linkPhone;
}
diff --git a/server/services/src/main/java/com/doumee/service/business/AppVersionService.java b/server/services/src/main/java/com/doumee/service/business/AppVersionService.java
index c9e58cb..9c932d0 100644
--- a/server/services/src/main/java/com/doumee/service/business/AppVersionService.java
+++ b/server/services/src/main/java/com/doumee/service/business/AppVersionService.java
@@ -5,6 +5,7 @@
import com.doumee.dao.business.model.AppVersion;
import java.util.List;
+import java.util.Map;
/**
* APP鐗堟湰Service瀹氫箟
@@ -104,4 +105,13 @@
*/
AppVersion getLatestVersion(Integer type);
+ /**
+ * 涓婁紶鏂囦欢鍒版湇鍔″櫒鏈湴鐩綍
+ *
+ * @param file 鏂囦欢
+ * @param folder 鏂囦欢澶瑰悕
+ * @return 鏂囦欢淇℃伅
+ */
+ Map<String, Object> uploadFile(org.springframework.web.multipart.MultipartFile file) throws Exception;
+
}
diff --git a/server/services/src/main/java/com/doumee/service/business/AreasService.java b/server/services/src/main/java/com/doumee/service/business/AreasService.java
index 6871b4b..624fbd0 100644
--- a/server/services/src/main/java/com/doumee/service/business/AreasService.java
+++ b/server/services/src/main/java/com/doumee/service/business/AreasService.java
@@ -150,6 +150,8 @@
*/
Areas getOpenedCityByName(String cityName);
+ Areas getOpenedCityByCode(String code);
+
/**
* 淇敼鐘舵��
*
diff --git a/server/services/src/main/java/com/doumee/service/business/DriverInfoService.java b/server/services/src/main/java/com/doumee/service/business/DriverInfoService.java
index 74fccd3..8edff6d 100644
--- a/server/services/src/main/java/com/doumee/service/business/DriverInfoService.java
+++ b/server/services/src/main/java/com/doumee/service/business/DriverInfoService.java
@@ -162,6 +162,15 @@
DriverInfo getDetail(Integer id);
/**
+ * 绠$悊绔慨鏀瑰徃鏈烘敞鍐屼俊鎭紙鍚檮浠讹級
+ *
+ * @param id 鍙告満涓婚敭
+ * @param request 淇敼璇锋眰
+ * @return 鏇存柊鍚庣殑鍙告満璇︽儏锛堝惈闄勪欢锛�
+ */
+ DriverInfo updateDriverInfo(DriverVerifyRequest request);
+
+ /**
* 淇敼鍙告満鐘舵�侊紙鍚敤/绂佺敤锛�
*
* @param dto 淇敼鐘舵�佽姹�
@@ -300,4 +309,9 @@
*/
boolean checkDriverToken(String token);
+ /**
+ * 娉ㄥ唽鏋佸厜鎺ㄩ�佸埆鍚�
+ */
+ void registerJpushAlias(Integer driverId, String jpushAlias);
+
}
diff --git a/server/services/src/main/java/com/doumee/service/business/OrdersService.java b/server/services/src/main/java/com/doumee/service/business/OrdersService.java
index 1695868..d990ee3 100644
--- a/server/services/src/main/java/com/doumee/service/business/OrdersService.java
+++ b/server/services/src/main/java/com/doumee/service/business/OrdersService.java
@@ -426,4 +426,9 @@
*/
int autoCompleteOrders();
+ /**
+ * 鎵撳嵃璁㈠崟鏍囩
+ */
+ void printOrderLabel(Integer orderId, Integer shopId);
+
}
\ No newline at end of file
diff --git a/server/services/src/main/java/com/doumee/service/business/ShopInfoService.java b/server/services/src/main/java/com/doumee/service/business/ShopInfoService.java
index 35a568e..b569e27 100644
--- a/server/services/src/main/java/com/doumee/service/business/ShopInfoService.java
+++ b/server/services/src/main/java/com/doumee/service/business/ShopInfoService.java
@@ -220,18 +220,9 @@
void changePassword(Integer shopId, String oldPassword, String newPassword, String token);
/**
- * 缁戝畾鎵撳嵃鏈�
+ * 缁存姢闂ㄥ簵鎵撳嵃鏈篠N
+ * @param dto 闂ㄥ簵鎵撳嵃鏈虹淮鎶よ姹�
*/
- void bindPrinter(com.doumee.dao.dto.PrinterBindDTO dto);
-
- /**
- * 瑙g粦鎵撳嵃鏈�
- */
- void unbindPrinter(Integer shopId);
-
- /**
- * 鏌ヨ鎵撳嵃鏈虹姸鎬�
- */
- Object queryPrinterStatus(Integer shopId);
+ void maintainPrinterSn(ShopPrinterDTO dto);
}
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/AppVersionServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/AppVersionServiceImpl.java
index 28b7b42..46236f1 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/AppVersionServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/AppVersionServiceImpl.java
@@ -4,11 +4,13 @@
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.core.constants.Constants;
import com.doumee.core.constants.ResponseStatus;
import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
+import com.doumee.core.utils.DateUtil;
import com.doumee.core.utils.Utils;
import com.doumee.dao.business.AppVersionMapper;
import com.doumee.dao.business.model.AppVersion;
@@ -17,9 +19,10 @@
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
+import org.springframework.web.multipart.MultipartFile;
-import java.util.List;
-import java.util.Objects;
+import java.io.File;
+import java.util.*;
/**
* APP鐗堟湰Service瀹炵幇
@@ -32,13 +35,15 @@
@Autowired
private AppVersionMapper appVersionMapper;
+ @Autowired
+ private SystemDictDataBiz systemDictDataBiz;
+
@Override
public Integer create(AppVersion appVersion) {
if (StringUtils.isBlank(appVersion.getVersionInfo())
|| StringUtils.isBlank(appVersion.getFileUrl())
|| StringUtils.isBlank(appVersion.getName())
|| StringUtils.isBlank(appVersion.getContent())
- || StringUtils.isBlank(appVersion.getTitle())
|| Objects.isNull(appVersion.getIsForce())
|| Objects.isNull(appVersion.getType())
|| Objects.isNull(appVersion.getFileSize())
@@ -132,7 +137,14 @@
wrapper.eq(AppVersion::getType, model.getType());
}
wrapper.orderByDesc(AppVersion::getId);
- return PageData.from(appVersionMapper.selectJoinPage(page, AppVersion.class, wrapper));
+ PageData<AppVersion> pageData = PageData.from(appVersionMapper.selectJoinPage(page, AppVersion.class, wrapper));
+ String urlPrefix = systemDictDataBiz.queryByCode(Constants.OSS, Constants.APP_FILES_URL).getCode();
+ for (AppVersion vo : pageData.getRecords()) {
+ if (StringUtils.isNotBlank(vo.getFileUrl())) {
+ vo.setFileFullUrl(urlPrefix + vo.getFileUrl());
+ }
+ }
+ return pageData;
}
@Override
@@ -152,4 +164,34 @@
return appVersionMapper.selectOne(qw);
}
+ @Override
+ public Map<String, Object> uploadFile(MultipartFile file) throws Exception {
+ if (file == null || file.isEmpty()) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "涓婁紶鏂囦欢涓嶈兘涓虹┖");
+ }
+ String rootPath = systemDictDataBiz.queryByCode(Constants.OSS, Constants.APP_FILES).getCode();
+ String urlPrefix = systemDictDataBiz.queryByCode(Constants.OSS, Constants.APP_FILES_URL).getCode();
+ String originName = file.getOriginalFilename();
+ String ext = ".apk";
+ if (originName != null && originName.indexOf(".") > 0) {
+ ext = originName.substring(originName.lastIndexOf("."));
+ }
+ String fileName = UUID.randomUUID() + ext;
+ File dest = new File(rootPath + fileName);
+ if (!dest.getParentFile().exists()) {
+ dest.getParentFile().mkdirs();
+ }
+ try {
+ file.transferTo(dest);
+ } catch (Exception e) {
+ throw new BusinessException(ResponseStatus.SERVER_ERROR.getCode(), "鏂囦欢涓婁紶澶辫触: " + e.getMessage());
+ }
+ Map<String, Object> data = new HashMap<>();
+ data.put("url", urlPrefix + fileName);
+ data.put("imgaddr", fileName);
+ data.put("imgname", fileName);
+ data.put("originname", originName);
+ return data;
+ }
+
}
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/AreasServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/AreasServiceImpl.java
index fa0eda3..d65830e 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/AreasServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/AreasServiceImpl.java
@@ -553,6 +553,7 @@
return list;
}
+
@Override
public Areas getOpenedCityByName(String cityName) {
if (StringUtils.isBlank(cityName)) {
@@ -568,6 +569,24 @@
return areasMapper.selectOne(qw);
}
+
+ @Override
+ public Areas getOpenedCityByCode(String code) {
+ if (StringUtils.isBlank(code)) {
+ return null;
+ }
+ Areas areas = areasMapper.selectById(code);
+ if(Objects.isNull(areas)||Objects.isNull(areas.getParentId())){
+ return null;
+ }
+ Areas city = areasMapper.selectById(areas.getParentId());
+ if(Objects.isNull(city)||Constants.equalsInteger(city.getIsdeleted(),Constants.ONE)||
+ Constants.equalsInteger(city.getStatus(),Constants.ZERO)){
+ return null;
+ }
+ return city;
+ }
+
@Override
public void updateStatus(Areas areas) {
if (areas == null || areas.getId() == null) {
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/DriverInfoServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/DriverInfoServiceImpl.java
index 7d642a5..e6aab3c 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/DriverInfoServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/DriverInfoServiceImpl.java
@@ -406,6 +406,7 @@
driverInfo.setMemberId(member.getId());
driverInfo.setStatus(Constants.ZERO);
driverInfo.setAuditStatus(99);
+ driverInfo.setJpushAlias(org.springframework.util.DigestUtils.md5DigestAsHex(telephone.getBytes()));
driverInfoMapper.insert(driverInfo);
}
@@ -581,6 +582,7 @@
if (Objects.nonNull(category)) {
driverInfo.setCarTypeName(category.getName());
driverInfo.setNeedLicense(Constants.equalsInteger(Integer.valueOf(category.getOtherField()), Constants.ONE) ? Constants.ONE : Constants.ZERO);
+ driverInfo.setDriverType(category.getDetail());
}
}
// 鏌ヨ鐪佸競鍖轰俊鎭�
@@ -730,6 +732,55 @@
}
@Override
+ public DriverInfo updateDriverInfo(DriverVerifyRequest request) {
+ Integer id = request.getId();
+ if (id == null) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鍙告満涓婚敭涓嶈兘涓虹┖");
+ }
+ DriverInfo driverInfo = driverInfoMapper.selectById(id);
+ if (Objects.isNull(driverInfo) || Constants.equalsInteger(driverInfo.getDeleted(), Constants.ONE)) {
+ throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ }
+ Date now = new Date();
+ driverInfoMapper.update(new UpdateWrapper<DriverInfo>().lambda()
+ .set(DriverInfo::getName, request.getName())
+ .set(DriverInfo::getIdcard, request.getIdcard())
+ .set(DriverInfo::getMaritalStatus, request.getMaritalStatus())
+ .set(DriverInfo::getAreaId, request.getAreaId())
+ .set(DriverInfo::getLivePlace, request.getLivePlace())
+ .set(DriverInfo::getCarCode, request.getCarCode())
+ .set(DriverInfo::getCarType, request.getCarType())
+ .set(DriverInfo::getCarColor, request.getCarColor())
+ .set(DriverInfo::getCardStartDate, request.getCardStartDate())
+ .set(DriverInfo::getCardEndDate, request.getCardEndDate())
+ .set(DriverInfo::getIdcardImg, request.getIdcardImg())
+ .set(DriverInfo::getIdcardImgBack, request.getIdcardImgBack())
+ .set(DriverInfo::getAliAccount, request.getAliAccount())
+ .set(DriverInfo::getAliName, request.getAliName())
+ .set(DriverInfo::getUpdateTime, now)
+ .eq(DriverInfo::getId, id));
+
+ // 鍒犻櫎鏃х殑鐓х墖璁板綍骞朵繚瀛樻柊鐨�
+ multifileMapper.delete(new QueryWrapper<Multifile>().lambda()
+ .eq(Multifile::getObjId, id)
+ .in(Multifile::getObjType,
+ Constants.FileType.DRIVER_CAR.getKey(),
+ Constants.FileType.DRIVER_LICENSE.getKey(),
+ Constants.FileType.DRIVER_OTHER.getKey()));
+ if (!CollectionUtils.isEmpty(request.getCarImgUrls())) {
+ saveMultifileList(id, Constants.FileType.DRIVER_CAR.getKey(), request.getCarImgUrls(), now);
+ }
+ if (!CollectionUtils.isEmpty(request.getLicenseImgUrls())) {
+ saveMultifileList(id, Constants.FileType.DRIVER_LICENSE.getKey(), request.getLicenseImgUrls(), now);
+ }
+ if (!CollectionUtils.isEmpty(request.getOtherImgUrls())) {
+ saveMultifileList(id, Constants.FileType.DRIVER_OTHER.getKey(), request.getOtherImgUrls(), now);
+ }
+
+ return getDetail(id);
+ }
+
+ @Override
public void changeStatus(ChangeStatusDTO dto) {
if (dto.getId() == null) {
throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "涓婚敭涓嶈兘涓虹┖");
@@ -833,7 +884,10 @@
+ systemDictDataBiz.queryByCode(Constants.OSS, Constants.MEMBER_FILES).getCode();
vo.setFullImgUrl(imgPrefix + driver.getImgurl());
}
-
+ Category category = categoryMapper.selectById(driver.getCarType());
+ if(Objects.nonNull(category)&&StringUtils.isNotBlank(category.getDetail())){
+ vo.setDriverType(category.getDetail());
+ }
// 浠婃棩棰勮浣i噾锛氫粖鏃ユ帴鍗曠殑鍙告満浣i噾 + 骞冲彴濂栧姳閲�
Date now = new Date();
Calendar cal = Calendar.getInstance();
@@ -1075,14 +1129,15 @@
.select("s1.address", Orders::getDepositShopAddress)
.select("s2.name", Orders::getTakeShopName)
.select("s2.address", Orders::getTakeShopAddress)
+ .select("s1.link_phone", Orders::getDepositShopLinkPhone)
.select("s2.link_phone as takeShopLinkPhone")
.select("c2.other_field as c2OtherField")
.select("c2.name as goodLevelName")
.select("IF(EXISTS(SELECT 1 FROM orders_detail od JOIN category c3 ON c3.id = od.LUGGAGE_ID AND c3.TYPE = 4 AND c3.OTHER_FIELD = '1' WHERE od.ORDER_ID = t.ID AND od.DELETED = 0), 1, 0) as hasOversized")
- .leftJoin("shop_info s1 on s1.id = t.DEPOSIT_SHOP_ID and s1.DELETED = 0")
- .leftJoin("shop_info s2 on s2.id = t.TAKE_SHOP_ID and s2.DELETED = 0")
- .leftJoin("category c1 on c1.id = t.GOOD_TYPE and c1.DELETED = 0")
- .leftJoin("category c2 on c2.id = c1.RELATION_ID and c2.DELETED = 0 and c2.TYPE = 3")
+ .leftJoin("shop_info s1 on s1.id = t.DEPOSIT_SHOP_ID ")
+ .leftJoin("shop_info s2 on s2.id = t.TAKE_SHOP_ID ")
+ .leftJoin("category c1 on c1.id = t.GOOD_TYPE ")
+ .leftJoin("category c2 on c2.id = c1.RELATION_ID and c2.TYPE = 3")
.eq(Orders::getAcceptDriver, driver.getId())
.eq(Orders::getType, Constants.ONE)
.eq(Objects.nonNull(dto.getStatus()),Orders::getStatus, dto.getStatus())
@@ -1124,7 +1179,7 @@
.select("s2.name", Orders::getTakeShopName)
.select("s2.address", Orders::getTakeShopAddress)
.select("s2.telephone", Orders::getTakeShopLinkPhone)
- .select("c2.other_field as c2OtherField")
+ .select("c1.other_field as c2OtherField")
.select("c1.name as goodTypeName")
.select("IF(EXISTS(SELECT 1 FROM orders_detail od JOIN category c3 ON c3.id = od.LUGGAGE_ID AND c3.TYPE = 4 AND c3.OTHER_FIELD = '1' WHERE od.ORDER_ID = t.ID AND od.DELETED = 0), 1, 0) as hasOversized")
.leftJoin("shop_info s1 on s1.id = t.DEPOSIT_SHOP_ID and s1.DELETED = 0")
@@ -1738,17 +1793,15 @@
vo.setDepositDistance(formatDistance(distKm));
}
- // 鍙栦欢淇℃伅 + 鑱旂郴鐢佃瘽锛堜娇鐢∣rders鑷甫鍧愭爣锛�
+ // 鍙栦欢淇℃伅锛堜娇鐢∣rders鑷甫鍧愭爣锛�
boolean hasTakeShop = order.getTakeShopId() != null && StringUtils.isNotBlank(order.getTakeShopName());
if (hasTakeShop) {
vo.setTakeName(order.getTakeShopName());
vo.setTakeAddress(order.getTakeShopAddress());
vo.setTakeShopId(order.getTakeShopId());
- vo.setContactPhone(order.getTakeShopLinkPhone());
} else {
vo.setTakeName(order.getTakeLocation());
vo.setTakeAddress(order.getTakeLocationRemark());
- vo.setContactPhone(order.getTakePhone());
}
vo.setTakeLng(order.getTakeLgt() != null ? order.getTakeLgt().doubleValue() : null);
vo.setTakeLat(order.getTakeLat() != null ? order.getTakeLat().doubleValue() : null);
@@ -1773,6 +1826,19 @@
vo.setStatus(order.getStatus());
vo.setStatusDesc(getStatusDesc(order.getStatus()));
vo.setCreateTime(order.getCreateTime());
+
+ // 鑱旂郴鐢佃瘽锛堟寜璁㈠崟鐘舵�侊級
+ if (Constants.equalsInteger(order.getStatus(), Constants.THREE)) {
+ vo.setContactPhone(order.getDepositShopLinkPhone());
+ } else if (Constants.equalsInteger(order.getStatus(), Constants.FOUR)) {
+ if (hasTakeShop) {
+ vo.setContactPhone(order.getTakeShopLinkPhone());
+ } else {
+ vo.setContactPhone(order.getTakePhone());
+ }
+ } else if (Constants.equalsInteger(order.getStatus(), Constants.FIVE)) {
+ vo.setContactPhone(order.getTakePhone());
+ }
// 鐗╁搧鏄庣粏
List<OrdersDetail> details = detailMap.getOrDefault(order.getId(), Collections.emptyList());
@@ -1930,7 +1996,8 @@
.select("s1.name", Orders::getDepositShopName)
.select("s1.address", Orders::getDepositShopAddress)
.select("s2.name", Orders::getTakeShopName)
- .select("s2.address", Orders::getTakeShopAddress)
+ .select("s2.address", Orders::getDepositShopAddress)
+ .select("s1.link_phone as takeShopLinkPhone")
.select("s2.link_phone as takeShopLinkPhone")
.select("c2.other_field as c2OtherField")
.select("c2.name as goodLevelName")
@@ -2038,4 +2105,12 @@
}
}
+ @Override
+ public void registerJpushAlias(Integer driverId, String jpushAlias) {
+ DriverInfo update = new DriverInfo();
+ update.setId(driverId);
+ update.setJpushAlias(jpushAlias);
+ driverInfoMapper.updateById(update);
+ }
+
}
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
index 415462e..1d4bd15 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/MemberServiceImpl.java
@@ -625,7 +625,10 @@
throw new BusinessException(ResponseStatus.BAD_REQUEST);
}
//鍒ゆ柇鏂版墜鏈哄彿鏄惁宸茶浣跨敤
- if(memberMapper.selectCount(new QueryWrapper<Member>().lambda().eq(Member::getTelephone,request.getPhone()))>Constants.ZERO){
+ if(memberMapper.selectCount(new QueryWrapper<Member>().lambda()
+ .eq(Member::getDeleted,Constants.ZERO)
+ .eq(Member::getUserType,Constants.ZERO)
+ .eq(Member::getTelephone,request.getPhone()))>Constants.ZERO){
throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"瀵逛笉璧�,鏂版墜鏈哄彿宸茶缁戝畾,鏃犳硶杩涜鎹㈢粦锛�");
}
Member member = memberMapper.selectById(request.getMemberId());
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/OrdersRefundServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/OrdersRefundServiceImpl.java
index 0c6b615..de00b2b 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/OrdersRefundServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/OrdersRefundServiceImpl.java
@@ -151,7 +151,7 @@
.select("o.total_amount as totalAmount")
.select("o.pay_amount as payAmount")
.select("c2.name as goodLevelName")
- .leftJoin("orders o on o.id = t.ORDER_ID and o.DELETED = 0")
+ .innerJoin("orders o on o.id = t.ORDER_ID ")
.leftJoin("category c1 on c1.id = o.GOOD_TYPE and c1.DELETED = 0")
.leftJoin("category c2 on c2.id = c1.RELATION_ID and c2.DELETED = 0 and c2.TYPE = 3")
.eq(OrdersRefund::getDeleted, 0);
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java
index f087f1c..04cd73b 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/OrdersServiceImpl.java
@@ -1,15 +1,19 @@
package com.doumee.service.business.impl;
+import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.doumee.biz.system.AreasBiz;
+import com.doumee.config.xyy.XyyConfig;
+import com.doumee.config.xyy.dto.PrintRequest;
import com.doumee.biz.system.OperationConfigBiz;
import com.doumee.biz.system.SystemDictDataBiz;
import com.doumee.config.wx.WxMiniConfig;
import com.doumee.config.wx.WxPayProperties;
import com.doumee.config.wx.WxPayV3Service;
+import com.doumee.core.utils.jpush.JPushUtil;
import com.wechat.pay.java.service.refund.model.Refund;
import com.doumee.core.constants.Constants;
import com.doumee.core.constants.ResponseStatus;
@@ -55,6 +59,7 @@
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
+import java.text.SimpleDateFormat;
import java.util.concurrent.TimeUnit;
/**
@@ -129,6 +134,9 @@
private AreasService areasService;
@Autowired
+ private AreasMapper aareasMapper;
+
+ @Autowired
private NoticeService noticeService;
@Autowired
@@ -139,6 +147,12 @@
@Autowired
private WxPayProperties wxPayProperties;
+
+ @Autowired
+ private XyyConfig xyyConfig;
+
+ @Autowired
+ private PrintService printService;
@Override
public Integer create(Orders orders) {
@@ -216,7 +230,6 @@
.leftJoin("shop_info s2 on s2.id = t.TAKE_SHOP_ID");
;
Utils.MP.blankToNull(pageWrap.getModel());
- pageWrap.getModel().setDeleted(Constants.ZERO);
queryWrapper.eq(pageWrap.getModel().getDeleted() != null, Orders::getDeleted, pageWrap.getModel().getDeleted());
queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getCode()), Orders::getCode, pageWrap.getModel().getCode());
queryWrapper.like(StringUtils.isNotBlank(pageWrap.getModel().getDepositShopName()), "s1.name", pageWrap.getModel().getDepositShopName());
@@ -234,13 +247,7 @@
queryWrapper.eq(pageWrap.getModel().getAcceptDriver() != null, Orders::getAcceptDriver, pageWrap.getModel().getAcceptDriver());
queryWrapper.and(pageWrap.getModel().getShopId() != null, i -> i.eq(Orders::getDepositShopId, pageWrap.getModel().getShopId())
.or().eq(Orders::getTakeShopId, pageWrap.getModel().getShopId()));
- for (PageWrap.SortData sortData : pageWrap.getSorts()) {
- if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) {
- queryWrapper.orderByDesc(sortData.getProperty());
- } else {
- queryWrapper.orderByAsc(sortData.getProperty());
- }
- }
+ queryWrapper.orderByDesc(Orders::getId);
PageData<Orders> pageData = PageData.from(ordersMapper.selectJoinPage(page, Orders.class, queryWrapper));
for (Orders o : pageData.getRecords()) {
if (o.getStatus() != null) {
@@ -368,7 +375,7 @@
for (Category c : categories) {
categoryNameMap.put(c.getId(), c.getName());
categoryDetailMap.put(c.getId(), c.getDetail());
- categoryOtherFieldMap.put(c.getId(),c.getOtherField());
+ categoryOtherFieldMap.put(c.getId(),c.getRemark());
}
// 璁$畻姣忛」鐗╁搧璐圭敤锛氬皬璁� = 鍗曚环 脳 鏁伴噺 脳 澶╂暟
@@ -490,7 +497,7 @@
for (Category c : categories) {
categoryNameMap.put(c.getId(), c.getName());
categoryDetailMap.put(c.getId(), c.getDetail());
- categoryOtherFieldMap.put(c.getId(),c.getOtherField());
+ categoryOtherFieldMap.put(c.getId(),c.getRemark());
}
// 3. 閫愰」璁$畻杩愯垂锛氳捣姝ヤ环 + 瓒呭嚭閮ㄥ垎闃舵浠�
@@ -1600,12 +1607,13 @@
// 闂ㄥ簵寰呭鐞嗚鍗曪細鎸変笟鍔$幆鑺傚尯鍒嗛棬搴楄鑹�
if (combinedStatus != null && Constants.equalsInteger(combinedStatus, Constants.SEVEN)) {
wrapper.and(w -> w
- .and(w1 -> w1.eq(Orders::getDepositShopId, shopId)
+ .and(w1 -> w1.eq(Orders::getType, Constants.ZERO).eq(Orders::getDepositShopId, shopId)
.in(Orders::getStatus, Constants.OrderStatus.waitDeposit.getStatus(),
- Constants.OrderStatus.deposited.getStatus()))
- .or(w2 -> w2.eq(Orders::getTakeShopId, shopId)
- .in(Orders::getStatus, Constants.OrderStatus.delivering.getStatus(),
- Constants.OrderStatus.arrived.getStatus()))
+ Constants.OrderStatus.arrived.getStatus())
+ .or(w3-> w3.eq(Orders::getType, Constants.ONE).eq(Orders::getDepositShopId, shopId)
+ .eq(Orders::getStatus, Constants.OrderStatus.waitDeposit.getStatus()))
+ .or(w2 -> w2.eq(Orders::getType, Constants.ONE).eq(Orders::getTakeShopId, shopId)
+ .eq(Orders::getStatus, Constants.OrderStatus.arrived.getStatus())))
);
} else {
wrapper.and(w -> w.eq(Orders::getDepositShopId, shopId).or().eq(Orders::getTakeShopId, shopId));
@@ -2414,13 +2422,13 @@
// 6. 鎶奸噾鏀粯瀹屾垚鍚庯紝鑻ュ煄甯傛湭寮�閫氬垯鑷姩寮�閫�
if (shopInfo.getAreaId() != null) {
- Areas shopArea = areasService.getById(shopInfo.getAreaId());
+ Areas shopArea = aareasMapper.selectById(shopInfo.getAreaId());
if (shopArea != null && shopArea.getParentId() != null) {
- Areas cityArea = areasService.getById(shopArea.getParentId());
+ Areas cityArea = aareasMapper.selectById(shopArea.getParentId());
if (cityArea != null && !Constants.equalsInteger(cityArea.getStatus(), Constants.ONE)) {
cityArea.setStatus(Constants.ONE);
cityArea.setEditDate(now);
- areasService.updateById(cityArea);
+ aareasMapper.updateById(cityArea);
areasService.cacheData();
}
}
@@ -2758,6 +2766,8 @@
// 寮傚湴瀵勫瓨 鈫� 寰呮姠鍗�
sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_GRAB, order.getId(),
"orderNo", order.getCode());
+ // 鎺ㄩ�侀�氱煡鍙告満
+ pushDriverNewOrder(order);
} else {
// 灏卞湴瀵勫瓨 鈫� 寰呭彇浠舵彁閱�
sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_PICKUP_REMIND, order.getId(),
@@ -2917,6 +2927,8 @@
// 寮傚湴瀵勫瓨 鈫� 寰呮姠鍗�
sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_GRAB, order.getId(),
"orderNo", order.getCode());
+ // 鎺ㄩ�侀�氱煡鍙告満
+ pushDriverNewOrder(order);
} else {
// 灏卞湴瀵勫瓨 鈫� 寰呭彇浠舵彁閱�
sendOrderNotice(order.getMemberId(), Constants.MemberOrderNotify.WAIT_PICKUP_REMIND, order.getId(),
@@ -3580,7 +3592,10 @@
* 渚涘垎椤电瓑宸叉煡璇㈡槑缁嗙殑涓氬姟鍦烘櫙澶嶇敤锛岄伩鍏嶉噸澶嶆煡璇�
*/
private OverdueFeeVO calculateOverdueFeeInternal(Orders order, List<OrdersDetail> details) {
- if (CollectionUtils.isEmpty(details)) {
+ if (CollectionUtils.isEmpty(details)||
+ Constants.equalsInteger(order.getStatus(),Constants.ZERO)
+ || Constants.equalsInteger(order.getStatus(),Constants.ONE)
+ ) {
OverdueFeeVO vo = new OverdueFeeVO();
vo.setOverdue(false);
vo.setOverdueDays(0);
@@ -4107,4 +4122,102 @@
}
}
+ @Override
+ public void printOrderLabel(Integer orderId, Integer shopId) {
+ Orders orders = ordersMapper.selectById(orderId);
+ if (orders == null) {
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "璁㈠崟涓嶅瓨鍦�");
+ }
+ if (!Constants.equalsInteger(orders.getDepositShopId(), shopId)) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "褰撳墠闂ㄥ簵涓嶆槸璇ヨ鍗曠殑瀛樹欢闂ㄥ簵");
+ }
+ if (orders.getStatus() < 2 || orders.getStatus() > 5) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "褰撳墠璁㈠崟鐘舵�佷笉鍏佽鎵撳嵃");
+ }
+ ShopInfo shop = shopInfoMapper.selectById(shopId);
+ if (shop == null) {
+ throw new BusinessException(ResponseStatus.DATA_EMPTY.getCode(), "瀛樹欢闂ㄥ簵涓嶅瓨鍦�");
+ }
+ if (StringUtils.isBlank(shop.getPrinterSn())) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瀛樹欢闂ㄥ簵鏈粦瀹氭墦鍗版満");
+ }
+ List<OrdersDetail> detailList = ordersDetailMapper.selectList(
+ new QueryWrapper<OrdersDetail>().lambda().eq(OrdersDetail::getOrderId, orderId));
+ // 鎷兼帴瀹㈡埛淇℃伅
+ String userInfo = "";
+ if (StringUtils.isNotBlank(orders.getTakeUser())) {
+ String phone = orders.getTakePhone();
+ userInfo = orders.getTakeUser();
+ if (StringUtils.isNotBlank(phone) && phone.length() >= 4) {
+ userInfo += "锛�" + phone.substring(phone.length() - 4) + "锛�";
+ }
+ }
+ String content = printService.getPrintContent(shop.getName(), detailList, userInfo, orders.getCode(), orders.getRemark(),
+ orders.getTakeLocationRemark(),
+ orders.getPayTime() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm").format(orders.getPayTime()) : "",
+ orders.getExpectedTakeTime() != null ? new SimpleDateFormat("yyyy-MM-dd HH:mm").format(orders.getExpectedTakeTime()) : "");
+ if (StringUtils.isBlank(content)) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鎵撳嵃鍐呭涓虹┖");
+ }
+ PrintRequest request = new PrintRequest();
+ xyyConfig.createRequestHeader(request);
+ request.setSn(shop.getPrinterSn());
+ request.setContent(content);
+ request.setCopies(1);
+ request.setVoice(2);
+ request.setMode(0);
+ com.doumee.config.xyy.vo.ObjectRestResponse<String> resp = printService.printLabel(request);
+ if (resp.getCode() != 0) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鎵撳嵃澶辫触锛�" + resp.getMsg());
+ }
+ log.info("璁㈠崟鏍囩鎵撳嵃鎴愬姛: orderId={}, orderIndex={}", orderId, resp.getData());
+ }
+
+ /**
+ * 寮傚湴璁㈠崟瀵勫瓨鎴愬姛鍚庢帹閫侀�氱煡缁欏徃鏈�
+ * 1銆佹湭鍔犳�ワ細鎺ㄩ�佸悓鍩庝笖闂ㄥ簵閰嶉�佽寖鍥村唴鎺ュ崟涓殑鍙告満
+ * 2銆佸姞鎬ワ細鎺ㄩ�佸悓鍩庢墍鏈夋帴鍗曚腑鐨勫徃鏈�
+ * 鍩庡競鍖归厤锛氬徃鏈篈REA_ID鍏宠仈areas琛紝閫愮骇parent_id鎵惧埌鍩庡競绾э紝涓庤鍗昪ityId鍖归厤
+ */
+ private void pushDriverNewOrder(Orders order) {
+ ShopInfo shop = shopInfoMapper.selectById(order.getDepositShopId());
+ if (shop == null || shop.getLongitude() == null || shop.getLatitude() == null) {
+ return;
+ }
+ String orderCityId = order.getCityId();
+ if (StringUtils.isBlank(orderCityId)) {
+ return;
+ }
+ String distSql = "(ST_Distance_Sphere(POINT(t.LONGITUDE, t.LATITUDE), POINT(" + shop.getLongitude() + ", " + shop.getLatitude() + ")) / 1000)";
+ // MPJ鍏宠仈鏌ヨ锛氬徃鏈� 鈫� areas(鍖哄幙) 鈫� areas_city(鍩庡競)锛屽尮閰嶈鍗昪ityId
+ MPJLambdaWrapper<DriverInfo> wrapper = new MPJLambdaWrapper<>();
+ wrapper.selectAll(DriverInfo.class)
+ .leftJoin(Areas.class,Areas::getId,DriverInfo::getAreaId)
+ .eq(DriverInfo::getAcceptingStatus, Constants.ONE)
+ .eq(DriverInfo::getStatus, Constants.ZERO)
+ .eq(DriverInfo::getDeleted, Constants.ZERO)
+ .eq(DriverInfo::getAuditStatus, Constants.THREE)
+ .eq(Areas::getParentId, orderCityId);
+ if (!Constants.equalsInteger(order.getIsUrgent(), Constants.ONE)) {
+ // 鏈姞鎬ワ細闂ㄥ簵閰嶉�佽寖鍥村唴
+ double rangeKm = shop.getDeliveryArea() != null ? shop.getDeliveryArea().doubleValue() : 5.0;
+ wrapper.apply(distSql + " <= {0}", rangeKm);
+ }
+ List<DriverInfo> drivers = driverInfoMapper.selectJoinList(DriverInfo.class, wrapper);
+ if (drivers.isEmpty()) {
+ return;
+ }
+ List<String> aliases = new ArrayList<>();
+ for (DriverInfo d : drivers) {
+ aliases.add(org.springframework.util.DigestUtils.md5DigestAsHex(d.getTelephone().getBytes()));
+ }
+ String title = Constants.equalsInteger(order.getIsUrgent(), Constants.ONE) ? "鏂板姞鎬ヨ鍗�" : "鏂拌鍗�";
+ String content = "璁㈠崟鍙凤細" + order.getCode();
+ java.util.Map<String, String> extras = new java.util.HashMap<>();
+ extras.put("orderId", String.valueOf(order.getId()));
+ extras.put("orderCode", order.getCode());
+ extras.put("type", "new_order");
+ JPushUtil.sendByAliases(aliases, title, content, extras);
+ }
+
}
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/PrintService.java b/server/services/src/main/java/com/doumee/service/business/impl/PrintService.java
new file mode 100644
index 0000000..d8a0f1c
--- /dev/null
+++ b/server/services/src/main/java/com/doumee/service/business/impl/PrintService.java
@@ -0,0 +1,297 @@
+package com.doumee.service.business.impl;
+
+import cn.binarywang.wx.miniapp.bean.intractiy.WxMaStoreBalance;
+import com.alibaba.druid.sql.visitor.functions.Concat;
+import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.TypeReference;
+import com.alipay.v3.model.GoodsDetail;
+import com.doumee.config.xyy.dto.*;
+import com.doumee.config.xyy.vo.ObjectRestResponse;
+import com.doumee.config.xyy.vo.OrderStatisResult;
+import com.doumee.config.xyy.vo.PrinterResult;
+import com.doumee.core.constants.Constants;
+import com.doumee.core.utils.HttpsUtil;
+import com.doumee.dao.business.model.OrdersDetail;
+import com.github.xiaoymin.knife4j.core.util.CollectionUtils;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.stereotype.Service;
+
+import java.math.BigDecimal;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+/**
+ * 浜戞墦鍗扮浉鍏虫帴鍙e皝瑁呯被
+ * @author JavaLyl
+ */
+@Service
+public class PrintService {
+
+ private static String BASE_URL = "https://open.xpyun.net/api/openapi";
+
+
+ public String getPrintContent(String shopName, List<OrdersDetail> detailList, String userInfo, String orderCode, String remark, String takeLocationRemark, String payTime, String expectedTakeTime){
+ StringBuilder printContent = new StringBuilder();
+ if(CollectionUtils.isNotEmpty(detailList)){
+ Integer num = detailList.stream().map(i->i.getNum()).reduce(Constants.ZERO, Integer::sum);
+ Integer index = 1;
+ for (OrdersDetail detail:detailList) {
+ for (int i = 1; i <= detail.getNum(); i++) {
+ int y = 160;
+ StringBuilder page = new StringBuilder();
+ page.append("<PAGE>").append("<SIZE>60,60</SIZE>");
+ page.append("<TEXT x=\"30\" y=\"10\" w=\"1\" h=\"1\" r=\"0\">")
+ .append(detail.getLuggageName()).append("(").append(i).append("/").append(detail.getNum()).append(")")
+ .append("</TEXT>");
+ page.append("<BC128 x=\"50\" y=\"60\" h=\"64\" s=\"1\" n=\"2\" w=\"2\" r=\"0\">")
+ .append(orderCode)
+ .append("</BC128>");
+ // 瀹㈡埛淇℃伅
+ page.append("<TEXT x=\"30\" y=\"").append(y).append("\" w=\"1\" h=\"1\" r=\"0\">")
+ .append("瀹㈡埛淇℃伅锛�").append(userInfo).append(StringUtils.repeat(" ", 4))
+ .append("</TEXT>");
+ y += 40;
+ // 涓嬪崟鏃堕棿锛堟敮浠樻椂闂达級
+ page.append("<TEXT x=\"30\" y=\"").append(y).append("\" w=\"1\" h=\"1\" r=\"0\">")
+ .append("涓嬪崟鏃堕棿锛�").append(payTime)
+ .append("</TEXT>");
+ y += 40;
+ // 鍙栦欢鍦板潃锛堟渶澶�2琛岋級
+ y = appendMultiLine(page, "鍙栦欢鍦板潃锛�", takeLocationRemark, y, 2);
+ y += 10;
+ // 閫佽揪鏃堕棿
+ page.append("<TEXT x=\"30\" y=\"").append(y).append("\" w=\"1\" h=\"1\" r=\"0\">")
+ .append("瀹㈡埛棰勮鍙栦欢鏃堕棿锛�").append(expectedTakeTime)
+ .append("</TEXT>");
+ y += 40;
+ // 璁㈠崟澶囨敞锛堟渶澶�2琛岋級
+ y = appendMultiLine(page, "璁㈠崟澶囨敞锛�", remark, y, 2);
+ // 闂ㄥ簵鍚� + 搴忓彿锛堝浐瀹氬湪搴曢儴锛�
+ page.append("<TEXT x=\"30\" y=\"440\" w=\"1\" h=\"1\" r=\"0\">")
+ .append(shopName).append(StringUtils.repeat(" ", 18))
+ .append(index).append("/").append(num)
+ .append("</TEXT>");
+ page.append("</PAGE>");
+ printContent.append(page);
+ index = index+1;
+ }
+ }
+ }
+ return printContent.toString();
+ }
+
+ /**
+ * 杩藉姞鍙兘鎹㈣鐨勬枃鏈紙鏍囬+鍐呭锛夛紝瓒呰繃maxChars涓瓧绗︽崲琛岋紝鏈�澶歮axLines琛�
+ * @return 娑堣�楃殑y鍋忕Щ鍚庣殑涓嬩竴涓獃鍧愭爣
+ */
+ private int appendMultiLine(StringBuilder sb, String title, String content, int startY, int maxLines) {
+ String fullText = title + (StringUtils.isNotBlank(content) ? content : "");
+ int maxChars = 18;
+ int line = 0;
+ int pos = 0;
+ int y = startY;
+ while (pos < fullText.length() && line < maxLines) {
+ String lineText;
+ int end = Math.min(pos + maxChars, fullText.length());
+ lineText = fullText.substring(pos, end);
+ pos = end;
+ line++;
+ sb.append("<TEXT x=\"30\" y=\"").append(y).append("\" w=\"1\" h=\"1\" r=\"0\">")
+ .append(lineText).append(StringUtils.repeat(" ", 4))
+ .append("</TEXT>");
+ y += 35;
+ }
+ return y;
+ }
+
+
+ /**
+ * 1.鎵归噺娣诲姞鎵撳嵃鏈�
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<PrinterResult> addPrinters(AddPrinterRequest restRequest) {
+ String url = BASE_URL + "/xprinter/addPrinters";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<PrinterResult> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<PrinterResult>>(){});
+ return result;
+ }
+
+ /**
+ * 2.璁剧疆鎵撳嵃鏈鸿闊崇被鍨�
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<Boolean> setPrinterVoiceType(SetVoiceTypeRequest restRequest) {
+ String url = BASE_URL + "/xprinter/setVoiceType";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<Boolean> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Boolean>>(){});
+ return result;
+ }
+
+ /**
+ * 3.鎵撳嵃灏忕エ璁㈠崟
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<String> print(PrintRequest restRequest) {
+ String url = BASE_URL + "/xprinter/print";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){});
+ return result;
+ }
+
+ /**
+ * 4.鎵撳嵃鏍囩璁㈠崟
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<String> printLabel(PrintRequest restRequest) {
+ String url = BASE_URL + "/xprinter/printLabel";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){});
+ return result;
+ }
+
+ /**
+ * 5.鎵归噺鍒犻櫎鎵撳嵃鏈�
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<PrinterResult> delPrinters(DelPrinterRequest restRequest) {
+ String url = BASE_URL + "/xprinter/delPrinters";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<PrinterResult> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<PrinterResult>>(){});
+ return result;
+ }
+
+ /**
+ * 6.淇敼鎵撳嵃鏈轰俊鎭�
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<Boolean> updPrinter(UpdPrinterRequest restRequest) {
+ String url = BASE_URL + "/xprinter/updPrinter";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<Boolean> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Boolean>>(){});
+ return result;
+ }
+
+ /**
+ * 7.娓呯┖寰呮墦鍗伴槦鍒�
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<Boolean> delPrinterQueue(PrinterRequest restRequest) {
+ String url = BASE_URL + "/xprinter/delPrinterQueue";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<Boolean> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Boolean>>(){});
+ return result;
+ }
+
+ /**
+ * 8.鏌ヨ璁㈠崟鏄惁鎵撳嵃鎴愬姛
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<Boolean> queryOrderState(QueryOrderStateRequest restRequest) {
+ String url = BASE_URL + "/xprinter/queryOrderState";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<Boolean> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Boolean>>(){});
+ return result;
+ }
+
+ /**
+ * 9.鏌ヨ鎵撳嵃鏈烘煇澶╃殑璁㈠崟缁熻鏁�
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<OrderStatisResult> queryOrderStatis(QueryOrderStatisRequest restRequest) {
+ String url = BASE_URL + "/xprinter/queryOrderStatis";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<OrderStatisResult> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<OrderStatisResult>>(){});
+ return result;
+ }
+
+ /**
+ * 10.鏌ヨ鎵撳嵃鏈虹姸鎬�
+ *
+ * 0銆佺绾� 1銆佸湪绾挎甯� 2銆佸湪绾夸笉姝e父
+ * 澶囨敞锛氬紓甯镐竴鑸槸鏃犵焊锛岀绾跨殑鍒ゆ柇鏄墦鍗版満涓庢湇鍔″櫒澶卞幓鑱旂郴瓒呰繃30绉�
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<Integer> queryPrinterStatus(PrinterRequest restRequest) {
+ String url = BASE_URL + "/xprinter/queryPrinterStatus";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<Integer> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<Integer>>(){});
+ return result;
+ }
+
+ /**
+ * 10.鎵归噺鏌ヨ鎵撳嵃鏈虹姸鎬�
+ *
+ * 0銆佺绾� 1銆佸湪绾挎甯� 2銆佸湪绾夸笉姝e父
+ * 澶囨敞锛氬紓甯镐竴鑸槸鏃犵焊锛岀绾跨殑鍒ゆ柇鏄墦鍗版満涓庢湇鍔″櫒澶卞幓鑱旂郴瓒呰繃30绉�
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<List<Integer>> queryPrintersStatus(PrintersRequest restRequest) {
+ String url = BASE_URL + "/xprinter/queryPrintersStatus";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<List<Integer>> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<List<Integer>>>(){});
+ return result;
+ }
+
+ /**
+ * 11.浜戝枃鍙挱鏀捐闊�
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<String> playVoice(VoiceRequest restRequest) {
+ String url = BASE_URL + "/xprinter/playVoice";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){});
+ return result;
+ }
+
+ /**
+ * 12.POS鎸囦护
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<String> pos(PrintRequest restRequest) {
+ String url = BASE_URL + "/xprinter/pos";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){});
+ return result;
+ }
+ /**
+ * 13.閽辩鎺у埗
+ * @param restRequest
+ * @return
+ */
+ public ObjectRestResponse<String> controlBox(PrintRequest restRequest) {
+ String url = BASE_URL + "/xprinter/controlBox";
+ String jsonRequest = JSON.toJSONString(restRequest);
+ String resp = HttpsUtil.postJson(url, jsonRequest);
+ ObjectRestResponse<String> result = JSON.parseObject(resp, new TypeReference<ObjectRestResponse<String>>(){});
+ return result;
+ }
+
+}
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/PrinterInfoServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/PrinterInfoServiceImpl.java
index 05fb6e2..6ec7301 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/PrinterInfoServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/PrinterInfoServiceImpl.java
@@ -3,16 +3,11 @@
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.doumee.core.constants.ResponseStatus;
-import com.doumee.core.exception.BusinessException;
import com.doumee.core.model.PageData;
import com.doumee.core.model.PageWrap;
-import com.doumee.core.utils.xpyun.XpyunPrintService;
-import com.doumee.core.utils.xpyun.XpyunResponse;
import com.doumee.dao.business.PrinterInfoMapper;
import com.doumee.dao.business.model.PrinterInfo;
import com.doumee.service.business.PrinterInfoService;
-import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
@@ -30,21 +25,8 @@
@Autowired
private PrinterInfoMapper printerInfoMapper;
- @Autowired
- private XpyunPrintService xpyunPrintService;
-
@Override
public Integer create(PrinterInfo printerInfo) {
- if (StringUtils.isBlank(printerInfo.getSn())) {
- throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鎵撳嵃鏈篠N涓嶈兘涓虹┖");
- }
- if (StringUtils.isBlank(printerInfo.getName())) {
- throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鎵撳嵃鏈哄悕绉颁笉鑳戒负绌�");
- }
- XpyunResponse response = xpyunPrintService.addPrinter(printerInfo.getSn(), printerInfo.getName());
- if (response.getCode() != 0) {
- throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "鑺儴浜戞坊鍔犳墦鍗版満澶辫触锛�" + response.getMsg());
- }
printerInfoMapper.insert(printerInfo);
return printerInfo.getId();
}
diff --git a/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java b/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java
index cf7f782..87cd2c6 100644
--- a/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java
+++ b/server/services/src/main/java/com/doumee/service/business/impl/ShopInfoServiceImpl.java
@@ -26,6 +26,12 @@
import com.doumee.dao.business.model.Orders;
import com.doumee.dao.business.model.PricingRule;
import com.doumee.dao.business.model.ShopInfo;
+import com.doumee.config.xyy.XyyConfig;
+import com.doumee.config.xyy.dto.AddPrinterRequest;
+import com.doumee.config.xyy.dto.AddPrinterRequestItem;
+import com.doumee.config.xyy.dto.DelPrinterRequest;
+import com.doumee.config.xyy.vo.ObjectRestResponse;
+import com.doumee.config.xyy.vo.PrinterResult;
import com.doumee.dao.dto.*;
import com.doumee.dao.system.model.SystemDictData;
import com.doumee.dao.system.SystemUserMapper;
@@ -93,6 +99,12 @@
@Autowired
private SmsrecordMapper smsrecordMapper;
+
+ @Autowired
+ private PrintService printService;
+
+ @Autowired
+ private XyyConfig xyyConfig;
@Override
public Integer create(ShopInfo shopInfo) {
shopInfoMapper.insert(shopInfo);
@@ -870,6 +882,7 @@
vo.setFeeStandard(shop.getFeeStandard());
vo.setLatitude(shop.getLatitude());
vo.setLongitude(shop.getLongitude());
+ vo.setLinkPhone(shop.getLinkPhone());
// 闂ㄥご鐓� + 鍐呴儴鐓� 鍏ㄨ矾寰勯泦鍚�
String imgPrefix = getShopPrefix();
@@ -1082,6 +1095,7 @@
// 瀛樹欢闂ㄥ簵
List<Orders> depositSalesOrders = ordersMapper.selectList(new QueryWrapper<Orders>().lambda()
.eq(Orders::getDeleted, Constants.ZERO)
+ .notIn(Orders::getStatus,Constants.OrderStatus.cancelled.getStatus(),Constants.OrderStatus.waitPay.getStatus())
.ge(Orders::getCreateTime, startTime)
.lt(Orders::getCreateTime, endTime)
.eq(Orders::getDepositShopId, shopId));
@@ -1089,6 +1103,7 @@
List<Orders> takeSalesOrders = ordersMapper.selectList(new QueryWrapper<Orders>().lambda()
.eq(Orders::getDeleted, Constants.ZERO)
.eq(Orders::getType,Constants.ONE)
+ .notIn(Orders::getStatus,Constants.OrderStatus.cancelled.getStatus(),Constants.OrderStatus.waitPay.getStatus())
.ge(Orders::getCreateTime, startTime)
.lt(Orders::getCreateTime, endTime)
.eq(Orders::getTakeShopId, shopId));
@@ -1161,7 +1176,10 @@
.last("limit 1")
);
if(shop==null){
- throw new BusinessException(ResponseStatus.ACCOUNT_INCORRECT);
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"璇锋牳瀵圭櫥褰曟墜鏈哄彿鏄惁姝g‘");
+ }
+ if(Constants.equalsInteger(shop.getStatus(),Constants.ONE)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闂ㄥ簵宸茬鐢紝璇疯仈绯荤鐞嗗憳");
}
if(!Constants.equalsInteger(shop.getAuditStatus(),Constants.THREE)){
if(Constants.equalsInteger(shop.getAuditStatus(),Constants.ONE)){
@@ -1219,6 +1237,9 @@
.last("limit 1"));
if (shop == null) {
return null;
+ }
+ if(Constants.equalsInteger(shop.getStatus(),Constants.ONE)){
+ throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"闂ㄥ簵宸茬鐢紝璇疯仈绯荤鐞嗗憳");
}
// 鍒涘缓token锛坓enerateTokenForRedis 宸茶嚜鍔ㄦ竻闄よ鐢ㄦ埛鏃oken锛屼繚璇佸敮涓�鏈夋晥锛�
String token = JwtTokenUtil.generateTokenForRedis(shop.getId(), Constants.TWO, JSONObject.toJSONString(shop), redisTemplate);
@@ -1418,56 +1439,57 @@
}
}
- @Autowired
- private com.doumee.core.utils.xpyun.XpyunPrintService xpyunPrintService;
-
@Override
- public void bindPrinter(com.doumee.dao.dto.PrinterBindDTO dto) {
- ShopInfo shop = shopInfoMapper.selectById(dto.getShopId());
+ public void maintainPrinterSn(ShopPrinterDTO dto) {
+ ShopInfo shop = shopInfoMapper.selectById(dto.getId());
if (shop == null || Constants.equalsInteger(shop.getDeleted(), Constants.ONE)) {
throw new BusinessException(ResponseStatus.DATA_EMPTY);
}
- // 璋冪敤鑺儴浜戞敞鍐屾墦鍗版満
- com.doumee.core.utils.xpyun.XpyunResponse resp = xpyunPrintService.addPrinter(
- dto.getPrinterSn(), shop.getName());
- if (resp.getCode() != null && resp.getCode() == 0) {
- log.info("鑺儴浜戞墦鍗版満娉ㄥ唽鎴愬姛: sn={}", dto.getPrinterSn());
- } else {
- log.warn("鑺儴浜戞墦鍗版満娉ㄥ唽杩斿洖闈�0: sn={}, code={}, msg={}",
- dto.getPrinterSn(), resp.getCode(), resp.getMsg());
+ String oldSn = shop.getPrinterSn();
+ String newSn = dto.getPrinterSn();
+ boolean hasNewSn = StringUtils.isNotBlank(newSn);
+ boolean hasOldSn = StringUtils.isNotBlank(oldSn);
+
+ if (!hasNewSn) {
+ // 鏈紶鎵撳嵃鏈篠N 鈫� 鍒犻櫎閫昏緫
+ if (hasOldSn) {
+ delPrinterFromXyy(oldSn);
+ shop.setPrinterSn(null);
+ shopInfoMapper.updateById(shop);
+ }
+ return;
}
- // 鏃犺浜戠鏄惁鎴愬姛锛岄兘缁戝畾鍒伴棬搴楋紙鍙悗缁噸璇曚簯绔敞鍐岋級
- ShopInfo update = new ShopInfo();
- update.setId(dto.getShopId());
- update.setPrinterSn(dto.getPrinterSn());
- shopInfoMapper.updateById(update);
+
+ // 浼犱簡鎵撳嵃鏈篠N 鈫� 濡傛灉鏃х粦瀹氬瓨鍦紝鍏堝垹闄�
+ if (hasOldSn) {
+ delPrinterFromXyy(oldSn);
+ }
+
+ // 缁戝畾鏂版墦鍗版満
+ AddPrinterRequest addReq = new AddPrinterRequest();
+ xyyConfig.createRequestHeader(addReq);
+ addReq.setItems(new AddPrinterRequestItem[]{new AddPrinterRequestItem() {{
+ setSn(newSn);
+ setName(shop.getName());
+ }}});
+ ObjectRestResponse<PrinterResult> addResp = printService.addPrinters(addReq);
+ if (addResp.getCode() != 0) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "缁戝畾鎵撳嵃鏈哄け璐ワ細" + addResp.getMsg());
+ }
+ log.info("缁戝畾鎴愬姛锛歿}", newSn);
+ shop.setPrinterSn(newSn);
+ shopInfoMapper.updateById(shop);
}
- @Override
- public void unbindPrinter(Integer shopId) {
- ShopInfo shop = shopInfoMapper.selectById(shopId);
- if (shop == null || Constants.equalsInteger(shop.getDeleted(), Constants.ONE)) {
- throw new BusinessException(ResponseStatus.DATA_EMPTY);
+ private void delPrinterFromXyy(String sn) {
+ DelPrinterRequest delReq = new DelPrinterRequest();
+ xyyConfig.createRequestHeader(delReq);
+ delReq.setSnlist(new String[]{sn});
+ ObjectRestResponse<PrinterResult> delResp = printService.delPrinters(delReq);
+ if (delResp.getCode() != 0) {
+ throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "瑙g粦鎵撳嵃鏈哄け璐ワ細" + delResp.getMsg());
}
- if (StringUtils.isNotBlank(shop.getPrinterSn())) {
- xpyunPrintService.deletePrinter(shop.getPrinterSn());
- }
- ShopInfo update = new ShopInfo();
- update.setId(shopId);
- update.setPrinterSn(null);
- shopInfoMapper.updateById(update);
- }
-
- @Override
- public Object queryPrinterStatus(Integer shopId) {
- ShopInfo shop = shopInfoMapper.selectById(shopId);
- if (shop == null || Constants.equalsInteger(shop.getDeleted(), Constants.ONE)) {
- throw new BusinessException(ResponseStatus.DATA_EMPTY);
- }
- if (StringUtils.isBlank(shop.getPrinterSn())) {
- throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "璇ラ棬搴楁湭缁戝畾鎵撳嵃鏈�");
- }
- return xpyunPrintService.queryPrinterStatus(shop.getPrinterSn());
+ log.info("瑙g粦鎴愬姛锛歿}", sn);
}
}
diff --git a/server/services/src/main/resources/application-dev.yml b/server/services/src/main/resources/application-dev.yml
index 800be90..d31d65f 100644
--- a/server/services/src/main/resources/application-dev.yml
+++ b/server/services/src/main/resources/application-dev.yml
@@ -64,8 +64,8 @@
des_pwd: 123456SDFKDJF
jpush:
- appKey:
- masterSecret:
+ appKey: bb8fd4bd06c8dcb004f4ee1e
+ masterSecret: 569a75763aa5a59377c46fbb
apnsProduction: false
knife4j:
diff --git a/server/services/src/main/resources/application-pro.yml b/server/services/src/main/resources/application-pro.yml
index 9be3ff8..9e70610 100644
--- a/server/services/src/main/resources/application-pro.yml
+++ b/server/services/src/main/resources/application-pro.yml
@@ -30,6 +30,11 @@
ssl:
enable: true
debug_model: false
+########################鏋佸厜鎺ㄩ�侀厤缃�########################
+jpush:
+ appKey: bb8fd4bd06c8dcb004f4ee1e
+ masterSecret: 569a75763aa5a59377c46fbb
+ apnsProduction: false
# Swagger閰嶇疆
swagger:
diff --git a/server/web/src/main/java/com/doumee/api/web/ConfigApi.java b/server/web/src/main/java/com/doumee/api/web/ConfigApi.java
index cadd02a..85570ff 100644
--- a/server/web/src/main/java/com/doumee/api/web/ConfigApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/ConfigApi.java
@@ -173,6 +173,15 @@
return ApiResponse.success("鏌ヨ鎴愬姛", areasService.getOpenedCityByName(cityName));
}
+ @ApiOperation(value = "鏍规嵁鍩庡競缂栫爜鏌ヨ鍩庡競淇℃伅", notes = "浠呰繑鍥炲凡寮�閫氱殑鍩庡競锛屾湭寮�閫氳繑鍥炵┖")
+ @GetMapping("/getCityByCode")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query", dataType = "String", name = "code", value = "鍩庡競缂栫爜", required = true)
+ })
+ public ApiResponse<Areas> getCityByCode(@RequestParam String code) {
+ return ApiResponse.success("鏌ヨ鎴愬姛", areasService.getOpenedCityByCode(code));
+ }
+
@LoginRequired
@ApiOperation(value = "浼氬憳閫氱煡娑堟伅鍒嗛〉", notes = "鏈浼樺厛锛屾椂闂村�掑簭")
@PostMapping("/memberNoticePage")
diff --git a/server/web/src/main/java/com/doumee/api/web/DriverInfoApi.java b/server/web/src/main/java/com/doumee/api/web/DriverInfoApi.java
index 77ec3a9..6ce7b4e 100644
--- a/server/web/src/main/java/com/doumee/api/web/DriverInfoApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/DriverInfoApi.java
@@ -24,6 +24,7 @@
import com.doumee.dao.vo.DriverCenterVO;
import com.doumee.dao.vo.DriverGrabOrderVO;
import com.doumee.dao.vo.DriverOrderDetailVO;
+import com.doumee.core.utils.jpush.JPushUtil;
import com.doumee.service.business.DriverInfoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
@@ -286,4 +287,26 @@
return ApiResponse.success(driverInfoService.checkDriverToken(token));
}
+ @LoginDriverRequired
+ @ApiOperation("娉ㄥ唽鏋佸厜鎺ㄩ�佸埆鍚�")
+ @PostMapping("/registerJpushAlias")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "鍙告満token鍊�", required = true)
+ })
+ public ApiResponse registerJpushAlias(@RequestParam String jpushAlias) {
+ driverInfoService.registerJpushAlias(this.getDriverId(), jpushAlias);
+ return ApiResponse.success("鎿嶄綔鎴愬姛");
+ }
+
+ @ApiOperation("鏋佸厜鎺ㄩ�佹祴璇�")
+ @GetMapping("/testJpush")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "query", dataType = "String", name = "title", value = "閫氱煡鏍囬", required = true),
+ @ApiImplicitParam(paramType = "query", dataType = "String", name = "content", value = "閫氱煡鍐呭", required = true)
+ })
+ public ApiResponse<Boolean> testJpush(@RequestParam String telephone, @RequestParam String title, @RequestParam String content) {
+ boolean result = JPushUtil.sendByAlias(org.springframework.util.DigestUtils.md5DigestAsHex(telephone.getBytes()), title, content, null);
+ return ApiResponse.success("鎺ㄩ��" + (result ? "鎴愬姛" : "澶辫触"), result);
+ }
+
}
diff --git a/server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java b/server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java
index 6087e89..0d1f123 100644
--- a/server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java
+++ b/server/web/src/main/java/com/doumee/api/web/ShopInfoApi.java
@@ -144,4 +144,16 @@
return ApiResponse.success("瀵嗙爜淇敼鎴愬姛锛岃閲嶆柊鐧诲綍");
}
+ @LoginShopRequired
+ @ApiOperation("闂ㄥ簵鎵撳嵃璁㈠崟鏍囩")
+ @GetMapping("/printOrderLabel/{orderId}")
+ @ApiImplicitParams({
+ @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "闂ㄥ簵token鍊�", required = true),
+ @ApiImplicitParam(paramType = "path", dataType = "Integer", name = "orderId", value = "璁㈠崟涓婚敭", required = true)
+ })
+ public ApiResponse printOrderLabel(@PathVariable Integer orderId) {
+ ordersService.printOrderLabel(orderId, this.getShopId());
+ return ApiResponse.success("鎵撳嵃鎴愬姛");
+ }
+
}
--
Gitblit v1.9.3