1 files added
21 files modified
| | |
| | | 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; |
| | |
| | | @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)); |
| | | } |
| | | } |
| | |
| | | import lombok.Getter; |
| | | import lombok.Setter; |
| | | |
| | | import javax.validation.constraints.NotBlank; |
| | | |
| | | /** |
| | | * @author xin |
| | | * @description |
| | |
| | | private String username; |
| | | |
| | | @ApiModelProperty(value = "微信code") |
| | | @NotBlank |
| | | private String code; |
| | | |
| | | @ApiModelProperty(value = "类型默认:OLD,注册:NEW",example = "OLD") |
| | | @NotBlank |
| | | private String type = "OLD"; |
| | | } |
New file |
| | |
| | | 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; |
| | | |
| | | } |
| | |
| | | public class ProductOrder { |
| | | |
| | | @ApiModelProperty(value = "商品ID") |
| | | private String productId; |
| | | private Long productId; |
| | | @ApiModelProperty(value = "数量") |
| | | private Integer count; |
| | | } |
| | |
| | | IPage<OrderOperationLog> findAll(@Param("criteria") OrderOperationLogQueryCriteria criteria, Page<Object> page); |
| | | |
| | | List<OrderOperationLog> findAll(@Param("criteria") OrderOperationLogQueryCriteria criteria); |
| | | |
| | | List<OrderOperationLog> getByOrderNum(String orderNum); |
| | | } |
| | |
| | | IPage<OrderReturnOperationLog> findAll(@Param("criteria") OrderReturnOperationLogQueryCriteria criteria, Page<Object> page); |
| | | |
| | | List<OrderReturnOperationLog> findAll(@Param("criteria") OrderReturnOperationLogQueryCriteria criteria); |
| | | |
| | | List<OrderReturnOperationLog> getByReturnNum(String returnNum); |
| | | } |
| | |
| | | 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; |
| | |
| | | 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.*; |
| | | |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | private final OrderProductSnapshotService orderProductSnapshotService; |
| | | |
| | | @GetMapping |
| | | @ApiOperation("查询订单商品快照") |
| | | @ApiOperation("根据订单号查询订单商品快照") |
| | | public ResponseEntity<Object> queryOrderProductSnapshot(@RequestParam String orderNum) { |
| | | return new ResponseEntity<>(R.success(orderProductSnapshotService.queryOrderProductSnapshot(orderNum)), HttpStatus.OK); |
| | | } |
| | |
| | | |
| | | 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; |
| | |
| | | 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("修改退款订单") |
| | |
| | | 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; |
| | |
| | | **/ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @Api(tags = "退订用户操作管理") |
| | | @Api(tags = "SH:退订用户操作管理") |
| | | @RequestMapping("/api/orderReturnOperationLog") |
| | | public class OrderReturnOperationLogController { |
| | | |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<OrderOperationLog> all, HttpServletResponse response) throws IOException; |
| | | |
| | | List<OrderOperationLog> getByOrderNum(String orderNum); |
| | | } |
| | |
| | | * @throws IOException / |
| | | */ |
| | | void download(List<OrderReturnOperationLog> all, HttpServletResponse response) throws IOException; |
| | | |
| | | List<OrderReturnOperationLog> getByReturnNum(String returnNum); |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | OrderReturn getByReturnNum(String outRefundNo); |
| | | |
| | | void updatePayStatus(String outRefundNo, String status, String time); |
| | | |
| | | void audit(AuditOrderReturn resources); |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderOperationLog> getByOrderNum(String orderNum) { |
| | | return orderOperationLogMapper.getByOrderNum(orderNum); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(OrderOperationLog resources) { |
| | | orderOperationLogMapper.insert(resources); |
| | |
| | | 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; |
| | | |
| | | /** |
| | |
| | | } |
| | | |
| | | @Override |
| | | public List<OrderReturnOperationLog> getByReturnNum(String returnNum) { |
| | | return orderReturnOperationLogMapper.getByReturnNum(returnNum); |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void create(OrderReturnOperationLog resources) { |
| | | orderReturnOperationLogMapper.insert(resources); |
| | |
| | | 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; |
| | |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void audit(AuditOrderReturn resources) { |
| | | |
| | | } |
| | | |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void deleteAll(List<Long> ids) { |
| | | orderReturnMapper.deleteBatchIds(ids); |
| | | } |
| | |
| | | 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())) { |
| | |
| | | server: |
| | | port: 8088 |
| | | port: 8000 |
| | | http2: |
| | | # 启用 HTTP/2 支持,提升传输效率 |
| | | enabled: true |
| | |
| | | <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"> |
| | |
| | | </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> |
| | |
| | | </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> |