| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.dao.business.vo.BikeUsageStatVO; |
| | | import com.doumee.dao.business.vo.DashboardVO; |
| | | import com.doumee.dao.business.vo.IncomeStatVO; |
| | | import com.doumee.dao.business.vo.PackageSourceStatVO; |
| | | import com.doumee.service.business.ReportService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | /** |
| | | * æ°æ®æ¥è¡¨(管ç端æ°å¢:è¿30天æ¶ç / 车è¾ä½¿ç¨æ
åµ / å¥é¤æ¥æº / 综åçæ¿)ã |
| | | * <p>ä¸åèå/æé®çº§æééå¶:æ @RequiresPermissions,ä»
å Shiro authc ç»å½æ ¡éªä¿æ¤,ç»å½åå°å³å¯è®¿é®ã |
| | | * <p>Service å¤ç¨ services 模å {@link ReportService}(ä¸ web 端 /web/report åæº)ã |
| | | * |
| | | * @author rk |
| | | * @date 2026/06/26 |
| | | */ |
| | | @Api(tags = "æ°æ®æ¥è¡¨(管ç端)") |
| | | @RestController |
| | | @RequestMapping("/business/report") |
| | | public class ReportController extends BaseController { |
| | | |
| | | @Autowired |
| | | private ReportService reportService; |
| | | |
| | | @ApiOperation("è¿30天æ¶çç»è®¡(ææ¥æ±ç¶å¾+累计+ç¯æ¯/忝)") |
| | | @GetMapping("/incomeStat30") |
| | | public ApiResponse<IncomeStatVO> incomeStat30() { |
| | | return ApiResponse.success(reportService.incomeStat30()); |
| | | } |
| | | |
| | | @ApiOperation("车è¾ä½¿ç¨æ
åµ:èªè¡è½¦/çµå¨è½¦åèªä½¿ç¨ä¸ä¸ç©ºé²æ°é") |
| | | @GetMapping("/bikeUsageStat") |
| | | public ApiResponse<BikeUsageStatVO> bikeUsageStat() { |
| | | return ApiResponse.success(reportService.bikeUsageStat()); |
| | | } |
| | | |
| | | @ApiOperation("å¥é¤é宿¥æº:æ¬æ/æ¬å¹´ç»´åº¦,æé³å
æ¢ä¸å°ç¨åºè´ä¹°æ°é") |
| | | @GetMapping("/packageSourceStat") |
| | | public ApiResponse<PackageSourceStatVO> packageSourceStat() { |
| | | return ApiResponse.success(reportService.packageSourceStat()); |
| | | } |
| | | |
| | | @ApiOperation("综åçæ¿:æ¬æ/æ¨æ¥/仿¥æ¶çä¸è®¢åæ°,è½¦è¾æ»æ°/使ç¨ä¸/空é²") |
| | | @GetMapping("/dashboard") |
| | | public ApiResponse<DashboardVO> dashboard() { |
| | | return ApiResponse.success(reportService.dashboard()); |
| | | } |
| | | } |
| | |
| | | import org.springframework.data.redis.core.RedisTemplate; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.InputStream; |
| | | import java.net.HttpURLConnection; |
| | | import java.net.URL; |
| | | import java.net.URLDecoder; |
| | |
| | | return objectId; |
| | | } |
| | | try { |
| | | HttpURLConnection conn = (HttpURLConnection) new URL(input).openConnection(); |
| | | conn.setInstanceFollowRedirects(true); |
| | | conn.setRequestMethod("GET"); |
| | | conn.setConnectTimeout(5000); |
| | | conn.setReadTimeout(5000); |
| | | conn.connect(); |
| | | String finalUrl = conn.getURL().toString(); |
| | | conn.disconnect(); |
| | | return extractObjectId(finalUrl); |
| | | // æå¨è·ééå®å:HttpURLConnection èªå¨éå®åä¸è·¨åè®®(httpâhttps)ä¸ getURL() æ´æ°ä¸ç¨³å®, |
| | | // æ¹ä¸ºé跳读å Location 头,æç»ä»è½å°é¿é¾éæå object_id |
| | | String current = input; |
| | | int maxRedirects = 5; |
| | | for (int i = 0; i < maxRedirects; i++) { |
| | | HttpURLConnection conn = (HttpURLConnection) new URL(current).openConnection(); |
| | | conn.setInstanceFollowRedirects(false); // æå¨è·é |
| | | conn.setRequestMethod("GET"); |
| | | conn.setRequestProperty("User-Agent", "Mozilla/5.0"); |
| | | conn.setConnectTimeout(5000); |
| | | conn.setReadTimeout(5000); |
| | | int code = conn.getResponseCode(); |
| | | String location = conn.getHeaderField("Location"); |
| | | // å¿
须读åå¹¶å
³éé误/è¾å
¥æµ,å¦åè¿æ¥èµæºæ³æ¼ |
| | | try (InputStream is = (code >= 400) ? conn.getErrorStream() : conn.getInputStream()) { |
| | | if (is != null) { |
| | | // ä¸éè¦å
容,ä»
æ¶è´¹æµä»¥éæ¾è¿æ¥ |
| | | byte[] buf = new byte[1024]; |
| | | while (is.read(buf) > 0) { |
| | | // drain |
| | | } |
| | | } |
| | | } |
| | | if (code == HttpURLConnection.HTTP_MOVED_PERM |
| | | || code == HttpURLConnection.HTTP_MOVED_TEMP |
| | | || code == HttpURLConnection.HTTP_SEE_OTHER |
| | | || code == 307 || code == 308) { |
| | | if (StringUtils.isBlank(location)) { |
| | | // éå®å使 Location,æ æ³ç»§ç» |
| | | return null; |
| | | } |
| | | current = location; |
| | | continue; |
| | | } |
| | | // ééå®å:ç¨æç» URL æå object_id |
| | | String resolved = location != null ? location : conn.getURL().toString(); |
| | | objectId = extractObjectId(resolved); |
| | | if (objectId == null) { |
| | | log.warn("è§£ææé³ç龿ªæåå° object_id,input={},final={}", input, resolved); |
| | | } |
| | | return objectId; |
| | | } |
| | | log.warn("è§£ææé³çé¾è¶
è¿æå¤§éå®å次æ°,input={}", input); |
| | | return null; |
| | | } catch (Exception e) { |
| | | log.error("è§£ææé³çé¾å¼å¸¸:{}", input, e); |
| | | return null; |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.core.douyin.dto; |
| | | |
| | | import com.doumee.dao.business.model.Discount; |
| | | import com.doumee.dao.business.model.DouyinProduct; |
| | | import lombok.AllArgsConstructor; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * æé³å¸æ ¸éåæ ¡éªç»æ:æ¿è½½ skuId 忥å°çæé³åå + ç»å®çæ¬å°å¥é¤ã |
| | | * <p>scanVerify 卿 ¸éåæ ¡éªæ¶ä¸æ¬¡æ§æ¥åº,è·¨å±éä¼ ç» verify å¼å¡,é¿å
é夿¥è¯¢ã |
| | | * |
| | | * @author rk |
| | | * @date 2026/06/26 |
| | | */ |
| | | @Data |
| | | @AllArgsConstructor |
| | | public class DouyinBoundProduct { |
| | | /** æé³åå(ç¨äºåå¡«æ ¸éè®°å½çååå¿«ç
§:productId/productName) */ |
| | | private DouyinProduct product; |
| | | /** ç»å®çæ¬å°å¥é¤(ç¨äºå¼éå¥é¤å¡:discountMember æ·è´æº) */ |
| | | private Discount discount; |
| | | } |
| | |
| | | @ApiModelProperty(value = "å¸ç ææ(æå¨è¾å
¥åºæ¯),ä¸ qrContent äºéä¸") |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "æ ¸éæé³é¨åºID", required = true) |
| | | @ApiModelProperty(value = "æ ¸éæé³é¨åºID") |
| | | private String poiId; |
| | | } |
| | |
| | | request.setSubMchid(WxMiniConfig.wxProperties.getSubMchId()); |
| | | request.setNotifyUrl(WxMiniConfig.wxProperties.getRefundNotifyUrl()); |
| | | AmountReq amountReq = new AmountReq(); |
| | | amountReq.setTotal(refundDTO.getTotalAmount().longValue()); |
| | | amountReq.setRefund(refundDTO.getRefundAmount().longValue()); |
| | | amountReq.setTotal(1L);//refundDTO.getTotalAmount().longValue()); |
| | | amountReq.setRefund(1L);//refundDTO.getRefundAmount().longValue()); |
| | | amountReq.setCurrency("CNY"); |
| | | request.setAmount(amountReq); |
| | | try { |
| | |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å·²å é¤ 0æªå é¤ 1å·²å é¤") |
| | | private Integer isdeleted; |
| | | |
| | | /** æ ¸éå¼éçå¥é¤å¡è¯¦æ
(éæ°æ®åºå段,scanVerify è¿åæ¶é带,ä¾å端å±ç¤ºå¥é¤ä¿¡æ¯) */ |
| | | @com.baomidou.mybatisplus.annotation.TableField(exist = false) |
| | | private DiscountMember packageInfo; |
| | | } |
| | |
| | | |
| | | @ApiModelProperty(value = "æ¶å
¥éé¢(å
)") |
| | | private BigDecimal income; |
| | | |
| | | @ApiModelProperty(value = "该车åçè½¦è¾æ°é(bikes 表æªå é¤)") |
| | | private Long bikeCount; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * 车è¾ä½¿ç¨æ
åµ VO(管ç端æ¥è¡¨:èªè¡è½¦/çµå¨è½¦ à 使ç¨ä¸/空é²)ã |
| | | * <p>å£å¾:bikes æªå é¤è½¦è¾,type=0 èªè¡è½¦ / 1 çµå¨è½¦; |
| | | * status=0 ç©ºé² / 1 使ç¨ä¸,3 ç¦ç¨è½¦è¾ä¸è®¡å
¥ã |
| | | * |
| | | * @author rk |
| | | * @date 2026/06/26 |
| | | */ |
| | | @Data |
| | | @ApiModel("车è¾ä½¿ç¨æ
åµ") |
| | | public class BikeUsageStatVO { |
| | | |
| | | @ApiModelProperty(value = "èªè¡è½¦ç©ºé²æ°é(status=0)") |
| | | private Long bikeIdle; |
| | | |
| | | @ApiModelProperty(value = "èªè¡è½¦ä½¿ç¨ä¸æ°é(status=1)") |
| | | private Long bikeInUse; |
| | | |
| | | @ApiModelProperty(value = "çµå¨è½¦ç©ºé²æ°é(status=0)") |
| | | private Long eleBikeIdle; |
| | | |
| | | @ApiModelProperty(value = "çµå¨è½¦ä½¿ç¨ä¸æ°é(status=1)") |
| | | private Long eleBikeInUse; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * 综åçæ¿ VO(管ç端æ¥è¡¨:æ¶ç + è®¢åæ° + è½¦è¾ + å®¢æ·æ°)ã |
| | | * <p>å£å¾: |
| | | * <ul> |
| | | * <li>æ¶ç:goodsorder type=0 æ¼é + status=4 å·²ç»ç® ç closeMoney ä¹å(åâå
),å incomeStat</li> |
| | | * <li>è®¢åæ°:goodsorder payStatus=1 å·²æ¯ä»è®¢å计æ°</li> |
| | | * <li>车è¾:æªå é¤è½¦è¾æ»æ°</li> |
| | | * <li>å®¢æ·æ°:æ»ä¼å=æªå é¤å
¨é¨;仿¥/æ¨æ¥æ°å¢æ member.create_date è½å¨å¯¹åºåºé´</li> |
| | | * </ul> |
| | | * |
| | | * @author rk |
| | | * @date 2026/06/26 |
| | | */ |
| | | @Data |
| | | @ApiModel("综åçæ¿") |
| | | public class DashboardVO { |
| | | |
| | | // ---------------- æ¶ç(å
) ---------------- |
| | | |
| | | @ApiModelProperty(value = "æ¬ææ¶ç(å
)") |
| | | private BigDecimal monthIncome; |
| | | |
| | | @ApiModelProperty(value = "æ¨æ¥æ¶ç(å
)") |
| | | private BigDecimal yesterdayIncome; |
| | | |
| | | @ApiModelProperty(value = "仿¥æ¶ç(å
)") |
| | | private BigDecimal todayIncome; |
| | | |
| | | // ---------------- è®¢åæ° ---------------- |
| | | |
| | | @ApiModelProperty(value = "æ¬æè®¢åæ°(å·²æ¯ä»)") |
| | | private Long monthOrderCount; |
| | | |
| | | @ApiModelProperty(value = "æ¨æ¥è®¢åæ°(å·²æ¯ä»)") |
| | | private Long yesterdayOrderCount; |
| | | |
| | | @ApiModelProperty(value = "仿¥è®¢åæ°(å·²æ¯ä»)") |
| | | private Long todayOrderCount; |
| | | |
| | | // ---------------- è½¦è¾ ---------------- |
| | | |
| | | @ApiModelProperty(value = "è½¦è¾æ»æ°(æªå é¤)") |
| | | private Long totalBikeCount; |
| | | |
| | | // ---------------- å®¢æ·æ° ---------------- |
| | | |
| | | @ApiModelProperty(value = "å®¢æ·æ»æ°(æªå é¤ä¼åæ»æ°)") |
| | | private Long totalMemberCount; |
| | | |
| | | @ApiModelProperty(value = "æ¨æ¥æ°å¢å®¢æ·(create_date è½å¨æ¨æ¥)") |
| | | private Long yesterdayNewMember; |
| | | |
| | | @ApiModelProperty(value = "仿¥æ°å¢å®¢æ·(create_date â¥ ä»æ¥0ç¹)") |
| | | private Long todayNewMember; |
| | | } |
| | |
| | | @ApiModelProperty(value = "å
æ¢äºº(member.name,æ ¸éæä½äºº=è´ä¹°ä¼åæ¬äºº)") |
| | | private String exchangerName; |
| | | |
| | | @ApiModelProperty(value = "å¥é¤ä½¿ç¨æ¬¡æ°(该å¥é¤å¡å
³èç member_rides è®°å½æ°;0=æªä½¿ç¨)") |
| | | private Long useCount; |
| | | |
| | | @ApiModelProperty(value = "ç¶æææ¡(å·²å
æ¢/å·²æ¤é/æ ¸é失败)") |
| | | private String statusName; |
| | | } |
| ¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.vo; |
| | | |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | /** |
| | | * å¥é¤é宿¥æºç»è®¡ VO(管ç端æ¥è¡¨:æ¬æ/æ¬å¹´ à æé³å
æ¢/å°ç¨åºè´ä¹°)ã |
| | | * <p>å£å¾:goodsorder type=1 å¥é¤å¡è´ä¹°ãpayStatus=1 å·²æ¯ä»; |
| | | * æé³å
æ¢ = payWay 2,å°ç¨åºè´ä¹° = payWay 0(微信);æ pay_date é宿¬æ/æ¬å¹´ã |
| | | * |
| | | * @author rk |
| | | * @date 2026/06/26 |
| | | */ |
| | | @Data |
| | | @ApiModel("å¥é¤é宿¥æºç»è®¡") |
| | | public class PackageSourceStatVO { |
| | | |
| | | @ApiModelProperty(value = "æ¬æå¥é¤é宿¥æº") |
| | | private PeriodCount month; |
| | | |
| | | @ApiModelProperty(value = "æ¬å¹´å¥é¤é宿¥æº") |
| | | private PeriodCount year; |
| | | |
| | | /** |
| | | * åä¸ªæ¶æ®µçå¥é¤é宿¥æºè®¡æ°(æé³å
æ¢ / å°ç¨åºè´ä¹°)ã |
| | | */ |
| | | @Data |
| | | @ApiModel("å¥é¤é宿¥æºè®¡æ°") |
| | | public static class PeriodCount { |
| | | @ApiModelProperty(value = "æé³å
æ¢æ°é(payWay=2)") |
| | | private Long douyinCount; |
| | | |
| | | @ApiModelProperty(value = "å°ç¨åºè´ä¹°æ°é(payWay=0 微信)") |
| | | private Long miniCount; |
| | | } |
| | | } |
| | |
| | | @ApiModelProperty(value = "鿬¾éé¢") |
| | | private BigDecimal money; |
| | | |
| | | @ApiModelProperty(value = "鿬¾éé¢") |
| | | @ApiModelProperty(value = "鿬¾è¯´æ") |
| | | private String reason; |
| | | |
| | | @ApiModelProperty(value = "å¥é¤å¡é款类å 0éè´§éæ¬¾ 1ä»
鿬¾") |
| | |
| | | |
| | | import com.doumee.dao.business.model.Ad; |
| | | import com.doumee.dao.business.model.Discount; |
| | | import com.doumee.dao.business.model.DiscountMember; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | |
| | | @ApiModelProperty(value = "çµè½¦è¿è¥åºå") |
| | | private String eleBusinessArea; |
| | | |
| | | @ApiModelProperty(value = "å½åä¼åææå¥é¤(æå¤10æ¡,æè·å¾æ¶é´ååº)") |
| | | private List<DiscountMember> validDiscountList; |
| | | |
| | | |
| | | } |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.douyin.dto.DouyinBaseResp; |
| | | import com.doumee.core.douyin.dto.DouyinBoundProduct; |
| | | import com.doumee.core.douyin.dto.DouyinCancelParam; |
| | | import com.doumee.core.douyin.dto.DouyinPrepareParam; |
| | | import com.doumee.core.douyin.dto.DouyinPrepareResp; |
| | |
| | | DouyinVerifyRecord verify(DouyinVerifyParam param, String operator); |
| | | |
| | | /** |
| | | * éªå¸(æ ¸é),使ç¨è°ç¨æ¹å·²æ ¡éªå¥½çå¥é¤ç»å®ç»æ(scanVerify æ ¸éåæ ¡éªåè°ç¨)ã |
| | | * <p>æ ¸éæååç´æ¥ç¨ boundProduct å¼éå¥é¤,ä¸åé夿¥è¯¢åå/å¥é¤ã |
| | | * @param param æ ¸éå
¥å |
| | | * @param operator æä½äººID |
| | | * @param boundProduct æ ¸éåå·²æ ¡éªçæé³åå + æ¬å°å¥é¤(scanVerify ä¼ å
¥) |
| | | */ |
| | | DouyinVerifyRecord verify(DouyinVerifyParam param, String operator, DouyinBoundProduct boundProduct); |
| | | |
| | | /** |
| | | * æ ¸éåæ ¡éª:æ skuId æ ¡éªæé³ååå¨åºä¸å·²ç»å®æææ¬å°å¥é¤ã |
| | | * <p>scanVerify 卿 ¸éåè°ç¨,失败æä¸å¡å¼å¸¸(å¸å°æªæ ¸é,é¿å
æé³å·²æ ¸é使¬å°æªå¼å¡çä¸ä¸è´)ã |
| | | * @param skuId æ ¸éå¸å¯¹åºçæé³ SKU ID |
| | | * @return æé³åå + ç»å®çæ¬å°å¥é¤(ä¾ verify å¼å¡å¤ç¨) |
| | | */ |
| | | DouyinBoundProduct resolveBoundProduct(String skuId); |
| | | |
| | | /** |
| | | * æ¤éæ ¸é(æ ¸éå 1 å°æ¶å
),æ´æ°è®°å½æ¤éç¶æ |
| | | * @param operator æä½äººID(ç±è°ç¨ç«¯ä¼ å
¥,web 端åç»å½ä¼åID) |
| | | */ |
| | | DouyinVerifyRecord cancel(DouyinCancelParam param, String operator); |
| | | |
| | | /** |
| | | * æ discountMemberId æå¥é¤å¡è¯¦æ
å¡«å° record.packageInfo(scanVerify å±ç¤ºç¨)ã |
| | | * <p>æ å¥é¤å¡IDææ¥ä¸å°æ¶,packageInfo ç½® null,ä¸å½±å主æµç¨ã |
| | | * |
| | | * @param record æ ¸éè®°å½(å« discountMemberId) |
| | | */ |
| | | void fillPackageInfo(DouyinVerifyRecord record); |
| | | |
| | | /** |
| | | * æ ¸éè®°å½å页(web 端å°ç¨åºèªç¨,ç®åå页) |
| | | */ |
| | | PageData<DouyinVerifyRecord> findPage(PageWrap<DouyinVerifyRecord> pageWrap); |
| | |
| | | void forceCloseGoodsorder(String orderId); |
| | | |
| | | /** |
| | | * 鿬¾ |
| | | * 鿬¾(ç»å½äººä» Shiro ä¸ä¸æå,platform 端ç¨) |
| | | */ |
| | | void backGoodsorder(GoodsorderBackDTO goodsorderBackDTO); |
| | | |
| | | /** |
| | | * 鿬¾(ç»å½äººç±è°ç¨æ¹ä¼ å
¥,web 端 JWT åºæ¯ç¨,creator=ç»å®ç管çåID) |
| | | * @param goodsorderBackDTO 鿬¾å
¥å |
| | | * @param creator æä½äººID(鿬¾å + å¥é¤æä½æ¥å¿ç creator) |
| | | */ |
| | | void backGoodsorder(GoodsorderBackDTO goodsorderBackDTO, String creator); |
| | | List<MemberRides> getMemberRidesForClose(String orderid ); |
| | | /** |
| | | * è·åå¯éæ¬¾ä¿¡æ¯ |
| | |
| | | AccountResponse wxPhone(WxPhoneRequest wxPhoneRequest); |
| | | |
| | | UserResponse getUserInfo(String memberId); |
| | | |
| | | /** |
| | | * éåºç»å½:æ¸
空å½åä¼åææºå·(置空串)ã |
| | | * <p>JWT æ ç¶æ,æ æ³åé token;æ¸
phone åä¼ååå°æªææææºå·ç¶æ, |
| | | * 䏿¬¡è¿å
¥ééæ° wxLogin + wxPhoneã |
| | | * |
| | | * @param memberId ä¼åID |
| | | */ |
| | | void clearPhone(String memberId); |
| | | } |
| | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.douyin.DouyinClient; |
| | | import com.doumee.core.douyin.dto.DouyinBaseResp; |
| | | import com.doumee.core.douyin.dto.DouyinBoundProduct; |
| | | import com.doumee.core.douyin.dto.DouyinCancelParam; |
| | | import com.doumee.core.douyin.dto.DouyinCancelReq; |
| | | import com.doumee.core.douyin.dto.DouyinCancelResp; |
| | |
| | | */ |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public DouyinVerifyRecord verify(DouyinVerifyParam param, String operator) { |
| | | public DouyinVerifyRecord verify(DouyinVerifyParam param, String operator, DouyinBoundProduct boundProduct) { |
| | | // å
¥åæ ¡éª |
| | | if (param == null || StringUtils.isBlank(param.getVerifyToken())) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "verifyToken ä¸è½ä¸ºç©º"); |
| | |
| | | if (StringUtils.isBlank(param.getSkuId())) { |
| | | // æ skuId åæ æ³åæ¥å¥é¤(æ ¸éè¿åæ¬èº«ä¸å«ååæ è¯),ç´æ¥æ¦æª |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "skuId ä¸è½ä¸ºç©º"); |
| | | } |
| | | if (boundProduct == null || boundProduct.getProduct() == null || boundProduct.getDiscount() == null) { |
| | | // å
åº:å¥é¤ç»å®ç»æç¼ºå¤±(scanVerify åºå·²æ ¡éª,è¿éé² NPE) |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æªæ¾å°è¯¥å¸å¯¹åºçæ¬å°å¥é¤,请å
å¨ç®¡ç端ç»å®"); |
| | | } |
| | | Date now = new Date(); |
| | | |
| | |
| | | } |
| | | |
| | | // æ ¸éæå:为å½åç»å½äººå¼éå¥é¤(任䏿¥å¤±è´¥ â æ´ååæ») |
| | | openDiscountForVerify(rec, param, operator); |
| | | // 注:scanVerify 已卿 ¸éåæ ¡éªè¿å¥é¤ç»å®å¹¶éä¼ ç»æ,è¿éä¸åé夿¥è¯¢ |
| | | openDiscountForVerify(rec, param, boundProduct, operator); |
| | | return rec; |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public DouyinVerifyRecord verify(DouyinVerifyParam param, String operator) { |
| | | // æ 颿 ¡éªç»æçå
¼å®¹å
¥å£:æ ¸éåå
æ ¡éªå¥é¤ç»å®(æ ¸éå¨ä½å¨éè½½å
宿) |
| | | return verify(param, operator, resolveBoundProduct(param.getSkuId())); |
| | | } |
| | | |
| | | /** |
| | |
| | | * |
| | | * @param rec æ ¸éè®°å½(å« originCode/certificateId çæé³æ è¯,å¼éååå¡«å¥é¤å¡ID) |
| | | * @param param æ ¸éå
¥å(å« skuId 忥å¥é¤ãpayAmount å¿«ç
§) |
| | | * @param boundProduct æ ¸éåå·²æ ¡éªçæé³åå + æ¬å°å¥é¤(é¿å
é夿¥è¯¢) |
| | | * @param operator æä½äºº = å¥é¤å½å±äºº(web 端ç»å½ä¼å id) |
| | | */ |
| | | private void openDiscountForVerify(DouyinVerifyRecord rec, DouyinVerifyParam param, String operator) { |
| | | // â 忥å¥é¤:skuId â douyin_product_sku â product_id â douyin_product.out_id â discount |
| | | DouyinProduct product = resolveProduct(param.getSkuId()); |
| | | Discount discount = resolveDiscount(product); |
| | | private void openDiscountForVerify(DouyinVerifyRecord rec, DouyinVerifyParam param, |
| | | DouyinBoundProduct boundProduct, String operator) { |
| | | // åå + å¥é¤å·²ç± scanVerify æ ¸éåæ ¡éª(resolveBoundProduct)æ¥åºå¹¶éä¼ ,ç´æ¥ä½¿ç¨ |
| | | DouyinProduct product = boundProduct.getProduct(); |
| | | Discount discount = boundProduct.getDiscount(); |
| | | |
| | | Date now = new Date(); |
| | | |
| | | // â¡ é²é:åä¸å¸ç å·²ä¸ºè¯¥ç¨æ·å¼è¿å¥é¤å¡åè·³è¿(é¿å
é夿 ¸ééå¼) |
| | | // â¡ é²é:åä¸å¸ç å·²ä¸ºè¯¥ç¨æ·å¼è¿ãæ£å¸¸ãå¥é¤å¡åè·³è¿(é¿å
é夿 ¸ééå¼)ã |
| | | // 注æ:å·²ä½åº(status=1,妿¤éæ ¸éå)çå¡ä¸åä¸é²éââæ¤éåéæ°æ ¸éåºæ£å¸¸å¼æ°å¡ã |
| | | DiscountMember existCard = discountMemberMapper.selectOne(new QueryWrapper<DiscountMember>().lambda() |
| | | .eq(DiscountMember::getCode, rec.getOriginCode()) |
| | | .eq(DiscountMember::getMemberId, operator) |
| | | .eq(DiscountMember::getStatus, Constants.ZERO) |
| | | .eq(DiscountMember::getIsdeleted, Constants.ZERO) |
| | | .last("limit 1")); |
| | | if (existCard != null) { |
| | |
| | | private Discount resolveDiscount(DouyinProduct product) { |
| | | Discount discount = discountMapper.selectOne(new QueryWrapper<Discount>().lambda() |
| | | .eq(Discount::getId, product.getOutId()) |
| | | .eq(Discount::getStatus, Constants.ZERO) |
| | | .eq(Discount::getIsdeleted, Constants.ZERO) |
| | | .last("limit 1")); |
| | | if (discount == null) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æªæ¾å°è¯¥å¸å¯¹åºçæ¬å°å¥é¤,请å
å¨ç®¡ç端ç»å®"); |
| | | } |
| | | return discount; |
| | | } |
| | | |
| | | @Override |
| | | public DouyinBoundProduct resolveBoundProduct(String skuId) { |
| | | if (StringUtils.isBlank(skuId)) { |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "skuId ä¸è½ä¸ºç©º"); |
| | | } |
| | | // å¤ç¨æ¢ææ ¡éªé¾è·¯:skuId â æé³åå(å¨åº + å·²ç» out_id)â æ¬å°å¥é¤(ææ) |
| | | DouyinProduct product = resolveProduct(skuId); |
| | | Discount discount = resolveDiscount(product); |
| | | return new DouyinBoundProduct(product, discount); |
| | | } |
| | | |
| | | @Override |
| | |
| | | rec.setRawResponse(respText); |
| | | // æ¤é失败:æ´æ°è®°å½æè¿°åæåº(è®°å½ä¿çåæ ¸éç¶æ) |
| | | if (!ok) { |
| | | // 失败åå :ä¼å
extra.description,æ sub_description æ¶è¿½å (sub_description æ´å
·ä½) |
| | | String desc = resp == null || resp.getExtra() == null ? "æ ååº" : resp.getExtra().getDescription(); |
| | | rec.setCancelMsg("æ¤é失败:" + desc); |
| | | String subDesc = resp == null || resp.getExtra() == null ? null : resp.getExtra().getSubDescription(); |
| | | String failMsg = StringUtils.isBlank(subDesc) ? desc : desc + ";" + subDesc; |
| | | rec.setCancelMsg("æ¤é失败:" + failMsg); |
| | | douyinVerifyRecordMapper.updateById(rec); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æ¤é失败:" + desc); |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "æ¤é失败:" + failMsg); |
| | | } |
| | | // æ¤éæå:ç½®æ¤éç¶æãæ¤éæ¶é´ä¸æ¤é人 |
| | | rec.setCancelStatus(Constants.DOUYIN_VERIFY_CANCEL_STATUS.DONE.getKey()); |
| | |
| | | // 忥ä½åºæ¬å°å·²å¼éçå¥é¤å¡(鲿¢æé³æ¤éåå¥é¤ä»è¢«ä½¿ç¨);åç
§ backGoodsorder éå¡ |
| | | cancelDiscountMember(rec, operator, now); |
| | | return rec; |
| | | } |
| | | |
| | | @Override |
| | | public void fillPackageInfo(DouyinVerifyRecord record) { |
| | | // æ å¥é¤å¡IDææ¥ä¸å°æ¶ç½® null,ä¸å½±å主æµç¨(scanVerify ç¨äºå端å±ç¤ºå¥é¤ä¿¡æ¯) |
| | | if (record == null || StringUtils.isBlank(record.getDiscountMemberId())) { |
| | | return; |
| | | } |
| | | record.setPackageInfo(discountMemberMapper.selectById(record.getDiscountMemberId())); |
| | | } |
| | | |
| | | /** |
| | |
| | | .selectAs(DouyinProduct::getCategory, DouyinVerifyRecordPageVO::getCategory) |
| | | // æé³å¸å:discount_member.name(æ¬å°å¼éå¥é¤å) |
| | | .selectAs(DiscountMember::getName, DouyinVerifyRecordPageVO::getCouponName) |
| | | // å¥é¤ä½¿ç¨æ¬¡æ°:åæ¥è¯¢ç»è®¡è¯¥å¥é¤å¡å¨ member_rides çéªè¡è®°å½æ°(t 为主表 douyin_verify_record) |
| | | .select(" ( select count(1) from member_rides where discount_member_id = t.discount_member_id and isdeleted = 0 ) ", DouyinVerifyRecordPageVO::getUseCount) |
| | | // ä¸è¡¨ leftJoin:discount_member(ç» discount_member_id)â member(ç» member_id);douyin_product(ç» product_id) |
| | | .leftJoin(DiscountMember.class, DiscountMember::getId, DouyinVerifyRecord::getDiscountMemberId) |
| | | .leftJoin(Member.class, Member::getId, DiscountMember::getMemberId) |
| | |
| | | } |
| | | } |
| | | } |
| | | // å½åä¼åææå¥é¤(status=0 æ£å¸¸ + isdeleted=0),æè·å¾æ¶é´(createDate)ååº,æå¤10æ¡ |
| | | homeResponse.setValidDiscountList(discountMemberMapper.selectList(new QueryWrapper<DiscountMember>().lambda() |
| | | .eq(DiscountMember::getMemberId, memberId) |
| | | .eq(DiscountMember::getStatus, Constants.ZERO) |
| | | .eq(DiscountMember::getIsdeleted, Constants.ZERO) |
| | | .orderByDesc(DiscountMember::getCreateDate) |
| | | .last(" limit 10 "))); |
| | | return homeResponse; |
| | | } |
| | | |
| | |
| | | |
| | | @Override |
| | | public void backGoodsorder(GoodsorderBackDTO goodsorderBackDTO) { |
| | | // platform 端:ç»å½äººä» Shiro ä¸ä¸æå,å§æç»å¸¦ creator çéè½½æ¹æ³ |
| | | LoginUserInfo principal = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | if (Objects.isNull(principal) || StringUtils.isBlank(principal.getId())) { |
| | | throw new BusinessException(ResponseStatus.BE_OVERDUE); |
| | | } |
| | | backGoodsorder(goodsorderBackDTO, principal.getId()); |
| | | } |
| | | |
| | | @Override |
| | | public void backGoodsorder(GoodsorderBackDTO goodsorderBackDTO, String creator) { |
| | | if(Objects.isNull(goodsorderBackDTO) |
| | | || StringUtils.isBlank(goodsorderBackDTO.getOrderId()) |
| | | || Objects.isNull(goodsorderBackDTO.getBackType()) |
| | |
| | | refundDTO.setRefundAmount(goodsorderBackDTO.getMoney().multiply(new BigDecimal(100))); |
| | | refundDTO.setTotalAmount(goodsorder.getMoney()); |
| | | refundDTO.setMemberId(goodsorder.getMemberId()); |
| | | refundDTO.setCreator(principal.getId()); |
| | | refundDTO.setCreator(creator); |
| | | refundDTO.setReason(goodsorderBackDTO.getReason()); |
| | | refundDTO.setType(Constants.REFUND_TYPE.BACK.getKey()); |
| | | //éè´§éæ¬¾ æ¥çå¥é¤è®¢åç¶æ æ´æ°è®¢åä¿¡æ¯ |
| | |
| | | //æä½æ¥å¿ |
| | | DiscountLog discountLog = new DiscountLog(); |
| | | discountLog.setIsdeleted(Constants.ZERO); |
| | | discountLog.setCreator(principal.getId()); |
| | | discountLog.setCreator(creator); |
| | | discountLog.setCreateDate(new Date()); |
| | | discountLog.setDiscountMemberId(discountMember.getId()); |
| | | discountLog.setType(Constants.ONE); |
| | |
| | | request.setOutTradeNo(goodsorder.getId()); |
| | | request.setNotifyUrl(WxMiniConfig.wxProperties.getNotifyUrl());//è¿ä¸ªåè°urlå¿
é¡»æ¯httpså¼å¤´ç |
| | | Amount amount = new Amount(); |
| | | amount.setTotal(goodsorder.getMoney().intValue()); |
| | | amount.setTotal(1);//goodsorder.getMoney().intValue()); |
| | | request.setAmount(amount); |
| | | // PrepayResponse res = WxMiniConfig.wxPayService.prepay(request); |
| | | // è·ä¹åä¸å示ä¾ä¸æ ·ï¼å¡«å
é¢ä¸ååæ° |
| | |
| | | return userResponse; |
| | | } |
| | | |
| | | @Override |
| | | public void clearPhone(String memberId) { |
| | | // éåºç»å½:æ¸
空ä¼åææºå·(置空串),ä¿çå
¶ä»ä¿¡æ¯(å« sysuser ç»å®) |
| | | memberMapper.update(null, new UpdateWrapper<Member>().lambda() |
| | | .set(Member::getPhone, StringUtils.EMPTY) |
| | | .eq(Member::getId, memberId)); |
| | | } |
| | | |
| | | |
| | | } |
| | |
| | | incomeByParam.merge(o.getParamId(), amount, BigDecimal::add); |
| | | } |
| | | |
| | | // 5. ç»è£
ç»æ:车åå + 大类 + æ¶å
¥(åâå
,2ä½),ææ¶å
¥éåº |
| | | // 5. æ paramId ç»è®¡æ¯ç±»è½¦åçè½¦è¾æ°é(bikes 表æªå é¤),䏿¬¡åç»æ¥è¯¢é¿å
N 次 count |
| | | Map<String, Long> bikeCountByParam; |
| | | if (incomeByParam.isEmpty()) { |
| | | // æ ææ¶å
¥çè½¦åæ¶è·³è¿æ¥è¯¢:空éåä¼ ç» in() ä¼çæ "IN ()",PostgreSQL è¯æ³é误 |
| | | bikeCountByParam = Collections.emptyMap(); |
| | | } else { |
| | | bikeCountByParam = bikesMapper.selectList( |
| | | new QueryWrapper<Bikes>().lambda() |
| | | .select(Bikes::getParamId) |
| | | .eq(Bikes::getIsdeleted, Constants.ZERO) |
| | | .in(Bikes::getParamId, incomeByParam.keySet())) |
| | | .stream() |
| | | .filter(b -> b.getParamId() != null) |
| | | .collect(Collectors.groupingBy(Bikes::getParamId, Collectors.counting())); |
| | | } |
| | | |
| | | // 6. ç»è£
ç»æ:车åå + 大类 + æ¶å
¥(åâå
,2ä½)+ è½¦è¾æ°,ææ¶å
¥éåº |
| | | List<BikeIncomeStatVO> result = new ArrayList<>(); |
| | | for (Map.Entry<String, BigDecimal> e : incomeByParam.entrySet()) { |
| | | BaseParam param = paramMap.get(e.getKey()); |
| | |
| | | vo.setParamName(param == null ? "æªç¥è½¦å" : param.getName()); |
| | | vo.setCategory(param == null ? "æªç¥" : categoryOf(param.getType())); |
| | | vo.setIncome(e.getValue().divide(CENT_PER_YUAN, 2, BigDecimal.ROUND_HALF_UP)); |
| | | vo.setBikeCount(bikeCountByParam.getOrDefault(e.getKey(), 0L)); |
| | | result.add(vo); |
| | | } |
| | | result.sort(Comparator.comparing(BikeIncomeStatVO::getIncome).reversed()); |
| | |
| | | BigDecimal totalCents = BigDecimal.ZERO; |
| | | for (Goodsorder o : orders) { |
| | | BigDecimal amount = o.getCloseMoney() == null ? BigDecimal.ZERO : o.getCloseMoney(); |
| | | sumByDay.merge(DateUtil.getShortDateStr(o.getPayDate()), amount, BigDecimal::add); |
| | | sumByDay.merge(DateUtil.getDateLong(o.getPayDate()), amount, BigDecimal::add); |
| | | totalCents = totalCents.add(amount); |
| | | } |
| | | |
| | |
| | | List<IncomeDailyVO> dailyList = new ArrayList<>(); |
| | | for (Date d : DateUtil.getDateList(DateUtil.getStartOfDay(start), DateUtil.getStartOfDay(end))) { |
| | | IncomeDailyVO vo = new IncomeDailyVO(); |
| | | vo.setDate(DateUtil.getShortDateStr(d)); |
| | | vo.setDate(DateUtil.getDateLong(d)); |
| | | BigDecimal daySum = sumByDay.getOrDefault(vo.getDate(), BigDecimal.ZERO); |
| | | // åâå
,2ä½å°æ° |
| | | vo.setIncome(daySum.divide(CENT_PER_YUAN, 2, BigDecimal.ROUND_HALF_UP)); |
| | |
| | | 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 |
| | | notifyUrl: https://test.doumee.cn/bikeWeb/api/wxPayNotify |
| | | refundNotifyUrl: https://test.doumee.cn/bikeWeb/api/wxRefundNotify |
| | | keyPath: /usr/local/jars/bike/apiclient_cert.p12 |
| | | privateCertPath: /usr/local/jars/bike/apiclient_cert.pem |
| | | privateKeyPath: /usr/local/jars/bike/apiclient_key.pem |
| | | # keyPath: d://apiclient_cert.p12 |
| | | # privateCertPath: d://apiclient_cert.pem |
| | | # privateKeyPath: d://apiclient_key.pem |
| | | #æå¡å-------------end--- |
| | | existsSub: 1 |
| | | appSecret: 1ceb7c9dff3c4330d653adc3ca55ea24 |
| | |
| | | return ApiResponse.success("æ¥è¯¢æå",userResponse); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation(value = "éåºç»å½", notes = "æ¸
空å½åä¼åææºå·,䏿¬¡è¿å
¥ééæ°ææ") |
| | | @PostMapping("/logout") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse logout() { |
| | | // JWT æ ç¶æ,æ æ³åé token;æ¤å¤æ¸
空ä¼åææºå·,使å
¶åå°æªææææºå·ç¶æ |
| | | memberService.clearPhone(getMemberId()); |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "æµè¯çæäºç»´ç ", notes = "å°ç¨åºç«¯") |
| | | @GetMapping("/generateWXMiniCode") |
| | |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.douyin.DouyinClient; |
| | | import com.doumee.core.douyin.dto.DouyinBaseResp; |
| | | import com.doumee.core.douyin.dto.DouyinBoundProduct; |
| | | import com.doumee.core.douyin.dto.DouyinPrepareParam; |
| | | import com.doumee.core.douyin.dto.DouyinPrepareResp; |
| | | import com.doumee.core.douyin.dto.DouyinShopPoiResp; |
| | |
| | | import com.doumee.service.business.DouyinVerifyLogService; |
| | | import com.doumee.service.business.DouyinVerifyService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | @PreventRepeat |
| | | @ApiOperation("æ«ç 䏿¥æ ¸é(éªå¸åå¤ + æ ¸éåå¹¶;å端åªè°æ¤æ¥å£)") |
| | | @PostMapping("/scanVerify") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<DouyinVerifyRecord> scanVerify(@RequestBody DouyinPrepareParam param) { |
| | | String apiPath = "/web/douyin/scanVerify"; |
| | | String memberId = getMemberId(); |
| | |
| | | verifyParam.setSkuId(cert.getSku().getSkuId()); |
| | | verifyParam.setPayAmount(cert.getAmount() == null ? null : cert.getAmount().getPayAmount()); |
| | | |
| | | // â£ æ ¸é + å¼å¥é¤(åç¬è®°ä¸æ¡ VERIFY æ¥å¿) |
| | | // â£ æ ¸éåæ ¡éª:ååå¨åº + å·²ç»å®ææå¥é¤;å¤±è´¥ç´æ¥æ¦æª(å¸å°æªæ ¸é,é¿å
æé³å·²æ ¸é使¬å°æªå¼å¡) |
| | | DouyinBoundProduct boundProduct = douyinVerifyService.resolveBoundProduct(verifyParam.getSkuId()); |
| | | |
| | | // â¤ æ ¸é + å¼å¥é¤(åç¬è®°ä¸æ¡ VERIFY æ¥å¿) |
| | | long verifyStart = System.currentTimeMillis(); |
| | | DouyinVerifyLog verifyLog = baseLog(Constants.DOUYIN_VERIFY_OPERATE_TYPE.VERIFY.getKey(), apiPath, verifyStart); |
| | | verifyLog.setRawRequest(JSON.toJSONString(verifyParam)); |
| | | verifyLog.setPoiId(verifyParam.getPoiId()); |
| | | try { |
| | | DouyinVerifyRecord rec = douyinVerifyService.verify(verifyParam, memberId); |
| | | // éä¼ æ ¸éåæ ¡éªç»æ,verify å
ä¸åé夿¥è¯¢åå/å¥é¤ |
| | | DouyinVerifyRecord rec = douyinVerifyService.verify(verifyParam, memberId, boundProduct); |
| | | // éå¸¦æ¬æ¬¡å¼éçå¥é¤å¡è¯¦æ
(ä¾åç«¯æ ¸éåå±ç¤ºå¥é¤ä¿¡æ¯) |
| | | douyinVerifyService.fillPackageInfo(rec); |
| | | fillByRecord(verifyLog, rec); |
| | | return ApiResponse.success(rec); |
| | | } catch (Throwable e) { |
| | |
| | | @LoginRequired |
| | | @ApiOperation("æ ¸éè®°å½å页") |
| | | @PostMapping("/page") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<PageData<DouyinVerifyRecord>> findPage(@RequestBody PageWrap<DouyinVerifyRecord> pageWrap) { |
| | | return ApiResponse.success(douyinVerifyService.findPage(pageWrap)); |
| | | } |
| | |
| | | @LoginRequired |
| | | @ApiOperation("æ ¸éè®°å½è¯¦æ
") |
| | | @GetMapping("/{id}") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "header", dataType = "String", name = "token", value = "ç¨æ·tokenå¼", required = true), |
| | | }) |
| | | public ApiResponse<DouyinVerifyRecord> findById(@PathVariable String id) { |
| | | return ApiResponse.success(douyinVerifyService.findById(id)); |
| | | } |
| | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.*; |
| | | import com.doumee.dao.business.web.request.GoodsorderBackDTO; |
| | | import com.doumee.dao.business.web.request.GoodsorderCanBanlanceDTO; |
| | | import com.doumee.dao.business.web.response.UserResponse; |
| | | import com.doumee.dao.system.dto.WebLoginDTO; |
| | | import com.doumee.dao.system.model.SystemUser; |
| | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | private SystemLoginService systemLoginService; |
| | | @Autowired |
| | | private SystemUserService systemUserService; |
| | | /** 订å鿬¾/å¯éæ¬¾ä¿¡æ¯æ¥è¯¢(web 端 JWT åºæ¯) */ |
| | | @Autowired |
| | | private GoodsorderService goodsorderService; |
| | | @LoginRequired |
| | | @PreventRepeat(limit = 10, lockTime = 10000) |
| | | @ApiOperation("ç»å½ç®¡çåè´¦å·") |
| | |
| | | return ApiResponse.success(list); |
| | | } |
| | | |
| | | @LoginRequired |
| | | @ApiOperation("è·åå¯é款信æ¯") |
| | | @GetMapping("/getGoodsorderCanBanlanceDTO") |
| | | public ApiResponse<GoodsorderCanBanlanceDTO> getGoodsorderCanBanlanceDTO(@RequestParam String orderId) { |
| | | // ä»
æ¥è¯¢,æ ç»å½äººåå
¥;æ ¡éªç®¡çå |
| | | UserResponse user = this.getUserResponse(); |
| | | if (user.getSysuser() == null) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | } |
| | | return ApiResponse.success(goodsorderService.getGoodsorderCanBanlanceDTO(orderId)); |
| | | } |
| | | |
| | | @PreventRepeat |
| | | @LoginRequired |
| | | @ApiOperation("鿬¾") |
| | | @PostMapping("/backGoodsorder") |
| | | public ApiResponse backGoodsorder(@RequestBody GoodsorderBackDTO goodsorderBackDTO) { |
| | | // 鿬¾ä¸ºç®¡çåæä½:æ ¡éªå·²ç»å®ç³»ç»ç®¡çå,creator å sysuser.id(ä¸ platform Shiro å£å¾ä¸è´) |
| | | UserResponse user = this.getUserResponse(); |
| | | if (user.getSysuser() == null) { |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED); |
| | | } |
| | | if (Objects.nonNull(goodsorderBackDTO) && Objects.isNull(goodsorderBackDTO.getBackType())) { |
| | | goodsorderBackDTO.setBackType(Constants.ONE); |
| | | } |
| | | goodsorderService.backGoodsorder(goodsorderBackDTO, user.getSysuser().getId()); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | } |