feat:
1.add api category type 2.add field `remarks` for order
This commit is contained in:
@@ -97,6 +97,7 @@ CREATE TABLE `kiosk_order`
|
|||||||
`total_amount` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '总金额',
|
`total_amount` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '总金额',
|
||||||
`tax_percent` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '税率',
|
`tax_percent` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '税率',
|
||||||
`tax_amount` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '税费',
|
`tax_amount` decimal(10, 2) NOT NULL DEFAULT 0 COMMENT '税费',
|
||||||
|
`remarks` text NULL COMMENT '备注',
|
||||||
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
`create_user` bigint NULL DEFAULT NULL COMMENT '创建人',
|
||||||
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
|
`create_dept` bigint NULL DEFAULT NULL COMMENT '创建部门',
|
||||||
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
`create_time` datetime NULL DEFAULT NULL COMMENT '创建时间',
|
||||||
|
|||||||
@@ -24,6 +24,19 @@ public class KioskApiController {
|
|||||||
|
|
||||||
private final IKioskApiService kioskApiService;
|
private final IKioskApiService kioskApiService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 产品类型查询
|
||||||
|
*
|
||||||
|
* @return List<DictBizApiVO>
|
||||||
|
*/
|
||||||
|
@GetMapping("/category-type")
|
||||||
|
@Operation(summary = "产品类型")
|
||||||
|
@Cacheable(cacheNames = "kiosk:category:type", key = "'all-types'")
|
||||||
|
public R<List<DictBizApiVO>> categoryType() {
|
||||||
|
List<DictBizApiVO> list = kioskApiService.categoryType();
|
||||||
|
return R.data(list);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 产品目录查询
|
* 产品目录查询
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -14,6 +14,8 @@ public class OrderApiRequest implements Serializable {
|
|||||||
|
|
||||||
private String email;
|
private String email;
|
||||||
|
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
@NotEmpty(message = "data is missing")
|
@NotEmpty(message = "data is missing")
|
||||||
private List<Item> data = List.of();
|
private List<Item> data = List.of();
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,12 @@ public class OrderEntity extends TenantEntity {
|
|||||||
/**
|
/**
|
||||||
* 税费
|
* 税费
|
||||||
*/
|
*/
|
||||||
@Schema(description = "总金额")
|
@Schema(description = "税费")
|
||||||
private BigDecimal taxAmount;
|
private BigDecimal taxAmount;
|
||||||
|
/**
|
||||||
|
* 备注
|
||||||
|
*/
|
||||||
|
@Schema(description = "备注")
|
||||||
|
private String remarks;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import java.util.List;
|
|||||||
|
|
||||||
public interface IKioskApiService {
|
public interface IKioskApiService {
|
||||||
|
|
||||||
|
List<DictBizApiVO> categoryType();
|
||||||
|
|
||||||
List<CategoryApiVO> categoryList();
|
List<CategoryApiVO> categoryList();
|
||||||
|
|
||||||
@@ -31,4 +32,5 @@ public interface IKioskApiService {
|
|||||||
Long upload(String fileName, InputStream stream);
|
Long upload(String fileName, InputStream stream);
|
||||||
|
|
||||||
List<PriceListApiVO> priceList(Long id);
|
List<PriceListApiVO> priceList(Long id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -66,8 +66,20 @@ public class KioskServiceImpl implements IKioskApiService {
|
|||||||
|
|
||||||
private static final String materialType = "material_type";
|
private static final String materialType = "material_type";
|
||||||
|
|
||||||
|
private static final String categoryType = "category_type";
|
||||||
|
|
||||||
private static final Integer taxPercent = 15;
|
private static final Integer taxPercent = 15;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<DictBizApiVO> categoryType() {
|
||||||
|
return dictService.getList(categoryType).stream().map(dictBiz -> {
|
||||||
|
DictBizApiVO vo = new DictBizApiVO();
|
||||||
|
vo.setKey(dictBiz.getDictKey());
|
||||||
|
vo.setValue(dictBiz.getDictValue());
|
||||||
|
return vo;
|
||||||
|
}).toList();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<CategoryApiVO> categoryList() {
|
public List<CategoryApiVO> categoryList() {
|
||||||
return categoryService.list().stream().map(category -> {
|
return categoryService.list().stream().map(category -> {
|
||||||
@@ -162,6 +174,7 @@ public class KioskServiceImpl implements IKioskApiService {
|
|||||||
order.setUserPhone(request.getPhone());
|
order.setUserPhone(request.getPhone());
|
||||||
order.setUserEmail(request.getEmail());
|
order.setUserEmail(request.getEmail());
|
||||||
order.setSerialNumber(StringUtil.random(8, RandomType.INT));
|
order.setSerialNumber(StringUtil.random(8, RandomType.INT));
|
||||||
|
order.setRemarks(request.getRemarks());
|
||||||
orderService.save(order);
|
orderService.save(order);
|
||||||
|
|
||||||
List<BigDecimal> totalAmount = new ArrayList<>();
|
List<BigDecimal> totalAmount = new ArrayList<>();
|
||||||
@@ -307,4 +320,5 @@ public class KioskServiceImpl implements IKioskApiService {
|
|||||||
return vo;
|
return vo;
|
||||||
}).toList();
|
}).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user