ruoyi-common/ruoyi-common-core/src/main/java/com/ruoyi/common/core/vo/AddressDto.java
@@ -7,5 +7,6 @@ public class AddressDto { private String city; private String cityCode; private String detail; private String name; } ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/controller/HomePageController.java
@@ -55,12 +55,13 @@ if (null == loginUser) { return R.loginExpire("登录失效!"); } if (loginUser.getIsFranchisee()) { if (loginUser.getIsFranchisee()||!userDataCountRequest.getCityList().isEmpty()) { if (null == userDataCountRequest.getCityList() || userDataCountRequest.getCityList().isEmpty()) { userDataCountRequest.setCityList(loginUser.getCityList()); } else { // userDataCountRequest.getCityList().addAll(loginUser.getCityList()); } // else { //// userDataCountRequest.getCityList().addAll(loginUser.getCityList()); // } R<List<Integer>> listR = orderClient.queryIdsBycode(userDataCountRequest.getCityList()); return R.ok(userService.userDataCount1(userDataCountRequest, listR.getData())); @@ -82,12 +83,13 @@ if (null == loginUser) { return R.loginExpire("登录失效!"); } if (loginUser.getIsFranchisee()) { if (loginUser.getIsFranchisee()||!cityList.isEmpty()) { if (null == cityList || cityList.isEmpty()) { cityList = loginUser.getCityList(); } else { // cityList.addAll(loginUser.getCityList()); } // else { //// cityList.addAll(loginUser.getCityList()); // } R<List<Integer>> listR = orderClient.queryIdsBycode(cityList); return R.ok(userService.userTrends1(cityList,listR.getData())); ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/controller/MasterWorkerController.java
@@ -198,10 +198,10 @@ if (!star.isEmpty()) { // 总评分 / 评价数量 double sum = star.stream().mapToDouble(Double::doubleValue).sum(); BigDecimal average = new BigDecimal(sum / star.size()).setScale(2, RoundingMode.HALF_UP); BigDecimal average = new BigDecimal(sum / star.size()).setScale(1, RoundingMode.HALF_UP); workerDetail.setStarRating(average); } else { workerDetail.setStarRating(new BigDecimal("0.00")); workerDetail.setStarRating(new BigDecimal("0.0")); } return R.ok(workerDetail); ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/controller/OrderController.java
@@ -270,6 +270,7 @@ // @RequiresPermissions({"reassignment_edit","order_edit"}) @ApiOperation(value = "订单列表-编辑", tags = {"后台-订单管理"}) @PostMapping(value = "/edit") @@ -278,7 +279,10 @@ Site site = siteService.lambdaQuery() .eq(Site::getId, order.getSiteId()) .eq(Site::getIsDelete, 0).one(); order.setSiteName(site.getSiteName()); if (null != site) { order.setSiteName(site.getSiteName()); } // 师傅信息 if (null != order.getServerId()) { MasterWorker masterWorker = masterWorkerService.lambdaQuery() @@ -299,6 +303,7 @@ }else { order.setOrderMoney(one.getRecoveryPrice()); } order.setServeName(recoveryServe.getServeName()); // 后台订单 order.setType(Constants.ONE); Boolean data = orderClient.edit(order).getData(); @@ -419,8 +424,8 @@ @ApiOperation(value = "ocr识别", tags = {"后台-首页"}) @PostMapping (value = "/ocr") public R<AddressDto> ocr(OcrBase ocrBase) { return R.ok(DescribeInstances.orcr(ocrBase.getBase())); public R<AddressDto> ocr(String ocrAddress) { return R.ok(DescribeInstances.ocr(ocrAddress)); } /** ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/service/impl/UserServiceImpl.java
@@ -48,6 +48,9 @@ } @Override public List<UserTrendsVO> userTrends1(List<String> city,List<Integer> userIds) { if (userIds.isEmpty()){ return new ArrayList<>(); } List<UserTrendsVO> userTrendsList = baseMapper.userTrends1(city,userIds); return null == userTrendsList || userTrendsList.isEmpty() ? new ArrayList<>() : userTrendsList; } @@ -120,6 +123,9 @@ public UserDataCountVO userDataCount1(UserDataCountRequest userDataCountRequest,List<Integer> userIds) { List<String> cityList = userDataCountRequest.getCityList(); String type = userDataCountRequest.getCountType(); if (userIds.isEmpty()){ return new UserDataCountVO(null,null,null,null); } LambdaQueryChainWrapper<User> userWrapper = lambdaQuery().eq(User::getIsDelete, 0).isNotNull(User::getPhone).in(!userIds.isEmpty(),User::getId,userIds); // if (null != cityList && !cityList.isEmpty()) { ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/service/impl/WorkerProcessServiceImpl.java
@@ -58,6 +58,7 @@ masterWorker.setUserNumber(Constants.DEFAULT_USER_NUMBER_PRE + RandomUtil.randomNumbers(10)); masterWorker.setCityStr(workerProcess.getCityStr()); masterWorker.setCityCode(workerProcess.getCityCode()); masterWorker.setProfilePicture(workerProcess.getProfilePicture()); masterWorkerService.save(masterWorker); } return updateById(workerProcess) ? R.ok() : R.fail("当前入驻申请审核失败!"); ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/utils/DescribeInstances.java
@@ -10,8 +10,69 @@ import com.tencentcloudapi.cvm.v20170312.models.DescribeInstancesResponse; import com.tencentcloudapi.ocr.v20181119.OcrClient; import com.tencentcloudapi.ocr.v20181119.models.*; import org.apache.http.HttpResponse; import org.apache.http.util.EntityUtils; import java.util.HashMap; import java.util.Map; public class DescribeInstances { public static AddressDto ocr(String address){ String host = "https://addre.market.alicloudapi.com"; String path = "/format"; String method = "GET"; String appcode = "44145c4c95004841985608a86eb4a4b7"; Map<String, String> headers = new HashMap<String, String>(); //最后在header中的格式(中间是英文空格)为Authorization:APPCODE 83359fd73fe94948385f570e3c139105 headers.put("Authorization", "APPCODE " + appcode); Map<String, String> querys = new HashMap<String, String>(); querys.put("text", address); try { /** * 重要提示如下: * HttpUtils请从 * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java * 下载 * * 相应的依赖请参照 * https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml */ HttpResponse response = HttpUtils.doGet(host, path, method, headers, querys); System.out.println(); String string = EntityUtils.toString(response.getEntity()); JSONObject json = JSON.parseObject(string); // 获取 data 对象 JSONObject data = json.getJSONObject("data"); // 提取所需的字段 String address1 = data.getString("address"); String person1 = data.getString("person"); String phonenum1 = data.getString("phonenum"); // 打印结果 System.out.println("Address: " + address1); System.out.println("Person: " + person1); System.out.println("Phone Number: " + phonenum1); AddressDto addressDto = new AddressDto(); addressDto.setAddress(address1); addressDto.setName(person1); addressDto.setPhone(phonenum1); return addressDto; //获取response的body } catch (Exception e) { e.printStackTrace(); } return new AddressDto(); } public static AddressDto orcr(String args) { try { // 为了保护密钥安全,建议将密钥设置在环境变量中或者配置文件中,请参考本文凭证管理章节。 ruoyi-service/ruoyi-admin/src/main/java/com/ruoyi/admin/utils/HttpUtils.java
New file @@ -0,0 +1,312 @@ package com.ruoyi.admin.utils; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.security.KeyManagementException; import java.security.NoSuchAlgorithmException; import java.security.cert.X509Certificate; import java.util.ArrayList; import java.util.List; import java.util.Map; import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManager; import javax.net.ssl.X509TrustManager; import com.baomidou.mybatisplus.core.toolkit.StringUtils; import org.apache.http.HttpResponse; import org.apache.http.NameValuePair; import org.apache.http.client.HttpClient; import org.apache.http.client.entity.UrlEncodedFormEntity; import org.apache.http.client.methods.HttpDelete; import org.apache.http.client.methods.HttpGet; import org.apache.http.client.methods.HttpPost; import org.apache.http.client.methods.HttpPut; import org.apache.http.conn.ClientConnectionManager; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.conn.ssl.SSLSocketFactory; import org.apache.http.entity.ByteArrayEntity; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.DefaultHttpClient; import org.apache.http.message.BasicNameValuePair; public class HttpUtils { /** * get * * @param host * @param path * @param method * @param headers * @param querys * @return * @throws Exception */ public static HttpResponse doGet(String host, String path, String method, Map<String, String> headers, Map<String, String> querys) throws Exception { HttpClient httpClient = wrapClient(host); HttpGet request = new HttpGet(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } return httpClient.execute(request); } /** * post form * * @param host * @param path * @param method * @param headers * @param querys * @param bodys * @return * @throws Exception */ public static HttpResponse doPost(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, Map<String, String> bodys) throws Exception { HttpClient httpClient = wrapClient(host); HttpPost request = new HttpPost(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (bodys != null) { List<NameValuePair> nameValuePairList = new ArrayList<NameValuePair>(); for (String key : bodys.keySet()) { nameValuePairList.add(new BasicNameValuePair(key, bodys.get(key))); } UrlEncodedFormEntity formEntity = new UrlEncodedFormEntity(nameValuePairList, "utf-8"); formEntity.setContentType("application/x-www-form-urlencoded; charset=UTF-8"); request.setEntity(formEntity); } return httpClient.execute(request); } /** * Post String * * @param host * @param path * @param method * @param headers * @param querys * @param body * @return * @throws Exception */ public static HttpResponse doPost(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, String body) throws Exception { HttpClient httpClient = wrapClient(host); HttpPost request = new HttpPost(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (StringUtils.isNotBlank(body)) { request.setEntity(new StringEntity(body, "utf-8")); } return httpClient.execute(request); } /** * Post stream * * @param host * @param path * @param method * @param headers * @param querys * @param body * @return * @throws Exception */ public static HttpResponse doPost(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, byte[] body) throws Exception { HttpClient httpClient = wrapClient(host); HttpPost request = new HttpPost(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (body != null) { request.setEntity(new ByteArrayEntity(body)); } return httpClient.execute(request); } /** * Put String * @param host * @param path * @param method * @param headers * @param querys * @param body * @return * @throws Exception */ public static HttpResponse doPut(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, String body) throws Exception { HttpClient httpClient = wrapClient(host); HttpPut request = new HttpPut(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (StringUtils.isNotBlank(body)) { request.setEntity(new StringEntity(body, "utf-8")); } return httpClient.execute(request); } /** * Put stream * @param host * @param path * @param method * @param headers * @param querys * @param body * @return * @throws Exception */ public static HttpResponse doPut(String host, String path, String method, Map<String, String> headers, Map<String, String> querys, byte[] body) throws Exception { HttpClient httpClient = wrapClient(host); HttpPut request = new HttpPut(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } if (body != null) { request.setEntity(new ByteArrayEntity(body)); } return httpClient.execute(request); } /** * Delete * * @param host * @param path * @param method * @param headers * @param querys * @return * @throws Exception */ public static HttpResponse doDelete(String host, String path, String method, Map<String, String> headers, Map<String, String> querys) throws Exception { HttpClient httpClient = wrapClient(host); HttpDelete request = new HttpDelete(buildUrl(host, path, querys)); for (Map.Entry<String, String> e : headers.entrySet()) { request.addHeader(e.getKey(), e.getValue()); } return httpClient.execute(request); } private static String buildUrl(String host, String path, Map<String, String> querys) throws UnsupportedEncodingException { StringBuilder sbUrl = new StringBuilder(); sbUrl.append(host); if (!StringUtils.isBlank(path)) { sbUrl.append(path); } if (null != querys) { StringBuilder sbQuery = new StringBuilder(); for (Map.Entry<String, String> query : querys.entrySet()) { if (0 < sbQuery.length()) { sbQuery.append("&"); } if (StringUtils.isBlank(query.getKey()) && !StringUtils.isBlank(query.getValue())) { sbQuery.append(query.getValue()); } if (!StringUtils.isBlank(query.getKey())) { sbQuery.append(query.getKey()); if (!StringUtils.isBlank(query.getValue())) { sbQuery.append("="); sbQuery.append(URLEncoder.encode(query.getValue(), "utf-8")); } } } if (0 < sbQuery.length()) { sbUrl.append("?").append(sbQuery); } } return sbUrl.toString(); } private static HttpClient wrapClient(String host) { HttpClient httpClient = new DefaultHttpClient(); if (host.startsWith("https://")) { sslClient(httpClient); } return httpClient; } private static void sslClient(HttpClient httpClient) { try { SSLContext ctx = SSLContext.getInstance("TLS"); X509TrustManager tm = new X509TrustManager() { public X509Certificate[] getAcceptedIssuers() { return null; } public void checkClientTrusted(X509Certificate[] xcs, String str) { } public void checkServerTrusted(X509Certificate[] xcs, String str) { } }; ctx.init(null, new TrustManager[] { tm }, null); SSLSocketFactory ssf = new SSLSocketFactory(ctx); ssf.setHostnameVerifier(SSLSocketFactory.ALLOW_ALL_HOSTNAME_VERIFIER); ClientConnectionManager ccm = httpClient.getConnectionManager(); SchemeRegistry registry = ccm.getSchemeRegistry(); registry.register(new Scheme("https", 443, ssf)); } catch (KeyManagementException ex) { throw new RuntimeException(ex); } catch (NoSuchAlgorithmException ex) { throw new RuntimeException(ex); } } } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/ChangeDispatchController.java
@@ -61,10 +61,10 @@ request.getPageSize())); for (ChangeDispatch record : page.getRecords()) { Order byId = orderService.getById(record.getOrderId()); if (byId!=null){ record.setType(byId.getType()); } // if (byId!=null){ // record.setType(byId.getType()); // // } } return R.ok(page); } ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/OrderController.java
@@ -8,6 +8,7 @@ import com.ruoyi.common.core.domain.BaseEntity; import com.ruoyi.common.core.domain.R; import com.ruoyi.common.core.exception.GlobalException; import com.ruoyi.common.core.vo.AddressDto; import com.ruoyi.common.core.vo.Path; import com.ruoyi.order.entity.*; import com.ruoyi.order.request.OrderCountDataRequest; @@ -16,6 +17,7 @@ import com.ruoyi.order.request.UserOrderRequest; import com.ruoyi.order.service.*; import com.ruoyi.order.vo.*; import com.ruoyi.user.api.feignClient.UserClient; import io.swagger.annotations.Api; import io.swagger.annotations.ApiImplicitParam; import io.swagger.annotations.ApiImplicitParams; @@ -30,6 +32,7 @@ import java.util.Arrays; import java.util.Date; import java.util.List; import java.util.Objects; import java.util.stream.Collectors; /** @@ -252,6 +255,8 @@ return R.ok(order); } @Resource private UserClient userClient; /** * 新增订单 * 后台订单为指定订单,默认为待上门状态 @@ -261,6 +266,14 @@ @ApiOperation(value = "订单列表-新增订单", tags = {"后台-订单管理"}) @PostMapping(value = "/save") public R<Boolean> save(@RequestBody OrderRequest orderRequest) { R<BigDecimal> servePrice = userClient.getServePrice(orderRequest.getServeId(), orderRequest.getCityCode()); if (servePrice.getData()!=null){ orderRequest.setOrderMoney(servePrice.getData()); } Order order = new Order(); order.setCity(orderRequest.getCity()); order.setOrderNumber(orderRequest.getOrderNumber()); @@ -269,7 +282,7 @@ order.setSiteName(orderRequest.getSiteName()); order.setServeId(orderRequest.getServeId()); order.setServeName(orderRequest.getServeName()); order.setServePrice(orderRequest.getServePrice()); order.setServePrice(orderRequest.getOrderMoney()); order.setSiteName(orderRequest.getSiteName()); // 预约信息 order.setReservationName(orderRequest.getReservationName()); @@ -304,8 +317,25 @@ @ApiOperation(value = "订单列表-新增订单", tags = {"后台-订单管理"}) @PostMapping(value = "/edit") public R<Boolean> edit(@RequestBody OrderRequest orderRequest) { Order order = orderService.getById(orderRequest.getOrderId()); R<BigDecimal> servePrice = userClient.getServePrice(orderRequest.getServeId(), orderRequest.getCityCode()); if (servePrice.getData()!=null){ orderRequest.setOrderMoney(servePrice.getData()); } Order order = orderService.getById(orderRequest.getOrderId()); if (order.getState()!=6) { if ((!Objects.equals(order.getServerId(), orderRequest.getServerId())) || (!Objects.equals(order.getTime(), orderRequest.getTime()))) { order.setState(1); order.setArriveTime(null); order.setAcceptTime(new Date()); orderService.lambdaUpdate() .eq(Order::getId, order.getId() ).set(Order::getArriveTime, null).update(); } } order.setId(orderRequest.getOrderId()); order.setCity(orderRequest.getCity()); @@ -315,35 +345,37 @@ order.setSiteName(orderRequest.getSiteName()); order.setServeId(orderRequest.getServeId()); order.setServeName(orderRequest.getServeName()); order.setServePrice(orderRequest.getServePrice()); order.setServePrice(orderRequest.getOrderMoney()); order.setSiteName(orderRequest.getSiteName()); order.setTime(orderRequest.getTime()); // 预约信息 order.setReservationName(orderRequest.getReservationName()); order.setReservationPhone(orderRequest.getReservationPhone()); order.setReservationAddress(orderRequest.getReservationAddress()); order.setTime(orderRequest.getTime()); order.setAcceptTime(orderRequest.getAcceptTime()); // order.setTime(orderRequest.getTime()); // order.setAcceptTime(orderRequest.getAcceptTime()); // 师傅信息 order.setServerId(orderRequest.getServerId()); order.setServerName(orderRequest.getServerName()); order.setServerPhone(orderRequest.getServerPhone()); order.setReservationRemark(orderRequest.getReservationRemark()); if ((order.getServerId()!=orderRequest.getServerId())||(order.getTime()!=orderRequest.getTime())) { order.setState(1); } order.setArriveTime(orderRequest.getArriveTime()); order.setType(orderRequest.getType()); // order.setType(orderRequest.getType()); order.setLongitude(orderRequest.getLongitude()); order.setLatitude(orderRequest.getLatitude()); order.setCompleteTime(orderRequest.getCompleteTime()); order.setSubsidy(orderRequest.getSubsidy()); // order.setSubsidy(orderRequest.getSubsidy()); order.setIsWithdrawal(orderRequest.getIsWithdrawal()); order.setAddress(orderRequest.getAddress()); order.setCancelReason(orderRequest.getCancelReason()); order.setApplyReason(orderRequest.getApplyReason()); order.setIsEvaluate(Constants.ZERO); order.setCityCode(orderRequest.getCityCode()); order.setOrderMoney(orderRequest.getOrderMoney()); order.setOrderMoney(orderRequest.getServePrice()); if (order.getSubsidy()!=null){ order.setOrderMoney(order.getServePrice().add(order.getSubsidy())); } return R.ok(orderService.updateById(order)); } @@ -641,7 +673,7 @@ wrapper.eq("server_id", workerId) .in("state", 1, 2) .eq("is_delete", Constants.ZERO) .eq("DATE(createTime)", todayStr) // 添加这一行来筛选当天的订单 .eq("DATE(time)", todayStr) // 添加这一行来筛选当天的订单 .orderByAsc("CASE WHEN topSort IS NULL THEN 1 ELSE 0 END") .orderByAsc("topSort"); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/controller/WithdrawController.java
@@ -137,9 +137,9 @@ throw new GlobalException("订单信息异常!"); } Boolean b = withdrawService.confirmWithdraw(openId, userId, order); if (!b) { throw new GlobalException("提现失败!"); } // if (!b) { // throw new GlobalException("提现失败!"); // } }else { Order order = orderService.lambdaQuery() .eq(Order::getId, withdraw.getOrderId()) ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/entity/ChangeDispatch.java
@@ -50,9 +50,7 @@ @ApiModelProperty("改派状态 (0:未改派 ;1:已改派 ;2:拒绝)") @TableField("state") private Integer state; @ApiModelProperty("订单类型(0:正常订单,1:后台订单(后台订单与用户端、师傅端无联系))") @TableField("type") private Integer type; @ApiModelProperty("订单id") @TableField("order_id") ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/OrderServiceImpl.java
@@ -331,9 +331,9 @@ order.setReservationName(reservationName); order.setReservationPhone(reservationPhone); if (null == userOrderRequest.getAddressId()) { order.setReservationAddress(addressDetail+cityCode.getData().getName()); order.setReservationAddress(cityCode.getData().getName()+address+cityCode.getData().getDetail()); } else { order.setReservationAddress(address+cityCode.getData().getName()); order.setReservationAddress(address+cityCode.getData().getName()+cityCode.getData().getDetail()); } order.setTime(time); order.setReservationRemark(reservationRemark); @@ -348,7 +348,7 @@ order.setLatitude(latitude); order.setIsWithdrawal(Constants.ZERO); order.setSubsidy(subsidy); order.setAddress(addressDetail); order.setAddress(""); order.setCity(cityCode.getData().getCity()); order.setCityCode(cityCode.getData().getCityCode()); this.save(order); ruoyi-service/ruoyi-order/src/main/java/com/ruoyi/order/service/impl/WithdrawServiceImpl.java
@@ -228,7 +228,8 @@ .eq(Withdraw::getOrderId, orderId).list(); List<Integer> stateList = list.stream().map(Withdraw::getState).collect(Collectors.toList()); if (stateList.contains(Constants.ZERO)) { throw new GlobalException("当前订单已提交提现申请,请等待审核!"); return false; // throw new GlobalException("当前订单已提交提现申请,请等待审核!"); } else if (stateList.contains(Constants.ONE)) { throw new GlobalException("当前订单已完成提现,请勿重复提现!"); } @@ -249,9 +250,9 @@ withdraw.setState(Constants.ONE); // 商家微信打款至微信零钱 boolean update = weChatPay(order.getOrderMoney(), openId,withdraw.getId()); if (!update) { throw new GlobalException("交易提现失败,请检查是否绑定微信!"); } // if (!update) { // throw new GlobalException("交易提现失败,请检查是否绑定微信!"); // } } else { // 待审核 withdraw.setState(Constants.ZERO); @@ -321,20 +322,28 @@ "D:\\study\\JiaDianHuiShou\\ruoyi-service\\ruoyi-order\\src\\main\\java\\com\\ruoyi\\order\\vx\\apiclient_key.pem", WechatConstants.WE_CHAT_URL_SUF); JSONObject jsonObject = JSONObject.parseObject(result); WithdrawDetail withdrawDetail = new WithdrawDetail(); withdrawDetail.setWithdrawId(withdrawId); withdrawDetail.setMoney(transferAmount); withdrawDetail.setOutBatchNo((String) postMap.get(WechatConstants.OUT_BATCH_NO)); withdrawDetailService.save(withdrawDetail); if (jsonObject.containsKey(WechatConstants.CREATE_TIME)) { // 转账成功 //保存转账明细 WithdrawDetail withdrawDetail = new WithdrawDetail(); withdrawDetail.setWithdrawId(withdrawId); withdrawDetail.setMoney(transferAmount); withdrawDetail.setOutBatchNo((String) postMap.get(WechatConstants.OUT_BATCH_NO)); withdrawDetailService.save(withdrawDetail); // WithdrawDetail withdrawDetail = new WithdrawDetail(); // withdrawDetail.setWithdrawId(withdrawId); // withdrawDetail.setMoney(transferAmount); // withdrawDetail.setOutBatchNo((String) postMap.get(WechatConstants.OUT_BATCH_NO)); // withdrawDetailService.save(withdrawDetail); } else { allTransfersSuccessful = false; break; } } return allTransfersSuccessful; ruoyi-service/ruoyi-order/src/main/resources/mapper/order/ChangeDispatchMapper.xml
@@ -6,7 +6,6 @@ <id column="id" property="id"/> <result column="worker_id" property="workerId"/> <result column="worker_name" property="workerName"/> <result column="type" property="type"/> <result column="apply_reason" property="applyReason"/> <result column="apply_time" property="applyTime"/> <result column="state" property="state"/> ruoyi-service/ruoyi-order/src/main/resources/mapper/order/EvaluateMapper.xml
@@ -147,7 +147,7 @@ <association property="evaluateInfo" javaType="com.ruoyi.order.vo.EvaluateInfoVO"> <result column="content" property="content"/> <result column="star_rating" property="starRating"/> <result column="createTime" property="evaluateTime"/> <result column="evaluateTime" property="evaluateTime"/> </association> </resultMap> @@ -163,7 +163,7 @@ o.createTime as createTime, o.serve_id, o.reservation_address, o.address o.address,e.createTime as evaluateTime FROM t_order o LEFT JOIN t_evaluate e on o.id = e.order_id <where> ruoyi-service/ruoyi-order/src/main/resources/mapper/order/OrderMapper.xml
@@ -174,7 +174,7 @@ SUM(CASE WHEN o.state = 3 THEN 1 ELSE 0 END) AS completedNumber, SUM(CASE WHEN o.state = 6 THEN 1 ELSE 0 END) AS reInvestment FROM t_order o WHERE o.is_delete = 0 and DATE(o.createTime) = DATE(NOW()) WHERE o.is_delete = 0 and DATE(o.time) = DATE(NOW()) and o.server_id is not null <if test="cityList != null and cityList.size() != 0"> and o.city_code in @@ -408,7 +408,7 @@ COALESCE(SUM(CASE WHEN o.state = 3 THEN 1 ELSE 0 END), 0) AS completed FROM t_order o where o.server_id = #{workerId} and o.is_delete = 0 AND DATE(o.createTime) = CURDATE() and o.is_delete = 0 </select> <select id="orderCountByTimeRange" resultType="com.ruoyi.order.vo.OrderQueryVO"> ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/OrderController.java
@@ -104,21 +104,21 @@ }) public R<BigDecimal> estimate(@RequestParam String orderId, String city) { Order order = orderClient.detail(orderId).getData(); RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() .eq(RecoveryServe::getId, order.getServeId()) .eq(RecoveryServe::getIsDelete, 0).one(); BigDecimal money = recoveryServe.getDefaultPrice(); if (StringUtils.isNotBlank(city)) { CityInfoVO info = GaoDeMapUtil.getAddressInfo(city).getDatas(); RecoveryServePrice price = recoveryServePriceService.lambdaQuery() .eq(RecoveryServePrice::getRecoveryServeId, recoveryServe.getId()) .eq(RecoveryServePrice::getCityCode, info.getCode()) .eq(RecoveryServePrice::getIsDelete, Constants.ZERO).one(); if (null != price) { money = price.getRecoveryPrice(); } } return R.ok(money); // RecoveryServe recoveryServe = recoveryServeService.lambdaQuery() // .eq(RecoveryServe::getId, order.getServeId()) // .eq(RecoveryServe::getIsDelete, 0).one(); // BigDecimal money = recoveryServe.getDefaultPrice(); // if (StringUtils.isNotBlank(city)) { // CityInfoVO info = GaoDeMapUtil.getAddressInfo(city).getDatas(); // RecoveryServePrice price = recoveryServePriceService.lambdaQuery() // .eq(RecoveryServePrice::getRecoveryServeId, recoveryServe.getId()) // .eq(RecoveryServePrice::getCity, info.getCode()) // .eq(RecoveryServePrice::getIsDelete, Constants.ZERO).one(); // if (null != price) { // money = price.getRecoveryPrice(); // } // } return R.ok(order.getServePrice()); } @GetMapping("/detail") ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/UserController.java
@@ -302,6 +302,7 @@ userDto.setCityCode(byId.getCityCode()); userDto.setCity(byId.getCity()); userDto.setName(byId.getName()); userDto.setDetail(byId.getAddressDetail()); return R.ok(userDto); } ruoyi-service/ruoyi-user/src/main/java/com/ruoyi/user/controller/WithdrawController.java
@@ -79,11 +79,17 @@ return R.loginExpire("登录失效!"); } if (redisService.hasKey(orderId)) { return R.repeatedSubmission("请勿重复提交!"); return R.fail("该笔订单已申请提现"); // return R.repeatedSubmission("请勿重复提交!"); } redisService.setCacheObject(orderId, "1", 10L, TimeUnit.SECONDS); Boolean b = withdrawService.confirmWithdraw(orderId, loginUser.getUserid()); return R.ok(withdrawService.confirmWithdraw(orderId, loginUser.getUserid())); if (b){ return R.ok(); }else { return R.fail("该笔订单已申请提现"); } } @GetMapping("/withdrawRecord")