|
|
@@ -208,7 +208,7 @@ public class FqcApplyService : IDynamicApiController, ITransient
|
|
|
|
|
|
// 1) 报检存在 + 归属 + 关键字段
|
|
|
var apply = await _db.Ado.SqlQuerySingleAsync<ApplyGenRow>(
|
|
|
- @"SELECT id AS Id, FBILLNO AS BillNo, wlbm AS Wlbm, cpmc AS Cpmc, cpxh AS Cpxh, scph AS Scph, sczld AS Sczld, sczldsl AS Sczldsl
|
|
|
+ @"SELECT id AS Id, FBILLNO AS BillNo, wlbm AS Wlbm, cpmc AS Cpmc, cpxh AS Cpxh, scph AS Scph, sczld AS Sczld, sczldsl AS Sczldsl, sl AS Sl
|
|
|
FROM qms_fqcbj WHERE id=@id AND tenant_id=@t LIMIT 1",
|
|
|
new SugarParameter("@id", input.ApplyId), new SugarParameter("@t", tenantId));
|
|
|
if (apply == null) throw Oops.Oh("报检不存在或不属于当前租户");
|
|
|
@@ -270,9 +270,11 @@ public class FqcApplyService : IDynamicApiController, ITransient
|
|
|
await _db.Ado.ExecuteCommandAsync(
|
|
|
@"INSERT INTO qms_qcpp_inspbill
|
|
|
(id, tenant_id, FBILLNO, lydjbh, hid, scph, sczld, sczldsl, wlmc, ggxh,
|
|
|
+ FMATERIALCFG, jysj,
|
|
|
jgbh, jgbb, jygfid, sxrq, FBILLSTATUS, FCREATETIME)
|
|
|
VALUES
|
|
|
(@id, @t, @no, @ly, @hid, @scph, @sczld, @sczldsl, @wlmc, @ggxh,
|
|
|
+ @FMATERIALCFG, @jysj,
|
|
|
@jgbh, @jgbb, @jygfid, @sxrq, '未检验', @now)",
|
|
|
new SugarParameter("@id", headId),
|
|
|
new SugarParameter("@t", tenantId),
|
|
|
@@ -284,6 +286,9 @@ public class FqcApplyService : IDynamicApiController, ITransient
|
|
|
new SugarParameter("@sczldsl", (object?)apply.Sczldsl ?? DBNull.Value),
|
|
|
new SugarParameter("@wlmc", (object?)apply.Cpmc ?? DBNull.Value),
|
|
|
new SugarParameter("@ggxh", (object?)apply.Cpxh ?? DBNull.Value),
|
|
|
+ // 物料编码=报检 wlbm、检验数量=报检数量 sl(生成时已确定的静态业务字段,随 wlmc/ggxh 同一 INSERT 落库)
|
|
|
+ new SugarParameter("@FMATERIALCFG", (object?)apply.Wlbm ?? DBNull.Value),
|
|
|
+ new SugarParameter("@jysj", (object?)apply.Sl ?? DBNull.Value),
|
|
|
new SugarParameter("@jgbh", (object?)chosen.Wjbh ?? DBNull.Value),
|
|
|
new SugarParameter("@jgbb", (object?)chosen.Bb ?? DBNull.Value),
|
|
|
new SugarParameter("@jygfid", chosen.Jygfid.ToString()),
|
|
|
@@ -480,6 +485,7 @@ internal sealed class ApplyGenRow
|
|
|
public string? Scph { get; set; }
|
|
|
public string? Sczld { get; set; }
|
|
|
public decimal? Sczldsl { get; set; }
|
|
|
+ public decimal? Sl { get; set; }
|
|
|
}
|
|
|
|
|
|
internal sealed class ExistingInspRow
|