feat(mall): 添加订单角标数量接口并优化相关功能
- 新增 findMarkCnt 接口,用于获取订单角标数量
- 优化订单列表查询逻辑,调整状态筛选条件
- 修复订单列表模板,移除冗余字段和操作按钮
- 优化订单发货和修改物流信息功能
- 添加 Redis 工具类用于本地唤醒状态保持
| | |
| | | return apiClothesOrderService.findOrderList(dto); |
| | | } |
| | | |
| | | |
| | | @ApiOperation(value = "获取订单角标数量") |
| | | @GetMapping(value = "/findMarkCnt") |
| | | public FebsResponse findMarkCnt() { |
| | | |
| | | return apiClothesOrderService.findMarkCnt(); |
| | | } |
| | | |
| | | @ApiOperation(value = "订单详情", notes = "订单详情") |
| | | @ApiResponses({ |
| | | @ApiResponse(code = 200, message = "success", response = ApiClothesOrderListInfoVo.class) |
| | |
| | | */ |
| | | @GetMapping("deliverGoods/{id}") |
| | | @RequiresPermissions("deliverGoods:update") |
| | | public String deliverGoods(@PathVariable long id, Model model) { |
| | | public String deliverGoods(@PathVariable Long id, Model model) { |
| | | AdminClothesDeliverGoodsVo data = new AdminClothesDeliverGoodsVo(); |
| | | ClothesOrder clothesOrder = clothesOrderMapper.selectById(id); |
| | | data.setId(clothesOrder.getId()); |
| | | data.setName(clothesOrder.getName()); |
| | | data.setPhone(clothesOrder.getPhone()); |
| | | data.setAddress(clothesOrder.getAddress()); |
| | | data.setExpressCom("极兔快递"); |
| | | MallExpressInfo mallExpressInfo = mallExpressInfoMapper.selectOne( |
| | | Wrappers.lambdaQuery(MallExpressInfo.class) |
| | |
| | | private Long skuId; |
| | | |
| | | @NotNull(message = "参数不能为空") |
| | | @ApiModelProperty(value = "数量", example = "2") |
| | | private Integer cnt; |
| | | |
| | | @NotNull(message = "参数不能为空") |
| | | @ApiModelProperty(value = "类型 1正面图案 2反面图案 3工艺 4布料 5尺码 6尺码自定义", example = "2") |
| | | private Integer type; |
| | | |
| | |
| | | @ApiModelProperty(value = "订单ID") |
| | | private Long id; |
| | | |
| | | @NotBlank(message = "参数不能为空") |
| | | @NotNull(message = "参数不能为空") |
| | | @ApiModelProperty(value = "支付类型", example = "1微信2支付宝3余额") |
| | | private Integer type; |
| | | |
| | |
| | | private List<ApiLocationAddDto> locationList; |
| | | |
| | | |
| | | @NotNull(message = "图案不能为空") |
| | | @ApiModelProperty(value = "图案ID") |
| | | private Long patternId; |
| | | |
| | | @ApiModelProperty(value = "自定义内容") |
| | | private String patternRemark; |
| | | |
| | | |
| | | @NotNull(message = "图案位置不能为空") |
| | | @ApiModelProperty(value = "图案位置ID") |
| | | private Long locationId; |
| | | |
| | | |
| | | @NotNull(message = "布料不能为空") |
| | | @ApiModelProperty(value = "布料ID") |
| | | private Long clothId; |
| | |
| | | import javax.validation.constraints.NotNull; |
| | | |
| | | @Data |
| | | @ApiModel(value = "ApiMyDraftSaveDto", description = "参数") |
| | | @ApiModel(value = "ApiSocialInfoDto", description = "参数") |
| | | public class ApiSocialInfoDto { |
| | | |
| | | @NotNull(message = "社区不能为空") |
| | |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | public interface ClothesOrderMapper extends BaseMapper<ClothesOrder> { |
| | | |
| | | Page<ApiClothesOrderListVo> selectPageInOrder(Page<ApiClothesOrderListVo> page, @Param("record")ApiClothesOrderListVoDto dto); |
| | | |
| | | IPage<AdminClothesOrderListVo> selectOrderListInPage(Page<AdminClothesOrderListVo> page, @Param("record")AdminClothesOrderListDto dto); |
| | | |
| | | List<Map<String, Integer>> selectOrderStatusCnt(@Param("memberId")Long memberId); |
| | | } |
| | |
| | | |
| | | import cc.mrbird.febs.common.enumerates.OrderStatusEnum; |
| | | import cc.mrbird.febs.common.exception.FebsException; |
| | | import cc.mrbird.febs.common.utils.RedisUtils; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cn.hutool.core.collection.CollUtil; |
| | |
| | | |
| | | } |
| | | |
| | | // @Scheduled(cron = "0/5 * * * * ? ") |
| | | // public void wakeup() { |
| | | // log.info("本地保持唤醒状态"); |
| | | // Long id = 5L; |
| | | // mallMemberMapper.selectById(id); |
| | | // } |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUtils redisUtils; |
| | | |
| | | @Scheduled(cron = "0/5 * * * * ? ") |
| | | public void wakeup() { |
| | | redisUtils.set("wakeup", "wakeup"); |
| | | } |
| | | } |
| | |
| | | |
| | | FebsResponse findOrderList(ApiClothesOrderListVoDto dto); |
| | | |
| | | FebsResponse findMarkCnt(); |
| | | |
| | | FebsResponse orderDetails(Long id); |
| | | |
| | | FebsResponse confirmOrder(Long id); |
| | |
| | | orderItem.setItemId(cloth.getId()); |
| | | orderItem.setName(cloth.getName()); |
| | | orderItem.setPrice(cloth.getPrice()); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | | orderItem.setItemCnt(orderItem.getItemCnt()); |
| | | orderItem.setAmount(cloth.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN)); |
| | | clothesOrderItemMapper.insert(orderItem); |
| | | |
| | |
| | | orderItem.setItemId(size.getId()); |
| | | orderItem.setName(size.getName()); |
| | | orderItem.setPrice(size.getPrice()); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | | orderItem.setItemCnt(orderItem.getItemCnt()); |
| | | orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN)); |
| | | clothesOrderItemMapper.insert(orderItem); |
| | | |
| | |
| | | orderItem.setItemId(location.getId()); |
| | | orderItem.setName(location.getName()); |
| | | orderItem.setPrice(location.getPrice()); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | | orderItem.setItemCnt(orderItem.getItemCnt()); |
| | | orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN)); |
| | | orderItem.setRemark(item.getPatternRemark()); |
| | | clothesOrderItemMapper.insert(orderItem); |
| | |
| | | orderItem.setRemark(item.getPatternRemark()); |
| | | orderItem.setName(pattern.getName()); |
| | | orderItem.setPrice(pattern.getPrice()); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | | orderItem.setItemCnt(orderItem.getItemCnt()); |
| | | orderItem.setRemark(item.getPatternRemark()); |
| | | orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN)); |
| | | clothesOrderItemMapper.insert(orderItem); |
| | |
| | | orderItem.setItemId(art.getId()); |
| | | orderItem.setName(art.getName()); |
| | | orderItem.setPrice(art.getPrice()); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | | orderItem.setItemCnt(orderItem.getItemCnt()); |
| | | orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN)); |
| | | clothesOrderItemMapper.insert(orderItem); |
| | | |
| | |
| | | orderItem.setItemId(clothesMemberStature.getId()); |
| | | orderItem.setName(clothesMemberStature.getName()); |
| | | orderItem.setPrice(BigDecimal.ZERO); |
| | | orderItem.setItemCnt(item.getCnt()); |
| | | orderItem.setItemCnt(orderItem.getItemCnt()); |
| | | orderItem.setAmount(orderItem.getPrice().multiply(new BigDecimal(orderItem.getItemCnt())).setScale(2, RoundingMode.DOWN)); |
| | | clothesOrderItemMapper.insert(orderItem); |
| | | |
| | |
| | | return new FebsResponse().success().data(voPage); |
| | | } |
| | | |
| | | @Override |
| | | public FebsResponse findMarkCnt() { |
| | | Long memberId = LoginUserUtil.getLoginUser().getId(); |
| | | |
| | | List<Map<String, Integer>> maps = clothesOrderMapper.selectOrderStatusCnt(memberId); |
| | | Map<Integer, Integer> orderCnt = new HashMap<>(); |
| | | if (CollUtil.isNotEmpty(maps)) { |
| | | for (Map<String, Integer> map : maps) { |
| | | orderCnt.put(map.get("status"), map.get("cnt")); |
| | | } |
| | | } |
| | | |
| | | Map<String, Object> result = new HashMap<>(); |
| | | result.put("order", orderCnt); |
| | | return new FebsResponse().success().data(result); |
| | | } |
| | | |
| | | |
| | | private List<ApiClothesOrderItemInfoVo> buildOrderItemInfo(Long id) { |
| | |
| | | clothesOrderMapper.update( |
| | | null, |
| | | Wrappers.lambdaUpdate(ClothesOrder.class) |
| | | .set(ClothesOrder::getStatus, ClothesOrderStatusEnum.CANCEL.getValue()) |
| | | .set(ClothesOrder::getUpdatedTime, new Date()) |
| | | .set(ClothesOrder::getStatus, value) |
| | | .set(ClothesOrder::getUpdatedTime, date) |
| | | .eq(ClothesOrder::getId, id) |
| | | ); |
| | | } |
| | |
| | | b.name like CONCAT('%', CONCAT(#{record.query}, '%')) or |
| | | ) |
| | | </if> |
| | | <if test="record.status != null"> |
| | | <if test="record.status != 0"> |
| | | and ( |
| | | a.status = #{record.status} |
| | | ) |
| | |
| | | |
| | | <where> |
| | | <if test="record != null"> |
| | | <if test="record.payResult != null"> |
| | | <if test="record.payResult != null and record.payResult != ''"> |
| | | and a.pay_result = #{record.payResult} |
| | | </if> |
| | | <if test="record.status != null"> |
| | |
| | | order by a.created_time desc |
| | | </select> |
| | | |
| | | |
| | | |
| | | <select id="selectOrderStatusCnt" resultType="java.util.Map"> |
| | | select |
| | | a.status, |
| | | count(1) cnt |
| | | from clothes_order a |
| | | where a.del_flag=0 and a.member_id=#{memberId} |
| | | group by a.status |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | } |
| | | let ids = ""; |
| | | for(let i = 0;i < data.length;i++){ |
| | | if(data[i].status != 1){ |
| | | if(data[i].status != 2){ |
| | | febs.alert.warn('请选择待发货的订单'); |
| | | return; |
| | | }else{ |
| | | ids = data[i].id; |
| | | } |
| | | } |
| | | console.log(ids); |
| | | if(ids == null || ids == ""){ |
| | | febs.alert.warn('请选择订单'); |
| | | return; |
| | | } |
| | | febs.modal.open('发货', 'modules/clothesType/deliverGoods/' + data.id, { |
| | | febs.modal.open('发货', 'modules/clothesType/deliverGoods/' + ids, { |
| | | btn: ['确认','取消'], |
| | | yes: function (index, layero) { |
| | | $('#deliver-update-clothes').find('#submit').trigger('click'); |
| | |
| | | if(data[i].status != 2){ |
| | | febs.alert.warn('请选择待收货的订单'); |
| | | return; |
| | | }else{ |
| | | ids = data[i].id; |
| | | } |
| | | } |
| | | if(ids == null || ids == ""){ |
| | | febs.alert.warn('请选择订单'); |
| | | return; |
| | | } |
| | | febs.modal.open('修改物流信息', 'modules/clothesType/deliverGoods/' + data.id, { |
| | | febs.modal.open('修改物流信息', 'modules/clothesType/deliverGoods/' + ids, { |
| | | btn: ['确认','取消'], |
| | | yes: function (index, layero) { |
| | | $('#deliver-update-clothes').find('#deliverInfoSubmit').trigger('click'); |
| | |
| | | } |
| | | let ids = ""; |
| | | for(let i = 0;i < data.length;i++){ |
| | | if(data[i].status == 2 ){ |
| | | if(data[i].status != 2 ){ |
| | | febs.alert.warn('请选择待发货的订单'); |
| | | return; |
| | | }else{ |
| | |
| | | febs.alert.warn('请选择订单'); |
| | | return; |
| | | } |
| | | febs.get(ctx + 'admin/clothesType/confirmOrder?ids='+ids, null, function () { |
| | | febs.get(ctx + 'admin/clothesType/confirmOrder/'+ids, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | |
| | | }); |
| | | |
| | | function refundOrder(id) { |
| | | febs.get(ctx + 'admin/clothesType/refundOrder' + id, null, function () { |
| | | febs.get(ctx + 'admin/clothesType/refundOrder/' + id, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | $query.click(); |
| | | }); |
| | |
| | | cols: [[ |
| | | {type: 'checkbox', fixed: 'left'}, |
| | | {type: 'numbers', title: '', width: 80}, |
| | | {title: '操作', |
| | | templet: function (d) { |
| | | return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder">详情</button>' |
| | | },minWidth: 200,align:'center'}, |
| | | // {title: '操作', |
| | | // templet: function (d) { |
| | | // return '<button class="layui-btn layui-btn-normal layui-btn-xs" lay-event="seeOrder">详情</button>' |
| | | // },minWidth: 200,align:'center'}, |
| | | {field: 'orderNo', title: '订单编号', minWidth: 200,align:'left' ,totalRowText:"合计"}, |
| | | {field: 'memberName', title: '购买人', minWidth: 100,align:'left'}, |
| | | {field: 'typeName', title: '类型', minWidth: 100,align:'left'}, |
| | | {field: 'typeImage', title: '图片', minWidth: 100,align:'left'}, |
| | | // {field: 'goodsName', title: '商品', minWidth: 160,align:'left'}, |
| | | // {field: 'typeImage', title: '图片', minWidth: 100,align:'left'}, |
| | | {field: 'goodsCnt', title: '数量', minWidth: 120,align:'left'}, |
| | | {field: 'status', title: '状态', |
| | | templet: function (d) { |
| | |
| | | return '' |
| | | } |
| | | }, minWidth: 80,align:'center'}, |
| | | {field: 'goodsName', title: '商品', minWidth: 160,align:'left'}, |
| | | {field: 'amount', title: '总价', minWidth: 80,align:'left', totalRow:true}, |
| | | {field: 'discountAmount', title: '优惠', minWidth: 80,align:'left', totalRow:true}, |
| | | {field: 'carriage', title: '邮费', minWidth: 80,align:'left', totalRow:true}, |
| | |
| | | orderNo: $searchForm.find('input[name="orderNo"]').val().trim(), |
| | | payResult: $searchForm.find("select[name='payResult']").val(), |
| | | status: $searchForm.find("select[name='status']").val(), |
| | | isHome: $searchForm.find("select[name='isHome']").val(), |
| | | uniqueCode: $searchForm.find("select[name='uniqueCode']").val(), |
| | | }; |
| | | } |
| | | |