0af7536b4ca6f01b292db2d3b60db7b88ebae33b..09ac251a089f5bb79d59a12bf2f932dda12c4ca2
2025-07-10 xin
小程序:微信授权登录;根据订单号查询订单操作日志
09ac25 diff | tree
2025-07-10 xin
审核退款订单
941c65 diff | tree
2025-07-10 xin
订单商品
f30342 diff | tree
2025-07-10 xin
短信验证码
c1bee2 diff | tree
1 files added
21 files modified
161 ■■■■ changed files
oying-system/src/main/java/com/oying/modules/security/rest/AuthController.java 12 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/security/rest/VerificationController.java 3 ●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/security/service/dto/AuthUserWeixinDto.java 4 ●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/domain/request/AuditOrderReturn.java 27 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/domain/request/ProductOrder.java 2 ●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/mapper/OrderOperationLogMapper.java 2 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/mapper/OrderReturnOperationLogMapper.java 2 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/rest/OrderOperationLogController.java 15 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/rest/OrderProductSnapshotController.java 2 ●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/rest/OrderReturnController.java 10 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/rest/OrderReturnOperationLogController.java 16 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/OrderOperationLogService.java 2 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/OrderReturnOperationLogService.java 2 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/OrderReturnService.java 3 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderOperationLogServiceImpl.java 5 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderReturnOperationLogServiceImpl.java 12 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderReturnServiceImpl.java 7 ●●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderServiceImpl.java 2 ●●● patch | view | raw | blame | history
oying-system/src/main/resources/config/application.yml 2 ●●● patch | view | raw | blame | history
oying-system/src/main/resources/mapper/sh/OrderMapper.xml 16 ●●●● patch | view | raw | blame | history
oying-system/src/main/resources/mapper/sh/OrderOperationLogMapper.xml 6 ●●●●● patch | view | raw | blame | history
oying-system/src/main/resources/mapper/sh/OrderReturnOperationLogMapper.xml 9 ●●●● patch | view | raw | blame | history
oying-system/src/main/java/com/oying/modules/security/rest/AuthController.java
@@ -147,22 +147,18 @@
    public static final String OLD = "OLD";
    public static final String NEW = "NEW";
    @Log("微信授权登录")
    @ApiOperation("微信授权登录")
    @Log("小程序:微信授权登录")
    @ApiOperation("小程序:微信授权登录")
    @AnonymousPostMapping(value = "/login/weixin")
    public ResponseEntity<Object> loginWeixin(@Validated @RequestBody AuthUserWeixinDto authUser, HttpServletRequest request) throws Exception {
        JSONObject jsonObject;
        switch (authUser.getCode()) {
        switch (authUser.getType()) {
            case OLD:
                jsonObject = weiXinService.code2Session(authUser.getCode());
                String openid = jsonObject.getString("openid");
                User userDto = userService.findByOpenid(openid);
                if (userDto == null) {
                    Map<String, Object> authInfo = new HashMap<String, Object>(2) {{
                        put("token", openid);
                        put("member", null);
                    }};
                    return ResponseEntity.ok(authInfo);
                    return ResponseEntity.ok(R.success(openid));
                }
                authUser.setUsername(userDto.getUsername());
                break;
oying-system/src/main/java/com/oying/modules/security/rest/VerificationController.java
@@ -39,12 +39,11 @@
    @ApiOperation("短信验证码")
    public ResponseEntity<Object> verification(@RequestParam String phone) {
        String uuid = key + IdUtil.simpleUUID();
        System.out.println(phone);
        //创建验证码
        String verification = (int) ((Math.random() * 9 + 1) * 100000) + "";
        redisUtils.set(uuid, verification, time);
        SendMessageUtils.sendMsg(properties.getUrlSendMsg(), phone, SendMessageUtils.SIGN,
                SendMessageUtils.MESSAGE.replace("{code}", verification), properties);
        redisUtils.set(uuid, verification, time);
        return ResponseEntity.ok(R.success(uuid));
    }
}
oying-system/src/main/java/com/oying/modules/security/service/dto/AuthUserWeixinDto.java
@@ -4,6 +4,8 @@
import lombok.Getter;
import lombok.Setter;
import javax.validation.constraints.NotBlank;
/**
 * @author xin
 * @description
@@ -17,8 +19,10 @@
    private String username;
    @ApiModelProperty(value = "微信code")
    @NotBlank
    private String code;
    @ApiModelProperty(value = "类型默认:OLD,注册:NEW",example = "OLD")
    @NotBlank
    private String type = "OLD";
}
oying-system/src/main/java/com/oying/modules/sh/domain/request/AuditOrderReturn.java
New file
@@ -0,0 +1,27 @@
package com.oying.modules.sh.domain.request;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.Setter;
import java.math.BigDecimal;
/**
 * @author xin
 * @description
 * @date 2025/7/9 20:59
 */
@Getter
@Setter
public class AuditOrderReturn {
    @ApiModelProperty(value = "退单号")
    private String returnNum;
    @ApiModelProperty(value = "审核状态")
    private String auditStatus;
    @ApiModelProperty(value = "备注")
    private String message;
    @ApiModelProperty(value = "金额")
    private BigDecimal amount;
}
oying-system/src/main/java/com/oying/modules/sh/domain/request/ProductOrder.java
@@ -14,7 +14,7 @@
public class ProductOrder {
    @ApiModelProperty(value = "商品ID")
    private String productId;
    private Long productId;
    @ApiModelProperty(value = "数量")
    private Integer count;
}
oying-system/src/main/java/com/oying/modules/sh/mapper/OrderOperationLogMapper.java
@@ -19,4 +19,6 @@
    IPage<OrderOperationLog> findAll(@Param("criteria") OrderOperationLogQueryCriteria criteria, Page<Object> page);
    List<OrderOperationLog> findAll(@Param("criteria") OrderOperationLogQueryCriteria criteria);
    List<OrderOperationLog> getByOrderNum(String orderNum);
}
oying-system/src/main/java/com/oying/modules/sh/mapper/OrderReturnOperationLogMapper.java
@@ -19,4 +19,6 @@
    IPage<OrderReturnOperationLog> findAll(@Param("criteria") OrderReturnOperationLogQueryCriteria criteria, Page<Object> page);
    List<OrderReturnOperationLog> findAll(@Param("criteria") OrderReturnOperationLogQueryCriteria criteria);
    List<OrderReturnOperationLog> getByReturnNum(String returnNum);
}
oying-system/src/main/java/com/oying/modules/sh/rest/OrderOperationLogController.java
@@ -1,7 +1,5 @@
package com.oying.modules.sh.rest;
import com.oying.annotation.Log;
import com.oying.modules.sh.domain.OrderOperationLog;
import com.oying.modules.sh.service.OrderOperationLogService;
import com.oying.modules.sh.domain.dto.OrderOperationLogQueryCriteria;
import com.oying.utils.R;
@@ -10,7 +8,6 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
@@ -46,12 +43,10 @@
        return new ResponseEntity<>(R.success(orderOperationLogService.queryAll(criteria, page)), HttpStatus.OK);
    }
    @PostMapping
    @Log("新增订单操作日志")
    @ApiOperation("新增订单操作日志")
    @PreAuthorize("@el.check('orderOperationLog:add')")
    public ResponseEntity<Object> createOrderOperationLog(@Validated @RequestBody OrderOperationLog resources) {
        orderOperationLogService.create(resources);
        return new ResponseEntity<>(R.success(), HttpStatus.CREATED);
    @GetMapping("getByOrderNum")
    @ApiOperation("根据订单号查询订单操作日志")
    @PreAuthorize("@el.check('orderOperationLog:list')")
    public ResponseEntity<Object> queryOrderOperationLog(@RequestParam String orderNum) {
        return new ResponseEntity<>(R.success(orderOperationLogService.getByOrderNum(orderNum)), HttpStatus.OK);
    }
}
oying-system/src/main/java/com/oying/modules/sh/rest/OrderProductSnapshotController.java
@@ -26,7 +26,7 @@
    private final OrderProductSnapshotService orderProductSnapshotService;
    @GetMapping
    @ApiOperation("查询订单商品快照")
    @ApiOperation("根据订单号查询订单商品快照")
    public ResponseEntity<Object> queryOrderProductSnapshot(@RequestParam String orderNum) {
        return new ResponseEntity<>(R.success(orderProductSnapshotService.queryOrderProductSnapshot(orderNum)), HttpStatus.OK);
    }
