|
@@ -24,7 +24,7 @@ namespace JLHHJSvr.Helper
|
|
|
/// <param name="bill"></param>
|
|
|
public u_softbed GetSoftBed(int billid,string fields = null)
|
|
|
{
|
|
|
- fields = fields ?? @"softbed_id,softbed_code,softbed_name,deptid,create_time,create_by,mtrlmode,mtrltype,has_headboard,has_nightstand,has_bedframe,is_template,
|
|
|
+ fields = fields ?? @"softbed_id,softbed_code,softbed_name,deptid,create_date,create_emp,mtrlmode,mtrltype,has_headboard,has_nightstand,has_bedframe,is_template,
|
|
|
template_id,template_code,template_name,commission,taxes,other_rate,extras_cost,moneyrate,dscrp,costamt,nottax_factory_cost,nottax_dept_cost,
|
|
|
dept_cost,foreign_cost";
|
|
|
var bill = new u_softbed() { softbed_id = billid };
|
|
@@ -103,15 +103,15 @@ namespace JLHHJSvr.Helper
|
|
|
/// </summary>
|
|
|
/// <param name="mxlist"></param>
|
|
|
/// <param name="codeList"></param>
|
|
|
- public List<u_softbed_mx> GetSoftBedMxBomList(int deptid, List<u_configure_codemx> codeList)
|
|
|
+ public List<u_softbed_mx> GetSoftBedMxBomList(List<u_configure_codemx> codeList)
|
|
|
{
|
|
|
var mxlist = new List<u_softbed_mx>();
|
|
|
-
|
|
|
foreach(var code in codeList)
|
|
|
{
|
|
|
var resultList = new List<u_configure_codemxbom>();
|
|
|
var outputFields = @"pzid,printid,pid,mtrlid,sonscale,sonscale_formula,mng_cost_rate,profit_rate,realqty,cost,cost_emp,cost_date,sonloss,sonloss_formula,
|
|
|
- sondecloss,sondecloss_formula,deptid_scll,price,price_formula,mtrlcode,mtrlname,mtrlmode,unit,mtrlsectype,zxmtrlmode,usermtrlmode";
|
|
|
+ sondecloss,sondecloss_formula,deptid_scll,price,price_formula,default_length,default_width,default_qty,mtrlcode,mtrlname,mtrlmode,unit,
|
|
|
+ mtrlsectype,zxmtrlmode,usermtrlmode";
|
|
|
var selectStr = @"SELECT u_configure_codemxbom.pzid
|
|
|
,u_configure_codemxbom.printid
|
|
|
,u_configure_codemxbom.pid
|
|
@@ -131,6 +131,9 @@ namespace JLHHJSvr.Helper
|
|
|
,u_configure_codemxbom.deptid_scll
|
|
|
,u_configure_codemxbom.price
|
|
|
,u_configure_codemxbom.price_formula
|
|
|
+ ,u_configure_codemxbom.default_length
|
|
|
+ ,u_configure_codemxbom.default_width
|
|
|
+ ,u_configure_codemxbom.default_qty
|
|
|
,u_mtrldef.mtrlcode
|
|
|
,u_mtrldef.mtrlname
|
|
|
,u_mtrldef.mtrlmode
|
|
@@ -141,8 +144,8 @@ namespace JLHHJSvr.Helper
|
|
|
FROM u_configure_codemxbom
|
|
|
INNER JOIN u_mtrldef ON u_configure_codemxbom.mtrlid = u_mtrldef.mtrlid";
|
|
|
DbSqlHelper.SelectJoin(cmd,selectStr,
|
|
|
- "u_configure_codemxbom.pzid = @pzid AND u_configure_codemxbom.printid = @printid AND u_configure_codemxbom.deptid_scll = @deptid",
|
|
|
- new Dictionary<string, object>() { { "@pzid", code.pzid }, { "@printid",code.printid},{ "@deptid",deptid } },
|
|
|
+ "u_configure_codemxbom.pzid = @pzid AND u_configure_codemxbom.printid = @printid",
|
|
|
+ new Dictionary<string, object>() { { "@pzid", code.pzid }, { "@printid",code.printid} },
|
|
|
"u_configure_codemxbom.pid", outputFields, 0,0,resultList);
|
|
|
|
|
|
foreach(var item in resultList)
|
|
@@ -152,7 +155,11 @@ namespace JLHHJSvr.Helper
|
|
|
}
|
|
|
return mxlist;
|
|
|
}
|
|
|
-
|
|
|
+ /// <summary>
|
|
|
+ /// 初始化配置项值带出的BOM清单列表
|
|
|
+ /// </summary>
|
|
|
+ /// <param name="bomItem"></param>
|
|
|
+ /// <returns></returns>
|
|
|
public u_softbed_mx InitSoftBedMxFromBom(u_configure_codemxbom bomItem)
|
|
|
{
|
|
|
var mx = new u_softbed_mx()
|
|
@@ -165,10 +172,10 @@ namespace JLHHJSvr.Helper
|
|
|
mtrlmode = bomItem.mtrlmode,
|
|
|
unit = bomItem.unit,
|
|
|
allow_edit = 0,
|
|
|
- has_type = 1, // 1-床头、2-床头柜、4-床架
|
|
|
- cutting_length = 0,
|
|
|
- cutting_qty = 0,
|
|
|
- cutting_width = 0,
|
|
|
+ has_type = bomItem.has_type, // 1-床头、2-床头柜、4-床架
|
|
|
+ cutting_length = bomItem.default_length,
|
|
|
+ cutting_width = bomItem.default_width,
|
|
|
+ cutting_qty = bomItem.default_qty,
|
|
|
useqty = bomItem.sonscale,
|
|
|
use_formula = "",
|
|
|
use_formula_str = bomItem.sonscale_formula,
|
|
@@ -211,7 +218,7 @@ namespace JLHHJSvr.Helper
|
|
|
// TODO:计算价格
|
|
|
|
|
|
//
|
|
|
- var dtNow = DateTime.Now;
|
|
|
+ var dtNow = context.opdate;
|
|
|
var fields = @"softbed_name,deptid,mtrlmode,mtrltype,has_headboard,has_nightstand,has_bedframe,is_template,
|
|
|
template_id,template_code,template_name,commission,taxes,other_rate,extras_cost,moneyrate,dscrp,costamt,nottax_factory_cost,nottax_dept_cost,
|
|
|
dept_cost,foreign_cost";
|
|
@@ -222,11 +229,11 @@ namespace JLHHJSvr.Helper
|
|
|
if(softbed.softbed_id == 0)
|
|
|
{
|
|
|
// 新建
|
|
|
- fields += ",softbed_id,softbed_code,create_time,create_by";
|
|
|
+ fields += ",softbed_id,softbed_code,create_date,create_emp";
|
|
|
|
|
|
softbed.softbed_id = BllHelper.GetID(cmd, "u_softbed");
|
|
|
- softbed.create_time = dtNow;
|
|
|
- softbed.create_by = context.tokendata.username;
|
|
|
+ softbed.create_date = dtNow;
|
|
|
+ softbed.create_emp = context.tokendata.username;
|
|
|
|
|
|
if (string.IsNullOrEmpty(softbed.softbed_code))
|
|
|
{
|
|
@@ -237,7 +244,11 @@ namespace JLHHJSvr.Helper
|
|
|
DbSqlHelper.Insert(cmd, "u_softbed", null, softbed, fields);
|
|
|
} else
|
|
|
{
|
|
|
- // 修改
|
|
|
+ // 修改
|
|
|
+ softbed.update_date = dtNow;
|
|
|
+ softbed.update_emp = context.tokendata.username;
|
|
|
+ fields += ",update_date,update_emp";
|
|
|
+
|
|
|
cmd.CommandText = @"DELETE FROM u_softbed_mx WHERE softbed_id = @softbed_id";
|
|
|
cmd.Parameters.Clear();
|
|
|
cmd.Parameters.AddWithValue("@softbed_id", softbed.softbed_id);
|
|
@@ -314,7 +325,9 @@ namespace JLHHJSvr.Helper
|
|
|
if (softbed.flag == 1) throw new LJCommonException($"单据:{softbed.softbed_code}未撤审,无法审核!");
|
|
|
|
|
|
softbed.flag = 1;
|
|
|
- DbSqlHelper.Update(cmd, "u_softbed",null,softbed, "softbed_id", "flag");
|
|
|
+ softbed.audit_date = context.opdate;
|
|
|
+ softbed.audit_emp = context.tokendata.username;
|
|
|
+ DbSqlHelper.Update(cmd, "u_softbed",null,softbed, "softbed_id", "flag,audit_date,audit_emp");
|
|
|
}
|
|
|
|
|
|
/// <summary>
|
|
@@ -331,7 +344,9 @@ namespace JLHHJSvr.Helper
|
|
|
if (softbed.flag == 0) throw new LJCommonException($"单据:{softbed.softbed_code}未审核,无法撤审!");
|
|
|
|
|
|
softbed.flag = 0;
|
|
|
- DbSqlHelper.Update(cmd, "u_softbed", null, softbed, "softbed_id", "flag");
|
|
|
+ softbed.audit_date = null;
|
|
|
+ softbed.audit_emp = string.Empty;
|
|
|
+ DbSqlHelper.Update(cmd, "u_softbed", null, softbed, "softbed_id", "flag,audit_date,audit_emp");
|
|
|
}
|
|
|
|
|
|
#region 通用公式方法
|