生成订单相关,员工相关,会员相关
This commit is contained in:
@@ -1,116 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="bot_send_order")
|
||||
public class BotSendOrder implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`order_code`")
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderCode;
|
||||
|
||||
@Column(name = "`message_id`")
|
||||
@ApiModelProperty(value = "消息id")
|
||||
private Integer messageId;
|
||||
|
||||
@Column(name = "`chat_id`")
|
||||
@ApiModelProperty(value = "聊天id")
|
||||
private Long chatId;
|
||||
|
||||
@Column(name = "`user_telegram_id`")
|
||||
@ApiModelProperty(value = "用户电报号")
|
||||
private String userTelegramId;
|
||||
|
||||
@Column(name = "`user_name`")
|
||||
@ApiModelProperty(value = "用户名称")
|
||||
private String userName;
|
||||
|
||||
@Column(name = "`odds`")
|
||||
@ApiModelProperty(value = "赔率")
|
||||
private BigDecimal odds;
|
||||
|
||||
@Column(name = "`chip_total`")
|
||||
@ApiModelProperty(value = "发包金额")
|
||||
private BigDecimal chipTotal;
|
||||
|
||||
@Column(name = "`chip_remain`")
|
||||
@ApiModelProperty(value = "未抢完金额")
|
||||
private BigDecimal chipRemain;
|
||||
|
||||
@Column(name = "`profit`")
|
||||
@ApiModelProperty(value = "总盈利")
|
||||
private BigDecimal profit;
|
||||
|
||||
@Column(name = "`bomb_number`")
|
||||
@ApiModelProperty(value = "雷号")
|
||||
private String bombNumber;
|
||||
|
||||
@Column(name = "`now_receive_count`")
|
||||
@ApiModelProperty(value = "领取次数")
|
||||
private String nowReceiveCount;
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "状态")
|
||||
private String status;
|
||||
|
||||
@Column(name = "`type`")
|
||||
@ApiModelProperty(value = "类型")
|
||||
private String type;
|
||||
|
||||
@Column(name = "`btc_price`")
|
||||
@ApiModelProperty(value = "价格")
|
||||
private String btcPrice;
|
||||
|
||||
@Column(name = "`gong_zheng_num`")
|
||||
@ApiModelProperty(value = "gongZhengNum")
|
||||
private String gongZhengNum;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "`update_time`")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Timestamp updateTime;
|
||||
|
||||
public void copy(BotSendOrder source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="bot_send_order_details")
|
||||
public class BotSendOrderDetails implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`order_code`")
|
||||
@ApiModelProperty(value = "订单号")
|
||||
private String orderCode;
|
||||
|
||||
@Column(name = "`chip_total`")
|
||||
@ApiModelProperty(value = "发包金额")
|
||||
private BigDecimal chipTotal;
|
||||
|
||||
@Column(name = "`bomb_number`")
|
||||
@ApiModelProperty(value = "雷号")
|
||||
private String bombNumber;
|
||||
|
||||
@Column(name = "`now_receive_count`")
|
||||
@ApiModelProperty(value = "领取次数")
|
||||
private String nowReceiveCount;
|
||||
|
||||
@Column(name = "`send_user_telegram_id`")
|
||||
@ApiModelProperty(value = "发送者电报号")
|
||||
private String sendUserTelegramId;
|
||||
|
||||
@Column(name = "`send_user_name`")
|
||||
@ApiModelProperty(value = "发送者名称")
|
||||
private String sendUserName;
|
||||
|
||||
@Column(name = "`send_user_status`")
|
||||
@ApiModelProperty(value = "发送者输赢状况")
|
||||
private String sendUserStatus;
|
||||
|
||||
@Column(name = "`send_user_fee`")
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal sendUserFee;
|
||||
|
||||
@Column(name = "`send_user_profit`")
|
||||
@ApiModelProperty(value = "赔率")
|
||||
private BigDecimal sendUserProfit;
|
||||
|
||||
@Column(name = "`get_user_telegram_id`")
|
||||
@ApiModelProperty(value = "抢红包者电报号")
|
||||
private String getUserTelegramId;
|
||||
|
||||
@Column(name = "`get_user_name`")
|
||||
@ApiModelProperty(value = "抢红包者名称")
|
||||
private String getUserName;
|
||||
|
||||
@Column(name = "`get_user_status`")
|
||||
@ApiModelProperty(value = "抢红包者输赢状况")
|
||||
private String getUserStatus;
|
||||
|
||||
@Column(name = "`get_user_get_amount`")
|
||||
@ApiModelProperty(value = "红包金额")
|
||||
private BigDecimal getUserGetAmount;
|
||||
|
||||
@Column(name = "`get_user_fee`")
|
||||
@ApiModelProperty(value = "手续费")
|
||||
private BigDecimal getUserFee;
|
||||
|
||||
@Column(name = "`get_user_profit`")
|
||||
@ApiModelProperty(value = "赔率")
|
||||
private BigDecimal getUserProfit;
|
||||
|
||||
@Column(name = "`special_prize_type`")
|
||||
@ApiModelProperty(value = "specialPrizeType")
|
||||
private String specialPrizeType;
|
||||
|
||||
@Column(name = "`special_prize_amount`")
|
||||
@ApiModelProperty(value = "specialPrizeAmount")
|
||||
private BigDecimal specialPrizeAmount;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "createTime")
|
||||
private Timestamp createTime;
|
||||
|
||||
public void copy(BotSendOrderDetails source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
@@ -1,108 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-06-23
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="view_box_order")
|
||||
public class ViewBoxOrder implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`user_id`")
|
||||
@ApiModelProperty(value = "下单人")
|
||||
private Integer userId;
|
||||
|
||||
@Column(name = "`box_price`")
|
||||
@ApiModelProperty(value = "盲盒的单价")
|
||||
private BigDecimal boxPrice;
|
||||
|
||||
@Column(name = "`box_number`")
|
||||
@ApiModelProperty(value = "购买数量")
|
||||
private BigDecimal boxNumber;
|
||||
|
||||
@Column(name = "`pay_coin_name`")
|
||||
@ApiModelProperty(value = "支付代币code")
|
||||
private String payCoinName;
|
||||
|
||||
@Column(name = "`pay_coin_price`")
|
||||
@ApiModelProperty(value = "支付代币的当前单价(u)")
|
||||
private BigDecimal payCoinPrice;
|
||||
|
||||
@Column(name = "`pay_coin_total`")
|
||||
@ApiModelProperty(value = "总支付的token数量")
|
||||
private BigDecimal payCoinTotal;
|
||||
|
||||
@Column(name = "`pay_miner_total`")
|
||||
@ApiModelProperty(value = " 预计收益(USDT)")
|
||||
private BigDecimal payMinerTotal;
|
||||
|
||||
@Column(name = "`tx_hash`")
|
||||
@ApiModelProperty(value = "交易哈希")
|
||||
private String txHash;
|
||||
|
||||
@Column(name = "`from_address`")
|
||||
@ApiModelProperty(value = "付款地址")
|
||||
private String fromAddress;
|
||||
|
||||
@Column(name = "`to_address`")
|
||||
@ApiModelProperty(value = "收款地址")
|
||||
private String toAddress;
|
||||
|
||||
@Column(name = "`confirm_status`")
|
||||
@ApiModelProperty(value = "链上确认状态")
|
||||
private String confirmStatus;
|
||||
|
||||
@Column(name = "`remark`")
|
||||
@ApiModelProperty(value = "订单描述")
|
||||
private String remark;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "创建时间")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "`update_time`")
|
||||
@ApiModelProperty(value = "更新时间")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "`address`")
|
||||
@ApiModelProperty(value = "钱包地址")
|
||||
private String address;
|
||||
|
||||
public void copy(ViewBoxOrder source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.rest;
|
||||
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrder;
|
||||
import me.zhengjie.modules.oder.service.BotSendOrderService;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "OrderController管理")
|
||||
@RequestMapping("/api/botSendOrder")
|
||||
public class BotSendOrderController {
|
||||
|
||||
private final BotSendOrderService botSendOrderService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('botSendOrder:list')")
|
||||
public void exportBotSendOrder(HttpServletResponse response, BotSendOrderQueryCriteria criteria) throws IOException {
|
||||
botSendOrderService.download(botSendOrderService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询OrderController")
|
||||
@ApiOperation("查询OrderController")
|
||||
@PreAuthorize("@el.check('botSendOrder:list')")
|
||||
public ResponseEntity<Object> queryBotSendOrder(BotSendOrderQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botSendOrderService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增OrderController")
|
||||
@ApiOperation("新增OrderController")
|
||||
@PreAuthorize("@el.check('botSendOrder:add')")
|
||||
public ResponseEntity<Object> createBotSendOrder(@Validated @RequestBody BotSendOrder resources){
|
||||
return new ResponseEntity<>(botSendOrderService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改OrderController")
|
||||
@ApiOperation("修改OrderController")
|
||||
@PreAuthorize("@el.check('botSendOrder:edit')")
|
||||
public ResponseEntity<Object> updateBotSendOrder(@Validated @RequestBody BotSendOrder resources){
|
||||
botSendOrderService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除OrderController")
|
||||
@ApiOperation("删除OrderController")
|
||||
@PreAuthorize("@el.check('botSendOrder:del')")
|
||||
public ResponseEntity<Object> deleteBotSendOrder(@RequestBody Integer[] ids) {
|
||||
botSendOrderService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.rest;
|
||||
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrderDetails;
|
||||
import me.zhengjie.modules.oder.service.BotSendOrderDetailsService;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderDetailsQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "sendDetail管理")
|
||||
@RequestMapping("/api/botSendOrderDetails")
|
||||
public class BotSendOrderDetailsController {
|
||||
|
||||
private final BotSendOrderDetailsService botSendOrderDetailsService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('botSendOrderDetails:list')")
|
||||
public void exportBotSendOrderDetails(HttpServletResponse response, BotSendOrderDetailsQueryCriteria criteria) throws IOException {
|
||||
botSendOrderDetailsService.download(botSendOrderDetailsService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询sendDetail")
|
||||
@ApiOperation("查询sendDetail")
|
||||
@PreAuthorize("@el.check('botSendOrderDetails:list')")
|
||||
public ResponseEntity<Object> queryBotSendOrderDetails(BotSendOrderDetailsQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(botSendOrderDetailsService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增sendDetail")
|
||||
@ApiOperation("新增sendDetail")
|
||||
@PreAuthorize("@el.check('botSendOrderDetails:add')")
|
||||
public ResponseEntity<Object> createBotSendOrderDetails(@Validated @RequestBody BotSendOrderDetails resources){
|
||||
return new ResponseEntity<>(botSendOrderDetailsService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改sendDetail")
|
||||
@ApiOperation("修改sendDetail")
|
||||
@PreAuthorize("@el.check('botSendOrderDetails:edit')")
|
||||
public ResponseEntity<Object> updateBotSendOrderDetails(@Validated @RequestBody BotSendOrderDetails resources){
|
||||
botSendOrderDetailsService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除sendDetail")
|
||||
@ApiOperation("删除sendDetail")
|
||||
@PreAuthorize("@el.check('botSendOrderDetails:del')")
|
||||
public ResponseEntity<Object> deleteBotSendOrderDetails(@RequestBody Integer[] ids) {
|
||||
botSendOrderDetailsService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -1,87 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.rest;
|
||||
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.oder.domain.ViewBoxOrder;
|
||||
import me.zhengjie.modules.oder.service.ViewBoxOrderService;
|
||||
import me.zhengjie.modules.oder.service.dto.ViewBoxOrderQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-06-23
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "订单查询管理")
|
||||
@RequestMapping("/api/viewBoxOrder")
|
||||
public class ViewBoxOrderController {
|
||||
|
||||
private final ViewBoxOrderService viewBoxOrderService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('viewBoxOrder:list')")
|
||||
public void exportViewBoxOrder(HttpServletResponse response, ViewBoxOrderQueryCriteria criteria) throws IOException {
|
||||
viewBoxOrderService.download(viewBoxOrderService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询订单查询")
|
||||
@ApiOperation("查询订单查询")
|
||||
@PreAuthorize("@el.check('viewBoxOrder:list')")
|
||||
public ResponseEntity<Object> queryViewBoxOrder(ViewBoxOrderQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(viewBoxOrderService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增订单查询")
|
||||
@ApiOperation("新增订单查询")
|
||||
@PreAuthorize("@el.check('viewBoxOrder:add')")
|
||||
public ResponseEntity<Object> createViewBoxOrder(@Validated @RequestBody ViewBoxOrder resources){
|
||||
return new ResponseEntity<>(viewBoxOrderService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改订单查询")
|
||||
@ApiOperation("修改订单查询")
|
||||
@PreAuthorize("@el.check('viewBoxOrder:edit')")
|
||||
public ResponseEntity<Object> updateViewBoxOrder(@Validated @RequestBody ViewBoxOrder resources){
|
||||
viewBoxOrderService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除订单查询")
|
||||
@ApiOperation("删除订单查询")
|
||||
@PreAuthorize("@el.check('viewBoxOrder:del')")
|
||||
public ResponseEntity<Object> deleteViewBoxOrder(@RequestBody Integer[] ids) {
|
||||
viewBoxOrderService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -1,84 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Data
|
||||
public class BotSendOrderDetailsDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 订单号 */
|
||||
private String orderCode;
|
||||
|
||||
/** 发包金额 */
|
||||
private BigDecimal chipTotal;
|
||||
|
||||
/** 雷号 */
|
||||
private String bombNumber;
|
||||
|
||||
/** 领取次数 */
|
||||
private String nowReceiveCount;
|
||||
|
||||
/** 发送者电报号 */
|
||||
private String sendUserTelegramId;
|
||||
|
||||
/** 发送者名称 */
|
||||
private String sendUserName;
|
||||
|
||||
/** 发送者输赢状况 */
|
||||
private String sendUserStatus;
|
||||
|
||||
/** 手续费 */
|
||||
private BigDecimal sendUserFee;
|
||||
|
||||
/** 赔率 */
|
||||
private BigDecimal sendUserProfit;
|
||||
|
||||
/** 抢红包者电报号 */
|
||||
private String getUserTelegramId;
|
||||
|
||||
/** 抢红包者名称 */
|
||||
private String getUserName;
|
||||
|
||||
/** 抢红包者输赢状况 */
|
||||
private String getUserStatus;
|
||||
|
||||
/** 红包金额 */
|
||||
private BigDecimal getUserGetAmount;
|
||||
|
||||
/** 手续费 */
|
||||
private BigDecimal getUserFee;
|
||||
|
||||
/** 赔率 */
|
||||
private BigDecimal getUserProfit;
|
||||
|
||||
private String specialPrizeType;
|
||||
|
||||
private BigDecimal specialPrizeAmount;
|
||||
|
||||
private Timestamp createTime;
|
||||
}
|
||||
@@ -1,57 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Data
|
||||
public class BotSendOrderDetailsQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String orderCode;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String sendUserTelegramId;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String sendUserName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String sendUserStatus;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String getUserTelegramId;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String getUserName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String getUserStatus;
|
||||
}
|
||||
@@ -1,83 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Data
|
||||
public class BotSendOrderDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 订单号 */
|
||||
private String orderCode;
|
||||
|
||||
/** 消息id */
|
||||
private Integer messageId;
|
||||
|
||||
/** 聊天id */
|
||||
private Long chatId;
|
||||
|
||||
/** 用户电报号 */
|
||||
private String userTelegramId;
|
||||
|
||||
/** 用户名称 */
|
||||
private String userName;
|
||||
|
||||
/** 赔率 */
|
||||
private BigDecimal odds;
|
||||
|
||||
/** 发包金额 */
|
||||
private BigDecimal chipTotal;
|
||||
|
||||
/** 未抢完金额 */
|
||||
private BigDecimal chipRemain;
|
||||
|
||||
/** 总盈利 */
|
||||
private BigDecimal profit;
|
||||
|
||||
/** 雷号 */
|
||||
private String bombNumber;
|
||||
|
||||
/** 领取次数 */
|
||||
private String nowReceiveCount;
|
||||
|
||||
/** 状态 */
|
||||
private String status;
|
||||
|
||||
/** 类型 */
|
||||
private String type;
|
||||
|
||||
/** 价格 */
|
||||
private String btcPrice;
|
||||
|
||||
private String gongZhengNum;
|
||||
|
||||
/** 创建时间 */
|
||||
private Timestamp createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private Timestamp updateTime;
|
||||
}
|
||||
@@ -1,78 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author admin
|
||||
* @date 2023-06-23
|
||||
**/
|
||||
@Data
|
||||
public class ViewBoxOrderDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 下单人 */
|
||||
private Integer userId;
|
||||
|
||||
/** 盲盒的单价 */
|
||||
private BigDecimal boxPrice;
|
||||
|
||||
/** 购买数量 */
|
||||
private BigDecimal boxNumber;
|
||||
|
||||
/** 支付代币code */
|
||||
private String payCoinName;
|
||||
|
||||
/** 支付代币的当前单价(u) */
|
||||
private BigDecimal payCoinPrice;
|
||||
|
||||
/** 总支付的token数量 */
|
||||
private BigDecimal payCoinTotal;
|
||||
|
||||
/** 预计收益(USDT) */
|
||||
private BigDecimal payMinerTotal;
|
||||
|
||||
/** 交易哈希 */
|
||||
private String txHash;
|
||||
|
||||
/** 付款地址 */
|
||||
private String fromAddress;
|
||||
|
||||
/** 收款地址 */
|
||||
private String toAddress;
|
||||
|
||||
/** 链上确认状态 */
|
||||
private String confirmStatus;
|
||||
|
||||
/** 订单描述 */
|
||||
private String remark;
|
||||
|
||||
/** 创建时间 */
|
||||
private Timestamp createTime;
|
||||
|
||||
/** 更新时间 */
|
||||
private Timestamp updateTime;
|
||||
|
||||
/** 钱包地址 */
|
||||
private String address;
|
||||
}
|
||||
@@ -1,121 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.impl;
|
||||
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrderDetails;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.oder.repository.BotSendOrderDetailsRepository;
|
||||
import me.zhengjie.modules.oder.service.BotSendOrderDetailsService;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderDetailsDto;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderDetailsQueryCriteria;
|
||||
import me.zhengjie.modules.oder.service.mapstruct.BotSendOrderDetailsMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BotSendOrderDetailsServiceImpl implements BotSendOrderDetailsService {
|
||||
|
||||
private final BotSendOrderDetailsRepository botSendOrderDetailsRepository;
|
||||
private final BotSendOrderDetailsMapper botSendOrderDetailsMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(BotSendOrderDetailsQueryCriteria criteria, Pageable pageable){
|
||||
Page<BotSendOrderDetails> page = botSendOrderDetailsRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(botSendOrderDetailsMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BotSendOrderDetailsDto> queryAll(BotSendOrderDetailsQueryCriteria criteria){
|
||||
return botSendOrderDetailsMapper.toDto(botSendOrderDetailsRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public BotSendOrderDetailsDto findById(Integer id) {
|
||||
BotSendOrderDetails botSendOrderDetails = botSendOrderDetailsRepository.findById(id).orElseGet(BotSendOrderDetails::new);
|
||||
ValidationUtil.isNull(botSendOrderDetails.getId(),"BotSendOrderDetails","id",id);
|
||||
return botSendOrderDetailsMapper.toDto(botSendOrderDetails);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BotSendOrderDetailsDto create(BotSendOrderDetails resources) {
|
||||
return botSendOrderDetailsMapper.toDto(botSendOrderDetailsRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(BotSendOrderDetails resources) {
|
||||
BotSendOrderDetails botSendOrderDetails = botSendOrderDetailsRepository.findById(resources.getId()).orElseGet(BotSendOrderDetails::new);
|
||||
ValidationUtil.isNull( botSendOrderDetails.getId(),"BotSendOrderDetails","id",resources.getId());
|
||||
botSendOrderDetails.copy(resources);
|
||||
botSendOrderDetailsRepository.save(botSendOrderDetails);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
botSendOrderDetailsRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<BotSendOrderDetailsDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (BotSendOrderDetailsDto botSendOrderDetails : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("订单号", botSendOrderDetails.getOrderCode());
|
||||
map.put("发包金额", botSendOrderDetails.getChipTotal());
|
||||
map.put("雷号", botSendOrderDetails.getBombNumber());
|
||||
map.put("领取次数", botSendOrderDetails.getNowReceiveCount());
|
||||
map.put("发送者电报号", botSendOrderDetails.getSendUserTelegramId());
|
||||
map.put("发送者名称", botSendOrderDetails.getSendUserName());
|
||||
map.put("发送者输赢状况", botSendOrderDetails.getSendUserStatus());
|
||||
map.put("手续费", botSendOrderDetails.getSendUserFee());
|
||||
map.put("赔率", botSendOrderDetails.getSendUserProfit());
|
||||
map.put("抢红包者电报号", botSendOrderDetails.getGetUserTelegramId());
|
||||
map.put("抢红包者名称", botSendOrderDetails.getGetUserName());
|
||||
map.put("抢红包者输赢状况", botSendOrderDetails.getGetUserStatus());
|
||||
map.put("红包金额", botSendOrderDetails.getGetUserGetAmount());
|
||||
map.put("手续费", botSendOrderDetails.getGetUserFee());
|
||||
map.put("赔率", botSendOrderDetails.getGetUserProfit());
|
||||
map.put(" specialPrizeType", botSendOrderDetails.getSpecialPrizeType());
|
||||
map.put(" specialPrizeAmount", botSendOrderDetails.getSpecialPrizeAmount());
|
||||
map.put(" createTime", botSendOrderDetails.getCreateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
@@ -1,120 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.impl;
|
||||
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrder;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.oder.repository.BotSendOrderRepository;
|
||||
import me.zhengjie.modules.oder.service.BotSendOrderService;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderDto;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderQueryCriteria;
|
||||
import me.zhengjie.modules.oder.service.mapstruct.BotSendOrderMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class BotSendOrderServiceImpl implements BotSendOrderService {
|
||||
|
||||
private final BotSendOrderRepository botSendOrderRepository;
|
||||
private final BotSendOrderMapper botSendOrderMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(BotSendOrderQueryCriteria criteria, Pageable pageable){
|
||||
Page<BotSendOrder> page = botSendOrderRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(botSendOrderMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<BotSendOrderDto> queryAll(BotSendOrderQueryCriteria criteria){
|
||||
return botSendOrderMapper.toDto(botSendOrderRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public BotSendOrderDto findById(Integer id) {
|
||||
BotSendOrder botSendOrder = botSendOrderRepository.findById(id).orElseGet(BotSendOrder::new);
|
||||
ValidationUtil.isNull(botSendOrder.getId(),"BotSendOrder","id",id);
|
||||
return botSendOrderMapper.toDto(botSendOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public BotSendOrderDto create(BotSendOrder resources) {
|
||||
return botSendOrderMapper.toDto(botSendOrderRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(BotSendOrder resources) {
|
||||
BotSendOrder botSendOrder = botSendOrderRepository.findById(resources.getId()).orElseGet(BotSendOrder::new);
|
||||
ValidationUtil.isNull( botSendOrder.getId(),"BotSendOrder","id",resources.getId());
|
||||
botSendOrder.copy(resources);
|
||||
botSendOrderRepository.save(botSendOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
botSendOrderRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<BotSendOrderDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (BotSendOrderDto botSendOrder : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("订单号", botSendOrder.getOrderCode());
|
||||
map.put("消息id", botSendOrder.getMessageId());
|
||||
map.put("聊天id", botSendOrder.getChatId());
|
||||
map.put("用户电报号", botSendOrder.getUserTelegramId());
|
||||
map.put("用户名称", botSendOrder.getUserName());
|
||||
map.put("赔率", botSendOrder.getOdds());
|
||||
map.put("发包金额", botSendOrder.getChipTotal());
|
||||
map.put("未抢完金额", botSendOrder.getChipRemain());
|
||||
map.put("总盈利", botSendOrder.getProfit());
|
||||
map.put("雷号", botSendOrder.getBombNumber());
|
||||
map.put("领取次数", botSendOrder.getNowReceiveCount());
|
||||
map.put("状态", botSendOrder.getStatus());
|
||||
map.put("类型", botSendOrder.getType());
|
||||
map.put("价格", botSendOrder.getBtcPrice());
|
||||
map.put(" gongZhengNum", botSendOrder.getGongZhengNum());
|
||||
map.put("创建时间", botSendOrder.getCreateTime());
|
||||
map.put("更新时间", botSendOrder.getUpdateTime());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
@@ -1,118 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.impl;
|
||||
|
||||
import me.zhengjie.modules.oder.domain.ViewBoxOrder;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.oder.repository.ViewBoxOrderRepository;
|
||||
import me.zhengjie.modules.oder.service.ViewBoxOrderService;
|
||||
import me.zhengjie.modules.oder.service.dto.ViewBoxOrderDto;
|
||||
import me.zhengjie.modules.oder.service.dto.ViewBoxOrderQueryCriteria;
|
||||
import me.zhengjie.modules.oder.service.mapstruct.ViewBoxOrderMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author admin
|
||||
* @date 2023-06-23
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class ViewBoxOrderServiceImpl implements ViewBoxOrderService {
|
||||
|
||||
private final ViewBoxOrderRepository viewBoxOrderRepository;
|
||||
private final ViewBoxOrderMapper viewBoxOrderMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(ViewBoxOrderQueryCriteria criteria, Pageable pageable){
|
||||
Page<ViewBoxOrder> page = viewBoxOrderRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(viewBoxOrderMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ViewBoxOrderDto> queryAll(ViewBoxOrderQueryCriteria criteria){
|
||||
return viewBoxOrderMapper.toDto(viewBoxOrderRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public ViewBoxOrderDto findById(Integer id) {
|
||||
ViewBoxOrder viewBoxOrder = viewBoxOrderRepository.findById(id).orElseGet(ViewBoxOrder::new);
|
||||
ValidationUtil.isNull(viewBoxOrder.getId(),"ViewBoxOrder","id",id);
|
||||
return viewBoxOrderMapper.toDto(viewBoxOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public ViewBoxOrderDto create(ViewBoxOrder resources) {
|
||||
return viewBoxOrderMapper.toDto(viewBoxOrderRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(ViewBoxOrder resources) {
|
||||
ViewBoxOrder viewBoxOrder = viewBoxOrderRepository.findById(resources.getId()).orElseGet(ViewBoxOrder::new);
|
||||
ValidationUtil.isNull( viewBoxOrder.getId(),"ViewBoxOrder","id",resources.getId());
|
||||
viewBoxOrder.copy(resources);
|
||||
viewBoxOrderRepository.save(viewBoxOrder);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
viewBoxOrderRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<ViewBoxOrderDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (ViewBoxOrderDto viewBoxOrder : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("下单人", viewBoxOrder.getUserId());
|
||||
map.put("盲盒的单价", viewBoxOrder.getBoxPrice());
|
||||
map.put("购买数量", viewBoxOrder.getBoxNumber());
|
||||
map.put("支付代币code", viewBoxOrder.getPayCoinName());
|
||||
map.put("支付代币的当前单价(u)", viewBoxOrder.getPayCoinPrice());
|
||||
map.put("总支付的token数量", viewBoxOrder.getPayCoinTotal());
|
||||
map.put(" 预计收益(USDT)", viewBoxOrder.getPayMinerTotal());
|
||||
map.put("交易哈希", viewBoxOrder.getTxHash());
|
||||
map.put("付款地址", viewBoxOrder.getFromAddress());
|
||||
map.put("收款地址", viewBoxOrder.getToAddress());
|
||||
map.put("链上确认状态", viewBoxOrder.getConfirmStatus());
|
||||
map.put("订单描述", viewBoxOrder.getRemark());
|
||||
map.put("创建时间", viewBoxOrder.getCreateTime());
|
||||
map.put("更新时间", viewBoxOrder.getUpdateTime());
|
||||
map.put("钱包地址", viewBoxOrder.getAddress());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.cashierCart.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_cashier_cart")
|
||||
public class TbCashierCart implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`master_id`")
|
||||
@ApiModelProperty(value = "主单Id")
|
||||
private String masterId;
|
||||
|
||||
@Column(name = "`order_id`")
|
||||
@ApiModelProperty(value = "本次下单Id")
|
||||
private Integer orderId;
|
||||
|
||||
@Column(name = "`ref_order_id`")
|
||||
@ApiModelProperty(value = "退单Id")
|
||||
private Integer refOrderId;
|
||||
|
||||
@Column(name = "`total_amount`")
|
||||
@ApiModelProperty(value = "购物车总额")
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
@Column(name = "`product_id`")
|
||||
@ApiModelProperty(value = "商品Id")
|
||||
private String productId;
|
||||
|
||||
@Column(name = "`cover_img`")
|
||||
@ApiModelProperty(value = "商品图片")
|
||||
private String coverImg;
|
||||
|
||||
@Column(name = "`is_sku`")
|
||||
@ApiModelProperty(value = "是否sku")
|
||||
private String isSku;
|
||||
|
||||
@Column(name = "`sku_id`")
|
||||
@ApiModelProperty(value = "skuId")
|
||||
private String skuId;
|
||||
|
||||
@Column(name = "`name`")
|
||||
@ApiModelProperty(value = "商品名")
|
||||
private String name;
|
||||
|
||||
@Column(name = "`sale_price`")
|
||||
@ApiModelProperty(value = "单价")
|
||||
private BigDecimal salePrice;
|
||||
|
||||
@Column(name = "`number`",nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "结余数量")
|
||||
private Integer number;
|
||||
|
||||
@Column(name = "`total_number`")
|
||||
@ApiModelProperty(value = "总下单数量")
|
||||
private Integer totalNumber;
|
||||
|
||||
@Column(name = "`refund_number`")
|
||||
@ApiModelProperty(value = "退单数量")
|
||||
private Integer refundNumber;
|
||||
|
||||
@Column(name = "`category_id`")
|
||||
@ApiModelProperty(value = "分类Id")
|
||||
private String categoryId;
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "'购物车关闭 closed',' 购物车挂起 refund',' 购物车列表生效create',' 购物车完成final'")
|
||||
private String status;
|
||||
|
||||
@Column(name = "`type`")
|
||||
@ApiModelProperty(value = "是否为组合商品 0-单商品 1为组合商品")
|
||||
private Integer type;
|
||||
|
||||
@Column(name = "`merchant_id`")
|
||||
@ApiModelProperty(value = "商户Id")
|
||||
private String merchantId;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "店铺Id")
|
||||
private String shopId;
|
||||
|
||||
@Column(name = "`created_at`")
|
||||
@ApiModelProperty(value = "createdAt")
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`updated_at`")
|
||||
@ApiModelProperty(value = "updatedAt")
|
||||
private Long updatedAt;
|
||||
|
||||
@Column(name = "`user_id`")
|
||||
@ApiModelProperty(value = "用户的openId")
|
||||
private Integer userId;
|
||||
|
||||
@Column(name = "`table_id`")
|
||||
@ApiModelProperty(value = "台桌id")
|
||||
private Integer tableId;
|
||||
|
||||
@Column(name = "`pack_fee`")
|
||||
@ApiModelProperty(value = "打包费")
|
||||
private BigDecimal packFee;
|
||||
|
||||
@Column(name = "`trade_day`")
|
||||
@ApiModelProperty(value = "tradeDay")
|
||||
private String tradeDay;
|
||||
|
||||
@Column(name = "`is_pack`")
|
||||
@ApiModelProperty(value = "isPack")
|
||||
private String isPack;
|
||||
|
||||
@Column(name = "`is_gift`")
|
||||
@ApiModelProperty(value = "isGift")
|
||||
private String isGift;
|
||||
|
||||
@Column(name = "`pending_at`")
|
||||
@ApiModelProperty(value = "pendingAt")
|
||||
private Long pendingAt;
|
||||
|
||||
public void copy(TbCashierCart source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
@@ -13,16 +13,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.repository;
|
||||
package me.zhengjie.modules.order.cashierCart.repository;
|
||||
|
||||
import me.zhengjie.modules.oder.domain.ViewBoxOrder;
|
||||
import me.zhengjie.modules.order.cashierCart.domain.TbCashierCart;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-06-23
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
public interface ViewBoxOrderRepository extends JpaRepository<ViewBoxOrder, Integer>, JpaSpecificationExecutor<ViewBoxOrder> {
|
||||
public interface TbCashierCartRepository extends JpaRepository<TbCashierCart, Integer>, JpaSpecificationExecutor<TbCashierCart> {
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.cashierCart.rest;
|
||||
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.order.cashierCart.domain.TbCashierCart;
|
||||
import me.zhengjie.modules.order.cashierCart.service.TbCashierCartService;
|
||||
import me.zhengjie.modules.order.cashierCart.service.dto.TbCashierCartQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/cashierCart管理")
|
||||
@RequestMapping("/api/tbCashierCart")
|
||||
public class TbCashierCartController {
|
||||
|
||||
private final TbCashierCartService tbCashierCartService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void exportTbCashierCart(HttpServletResponse response, TbCashierCartQueryCriteria criteria) throws IOException {
|
||||
tbCashierCartService.download(tbCashierCartService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询/cashierCart")
|
||||
@ApiOperation("查询/cashierCart")
|
||||
public ResponseEntity<Object> queryTbCashierCart(TbCashierCartQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbCashierCartService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增/cashierCart")
|
||||
@ApiOperation("新增/cashierCart")
|
||||
public ResponseEntity<Object> createTbCashierCart(@Validated @RequestBody TbCashierCart resources){
|
||||
return new ResponseEntity<>(tbCashierCartService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改/cashierCart")
|
||||
@ApiOperation("修改/cashierCart")
|
||||
public ResponseEntity<Object> updateTbCashierCart(@Validated @RequestBody TbCashierCart resources){
|
||||
tbCashierCartService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除/cashierCart")
|
||||
@ApiOperation("删除/cashierCart")
|
||||
public ResponseEntity<Object> deleteTbCashierCart(@RequestBody Integer[] ids) {
|
||||
tbCashierCartService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service;
|
||||
package me.zhengjie.modules.order.cashierCart.service;
|
||||
|
||||
import me.zhengjie.modules.oder.domain.ViewBoxOrder;
|
||||
import me.zhengjie.modules.oder.service.dto.ViewBoxOrderDto;
|
||||
import me.zhengjie.modules.oder.service.dto.ViewBoxOrderQueryCriteria;
|
||||
import me.zhengjie.modules.order.cashierCart.domain.TbCashierCart;
|
||||
import me.zhengjie.modules.order.cashierCart.service.dto.TbCashierCartDto;
|
||||
import me.zhengjie.modules.order.cashierCart.service.dto.TbCashierCartQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
@@ -27,10 +27,10 @@ import javax.servlet.http.HttpServletResponse;
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author admin
|
||||
* @date 2023-06-23
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
public interface ViewBoxOrderService {
|
||||
public interface TbCashierCartService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
@@ -38,34 +38,34 @@ public interface ViewBoxOrderService {
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(ViewBoxOrderQueryCriteria criteria, Pageable pageable);
|
||||
Map<String,Object> queryAll(TbCashierCartQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<ViewBoxOrderDto>
|
||||
* @return List<TbCashierCartDto>
|
||||
*/
|
||||
List<ViewBoxOrderDto> queryAll(ViewBoxOrderQueryCriteria criteria);
|
||||
List<TbCashierCartDto> queryAll(TbCashierCartQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return ViewBoxOrderDto
|
||||
* @return TbCashierCartDto
|
||||
*/
|
||||
ViewBoxOrderDto findById(Integer id);
|
||||
TbCashierCartDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return ViewBoxOrderDto
|
||||
* @return TbCashierCartDto
|
||||
*/
|
||||
ViewBoxOrderDto create(ViewBoxOrder resources);
|
||||
TbCashierCartDto create(TbCashierCart resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(ViewBoxOrder resources);
|
||||
void update(TbCashierCart resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
@@ -79,5 +79,5 @@ public interface ViewBoxOrderService {
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<ViewBoxOrderDto> all, HttpServletResponse response) throws IOException;
|
||||
void download(List<TbCashierCartDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.cashierCart.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Data
|
||||
public class TbCashierCartDto implements Serializable {
|
||||
|
||||
/** id */
|
||||
private Integer id;
|
||||
|
||||
/** 主单Id */
|
||||
private String masterId;
|
||||
|
||||
/** 本次下单Id */
|
||||
private Integer orderId;
|
||||
|
||||
/** 退单Id */
|
||||
private Integer refOrderId;
|
||||
|
||||
/** 购物车总额 */
|
||||
private BigDecimal totalAmount;
|
||||
|
||||
/** 商品Id */
|
||||
private String productId;
|
||||
|
||||
/** 商品图片 */
|
||||
private String coverImg;
|
||||
|
||||
/** 是否sku */
|
||||
private String isSku;
|
||||
|
||||
/** skuId */
|
||||
private String skuId;
|
||||
|
||||
/** 商品名 */
|
||||
private String name;
|
||||
|
||||
/** 单价 */
|
||||
private BigDecimal salePrice;
|
||||
|
||||
/** 结余数量 */
|
||||
private Integer number;
|
||||
|
||||
/** 总下单数量 */
|
||||
private Integer totalNumber;
|
||||
|
||||
/** 退单数量 */
|
||||
private Integer refundNumber;
|
||||
|
||||
/** 分类Id */
|
||||
private String categoryId;
|
||||
|
||||
/** '购物车关闭 closed',' 购物车挂起 refund',' 购物车列表生效create',' 购物车完成final' */
|
||||
private String status;
|
||||
|
||||
/** 是否为组合商品 0-单商品 1为组合商品 */
|
||||
private Integer type;
|
||||
|
||||
/** 商户Id */
|
||||
private String merchantId;
|
||||
|
||||
/** 店铺Id */
|
||||
private String shopId;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
/** 用户的openId */
|
||||
private Integer userId;
|
||||
|
||||
/** 台桌id */
|
||||
private Integer tableId;
|
||||
|
||||
/** 打包费 */
|
||||
private BigDecimal packFee;
|
||||
|
||||
private String tradeDay;
|
||||
|
||||
private String isPack;
|
||||
|
||||
private String isGift;
|
||||
|
||||
private Long pendingAt;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.cashierCart.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Data
|
||||
public class TbCashierCartQueryCriteria{
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.cashierCart.service.impl;
|
||||
|
||||
import me.zhengjie.modules.order.cashierCart.domain.TbCashierCart;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.order.cashierCart.repository.TbCashierCartRepository;
|
||||
import me.zhengjie.modules.order.cashierCart.service.TbCashierCartService;
|
||||
import me.zhengjie.modules.order.cashierCart.service.dto.TbCashierCartDto;
|
||||
import me.zhengjie.modules.order.cashierCart.service.dto.TbCashierCartQueryCriteria;
|
||||
import me.zhengjie.modules.order.cashierCart.service.mapstruct.TbCashierCartMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbCashierCartServiceImpl implements TbCashierCartService {
|
||||
|
||||
private final TbCashierCartRepository tbCashierCartRepository;
|
||||
private final TbCashierCartMapper tbCashierCartMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbCashierCartQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbCashierCart> page = tbCashierCartRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbCashierCartMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbCashierCartDto> queryAll(TbCashierCartQueryCriteria criteria){
|
||||
return tbCashierCartMapper.toDto(tbCashierCartRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbCashierCartDto findById(Integer id) {
|
||||
TbCashierCart tbCashierCart = tbCashierCartRepository.findById(id).orElseGet(TbCashierCart::new);
|
||||
ValidationUtil.isNull(tbCashierCart.getId(),"TbCashierCart","id",id);
|
||||
return tbCashierCartMapper.toDto(tbCashierCart);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbCashierCartDto create(TbCashierCart resources) {
|
||||
return tbCashierCartMapper.toDto(tbCashierCartRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbCashierCart resources) {
|
||||
TbCashierCart tbCashierCart = tbCashierCartRepository.findById(resources.getId()).orElseGet(TbCashierCart::new);
|
||||
ValidationUtil.isNull( tbCashierCart.getId(),"TbCashierCart","id",resources.getId());
|
||||
tbCashierCart.copy(resources);
|
||||
tbCashierCartRepository.save(tbCashierCart);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbCashierCartRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbCashierCartDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbCashierCartDto tbCashierCart : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("主单Id", tbCashierCart.getMasterId());
|
||||
map.put("本次下单Id", tbCashierCart.getOrderId());
|
||||
map.put("退单Id", tbCashierCart.getRefOrderId());
|
||||
map.put("购物车总额", tbCashierCart.getTotalAmount());
|
||||
map.put("商品Id", tbCashierCart.getProductId());
|
||||
map.put("商品图片", tbCashierCart.getCoverImg());
|
||||
map.put("是否sku", tbCashierCart.getIsSku());
|
||||
map.put("skuId", tbCashierCart.getSkuId());
|
||||
map.put("商品名", tbCashierCart.getName());
|
||||
map.put("单价", tbCashierCart.getSalePrice());
|
||||
map.put("结余数量", tbCashierCart.getNumber());
|
||||
map.put("总下单数量", tbCashierCart.getTotalNumber());
|
||||
map.put("退单数量", tbCashierCart.getRefundNumber());
|
||||
map.put("分类Id", tbCashierCart.getCategoryId());
|
||||
map.put("'购物车关闭 closed',' 购物车挂起 refund',' 购物车列表生效create',' 购物车完成final'", tbCashierCart.getStatus());
|
||||
map.put("是否为组合商品 0-单商品 1为组合商品", tbCashierCart.getType());
|
||||
map.put("商户Id", tbCashierCart.getMerchantId());
|
||||
map.put("店铺Id", tbCashierCart.getShopId());
|
||||
map.put(" createdAt", tbCashierCart.getCreatedAt());
|
||||
map.put(" updatedAt", tbCashierCart.getUpdatedAt());
|
||||
map.put("用户的openId", tbCashierCart.getUserId());
|
||||
map.put("台桌id", tbCashierCart.getTableId());
|
||||
map.put("打包费", tbCashierCart.getPackFee());
|
||||
map.put(" tradeDay", tbCashierCart.getTradeDay());
|
||||
map.put(" isPack", tbCashierCart.getIsPack());
|
||||
map.put(" isGift", tbCashierCart.getIsGift());
|
||||
map.put(" pendingAt", tbCashierCart.getPendingAt());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
@@ -13,20 +13,20 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.mapstruct;
|
||||
package me.zhengjie.modules.order.cashierCart.service.mapstruct;
|
||||
|
||||
import me.zhengjie.base.BaseMapper;
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrderDetails;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderDetailsDto;
|
||||
import me.zhengjie.modules.order.cashierCart.domain.TbCashierCart;
|
||||
import me.zhengjie.modules.order.cashierCart.service.dto.TbCashierCartDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface BotSendOrderDetailsMapper extends BaseMapper<BotSendOrderDetailsDto, BotSendOrderDetails> {
|
||||
public interface TbCashierCartMapper extends BaseMapper<TbCashierCartDto, TbCashierCart> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.orderDetail.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_order_detail")
|
||||
public class TbOrderDetail implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "id")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`order_id`")
|
||||
@ApiModelProperty(value = "orderId")
|
||||
private Integer orderId;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "shopId")
|
||||
private Integer shopId;
|
||||
|
||||
@Column(name = "`product_id`")
|
||||
@ApiModelProperty(value = "productId")
|
||||
private Integer productId;
|
||||
|
||||
@Column(name = "`product_sku_id`")
|
||||
@ApiModelProperty(value = "productSkuId")
|
||||
private Integer productSkuId;
|
||||
|
||||
@Column(name = "`num`")
|
||||
@ApiModelProperty(value = "num")
|
||||
private Integer num;
|
||||
|
||||
@Column(name = "`product_name`")
|
||||
@ApiModelProperty(value = "productName")
|
||||
private String productName;
|
||||
|
||||
@Column(name = "`product_sku_name`")
|
||||
@ApiModelProperty(value = "productSkuName")
|
||||
private String productSkuName;
|
||||
|
||||
@Column(name = "`product_img`")
|
||||
@ApiModelProperty(value = "productImg")
|
||||
private String productImg;
|
||||
|
||||
@Column(name = "`create_time`")
|
||||
@ApiModelProperty(value = "createTime")
|
||||
private Timestamp createTime;
|
||||
|
||||
@Column(name = "`update_time`")
|
||||
@ApiModelProperty(value = "updateTime")
|
||||
private Timestamp updateTime;
|
||||
|
||||
@Column(name = "`price`")
|
||||
@ApiModelProperty(value = "price")
|
||||
private BigDecimal price;
|
||||
|
||||
@Column(name = "`price_amount`")
|
||||
@ApiModelProperty(value = "priceAmount")
|
||||
private BigDecimal priceAmount;
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "status")
|
||||
private String status;
|
||||
|
||||
@Column(name = "`pack_amount`",nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "打包费")
|
||||
private BigDecimal packAmount;
|
||||
|
||||
public void copy(TbOrderDetail source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
@@ -13,16 +13,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.repository;
|
||||
package me.zhengjie.modules.order.orderDetail.repository;
|
||||
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrderDetails;
|
||||
import me.zhengjie.modules.order.orderDetail.domain.TbOrderDetail;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
public interface BotSendOrderDetailsRepository extends JpaRepository<BotSendOrderDetails, Integer>, JpaSpecificationExecutor<BotSendOrderDetails> {
|
||||
public interface TbOrderDetailRepository extends JpaRepository<TbOrderDetail, Integer>, JpaSpecificationExecutor<TbOrderDetail> {
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.orderDetail.rest;
|
||||
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.order.orderDetail.domain.TbOrderDetail;
|
||||
import me.zhengjie.modules.order.orderDetail.service.TbOrderDetailService;
|
||||
import me.zhengjie.modules.order.orderDetail.service.dto.TbOrderDetailQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/orderDetail管理")
|
||||
@RequestMapping("/api/tbOrderDetail")
|
||||
public class TbOrderDetailController {
|
||||
|
||||
private final TbOrderDetailService tbOrderDetailService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void exportTbOrderDetail(HttpServletResponse response, TbOrderDetailQueryCriteria criteria) throws IOException {
|
||||
tbOrderDetailService.download(tbOrderDetailService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询/orderDetail")
|
||||
@ApiOperation("查询/orderDetail")
|
||||
public ResponseEntity<Object> queryTbOrderDetail(TbOrderDetailQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbOrderDetailService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增/orderDetail")
|
||||
@ApiOperation("新增/orderDetail")
|
||||
public ResponseEntity<Object> createTbOrderDetail(@Validated @RequestBody TbOrderDetail resources){
|
||||
return new ResponseEntity<>(tbOrderDetailService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改/orderDetail")
|
||||
@ApiOperation("修改/orderDetail")
|
||||
public ResponseEntity<Object> updateTbOrderDetail(@Validated @RequestBody TbOrderDetail resources){
|
||||
tbOrderDetailService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除/orderDetail")
|
||||
@ApiOperation("删除/orderDetail")
|
||||
public ResponseEntity<Object> deleteTbOrderDetail(@RequestBody Integer[] ids) {
|
||||
tbOrderDetailService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service;
|
||||
package me.zhengjie.modules.order.orderDetail.service;
|
||||
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrderDetails;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderDetailsDto;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderDetailsQueryCriteria;
|
||||
import me.zhengjie.modules.order.orderDetail.domain.TbOrderDetail;
|
||||
import me.zhengjie.modules.order.orderDetail.service.dto.TbOrderDetailDto;
|
||||
import me.zhengjie.modules.order.orderDetail.service.dto.TbOrderDetailQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
@@ -27,10 +27,10 @@ import javax.servlet.http.HttpServletResponse;
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author admin
|
||||
* @date 2023-10-31
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
public interface BotSendOrderDetailsService {
|
||||
public interface TbOrderDetailService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
@@ -38,34 +38,34 @@ public interface BotSendOrderDetailsService {
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(BotSendOrderDetailsQueryCriteria criteria, Pageable pageable);
|
||||
Map<String,Object> queryAll(TbOrderDetailQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<BotSendOrderDetailsDto>
|
||||
* @return List<TbOrderDetailDto>
|
||||
*/
|
||||
List<BotSendOrderDetailsDto> queryAll(BotSendOrderDetailsQueryCriteria criteria);
|
||||
List<TbOrderDetailDto> queryAll(TbOrderDetailQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return BotSendOrderDetailsDto
|
||||
* @return TbOrderDetailDto
|
||||
*/
|
||||
BotSendOrderDetailsDto findById(Integer id);
|
||||
TbOrderDetailDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return BotSendOrderDetailsDto
|
||||
* @return TbOrderDetailDto
|
||||
*/
|
||||
BotSendOrderDetailsDto create(BotSendOrderDetails resources);
|
||||
TbOrderDetailDto create(TbOrderDetail resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(BotSendOrderDetails resources);
|
||||
void update(TbOrderDetail resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
@@ -79,5 +79,5 @@ public interface BotSendOrderDetailsService {
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<BotSendOrderDetailsDto> all, HttpServletResponse response) throws IOException;
|
||||
void download(List<TbOrderDetailDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.orderDetail.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.sql.Timestamp;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Data
|
||||
public class TbOrderDetailDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
private Integer orderId;
|
||||
|
||||
private Integer shopId;
|
||||
|
||||
private Integer productId;
|
||||
|
||||
private Integer productSkuId;
|
||||
|
||||
private Integer num;
|
||||
|
||||
private String productName;
|
||||
|
||||
private String productSkuName;
|
||||
|
||||
private String productImg;
|
||||
|
||||
private Timestamp createTime;
|
||||
|
||||
private Timestamp updateTime;
|
||||
|
||||
private BigDecimal price;
|
||||
|
||||
private BigDecimal priceAmount;
|
||||
|
||||
private String status;
|
||||
|
||||
/** 打包费 */
|
||||
private BigDecimal packAmount;
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.orderDetail.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Data
|
||||
public class TbOrderDetailQueryCriteria{
|
||||
}
|
||||
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.orderDetail.service.impl;
|
||||
|
||||
import me.zhengjie.modules.order.orderDetail.domain.TbOrderDetail;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.order.orderDetail.repository.TbOrderDetailRepository;
|
||||
import me.zhengjie.modules.order.orderDetail.service.TbOrderDetailService;
|
||||
import me.zhengjie.modules.order.orderDetail.service.dto.TbOrderDetailDto;
|
||||
import me.zhengjie.modules.order.orderDetail.service.dto.TbOrderDetailQueryCriteria;
|
||||
import me.zhengjie.modules.order.orderDetail.service.mapstruct.TbOrderDetailMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbOrderDetailServiceImpl implements TbOrderDetailService {
|
||||
|
||||
private final TbOrderDetailRepository tbOrderDetailRepository;
|
||||
private final TbOrderDetailMapper tbOrderDetailMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbOrderDetailQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbOrderDetail> page = tbOrderDetailRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbOrderDetailMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbOrderDetailDto> queryAll(TbOrderDetailQueryCriteria criteria){
|
||||
return tbOrderDetailMapper.toDto(tbOrderDetailRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbOrderDetailDto findById(Integer id) {
|
||||
TbOrderDetail tbOrderDetail = tbOrderDetailRepository.findById(id).orElseGet(TbOrderDetail::new);
|
||||
ValidationUtil.isNull(tbOrderDetail.getId(),"TbOrderDetail","id",id);
|
||||
return tbOrderDetailMapper.toDto(tbOrderDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbOrderDetailDto create(TbOrderDetail resources) {
|
||||
return tbOrderDetailMapper.toDto(tbOrderDetailRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbOrderDetail resources) {
|
||||
TbOrderDetail tbOrderDetail = tbOrderDetailRepository.findById(resources.getId()).orElseGet(TbOrderDetail::new);
|
||||
ValidationUtil.isNull( tbOrderDetail.getId(),"TbOrderDetail","id",resources.getId());
|
||||
tbOrderDetail.copy(resources);
|
||||
tbOrderDetailRepository.save(tbOrderDetail);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbOrderDetailRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbOrderDetailDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbOrderDetailDto tbOrderDetail : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put(" orderId", tbOrderDetail.getOrderId());
|
||||
map.put(" shopId", tbOrderDetail.getShopId());
|
||||
map.put(" productId", tbOrderDetail.getProductId());
|
||||
map.put(" productSkuId", tbOrderDetail.getProductSkuId());
|
||||
map.put(" num", tbOrderDetail.getNum());
|
||||
map.put(" productName", tbOrderDetail.getProductName());
|
||||
map.put(" productSkuName", tbOrderDetail.getProductSkuName());
|
||||
map.put(" productImg", tbOrderDetail.getProductImg());
|
||||
map.put(" createTime", tbOrderDetail.getCreateTime());
|
||||
map.put(" updateTime", tbOrderDetail.getUpdateTime());
|
||||
map.put(" price", tbOrderDetail.getPrice());
|
||||
map.put(" priceAmount", tbOrderDetail.getPriceAmount());
|
||||
map.put(" status", tbOrderDetail.getStatus());
|
||||
map.put("打包费", tbOrderDetail.getPackAmount());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
@@ -13,20 +13,20 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.mapstruct;
|
||||
package me.zhengjie.modules.order.orderDetail.service.mapstruct;
|
||||
|
||||
import me.zhengjie.base.BaseMapper;
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrder;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderDto;
|
||||
import me.zhengjie.modules.order.orderDetail.domain.TbOrderDetail;
|
||||
import me.zhengjie.modules.order.orderDetail.service.dto.TbOrderDetailDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface BotSendOrderMapper extends BaseMapper<BotSendOrderDto, BotSendOrder> {
|
||||
public interface TbOrderDetailMapper extends BaseMapper<TbOrderDetailDto, TbOrderDetail> {
|
||||
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.orderInfo.domain;
|
||||
package me.zhengjie.modules.order.orderInfo.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
@@ -28,7 +28,7 @@ import java.io.Serializable;
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2023-11-22
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@@ -42,120 +42,127 @@ public class TbOrderInfo implements Serializable {
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`order_no`")
|
||||
@ApiModelProperty(value = "订单编号")
|
||||
private String orderNo;
|
||||
|
||||
@Column(name = "`settlement_amount`")
|
||||
@ApiModelProperty(value = "商户结算金额")
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
@Column(name = "`pack_fee`")
|
||||
@ApiModelProperty(value = "包装费")
|
||||
private BigDecimal packFee;
|
||||
|
||||
@Column(name = "`origin_amount`")
|
||||
@ApiModelProperty(value = "订单原金额")
|
||||
private BigDecimal originAmount;
|
||||
|
||||
@Column(name = "`product_amount`")
|
||||
@ApiModelProperty(value = "商品售价")
|
||||
private BigDecimal productAmount;
|
||||
|
||||
@Column(name = "`amount`")
|
||||
@ApiModelProperty(value = "最终金额---退单后,金额变动")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Column(name = "`refund_amount`")
|
||||
@ApiModelProperty(value = "退单金额")
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
@Column(name = "`pay_amount`")
|
||||
@ApiModelProperty(value = "支付金额")
|
||||
private BigDecimal payAmount;
|
||||
|
||||
@Column(name = "`freight_amount`")
|
||||
@ApiModelProperty(value = "订单邮递费用")
|
||||
private BigDecimal freightAmount;
|
||||
|
||||
@Column(name = "`cash_paid_amount`")
|
||||
private BigDecimal cashPaidAmount;
|
||||
|
||||
@Column(name = "`wx_paid_amount`")
|
||||
private BigDecimal wxPaidAmount;
|
||||
|
||||
@Column(name = "`ali_paid_amount`")
|
||||
private BigDecimal aliPaidAmount;
|
||||
|
||||
@Column(name = "`deposit_paid_amount`")
|
||||
private BigDecimal depositPaidAmount;
|
||||
|
||||
@Column(name = "`bank_paid_amount`")
|
||||
private BigDecimal bankPaidAmount;
|
||||
|
||||
@Column(name = "`virtual_paid_amount`")
|
||||
private BigDecimal virtualPaidAmount;
|
||||
|
||||
@Column(name = "`other_paid_amount`")
|
||||
private BigDecimal otherPaidAmount;
|
||||
|
||||
@Column(name = "`discount_amount`")
|
||||
@ApiModelProperty(value = "折扣金额")
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
@Column(name = "`table_id`")
|
||||
@ApiModelProperty(value = "台桌Id")
|
||||
private String tableId;
|
||||
|
||||
@Column(name = "`small_change`")
|
||||
@ApiModelProperty(value = "订单抹零")
|
||||
private BigDecimal smallChange;
|
||||
|
||||
@Column(name = "`send_type`")
|
||||
@ApiModelProperty(value = "发货类型")
|
||||
private String sendType;
|
||||
|
||||
@Column(name = "`order_type`")
|
||||
@ApiModelProperty(value = "订单类型-cash收银-miniapp小程序-offline线下")
|
||||
private String orderType;
|
||||
|
||||
@Column(name = "`product_type`")
|
||||
@ApiModelProperty(value = "订单里面商品的类型")
|
||||
private String productType;
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "状态: unpaid 待支付unsend待发货 closed 订单完成 send 已发refunding申请退单refund退单cancelled取消订单merge合台")
|
||||
private String status;
|
||||
|
||||
@Column(name = "`billing_id`")
|
||||
@ApiModelProperty(value = "orderType为union-minor时,parentId生效,为其上级合单id")
|
||||
private String billingId;
|
||||
|
||||
@Column(name = "`merchant_id`")
|
||||
@ApiModelProperty(value = "对于平台订单,是收款商户Id")
|
||||
private String merchantId;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "店铺Id")
|
||||
private String shopId;
|
||||
|
||||
@Column(name = "`is_vip`")
|
||||
@ApiModelProperty(value = "是否vip订单")
|
||||
private Integer isVip;
|
||||
|
||||
@Column(name = "`member_id`")
|
||||
@ApiModelProperty(value = "商户会员Id")
|
||||
private String memberId;
|
||||
|
||||
@Column(name = "`user_id`")
|
||||
@ApiModelProperty(value = "用户Id")
|
||||
private String userId;
|
||||
|
||||
@Column(name = "`product_score`")
|
||||
@ApiModelProperty(value = "该订单商品赠送的积分")
|
||||
private Integer productScore;
|
||||
|
||||
@Column(name = "`deduct_score`")
|
||||
@ApiModelProperty(value = "抵扣积分")
|
||||
private Integer deductScore;
|
||||
|
||||
@Column(name = "`user_coupon_id`")
|
||||
@ApiModelProperty(value = "用户使用的卡券")
|
||||
private String userCouponId;
|
||||
|
||||
@Column(name = "`user_coupon_amount`")
|
||||
@ApiModelProperty(value = "优惠券抵扣金额")
|
||||
private BigDecimal userCouponAmount;
|
||||
|
||||
@Column(name = "`is_master`")
|
||||
private Integer isMaster;
|
||||
|
||||
@Column(name = "`master_id`")
|
||||
@ApiModelProperty(value = "如果为退单时,主单号")
|
||||
private String masterId;
|
||||
|
||||
@Column(name = "`refund_able`")
|
||||
@ApiModelProperty(value = "是否支持退款,1支持退单, 0不支持退单")
|
||||
private Integer refundAble;
|
||||
|
||||
@Column(name = "`paid_time`")
|
||||
@ApiModelProperty(value = "支付时间")
|
||||
private Long paidTime;
|
||||
|
||||
@Column(name = "`is_effect`")
|
||||
@ApiModelProperty(value = "是否生效,若订单合单之后,则原订单不会生效")
|
||||
private Integer isEffect;
|
||||
|
||||
@Column(name = "`is_group`")
|
||||
@ApiModelProperty(value = "是否合台")
|
||||
private Integer isGroup;
|
||||
|
||||
@Column(name = "`updated_at`")
|
||||
@@ -163,14 +170,45 @@ public class TbOrderInfo implements Serializable {
|
||||
private Long updatedAt;
|
||||
|
||||
@Column(name = "`system_time`")
|
||||
@ApiModelProperty(value = "系统时间")
|
||||
private Long systemTime;
|
||||
|
||||
@Column(name = "`created_at`")
|
||||
@ApiModelProperty(value = "createdAt")
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`is_accepted`")
|
||||
@ApiModelProperty(value = "收银台是否已接单")
|
||||
private Integer isAccepted;
|
||||
|
||||
@Column(name = "`pay_type`")
|
||||
@ApiModelProperty(value = "支付类型")
|
||||
private String payType;
|
||||
|
||||
@Column(name = "`order_amount`")
|
||||
@ApiModelProperty(value = "订单金额")
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
@Column(name = "`discount_ratio`")
|
||||
@ApiModelProperty(value = "折扣比例")
|
||||
private BigDecimal discountRatio;
|
||||
|
||||
@Column(name = "`pay_order_no`")
|
||||
@ApiModelProperty(value = "支付订单号")
|
||||
private String payOrderNo;
|
||||
|
||||
@Column(name = "`trade_day`")
|
||||
@ApiModelProperty(value = "tradeDay")
|
||||
private String tradeDay;
|
||||
|
||||
@Column(name = "`source`")
|
||||
@ApiModelProperty(value = "source")
|
||||
private Integer source;
|
||||
|
||||
@Column(name = "`remark`")
|
||||
@ApiModelProperty(value = "remark")
|
||||
private String remark;
|
||||
|
||||
public void copy(TbOrderInfo source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
@@ -13,16 +13,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.orderInfo.repository;
|
||||
package me.zhengjie.modules.order.orderInfo.repository;
|
||||
|
||||
import me.zhengjie.modules.orderInfo.domain.TbOrderInfo;
|
||||
import me.zhengjie.modules.order.orderInfo.domain.TbOrderInfo;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2023-11-22
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
public interface TbOrderInfoRepository extends JpaRepository<TbOrderInfo, Integer>, JpaSpecificationExecutor<TbOrderInfo> {
|
||||
}
|
||||
@@ -13,12 +13,12 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.orderInfo.rest;
|
||||
package me.zhengjie.modules.order.orderInfo.rest;
|
||||
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.orderInfo.domain.TbOrderInfo;
|
||||
import me.zhengjie.modules.orderInfo.service.TbOrderInfoService;
|
||||
import me.zhengjie.modules.orderInfo.service.dto.TbOrderInfoQueryCriteria;
|
||||
import me.zhengjie.modules.order.orderInfo.domain.TbOrderInfo;
|
||||
import me.zhengjie.modules.order.orderInfo.service.TbOrderInfoService;
|
||||
import me.zhengjie.modules.order.orderInfo.service.dto.TbOrderInfoQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.http.HttpStatus;
|
||||
@@ -33,53 +33,48 @@ import javax.servlet.http.HttpServletResponse;
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2023-11-22
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/orderInfo")
|
||||
@Api(tags = "/orderInfo管理")
|
||||
@RequestMapping("/api/tbOrderInfo")
|
||||
public class TbOrderInfoController {
|
||||
|
||||
private final TbOrderInfoService tbOrderInfoService;
|
||||
|
||||
@Log("")
|
||||
@ApiOperation("")
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('tbOrderInfo:list')")
|
||||
public void exportTbOrderInfo(HttpServletResponse response, TbOrderInfoQueryCriteria criteria) throws IOException {
|
||||
tbOrderInfoService.download(tbOrderInfoService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("/orderInfo")
|
||||
@ApiOperation("/orderInfo")
|
||||
@PreAuthorize("@el.check('tbOrderInfo:list')")
|
||||
@Log("查询/orderInfo")
|
||||
@ApiOperation("查询/orderInfo")
|
||||
public ResponseEntity<Object> queryTbOrderInfo(TbOrderInfoQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbOrderInfoService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("/orderInfo")
|
||||
@ApiOperation("/orderInfo")
|
||||
@PreAuthorize("@el.check('tbOrderInfo:add')")
|
||||
@Log("新增/orderInfo")
|
||||
@ApiOperation("新增/orderInfo")
|
||||
public ResponseEntity<Object> createTbOrderInfo(@Validated @RequestBody TbOrderInfo resources){
|
||||
return new ResponseEntity<>(tbOrderInfoService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("/orderInfo")
|
||||
@ApiOperation("/orderInfo")
|
||||
@PreAuthorize("@el.check('tbOrderInfo:edit')")
|
||||
@Log("修改/orderInfo")
|
||||
@ApiOperation("修改/orderInfo")
|
||||
public ResponseEntity<Object> updateTbOrderInfo(@Validated @RequestBody TbOrderInfo resources){
|
||||
tbOrderInfoService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("/orderInfo")
|
||||
@ApiOperation("/orderInfo")
|
||||
@PreAuthorize("@el.check('tbOrderInfo:del')")
|
||||
@Log("删除/orderInfo")
|
||||
@ApiOperation("删除/orderInfo")
|
||||
public ResponseEntity<Object> deleteTbOrderInfo(@RequestBody Integer[] ids) {
|
||||
tbOrderInfoService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
@@ -13,11 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.orderInfo.service;
|
||||
package me.zhengjie.modules.order.orderInfo.service;
|
||||
|
||||
import me.zhengjie.modules.orderInfo.domain.TbOrderInfo;
|
||||
import me.zhengjie.modules.orderInfo.service.dto.TbOrderInfoDto;
|
||||
import me.zhengjie.modules.orderInfo.service.dto.TbOrderInfoQueryCriteria;
|
||||
import me.zhengjie.modules.order.orderInfo.domain.TbOrderInfo;
|
||||
import me.zhengjie.modules.order.orderInfo.service.dto.TbOrderInfoDto;
|
||||
import me.zhengjie.modules.order.orderInfo.service.dto.TbOrderInfoQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
@@ -26,56 +26,56 @@ import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description
|
||||
* @description 服务接口
|
||||
* @author lyf
|
||||
* @date 2023-11-22
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
public interface TbOrderInfoService {
|
||||
|
||||
/**
|
||||
*
|
||||
* @param criteria
|
||||
* @param pageable
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbOrderInfoQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* <EFBFBD>
|
||||
* @param criteria
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbOrderInfoDto>
|
||||
*/
|
||||
List<TbOrderInfoDto> queryAll(TbOrderInfoQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* ID<EFBFBD><EFBFBD>ѯ
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbOrderInfoDto
|
||||
*/
|
||||
TbOrderInfoDto findById(Integer id);
|
||||
|
||||
/**
|
||||
*
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbOrderInfoDto
|
||||
*/
|
||||
TbOrderInfoDto create(TbOrderInfo resources);
|
||||
|
||||
/**
|
||||
* <EFBFBD>༭
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbOrderInfo resources);
|
||||
|
||||
/**
|
||||
* <EFBFBD><EFBFBD>ѡɾ<EFBFBD><EFBFBD>
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
*
|
||||
* @param all
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.orderInfo.service.dto;
|
||||
package me.zhengjie.modules.order.orderInfo.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
@@ -23,136 +23,131 @@ import java.io.Serializable;
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2023-11-22
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Data
|
||||
public class TbOrderInfoDto implements Serializable {
|
||||
|
||||
private Integer id;
|
||||
|
||||
/** 订单编号 */
|
||||
private String orderNo;
|
||||
|
||||
/** <EFBFBD>̻<EFBFBD><EFBFBD><EFBFBD> */
|
||||
/** 商户结算金额 */
|
||||
private BigDecimal settlementAmount;
|
||||
|
||||
/** <EFBFBD><EFBFBD>װ<EFBFBD><EFBFBD> */
|
||||
/** 包装费 */
|
||||
private BigDecimal packFee;
|
||||
|
||||
/** ԭ<EFBFBD><EFBFBD><EFBFBD> */
|
||||
/** 订单原金额 */
|
||||
private BigDecimal originAmount;
|
||||
|
||||
/** <EFBFBD><EFBFBD>Ʒ<EFBFBD>ۼ<EFBFBD> */
|
||||
/** 商品售价 */
|
||||
private BigDecimal productAmount;
|
||||
|
||||
/** <EFBFBD><EFBFBD><EFBFBD>ս<EFBFBD><EFBFBD>---<2D>˵<EFBFBD><CBB5><EFBFBD><F3A3ACBD>䶯 */
|
||||
/** 最终金额---退单后,金额变动 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** <EFBFBD>˵ */
|
||||
/** 退单金额 */
|
||||
private BigDecimal refundAmount;
|
||||
|
||||
/** ֧<EFBFBD> */
|
||||
/** 支付金额 */
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/** <EFBFBD>ʵݷ<EFBFBD><EFBFBD><EFBFBD> */
|
||||
/** 订单邮递费用 */
|
||||
private BigDecimal freightAmount;
|
||||
|
||||
/** <EFBFBD>ֽ<EFBFBD>֧<EFBFBD> */
|
||||
private BigDecimal cashPaidAmount;
|
||||
|
||||
/** <><CEA2>֧<EFBFBD> */
|
||||
private BigDecimal wxPaidAmount;
|
||||
|
||||
/** ֧֧<D6A7> */
|
||||
private BigDecimal aliPaidAmount;
|
||||
|
||||
/** <20><>ֵ֧<D6B5> */
|
||||
private BigDecimal depositPaidAmount;
|
||||
|
||||
/** ֧<> */
|
||||
private BigDecimal bankPaidAmount;
|
||||
|
||||
/** ֧<> */
|
||||
private BigDecimal virtualPaidAmount;
|
||||
|
||||
/** ֧<> */
|
||||
private BigDecimal otherPaidAmount;
|
||||
|
||||
/** <20>ۿ۽<DBBF><DBBD> */
|
||||
/** 折扣金额 */
|
||||
private BigDecimal discountAmount;
|
||||
|
||||
/** ̨<EFBFBD><EFBFBD>Id */
|
||||
/** 台桌Id */
|
||||
private String tableId;
|
||||
|
||||
/** Ĩ<EFBFBD><EFBFBD> */
|
||||
/** 订单抹零 */
|
||||
private BigDecimal smallChange;
|
||||
|
||||
/** */
|
||||
/** 发货类型 */
|
||||
private String sendType;
|
||||
|
||||
/** -cash-miniappС-offline */
|
||||
/** 订单类型-cash收银-miniapp小程序-offline线下 */
|
||||
private String orderType;
|
||||
|
||||
/** <EFBFBD><EFBFBD>Ʒ<EFBFBD><EFBFBD> */
|
||||
/** 订单里面商品的类型 */
|
||||
private String productType;
|
||||
|
||||
/** ״̬: unpaid <EFBFBD><EFBFBD>֧<EFBFBD><EFBFBD>unsend<EFBFBD><EFBFBD> closed <EFBFBD><EFBFBD><EFBFBD> send <EFBFBD>ѷ<EFBFBD>refunding<EFBFBD>˵<EFBFBD>refund<EFBFBD>˵<EFBFBD>cancelledȡ<EFBFBD><EFBFBD>merge<EFBFBD><EFBFBD>̨ */
|
||||
/** 状态: unpaid 待支付unsend待发货 closed 订单完成 send 已发refunding申请退单refund退单cancelled取消订单merge合台 */
|
||||
private String status;
|
||||
|
||||
/** orderTypeΪunion-minorʱ<EFBFBD><EFBFBD>parentId<EFBFBD><EFBFBD>Ч<EFBFBD><EFBFBD>Ϊ<EFBFBD><EFBFBD><EFBFBD>ϼ<EFBFBD><EFBFBD>ϵ<EFBFBD>id */
|
||||
/** orderType为union-minor时,parentId生效,为其上级合单id */
|
||||
private String billingId;
|
||||
|
||||
/** ƽ̨,<2C><><EFBFBD>տ<EFBFBD><D5BF>̻<EFBFBD>Id */
|
||||
/** 对于平台订单,是收款商户Id */
|
||||
private String merchantId;
|
||||
|
||||
/** Id */
|
||||
/** 店铺Id */
|
||||
private String shopId;
|
||||
|
||||
/** <EFBFBD>Ƿ<EFBFBD>vip */
|
||||
/** 是否vip订单 */
|
||||
private Integer isVip;
|
||||
|
||||
/** <EFBFBD>̻<EFBFBD><EFBFBD><EFBFBD>ԱId */
|
||||
/** 商户会员Id */
|
||||
private String memberId;
|
||||
|
||||
/** <EFBFBD>û<EFBFBD>Id */
|
||||
/** 用户Id */
|
||||
private String userId;
|
||||
|
||||
/** <EFBFBD>ö<EFBFBD>Ʒ<EFBFBD><EFBFBD><EFBFBD>͵Ļ<EFBFBD><EFBFBD><EFBFBD> */
|
||||
/** 该订单商品赠送的积分 */
|
||||
private Integer productScore;
|
||||
|
||||
/** <EFBFBD>ֿۻ<EFBFBD><EFBFBD><EFBFBD> */
|
||||
/** 抵扣积分 */
|
||||
private Integer deductScore;
|
||||
|
||||
/** <EFBFBD>û<EFBFBD>ʹ<EFBFBD>õĿ<EFBFBD>ȯ */
|
||||
/** 用户使用的卡券 */
|
||||
private String userCouponId;
|
||||
|
||||
/** <EFBFBD>Ż<EFBFBD>ȯ<EFBFBD>ֿ۽<EFBFBD><EFBFBD> */
|
||||
/** 优惠券抵扣金额 */
|
||||
private BigDecimal userCouponAmount;
|
||||
|
||||
/** <EFBFBD>Ƿ<EFBFBD> */
|
||||
private Integer isMaster;
|
||||
|
||||
/** <20><><EFBFBD>Ϊ<EFBFBD>˵<EFBFBD>ʱ */
|
||||
/** 如果为退单时,主单号 */
|
||||
private String masterId;
|
||||
|
||||
/** <EFBFBD>Ƿ<EFBFBD>֧<EFBFBD><EFBFBD><EFBFBD>˿1֧<EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD> 0<><30>֧<EFBFBD><D6A7><EFBFBD>˵<EFBFBD> */
|
||||
/** 是否支持退款,1支持退单, 0不支持退单 */
|
||||
private Integer refundAble;
|
||||
|
||||
/** ֧<EFBFBD><EFBFBD>ʱ<EFBFBD><EFBFBD> */
|
||||
/** 支付时间 */
|
||||
private Long paidTime;
|
||||
|
||||
/** <EFBFBD>Ƿ<EFBFBD><EFBFBD><EFBFBD>Ч<EFBFBD>ϵ<EFBFBD>֮ԭ<EFBFBD><EFBFBD>Ч */
|
||||
/** 是否生效,若订单合单之后,则原订单不会生效 */
|
||||
private Integer isEffect;
|
||||
|
||||
/** <EFBFBD>Ƿ<EFBFBD><EFBFBD>̨ */
|
||||
/** 是否合台 */
|
||||
private Integer isGroup;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
/** ϵͳʱ<EFBFBD><EFBFBD> */
|
||||
/** 系统时间 */
|
||||
private Long systemTime;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
/** ̨<EFBFBD>Ƿ<EFBFBD><EFBFBD>ѽӵ<EFBFBD> */
|
||||
/** 收银台是否已接单 */
|
||||
private Integer isAccepted;
|
||||
|
||||
/** 支付类型 */
|
||||
private String payType;
|
||||
|
||||
/** 订单金额 */
|
||||
private BigDecimal orderAmount;
|
||||
|
||||
/** 折扣比例 */
|
||||
private BigDecimal discountRatio;
|
||||
|
||||
/** 支付订单号 */
|
||||
private String payOrderNo;
|
||||
|
||||
private String tradeDay;
|
||||
|
||||
private Integer source;
|
||||
|
||||
private String remark;
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.orderInfo.service.dto;
|
||||
package me.zhengjie.modules.order.orderInfo.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
@@ -23,7 +23,7 @@ import me.zhengjie.annotation.Query;
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2023-11-22
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Data
|
||||
public class TbOrderInfoQueryCriteria{
|
||||
@@ -44,34 +44,6 @@ public class TbOrderInfoQueryCriteria{
|
||||
@Query
|
||||
private BigDecimal payAmount;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private BigDecimal cashPaidAmount;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private BigDecimal wxPaidAmount;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private BigDecimal aliPaidAmount;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private BigDecimal depositPaidAmount;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private BigDecimal bankPaidAmount;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private BigDecimal virtualPaidAmount;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private BigDecimal otherPaidAmount;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String sendType;
|
||||
@@ -0,0 +1,145 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.order.orderInfo.service.impl;
|
||||
|
||||
import me.zhengjie.modules.order.orderInfo.domain.TbOrderInfo;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.order.orderInfo.repository.TbOrderInfoRepository;
|
||||
import me.zhengjie.modules.order.orderInfo.service.TbOrderInfoService;
|
||||
import me.zhengjie.modules.order.orderInfo.service.dto.TbOrderInfoDto;
|
||||
import me.zhengjie.modules.order.orderInfo.service.dto.TbOrderInfoQueryCriteria;
|
||||
import me.zhengjie.modules.order.orderInfo.service.mapstruct.TbOrderInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||
|
||||
private final TbOrderInfoRepository tbOrderInfoRepository;
|
||||
private final TbOrderInfoMapper tbOrderInfoMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbOrderInfoQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbOrderInfo> page = tbOrderInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbOrderInfoMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbOrderInfoDto> queryAll(TbOrderInfoQueryCriteria criteria){
|
||||
return tbOrderInfoMapper.toDto(tbOrderInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbOrderInfoDto findById(Integer id) {
|
||||
TbOrderInfo tbOrderInfo = tbOrderInfoRepository.findById(id).orElseGet(TbOrderInfo::new);
|
||||
ValidationUtil.isNull(tbOrderInfo.getId(),"TbOrderInfo","id",id);
|
||||
return tbOrderInfoMapper.toDto(tbOrderInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbOrderInfoDto create(TbOrderInfo resources) {
|
||||
return tbOrderInfoMapper.toDto(tbOrderInfoRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbOrderInfo resources) {
|
||||
TbOrderInfo tbOrderInfo = tbOrderInfoRepository.findById(resources.getId()).orElseGet(TbOrderInfo::new);
|
||||
ValidationUtil.isNull( tbOrderInfo.getId(),"TbOrderInfo","id",resources.getId());
|
||||
tbOrderInfo.copy(resources);
|
||||
tbOrderInfoRepository.save(tbOrderInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbOrderInfoRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbOrderInfoDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbOrderInfoDto tbOrderInfo : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("订单编号", tbOrderInfo.getOrderNo());
|
||||
map.put("商户结算金额", tbOrderInfo.getSettlementAmount());
|
||||
map.put("包装费", tbOrderInfo.getPackFee());
|
||||
map.put("订单原金额", tbOrderInfo.getOriginAmount());
|
||||
map.put("商品售价", tbOrderInfo.getProductAmount());
|
||||
map.put("最终金额---退单后,金额变动", tbOrderInfo.getAmount());
|
||||
map.put("退单金额", tbOrderInfo.getRefundAmount());
|
||||
map.put("支付金额", tbOrderInfo.getPayAmount());
|
||||
map.put("订单邮递费用", tbOrderInfo.getFreightAmount());
|
||||
map.put("折扣金额", tbOrderInfo.getDiscountAmount());
|
||||
map.put("台桌Id", tbOrderInfo.getTableId());
|
||||
map.put("订单抹零", tbOrderInfo.getSmallChange());
|
||||
map.put("发货类型", tbOrderInfo.getSendType());
|
||||
map.put("订单类型-cash收银-miniapp小程序-offline线下", tbOrderInfo.getOrderType());
|
||||
map.put("订单里面商品的类型", tbOrderInfo.getProductType());
|
||||
map.put("状态: unpaid 待支付unsend待发货 closed 订单完成 send 已发refunding申请退单refund退单cancelled取消订单merge合台", tbOrderInfo.getStatus());
|
||||
map.put("orderType为union-minor时,parentId生效,为其上级合单id", tbOrderInfo.getBillingId());
|
||||
map.put("对于平台订单,是收款商户Id", tbOrderInfo.getMerchantId());
|
||||
map.put("店铺Id", tbOrderInfo.getShopId());
|
||||
map.put("是否vip订单", tbOrderInfo.getIsVip());
|
||||
map.put("商户会员Id", tbOrderInfo.getMemberId());
|
||||
map.put("用户Id", tbOrderInfo.getUserId());
|
||||
map.put("该订单商品赠送的积分", tbOrderInfo.getProductScore());
|
||||
map.put("抵扣积分", tbOrderInfo.getDeductScore());
|
||||
map.put("用户使用的卡券", tbOrderInfo.getUserCouponId());
|
||||
map.put("优惠券抵扣金额", tbOrderInfo.getUserCouponAmount());
|
||||
map.put("如果为退单时,主单号", tbOrderInfo.getMasterId());
|
||||
map.put("是否支持退款,1支持退单, 0不支持退单", tbOrderInfo.getRefundAble());
|
||||
map.put("支付时间", tbOrderInfo.getPaidTime());
|
||||
map.put("是否生效,若订单合单之后,则原订单不会生效", tbOrderInfo.getIsEffect());
|
||||
map.put("是否合台", tbOrderInfo.getIsGroup());
|
||||
map.put(" updatedAt", tbOrderInfo.getUpdatedAt());
|
||||
map.put("系统时间", tbOrderInfo.getSystemTime());
|
||||
map.put(" createdAt", tbOrderInfo.getCreatedAt());
|
||||
map.put("收银台是否已接单", tbOrderInfo.getIsAccepted());
|
||||
map.put("支付类型", tbOrderInfo.getPayType());
|
||||
map.put("订单金额", tbOrderInfo.getOrderAmount());
|
||||
map.put("折扣比例", tbOrderInfo.getDiscountRatio());
|
||||
map.put("支付订单号", tbOrderInfo.getPayOrderNo());
|
||||
map.put(" tradeDay", tbOrderInfo.getTradeDay());
|
||||
map.put(" source", tbOrderInfo.getSource());
|
||||
map.put(" remark", tbOrderInfo.getRemark());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
@@ -13,18 +13,18 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.orderInfo.service.mapstruct;
|
||||
package me.zhengjie.modules.order.orderInfo.service.mapstruct;
|
||||
|
||||
import me.zhengjie.base.BaseMapper;
|
||||
import me.zhengjie.modules.orderInfo.domain.TbOrderInfo;
|
||||
import me.zhengjie.modules.orderInfo.service.dto.TbOrderInfoDto;
|
||||
import me.zhengjie.modules.order.orderInfo.domain.TbOrderInfo;
|
||||
import me.zhengjie.modules.order.orderInfo.service.dto.TbOrderInfoDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2023-11-22
|
||||
* @date 2024-03-02
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbOrderInfoMapper extends BaseMapper<TbOrderInfoDto, TbOrderInfo> {
|
||||
@@ -1,146 +0,0 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.orderInfo.service.impl;
|
||||
|
||||
import me.zhengjie.modules.orderInfo.domain.TbOrderInfo;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.orderInfo.repository.TbOrderInfoRepository;
|
||||
import me.zhengjie.modules.orderInfo.service.TbOrderInfoService;
|
||||
import me.zhengjie.modules.orderInfo.service.dto.TbOrderInfoDto;
|
||||
import me.zhengjie.modules.orderInfo.service.dto.TbOrderInfoQueryCriteria;
|
||||
import me.zhengjie.modules.orderInfo.service.mapstruct.TbOrderInfoMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description
|
||||
* @author lyf
|
||||
* @date 2023-11-22
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbOrderInfoServiceImpl implements TbOrderInfoService {
|
||||
|
||||
private final TbOrderInfoRepository tbOrderInfoRepository;
|
||||
private final TbOrderInfoMapper tbOrderInfoMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbOrderInfoQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbOrderInfo> page = tbOrderInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbOrderInfoMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbOrderInfoDto> queryAll(TbOrderInfoQueryCriteria criteria){
|
||||
return tbOrderInfoMapper.toDto(tbOrderInfoRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbOrderInfoDto findById(Integer id) {
|
||||
TbOrderInfo tbOrderInfo = tbOrderInfoRepository.findById(id).orElseGet(TbOrderInfo::new);
|
||||
ValidationUtil.isNull(tbOrderInfo.getId(),"TbOrderInfo","id",id);
|
||||
return tbOrderInfoMapper.toDto(tbOrderInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbOrderInfoDto create(TbOrderInfo resources) {
|
||||
return tbOrderInfoMapper.toDto(tbOrderInfoRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbOrderInfo resources) {
|
||||
TbOrderInfo tbOrderInfo = tbOrderInfoRepository.findById(resources.getId()).orElseGet(TbOrderInfo::new);
|
||||
ValidationUtil.isNull( tbOrderInfo.getId(),"TbOrderInfo","id",resources.getId());
|
||||
tbOrderInfo.copy(resources);
|
||||
tbOrderInfoRepository.save(tbOrderInfo);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbOrderInfoRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbOrderInfoDto> all, HttpServletResponse response) throws IOException {
|
||||
// List<Map<String, Object>> list = new ArrayList<>();
|
||||
// for (TbOrderInfoDto tbOrderInfo : all) {
|
||||
// Map<String,Object> map = new LinkedHashMap<>();
|
||||
// map.put("<22><><EFBFBD>", tbOrderInfo.getOrderNo());
|
||||
// map.put("<22>̻<EFBFBD><CCBB><EFBFBD>", tbOrderInfo.getSettlementAmount());
|
||||
// map.put("<22><>װ<EFBFBD><D7B0>", tbOrderInfo.getPackFee());
|
||||
// map.put("ԭ<><D4AD><EFBFBD>", tbOrderInfo.getOriginAmount());
|
||||
// map.put("<22><>Ʒ<EFBFBD>ۼ<EFBFBD>", tbOrderInfo.getProductAmount());
|
||||
// map.put("<22><><EFBFBD>ս<EFBFBD><D5BD>---<2D>˵<EFBFBD><CBB5><EFBFBD><F3A3ACBD>䶯", tbOrderInfo.getAmount());
|
||||
// map.put("<22>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>", tbOrderInfo.getRefundAmount());
|
||||
// map.put("֧<><D6A7><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getPayAmount());
|
||||
// map.put("<22><><EFBFBD><EFBFBD><EFBFBD>ʵݷ<CAB5><DDB7><EFBFBD>", tbOrderInfo.getFreightAmount());
|
||||
// map.put("<22>ֽ<EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getCashPaidAmount());
|
||||
// map.put("<><CEA2>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getWxPaidAmount());
|
||||
// map.put("֧<><D6A7><EFBFBD><EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getAliPaidAmount());
|
||||
// map.put("<22><>ֵ֧<D6B5><D6A7><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getDepositPaidAmount());
|
||||
// map.put("<22><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getBankPaidAmount());
|
||||
// map.put("<22><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getVirtualPaidAmount());
|
||||
// map.put("<22><><EFBFBD><EFBFBD>֧<EFBFBD><D6A7><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getOtherPaidAmount());
|
||||
// map.put("<22>ۿ۽<DBBF><DBBD>", tbOrderInfo.getDiscountAmount());
|
||||
// map.put("̨<><CCA8>Id", tbOrderInfo.getTableId());
|
||||
// map.put("<22><><EFBFBD><EFBFBD>Ĩ<EFBFBD><C4A8>", tbOrderInfo.getSmallChange());
|
||||
// map.put("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getSendType());
|
||||
// map.put("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>-cash<73><68><EFBFBD><EFBFBD>-miniappС<70><D0A1><EFBFBD><EFBFBD>-offline<6E><65><EFBFBD><EFBFBD>", tbOrderInfo.getOrderType());
|
||||
// map.put("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getProductType());
|
||||
// map.put("״̬: unpaid <20><>֧<EFBFBD><D6A7>unsend<6E><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD> closed <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> send <20>ѷ<EFBFBD>refunding<6E><67><EFBFBD><EFBFBD><EFBFBD>˵<EFBFBD>refund<6E>˵<EFBFBD>cancelledȡ<64><C8A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>merge<67><65>̨", tbOrderInfo.getStatus());
|
||||
// map.put("orderTypeΪunion-minorʱ<72><CAB1>parentId<49><64>Ч<EFBFBD><D0A7>Ϊ<EFBFBD><CEAA><EFBFBD>ϼ<EFBFBD><CFBC>ϵ<EFBFBD>id", tbOrderInfo.getBillingId());
|
||||
// map.put("<22><><EFBFBD><EFBFBD>ƽ̨<C6BD><CCA8><EFBFBD><EFBFBD>,<2C><><EFBFBD>տ<EFBFBD><D5BF>̻<EFBFBD>Id", tbOrderInfo.getMerchantId());
|
||||
// map.put("<22><><EFBFBD><EFBFBD>Id", tbOrderInfo.getShopId());
|
||||
// map.put("<22>Ƿ<EFBFBD>vip<69><70><EFBFBD><EFBFBD>", tbOrderInfo.getIsVip());
|
||||
// map.put("<22>̻<EFBFBD><CCBB><EFBFBD>ԱId", tbOrderInfo.getMemberId());
|
||||
// map.put("<22>û<EFBFBD>Id", tbOrderInfo.getUserId());
|
||||
// map.put("<22>ö<EFBFBD><C3B6><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>͵Ļ<CDB5><C4BB><EFBFBD>", tbOrderInfo.getProductScore());
|
||||
// map.put("<22>ֿۻ<D6BF><DBBB><EFBFBD>", tbOrderInfo.getDeductScore());
|
||||
// map.put("<22>û<EFBFBD>ʹ<EFBFBD>õĿ<C3B5>ȯ", tbOrderInfo.getUserCouponId());
|
||||
// map.put("<22>Ż<EFBFBD>ȯ<EFBFBD>ֿ۽<D6BF><DBBD>", tbOrderInfo.getUserCouponAmount());
|
||||
// map.put("<22>Ƿ<EFBFBD><C7B7><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getIsMaster());
|
||||
// map.put("<22><><EFBFBD>Ϊ<EFBFBD>˵<EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>", tbOrderInfo.getMasterId());
|
||||
// map.put("<22>Ƿ<EFBFBD>֧<EFBFBD><D6A7><EFBFBD>˿1֧<31><D6A7><EFBFBD>˵<EFBFBD><CBB5><EFBFBD> 0<><30>֧<EFBFBD><D6A7><EFBFBD>˵<EFBFBD>", tbOrderInfo.getRefundAble());
|
||||
// map.put("֧<><D6A7>ʱ<EFBFBD><CAB1>", tbOrderInfo.getPaidTime());
|
||||
// map.put("<22>Ƿ<EFBFBD><C7B7><EFBFBD>Ч<EFBFBD><D0A7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵ<EFBFBD>֮<EFBFBD><D6AE><EFBFBD><EFBFBD>ԭ<EFBFBD><D4AD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ч", tbOrderInfo.getIsEffect());
|
||||
// map.put("<22>Ƿ<EFBFBD><C7B7>̨", tbOrderInfo.getIsGroup());
|
||||
// map.put(" updatedAt", tbOrderInfo.getUpdatedAt());
|
||||
// map.put("ϵͳʱ<CDB3><CAB1>", tbOrderInfo.getSystemTime());
|
||||
// map.put(" createdAt", tbOrderInfo.getCreatedAt());
|
||||
// map.put("<22><><EFBFBD><EFBFBD>̨<EFBFBD>Ƿ<EFBFBD><C7B7>ѽӵ<D1BD>", tbOrderInfo.getIsAccepted());
|
||||
// list.add(map);
|
||||
// }
|
||||
FileUtil.downloadExcel(new ArrayList<>(), response);
|
||||
}
|
||||
}
|
||||
@@ -87,6 +87,10 @@ public class TbShopPayType implements Serializable {
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sorts;
|
||||
|
||||
@Column(name = "icon")
|
||||
@ApiModelProperty(value = "图标")
|
||||
private String icon;
|
||||
|
||||
public void copy(TbShopPayType source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
|
||||
@@ -63,4 +63,8 @@ public class TbShopPayTypeDto implements Serializable {
|
||||
|
||||
/** 排序 */
|
||||
private Integer sorts;
|
||||
/**
|
||||
* 图标
|
||||
*/
|
||||
private String icon;
|
||||
}
|
||||
@@ -57,7 +57,7 @@ public class TbShopPayTypeServiceImpl implements TbShopPayTypeService {
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbShopPayTypeQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbShopPayType> page = tbShopPayTypeRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbShopPayTypeMapper::toDto));
|
||||
return PageUtil.toPage(page.getContent(),page.getTotalElements());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -79,6 +79,9 @@ public class TbShopPayTypeServiceImpl implements TbShopPayTypeService {
|
||||
if (resources.getPayName() == null || "".equals(resources.getPayName())){
|
||||
throw new BadRequestException("付款方式不能为空");
|
||||
}
|
||||
if (resources.getIcon() == null || "".equals(resources.getIcon())){
|
||||
throw new BadRequestException("支付方式图标不能为空");
|
||||
}
|
||||
//类型转换
|
||||
String nameByType = PayTypeEnum.getNameByType(resources.getPayName());
|
||||
resources.setPayType(nameByType);
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopStaff.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_pluss_shop_staff")
|
||||
public class TbPlussShopStaff implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "自增")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`code`")
|
||||
@ApiModelProperty(value = "员工编号")
|
||||
private String code;
|
||||
|
||||
@Column(name = "`name`")
|
||||
@ApiModelProperty(value = "员工名称")
|
||||
private String name;
|
||||
|
||||
@Column(name = "`account`")
|
||||
@ApiModelProperty(value = "登录账号")
|
||||
private String account;
|
||||
|
||||
@Column(name = "`password`")
|
||||
@ApiModelProperty(value = "密码")
|
||||
private String password;
|
||||
|
||||
@Column(name = "`max_discount_amount`")
|
||||
@ApiModelProperty(value = "最大优惠金额")
|
||||
private BigDecimal maxDiscountAmount;
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "1启用0不启用")
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "`employee`")
|
||||
@ApiModelProperty(value = "登录端")
|
||||
private String employee;
|
||||
|
||||
@Column(name = "`shop_id`")
|
||||
@ApiModelProperty(value = "shopId")
|
||||
private String shopId;
|
||||
|
||||
@Column(name = "`created_at`")
|
||||
@ApiModelProperty(value = "createdAt")
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`updated_at`")
|
||||
@ApiModelProperty(value = "updatedAt")
|
||||
private Long updatedAt;
|
||||
|
||||
public void copy(TbPlussShopStaff source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopStaff.repository;
|
||||
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.domain.TbPlussShopStaff;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
public interface TbPlussShopStaffRepository extends JpaRepository<TbPlussShopStaff, Integer>, JpaSpecificationExecutor<TbPlussShopStaff> {
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopStaff.rest;
|
||||
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.domain.TbPlussShopStaff;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.service.TbPlussShopStaffService;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.service.dto.TbPlussShopStaffQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/shop/shopStaff管理")
|
||||
@RequestMapping("/api/tbPlussShopStaff")
|
||||
public class TbPlussShopStaffController {
|
||||
|
||||
private final TbPlussShopStaffService tbPlussShopStaffService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
public void exportTbPlussShopStaff(HttpServletResponse response, TbPlussShopStaffQueryCriteria criteria) throws IOException {
|
||||
tbPlussShopStaffService.download(tbPlussShopStaffService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询/shop/shopStaff")
|
||||
@ApiOperation("查询/shop/shopStaff")
|
||||
public ResponseEntity<Object> queryTbPlussShopStaff(TbPlussShopStaffQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbPlussShopStaffService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增/shop/shopStaff")
|
||||
@ApiOperation("新增/shop/shopStaff")
|
||||
public ResponseEntity<Object> createTbPlussShopStaff(@Validated @RequestBody TbPlussShopStaff resources){
|
||||
return new ResponseEntity<>(tbPlussShopStaffService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改/shop/shopStaff")
|
||||
@ApiOperation("修改/shop/shopStaff")
|
||||
public ResponseEntity<Object> updateTbPlussShopStaff(@Validated @RequestBody TbPlussShopStaff resources){
|
||||
tbPlussShopStaffService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除/shop/shopStaff")
|
||||
@ApiOperation("删除/shop/shopStaff")
|
||||
public ResponseEntity<Object> deleteTbPlussShopStaff(@RequestBody Integer[] ids) {
|
||||
tbPlussShopStaffService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopStaff.service;
|
||||
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.domain.TbPlussShopStaff;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.service.dto.TbPlussShopStaffDto;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.service.dto.TbPlussShopStaffQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
public interface TbPlussShopStaffService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
* @param criteria 条件
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(TbPlussShopStaffQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<TbPlussShopStaffDto>
|
||||
*/
|
||||
List<TbPlussShopStaffDto> queryAll(TbPlussShopStaffQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return TbPlussShopStaffDto
|
||||
*/
|
||||
TbPlussShopStaffDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return TbPlussShopStaffDto
|
||||
*/
|
||||
TbPlussShopStaffDto create(TbPlussShopStaff resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(TbPlussShopStaff resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
* @param ids /
|
||||
*/
|
||||
void deleteAll(Integer[] ids);
|
||||
|
||||
/**
|
||||
* 导出数据
|
||||
* @param all 待导出的数据
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<TbPlussShopStaffDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopStaff.service.dto;
|
||||
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Data
|
||||
public class TbPlussShopStaffDto implements Serializable {
|
||||
|
||||
/** 自增 */
|
||||
private Integer id;
|
||||
|
||||
/** 员工编号 */
|
||||
private String code;
|
||||
|
||||
/** 员工名称 */
|
||||
private String name;
|
||||
|
||||
/** 登录账号 */
|
||||
private String account;
|
||||
|
||||
/** 密码 */
|
||||
private String password;
|
||||
|
||||
/** 最大优惠金额 */
|
||||
private BigDecimal maxDiscountAmount;
|
||||
|
||||
/** 1启用0不启用 */
|
||||
private Integer status;
|
||||
|
||||
/** 登录端 */
|
||||
private String employee;
|
||||
|
||||
/** shopId */
|
||||
private String shopId;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.dto;
|
||||
package me.zhengjie.modules.shopInfo.shopStaff.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
@@ -21,25 +21,13 @@ import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-06-23
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Data
|
||||
public class ViewBoxOrderQueryCriteria{
|
||||
public class TbPlussShopStaffQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String payCoinName;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String toAddress;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String confirmStatus;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String address;
|
||||
private String shopId;
|
||||
}
|
||||
@@ -0,0 +1,113 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopStaff.service.impl;
|
||||
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.domain.TbPlussShopStaff;
|
||||
import me.zhengjie.utils.*;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.repository.TbPlussShopStaffRepository;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.service.TbPlussShopStaffService;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.service.dto.TbPlussShopStaffDto;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.service.dto.TbPlussShopStaffQueryCriteria;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.service.mapstruct.TbPlussShopStaffMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbPlussShopStaffServiceImpl implements TbPlussShopStaffService {
|
||||
|
||||
private final TbPlussShopStaffRepository tbPlussShopStaffRepository;
|
||||
private final TbPlussShopStaffMapper tbPlussShopStaffMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbPlussShopStaffQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbPlussShopStaff> page = tbPlussShopStaffRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbPlussShopStaffMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbPlussShopStaffDto> queryAll(TbPlussShopStaffQueryCriteria criteria){
|
||||
return tbPlussShopStaffMapper.toDto(tbPlussShopStaffRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbPlussShopStaffDto findById(Integer id) {
|
||||
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(id).orElseGet(TbPlussShopStaff::new);
|
||||
ValidationUtil.isNull(tbPlussShopStaff.getId(),"TbPlussShopStaff","id",id);
|
||||
return tbPlussShopStaffMapper.toDto(tbPlussShopStaff);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbPlussShopStaffDto create(TbPlussShopStaff resources) {
|
||||
resources.setPassword(MD5Utils.md5("123456"));
|
||||
resources.setCreatedAt(Instant.now().toEpochMilli());
|
||||
resources.setUpdatedAt(Instant.now().toEpochMilli());
|
||||
return tbPlussShopStaffMapper.toDto(tbPlussShopStaffRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbPlussShopStaff resources) {
|
||||
TbPlussShopStaff tbPlussShopStaff = tbPlussShopStaffRepository.findById(resources.getId()).orElseGet(TbPlussShopStaff::new);
|
||||
ValidationUtil.isNull( tbPlussShopStaff.getId(),"TbPlussShopStaff","id",resources.getId());
|
||||
tbPlussShopStaff.copy(resources);
|
||||
tbPlussShopStaffRepository.save(tbPlussShopStaff);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbPlussShopStaffRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbPlussShopStaffDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbPlussShopStaffDto tbPlussShopStaff : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("员工编号", tbPlussShopStaff.getCode());
|
||||
map.put("员工名称", tbPlussShopStaff.getName());
|
||||
map.put("登录账号", tbPlussShopStaff.getAccount());
|
||||
map.put("密码", tbPlussShopStaff.getPassword());
|
||||
map.put("最大优惠金额", tbPlussShopStaff.getMaxDiscountAmount());
|
||||
map.put("1启用0不启用", tbPlussShopStaff.getStatus());
|
||||
map.put("登录端", tbPlussShopStaff.getEmployee());
|
||||
map.put("shopId", tbPlussShopStaff.getShopId());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopStaff.service.mapstruct;
|
||||
|
||||
import me.zhengjie.base.BaseMapper;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.domain.TbPlussShopStaff;
|
||||
import me.zhengjie.modules.shopInfo.shopStaff.service.dto.TbPlussShopStaffDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface TbPlussShopStaffMapper extends BaseMapper<TbPlussShopStaffDto, TbPlussShopStaff> {
|
||||
|
||||
}
|
||||
@@ -0,0 +1,157 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopUser.domain;
|
||||
|
||||
import lombok.Data;
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import cn.hutool.core.bean.copier.CopyOptions;
|
||||
import javax.persistence.*;
|
||||
import javax.validation.constraints.*;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Entity
|
||||
@Data
|
||||
@Table(name="tb_shop_user")
|
||||
public class TbShopUser implements Serializable {
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
@Column(name = "`id`")
|
||||
@ApiModelProperty(value = "(随机)")
|
||||
private Integer id;
|
||||
|
||||
@Column(name = "`amount`")
|
||||
@ApiModelProperty(value = "钱包余额")
|
||||
private BigDecimal amount;
|
||||
|
||||
@Column(name = "`credit_amount`")
|
||||
@ApiModelProperty(value = "授权金额")
|
||||
private BigDecimal creditAmount;
|
||||
|
||||
@Column(name = "`consume_amount`")
|
||||
@ApiModelProperty(value = "消费累计")
|
||||
private BigDecimal consumeAmount;
|
||||
|
||||
@Column(name = "`consume_number`")
|
||||
@ApiModelProperty(value = "消费数量累计")
|
||||
private Integer consumeNumber;
|
||||
|
||||
@Column(name = "`level_consume`",nullable = false)
|
||||
@NotNull
|
||||
@ApiModelProperty(value = "等级积分")
|
||||
private BigDecimal levelConsume;
|
||||
|
||||
@Column(name = "`status`")
|
||||
@ApiModelProperty(value = "0-不可使用 1可使用")
|
||||
private Integer status;
|
||||
|
||||
@Column(name = "`merchant_id`")
|
||||
@ApiModelProperty(value = "代理Id")
|
||||
private String merchantId;
|
||||
|
||||
@Column(name = "`shop_id`",nullable = false)
|
||||
@NotBlank
|
||||
@ApiModelProperty(value = "店铺Id")
|
||||
private String shopId;
|
||||
|
||||
@Column(name = "`user_id`")
|
||||
@ApiModelProperty(value = "用户Id")
|
||||
private String userId;
|
||||
|
||||
@Column(name = "`parent_id`")
|
||||
@ApiModelProperty(value = "上级Id")
|
||||
private String parentId;
|
||||
|
||||
@Column(name = "`parent_level`")
|
||||
@ApiModelProperty(value = "上级的层级")
|
||||
private String parentLevel;
|
||||
|
||||
@Column(name = "`name`")
|
||||
@ApiModelProperty(value = "真实名字")
|
||||
private String name;
|
||||
|
||||
@Column(name = "`head_img`")
|
||||
@ApiModelProperty(value = "headImg")
|
||||
private String headImg;
|
||||
|
||||
@Column(name = "`sex`")
|
||||
@ApiModelProperty(value = "性别")
|
||||
private Integer sex;
|
||||
|
||||
@Column(name = "`birth_day`")
|
||||
@ApiModelProperty(value = "生日")
|
||||
private String birthDay;
|
||||
|
||||
@Column(name = "`telephone`")
|
||||
@ApiModelProperty(value = "联系电话")
|
||||
private String telephone;
|
||||
|
||||
@Column(name = "`is_vip`")
|
||||
@ApiModelProperty(value = "是否会员,")
|
||||
private Integer isVip;
|
||||
|
||||
@Column(name = "`code`")
|
||||
@ApiModelProperty(value = "会员编号")
|
||||
private String code;
|
||||
|
||||
@Column(name = "`is_attention`")
|
||||
@ApiModelProperty(value = "是否通过关注而成为会员的,此字段固定后不改")
|
||||
private Integer isAttention;
|
||||
|
||||
@Column(name = "`attention_at`")
|
||||
@ApiModelProperty(value = "关注时间")
|
||||
private Integer attentionAt;
|
||||
|
||||
@Column(name = "`is_shareholder`")
|
||||
@ApiModelProperty(value = "是否股东(分销商)")
|
||||
private Integer isShareholder;
|
||||
|
||||
@Column(name = "`level`")
|
||||
@ApiModelProperty(value = "层级1-顶级 2-次级 3最低")
|
||||
private Integer level;
|
||||
|
||||
@Column(name = "`distribute_type`")
|
||||
@ApiModelProperty(value = "分销类型 auto-自动获取 set手动设置 charge充值")
|
||||
private String distributeType;
|
||||
|
||||
@Column(name = "`sort`")
|
||||
@ApiModelProperty(value = "排序")
|
||||
private Integer sort;
|
||||
|
||||
@Column(name = "`created_at`")
|
||||
@ApiModelProperty(value = "createdAt")
|
||||
private Long createdAt;
|
||||
|
||||
@Column(name = "`updated_at`")
|
||||
@ApiModelProperty(value = "updatedAt")
|
||||
private Long updatedAt;
|
||||
|
||||
@Column(name = "`mini_open_id`")
|
||||
@ApiModelProperty(value = "小程序openId")
|
||||
private String miniOpenId;
|
||||
|
||||
public void copy(TbShopUser source){
|
||||
BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true));
|
||||
}
|
||||
}
|
||||
@@ -13,16 +13,16 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.repository;
|
||||
package me.zhengjie.modules.shopInfo.shopUser.repository;
|
||||
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrder;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.domain.TbShopUser;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
public interface BotSendOrderRepository extends JpaRepository<BotSendOrder, Integer>, JpaSpecificationExecutor<BotSendOrder> {
|
||||
public interface TbShopUserRepository extends JpaRepository<TbShopUser, Integer>, JpaSpecificationExecutor<TbShopUser> {
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopUser.rest;
|
||||
|
||||
import me.zhengjie.annotation.Log;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.domain.TbShopUser;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.service.TbShopUserService;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.service.dto.TbShopUserQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
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;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@RestController
|
||||
@RequiredArgsConstructor
|
||||
@Api(tags = "/shop/user管理")
|
||||
@RequestMapping("/api/tbShopUser")
|
||||
public class TbShopUserController {
|
||||
|
||||
private final TbShopUserService tbShopUserService;
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('tbShopUser:list')")
|
||||
public void exportTbShopUser(HttpServletResponse response, TbShopUserQueryCriteria criteria) throws IOException {
|
||||
tbShopUserService.download(tbShopUserService.queryAll(criteria), response);
|
||||
}
|
||||
|
||||
@GetMapping
|
||||
@Log("查询/shop/user")
|
||||
@ApiOperation("查询/shop/user")
|
||||
@PreAuthorize("@el.check('tbShopUser:list')")
|
||||
public ResponseEntity<Object> queryTbShopUser(TbShopUserQueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(tbShopUserService.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
|
||||
@PostMapping
|
||||
@Log("新增/shop/user")
|
||||
@ApiOperation("新增/shop/user")
|
||||
@PreAuthorize("@el.check('tbShopUser:add')")
|
||||
public ResponseEntity<Object> createTbShopUser(@Validated @RequestBody TbShopUser resources){
|
||||
return new ResponseEntity<>(tbShopUserService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
@PutMapping
|
||||
@Log("修改/shop/user")
|
||||
@ApiOperation("修改/shop/user")
|
||||
@PreAuthorize("@el.check('tbShopUser:edit')")
|
||||
public ResponseEntity<Object> updateTbShopUser(@Validated @RequestBody TbShopUser resources){
|
||||
tbShopUserService.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
}
|
||||
|
||||
@DeleteMapping
|
||||
@Log("删除/shop/user")
|
||||
@ApiOperation("删除/shop/user")
|
||||
@PreAuthorize("@el.check('tbShopUser:del')")
|
||||
public ResponseEntity<Object> deleteTbShopUser(@RequestBody Integer[] ids) {
|
||||
tbShopUserService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
@@ -13,11 +13,11 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service;
|
||||
package me.zhengjie.modules.shopInfo.shopUser.service;
|
||||
|
||||
import me.zhengjie.modules.oder.domain.BotSendOrder;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderDto;
|
||||
import me.zhengjie.modules.oder.service.dto.BotSendOrderQueryCriteria;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.domain.TbShopUser;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.service.dto.TbShopUserDto;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.service.dto.TbShopUserQueryCriteria;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import java.util.Map;
|
||||
import java.util.List;
|
||||
@@ -27,10 +27,10 @@ import javax.servlet.http.HttpServletResponse;
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务接口
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
public interface BotSendOrderService {
|
||||
public interface TbShopUserService {
|
||||
|
||||
/**
|
||||
* 查询数据分页
|
||||
@@ -38,34 +38,34 @@ public interface BotSendOrderService {
|
||||
* @param pageable 分页参数
|
||||
* @return Map<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(BotSendOrderQueryCriteria criteria, Pageable pageable);
|
||||
Map<String,Object> queryAll(TbShopUserQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<BotSendOrderDto>
|
||||
* @return List<TbShopUserDto>
|
||||
*/
|
||||
List<BotSendOrderDto> queryAll(BotSendOrderQueryCriteria criteria);
|
||||
List<TbShopUserDto> queryAll(TbShopUserQueryCriteria criteria);
|
||||
|
||||
/**
|
||||
* 根据ID查询
|
||||
* @param id ID
|
||||
* @return BotSendOrderDto
|
||||
* @return TbShopUserDto
|
||||
*/
|
||||
BotSendOrderDto findById(Integer id);
|
||||
TbShopUserDto findById(Integer id);
|
||||
|
||||
/**
|
||||
* 创建
|
||||
* @param resources /
|
||||
* @return BotSendOrderDto
|
||||
* @return TbShopUserDto
|
||||
*/
|
||||
BotSendOrderDto create(BotSendOrder resources);
|
||||
TbShopUserDto create(TbShopUser resources);
|
||||
|
||||
/**
|
||||
* 编辑
|
||||
* @param resources /
|
||||
*/
|
||||
void update(BotSendOrder resources);
|
||||
void update(TbShopUser resources);
|
||||
|
||||
/**
|
||||
* 多选删除
|
||||
@@ -79,5 +79,5 @@ public interface BotSendOrderService {
|
||||
* @param response /
|
||||
* @throws IOException /
|
||||
*/
|
||||
void download(List<BotSendOrderDto> all, HttpServletResponse response) throws IOException;
|
||||
void download(List<TbShopUserDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopUser.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.math.BigDecimal;
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Data
|
||||
public class TbShopUserDto implements Serializable {
|
||||
|
||||
/** (随机) */
|
||||
private Integer id;
|
||||
|
||||
/** 钱包余额 */
|
||||
private BigDecimal amount;
|
||||
|
||||
/** 授权金额 */
|
||||
private BigDecimal creditAmount;
|
||||
|
||||
/** 消费累计 */
|
||||
private BigDecimal consumeAmount;
|
||||
|
||||
/** 消费数量累计 */
|
||||
private Integer consumeNumber;
|
||||
|
||||
/** 等级积分 */
|
||||
private BigDecimal levelConsume;
|
||||
|
||||
/** 0-不可使用 1可使用 */
|
||||
private Integer status;
|
||||
|
||||
/** 代理Id */
|
||||
private String merchantId;
|
||||
|
||||
/** 店铺Id */
|
||||
private String shopId;
|
||||
|
||||
/** 用户Id */
|
||||
private String userId;
|
||||
|
||||
/** 上级Id */
|
||||
private String parentId;
|
||||
|
||||
/** 上级的层级 */
|
||||
private String parentLevel;
|
||||
|
||||
/** 真实名字 */
|
||||
private String name;
|
||||
|
||||
private String headImg;
|
||||
|
||||
/** 性别 */
|
||||
private Integer sex;
|
||||
|
||||
/** 生日 */
|
||||
private String birthDay;
|
||||
|
||||
/** 联系电话 */
|
||||
private String telephone;
|
||||
|
||||
/** 是否会员, */
|
||||
private Integer isVip;
|
||||
|
||||
/** 会员编号 */
|
||||
private String code;
|
||||
|
||||
/** 是否通过关注而成为会员的,此字段固定后不改 */
|
||||
private Integer isAttention;
|
||||
|
||||
/** 关注时间 */
|
||||
private Integer attentionAt;
|
||||
|
||||
/** 是否股东(分销商) */
|
||||
private Integer isShareholder;
|
||||
|
||||
/** 层级1-顶级 2-次级 3最低 */
|
||||
private Integer level;
|
||||
|
||||
/** 分销类型 auto-自动获取 set手动设置 charge充值 */
|
||||
private String distributeType;
|
||||
|
||||
/** 排序 */
|
||||
private Integer sort;
|
||||
|
||||
private Long createdAt;
|
||||
|
||||
private Long updatedAt;
|
||||
|
||||
/** 小程序openId */
|
||||
private String miniOpenId;
|
||||
}
|
||||
@@ -13,7 +13,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.dto;
|
||||
package me.zhengjie.modules.shopInfo.shopUser.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
import java.util.List;
|
||||
@@ -21,29 +21,22 @@ import me.zhengjie.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-10-30
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Data
|
||||
public class BotSendOrderQueryCriteria{
|
||||
public class TbShopUserQueryCriteria{
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String orderCode;
|
||||
/** 模糊 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String name;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String userTelegramId;
|
||||
/** 模糊 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String telephone;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String userName;
|
||||
|
||||
/** 精确 */
|
||||
private String shopId;
|
||||
@Query
|
||||
private String status;
|
||||
|
||||
/** 精确 */
|
||||
@Query
|
||||
private String type;
|
||||
private Integer isVip=1;
|
||||
}
|
||||
@@ -0,0 +1,130 @@
|
||||
/*
|
||||
* Copyright 2019-2020 Zheng Jie
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.shopInfo.shopUser.service.impl;
|
||||
|
||||
import me.zhengjie.modules.shopInfo.shopUser.domain.TbShopUser;
|
||||
import me.zhengjie.utils.ValidationUtil;
|
||||
import me.zhengjie.utils.FileUtil;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.repository.TbShopUserRepository;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.service.TbShopUserService;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.service.dto.TbShopUserDto;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.service.dto.TbShopUserQueryCriteria;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.service.mapstruct.TbShopUserMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.data.domain.Page;
|
||||
import org.springframework.data.domain.Pageable;
|
||||
import me.zhengjie.utils.PageUtil;
|
||||
import me.zhengjie.utils.QueryHelp;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import java.util.ArrayList;
|
||||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Service
|
||||
@RequiredArgsConstructor
|
||||
public class TbShopUserServiceImpl implements TbShopUserService {
|
||||
|
||||
private final TbShopUserRepository tbShopUserRepository;
|
||||
private final TbShopUserMapper tbShopUserMapper;
|
||||
|
||||
@Override
|
||||
public Map<String,Object> queryAll(TbShopUserQueryCriteria criteria, Pageable pageable){
|
||||
Page<TbShopUser> page = tbShopUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable);
|
||||
return PageUtil.toPage(page.map(tbShopUserMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<TbShopUserDto> queryAll(TbShopUserQueryCriteria criteria){
|
||||
return tbShopUserMapper.toDto(tbShopUserRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder)));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional
|
||||
public TbShopUserDto findById(Integer id) {
|
||||
TbShopUser tbShopUser = tbShopUserRepository.findById(id).orElseGet(TbShopUser::new);
|
||||
ValidationUtil.isNull(tbShopUser.getId(),"TbShopUser","id",id);
|
||||
return tbShopUserMapper.toDto(tbShopUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public TbShopUserDto create(TbShopUser resources) {
|
||||
return tbShopUserMapper.toDto(tbShopUserRepository.save(resources));
|
||||
}
|
||||
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void update(TbShopUser resources) {
|
||||
TbShopUser tbShopUser = tbShopUserRepository.findById(resources.getId()).orElseGet(TbShopUser::new);
|
||||
ValidationUtil.isNull( tbShopUser.getId(),"TbShopUser","id",resources.getId());
|
||||
tbShopUser.copy(resources);
|
||||
tbShopUserRepository.save(tbShopUser);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAll(Integer[] ids) {
|
||||
for (Integer id : ids) {
|
||||
tbShopUserRepository.deleteById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void download(List<TbShopUserDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (TbShopUserDto tbShopUser : all) {
|
||||
Map<String,Object> map = new LinkedHashMap<>();
|
||||
map.put("钱包余额", tbShopUser.getAmount());
|
||||
map.put("授权金额", tbShopUser.getCreditAmount());
|
||||
map.put("消费累计", tbShopUser.getConsumeAmount());
|
||||
map.put("消费数量累计", tbShopUser.getConsumeNumber());
|
||||
map.put("等级积分", tbShopUser.getLevelConsume());
|
||||
map.put("0-不可使用 1可使用", tbShopUser.getStatus());
|
||||
map.put("代理Id", tbShopUser.getMerchantId());
|
||||
map.put("店铺Id", tbShopUser.getShopId());
|
||||
map.put("用户Id", tbShopUser.getUserId());
|
||||
map.put("上级Id", tbShopUser.getParentId());
|
||||
map.put("上级的层级", tbShopUser.getParentLevel());
|
||||
map.put("真实名字", tbShopUser.getName());
|
||||
map.put(" headImg", tbShopUser.getHeadImg());
|
||||
map.put("性别", tbShopUser.getSex());
|
||||
map.put("生日", tbShopUser.getBirthDay());
|
||||
map.put("联系电话", tbShopUser.getTelephone());
|
||||
map.put("是否会员,", tbShopUser.getIsVip());
|
||||
map.put("会员编号", tbShopUser.getCode());
|
||||
map.put("是否通过关注而成为会员的,此字段固定后不改", tbShopUser.getIsAttention());
|
||||
map.put("关注时间", tbShopUser.getAttentionAt());
|
||||
map.put("是否股东(分销商)", tbShopUser.getIsShareholder());
|
||||
map.put("层级1-顶级 2-次级 3最低", tbShopUser.getLevel());
|
||||
map.put("分销类型 auto-自动获取 set手动设置 charge充值", tbShopUser.getDistributeType());
|
||||
map.put("排序", tbShopUser.getSort());
|
||||
map.put(" createdAt", tbShopUser.getCreatedAt());
|
||||
map.put(" updatedAt", tbShopUser.getUpdatedAt());
|
||||
map.put("小程序openId", tbShopUser.getMiniOpenId());
|
||||
list.add(map);
|
||||
}
|
||||
FileUtil.downloadExcel(list, response);
|
||||
}
|
||||
}
|
||||
@@ -13,20 +13,20 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
package me.zhengjie.modules.oder.service.mapstruct;
|
||||
package me.zhengjie.modules.shopInfo.shopUser.service.mapstruct;
|
||||
|
||||
import me.zhengjie.base.BaseMapper;
|
||||
import me.zhengjie.modules.oder.domain.ViewBoxOrder;
|
||||
import me.zhengjie.modules.oder.service.dto.ViewBoxOrderDto;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.domain.TbShopUser;
|
||||
import me.zhengjie.modules.shopInfo.shopUser.service.dto.TbShopUserDto;
|
||||
import org.mapstruct.Mapper;
|
||||
import org.mapstruct.ReportingPolicy;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author admin
|
||||
* @date 2023-06-23
|
||||
* @author lyf
|
||||
* @date 2024-03-01
|
||||
**/
|
||||
@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
|
||||
public interface ViewBoxOrderMapper extends BaseMapper<ViewBoxOrderDto, ViewBoxOrder> {
|
||||
public interface TbShopUserMapper extends BaseMapper<TbShopUserDto, TbShopUser> {
|
||||
|
||||
}
|
||||
@@ -46,7 +46,6 @@ public class ${className}Controller {
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
@PreAuthorize("@el.check('${changeClassName}:list')")
|
||||
public void export${className}(HttpServletResponse response, ${className}QueryCriteria criteria) throws IOException {
|
||||
${changeClassName}Service.download(${changeClassName}Service.queryAll(criteria), response);
|
||||
}
|
||||
@@ -54,7 +53,6 @@ public class ${className}Controller {
|
||||
@GetMapping
|
||||
@Log("查询${apiAlias}")
|
||||
@ApiOperation("查询${apiAlias}")
|
||||
@PreAuthorize("@el.check('${changeClassName}:list')")
|
||||
public ResponseEntity<Object> query${className}(${className}QueryCriteria criteria, Pageable pageable){
|
||||
return new ResponseEntity<>(${changeClassName}Service.queryAll(criteria,pageable),HttpStatus.OK);
|
||||
}
|
||||
@@ -62,7 +60,6 @@ public class ${className}Controller {
|
||||
@PostMapping
|
||||
@Log("新增${apiAlias}")
|
||||
@ApiOperation("新增${apiAlias}")
|
||||
@PreAuthorize("@el.check('${changeClassName}:add')")
|
||||
public ResponseEntity<Object> create${className}(@Validated @RequestBody ${className} resources){
|
||||
return new ResponseEntity<>(${changeClassName}Service.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
@@ -70,7 +67,6 @@ public class ${className}Controller {
|
||||
@PutMapping
|
||||
@Log("修改${apiAlias}")
|
||||
@ApiOperation("修改${apiAlias}")
|
||||
@PreAuthorize("@el.check('${changeClassName}:edit')")
|
||||
public ResponseEntity<Object> update${className}(@Validated @RequestBody ${className} resources){
|
||||
${changeClassName}Service.update(resources);
|
||||
return new ResponseEntity<>(HttpStatus.NO_CONTENT);
|
||||
@@ -79,7 +75,6 @@ public class ${className}Controller {
|
||||
@DeleteMapping
|
||||
@Log("删除${apiAlias}")
|
||||
@ApiOperation("删除${apiAlias}")
|
||||
@PreAuthorize("@el.check('${changeClassName}:del')")
|
||||
public ResponseEntity<Object> delete${className}(@RequestBody ${pkColumnType}[] ids) {
|
||||
${changeClassName}Service.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
|
||||
Reference in New Issue
Block a user