| | |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:orders:update") |
| | | public ApiResponse updateById(@RequestBody Orders orders) { |
| | | ordersService.updateById(orders); |
| | | return ApiResponse.success(null); |
| | | } |
| | | // @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | // @PostMapping("/updateById") |
| | | // @RequiresPermissions("business:orders:update") |
| | | // public ApiResponse updateById(@RequestBody Orders orders) { |
| | | // ordersService.updateById(orders); |
| | | // return ApiResponse.success(null); |
| | | // } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | |
| | | <version>0.2.15</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.aliyun</groupId> |
| | | <artifactId>aliyun-java-sdk-core</artifactId> |
| | | <version>3.5.0</version> |
| | | </dependency> |
| | | |
| | | <dependency> |
| | | <groupId>com.aliyun</groupId> |
| | | <artifactId>aliyun-java-sdk-dysmsapi</artifactId> |
| | | <version>1.1.0</version> |
| | | </dependency> |
| | | |
| | | <!-- <dependency> |
| | | <groupId>com.azure.spring</groupId> |
| | |
| | | public void refreshToken(String token,Member member) { |
| | | try { |
| | | if(Objects.nonNull(member)){ |
| | | redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(member),jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| | | redisTemplate.expire(Constants.REDIS_TOKEN_KEY+token,jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| | | // redisTemplate.delete(Constants.REDIS_TOKEN_KEY+token); |
| | | // redisTemplate.opsForValue().set(Constants.REDIS_TOKEN_KEY+token,JSONObject.toJSONString(member),jwtProperties.getExpiration(), TimeUnit.MILLISECONDS); |
| | | } |
| | | } catch (Exception e) { |
| | | |
| | |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.model.IdentityInfo; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.dao.business.model.WithdrawalOrders; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import me.chanjar.weixin.common.error.WxErrorException; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | |
| | | private static String goodsOrderUrl = "pages/settlementDetails/settlementDetails?goodsOrderId="; |
| | | |
| | | private static String identityInfoUrl = "pages/mine/mine"; |
| | | |
| | | @Autowired |
| | | private SystemDictDataBiz systemDictDataBiz; |
| | | |
| | | /** |
| | | * ä¿¡æ¯è®¤è¯ |
| | | * @param openid |
| | | * @param identityInfo |
| | | * @throws WxErrorException |
| | | */ |
| | | public void identityInfoMessage(String openid, IdentityInfo identityInfo) throws WxErrorException { |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String accessToken = WxMiniConfig.wxMaService.getAccessToken(); |
| | |
| | | //ç¨æ·çopenidï¼è¦åéç»é£ä¸ªç¨æ·ï¼ |
| | | wxMsgVO.setTouser(openid); |
| | | //订é
æ¶æ¯æ¨¡æ¿id |
| | | wxMsgVO.setTemplate_id("4H9ztG4E9BxJLwMuYSZ6oiM7yb4KX7u7bYhkhYJP0-Y"); |
| | | wxMsgVO.setTemplate_id("VJho7-lf-4_WZFfOzenDndgwNDIA0EvCiE6vqBnExpQ"); |
| | | Map<String, TemplateData> m = new HashMap<>(4); |
| | | m.put("thing11", new TemplateData(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO)?"ç¨å·¥è®¤è¯":Constants.equalsInteger(identityInfo.getType(),Constants.ONE)?"è¿è´§è®¤è¯":"ä¾é¤è®¤è¯")); |
| | | m.put("phrase4", new TemplateData(Constants.equalsInteger(identityInfo.getAuditStatus(),Constants.TWO)?"认è¯éè¿":"è®¤è¯æªéè¿")); |
| | | m.put("date3", new TemplateData(DateUtil.getFomartDate(identityInfo.getAuditTime(),"yyyy-MM-dd HH:mm:ss"))); |
| | | m.put("thing5", new TemplateData(identityInfo.getAuditRemark())); |
| | | m.put("thing2", new TemplateData(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO)?"ç¨å·¥è®¤è¯":Constants.equalsInteger(identityInfo.getType(),Constants.ONE)?"è¿è´§è®¤è¯":"ä¾é¤è®¤è¯")); |
| | | m.put("phrase6", new TemplateData(Constants.equalsInteger(identityInfo.getAuditStatus(),Constants.TWO)?"认è¯éè¿":"è®¤è¯æªéè¿")); |
| | | m.put("time12", new TemplateData(DateUtil.getFomartDate(identityInfo.getAuditTime(),"yyyy-MM-dd HH:mm"))); |
| | | m.put("thing14", new TemplateData(identityInfo.getAuditRemark())); |
| | | wxMsgVO.setPage(identityInfoUrl); |
| | | wxMsgVO.setData(m); |
| | | ResponseEntity<String> responseEntity = |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * |
| | | * @param openidList |
| | | * @param orders |
| | | * @param cancelType åæ¶ç±»åï¼0=å¹³å°åæ¶ï¼1=å忹忶ï¼1=æ¥åæ¹åæ¶ |
| | | * @throws WxErrorException |
| | | */ |
| | | public void cancelMessage(List<String> openidList, Orders orders,Integer cancelType ) throws WxErrorException { |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String accessToken = WxMiniConfig.wxMaService.getAccessToken(); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ - 订ååæ¶ä¸å¡ -> accessTokenï¼{}",accessToken); |
| | | //è¿éç®åèµ·è§æä»¬æ¯æ¬¡é½è·åææ°çaccess_tokenï¼æ¶é´å¼åä¸ï¼åºè¯¥å¨access_tokenå¿«è¿ææ¶åéæ°è·åï¼ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+accessToken; |
| | | //æ¼æ¥æ¨éçæ¨¡ç |
| | | WxMsgVO wxMsgVO = new WxMsgVO(); |
| | | //订é
æ¶æ¯æ¨¡æ¿id |
| | | wxMsgVO.setTemplate_id("AA97cHjvlPiNO4viMkVe4JifCf9TD5b5Eb7s6El3VS8"); |
| | | Map<String, TemplateData> m = new HashMap<>(5); |
| | | m.put("character_string3", new TemplateData(orders.getCode())); |
| | | m.put("thing2", new TemplateData(Constants.orderType.getName(orders.getType()))); |
| | | m.put("thing1", new TemplateData(orders.getLocation() + (StringUtils.isNotBlank(orders.getLocationRemark())?orders.getLocationRemark():""))); |
| | | m.put("date8", new TemplateData(DateUtil.getFomartDate(orders.getCancelTime(),"yyyy-MM-dd HH:mm:ss"))); |
| | | m.put("thing6", new TemplateData(Constants.equalsInteger(cancelType,Constants.ZERO)?"å¹³å°åæ¶":Constants.equalsInteger(cancelType,Constants.ONE)?"å忹忶":"æ¥åæ¹åæ¶")); |
| | | //TODO 跳转å°å |
| | | wxMsgVO.setPage(""); |
| | | wxMsgVO.setData(m); |
| | | if(CollectionUtils.isNotEmpty(openidList)){ |
| | | for (String openid:openidList) { |
| | | //ç¨æ·çopenidï¼è¦åéç»é£ä¸ªç¨æ·ï¼ |
| | | wxMsgVO.setTouser(openid); |
| | | ResponseEntity<String> responseEntity = |
| | | restTemplate.postForEntity(url, wxMsgVO, String.class); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ è®¢ååæ¶ä¸å¡ï¼{}", JSONObject.toJSONString(responseEntity)); |
| | | } |
| | | }else{ |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ è®¢ååæ¶ä¸å¡ï¼{}", "æ 人åä¿¡æ¯"); |
| | | } |
| | | } |
| | | |
| | | |
| | | public void acceptMessage(String openid, Orders orders,String memberName,String memberPhone) throws WxErrorException { |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String accessToken = WxMiniConfig.wxMaService.getAccessToken(); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ - æ¥åä¸å¡ -> accessTokenï¼{}",accessToken); |
| | | //è¿éç®åèµ·è§æä»¬æ¯æ¬¡é½è·åææ°çaccess_tokenï¼æ¶é´å¼åä¸ï¼åºè¯¥å¨access_tokenå¿«è¿ææ¶åéæ°è·åï¼ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+accessToken; |
| | | //æ¼æ¥æ¨éçæ¨¡ç |
| | | WxMsgVO wxMsgVO = new WxMsgVO(); |
| | | wxMsgVO.setTouser(openid); |
| | | //订é
æ¶æ¯æ¨¡æ¿id |
| | | wxMsgVO.setTemplate_id("oVjOBLcHxIlGzOMJsdInmgI5CHGXh-UTvMzQqfFOnIg"); |
| | | Map<String, TemplateData> m = new HashMap<>(4); |
| | | m.put("character_string3", new TemplateData(orders.getCode())); |
| | | m.put("thing1", new TemplateData(Constants.orderType.getName(orders.getType()))); |
| | | m.put("thing15", new TemplateData(memberName)); |
| | | m.put("phone_number8", new TemplateData(memberPhone)); |
| | | //TODO 跳转å°å |
| | | wxMsgVO.setPage(""); |
| | | wxMsgVO.setData(m); |
| | | //ç¨æ·çopenidï¼è¦åéç»é£ä¸ªç¨æ·ï¼ |
| | | ResponseEntity<String> responseEntity = |
| | | restTemplate.postForEntity(url, wxMsgVO, String.class); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ è®¢ååæ¶ä¸å¡ï¼{}", JSONObject.toJSONString(responseEntity)); |
| | | } |
| | | |
| | | |
| | | public void orderUpdMessage(String openid, Orders orders) throws WxErrorException { |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String accessToken = WxMiniConfig.wxMaService.getAccessToken(); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ - 订ååæ´éç¥ -> accessTokenï¼{}",accessToken); |
| | | //è¿éç®åèµ·è§æä»¬æ¯æ¬¡é½è·åææ°çaccess_tokenï¼æ¶é´å¼åä¸ï¼åºè¯¥å¨access_tokenå¿«è¿ææ¶åéæ°è·åï¼ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+accessToken; |
| | | //æ¼æ¥æ¨éçæ¨¡ç |
| | | WxMsgVO wxMsgVO = new WxMsgVO(); |
| | | wxMsgVO.setTouser(openid); |
| | | //订é
æ¶æ¯æ¨¡æ¿id |
| | | wxMsgVO.setTemplate_id("3YSC7gouRlSjHXz4CrWOGFzPmGwEBtFj4snwdfMvKHk"); |
| | | Map<String, TemplateData> m = new HashMap<>(3); |
| | | m.put("character_string1", new TemplateData(orders.getCode())); |
| | | m.put("thing3", new TemplateData("åæ´è®¢åæ¥æ")); |
| | | //忴忥æï¼07-23è³07-25 |
| | | m.put("thing5", new TemplateData("忴忥æ:" +DateUtil.getFomartDate(orders.getStartDate(),"MM-dd") + "è³" +DateUtil.getFomartDate(orders.getEndDate(),"MM-dd"))); |
| | | //TODO 跳转å°å |
| | | wxMsgVO.setPage(""); |
| | | wxMsgVO.setData(m); |
| | | //ç¨æ·çopenidï¼è¦åéç»é£ä¸ªç¨æ·ï¼ |
| | | ResponseEntity<String> responseEntity = |
| | | restTemplate.postForEntity(url, wxMsgVO, String.class); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ è®¢ååæ´éç¥ï¼{}", JSONObject.toJSONString(responseEntity)); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public void withdrawalMessage(String openid, WithdrawalOrders withdrawalOrders) throws WxErrorException { |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String accessToken = WxMiniConfig.wxMaService.getAccessToken(); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ - æç°æåéç¥ -> accessTokenï¼{}",accessToken); |
| | | //è¿éç®åèµ·è§æä»¬æ¯æ¬¡é½è·åææ°çaccess_tokenï¼æ¶é´å¼åä¸ï¼åºè¯¥å¨access_tokenå¿«è¿ææ¶åéæ°è·åï¼ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+accessToken; |
| | | //æ¼æ¥æ¨éçæ¨¡ç |
| | | WxMsgVO wxMsgVO = new WxMsgVO(); |
| | | wxMsgVO.setTouser(openid); |
| | | //订é
æ¶æ¯æ¨¡æ¿id |
| | | wxMsgVO.setTemplate_id("fNJy4545hcrH83bP3a1vszs7XEKWjXMsrfr2XCNsql0"); |
| | | Map<String, TemplateData> m = new HashMap<>(4); |
| | | m.put("phrase2", new TemplateData("å·²ææ¬¾")); |
| | | m.put("amount1", new TemplateData((new BigDecimal(withdrawalOrders.getAmount().toString()).divide(new BigDecimal("100"))).toString())); |
| | | m.put("time3", new TemplateData(DateUtil.getFomartDate(withdrawalOrders.getUpdateTime(),"yyyy.MM.dd HH.mm.ss"))); |
| | | m.put("thing4", new TemplateData("ææ¬¾æåï¼è¯·æ³¨ææ¥æ¶")); |
| | | //TODO 跳转å°å |
| | | wxMsgVO.setPage(""); |
| | | wxMsgVO.setData(m); |
| | | //ç¨æ·çopenidï¼è¦åéç»é£ä¸ªç¨æ·ï¼ |
| | | ResponseEntity<String> responseEntity = |
| | | restTemplate.postForEntity(url, wxMsgVO, String.class); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ æç°æåéç¥ï¼{}", JSONObject.toJSONString(responseEntity)); |
| | | } |
| | | |
| | | |
| | | public void revenueMessage(String openid, Orders orders) throws WxErrorException { |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String accessToken = WxMiniConfig.wxMaService.getAccessToken(); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ - è®¢åæ¶çéç¥ -> accessTokenï¼{}",accessToken); |
| | | //è¿éç®åèµ·è§æä»¬æ¯æ¬¡é½è·åææ°çaccess_tokenï¼æ¶é´å¼åä¸ï¼åºè¯¥å¨access_tokenå¿«è¿ææ¶åéæ°è·åï¼ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+accessToken; |
| | | //æ¼æ¥æ¨éçæ¨¡ç |
| | | WxMsgVO wxMsgVO = new WxMsgVO(); |
| | | wxMsgVO.setTouser(openid); |
| | | //订é
æ¶æ¯æ¨¡æ¿id |
| | | wxMsgVO.setTemplate_id("tDpYImlrdv-0d3euTrHbYZ1cEZvjVHTNlqHvV0tpLHg"); |
| | | Map<String, TemplateData> m = new HashMap<>(5); |
| | | m.put("character_string8", new TemplateData(orders.getCode())); |
| | | m.put("phrase3", new TemplateData("å·²æ¯ä»")); |
| | | m.put("phrase4", new TemplateData("微信æ¯ä»")); |
| | | m.put("amount6", new TemplateData((new BigDecimal(orders.getReceiveAccount().toString()).divide(new BigDecimal("100")))+"å
")); |
| | | m.put("date7", new TemplateData(DateUtil.getFomartDate(new Date(),"yyyy-MM-dd HH:mm:ss"))); |
| | | //TODO 跳转å°å |
| | | wxMsgVO.setPage(""); |
| | | wxMsgVO.setData(m); |
| | | //ç¨æ·çopenidï¼è¦åéç»é£ä¸ªç¨æ·ï¼ |
| | | ResponseEntity<String> responseEntity = |
| | | restTemplate.postForEntity(url, wxMsgVO, String.class); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ è®¢åæ¶çéç¥ï¼{}", JSONObject.toJSONString(responseEntity)); |
| | | } |
| | | |
| | | |
| | | public void autoDispatchMessage(String openid, Orders orders,BigDecimal distance) throws WxErrorException { |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | String accessToken = WxMiniConfig.wxMaService.getAccessToken(); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ - æå¡æ´¾å -> accessTokenï¼{}",accessToken); |
| | | //è¿éç®åèµ·è§æä»¬æ¯æ¬¡é½è·åææ°çaccess_tokenï¼æ¶é´å¼åä¸ï¼åºè¯¥å¨access_tokenå¿«è¿ææ¶åéæ°è·åï¼ |
| | | String url = "https://api.weixin.qq.com/cgi-bin/message/subscribe/send?access_token="+accessToken; |
| | | //æ¼æ¥æ¨éçæ¨¡ç |
| | | WxMsgVO wxMsgVO = new WxMsgVO(); |
| | | wxMsgVO.setTouser(openid); |
| | | //订é
æ¶æ¯æ¨¡æ¿id |
| | | wxMsgVO.setTemplate_id("1h6JYpQf-mDKV4tYQ6gGDONfx1awqtm3-y9W8vUraT4"); |
| | | Map<String, TemplateData> m = new HashMap<>(5); |
| | | m.put("thing2", new TemplateData(Constants.orderType.getName(orders.getType()))); |
| | | m.put("thing3", new TemplateData(orders.getOrderContent())); |
| | | m.put("phrase4", new TemplateData("æ¤å°è·ç¦»æ¨"+distance+"å
Ž")); |
| | | m.put("amount28", new TemplateData(orders.getEstimatedAccount().toString())); |
| | | m.put("thing12", new TemplateData("å·¥åå°äº"+DateUtil.getFomartDate(orders.getStartDate(),"MM-dd")+"å¼å§")); |
| | | //TODO 跳转å°å |
| | | wxMsgVO.setPage(""); |
| | | wxMsgVO.setData(m); |
| | | //ç¨æ·çopenidï¼è¦åéç»é£ä¸ªç¨æ·ï¼ |
| | | ResponseEntity<String> responseEntity = |
| | | restTemplate.postForEntity(url, wxMsgVO, String.class); |
| | | log.info("微信å°ç¨åº->å¾®ä¿¡æ¶æ¯éç¥ æå¡æ´¾åï¼{}", JSONObject.toJSONString(responseEntity)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | public static WxMaService wxMaService; |
| | | /********微信å°ç¨åºæ¯ä»**********/ |
| | | public static JsapiService wxPayService; |
| | | public static WxPayService wxPayV2Service; |
| | | // public static WxPayService wxPayV2Service; |
| | | public static RefundService refundService; |
| | | public static JsapiServiceExtension jsapiExtService; |
| | | public static BillDownloadService billDownloadService; |
| | |
| | | void init() { |
| | | this.load_WxMaService(); |
| | | this.load_wxPayService(); |
| | | this.load_wxPayV2Service(); |
| | | this.load_transferToUser(); |
| | | // this.load_wxPayV2Service(); |
| | | this.load_transferToUser(); |
| | | this.wxProperties = wxPayProperties; |
| | | } |
| | |
| | | config.setAppid(StringUtils.trimToNull(wxPayProperties.getSubAppId())); |
| | | config.setSecret(StringUtils.trimToNull(wxPayProperties.getSubAppSecret())); |
| | | }else { |
| | | config.setAppid(StringUtils.trimToNull(wxPayProperties.getAppId())); |
| | | config.setSecret(StringUtils.trimToNull(wxPayProperties.getAppSecret())); |
| | | // config.setAppid(StringUtils.trimToNull(wxPayProperties.getAppId())); |
| | | // config.setSecret(StringUtils.trimToNull(wxPayProperties.getAppSecret())); |
| | | } |
| | | config.setMsgDataFormat("JSON"); |
| | | //config.setToken(""); |
| | |
| | | /** |
| | | * åå§å微信å°ç¨åºæ¯ä» |
| | | */ |
| | | public void load_wxPayV2Service() |
| | | { |
| | | WxPayConfig payConfig = new WxPayConfig(); |
| | | payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); |
| | | payConfig.setSignType(WxPayConstants.SignType.MD5); |
| | | payConfig.setAppId(StringUtils.trimToNull(wxPayProperties.getAppId())); |
| | | payConfig.setSubAppId(StringUtils.trimToNull(wxPayProperties.getSubAppId())); |
| | | payConfig.setMchId(StringUtils.trimToNull(wxPayProperties.getMchId())); |
| | | payConfig.setSubMchId(StringUtils.trimToNull(wxPayProperties.getSubMchId())); |
| | | payConfig.setMchKey(StringUtils.trimToNull(wxPayProperties.getMchKey())); |
| | | // payConfig.setKeyPath(StringUtils.trimToNull(wxPayProperties.getKeyPath())); |
| | | payConfig.setNotifyUrl(StringUtils.trimToNull(wxPayProperties.getNotifyUrl())); |
| | | WxPayService wxPayService = new WxPayServiceImpl(); |
| | | wxPayService.setConfig(payConfig); |
| | | this.wxPayV2Service = wxPayService; |
| | | } |
| | | // public void load_wxPayV2Service() |
| | | // { |
| | | // WxPayConfig payConfig = new WxPayConfig(); |
| | | // payConfig.setTradeType(WxPayConstants.TradeType.JSAPI); |
| | | // payConfig.setSignType(WxPayConstants.SignType.MD5); |
| | | // payConfig.setAppId(StringUtils.trimToNull(wxPayProperties.getAppId())); |
| | | // payConfig.setSubAppId(StringUtils.trimToNull(wxPayProperties.getSubAppId())); |
| | | // payConfig.setMchId(StringUtils.trimToNull(wxPayProperties.getMchId())); |
| | | // payConfig.setSubMchId(StringUtils.trimToNull(wxPayProperties.getSubMchId())); |
| | | // payConfig.setMchKey(StringUtils.trimToNull(wxPayProperties.getMchKey())); |
| | | //// payConfig.setKeyPath(StringUtils.trimToNull(wxPayProperties.getKeyPath())); |
| | | // payConfig.setNotifyUrl(StringUtils.trimToNull(wxPayProperties.getNotifyUrl())); |
| | | // WxPayService wxPayService = new WxPayServiceImpl(); |
| | | // wxPayService.setConfig(payConfig); |
| | | // this.wxPayV2Service = wxPayService; |
| | | // } |
| | | |
| | | |
| | | /** |
| | |
| | | // } |
| | | |
| | | |
| | | //转账ä¸å¡ |
| | | public void load_transferToUser() |
| | | { |
| | | TransferToUser transferToUser = new TransferToUser( |
| | |
| | | /** |
| | | * æ¯ä»APIå¯é¥ |
| | | */ |
| | | private String subMchKey; |
| | | // private String subMchKey; |
| | | |
| | | /** |
| | | * æ¯ä»åè°å°å |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public enum orderType { |
| | | ygd(0, "ç¨å·¥å"), |
| | | hyd(1, "è´§è¿å"), |
| | | scd(2, "éé¤å"), |
| | | |
| | | ; |
| | | // æååé |
| | | private int key; |
| | | private String name; |
| | | |
| | | // æé æ¹æ³ |
| | | orderType(int key, String name) { |
| | | this.name = name; |
| | | this.key = key; |
| | | } |
| | | |
| | | // æ®éæ¹æ³ |
| | | public static String getName(int index) { |
| | | for (orderType c : orderType.values()) { |
| | | if (c.getKey() == index) { |
| | | return c.name; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | // get set æ¹æ³ |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | public enum smsContent { |
| | | accept(0, "SMS_491325122","æ¨ç{order}订å已被æ¥åï¼æ¶é´ï¼{time1}-{time2}ï¼æ¥åæ¹ï¼{name}ã"), |
| | | receiveCancel(1, "SMS_491055243","æ¨ç{order}订åï¼æ¶é´ï¼{time1}-{time2}ï¼å·²è¢«æ¥åæ¹åæ¶ï¼è®¢å已鿰è¿å
¥æ¥å大å
ã"), |
| | | platformCancel(2, "SMS_491375152","æ¨ç{order}订åï¼æ¶é´ï¼{time1}-{time2},å·²ç±å¹³å°åæ¶ã妿çé®è¯·è系客æã"), |
| | | agreeUpd(3, "SMS_491190259","æ¥åæ¹å·²åææ¨å°{order}çè®¢åæ¶é´ä¿®æ¹ä¸º{time1}è³{time2}ã"), |
| | | disAgreeUpd(4, "SMS_491085252","æ¥åæ¹å·²æç»æ¨å°{order}çè®¢åæ¶é´ä¿®æ¹ä¸º{time1}-{time2}ãç³»ç»å·²éæ°å°è®¢åæ¾å
¥æ¥å大å
ã"), |
| | | orderUpd(5, "SMS_491010267","请注æï¼æ¨æ¿æ¥ç{order}订åï¼å®¢æ·å°è®¢åæ¶é´ä¿®æ¹ä¸º{time1}-{time2}ã请åå¾ç¡®è®¤æ¯å¦æ¥åï¼è¶
æ¶ä¸å¤çå°è§ä¸ºåæã"), |
| | | releaseCancel(6, "SMS_491150253","æ¨æ¿æ¥ç{order}订åï¼æ¶é´ï¼{time1}-{time2}ï¼å·²è¢«ååæ¹åæ¶ãæ¨å¯å徿¥å大å
éæ°æ¥åã"), |
| | | platformCancel2(7, "SMS_491420143","æ¨æ¿æ¥ç{order}订åï¼æ¶é´ï¼{time1}-{time2}ï¼å·²ç±å¹³å°åæ¶ã妿çé®è¯·è系客æã"), |
| | | dispatch(8, "SMS_491180276","å·²ä¸ºæ¨æºè½å¹é
订åã订åç±»åï¼{order}ï¼æ¶é´ï¼{time1}-{time2}ï¼è·ç¦»ï¼{distance}ï¼é¢è®¡è´¹ç¨{money}ã请åå¾ç¡®è®¤ã"), |
| | | pay(9, "SMS_491180278","æ¨æ¿æ¥ç{order}è®¢åæ¬¾é¡¹å·²å°è´¦ï¼å°è´¦éé¢ï¼{money}ãå¯å¨å°ç¨åºè´¦æ·ä½é¢è¿è¡æ¥çã"), |
| | | authentication(10, "SMS_491055290","æ¨ç³è¯·ç{authentication}ç{order}认è¯{status}ã请å¨å°ç¨åºæ¥ç详æ
ã"), |
| | | ; |
| | | // æååé |
| | | private int key; |
| | | private String code; |
| | | private String name; |
| | | |
| | | // æé æ¹æ³ |
| | | smsContent(int key,String code, String name) { |
| | | this.name = name; |
| | | this.code = code; |
| | | this.key = key; |
| | | } |
| | | |
| | | // æ®éæ¹æ³ |
| | | public static Constants.smsContent getSmsContent(int index) { |
| | | for (smsContent c : smsContent.values()) { |
| | | if (c.getKey() == index) { |
| | | return c; |
| | | } |
| | | } |
| | | return null; |
| | | } |
| | | // get set æ¹æ³ |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | |
| | | public String getCode() { |
| | | return code; |
| | | } |
| | | |
| | | public void setCode(String code) { |
| | | this.code = code; |
| | | } |
| | | |
| | | public int getKey() { |
| | | return key; |
| | | } |
| | | |
| | | public void setKey(int key) { |
| | | this.key = key; |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | } |
| | |
| | | private Integer isUpdate; |
| | | |
| | | @ApiModelProperty(value = "ä¿®æ¹æ¶é´", example = "1") |
| | | private Integer isUpdateTime; |
| | | private Date isUpdateTime; |
| | | |
| | | @ApiModelProperty(value = "æ¥åæ¹é»ååmember:id å¤ä¸ªä»¥,åå²") |
| | | private String blackReceive; |
| | |
| | | @TableField(exist = false) |
| | | private BigDecimal queryLgt; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å¯åæ¶ï¼0=å¯ä»¥ï¼1=ä¸å¯ä»¥", example = "1") |
| | | @TableField(exist = false) |
| | | private Integer cancelStatus; |
| | | |
| | | } |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.aliyuncs.DefaultAcsClient; |
| | | import com.aliyuncs.IAcsClient; |
| | | import com.aliyuncs.dysmsapi.model.v20170525.SendSmsRequest; |
| | | import com.aliyuncs.dysmsapi.model.v20170525.SendSmsResponse; |
| | | import com.aliyuncs.http.MethodType; |
| | | import com.aliyuncs.profile.DefaultProfile; |
| | | import com.aliyuncs.profile.IClientProfile; |
| | | import com.doumee.core.constants.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.dao.business.CategoryMapper; |
| | | import com.doumee.dao.business.model.Category; |
| | | import com.doumee.dao.business.model.IdentityInfo; |
| | | import com.doumee.dao.business.model.Orders; |
| | | import com.doumee.dao.dto.CateringDTO; |
| | | import com.github.pagehelper.Constant; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.logging.log4j.LogManager; |
| | | import org.apache.logging.log4j.Logger; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2025/7/23 11:37 |
| | | */ |
| | | @Service |
| | | @Slf4j |
| | | public class AliSmsService { |
| | | |
| | | protected Logger logger = LogManager.getLogger("sms"); |
| | | |
| | | private final static String ACCESS_KEY_ID = "LTAI5tMkg7wwV74a8H6Bm3Ej"; |
| | | private final static String ACCESS_KEY_SECRET = "FcHKST36sfwfo706L6bvrweGFIbp3n"; |
| | | private final static String SING_NAME = "æ©æ¡å¤©ä¸ç§æ"; |
| | | |
| | | |
| | | public void sendSms(int type, String phone, Orders orders, String receiveName, String businessPhone, BigDecimal distance, IdentityInfo identityInfo,CategoryMapper categoryMapper){ |
| | | Constants.smsContent smsContent = Constants.smsContent.getSmsContent(type); |
| | | Map<String,Object> tempParam = new HashMap<>(); |
| | | if(smsContent.getName().indexOf("time1")>=Constants.ZERO){ |
| | | tempParam.put("time1", DateUtil.formatDate(orders.getStartDate(),"MM-dd")); |
| | | } |
| | | if(smsContent.getName().indexOf("time2")>=Constants.ZERO){ |
| | | tempParam.put("time2", DateUtil.formatDate(orders.getEndDate(),"MM-dd")); |
| | | } |
| | | if(smsContent.getName().indexOf("name")>=Constants.ZERO){ |
| | | tempParam.put("name", receiveName); |
| | | } |
| | | if(smsContent.getName().indexOf("money")>=Constants.ZERO){ |
| | | tempParam.put("money", new BigDecimal(orders.getReceiveAccount().toString()).divide(new BigDecimal("100"),2,BigDecimal.ROUND_HALF_UP)+"å
"); |
| | | } |
| | | if(smsContent.getName().indexOf("distance")>=Constants.ZERO){ |
| | | tempParam.put("distance", distance +"km"); |
| | | } |
| | | //认è¯çä¿¡ ç¹æ®å¤ç |
| | | if(Constants.equalsInteger(smsContent.getKey(),Constants.smsContent.authentication.getKey())){ |
| | | //认è¯ç±»å |
| | | if(smsContent.getName().indexOf("authentication")>=Constants.ZERO){ |
| | | tempParam.put("authentication", Constants.equalsInteger(identityInfo.getAuthType(),Constants.ZERO)?"个人":identityInfo.getCompanyName()); |
| | | } |
| | | if(smsContent.getName().indexOf("order")>=Constants.ZERO){ |
| | | tempParam.put("order", Constants.orderType.getName(identityInfo.getType()).replace("å","")); |
| | | } |
| | | if(smsContent.getName().indexOf("status")>=Constants.ZERO){ |
| | | tempParam.put("status", Constants.equalsInteger(identityInfo.getAuditStatus(),Constants.TWO)?"å·²éè¿":"æªéè¿"); |
| | | } |
| | | }else{ |
| | | if(smsContent.getName().indexOf("order")>=Constants.ZERO){ |
| | | String order = ""; |
| | | //æ¥è¯¢è®¢åçç±»åä¿¡æ¯ |
| | | if(Constants.equalsInteger(orders.getType(),Constants.ZERO)){ |
| | | order = Constants.workType.getName(orders.getWorkType()); |
| | | Category category = categoryMapper.selectById(orders.getCategoryId()); |
| | | if(Objects.nonNull(category)){ |
| | | order = category.getName() + order; |
| | | } |
| | | }else if(Constants.equalsInteger(orders.getType(),Constants.ZERO)){ |
| | | order = "è¿è¾"; |
| | | Category category = categoryMapper.selectById(orders.getTransportTypeId()); |
| | | if(Objects.nonNull(category)){ |
| | | order = category.getName() + order; |
| | | } |
| | | }else{ |
| | | List<CateringDTO> cateringDTOList = JSONArray.parseArray(orders.getWayInfo(),CateringDTO.class); |
| | | if(CollectionUtils.isNotEmpty(cateringDTOList)){ |
| | | for (CateringDTO cateringDTO:cateringDTOList) { |
| | | if(StringUtils.isBlank(order)){ |
| | | order = cateringDTO.getName(); |
| | | }else{ |
| | | order = order + "/" +cateringDTO.getName(); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | tempParam.put("order",order); |
| | | } |
| | | } |
| | | |
| | | if(smsContent.getName().indexOf("authentication")>=Constants.ZERO){ |
| | | tempParam.put("distance", distance +"km"); |
| | | } |
| | | AliSmsService.sendSms(phone,smsContent.getCode(), JSONObject.toJSONString(tempParam)); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | Map<String,Object> tempParam = new HashMap<>(); |
| | | tempParam.put("order","è¡èéæå·¥"); |
| | | tempParam.put("time1","07-23"); |
| | | tempParam.put("time2","07-24"); |
| | | AliSmsService.sendSms("18055151023","SMS_491055243", JSONObject.toJSONString(tempParam)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * åç信模æ¿(å¯ç¾¤å) |
| | | * |
| | | * @param phone 订å详æ
|
| | | * @param templateCode 模æ¿code |
| | | * @param templateParam 模æ¿åéjsonå符串 |
| | | * @return å¤çç»æ |
| | | */ |
| | | public static Boolean sendSms(String phone, String templateCode, String templateParam) { |
| | | try { |
| | | //设置è¶
æ¶æ¶é´-å¯èªè¡è°æ´ |
| | | System.setProperty("sun.net.client.defaultConnectTimeout", "10000"); |
| | | System.setProperty("sun.net.client.defaultReadTimeout", "10000"); |
| | | //åå§åascClientéè¦çå ä¸ªåæ° |
| | | //çä¿¡API产ååç§°ï¼ç信产åååºå®ï¼æ éä¿®æ¹ï¼ |
| | | final String product = "Dysmsapi"; |
| | | //çä¿¡API产åååï¼æ¥å£å°ååºå®ï¼æ éä¿®æ¹ï¼ |
| | | final String domain = "dysmsapi.aliyuncs.com"; |
| | | //åå§åascClient,ææ¶ä¸æ¯æå¤regionï¼è¯·å¿ä¿®æ¹ï¼ |
| | | IClientProfile profile = DefaultProfile.getProfile("cn-hangzhou", ACCESS_KEY_ID, ACCESS_KEY_SECRET); |
| | | DefaultProfile.addEndpoint("cn-hangzhou", "cn-hangzhou", product, domain); |
| | | IAcsClient acsClient = new DefaultAcsClient(profile); |
| | | //ç»è£
请æ±å¯¹è±¡ |
| | | SendSmsRequest request = new SendSmsRequest(); |
| | | //使ç¨postæäº¤ |
| | | request.setMethod(MethodType.POST); |
| | | //å¿
å¡«:å¾
åéææºå·ãæ¯æä»¥éå·åéçå½¢å¼è¿è¡æ¹éè°ç¨ï¼æ¹éä¸é为1000ä¸ªææºå·ç ,æ¹éè°ç¨ç¸å¯¹äºåæ¡è°ç¨åæ¶æ§ç¨æå»¶è¿,éªè¯ç ç±»åççä¿¡æ¨è使ç¨åæ¡è°ç¨çæ¹å¼ |
| | | request.setPhoneNumbers(phone); |
| | | //å¿
å¡«:çä¿¡ç¾å-å¯å¨çä¿¡æ§å¶å°ä¸æ¾å° |
| | | request.setSignName(SING_NAME); |
| | | //å¿
å¡«:ç信模æ¿-å¯å¨çä¿¡æ§å¶å°ä¸æ¾å° |
| | | request.setTemplateCode(templateCode); |
| | | //å¯é:模æ¿ä¸çåéæ¿æ¢JSON串,妿¨¡æ¿å
容为"亲ç±ç${name},æ¨çéªè¯ç 为${code}"æ¶,æ¤å¤çå¼ä¸º |
| | | //åæ
æç¤º:妿JSONä¸éè¦å¸¦æ¢è¡ç¬¦,请åç
§æ åçJSONå议对æ¢è¡ç¬¦çè¦æ±,æ¯å¦çä¿¡å
容ä¸å
å«\r\nçæ
åµå¨JSONä¸éè¦è¡¨ç¤ºæ\\r\\n,å¦åä¼å¯¼è´JSON卿å¡ç«¯è§£æå¤±è´¥ |
| | | request.setTemplateParam(templateParam); |
| | | //å¯é-ä¸è¡çä¿¡æ©å±ç (æ©å±ç åæ®µæ§å¶å¨7使以ä¸ï¼æ ç¹æ®éæ±ç¨æ·è¯·å¿½ç¥æ¤å段) |
| | | //dto.setSmsUpExtendCode("90997"); |
| | | //å¯é:outId为æä¾ç»ä¸å¡æ¹æ©å±å段,æç»å¨çä¿¡åæ§æ¶æ¯ä¸å°æ¤å¼å¸¦åç»è°ç¨è
|
| | | //dto.setOutId("yourOutId"); |
| | | //请æ±å¤±è´¥è¿é伿ClientExceptionå¼å¸¸ |
| | | SendSmsResponse sendSmsResponse = acsClient.getAcsResponse(request); |
| | | if (sendSmsResponse.getCode() != null && sendSmsResponse.getCode().equals("OK")) { |
| | | // logger.info(phone + "-" + templateCode + "-" + templateParam + " >>> " + JSON.toJSONString(sendSmsResponse)); |
| | | return true; |
| | | } else { |
| | | // logger.error(phone + "-" + templateCode + "-" + templateParam + " >>> " + JSON.toJSONString(sendSmsResponse)); |
| | | } |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | // logger.error(e); |
| | | } |
| | | return false; |
| | | } |
| | | } |
| | |
| | | * |
| | | * @param orders å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(Orders orders); |
| | | // void updateById(Orders orders); |
| | | |
| | | void update(Orders orders); |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | |
| | | |
| | | void begin(Integer orderId,Member member); |
| | | |
| | | void updOrderData(UpdOrderDataDTO updOrderDataDTO); |
| | | |
| | | // void updOrderData(UpdOrderDataDTO updOrderDataDTO); |
| | | // |
| | | void confirmUpd(ConfirmUpdOrderDTO confirmUpdOrderDTO); |
| | | |
| | | void releaseCancelOrder(Integer orderId,Member member); |
| | | /** |
| | | * 订ååæ¶åç½®æç¤º |
| | | * @param orderId |
| | | * @param member |
| | | * @return |
| | | */ |
| | | String cancelTips(Integer orderId,Member member); |
| | | |
| | | void receiveCancelOrder(Integer orderId,Member member); |
| | | void cancelOrder(Integer orderId,Member member); |
| | | |
| | | OrderReleaseVO doneOrder(DoneOrderDTO doneOrderDTO); |
| | | |
| | |
| | | |
| | | PageData<Orders> findPageForMini(PageWrap<Orders> pageWrap); |
| | | |
| | | Orders getDetail(Integer id,Integer userType); |
| | | Orders getDetail(Integer id,Member member); |
| | | |
| | | void refundCallback(RefundNotification refundNotification); |
| | | |
| | |
| | | @Override |
| | | public List<Category> getCategoryList(Integer type){ |
| | | List<Category> categoryList = categoryMapper.selectList(new QueryWrapper<Category>().lambda().eq(Category::getDeleted,Constants.ZERO).eq(Category::getStatus,Constants.ZERO) |
| | | .eq(Objects.nonNull(type),Category::getType,type)); |
| | | .eq(Objects.nonNull(type),Category::getType,type) |
| | | .orderByAsc(Category::getSortnum) |
| | | ); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(categoryList)){ |
| | | String path = systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RESOURCE_PATH).getCode() |
| | | +systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.CATEGORY_FILES).getCode(); |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | if(Objects.nonNull(identityInfo.getId())){ |
| | | this.updateById(identityInfo); |
| | | }else{ |
| | | IdentityInfo model = identityInfoMapper.selectOne(new QueryWrapper<IdentityInfo>().lambda() |
| | | .eq(IdentityInfo::getMemberId,identityInfo.getMemberId()) |
| | | .eq(IdentityInfo::getType,identityInfo.getType()) |
| | | .last("limit 1") |
| | | ); |
| | | if(Objects.nonNull(model)){ |
| | | identityInfo.setId(model.getId()); |
| | | this.updateById(identityInfo); |
| | | return identityInfo.getId(); |
| | | } |
| | | |
| | | |
| | | //æ¥è¯¢ç¨æ·æ¯å¦å·²åå¨å½å身份 |
| | | if(identityInfoMapper.selectCount(new QueryWrapper<IdentityInfo>().lambda() |
| | | .eq(IdentityInfo::getDeleted,Constants.ZERO) |
| | |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity,Constants.ONE) |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity,Constants.ONE) |
| | | .eq(Member::getId,identityInfo.getMemberId())); |
| | | } |
| | | return identityInfo.getId(); |
| | | } |
| | | |
| | |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getUpdateUser,user.getId()) |
| | | .set(Member::getUpdateTime,date) |
| | | .set(Constants.equalsInteger(auditDTO.getAuditStatus(),Constants.ZERO),Member::getAutoReceiveStatus,Constants.ONE) |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ZERO),Member::getWorkerIdentity, auditDTO.getAuditStatus() ) |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.ONE),Member::getDriverIdentity , auditDTO.getAuditStatus() ) |
| | | .set(Constants.equalsInteger(identityInfo.getType(),Constants.TWO),Member::getChefIdentity , auditDTO.getAuditStatus() ) |
| | |
| | | .or().eq(Member::getDriverIdentity,Constants.TWO ); |
| | | }); |
| | | queryWrapper.lambda().ge(pageWrap.getModel().getStartTime()!=null, Member::getCreateTime,pageWrap.getModel().getStartTime()); |
| | | queryWrapper.lambda().ne(pageWrap.getModel().getEndTime()!=null,Member::getCreateTime,pageWrap.getModel().getEndTime()); |
| | | queryWrapper.lambda().le(pageWrap.getModel().getEndTime()!=null,Member::getCreateTime,pageWrap.getModel().getEndTime()); |
| | | |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | |
| | | |
| | | |
| | | /***************å°ç¨åºæ¥å£*************/ |
| | | |
| | | |
| | | |
| | | /** |
| | | * 微信å°ç¨åºç»å½ |
| | |
| | | member.setPublishNum(Constants.ZERO.longValue()); |
| | | member.setAutoReceiveStatus(Constants.ONE); |
| | | member.setUseIdentity(Constants.ZERO); |
| | | member.setOpenid(wxPhoneRequest.getOpenid()); |
| | | memberMapper.insert(member); |
| | | } |
| | | AccountResponse accountResponse = new AccountResponse(); |
| | |
| | | orders.setPayStatus(Constants.ZERO); |
| | | orders.setDeleted(Constants.ZERO); |
| | | orders.setReleaseMemberId(orders.getMember().getId()); |
| | | orders.setCommentStatus(Constants.ZERO); |
| | | //æ¥è¯¢æç»è´¹ |
| | | Category platformCategory = categoryMapper.selectOne(new QueryWrapper<Category>().lambda().eq(Category::getType,Constants.THREE).eq(Category::getName,orders.getType()).eq(Category::getDeleted,Constants.ZERO).last("limit 1 ")); |
| | | if(Objects.isNull(platformCategory)){ |
| | |
| | | if(Constants.equalsInteger(orders.getType(),Constants.TWO)){ |
| | | orders.setStatus(Constants.ordersStatus.waitPay.getKey()); |
| | | orders.setOutTradeNo(UUID.randomUUID().toString().replace("-","")); |
| | | orders.setPayAccount(orders.getEstimatedAccount()); |
| | | //å¤èµ·æ¯ä»ä¸å¡ |
| | | objects = this.getWxPayResponse(orders,orders.getMember().getOpenid()); |
| | | orderReleaseVO.setObject(objects); |
| | |
| | | request.setOutTradeNo(orders.getOutTradeNo()); |
| | | request.setNotifyUrl(WxMiniConfig.wxProperties.getNotifyUrl());//è¿ä¸ªåè°urlå¿
é¡»æ¯httpså¼å¤´ç |
| | | Amount amount = new Amount(); |
| | | amount.setTotal(1);//orders.getEstimatedAccount().intValue()); |
| | | amount.setTotal(1);//orders.getPayAccount().intValue()); |
| | | request.setAmount(amount); |
| | | // PrepayResponse res = WxMiniConfig.wxPayService.prepay(request); |
| | | // è·ä¹åä¸å示ä¾ä¸æ ·ï¼å¡«å
é¢ä¸ååæ° |
| | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void updateById(Orders orders) { |
| | | public void update(Orders orders){ |
| | | if(Objects.isNull(orders) |
| | | || Objects.isNull(orders.getId())){ |
| | | || Objects.isNull(orders.getId())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | Orders model = ordersMapper.selectById(orders.getId()); |
| | | if(!Constants.equalsInteger(model.getReleaseMemberId(),orders.getMember().getId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鿍çè®¢åæ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | if(Constants.equalsInteger(model.getIsUpdate(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"订å已修æ¹ï¼å¾
æ¥åæ¹ç¡®è®¤ï¼æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | if(!Constants.equalsInteger(model.getType(),Constants.TWO)){ |
| | | if(Constants.equalsInteger(model.getStatus(),Constants.ZERO)||Constants.equalsInteger(model.getStatus(),Constants.ONE)){ |
| | | this.updateById(orders); |
| | | }else if(Constants.equalsInteger(model.getStatus(),Constants.TWO)){ |
| | | this.updOrderData(orders,model); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | } |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | // @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void updateById(Orders orders) { |
| | | |
| | | Orders model = ordersMapper.selectById(orders.getId()); |
| | | if(Constants.equalsInteger(model.getType(),Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ¤ç±»è®¢åæ æ³è¿è¡ä¿®æ¹"); |
| | |
| | | || StringUtils.isEmpty(multifile.getName())){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(),"éä»¶ä¿¡æ¯é误"); |
| | | } |
| | | multifile.setId(null); |
| | | multifile.setIsdeleted(Constants.ZERO); |
| | | multifile.setCreateDate(new Date()); |
| | | multifile.setObjId(orders.getId()); |
| | |
| | | return; |
| | | } |
| | | for (Orders orders: orderss) { |
| | | this.updateById(orders); |
| | | //this.updateById(orders); |
| | | } |
| | | } |
| | | |
| | |
| | | queryWrapper.like(org.apache.commons.lang3.StringUtils.isNotBlank(model.getCode()),Orders::getCode, model.getCode()); |
| | | queryWrapper.eq(Objects.nonNull(model.getType()),Orders::getType, model.getType()); |
| | | queryWrapper.eq(Objects.nonNull(model.getStatus()),Orders::getStatus, model.getStatus()); |
| | | queryWrapper.eq(Objects.nonNull(model.getCommentStatus()),Orders::getCommentStatus, model.getCommentStatus()); |
| | | queryWrapper.eq(Objects.nonNull(model.getReleaseMemberId()),Orders::getReleaseMemberId, model.getReleaseMemberId()); |
| | | queryWrapper.eq(Objects.nonNull(model.getAcceptMemberId()),Orders::getAcceptMemberId, model.getAcceptMemberId()); |
| | | queryWrapper.eq(Objects.nonNull(model.getAcceptType()),Orders::getAcceptType, model.getAcceptType()); |
| | | queryWrapper.apply(org.apache.commons.lang3.StringUtils.isNotBlank(model.getReleaseName()),"m1.name", model.getReleaseName()); |
| | | queryWrapper.apply(org.apache.commons.lang3.StringUtils.isNotBlank(model.getReleaseName()),"m1.name like '%"+model.getReleaseName()+"%' or m1.TELEPHONE like '%"+model.getReleaseName()+"%' "); |
| | | queryWrapper.apply(org.apache.commons.lang3.StringUtils.isNotBlank(model.getAcceptName()),"( i.LINK_NAME like '%"+model.getAcceptName()+"%' or i.company_name like '%"+model.getAcceptName()+"%' or i.TELEPHONE like '%"+model.getAcceptName()+"%' ) "); |
| | | IPage<Orders> iPage = ordersMapper.selectJoinPage(page,Orders.class,queryWrapper); |
| | | for (Orders orders:iPage.getRecords()) { |
| | |
| | | if(Constants.equalsInteger(orders.getReleaseMemberId(),member.getId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"æ¨èªå·±çè®¢åæ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | member = memberMapper.selectById(member.getId()); |
| | | //æ¥è¯¢ç¨æ·æ¯å¦æå¯¹åºèº«ä»½ |
| | | if(Constants.equalsInteger(orders.getType(),Constants.ZERO)){ |
| | | if(!Constants.equalsInteger(member.getWorkerIdentity(),Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"身份信æ¯å¼å¸¸ï¼è¯·è系管çå"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"身份信æ¯å¼å¸¸ï¼è¯·åå¾ä¸ªäººä¸å¿è¿è¡èº«ä»½è®¤è¯!"); |
| | | } |
| | | }else if(Constants.equalsInteger(orders.getType(),Constants.ONE)){ |
| | | if(!Constants.equalsInteger(member.getDriverIdentity(),Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"身份信æ¯å¼å¸¸ï¼è¯·è系管çå"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"身份信æ¯å¼å¸¸ï¼è¯·åå¾ä¸ªäººä¸å¿è¿è¡èº«ä»½è®¤è¯!"); |
| | | } |
| | | }else{ |
| | | if(!Constants.equalsInteger(member.getChefIdentity(),Constants.TWO)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"身份信æ¯å¼å¸¸ï¼è¯·è系管çå"); |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"身份信æ¯å¼å¸¸ï¼è¯·åå¾ä¸ªäººä¸å¿è¿è¡èº«ä»½è®¤è¯!"); |
| | | } |
| | | } |
| | | |
| | | ordersMapper.update(new UpdateWrapper<Orders>().lambda().eq(Orders::getId,orders.getId()) |
| | | ordersMapper.update(new UpdateWrapper<Orders>().lambda().eq(Orders::getId,orders.getId()) |
| | | .set(Orders::getUpdateTime,new Date()) |
| | | .set(Orders::getAcceptType,Constants.ZERO) |
| | | .set(Orders::getAcceptTime,new Date()) |
| | |
| | | |
| | | /** |
| | | * ååæ¹ä¿®æ¹è®¢å - å·²æ¥åç¶æ |
| | | * @param updOrderDataDTO |
| | | */ |
| | | @Override |
| | | // @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void updOrderData(UpdOrderDataDTO updOrderDataDTO){ |
| | | if(Objects.isNull(updOrderDataDTO) |
| | | || Objects.isNull(updOrderDataDTO.getOrderId()) |
| | | || Objects.isNull(updOrderDataDTO.getStartDate()) |
| | | || Objects.isNull(updOrderDataDTO.getEndDate())){ |
| | | public void updOrderData(Orders orders,Orders model){ |
| | | if(Objects.isNull(orders) |
| | | || Objects.isNull(orders.getStartDate()) |
| | | || Objects.isNull(orders.getEndDate())){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | Orders orders = ordersMapper.selectById(updOrderDataDTO.getOrderId()); |
| | | if(Objects.isNull(orders)||Constants.equalsInteger(orders.getDeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(!Constants.equalsInteger(orders.getStatus(),Constants.ordersStatus.accept.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"订åç¶æå·²æµè½¬,æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | if(!Constants.equalsInteger(orders.getReleaseMemberId(),updOrderDataDTO.getMember().getId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鿍çè®¢åæ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | if(Constants.equalsInteger(orders.getIsUpdate(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"订å已修æ¹ï¼å¾
æ¥åæ¹ç¡®è®¤ï¼æ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | orders.setStartDate(updOrderDataDTO.getStartDate()); |
| | | orders.setEndDate(updOrderDataDTO.getEndDate()); |
| | | orders.setTotalDays(updOrderDataDTO.getTotalDays()); |
| | | model.setTotalDays(DateUtil.daysBetweenDates(orders.getEndDate(),orders.getStartDate())+1); |
| | | model.setStartDate(orders.getStartDate()); |
| | | model.setEndDate(orders.getEndDate()); |
| | | //ç¨è½¦ç±»å |
| | | if(Constants.equalsInteger(orders.getType(),Constants.ONE)){ |
| | | if(Constants.equalsInteger(orders.getCarType(),Constants.ZERO)) { |
| | | orders.setPriceNum1(updOrderDataDTO.getTotalDays()); |
| | | if(Constants.equalsInteger(model.getType(),Constants.ONE)){ |
| | | if(Constants.equalsInteger(model.getCarType(),Constants.ZERO)) { |
| | | model.setPriceNum1(orders.getTotalDays()); |
| | | } |
| | | }else if(Constants.equalsInteger(orders.getType(),Constants.ZERO)){ |
| | | if(Constants.equalsInteger(orders.getWorkType(),Constants.ONE)||(Constants.equalsInteger(orders.getWorkType(),Constants.TWO)&&Constants.equalsInteger(orders.getCarType(),Constants.ZERO))){ |
| | | orders.setPriceNum1(updOrderDataDTO.getTotalDays()); |
| | | }else if(Constants.equalsInteger(model.getType(),Constants.ZERO)){ |
| | | if(Constants.equalsInteger(model.getWorkType(),Constants.ONE)|| |
| | | (Constants.equalsInteger(model.getWorkType(),Constants.TWO)&&Constants.equalsInteger(model.getCarType(),Constants.ZERO))){ |
| | | model.setPriceNum1(orders.getTotalDays()); |
| | | } |
| | | }else{ |
| | | orders.setPriceNum1(updOrderDataDTO.getTotalDays()); |
| | | model.setPriceNum1(orders.getTotalDays()); |
| | | } |
| | | Long total = this.getTotal(orders); |
| | | ordersMapper.update(new UpdateWrapper<Orders>().lambda() |
| | | .set(Orders::getStartDate,updOrderDataDTO.getStartDate()) |
| | | .set(Orders::getEndDate,updOrderDataDTO.getEndDate()) |
| | | .set(Orders::getTotalDays,updOrderDataDTO.getTotalDays()) |
| | | .set(Orders::getStartDate,model.getStartDate()) |
| | | .set(Orders::getEndDate,model.getEndDate()) |
| | | .set(Orders::getTotalDays,model.getTotalDays()) |
| | | .set(Orders::getIsUpdate,Constants.ONE) |
| | | .set(Orders::getIsUpdateTime,new Date()) |
| | | .set(Orders::getUpdateTime,new Date()) |
| | |
| | | ); |
| | | //å建æä½æ¥å¿ |
| | | Constants.OrdersLog ordersLog = Constants.OrdersLog.UPD_ORDER; |
| | | this.saveOrderLog(orders,ordersLog, |
| | | ordersLog.getInfo(),updOrderDataDTO.getMember().getId(),null); |
| | | this.saveOrderLog(model,ordersLog, |
| | | ordersLog.getInfo(),orders.getMember().getId(),null); |
| | | |
| | | //TODO éç¥æ¥å人 订ååçåæ´ |
| | | } |
| | |
| | | if(!Constants.equalsInteger(orders.getAcceptMemberId(),confirmUpdOrderDTO.getMember().getId())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鿍çè®¢åæ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | if( Constants.equalsInteger(confirmUpdOrderDTO.getStatus(),Constants.ONE)){ |
| | | if(!Constants.equalsInteger(confirmUpdOrderDTO.getStatus(),Constants.ONE)){ |
| | | ordersMapper.update(new UpdateWrapper<Orders>().lambda() |
| | | .set(Orders::getIsUpdate,Constants.TWO) |
| | | .set(Orders::getUpdateTime,new Date()) |
| | |
| | | .eq(Orders::getId,orders.getId()) |
| | | ); |
| | | |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().set(Member::getReceiveNum,"receive_num - 1").eq(Member::getId,confirmUpdOrderDTO.getMember().getId())); |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().setSql("receive_num = receive_num - 1").eq(Member::getId,confirmUpdOrderDTO.getMember().getId())); |
| | | |
| | | //è®°å½ä¸åæä¿®æ¹çæ¥å¿ |
| | | Constants.OrdersLog ordersLog = Constants.OrdersLog.UPD_DISAGREE; |
| | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * ååæ¹åæ¶è®¢å |
| | | * @param orderId |
| | | * @param member |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void releaseCancelOrder(Integer orderId,Member member){ |
| | | public void cancelOrder(Integer orderId,Member member){ |
| | | Orders orders = ordersMapper.selectById(orderId); |
| | | if(Objects.isNull(orders)||Constants.equalsInteger(orders.getDeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Constants.equalsInteger(orders.getReleaseMemberId(),member.getId())){ |
| | | this.releaseCancelOrder(orders,member); |
| | | }else if(Constants.equalsInteger(orders.getAcceptMemberId(),member.getId())){ |
| | | this.receiveCancelOrder(orders,member); |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"鿍çè®¢åæ æ³è¿è¡è¯¥æä½"); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String cancelTips(Integer orderId,Member member){ |
| | | Orders orders = ordersMapper.selectById(orderId); |
| | | if(Objects.isNull(orders)||Constants.equalsInteger(orders.getDeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | |
| | | Integer totalCancelTimes = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RELEASE_CANCEL_TIMES).getCode()); |
| | | Long cancelTimes = ordersMapper.selectCount(new QueryWrapper<Orders>().lambda() |
| | | .apply(" DATE(cancel_time) = DATE(NOW()) ") |
| | | .eq(Orders::getStatus,Constants.ordersStatus.cancel.getKey()) |
| | | .eq(Orders::getReleaseMemberId,member.getId())); |
| | | //æ¥è¯¢åæ¶æ¬¡æ° |
| | | if(totalCancelTimes<=cancelTimes){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"仿¥è®¢å主å¨åæ¶æ¬¡æ°å·²è¶
åº"+totalCancelTimes+"次,æ æ³åæ¶è®¢å,å¦éå¤ç请è系客æ"); |
| | | } |
| | | |
| | | Integer cancelTimeHour = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RELEASE_CANCEL_TIME).getCode()); |
| | | Long hours = DateUtil.getBetweenHours(new Date(),orders.getStartDate()); |
| | | if(hours < cancelTimeHour){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"è·ç¦»è®¢åå¼å§æ¶é´ä¸è¶³"+cancelTimeHour+"å°æ¶,æ æ³åæ¶è®¢åï¼å¦éå¤ç请è系客æ"); |
| | | } |
| | | return "仿¥è¿å¯ä¸»å¨åæ¶"+(totalCancelTimes-cancelTimes)+"æ¬¡ï¼æ¯å¦ç¡®è®¤åæ¶"; |
| | | |
| | | } |
| | | |
| | | /** |
| | | * ååæ¹åæ¶è®¢å |
| | | * @param member |
| | | */ |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void releaseCancelOrder(Orders orders,Member member){ |
| | | if(!(Constants.equalsInteger(orders.getStatus(),Constants.ordersStatus.wait.getKey()) |
| | | ||Constants.equalsInteger(orders.getStatus(),Constants.ordersStatus.waitPay.getKey()) |
| | | || Constants.equalsInteger(orders.getStatus(),Constants.ordersStatus.accept.getKey()))){ |
| | |
| | | //TODO ååæ¹åæ¶è®¢åéç¥æ¥åæ¹ |
| | | |
| | | //åå°æ¥åé |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().set(Member::getReceiveNum,"receive_num - 1").eq(Member::getId,orders.getAcceptMemberId())); |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().setSql("receive_num = (receive_num - 1) ").eq(Member::getId,orders.getAcceptMemberId())); |
| | | } |
| | | //åå°ååé |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().set(Member::getPublishNum,"publish_num - 1").eq(Member::getId,orders.getReleaseMemberId())); |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().setSql("publish_num = (publish_num - 1)").eq(Member::getId,orders.getReleaseMemberId())); |
| | | |
| | | //æ¥å¿åå¨ |
| | | Constants.OrdersLog ordersLog = Constants.OrdersLog.RELEASE_CANCEL; |
| | | this.saveOrderLog(orders,ordersLog, |
| | | ordersLog.getInfo(),member.getId(),null); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ¥åæ¹åæ¶æ¥å |
| | | * @param orderId |
| | | * @param member |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public void receiveCancelOrder(Integer orderId,Member member){ |
| | | Orders orders = ordersMapper.selectById(orderId); |
| | | if(Objects.isNull(orders)||Constants.equalsInteger(orders.getDeleted(),Constants.ONE)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | public void receiveCancelOrder(Orders orders,Member member){ |
| | | if(!Constants.equalsInteger(orders.getStatus(),Constants.ordersStatus.accept.getKey())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"订åç¶æå·²æµè½¬,æ æ³è¿è¡åæ¶"); |
| | | } |
| | |
| | | ); |
| | | |
| | | //åå°æ¥åé |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().set(Member::getReceiveNum,"receive_num - 1").eq(Member::getId,orders.getAcceptMemberId())); |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda().setSql(" receive_num = receive_num - 1 ").eq(Member::getId,orders.getAcceptMemberId())); |
| | | //æ¥å¿åå¨ |
| | | Constants.OrdersLog ordersLog = Constants.OrdersLog.CANCEL; |
| | | this.saveOrderLog(orders,ordersLog, |
| | |
| | | orders.setOutTradeNo(UUID.randomUUID().toString().replace("-","")); |
| | | ordersMapper.updateById(orders); |
| | | //å¤èµ·æ¯ä»ä¸å¡ |
| | | object = this.getWxPayResponse(orders,orders.getMember().getOpenid()); |
| | | object = this.getWxPayResponse(orders,doneOrderDTO.getMember().getOpenid()); |
| | | orderReleaseVO.setObject(object); |
| | | }else{ |
| | | orders.setStatus(Constants.ordersStatus.done.getKey()); |
| | |
| | | .set(Orders::getUpdateTime,new Date()) |
| | | .set(Orders::getCommentTime,new Date()) |
| | | .set(Orders::getCommentLevel,commentDTO.getLevel()) |
| | | .set(org.apache.commons.lang3.StringUtils.isNotBlank(commentDTO.getInfo()),Orders::getCommentInfo,commentDTO.getInfo()) |
| | | .set(Orders::getCommentType,Constants.ZERO) |
| | | .eq(Orders::getId,orders.getId()) |
| | | ); |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getScore," ( total_score +" + commentDTO.getLevel() + " ) / (score_order_num + 1 )") |
| | | .set(Member::getTotalScore," total_score +" + commentDTO.getLevel()) |
| | | .set(Member::getScoreOrderNum," score_order_num + 1 " ).eq(Member::getId,orders.getAcceptMemberId()) |
| | | .setSql(" score = ( total_score +" + commentDTO.getLevel() + " ) / (score_order_num + 1 )") |
| | | .setSql(" total_score = total_score +" + commentDTO.getLevel()) |
| | | .setSql(" score_order_num = score_order_num + 1 " ).eq(Member::getId,orders.getAcceptMemberId()) |
| | | ); |
| | | //æ¥å¿åå¨ |
| | | Constants.OrdersLog ordersLog = Constants.OrdersLog.COMMENT; |
| | |
| | | @Override |
| | | @Transactional(rollbackFor = {BusinessException.class,Exception.class}) |
| | | public String payNotify(String preOrderId,String paymentNo){ |
| | | Orders orders = ordersMapper.selectOne(new QueryWrapper<Orders>().lambda().eq(Orders::getCode,preOrderId).last("limit 1")); |
| | | Orders orders = ordersMapper.selectOne(new QueryWrapper<Orders>().lambda().eq(Orders::getOutTradeNo,preOrderId).last("limit 1")); |
| | | if(Constants.equalsInteger(orders.getType(),Constants.TWO)){ |
| | | //ç¨é¤è®¢å å¦æå·²ç»æµè½¬å°å·²æ¯ä» åç´æ¥è¿å |
| | | if(!Constants.equalsInteger(orders.getStatus(),Constants.ZERO)){ |
| | |
| | | //å卿µæ°´è®°å½ |
| | | MemberRevenue memberRevenue = new MemberRevenue(); |
| | | memberRevenue.setCreateTime(new Date()); |
| | | memberRevenue.setDeleted(Constants.ZERO); |
| | | memberRevenue.setTransactionNo(orders.getCode()); |
| | | memberRevenue.setMemberId(orders.getAcceptMemberId()); |
| | | memberRevenue.setType(orders.getType()); |
| | | memberRevenue.setOptType(Constants.ONE); |
| | |
| | | |
| | | //æ´æ°æ¥åç¨æ·çä½é¢ä¸å岿»éé¢ |
| | | memberMapper.update(new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getAmount,"amount + " + orders.getReceiveAccount() ) |
| | | .set(Member::getTotalAmount,"amount + " + orders.getReceiveAccount() ) |
| | | .setSql(" amount = ( amount + " + orders.getReceiveAccount() +")" ) |
| | | .setSql(" total_amount = ( amount + " + orders.getReceiveAccount() + ")" ) |
| | | .eq(Member::getId,member.getId()) |
| | | ); |
| | | |
| | |
| | | //æ¥åæ¹ æç订å |
| | | queryWrapper.eq(Orders::getAcceptMemberId,model.getMember().getId()); |
| | | queryWrapper.eq(Objects.nonNull(model.getStatus()),Orders::getStatus,model.getStatus()); |
| | | queryWrapper.orderByDesc(Orders::getCreateTime); |
| | | queryWrapper.orderByDesc(Orders::getAcceptTime); |
| | | }else{ |
| | | //æ¥è¯¢ç¨æ·çæ¥åæé |
| | | ReceiveWeight receiveWeight = receiveWeightMapper.selectOne(new QueryWrapper<ReceiveWeight>().lambda().eq(ReceiveWeight::getDeleted,Constants.ZERO).apply(" RECEIVE_MIN < "+model.getMember().getReceiveNum()+" and RECEIVE_MAX > " + model.getMember().getReceiveNum()).last(" limit 1 ")); |
| | |
| | | |
| | | |
| | | @Override |
| | | public Orders getDetail(Integer id,Integer userType) { |
| | | public Orders getDetail(Integer id,Member member) { |
| | | Orders orders = ordersMapper.selectJoinOne(Orders.class,new MPJLambdaWrapper<Orders>() |
| | | .selectAll(Orders.class) |
| | | .select(" m1.name " , Orders::getReleaseName) |
| | |
| | | orders.setMultifileList(multifileList); |
| | | } |
| | | orders.setStatusName(Constants.ordersStatus.getName(orders.getStatus())); |
| | | orders.setCancelStatus(Constants.ZERO); |
| | | this.getPriceUnit(orders); |
| | | if(orders.getStatus() <= Constants.ordersStatus.accept.getKey()){ |
| | | if(Constants.equalsInteger(orders.getReleaseMemberId(),member.getId())){ |
| | | //夿æ¯å¦å¯ä¿®æ¹ å·²åæ¶æ¬¡æ° ä¸ æ¶é´éå¶ |
| | | Integer totalCancelTimes = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RELEASE_CANCEL_TIMES).getCode()); |
| | | Long cancelTimes = ordersMapper.selectCount(new QueryWrapper<Orders>().lambda() |
| | | .apply(" DATE(cancel_time) = DATE(NOW()) ") |
| | | .eq(Orders::getStatus,Constants.ordersStatus.cancel.getKey()) |
| | | .eq(Orders::getReleaseMemberId,orders.getReleaseMemberId())); |
| | | //æ¥è¯¢åæ¶æ¬¡æ° |
| | | if(totalCancelTimes<=cancelTimes){ |
| | | orders.setCancelStatus(Constants.ONE); |
| | | return orders; |
| | | } |
| | | Integer cancelTimeHour = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RELEASE_CANCEL_TIME).getCode()); |
| | | Long hours = DateUtil.getBetweenHours(new Date(),orders.getStartDate()); |
| | | if(hours < cancelTimeHour){ |
| | | orders.setCancelStatus(Constants.ONE); |
| | | return orders; |
| | | } |
| | | }else if(Constants.equalsInteger(orders.getAcceptMemberId(),member.getId())){ |
| | | //夿æ¯å¦å¯ä¿®æ¹ å·²åæ¶æ¬¡æ° ä¸ æ¶é´éå¶ |
| | | Integer totalCancelTimes = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RECEIVE_CANCEL_TIMES).getCode()); |
| | | Long cancelTimes = orderLogMapper.selectCount(new QueryWrapper<OrderLog>().lambda() |
| | | .apply(" DATE(create_time) = DATE(NOW()) ") |
| | | .eq(OrderLog::getObjType,Constants.OrdersLog.CANCEL.getKey()) |
| | | .eq(OrderLog::getMemberId,member.getId())); |
| | | //æ¥è¯¢åæ¶æ¬¡æ° |
| | | if(totalCancelTimes<=cancelTimes){ |
| | | orders.setCancelStatus(Constants.ONE); |
| | | return orders; |
| | | } |
| | | |
| | | Integer cancelTimeHour = Integer.valueOf(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.RECEIVE_CANCEL_TIME).getCode()); |
| | | Long hours = DateUtil.getBetweenHours(new Date(),orders.getStartDate()); |
| | | if(hours < cancelTimeHour){ |
| | | orders.setCancelStatus(Constants.ONE); |
| | | return orders; |
| | | } |
| | | } |
| | | } else{ |
| | | orders.setCancelStatus(Constants.ONE); |
| | | } |
| | | return orders; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | public synchronized String getNextCode(Integer type){ |
| | | String prefix = "YG"; |
| | | if(!Constants.equalsInteger(type,Constants.ZERO)){ |
| | |
| | | //å卿µæ°´è®°å½ |
| | | MemberRevenue memberRevenue = new MemberRevenue(); |
| | | memberRevenue.setCreateTime(new Date()); |
| | | memberRevenue.setTransactionNo(withdrawalOrders.getOutBillNo()); |
| | | memberRevenue.setDeleted(Constants.ZERO); |
| | | memberRevenue.setMemberId(member.getId()); |
| | | memberRevenue.setType(Constants.THREE); |
| | | memberRevenue.setOptType(-Constants.ONE); |
| | |
| | | driver-class-name: com.mysql.cj.jdbc.Driver |
| | | type: com.alibaba.druid.pool.DruidDataSource |
| | | redis: |
| | | # database: 0 |
| | | # database: 0 |
| | | host: 127.0.0.1 |
| | | port: 6379 |
| | | password: |
| | |
| | | required: true |
| | | |
| | | debug_model: true |
| | | |
| | | # Swaggeré
ç½® |
| | | swagger: |
| | | host: |
| | |
| | | enable-encrypt: true |
| | | # ç¦ç¨swaggeræ¶çéå®åå°å |
| | | redirect-uri: / |
| | | |
| | | |
| | | des_pwd: 123456SDFKDJF |
| | | knife4j: |
| | | enable: true |
| | |
| | | enable: true |
| | | username: admin |
| | | password: 111111 |
| | | |
| | | qiwei: |
| | | serviceurl: https://qyapi.weixin.qq.com |
| | | |
| | | aes: |
| | | encrypt: |
| | | open: true # æ¯å¦å¼å¯å å¯ true or false |
| | |
| | | publicKey: mN4Yn8Or8r7SH1w3 # AESå¯é¥ |
| | | privateKey: # RSAç§é¥ |
| | | time: 600000 |
| | | |
| | | ########################微信æ¯ä»ç¸å
³é
ç½®######################## |
| | | wx: |
| | | pay: |
| | | #æå¡å---------start------- |
| | | appId: wx48fd8faa35cc8277 |
| | | mchId: 1661770902 |
| | | apiV3Key: iF3kC8pL8dZ9iU3hN5fX9zI6eF4xQ6fT |
| | | serialNumer: 368B835A194384FD583B83B77977B84127D2F655 |
| | | mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S |
| | | notifyUrl: http://xiaopiqiu2.natapp1.cc/web/wxPayNotify |
| | | refundNotifyUrl: http://xiaopiqiu2.natapp1.cc/web/wxRefundNotify |
| | | #notifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxPayNotify |
| | | #refundNotifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxRefundNotify |
| | | #keyPath: /usr/local/aliConfig/bike/apiclient_cert.p12 |
| | | #privateCertPath: /usr/local/aliConfig/bike/apiclient_cert.pem |
| | | #privateKeyPath: /usr/local/aliConfig/bike/apiclient_key.pem |
| | | keyPath: d://apiclient_cert.p12 |
| | | privateCertPath: d://apiclient_cert.pem |
| | | privateKeyPath: d://apiclient_key.pem |
| | | |
| | | #åæ·ä¿¡æ¯ |
| | | wechatSerialNumer: 3C9A32FB6CD453FAAAF97F9737ECAEA9D6625727 |
| | | wechatPayPublicKeyId: 47E172124E73E8098A565E971064C20ACDE7C911 # PUB_KEY_ID_0116617720032025071800291849000801 #åæ·/平尿¯ä»å
¬é¥id |
| | | wechatPubKeyPath: d://pub_key.pem #åæ·æ¯ä»å
¬é¥ |
| | | #wechatPlatformPubKeyPath: d:/wechatpay_47E172124E73E8098A565E971064C20ACDE7C911.pem #平尿¯ä»å
¬é¥ |
| | | wechatPrivateKeyPath: d://wechatApiclient_key.pem #åæ·ç§é¥ |
| | | wechatNotifyUrl: http://xiaopiqiu2.natapp1.cc/web/wechat/transferNotify #åæ·è½¬è´¦åè°å°å |
| | | #wechatApiV3Key: V4PRKUBTK2BKNKJAD9NSI9YFG2Q0EOT1 #åæ·APIV3Key |
| | | #æå¡å---------start------- åæ°è¯¦è§£å°å https://pay.weixin.qq.com/doc/v3/partner/4013080340 |
| | | mchId: 1700071922 #æå¡åå¨å¾®ä¿¡æ¯ä»ä¾§çå¯ä¸èº«ä»½æ è¯ |
| | | appId: wx332441ae5b12be7d #æå¡åå¨å¾®ä¿¡å¼æ¾å¹³å°ï¼ç§»å¨åºç¨ï¼æå
¬ä¼å¹³å°ï¼å
¬ä¼å·/å°ç¨åºï¼ä¸ç³è¯·çä¸ä¸ªå¯ä¸æ è¯ |
| | | apiV3Key: 0a056faa107c2b2944b9d6a9aa6d4142 #7tG4Vk9Zp2L8dXw5Jq0N3hR6yE1sF3cB |
| | | serialNumer: 7DCD480EB6DF3791721867A6EB57105DECEF38BE #38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #æå¡åè¯ä¹¦åºåå· |
| | | #mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S |
| | | notifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxPayNotify |
| | | refundNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxRefundNotify |
| | | keyPath: d://jinkuai/apiclient_cert.p12 |
| | | privateCertPath: d://jinkuai/apiclient_cert.pem |
| | | privateKeyPath: d://jinkuai/apiclient_key.pem |
| | | |
| | | #æå¡å-------------end--- |
| | | |
| | | #åæ·ä¿¡æ¯ |
| | | wechatSerialNumer: 38495CE0137D90E4DC4F64F7ECDE035A35470BE3 |
| | | wechatPayPublicKeyId: PUB_KEY_ID_0117233260692025072500181939000603 #åæ·/平尿¯ä»å
¬é¥id |
| | | wechatPubKeyPath: d://jinkuai/shanghu/pub_key.pem #åæ·æ¯ä»å
¬é¥ |
| | | wechatPrivateKeyPath: d://jinkuai/shanghu/apiclient_key.pem #åæ·ç§é¥ |
| | | wechatNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wechat/transferNotify #åæ·è½¬è´¦åè°å°å |
| | | |
| | | |
| | | existsSub: 1 |
| | | appSecret: 1ceb7c9dff3c4330d653adc3ca55ea24 |
| | | appSecret: |
| | | #ååæ·------------start---- |
| | | subAppId: wxcd2b89fd2ff065f8 #wxcd2b89fd2ff065f8 |
| | | subAppSecret: 3462fa186da7cb06c544df8d8664b63a #3336812504c830b1c3c5243f9ece407a |
| | | subMchId: 1661772003 |
| | | subMchKey: EVM8E15TKXE0OEMJFC0V6UFVIOZ5CSQS |
| | | subMchId: 1723326069 #ååæ·å· |
| | | subAppId: wx332441ae5b12be7d #å°ç¨åºid |
| | | subAppSecret: add86d6406f5c14501ac5bbb1a60e004 #å°ç¨åºç§é¥ |
| | | #ååæ·------------end---- |
| | | #mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM |
| | | # mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM |
| | | typeId: gybike |
| | | |
| | | |
| | | #wx: |
| | | # pay: |
| | | # #æå¡å---------start------- |
| | | # appId: wx48fd8faa35cc8277 |
| | | # mchId: 1661770902 |
| | | # apiV3Key: iF3kC8pL8dZ9iU3hN5fX9zI6eF4xQ6fT |
| | | # serialNumer: 368B835A194384FD583B83B77977B84127D2F655 |
| | | # mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S |
| | | # notifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxPayNotify |
| | | # refundNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxRefundNotify |
| | | ## notifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxPayNotify |
| | | ## refundNotifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxRefundNotify |
| | | # #keyPath: /usr/local/aliConfig/bike/apiclient_cert.p12 |
| | | # #privateCertPath: /usr/local/aliConfig/bike/apiclient_cert.pem |
| | | # #privateKeyPath: /usr/local/aliConfig/bike/apiclient_key.pem |
| | | # keyPath: /usr/local/zhengshu/apiclient_cert.p12 #d://apiclient_cert.p12 |
| | | # privateCertPath: /usr/local/zhengshu/apiclient_cert.pem #d://apiclient_cert.pem |
| | | # privateKeyPath: /usr/local/zhengshu/apiclient_key.pem #d://apiclient_key.pem |
| | | # |
| | | # |
| | | # #åæ·ä¿¡æ¯ |
| | | # wechatSerialNumer: 3C9A32FB6CD453FAAAF97F9737ECAEA9D6625727 |
| | | # wechatPayPublicKeyId: 47E172124E73E8098A565E971064C20ACDE7C911 # PUB_KEY_ID_0116617720032025071800291849000801 #åæ·/平尿¯ä»å
¬é¥id |
| | | # wechatPubKeyPath: /usr/local/zhengshu/pub_key.pem #d://pub_key.pem #åæ·æ¯ä»å
¬é¥ |
| | | # #wechatPlatformPubKeyPath: d:/wechatpay_47E172124E73E8098A565E971064C20ACDE7C911.pem #平尿¯ä»å
¬é¥ |
| | | # wechatPrivateKeyPath: /usr/local/zhengshu/wechatApiclient_key.pem #d://wechatApiclient_key.pem #åæ·ç§é¥ |
| | | # wechatNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wechat/transferNotify #åæ·è½¬è´¦åè°å°å |
| | | # #wechatApiV3Key: V4PRKUBTK2BKNKJAD9NSI9YFG2Q0EOT1 #åæ·APIV3Key |
| | | # |
| | | # |
| | | # #æå¡å-------------end--- |
| | | # existsSub: 1 |
| | | # appSecret: 1ceb7c9dff3c4330d653adc3ca55ea24 |
| | | # #ååæ·------------start---- |
| | | # subAppId: wxcd2b89fd2ff065f8 #wxcd2b89fd2ff065f8 |
| | | # subAppSecret: 3462fa186da7cb06c544df8d8664b63a #3336812504c830b1c3c5243f9ece407a |
| | | # subMchId: 1661772003 |
| | | # subMchKey: EVM8E15TKXE0OEMJFC0V6UFVIOZ5CSQS |
| | | # #ååæ·------------end---- |
| | | # # mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM |
| | | # typeId: gybike |
| | | |
| | | upload: |
| | | type: ftp |
| | | |
| | |
| | | password: 111111 |
| | | |
| | | ########################微信æ¯ä»ç¸å
³é
ç½®######################## |
| | | |
| | | ########################微信æ¯ä»ç¸å
³é
ç½®######################## |
| | | wx: |
| | | pay: |
| | | #æå¡å---------start------- |
| | | appId: wx48fd8faa35cc8277 |
| | | mchId: 1661770902 |
| | | apiV3Key: iF3kC8pL8dZ9iU3hN5fX9zI6eF4xQ6fT |
| | | serialNumer: 368B835A194384FD583B83B77977B84127D2F655 |
| | | mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S |
| | | # notifyUrl: http://xiaopiqiu3.natapp1.cc/api/wxPayNotify |
| | | # refundNotifyUrl: http://xiaopiqiu3.natapp1.cc/api/wxRefundNotify |
| | | notifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxPayNotify |
| | | refundNotifyUrl: https://dmtest.ahapp.net/bike_h5_api/api/wxRefundNotify |
| | | keyPath: /usr/local/aliConfig/bike/apiclient_cert.p12 |
| | | privateCertPath: /usr/local/aliConfig/bike/apiclient_cert.pem |
| | | privateKeyPath: /usr/local/aliConfig/bike/apiclient_key.pem |
| | | # keyPath: d://apiclient_cert.p12 |
| | | # privateCertPath: d://apiclient_cert.pem |
| | | # privateKeyPath: d://apiclient_key.pem |
| | | mchId: 1700071922 #æå¡ååæ·å· |
| | | appId: wx6cc1087ca79db7f6 #æå¡åAPPID |
| | | apiV3Key: 0a056faa107c2b2944b9d6a9aa6d4142 |
| | | serialNumer: 38495CE0137D90E4DC4F64F7ECDE035A35470BE3 #æå¡åè¯ä¹¦åºåå· |
| | | #mchKey: W97N53Q71326D6JZ2E9HY5M4VT4BAC8S |
| | | notifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxPayNotify |
| | | refundNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wxRefundNotify |
| | | keyPath: /usr/local/zhengshu/apiclient_cert.p12 |
| | | privateCertPath: /usr/local/zhengshu/apiclient_cert.pem |
| | | privateKeyPath: /usr/local/zhengshu/apiclient_key.pem |
| | | |
| | | #åæ·ä¿¡æ¯ |
| | | wechatSerialNumer: 12C0F0DD0F3D2B565B45586D3FEA225EBF723BEC |
| | | wechatPayPublicKeyId: PUB_KEY_ID_0117233260692025072500181939000603 #åæ·/平尿¯ä»å
¬é¥id |
| | | wechatPubKeyPath: /usr/local/zhengshu/pub_key.pem #åæ·æ¯ä»å
¬é¥ |
| | | wechatPrivateKeyPath: /usr/local/zhengshu/shanghu/apiclient_key.pem #åæ·ç§é¥ |
| | | wechatNotifyUrl: https://test.doumee.cn/jinkuai_admin/web/wechat/transferNotify #åæ·è½¬è´¦åè°å°å |
| | | |
| | | |
| | | #æå¡å-------------end--- |
| | | existsSub: 1 |
| | | appSecret: 1ceb7c9dff3c4330d653adc3ca55ea24 |
| | | appSecret: |
| | | #ååæ·------------start---- |
| | | subAppId: wxcd2b89fd2ff065f8 #wxcd2b89fd2ff065f8 |
| | | subAppSecret: 3462fa186da7cb06c544df8d8664b63a #3336812504c830b1c3c5243f9ece407a |
| | | subMchId: 1661772003 |
| | | subMchKey: EVM8E15TKXE0OEMJFC0V6UFVIOZ5CSQS |
| | | subAppId: wx332441ae5b12be7d #å°ç¨åºid |
| | | subAppSecret: add86d6406f5c14501ac5bbb1a60e004 #å°ç¨åºç§é¥ |
| | | subMchId: 1723326069 #ååæ·å· |
| | | #ååæ·------------end---- |
| | | # mchKey: u4TSNtv0wFP7WRfnxBgijYOtRhS9FvlM |
| | | typeId: gybike |
| | |
| | | }) |
| | | public ApiResponse updateOrder(@RequestBody Orders orders) { |
| | | orders.setMember(this.getMemberResponse()); |
| | | ordersService.updateById(orders); |
| | | ordersService.update(orders); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | // @LoginRequired |
| | | // @ApiOperation(value = "ä¿®æ¹è®¢åæ¥æ - ååæ¹", notes = "å°ç¨åºç«¯") |
| | | // @PostMapping("/updOrderData") |
| | | // @ApiImplicitParams({ |
| | | // @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | // }) |
| | | // public ApiResponse updOrderData(@RequestBody UpdOrderDataDTO updOrderDataDTO) { |
| | | // updOrderDataDTO.setMember(this.getMemberResponse()); |
| | | // ordersService.updOrderData(updOrderDataDTO); |
| | | // return ApiResponse.success("æä½æå"); |
| | | // } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "æå¨æ¥å - æ¥åæ¹", notes = "å°ç¨åºç«¯") |
| | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "åæ¶è®¢å - ååæ¹", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/releaseCancelOrder") |
| | | @GetMapping("/cancelOrder") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse releaseCancelOrder(@RequestParam Integer orderId) { |
| | | ordersService.releaseCancelOrder(orderId,this.getMemberResponse()); |
| | | public ApiResponse cancelOrder(@RequestParam Integer orderId) { |
| | | ordersService.cancelOrder(orderId,this.getMemberResponse()); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "åæ¶æ¥å - æ¥åæ¹", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/receiveCancelOrder") |
| | | @ApiOperation(value = "åæ¶åæç¤ºè¯ - ååæ¹", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/cancelTips") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse receiveCancelOrder(@RequestParam Integer orderId) { |
| | | ordersService.receiveCancelOrder(orderId,this.getMemberResponse()); |
| | | public ApiResponse cancelTips(@RequestParam Integer orderId) { |
| | | ordersService.cancelTips(orderId,this.getMemberResponse()); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "ä¿®æ¹è®¢åæ¥æ - ååæ¹", notes = "å°ç¨åºç«¯") |
| | | @PostMapping("/updOrderData") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse updOrderData(@RequestBody UpdOrderDataDTO updOrderDataDTO) { |
| | | updOrderDataDTO.setMember(this.getMemberResponse()); |
| | | ordersService.updOrderData(updOrderDataDTO); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "确认订åä¿®æ¹ - æ¥åæ¹", notes = "å°ç¨åºç«¯") |
| | |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<Orders> getDetail(@RequestParam Integer orderId) { |
| | | return ApiResponse.success("æä½æå",ordersService.getDetail(orderId,this.getMemberResponse().getUseIdentity())); |
| | | return ApiResponse.success("æä½æå",ordersService.getDetail(orderId,this.getMemberResponse())); |
| | | } |
| | | |
| | | @LoginRequired |
| | |
| | | <script> |
| | | import { mapState } from 'vuex' |
| | | var QQMapWX = require('@/utils/qqmap-wx-jssdk.js') |
| | | export default { |
| | | computed: { |
| | | ...mapState(['userInfo','openid']) |
| | | }, |
| | | <<<<<<< HEAD |
| | | onLaunch: function() { |
| | | ======= |
| | | onLaunch: function() { |
| | | >>>>>>> 2d0d3bb6a63ad0aee9d5cc003b50c50391b1cc94 |
| | | var that = this; |
| | | that.getLocaltionBiz() |
| | | if (!this.openid || this.openid =='') { |
| | | uni.login({ |
| | | provider: 'weixin', |
| | |
| | | that.$store.commit('setToken', res.data.token) |
| | | that.$store.commit('setOpenid', res.data.openid) |
| | | that.$store.commit('setUserInfo', res.data.member) |
| | | uni.getLocation({ |
| | | type: 'wgs84', |
| | | success: (addr) => { |
| | | that.$store.commit('setPosition', { latitude: addr.latitude, longitude: addr.longitude }) |
| | | that.$isResolve() |
| | | }, |
| | | fail: (err) => { |
| | | console.error('è·åä½ç½®å¤±è´¥', err); |
| | | that.$isResolve() |
| | | } |
| | | }); |
| | | |
| | | } |
| | | } |
| | |
| | | var that = this |
| | | let res = this.$u.api.getMemberInfo({}).then(res =>{ |
| | | if (res && res.code === 200) { |
| | | that.$store.commit('setUserInfo', res.data) |
| | | uni.getLocation({ |
| | | type: 'wgs84', |
| | | success: (addr) => { |
| | | that.$store.commit('setPosition', { latitude: addr.latitude, longitude: addr.longitude }) |
| | | that.$isResolve() |
| | | }, |
| | | fail: (err) => { |
| | | console.error('è·åä½ç½®å¤±è´¥', err); |
| | | that.$isResolve() |
| | | } |
| | | }); |
| | | that.$store.commit('setUserInfo', res.data) |
| | | } else { |
| | | that.$store.commit('setToken','') |
| | | that.$store.commit('setUserInfo',{}) |
| | | uni.getLocation({ |
| | | type: 'wgs84', |
| | | success: (addr) => { |
| | | that.$store.commit('setPosition', { latitude: addr.latitude, longitude: addr.longitude }) |
| | | that.$isResolve() |
| | | }, |
| | | fail: (err) => { |
| | | console.error('è·åä½ç½®å¤±è´¥', err); |
| | | that.$isResolve() |
| | | } |
| | | }); |
| | | that.$store.commit('setUserInfo',{}) |
| | | } |
| | | }) |
| | | } |
| | |
| | | }, |
| | | onHide: function() { |
| | | console.log('App Hide') |
| | | }, |
| | | methods:{ |
| | | getLocaltionBiz(){ |
| | | var that =this |
| | | uni.getLocation({ |
| | | type: 'wgs84', |
| | | success: (addr) => { |
| | | const locParam = { latitude: addr.latitude, longitude: addr.longitude ,address:'è·åå°å失败'}; |
| | | var address =null |
| | | const qqmapsdk = new QQMapWX({ |
| | | key: '4PXBZ-JLBC7-LCLXG-P2SZX-C4HYE-LDBLQ' //è
¾è®¯å°å¾ç³è¯·çkeyï¼åç»éè¦å
¬å¸æä¾ï¼ä¸ªäººå¼åè
é¢åº¦æéï¼ |
| | | }); |
| | | // è
¾è®¯å°å¾éå°çç¼ç |
| | | qqmapsdk.reverseGeocoder({ |
| | | locParam, |
| | | success: function(res) { |
| | | console.log(res, '==================è·åå°å'); |
| | | let info = res.result; |
| | | locParam.province = info.address_component.province; |
| | | locParam.city = info.address_component.city; |
| | | locParam.area = info.address_component.district; |
| | | locParam.street = info.address_component.street; |
| | | var ta = info.address || 'å°åè·å失败' ; |
| | | if(info.formatted_addresses && info.formatted_addresses.recommend){ |
| | | ta =info.formatted_addresses.recommend |
| | | } |
| | | locParam.address =ta |
| | | that.$store.commit('setPosition',locParam) |
| | | that.$isResolve() |
| | | }, |
| | | fail: (err) => { |
| | | console.error('è·åä½ç½®å¤±è´¥===========', err); |
| | | that.$store.commit('setPosition',locParam) |
| | | that.$isResolve() |
| | | } |
| | | }); |
| | | // that.$store.commit('setPosition',locParam) |
| | | that.$isResolve() |
| | | }, |
| | | fail: (err) => { |
| | | console.error('è·åä½ç½®å¤±è´¥', err); |
| | | that.$isResolve() |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | } |
| | | </script> |
| | |
| | | <!-- ååæ¹ --> |
| | | <view class="index-c" v-if="typeViewId === 0"> |
| | | <view :style="{ width: '100%', height: statusbarHeight + 'px' }"></view> |
| | | <view class="index-c-title" :style="{ height: navHeight + 'px' }" @click="selectAddress"> |
| | | <view class="index-c-title" :style="{ height: navHeight + 'px' }" @click="selectAddress(-1)"> |
| | | <text class="index-c-title-logo">è¿å¿«</text> |
| | | <image class="dingwei" src="/static/icon/home_ic_location@2x.png" mode="widthFix"></image> |
| | | <text>西æ¹å½é
广åº</text> |
| | | <text>{{location.address || address || 'è·åå°å失败'}}</text> |
| | | <image class="qu" src="/static/icon/home_ar_next@2x.png" mode="widthFix"></image> |
| | | </view> |
| | | |
| | |
| | | <view class="phone-item" v-for="(item,index) in serverPhone" :key="item" @click="contactPhoneDo(item)"> |
| | | <view></view> |
| | | <text>{{item}}</text> |
| | | </view> |
| | | <view class="phone-item" v-for="(item,index) in serverPhone" :key="item" @click="contactPhoneDo(item)"> |
| | | <view></view> |
| | | <text>{{item}}</text> |
| | | </view> |
| | | </view> |
| | | <!-- <view class="phone-botton" @click="contactPhone()" >å
³é</view> --> |
| | | </view> |
| | | </u-popup> |
| | |
| | | export default { |
| | | components: { sunuiMverify }, |
| | | computed: { |
| | | ...mapState(['navHeight', 'statusbarHeight','userInfo','token','openid', 'latitude', 'longitude']), |
| | | ...mapState(['navHeight', 'statusbarHeight','userInfo','token','openid', 'latitude', 'longitude','address']), |
| | | totalPrice() { |
| | | return this.form.estimatedAccount / 100 |
| | | } |
| | |
| | | isLogin: false, |
| | | typeId: 0, |
| | | qqmapsdk: null, |
| | | location:{ |
| | | latitude:null, |
| | | longitude:null, |
| | | address:null, |
| | | }, |
| | | type: [ |
| | | { name: 'ç¨å·¥', id: 0 }, |
| | | { name: 'è¿è´§', id: 1 }, |
| | |
| | | isOnce: true |
| | | } |
| | | }, |
| | | async onLoad() { |
| | | async onLoad() { |
| | | await this.$onLaunched; |
| | | |
| | | if (this.token && this.token != '' && this.userInfo && JSON.stringify(this.userInfo) != '{}' && this.userInfo.useIdentity === 1) { |
| | |
| | | }, |
| | | selectAddress(type, index) { |
| | | uni.chooseLocation({ |
| | | success: (res) => { |
| | | success: (res) => { |
| | | if ([1,2].includes(type)) { |
| | | this.form.latitude = res.latitude |
| | | this.form.longitude = res.longitude |
| | |
| | | this.form.wayInfoDTOList[0].lat = res.latitude |
| | | this.form.wayInfoDTOList[0].lgt = res.longitude |
| | | this.form.wayInfoDTOList[0].location = res.address |
| | | } |
| | | }else if (type == -1) { |
| | | console.log(res) |
| | | this.location.latitude = res.latitude |
| | | this.location.longitude = res.longitude |
| | | this.location.address =res.name || res.address |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | |
| | | padding: 0 30rpx; |
| | | box-sizing: border-box; |
| | | display: flex; |
| | | align-items: center; |
| | | align-items: center; |
| | | .index-c-title-logo { |
| | | font-weight: bold; |
| | | font-size: 40rpx; |
| | |
| | | font-size: 32rpx; |
| | | color: #ffffff; |
| | | margin-right: 12rpx; |
| | | max-width: 280rpx; |
| | | white-space: nowrap; |
| | | overflow: hidden; |
| | | text-overflow: ellipsis; |
| | | } |
| | | .qu { |
| | | width: 22rpx; |
| | |
| | | <text>æç°å°è´¦</text> |
| | | <text>微信é¶é±</text> |
| | | </view> |
| | | <view class="content-title">çå®å§å</view> |
| | | <view class="content-input" style="margin-bottom: 40rpx;"> |
| | | <input style="font-weight: 500;" type="text" v-model="name" @input="changeName" placeholder="微信å®å认è¯å§å" /> |
| | | </view> |
| | | <view class="content-title">æç°éé¢</view> |
| | | <view class="content-input"> |
| | | <view class="content-input-icon"> |
| | | <image src="/static/icon/ic_money@2x.png" mode="widthFix"></image> |
| | | </view> |
| | | <input type="number" v-model="amount" @input="changeAmount" placeholder="请è¾å
¥æç°éé¢" /> |
| | | <view class="content-input-btn" @click="inputAll">å
¨é¨æç°</view> |
| | | <input type="digit" v-model="amount" @input="changeAmount" placeholder="请è¾å
¥æç°éé¢" /> |
| | | <view class="content-input-btn" @click="inputAll">å
¨é¨æç°</view> |
| | | </view> |
| | | <view class="content-tips">{{tips}}</view> |
| | | <view class="content-button" @click="submit">2å°æ¶å°è´¦ï¼ç¡®è®¤æç°</view> |
| | |
| | | data() { |
| | | return { |
| | | tips:'',// |
| | | wxTips:'', |
| | | canTransfer:false, |
| | | changing1:false, |
| | | amount: null |
| | | amount: null, |
| | | name:'' |
| | | }; |
| | | }, |
| | | onLoad(){ |
| | | this.name = this.userInfo.name |
| | | var that =this |
| | | that.canTransfer = false |
| | | if (wx.canIUse('requestMerchantTransfer')) { |
| | | //that.tips='æ¨çå¾®ä¿¡çæ¬æ¯æè¯¥åè½' |
| | | that.canTransfer = true |
| | | }else{ |
| | | that.tips='æ¨çå¾®ä¿¡çæ¬è¿ä½ï¼è¯·æ´æ°è³ææ°çæ¬ä½¿ç¨è¯¥åè½' |
| | | uni.showToast({ |
| | | title:'æ¨çå¾®ä¿¡çæ¬è¿ä½ï¼è¯·æ´æ°è³ææ°çæ¬ä½¿ç¨è¯¥åè½ã' |
| | | }) |
| | | } |
| | | /* wx.ready(function () { |
| | | wx.checkJsApi({ |
| | | jsApiList: ['requestMerchantTransfer'], |
| | | success: function (res) { |
| | | if (res.checkResult['requestMerchantTransfer']) { |
| | | that.canTransfer = true |
| | | } else { |
| | | that.tips='æ¨çå¾®ä¿¡çæ¬è¿ä½ï¼è¯·æ´æ°è³ææ°çæ¬ä½¿ç¨è¯¥åè½' |
| | | uni.showToast({ |
| | | title:'æ¨çå¾®ä¿¡çæ¬è¿ä½ï¼è¯·æ´æ°è³ææ°çæ¬ä½¿ç¨è¯¥åè½ã' |
| | | }) |
| | | } |
| | | } |
| | | }); |
| | | }); */ |
| | | }, |
| | | methods: { |
| | | jump() { |
| | | uni.navigateTo({ |
| | | url: '/pages/balance-details/balance-details' |
| | | }) |
| | | }, |
| | | }, |
| | | inputAll(){ |
| | | this.amount = ((this.userInfo.amount|| 0)/100).toFixed(2) |
| | | }, |
| | | changeAmount(){ |
| | | this.tips='' |
| | | }, |
| | | wxMerchantTransfer(param){ |
| | | wx.requestMerchantTransfer({ |
| | | mchId: param.mchId, |
| | | appId: param.appId, |
| | | package: param.packageInfo, |
| | | success: (res) => { |
| | | // res.err_msgå°å¨é¡µé¢å±ç¤ºæååè¿ååºç¨æ¶è¿åokï¼å¹¶ä¸ä»£è¡¨ä»æ¬¾æå |
| | | console.log(res) |
| | | uni.navigateTo({ |
| | | url: '/pages/withdrawal-successful/withdrawal-successful' |
| | | }) |
| | | }, |
| | | fail: (res) => { |
| | | console.log("22222222222222",res) |
| | | uni.showToast({ |
| | | title:'对ä¸èµ·ï¼æç°å¤±è´¥ã'+res.err_msg |
| | | }) |
| | | }, |
| | | }); |
| | | /* WeixinJSBridge.invoke('requestMerchantTransfer',param, |
| | | function (res) { |
| | | if (res.err_msg === 'requestMerchantTransfer:ok') { |
| | | // res.err_msgå°å¨é¡µé¢å±ç¤ºæååè¿ååºç¨æ¶è¿åsuccessï¼å¹¶ä¸ä»£è¡¨ä»æ¬¾æå |
| | | uni.navigateTo({ |
| | | url: '/pages/withdrawal-successful/withdrawal-successful' |
| | | }) |
| | | }else{ |
| | | uni.showToast({ |
| | | title:'对ä¸èµ·ï¼æç°å¤±è´¥ã'+res.err_msg |
| | | }) |
| | | } |
| | | } |
| | | ); */ |
| | | }, |
| | | submit() { |
| | | if(!this.canTransfer){ |
| | | uni.showToast({ |
| | | title:'æ¨çå¾®ä¿¡çæ¬è¿ä½ï¼è¯·æ´æ°è³ææ°çæ¬ä½¿ç¨è¯¥åè½ã' |
| | | }) |
| | | return; |
| | | } |
| | | if(this.changing1){ |
| | | return |
| | | } |
| | |
| | | } |
| | | this.changing1 = true |
| | | var that = this |
| | | var param ={amount:this.amount } |
| | | var param ={amount:this.amount,name:this.name } |
| | | that.$u.api.applyWithdrawal(param) |
| | | .then(res =>{ |
| | | if(res.code ===200){ |
| | | uni.navigateTo({ |
| | | url: '/pages/withdrawal-successful/withdrawal-successful' |
| | | }) |
| | | that.wxMerchantTransfer(res.data); |
| | | // uni.navigateTo({ |
| | | // url: '/pages/withdrawal-successful/withdrawal-successful' |
| | | // }) |
| | | } |
| | | }).finally(() => { |
| | | that.changing1 = false |
| | |
| | | openid: token || '', |
| | | |
| | | latitude: '', |
| | | longitude: '' |
| | | longitude: '', |
| | | address:'å®ä½ä¸' |
| | | }, |
| | | mutations: { |
| | | // è®¾ç½®å¯¼èªæ é«åº¦ |
| | |
| | | console.log(obj) |
| | | state.latitude = obj.latitude |
| | | state.longitude = obj.longitude |
| | | state.address = obj.address |
| | | console.log("=====================",obj) |
| | | }, |
| | | // æ¸
é¤ç¼åæ°æ® |
| | | empty(state) { |