Merge remote-tracking branch 'origin/master'
This commit is contained in:
@@ -0,0 +1,73 @@
|
||||
package com.czg.controller.admin;
|
||||
|
||||
import com.czg.account.entity.SyncNotice;
|
||||
import com.czg.account.service.SyncNoticeService;
|
||||
import com.czg.product.dto.SyncNoticeReadDTO;
|
||||
import com.czg.resp.CzgResult;
|
||||
import com.czg.sa.StpKit;
|
||||
import com.mybatisflex.core.paginate.Page;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* 通知中心-同步消息
|
||||
* @author Administrator
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/admin/syncNotice")
|
||||
public class SyncNoticeController {
|
||||
@Resource
|
||||
private SyncNoticeService syncNoticeService;
|
||||
|
||||
/**
|
||||
* 通知消息列表
|
||||
* @param name 名称
|
||||
* @param startTime 起始时间
|
||||
* @param endTime 结束时间
|
||||
* @param type 0-商品 1-耗材
|
||||
* @param isRead 0-未读 1-已读
|
||||
* @return 分页数据
|
||||
*/
|
||||
@GetMapping
|
||||
public CzgResult<Page<SyncNotice>> page(@RequestParam(required = false) String name, @RequestParam(required = false) String startTime,
|
||||
@RequestParam(required = false) String endTime, @RequestParam(required = false) Integer type,
|
||||
@RequestParam(required = false) Integer isRead) {
|
||||
return CzgResult.success(syncNoticeService.pageInfo(StpKit.USER.getShopId(), name, startTime, endTime, type, isRead));
|
||||
}
|
||||
|
||||
/**
|
||||
* 详情
|
||||
* @param id id
|
||||
* @return 详细信息
|
||||
*/
|
||||
@GetMapping("/detail")
|
||||
public CzgResult<SyncNotice> detail(@RequestParam Long id) {
|
||||
return CzgResult.success(syncNoticeService.getOne(new QueryWrapper().eq(SyncNotice::getShopId, StpKit.USER.getShopId()).eq(SyncNotice::getId, id)));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 已读消息
|
||||
* @return 是否成功
|
||||
*/
|
||||
@PutMapping("/read")
|
||||
public CzgResult<Boolean> read(@RequestBody @Validated SyncNoticeReadDTO syncNoticeReadDTO) {
|
||||
return CzgResult.success(syncNoticeService.read(StpKit.USER.getShopId(), syncNoticeReadDTO));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 消息统计
|
||||
* @return 消息记录数
|
||||
*/
|
||||
@PutMapping("/count")
|
||||
public CzgResult<Long> count(@RequestParam Integer isRead) {
|
||||
QueryWrapper queryWrapper = new QueryWrapper().eq(SyncNotice::getShopId, StpKit.USER.getShopId());
|
||||
queryWrapper.eq(SyncNotice::getIsRead, isRead);
|
||||
return CzgResult.success(syncNoticeService.count(queryWrapper));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -110,7 +110,7 @@ public class ShopVendorController {
|
||||
* @return 统计信息
|
||||
*/
|
||||
@GetMapping("summary")
|
||||
@OperationLog("供应商账单-统计")
|
||||
// @OperationLog("供应商账单-统计")
|
||||
public CzgResult<ShopVendorSummaryVO> summary() {
|
||||
return CzgResult.success(shopVendorService.summary(StpKit.USER.getShopId()));
|
||||
}
|
||||
@@ -120,9 +120,9 @@ public class ShopVendorController {
|
||||
* @return 账单列表
|
||||
*/
|
||||
@GetMapping("/bill")
|
||||
@OperationLog("供应商账单-列表")
|
||||
public CzgResult<Page<ShopVendorBillVO>> bill() {
|
||||
return CzgResult.success(shopVendorService.billList(StpKit.USER.getShopId()));
|
||||
// @OperationLog("供应商账单-列表")
|
||||
public CzgResult<Page<ShopVendorBillVO>> bill(@RequestParam(required = false) String key) {
|
||||
return CzgResult.success(shopVendorService.billList(StpKit.USER.getShopId(), key));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -130,9 +130,9 @@ public class ShopVendorController {
|
||||
* @return 记录list
|
||||
*/
|
||||
@GetMapping("/bill/record")
|
||||
@OperationLog("供应商账单-列表")
|
||||
public CzgResult<Page<ShopVendorBillRecordVO>> bill(@RequestParam Integer vendorId) {
|
||||
return CzgResult.success(shopVendorService.billRecord(StpKit.USER.getShopId(), vendorId));
|
||||
// @OperationLog("供应商账单-列表")
|
||||
public CzgResult<Page<ShopVendorBillRecordVO>> bill(@RequestParam Integer vendorId, @RequestParam(required = false) String key) {
|
||||
return CzgResult.success(shopVendorService.billRecord(StpKit.USER.getShopId(), vendorId, key));
|
||||
}
|
||||
|
||||
|
||||
@@ -141,7 +141,7 @@ public class ShopVendorController {
|
||||
* @return 记录list
|
||||
*/
|
||||
@PostMapping("/bill/pay")
|
||||
@OperationLog("供应商账单-付款")
|
||||
// @OperationLog("供应商账单-付款")
|
||||
public CzgResult<Boolean> pay(@RequestBody @Validated ShopVendorBillPayDTO payDTO) {
|
||||
return CzgResult.success(shopVendorService.pay(StpKit.USER.getShopId(), payDTO));
|
||||
}
|
||||
@@ -152,7 +152,7 @@ public class ShopVendorController {
|
||||
* @return 记录list
|
||||
*/
|
||||
@GetMapping("/bill/pay/record")
|
||||
@OperationLog("供应商账单-付款记录")
|
||||
// @OperationLog("供应商账单-付款记录")
|
||||
public CzgResult<Page<ShopVendorBillPayRecordVO>> payRecord(@RequestParam Long flowId) {
|
||||
return CzgResult.success(shopVendorService.payRecord(StpKit.USER.getShopId(), flowId));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user