交班记录代码提交
This commit is contained in:
parent
a136c24d84
commit
29181fcd87
|
|
@ -1,6 +1,8 @@
|
|||
package com.czg.controller.admin;
|
||||
|
||||
import cn.hutool.core.bean.BeanUtil;
|
||||
import com.czg.account.dto.HandoverRecordDTO;
|
||||
import com.czg.account.entity.HandoverRecord;
|
||||
import com.czg.account.service.HandoverRecordService;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import com.czg.account.vo.HandoverTotalVo;
|
||||
|
|
@ -85,10 +87,24 @@ public class HandoverRecordController {
|
|||
@PostMapping("handover")
|
||||
@OperationLog("收银机-交班/关班")
|
||||
//@SaAdminCheckPermission("handoverRecord:handover")
|
||||
public CzgResult<Void> handover(@RequestParam Integer isPrint) {
|
||||
public CzgResult<Long> handover(@RequestParam Integer isPrint) {
|
||||
Long id = handoverRecordService.handover();
|
||||
handoverRecordService.printHandoverReceipt(id, isPrint);
|
||||
return CzgResult.success();
|
||||
return CzgResult.success(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 交班记录-详情
|
||||
*
|
||||
* @param id 交班记录ID
|
||||
*/
|
||||
@GetMapping("/detail/{id}")
|
||||
@OperationLog("交班记录-详情")
|
||||
//@SaAdminCheckPermission("handoverRecord:detail")
|
||||
public CzgResult<HandoverRecordDTO> detail(@PathVariable Long id) {
|
||||
HandoverRecord entity = handoverRecordService.getById(id);
|
||||
HandoverRecordDTO data = BeanUtil.copyProperties(entity, HandoverRecordDTO.class);
|
||||
return CzgResult.success(data);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -1,12 +1,18 @@
|
|||
package com.czg.account.dto;
|
||||
|
||||
import cn.hutool.core.convert.Convert;
|
||||
import cn.hutool.core.util.StrUtil;
|
||||
import com.alibaba.fastjson2.JSON;
|
||||
import com.alibaba.fastjson2.annotation.JSONField;
|
||||
import com.czg.account.vo.HandoverCategoryListVo;
|
||||
import com.czg.account.vo.HandoverProductListVo;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serial;
|
||||
import java.io.Serializable;
|
||||
import java.math.BigDecimal;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* 交班记录表
|
||||
|
|
@ -76,10 +82,12 @@ public class HandoverRecordDTO implements Serializable {
|
|||
/**
|
||||
* 分类数据 json
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private String categoryData;
|
||||
/**
|
||||
* 商品数据 json
|
||||
*/
|
||||
@JSONField(serialize = false)
|
||||
private String productData;
|
||||
/**
|
||||
* 快捷收款金额
|
||||
|
|
@ -109,4 +117,28 @@ public class HandoverRecordDTO implements Serializable {
|
|||
@JSONField(serialize = false)
|
||||
private String endDate;
|
||||
|
||||
/**
|
||||
* 分类数据
|
||||
*/
|
||||
List<HandoverCategoryListVo> categoryDataList;
|
||||
/**
|
||||
* 商品数据
|
||||
*/
|
||||
List<HandoverProductListVo> productDatalist;
|
||||
|
||||
public Object getCategoryData() {
|
||||
return JSON.parseObject(Convert.toStr(categoryData, "{}"));
|
||||
}
|
||||
|
||||
public Object getProductData() {
|
||||
return JSON.parseObject(Convert.toStr(productData, "{}"));
|
||||
}
|
||||
|
||||
public List<HandoverCategoryListVo> getCategoryDataList() {
|
||||
return JSON.parseArray(StrUtil.blankToDefault(categoryData, "[]"), HandoverCategoryListVo.class);
|
||||
}
|
||||
|
||||
public List<HandoverProductListVo> getProductDatalist() {
|
||||
return JSON.parseArray(StrUtil.blankToDefault(productData, "[]"), HandoverProductListVo.class);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue