|
|
@@ -5,11 +5,14 @@ using System.Linq;
|
|
|
using System.Text;
|
|
|
using JLHHJSvr.BLL;
|
|
|
using JLHHJSvr.Com;
|
|
|
+using JLHHJSvr.Com.Model;
|
|
|
+using JLHHJSvr.Helper;
|
|
|
using JLHHJSvr.LJException;
|
|
|
using JLHHJSvr.Tools;
|
|
|
using LJLib.DAL.SQL;
|
|
|
using LJLib.Net.SPI.Server;
|
|
|
using LJLib.SQLEX;
|
|
|
+using static JLHHJSvr.Helper.CacheHelper;
|
|
|
|
|
|
namespace JLHHJSvr.Excutor
|
|
|
{
|
|
|
@@ -45,51 +48,13 @@ namespace JLHHJSvr.Excutor
|
|
|
|
|
|
AutoInit.AutoInitS(cmd, request.mtrl);
|
|
|
|
|
|
+ var helper = HelperBase.GetHelper<BasicInfoHelper>(cmd, new HelperBase.Context() { tokendata = tokendata });
|
|
|
+
|
|
|
using (cmd.Transaction = con.BeginTransaction())
|
|
|
{
|
|
|
try
|
|
|
{
|
|
|
- if (request.mtrl.mtrlid <= 0)
|
|
|
- {
|
|
|
- request.mtrl.mtrlid = BllHelper.GetID(cmd, "u_mtrl_price");
|
|
|
-
|
|
|
- request.mtrl.createtime = dtNow;
|
|
|
- request.mtrl.createby = tokendata.username;
|
|
|
-
|
|
|
- var fields = @"mtrlid,mtrltype,name,priceunit,shrinkage,gram_weight,cloth_width,if_inputqty,if_areaprice,createtime,createby,thickness,dscrp,erp_mtrlid,fjcnt,isuse,handtype,lastdate,erp_mtrlengname,if_subspecs,extra_cost,is_singleqty";
|
|
|
- DbSqlHelper.Insert(cmd, "u_mtrl_price", null, request.mtrl, fields);
|
|
|
-
|
|
|
- var fields2 = @"mtrlid,pricelistid,price,pricetype,price_formula,qty_formula";
|
|
|
-
|
|
|
- if(request.mtrl.mxlist != null && request.mtrl.mxlist.Any())
|
|
|
- {
|
|
|
- foreach (var mx in request.mtrl.mxlist)
|
|
|
- {
|
|
|
- AutoInit.AutoInitS(cmd, mx);
|
|
|
- mx.mtrlid = request.mtrl.mtrlid;
|
|
|
-
|
|
|
- DbSqlHelper.Insert(cmd, "u_mtrl_price_pricelist", null, mx, fields2);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- //修改
|
|
|
- var fields = @"mtrltype,name,priceunit,shrinkage,gram_weight,cloth_width,if_inputqty,if_areaprice,thickness,dscrp,erp_mtrlid,fjcnt,isuse,handtype,lastdate,erp_mtrlengname,if_subspecs,extra_cost,is_singleqty";
|
|
|
- DbSqlHelper.Update(cmd, "u_mtrl_price", null, request.mtrl, "mtrlid", fields);
|
|
|
-
|
|
|
- var fields2 = @"price,pricetype,price_formula,qty_formula";
|
|
|
-
|
|
|
- if (request.mtrl.mxlist != null && request.mtrl.mxlist.Any())
|
|
|
- {
|
|
|
- foreach (var mx in request.mtrl.mxlist)
|
|
|
- {
|
|
|
- AutoInit.AutoInitS(cmd, mx);
|
|
|
- DbSqlHelper.Update(cmd, "u_mtrl_price_pricelist", null, mx, "mtrlid,pricelistid", fields2);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
+ helper.SaveMtrlDef(request.mtrl);
|
|
|
cmd.Transaction.Commit();
|
|
|
}
|
|
|
catch (Exception e)
|