oying-system/src/main/java/com/oying/modules/sh/rest/OrderReturnController.java
@@ -2,6 +2,7 @@
import com.oying.annotation.Log;
import com.oying.modules.sh.domain.OrderReturn;
import com.oying.modules.sh.domain.request.AuditOrderReturn;
import com.oying.modules.sh.service.OrderReturnService;
import com.oying.modules.sh.domain.dto.OrderReturnQueryCriteria;
import com.oying.utils.R;
@@ -57,6 +58,15 @@
        return new ResponseEntity<>(R.success(), HttpStatus.CREATED);
    }
    @PutMapping("audit")
    @Log("审核退款订单")
    @ApiOperation("审核退款订单")
    @PreAuthorize("@el.check('orderReturn:edit')")
    public ResponseEntity<Object> audit(@Validated @RequestBody AuditOrderReturn resources) {
        orderReturnService.audit(resources);
        return new ResponseEntity<>(R.success(), HttpStatus.NO_CONTENT);
    }
    @PutMapping
    @Log("修改退款订单")
    @ApiOperation("修改退款订单")
oying-system/src/main/java/com/oying/modules/sh/rest/OrderReturnOperationLogController.java
@@ -1,14 +1,13 @@
package com.oying.modules.sh.rest;
import com.oying.annotation.Log;
import com.oying.modules.sh.domain.OrderReturnOperationLog;
import com.oying.modules.sh.service.OrderReturnOperationLogService;
import com.oying.modules.sh.domain.dto.OrderReturnOperationLogQueryCriteria;
import com.oying.utils.R;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.*;
import java.io.IOException;
@@ -22,7 +21,7 @@
**/
@RestController
@RequiredArgsConstructor
@Api(tags = "退订用户操作管理")
@Api(tags = "SH:退订用户操作管理")
@RequestMapping("/api/orderReturnOperationLog")
public class OrderReturnOperationLogController {
@@ -43,12 +42,9 @@
        return new ResponseEntity<>(orderReturnOperationLogService.queryAll(criteria,page),HttpStatus.OK);
    }
    @PostMapping
    @Log("新增退订用户操作管理")
    @ApiOperation("新增退订用户操作管理")
    @PreAuthorize("@el.check('orderReturnOperationLog:add')")
    public ResponseEntity<Object> createOrderReturnOperationLog(@Validated @RequestBody OrderReturnOperationLog resources){
        orderReturnOperationLogService.create(resources);
        return new ResponseEntity<>(HttpStatus.CREATED);
    @GetMapping("getByReturnNum")
    @ApiOperation("根据退单号查询退单操作日志")
    public ResponseEntity<Object> getByReturnNum(@RequestParam String returnNum) {
        return new ResponseEntity<>(R.success(orderReturnOperationLogService.getByReturnNum(returnNum)), HttpStatus.OK);
    }
}
oying-system/src/main/java/com/oying/modules/sh/service/OrderOperationLogService.java
@@ -56,4 +56,6 @@
    * @throws IOException /
    */
    void download(List<OrderOperationLog> all, HttpServletResponse response) throws IOException;
    List<OrderOperationLog> getByOrderNum(String orderNum);
}
oying-system/src/main/java/com/oying/modules/sh/service/OrderReturnOperationLogService.java
@@ -56,4 +56,6 @@
    * @throws IOException /
    */
    void download(List<OrderReturnOperationLog> all, HttpServletResponse response) throws IOException;
    List<OrderReturnOperationLog> getByReturnNum(String returnNum);
}
oying-system/src/main/java/com/oying/modules/sh/service/OrderReturnService.java
@@ -7,6 +7,7 @@
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.oying.modules.sh.domain.request.AuditOrderReturn;
import com.oying.utils.PageResult;
/**
@@ -60,4 +61,6 @@
    OrderReturn getByReturnNum(String outRefundNo);
    void updatePayStatus(String outRefundNo, String status, String time);
    void audit(AuditOrderReturn resources);
}
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderOperationLogServiceImpl.java
@@ -41,6 +41,11 @@
    }
    @Override
    public List<OrderOperationLog> getByOrderNum(String orderNum) {
        return orderOperationLogMapper.getByOrderNum(orderNum);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void create(OrderOperationLog resources) {
        orderOperationLogMapper.insert(resources);
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderReturnOperationLogServiceImpl.java
@@ -11,12 +11,11 @@
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.oying.utils.PageUtil;
import java.util.List;
import java.util.Map;
import java.util.*;
import java.io.IOException;
import javax.servlet.http.HttpServletResponse;
import java.util.ArrayList;
import java.util.LinkedHashMap;
import com.oying.utils.PageResult;
/**
@@ -41,6 +40,11 @@
    }
    @Override
    public List<OrderReturnOperationLog> getByReturnNum(String returnNum) {
        return orderReturnOperationLogMapper.getByReturnNum(returnNum);
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void create(OrderReturnOperationLog resources) {
        orderReturnOperationLogMapper.insert(resources);
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderReturnServiceImpl.java
@@ -1,6 +1,7 @@
package com.oying.modules.sh.service.impl;
import com.oying.modules.sh.domain.OrderReturn;
import com.oying.modules.sh.domain.request.AuditOrderReturn;
import com.oying.utils.FileUtil;
import com.oying.utils.enums.ReturnAuditEnum;
import lombok.RequiredArgsConstructor;
@@ -69,6 +70,12 @@
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void audit(AuditOrderReturn resources) {
    }
    @Override
    @Transactional(rollbackFor = Exception.class)
    public void deleteAll(List<Long> ids) {
        orderReturnMapper.deleteBatchIds(ids);
    }
oying-system/src/main/java/com/oying/modules/sh/service/impl/OrderServiceImpl.java
@@ -165,7 +165,7 @@
            if (product == null) {
                throw new BadRequestException("商品不存在");
            }
            if (product.getStoreId().equals(criteria.getStoreId())) {
            if (!product.getStoreId().equals(criteria.getStoreId())) {
                throw new BadRequestException("不支持跨门店下单");
            }
            if (!product.getStatus().equals(ProductStatusEnum.AVAILABLE.getValue())) {
oying-system/src/main/resources/config/application.yml
@@ -1,5 +1,5 @@
server:
  port: 8088
  port: 8000
  http2:
    # 启用 HTTP/2 支持,提升传输效率
    enabled: true
oying-system/src/main/resources/mapper/sh/OrderMapper.xml
@@ -51,28 +51,28 @@
        <include refid="Base_Column_List"/>
        from sh_order
        <where>
            <if test="criteria.orderNum != null">
            <if test="criteria.orderNum != null and criteria.orderNum != ''">
                and order_num like concat('%',#{criteria.orderNum},'%')
            </if>
            <if test="criteria.orderStatus != null">
            <if test="criteria.orderStatus != null and criteria.orderStatus != ''">
                and order_status = #{criteria.orderStatus}
            </if>
            <if test="criteria.userId != null">
            <if test="criteria.userId != null and criteria.userId != ''">
                and user_id = #{criteria.userId}
            </if>
            <if test="criteria.username != null">
            <if test="criteria.username != null and criteria.username != ''">
                and username like concat('%',#{criteria.username},'%')
            </if>
            <if test="criteria.storeId != null">
            <if test="criteria.storeId != null and criteria.storeId != ''">
                and store_id = #{criteria.storeId}
            </if>
            <if test="criteria.orderDescribe != null">
            <if test="criteria.orderDescribe != null and criteria.orderDescribe != ''">
                and order_describe like concat('%',#{criteria.orderDescribe},'%')
            </if>
            <if test="criteria.payState != null">
            <if test="criteria.payState != null and criteria.payState != ''">
                and pay_state = #{criteria.payState}
            </if>
            <if test="criteria.payType != null">
            <if test="criteria.payType != null and criteria.payType != ''">
                and pay_type = #{criteria.payType}
            </if>
            <if test="criteria.payTime != null and criteria.payTime.size() > 0">
oying-system/src/main/resources/mapper/sh/OrderOperationLogMapper.xml
@@ -37,4 +37,10 @@
        </where>
        order by log_id desc
    </select>
    <select id="getByOrderNum" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from sh_order_operation_log
        where order_num = #{orderNum} order by log_id desc
    </select>
</mapper>
oying-system/src/main/resources/mapper/sh/OrderReturnOperationLogMapper.xml
@@ -37,4 +37,11 @@
        </where>
        order by log_id desc
    </select>
</mapper>
    <select id="getByReturnNum" resultMap="BaseResultMap">
        select
        <include refid="Base_Column_List"/>
        from sh_order_return_operation_log
        where return_num = #{returnNum}
        order by log_id desc
    </select>
</mapper>