This commit is contained in:
2026-04-07 16:02:27 +08:00
parent be37a2d92b
commit 7b948b514a
10 changed files with 309 additions and 533 deletions

View File

@@ -7,7 +7,6 @@ import com.czg.account.service.HandoverRecordService;
import com.czg.account.vo.HandoverProductListVo;
import com.czg.account.vo.HandoverTotalVo;
import com.czg.annotation.SaAdminCheckPermission;
import com.czg.constants.SystemConstants;
import com.czg.excel.ExcelExportUtil;
import com.czg.log.annotation.OperationLog;
import com.czg.resp.CzgResult;
@@ -38,7 +37,6 @@ public class HandoverRecordController {
* @param endDate 结束时间 格式yyyy-MM-dd
*/
@GetMapping("page")
@OperationLog("交班记录-分页")
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:page", name = "交班记录-分页")
public CzgResult<Page<HandoverRecordDTO>> page(@RequestParam(required = false) String beginDate, @RequestParam(required = false) String endDate) {
Page<HandoverRecordDTO> page = handoverRecordService.getHandoverRecordPage(beginDate, endDate);
@@ -46,20 +44,33 @@ public class HandoverRecordController {
}
/**
* 交班记录-查看
* 交班记录-详情
*
* @param id 交班记录ID
*/
@GetMapping("/detail/{id}")
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:detail", name = "交班记录-详情")
public CzgResult<HandoverRecordDTO> detail(@PathVariable Long id) {
HandoverRecord entity = handoverRecordService.getById(id);
HandoverRecordDTO data = BeanUtil.copyProperties(entity, HandoverRecordDTO.class);
return CzgResult.success(data);
}
/**
* 交班记录-商品详情
*
* @param id 交班记录ID
*/
@GetMapping("{id}")
@OperationLog("交班记录-查看")
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:info", name = "交班记录-查看")
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:detail", name = "交班记录-详情")
public CzgResult<List<HandoverProductListVo>> info(@PathVariable Long id) {
List<HandoverProductListVo> data = handoverRecordService.getHandoverProductListById(id);
return CzgResult.success(data);
}
/**
* 交班记录-导出
* 交班记录-商品详情导出
*
* @param id 交班记录ID
*/
@@ -71,13 +82,13 @@ public class HandoverRecordController {
ExcelExportUtil.exportToResponse(list, HandoverProductListVo.class, "交班售出商品明细", response);
}
/**
* 收银机-交班数据统计
* 收银机-实时交班数据
*/
@GetMapping("total")
@OperationLog("收银机-交班数据统计")
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:total", name = "收银机-交班数据统计")
public CzgResult<HandoverTotalVo> total() {
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:realTime", name = "收银机-实时交班数据")
public CzgResult<HandoverTotalVo> realTime() {
HandoverTotalVo data = handoverRecordService.totalHandoverData();
return CzgResult.success(data);
}
@@ -92,35 +103,7 @@ public class HandoverRecordController {
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:handover", name = "收银机-交班/关班")
public CzgResult<Long> handover(@RequestParam Integer isPrint) {
Long id = handoverRecordService.handover();
handoverRecordService.printHandoverReceipt(id, isPrint);
return CzgResult.success(id);
}
/**
* 收银机-交班/关班-网络打印机打印交班小票
*
* @param id 交班记录id
*/
@PostMapping("/network/print/{id}")
@OperationLog("收银机-交班/关班-网络打印机打印交班小票")
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:networkPrint", name = "收银机-交班/关班-网络打印机打印交班小票")
public CzgResult<Void> handover(@PathVariable Long id) {
handoverRecordService.printHandoverReceipt(id, SystemConstants.OneZero.ONE);
return CzgResult.success();
}
/**
* 交班记录-详情
*
* @param id 交班记录ID
*/
@GetMapping("/detail/{id}")
@OperationLog("交班记录-详情")
@SaAdminCheckPermission(parentName = "交班记录", value = "handoverRecord:detail", name = "交班记录-详情")
public CzgResult<HandoverRecordDTO> detail(@PathVariable Long id) {
HandoverRecord entity = handoverRecordService.getById(id);
HandoverRecordDTO data = BeanUtil.copyProperties(entity, HandoverRecordDTO.class);
return CzgResult.success(data);
}
}