diff --git a/fuintAdmin/src/api/integral/gift.js b/fuintAdmin/src/api/integral/gift.js index 251cff955..690282f55 100644 --- a/fuintAdmin/src/api/integral/gift.js +++ b/fuintAdmin/src/api/integral/gift.js @@ -25,4 +25,14 @@ export function getGiftApi(data) { }) } + + // 修改库存 + export function updateGiftInventoryApi(data) { + return request({ + url: 'business/integral/integralGift/updateInventory', + method: 'get', + params: data + }) + } + \ No newline at end of file diff --git a/fuintAdmin/src/api/integral/order.js b/fuintAdmin/src/api/integral/order.js new file mode 100644 index 000000000..048d71b73 --- /dev/null +++ b/fuintAdmin/src/api/integral/order.js @@ -0,0 +1,37 @@ +import request from "@/utils/request"; + +// 查询列表 +export function getOrderApi(data) { + return request({ + url: 'business/integral/integralOrders/queryByPage', + method: 'get', + params: data + }) + } + + // 新增有关信息 + export function insertOrderApi(data) { + return request({ + url: 'business/integral/integralOrders', + method: 'post', + data: data + }) + } + // 修改有关信息 + export function updateOrderApi(data) { + return request({ + url: 'business/integral/integralOrders', + method: 'put', + data: data + }) + } + + export function getStatisticsApi(data) { + return request({ + url: 'business/integral/integralOrders/statistics', + method: 'get', + params: data + }) + } + + \ No newline at end of file diff --git a/fuintAdmin/src/views/integral/gift/index.vue b/fuintAdmin/src/views/integral/gift/index.vue index ddbe4594f..456e68406 100644 --- a/fuintAdmin/src/views/integral/gift/index.vue +++ b/fuintAdmin/src/views/integral/gift/index.vue @@ -44,7 +44,11 @@ v-loading="loading" :data="dataList" :default-sort="defaultSort"> - + + + @@ -80,7 +84,13 @@ - + + + + + diff --git a/fuintAdmin/src/views/integral/order/index.vue b/fuintAdmin/src/views/integral/order/index.vue new file mode 100644 index 000000000..3b21ad263 --- /dev/null +++ b/fuintAdmin/src/views/integral/order/index.vue @@ -0,0 +1,69 @@ + + + + + + diff --git a/fuintAdmin/src/views/integral/order/pointsCashier.vue b/fuintAdmin/src/views/integral/order/pointsCashier.vue new file mode 100644 index 000000000..e69b0e5dd --- /dev/null +++ b/fuintAdmin/src/views/integral/order/pointsCashier.vue @@ -0,0 +1,184 @@ + + + + + diff --git a/fuintAdmin/src/views/integral/order/pointsMall.vue b/fuintAdmin/src/views/integral/order/pointsMall.vue new file mode 100644 index 000000000..6a51a6dc0 --- /dev/null +++ b/fuintAdmin/src/views/integral/order/pointsMall.vue @@ -0,0 +1,201 @@ + + + + + + + diff --git a/fuintBackend/configure/dev/application.properties b/fuintBackend/configure/dev/application.properties index 1aa8a9b12..668ed2f0d 100644 --- a/fuintBackend/configure/dev/application.properties +++ b/fuintBackend/configure/dev/application.properties @@ -38,7 +38,7 @@ images.root=C:/fuintV3.0.1/fuintBackend/fuint-application/target/classes images.path=/static/uploadImages/ # 上传图片服务器域名 -images.upload.url=http://localhost:8080 +images.upload.url=http://localhost:8008 # 上传图片允许的大小(单位:MB) images.upload.maxSize=5 diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralGiftController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralGiftController.java index de71c07e2..1b25f7c6b 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralGiftController.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralGiftController.java @@ -88,5 +88,17 @@ public class IntegralGiftController extends BaseController { return getSuccessResult(this.integralGiftService.deleteById(id)); } + /** + * 单独修改商品的库存 + * @param id + * @param editInventory + * @return + */ + @GetMapping("updateInventory") + public ResponseObject updateInventory(@Param("id") Integer id,@Param("editInventory") Integer editInventory) { + return getSuccessResult(this.integralGiftService.updateInventory(id,editInventory)); + } + + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java new file mode 100644 index 000000000..aca5c0f61 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/controller/IntegralOrdersController.java @@ -0,0 +1,99 @@ +package com.fuint.business.integral.controller; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.integral.entity.IntegralOrders; +import com.fuint.business.integral.service.IntegralOrdersService; +import com.fuint.business.integral.vo.IntegralOrdersVO; +import com.fuint.framework.web.BaseController; +import com.fuint.framework.web.ResponseObject; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.PageRequest; +import org.springframework.http.ResponseEntity; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; + +/** + * 存储兑换订单信息(IntegralOrders)表控制层 + * + * @author makejava + * @since 2023-11-07 13:59:23 + */ +@RestController +@RequestMapping("business/integral/integralOrders") +public class IntegralOrdersController extends BaseController { + /** + * 服务对象 + */ + @Resource + private IntegralOrdersService integralOrdersService; + + /** + * 分页查询 + * + * @param integralOrders 筛选条件 + * @param pageNo 分页对象 + * @return 查询结果 + */ + @GetMapping("queryByPage") + public ResponseObject queryByPage(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo, + @RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize, + @Param("integralOrders") IntegralOrders integralOrders) { + Page page = new Page(pageNo, pageSize); + IPage integralOrdersIPage = this.integralOrdersService.queryByPage(page, integralOrders); + return getSuccessResult(integralOrdersIPage); + } + + + /** + * 通过主键查询单条数据 + * + * @param id 主键 + * @return 单条数据 + */ + @GetMapping("{id}") + public ResponseObject queryById(@PathVariable("id") Integer id) { + return getSuccessResult(this.integralOrdersService.queryById(id)); + } + + /** + * 新增数据 + * + * @param integralOrders 实体 + * @return 新增结果 + */ + @PostMapping + public ResponseObject add(IntegralOrders integralOrders) { + return getSuccessResult(this.integralOrdersService.insert(integralOrders)); + } + + /** + * 编辑数据 + * + * @param integralOrders 实体 + * @return 编辑结果 + */ + @PutMapping + public ResponseObject edit(IntegralOrders integralOrders) { + return getSuccessResult(this.integralOrdersService.update(integralOrders)); + } + + /** + * 删除数据 + * + * @param id 主键 + * @return 删除是否成功 + */ + @DeleteMapping + public ResponseObject deleteById(Integer id) { + return getSuccessResult(this.integralOrdersService.deleteById(id)); + } + + + @GetMapping("/statistics") + public ResponseObject statistics() { + return getSuccessResult(this.integralOrdersService.statistics()); + } +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralGift.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralGift.java index 5ab37fdfd..defaceda4 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralGift.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralGift.java @@ -63,6 +63,8 @@ public class IntegralGift extends BaseEntity { * 礼品剩余库存 */ private Integer remainingInventory; + + private Integer usedInventory; /** * 商家卡券 */ @@ -79,6 +81,10 @@ public class IntegralGift extends BaseEntity { * 加钱比例 */ private Double moneyRatio; + /** + * 市场价格 + */ + private Double market; /** * 兑换金额 */ @@ -94,7 +100,7 @@ public class IntegralGift extends BaseEntity { /** * 快递运费 */ - private Double expressShippingFee; + private String expressShippingFee; /** * 运费金额 */ diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralOrders.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralOrders.java new file mode 100644 index 000000000..7c910d7a1 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/entity/IntegralOrders.java @@ -0,0 +1,84 @@ +package com.fuint.business.integral.entity; + +import com.fuint.framework.entity.BaseEntity; +import lombok.Data; + +import java.util.Date; +import java.io.Serializable; + +/** + * 存储兑换订单信息(IntegralOrders)实体类 + * + * @author makejava + * @since 2023-11-07 13:59:23 + */ +@Data +public class IntegralOrders extends BaseEntity { + private static final long serialVersionUID = 181605029480746026L; + /** + * 兑换订单id(主键) + */ + private Integer id; + /** + * 关联用户id + */ + private Integer userId; + /** + * 订单号 + */ + private String orderNumber; + /** + * 关联商品id + */ + private Integer giftId; + /** + * 配送类型 + */ + private String shippingType; + /** + * 实付信息 + */ + private Double paidInfo; + /** + * 金额 + */ + private Double amount; + /** + * 积分 + */ + private Double integral; + /** + * 加油金 + */ + private Double comeOn; + /** + * 兑换数量 + */ + private Integer exchangeQuantity; + /** + * 订单状态 + */ + private String orderStatus; + /** + * 状态 + */ + private String status; + /** + * 订单类型 + */ + private String orderType; + /** + * 处理结果 + */ + private String processingResult; + /** + * 备注 + */ + private String notes; + /** + * 店铺ID + */ + private Integer storeId; + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralGiftMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralGiftMapper.java index 36b0aaa52..761c2a206 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralGiftMapper.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralGiftMapper.java @@ -83,5 +83,8 @@ public interface IntegralGiftMapper { */ int deleteById(Integer id); + + int updateInventory(@Param("id") Integer id,@Param("editInventory") Integer editInventory,@Param("updateBy") Integer updateBy); + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java new file mode 100644 index 000000000..72a808722 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/IntegralOrdersMapper.java @@ -0,0 +1,95 @@ +package com.fuint.business.integral.mapper; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.integral.entity.IntegralGift; +import com.fuint.business.integral.entity.IntegralOrders; +import com.fuint.business.integral.vo.IntegralGiftVO; +import com.fuint.business.integral.vo.IntegralOrdersVO; +import org.apache.ibatis.annotations.Param; +import org.springframework.data.domain.Pageable; +import java.util.List; +import java.util.Map; + +/** + * 存储兑换订单信息(IntegralOrders)表数据库访问层 + * + * @author makejava + * @since 2023-11-07 13:59:23 + */ +public interface IntegralOrdersMapper { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + IntegralOrders queryById(Integer id); + + /** + * 查询指定行数据 + * + * @param integralOrders 查询条件 + * @param page 分页对象 + * @return 对象列表 + */ + IPage queryAllByLimit(@Param("page") Page page, @Param("integralOrders") IntegralOrders integralOrders); + + /** + * 统计总行数 + * + * @param integralOrders 查询条件 + * @return 总行数 + */ + long count(IntegralOrders integralOrders); + + /** + * 新增数据 + * + * @param integralOrders 实例对象 + * @return 影响行数 + */ + int insert(IntegralOrders integralOrders); + + /** + * 批量新增数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + */ + int insertBatch(@Param("entities") List entities); + + /** + * 批量新增或按主键更新数据(MyBatis原生foreach方法) + * + * @param entities List 实例对象列表 + * @return 影响行数 + * @throws org.springframework.jdbc.BadSqlGrammarException 入参是空List的时候会抛SQL语句错误的异常,请自行校验入参 + */ + int insertOrUpdateBatch(@Param("entities") List entities); + + /** + * 修改数据 + * + * @param integralOrders 实例对象 + * @return 影响行数 + */ + int update(IntegralOrders integralOrders); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 影响行数 + */ + int deleteById(Integer id); + + /** + * 统计数据 + * @return + */ + Map statistics(); + +} + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml index c85909df4..232ce7373 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralGiftMapper.xml @@ -33,6 +33,8 @@ + + @@ -84,6 +86,7 @@ ig.update_time, ig.create_by, ig.update_by, + ig.used_inventory, igc.category_name from integral_gift ig left join integral_gift_category igc ON ig.category_id = igc.id @@ -239,8 +242,8 @@ - insert into integral_gift(gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by) - values (#{giftName}, #{categoryId}, #{coverImage}, #{giftImages}, #{giftType}, #{couponId}, #{voucherId}, #{goodsId}, #{giftQuantity}, #{totalInventory}, #{remainingInventory}, #{merchantCouponId}, #{exchangeMethod}, #{exchangePoints}, #{moneyRatio}, #{exchangeAmount}, #{exchangeFuelAmount}, #{deliveryMethod}, #{expressShippingFee}, #{shippingFeeAmount}, #{exchangeTimes}, #{sort}, #{status}, #{detailedDescription}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy}) + insert into integral_gift(gift_name, category_id, cover_image, gift_images, gift_type, coupon_id, voucher_id, goods_id, gift_quantity, total_inventory, remaining_inventory, merchant_coupon_id, exchange_method, exchange_points, money_ratio, exchange_amount, exchange_fuel_amount, delivery_method, express_shipping_fee, shipping_fee_amount, exchange_times, sort, status, detailed_description, store_id, create_time, update_time, create_by, update_by,market) + values (#{giftName}, #{categoryId}, #{coverImage}, #{giftImages}, #{giftType}, #{couponId}, #{voucherId}, #{goodsId}, #{giftQuantity}, #{totalInventory}, #{remainingInventory}, #{merchantCouponId}, #{exchangeMethod}, #{exchangePoints}, #{moneyRatio}, #{exchangeAmount}, #{exchangeFuelAmount}, #{deliveryMethod}, #{expressShippingFee}, #{shippingFeeAmount}, #{exchangeTimes}, #{sort}, #{status}, #{detailedDescription}, #{storeId}, #{createTime}, #{createTime}, #{createBy}, #{updateBy},#{market}) @@ -380,6 +383,9 @@ update_by = #{updateBy}, + + market = #{market}, + where id = #{id} @@ -389,5 +395,14 @@ delete from integral_gift where id = #{id} + + update integral_gift + set + total_inventory = total_inventory + #{editInventory}, + update_by = #{updateBy}, + update_time = NOW() + where id =#{id} + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml new file mode 100644 index 000000000..31e9e723b --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/mapper/xml/IntegralOrdersMapper.xml @@ -0,0 +1,301 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + insert into integral_orders(user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on, exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time, update_time, create_by, update_by) + values (#{userId}, #{orderNumber}, #{giftId}, #{shippingType}, #{paidInfo}, #{amount}, #{integral}, #{comeOn}, #{exchangeQuantity}, #{orderStatus}, #{status}, #{orderType}, #{processingResult}, #{notes}, #{storeId}, #{createTime}, #{updateTime}, #{createBy}, #{updateBy}) + + + + insert into integral_orders(user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on, exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time, update_time, create_by, update_by) + values + + (#{entity.userId}, #{entity.orderNumber}, #{entity.giftId}, #{entity.shippingType}, #{entity.paidInfo}, #{entity.amount}, #{entity.integral}, #{entity.comeOn}, #{entity.exchangeQuantity}, #{entity.orderStatus}, #{entity.status}, #{entity.orderType}, #{entity.processingResult}, #{entity.notes}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy}) + + + + + insert into integral_orders(user_id, order_number, gift_id, shipping_type, paid_info, amount, integral, come_on, exchange_quantity, order_status, status, order_type, processing_result, notes, store_id, create_time, update_time, create_by, update_by) + values + + (#{entity.userId}, #{entity.orderNumber}, #{entity.giftId}, #{entity.shippingType}, #{entity.paidInfo}, #{entity.amount}, #{entity.integral}, #{entity.comeOn}, #{entity.exchangeQuantity}, #{entity.orderStatus}, #{entity.status}, #{entity.orderType}, #{entity.processingResult}, #{entity.notes}, #{entity.storeId}, #{entity.createTime}, #{entity.updateTime}, #{entity.createBy}, #{entity.updateBy}) + + on duplicate key update + user_id = values(user_id), + order_number = values(order_number), + gift_id = values(gift_id), + shipping_type = values(shipping_type), + paid_info = values(paid_info), + amount = values(amount), + integral = values(integral), + come_on = values(come_on), + exchange_quantity = values(exchange_quantity), + order_status = values(order_status), + status = values(status), + order_type = values(order_type), + processing_result = values(processing_result), + notes = values(notes), + store_id = values(store_id), + create_time = values(create_time), + update_time = values(update_time), + create_by = values(create_by), + update_by = values(update_by) + + + + + update integral_orders + + + user_id = #{userId}, + + + order_number = #{orderNumber}, + + + gift_id = #{giftId}, + + + shipping_type = #{shippingType}, + + + paid_info = #{paidInfo}, + + + amount = #{amount}, + + + integral = #{integral}, + + + come_on = #{comeOn}, + + + exchange_quantity = #{exchangeQuantity}, + + + order_status = #{orderStatus}, + + + status = #{status}, + + + order_type = #{orderType}, + + + processing_result = #{processingResult}, + + + notes = #{notes}, + + + store_id = #{storeId}, + + + create_time = #{createTime}, + + + update_time = #{updateTime}, + + + create_by = #{createBy}, + + + update_by = #{updateBy}, + + + where id = #{id} + + + + + delete from integral_orders where id = #{id} + + + + diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralGiftService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralGiftService.java index e2206e8e7..4fbcffcbb 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralGiftService.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralGiftService.java @@ -57,4 +57,12 @@ public interface IntegralGiftService { */ boolean deleteById(Integer id); + /** + * 单独修改商品的库存 + * @param id + * @param editInventory + * @return + */ + boolean updateInventory(@Param("id") Integer id,@Param("editInventory") Integer editInventory); + } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java new file mode 100644 index 000000000..838f8e4f1 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/IntegralOrdersService.java @@ -0,0 +1,61 @@ +package com.fuint.business.integral.service; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.fuint.business.integral.entity.IntegralOrders; +import com.fuint.business.integral.vo.IntegralOrdersVO; +import org.apache.ibatis.annotations.Param; + +import java.util.Map; + +/** + * 存储兑换订单信息(IntegralOrders)表服务接口 + * + * @author makejava + * @since 2023-11-07 13:59:23 + */ +public interface IntegralOrdersService { + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + IntegralOrders queryById(Integer id); + + /** + * 分页查询 + * + * @param integralOrders 筛选条件 + * @param page 分页对象 + * @return 查询结果 + */ + IPage queryByPage(@Param("page") Page page, @Param("integralGift") IntegralOrders integralOrders); + + /** + * 新增数据 + * + * @param integralOrders 实例对象 + * @return 实例对象 + */ + IntegralOrders insert(IntegralOrders integralOrders); + + /** + * 修改数据 + * + * @param integralOrders 实例对象 + * @return 实例对象 + */ + IntegralOrders update(IntegralOrders integralOrders); + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + boolean deleteById(Integer id); + Map statistics(); + +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralGiftServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralGiftServiceImpl.java index a1ece0715..ec25bbf44 100644 --- a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralGiftServiceImpl.java +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralGiftServiceImpl.java @@ -89,4 +89,17 @@ public class IntegralGiftServiceImpl implements IntegralGiftService { public boolean deleteById(Integer id) { return this.integralGiftDao.deleteById(id) > 0; } + + + /** + * 单独修改商品的库存 + * @param id + * @param editInventory + * @return + */ + @Override + public boolean updateInventory(@Param("id") Integer id,@Param("editInventory") Integer editInventory) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + return this.integralGiftDao.updateInventory(id,editInventory,nowAccountInfo.getStaffId()) > 0; + } } diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java new file mode 100644 index 000000000..d1baea233 --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/service/impl/IntegralOrdersServiceImpl.java @@ -0,0 +1,96 @@ +package com.fuint.business.integral.service.impl; + +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.fuint.business.integral.entity.IntegralGift; +import com.fuint.business.integral.entity.IntegralOrders; +import com.fuint.business.integral.mapper.IntegralOrdersMapper; +import com.fuint.business.integral.service.IntegralOrdersService; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; + +import com.fuint.business.integral.vo.IntegralGiftVO; +import com.fuint.business.integral.vo.IntegralOrdersVO; +import com.fuint.common.dto.AccountInfo; +import com.fuint.common.util.TokenUtil; +import org.apache.ibatis.annotations.Param; +import org.springframework.stereotype.Service; +import org.springframework.data.domain.PageImpl; +import org.springframework.data.domain.PageRequest; + +import javax.annotation.Resource; +import java.util.Map; + +/** + * 存储兑换订单信息(IntegralOrders)表服务实现类 + * + * @author makejava + * @since 2023-11-07 13:59:23 + */ +@Service("integralOrdersService") +public class IntegralOrdersServiceImpl implements IntegralOrdersService { + @Resource + private IntegralOrdersMapper integralOrdersDao; + + /** + * 通过ID查询单条数据 + * + * @param id 主键 + * @return 实例对象 + */ + @Override + public IntegralOrders queryById(Integer id) { + return this.integralOrdersDao.queryById(id); + } + + /** + * 分页查询 + * + * @param integralOrders 筛选条件 + * @param page 分页对象 + * @return 查询结果 + */ + @Override + public IPage queryByPage(@Param("page") Page page, @Param("integralOrders") IntegralOrders integralOrders) { + AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo(); + integralOrders.setStoreId(nowAccountInfo.getStoreId()); + return integralOrdersDao.queryAllByLimit(page, integralOrders); + } + /** + * 新增数据 + * + * @param integralOrders 实例对象 + * @return 实例对象 + */ + @Override + public IntegralOrders insert(IntegralOrders integralOrders) { + this.integralOrdersDao.insert(integralOrders); + return integralOrders; + } + + /** + * 修改数据 + * + * @param integralOrders 实例对象 + * @return 实例对象 + */ + @Override + public IntegralOrders update(IntegralOrders integralOrders) { + this.integralOrdersDao.update(integralOrders); + return this.queryById(integralOrders.getId()); + } + + /** + * 通过主键删除数据 + * + * @param id 主键 + * @return 是否成功 + */ + @Override + public boolean deleteById(Integer id) { + return this.integralOrdersDao.deleteById(id) > 0; + } + + @Override + public Map statistics() { + return this.integralOrdersDao.statistics(); + } +} diff --git a/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/vo/IntegralOrdersVO.java b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/vo/IntegralOrdersVO.java new file mode 100644 index 000000000..60aa9faed --- /dev/null +++ b/fuintBackend/fuint-application/src/main/java/com/fuint/business/integral/vo/IntegralOrdersVO.java @@ -0,0 +1,14 @@ +package com.fuint.business.integral.vo; + + +import com.fuint.business.integral.entity.IntegralOrders; +import lombok.Data; + +@Data +public class IntegralOrdersVO extends IntegralOrders { + private String mobile; + private String userNo; + private String name; + private String giftName; + private String coverImage; +}