新增农户功能升级:身份证OCR/OSS上传、头像采集、同名村检测、Region热度排序及表单体验优化
- Region 表新增热度列,热门省份优先显示 - 区县下拉按地级市分组、已录区县优先、支持全省搜索 - 组选择内置一组至二十组 - 银行卡号独立行+粗体预览,开户行独立行 - 新增农户类型:农户/个体户/合作社/经营集体/公司 - 身份证正反面支持高拍仪/摄像头OCR与手机扫码上传,附件存本地/OSS - 新增农户头像采集组件(摄像头/本地上传),预留人脸识别收购扩展 - 同名村弹窗提醒(防选错乡镇) - 编辑窗体禁止遮罩/Esc误关,整体加宽适配高频操作 - 修复二维码局域网手机无法访问(监听0.0.0.0、局域网IP识别、Vite代理兜底)
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
using AgriculturalPlatform.Api.Models;
|
||||
|
||||
namespace AgriculturalPlatform.Api.Dtos;
|
||||
|
||||
public record PurchaseDto(
|
||||
int Id, string OrderNo, int FarmerId, string FarmerName, string? FarmerPhone,
|
||||
int ProductId, string ProductName, string Category, int PurchaserOrgId, string PurchaserOrgName,
|
||||
string Grade, string Unit, decimal UnitPrice, decimal GrossWeight, decimal TareWeight,
|
||||
decimal NetWeight, decimal Amount, int WeighCount, string Status,
|
||||
string? OperatorName, DateTime WeighInAt, DateTime? WeighOutAt, string Notes, DateTime CreatedAt);
|
||||
|
||||
/// <summary>新建收购单(第一次过磅:称毛重)</summary>
|
||||
public record PurchaseCreateRequest(
|
||||
int FarmerId, int ProductId, int PurchaserOrgId, string Grade,
|
||||
decimal GrossWeight, string Unit = "公斤", decimal UnitPrice = 0, string Notes = "");
|
||||
|
||||
/// <summary>回皮完成(第二次过磅:称皮重,计算净重与金额)</summary>
|
||||
public record PurchaseTareRequest(decimal TareWeight);
|
||||
|
||||
public static class PurchaseMappers
|
||||
{
|
||||
public static PurchaseDto ToDto(this PurchaseOrder p) => new(
|
||||
p.Id, p.OrderNo,
|
||||
p.FarmerId, p.Farmer?.Name ?? "", p.Farmer?.Phone ?? "",
|
||||
p.ProductId, p.Product?.Name ?? "", p.Product?.Category ?? "",
|
||||
p.PurchaserOrgId, p.PurchaserOrg?.Name ?? "",
|
||||
p.Grade, p.Unit, p.UnitPrice, p.GrossWeight, p.TareWeight,
|
||||
p.NetWeight, p.Amount, p.WeighCount, p.Status.ToString(),
|
||||
p.Operator?.RealName ?? "", p.WeighInAt, p.WeighOutAt, p.Notes, p.CreatedAt);
|
||||
|
||||
public static PurchaseDto[] ToDtos(this IEnumerable<PurchaseOrder> items) => items.Select(ToDto).ToArray();
|
||||
}
|
||||
Reference in New Issue
Block a user