SoftBedHelper.cs 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571
  1. using DirectService.Tools;
  2. using JLHHJSvr.BLL;
  3. using JLHHJSvr.Com.Model;
  4. using JLHHJSvr.LJException;
  5. using JLHHJSvr.Tools;
  6. using LJLib.DAL.SQL;
  7. using NPOI.SS.Formula.Functions;
  8. using System;
  9. using System.Collections;
  10. using System.Collections.Generic;
  11. using System.Linq;
  12. using System.Text;
  13. using System.Threading.Tasks;
  14. using System.Web;
  15. using static JLHHJSvr.Helper.CacheHelper;
  16. namespace JLHHJSvr.Helper
  17. {
  18. internal class SoftBedHelper : HelperBase
  19. {
  20. /// <summary>
  21. /// 获取软床报价单据
  22. /// </summary>
  23. /// <param name="billid"></param>
  24. /// <param name="fields"></param>
  25. /// <param name="bill"></param>
  26. public u_softbed GetSoftBed(int billid,string fields = null)
  27. {
  28. fields = fields ?? @"softbed_id,softbed_code,softbed_relcode,softbed_name,deptid,create_date,create_emp,mtrlmode,mtrltype,has_headboard,has_nightstand,has_bedframe,is_template,
  29. template_id,template_code,template_name,commission,taxes,taxrate,other_rate,extras_cost,money_type,moneyrate,dscrp,costamt,nottax_factory_cost,nottax_dept_cost,
  30. dept_cost,foreign_cost";
  31. var bill = new u_softbed() { softbed_id = billid };
  32. if (DbSqlHelper.SelectOne(cmd, bill, fields) == 0) return null;
  33. return bill;
  34. }
  35. /// <summary>
  36. /// 获取软床报价单据明细
  37. /// </summary>
  38. /// <param name="billid"></param>
  39. /// <param name="fields"></param>
  40. /// <param name="mxlist"></param>
  41. public List<u_softbed_mx> GetSoftBedMxList(int billid,string fields = null)
  42. {
  43. fields = fields ?? @"softbed_id,printid,pzid,mtrlid,mtrlname,mtrlcode,mtrlmode,unit,has_type,allow_edit,cutting_length,cutting_width,cutting_qty,
  44. useqty,use_formula,use_formula_str,actual_useqty,loss_rate,price,price_formula,price_formula_str,cost_price,cost_amt,pzname,pzmxname";
  45. var mxlist = new List<u_softbed_mx>();
  46. var selectStr = @"SELECT u_softbed_mx.softbed_id
  47. ,u_softbed_mx.printid
  48. ,u_softbed_mx.pzid
  49. ,u_softbed_mx.mtrlid
  50. ,u_softbed_mx.mtrlname
  51. ,u_softbed_mx.mtrlcode
  52. ,u_softbed_mx.mtrlmode
  53. ,u_softbed_mx.unit
  54. ,u_softbed_mx.has_type
  55. ,u_softbed_mx.allow_edit
  56. ,u_softbed_mx.cutting_length
  57. ,u_softbed_mx.cutting_width
  58. ,u_softbed_mx.cutting_qty
  59. ,u_softbed_mx.useqty
  60. ,u_softbed_mx.use_formula
  61. ,u_softbed_mx.use_formula_str
  62. ,u_softbed_mx.actual_useqty
  63. ,u_softbed_mx.loss_rate
  64. ,u_softbed_mx.price
  65. ,u_softbed_mx.price_formula
  66. ,u_softbed_mx.price_formula_str
  67. ,u_softbed_mx.cost_price
  68. ,u_softbed_mx.cost_amt
  69. ,u_configure_code.name AS pzname
  70. ,u_configure_codemx.namemx AS pzmxname
  71. FROM u_softbed_mx";
  72. DbSqlHelper.SelectJoin(cmd, selectStr, "softbed_id = @billid", new Dictionary<string, object>() { { "@billid", billid } }, "printid", fields, 0, 0, mxlist);
  73. return mxlist;
  74. }
  75. /// <summary>
  76. /// 根据部件配置项值获取对应BOM明细
  77. /// </summary>
  78. /// <param name="mxlist"></param>
  79. /// <param name="codeList"></param>
  80. public List<u_softbed_mx> GetSoftBedMxBomList(List<u_configure_codemx> codeList)
  81. {
  82. var mxlist = new List<u_softbed_mx>();
  83. foreach(var code in codeList)
  84. {
  85. var resultList = new List<u_configure_codemxbom>();
  86. var outputFields = @"pzid,printid,pid,mtrlid,sonscale,sonscale_formula,mng_cost_rate,profit_rate,realqty,cost,cost_emp,cost_date,sonloss,sonloss_formula,
  87. sondecloss,sondecloss_formula,deptid_scll,default_length,default_width,default_qty,mtrlcode,mtrlname,mtrlmode,unit,
  88. mtrlsectype,zxmtrlmode,usermtrlmode";
  89. var selectStr = @"SELECT u_configure_codemxbom.pzid
  90. ,u_configure_codemxbom.printid
  91. ,u_configure_codemxbom.pid
  92. ,u_configure_codemxbom.mtrlid
  93. ,u_configure_codemxbom.sonscale
  94. ,u_configure_codemxbom.sonscale_formula
  95. ,u_configure_codemxbom.mng_cost_rate
  96. ,u_configure_codemxbom.profit_rate
  97. ,u_configure_codemxbom.realqty
  98. ,u_configure_codemxbom.cost
  99. ,u_configure_codemxbom.cost_emp
  100. ,u_configure_codemxbom.cost_date
  101. ,u_configure_codemxbom.sonloss
  102. ,u_configure_codemxbom.sonloss_formula
  103. ,u_configure_codemxbom.sondecloss
  104. ,u_configure_codemxbom.sondecloss_formula
  105. ,u_configure_codemxbom.deptid_scll
  106. ,u_configure_codemxbom.default_length
  107. ,u_configure_codemxbom.default_width
  108. ,u_configure_codemxbom.default_qty
  109. ,u_mtrldef.mtrlcode
  110. ,u_mtrldef.mtrlname
  111. ,u_mtrldef.mtrlmode
  112. ,u_mtrldef.unit
  113. ,u_mtrldef.mtrlsectype
  114. ,u_mtrldef.zxmtrlmode
  115. ,u_mtrldef.usermtrlmode
  116. FROM u_configure_codemxbom
  117. INNER JOIN u_mtrldef ON u_configure_codemxbom.mtrlid = u_mtrldef.mtrlid";
  118. DbSqlHelper.SelectJoin(cmd,selectStr,
  119. "u_configure_codemxbom.pzid = @pzid AND u_configure_codemxbom.printid = @printid",
  120. new Dictionary<string, object>() { { "@pzid", code.pzid }, { "@printid",code.printid} },
  121. "u_configure_codemxbom.pid", outputFields, 0,0,resultList);
  122. foreach(var item in resultList)
  123. {
  124. mxlist.Add(InitSoftBedMxFromBom(item));
  125. }
  126. }
  127. return mxlist;
  128. }
  129. /// <summary>
  130. /// 初始化配置项值带出的BOM清单列表
  131. /// </summary>
  132. /// <param name="bomItem"></param>
  133. /// <returns></returns>
  134. public u_softbed_mx InitSoftBedMxFromBom(u_configure_codemxbom bomItem)
  135. {
  136. var mx = new u_softbed_mx()
  137. {
  138. pzid = bomItem.pzid,
  139. mtrlid = bomItem.mtrlid,
  140. mtrlname = bomItem.mtrlname,
  141. mtrlcode = bomItem.mtrlcode,
  142. mtrlmode = bomItem.mtrlmode,
  143. unit = bomItem.unit,
  144. allow_edit = 0,
  145. has_type = bomItem.has_type, // 1-床头、2-床头柜、4-床架
  146. cutting_length = bomItem.default_length,
  147. cutting_width = bomItem.default_width,
  148. cutting_qty = bomItem.default_qty,
  149. useqty = bomItem.sonscale,
  150. use_formula = "",
  151. use_formula_str = bomItem.sonscale_formula,
  152. actual_useqty = 0,
  153. loss_rate = bomItem.sonloss,
  154. cost_price = bomItem.cost,
  155. cost_amt = 0
  156. };
  157. // 用量
  158. // 实际用量: 用量 * 损耗
  159. mx.actual_useqty = mx.useqty * mx.loss_rate;
  160. // 成本金额: 实际用量 * 成本单价
  161. mx.cost_amt = mx.actual_useqty * mx.cost_price;
  162. return mx;
  163. }
  164. /// <summary>
  165. /// 新建/修改 软床报价
  166. /// </summary>
  167. /// <param name="softbed"></param>
  168. /// <exception cref="LJCommonException"></exception>
  169. public void SaveSoftBed(u_softbed softbed)
  170. {
  171. if (softbed == null) throw new LJCommonException("软床报价保存失败,数据异常!");
  172. if (softbed.is_template == 0 && (softbed.mxList == null || softbed.mxList.Count <= 0)) throw new LJCommonException("软床报价保存失败,明细内容为空!");
  173. // 初始化属性
  174. AutoInit.AutoInitS(softbed);
  175. foreach(var mx in softbed.mxList)
  176. {
  177. AutoInit.AutoInitS(mx);
  178. }
  179. // TODO:计算价格
  180. CalCulateFormula(softbed);
  181. //
  182. var dtNow = context.opdate;
  183. var fields = @"softbed_relcode,softbed_name,deptid,mtrlmode,mtrltype,has_headboard,has_nightstand,has_bedframe,is_template,
  184. template_id,template_code,template_name,commission,taxes,taxrate,other_rate,extras_cost,money_type,moneyrate,dscrp,costamt,nottax_factory_cost,nottax_dept_cost,
  185. dept_cost,foreign_cost";
  186. var mx_fields = @"softbed_id,printid,pzid,mtrlid,mtrlname,mtrlcode,mtrlmode,unit,has_type,allow_edit,cutting_length,cutting_width,cutting_qty,
  187. useqty,use_formula,use_formula_str,actual_useqty,loss_rate,price,price_formula,price_formula_str,cost_price,cost_amt,pzname,pzmxname";
  188. if(softbed.softbed_id == 0)
  189. {
  190. // 新建
  191. fields += ",softbed_id,softbed_code,create_date,create_emp";
  192. softbed.softbed_id = BllHelper.GetID(cmd, "u_softbed");
  193. softbed.create_date = dtNow;
  194. softbed.create_emp = context.tokendata.username;
  195. if (string.IsNullOrEmpty(softbed.softbed_code))
  196. {
  197. // 编号-年月日+流水
  198. softbed.softbed_code = $"RC-{dtNow.ToString("yyyyMMdd")}{(softbed.softbed_id % 10000).ToString("D4")}";
  199. }
  200. DbSqlHelper.Insert(cmd, "u_softbed", null, softbed, fields);
  201. } else
  202. {
  203. // 修改
  204. softbed.update_date = dtNow;
  205. softbed.update_emp = context.tokendata.username;
  206. fields += ",update_date,update_emp";
  207. cmd.CommandText = @"DELETE FROM u_softbed_mx WHERE softbed_id = @softbed_id";
  208. cmd.Parameters.Clear();
  209. cmd.Parameters.AddWithValue("@softbed_id", softbed.softbed_id);
  210. cmd.ExecuteNonQuery();
  211. DbSqlHelper.Update(cmd, "u_softbed", null, softbed, "softbed_id", fields);
  212. }
  213. for (int i = 0; i < softbed.mxList.Count; i++)
  214. {
  215. var mx = softbed.mxList[i];
  216. mx.softbed_id = softbed.softbed_id;
  217. mx.printid = i + 1;
  218. DbSqlHelper.Insert(cmd, "u_softbed_mx", null, mx, mx_fields);
  219. }
  220. SaveSoftBedTemplate(softbed);
  221. }
  222. /// <summary>
  223. /// 新建软床报价模板
  224. /// </summary>
  225. /// <param name="softbed"></param>
  226. private void SaveSoftBedTemplate(u_softbed softbed)
  227. {
  228. if (softbed.is_template == 0) return;
  229. if(string.IsNullOrEmpty(softbed.softbed_code))
  230. {
  231. throw new LJCommonException("报价未生成唯一码,无法生成模板配置");
  232. }
  233. string prefix = $"{softbed.softbed_code}|";
  234. var configureList = new List<u_configure_type>();
  235. if(softbed.has_headboard == 1)
  236. {
  237. configureList.Add(new u_configure_type()
  238. {
  239. contfigtypeid = 0,
  240. contfigtypename = $"{prefix}床头",
  241. contfigtype = 0,
  242. usechflag = 1,
  243. flag = 0
  244. });
  245. }
  246. if(softbed.has_bedframe == 1)
  247. {
  248. configureList.Add(new u_configure_type()
  249. {
  250. contfigtypeid = 0,
  251. contfigtypename = $"{prefix}床架",
  252. contfigtype = 0,
  253. usechflag = 1,
  254. flag = 0
  255. });
  256. }
  257. if (softbed.has_nightstand == 1)
  258. {
  259. configureList.Add(new u_configure_type()
  260. {
  261. contfigtypeid = 0,
  262. contfigtypename = $"{prefix}床头柜",
  263. contfigtype = 0,
  264. usechflag = 1,
  265. flag = 0
  266. });
  267. }
  268. var baseInfoHelper = GetHelper<BasicInfoHelper>(cmd, context);
  269. foreach(var configure in configureList)
  270. {
  271. // 判断是否已存在
  272. cmd.CommandText = @"SELECT COUNT(*) FROM u_configure_type WHERE LTRIM(RTRIM(contfigtypename)) = @contfigtypename";
  273. cmd.Parameters.Clear();
  274. cmd.Parameters.AddWithValue("@contfigtypename", configure.contfigtypename);
  275. var cnt = Convert.ToInt32(cmd.ExecuteScalar());
  276. if (cnt > 0) continue;
  277. baseInfoHelper.SaveConfigureType(configure);
  278. }
  279. }
  280. public List<u_configure_type> GetSoftBedConfigureList(u_softbed softbed)
  281. {
  282. var codeMxList = new List<u_configure_codemx>();
  283. var selectStr = @"SELECT u_configure_codemx.pzid
  284. ,u_configure_codemx.printid
  285. ,u_configure_codemx.pzcodemx
  286. ,u_configure_codemx.namemx
  287. ,u_configure_code.name AS pzname
  288. ,u_configure_code.pzcode
  289. ,u_configure_code.inputtype
  290. ,LTRIM(RTRIM(u_configure_type.contfigtypename)) AS contfigtypename
  291. ,u_configure_code.typeid
  292. FROM u_configure_codemx
  293. INNER JOIN u_configure_code ON u_configure_codemx.pzid = u_configure_code.pzid
  294. INNER JOIN u_configure_type ON u_configure_code.typeid = u_configure_type.contfigtypeid";
  295. var whereList = new List<string>();
  296. var nameList = new List<string>();
  297. if (softbed.softbed_id > 0)
  298. {
  299. // 模版配置获取
  300. var _softbed = GetSoftBed(softbed.softbed_id, "softbed_id,softbed_code,has_headboard,has_nightstand,has_bedframe");
  301. string prefix = $"{_softbed.softbed_code}|";
  302. if(_softbed.has_headboard == 1)
  303. {
  304. nameList.Add($"{prefix}床头");
  305. }
  306. if (_softbed.has_nightstand == 1)
  307. {
  308. nameList.Add($"{prefix}床头柜");
  309. }
  310. if (_softbed.has_bedframe == 1)
  311. {
  312. nameList.Add($"{prefix}床架");
  313. }
  314. }
  315. if(nameList.Count > 0)
  316. {
  317. whereList.Add($"LTRIM(RTRIM(u_configure_type.contfigtypename)) IN {ListEx.getString(nameList)}");
  318. }
  319. DbSqlHelper.SelectJoin(cmd, selectStr, ListEx.GetWhereStr(whereList), null, "typeid,pzid,printid", "typeid,pzid,printid,pzcodemx,namemx,pzname,pzcode,contfigtypename", 0, 0, codeMxList);
  320. // 部件选配项
  321. var codeMap = new Dictionary<int, u_configure_code>();
  322. foreach(var codeMx in codeMxList)
  323. {
  324. int pzid = codeMx.pzid.Value;
  325. if (!codeMap.TryGetValue(pzid, out var config))
  326. {
  327. config = new u_configure_code
  328. {
  329. pzid = pzid,
  330. name = codeMx.pzname,
  331. contfigtypename = codeMx.contfigtypename,
  332. pzcode = codeMx.pzcode,
  333. typeid = codeMx.pzid,
  334. codeMxList = new List<u_configure_codemx>()
  335. };
  336. codeMap.Add(pzid, config);
  337. }
  338. config.codeMxList.Add(codeMx);
  339. }
  340. // 部件选配类型
  341. var typeMap = new Dictionary<int, u_configure_type>();
  342. foreach(var code in codeMap.Values.ToList())
  343. {
  344. int typeid = code.typeid.Value;
  345. if (!typeMap.TryGetValue(typeid, out var config))
  346. {
  347. config = new u_configure_type
  348. {
  349. contfigtypeid = typeid,
  350. contfigtypename = code.contfigtypename,
  351. codeList = new List<u_configure_code>()
  352. };
  353. typeMap.Add(typeid, config);
  354. }
  355. config.codeList.Add(code);
  356. }
  357. return typeMap.Values.ToList();
  358. }
  359. /// <summary>
  360. /// 复制软床报价
  361. /// </summary>
  362. /// <param name="softbed"></param>
  363. /// <param name="newId"></param>
  364. public void CopySoftBed(u_softbed softbed, out int newId)
  365. {
  366. var fields = @"mtrlmode,mtrltype,has_headboard,has_nightstand,has_bedframe,is_template,
  367. template_id,template_code,template_name,commission,taxes,taxrate,other_rate,extras_cost,moneyrate";
  368. var softbed_copy = GetSoftBed(softbed.softbed_id, fields);
  369. // 判断copy_bedNet.bednetcode是否存在@@字符串,如果存在,则删除@@后面的字符串,包括@@
  370. if (softbed_copy.softbed_code.IndexOf("@@") > -1)
  371. {
  372. softbed_copy.softbed_code = softbed_copy.softbed_code.Substring(softbed_copy.softbed_code.IndexOf("@@"));
  373. }
  374. softbed_copy.softbed_code += " @@";
  375. softbed_copy.softbed_code += DateTime.Now.ToString("yyyMMdd_mmhhss");
  376. softbed_copy.softbed_id = 0;
  377. SaveSoftBed(softbed_copy);
  378. newId = softbed_copy.softbed_id;
  379. }
  380. /// <summary>
  381. /// 删除软床报价
  382. /// </summary>
  383. /// <param name="billid"></param>
  384. /// <exception cref="LJCommonException"></exception>
  385. public void DeleteSoftBed(int billid)
  386. {
  387. var softbed = GetSoftBed(billid, "softbed_code,flag");
  388. if (softbed == null) throw new LJCommonException($"单据不存在,请检查! billid:{billid}");
  389. if (softbed.flag == 1) throw new LJCommonException($"单据:{softbed.softbed_code}已审核,无法删除!");
  390. DbSqlHelper.Delete(cmd, softbed);
  391. }
  392. /// <summary>
  393. /// 审核软床报价
  394. /// </summary>
  395. /// <param name="billid"></param>
  396. /// <exception cref="LJCommonException"></exception>
  397. public void AuditSoftBed(int billid)
  398. {
  399. var softbed = GetSoftBed(billid, "softbed_code,flag");
  400. if (softbed == null) throw new LJCommonException($"单据不存在,请检查! billid:{billid}");
  401. if (softbed.flag == 1) throw new LJCommonException($"单据:{softbed.softbed_code}未撤审,无法审核!");
  402. softbed.flag = 1;
  403. softbed.audit_date = context.opdate;
  404. softbed.audit_emp = context.tokendata.username;
  405. DbSqlHelper.Update(cmd, "u_softbed",null,softbed, "softbed_id", "flag,audit_date,audit_emp");
  406. }
  407. /// <summary>
  408. /// 撤审软床报价
  409. /// </summary>
  410. /// <param name="billid"></param>
  411. /// <exception cref="LJCommonException"></exception>
  412. public void CAuditSoftBed(int billid)
  413. {
  414. var softbed = GetSoftBed(billid, "softbed_code,flag");
  415. if (softbed == null) throw new LJCommonException($"单据不存在,请检查! billid:{billid}");
  416. if (softbed.flag == 0) throw new LJCommonException($"单据:{softbed.softbed_code}未审核,无法撤审!");
  417. softbed.flag = 0;
  418. softbed.audit_date = null;
  419. softbed.audit_emp = string.Empty;
  420. DbSqlHelper.Update(cmd, "u_softbed", null, softbed, "softbed_id", "flag,audit_date,audit_emp");
  421. }
  422. public void CalCulateFormula(u_softbed softbed)
  423. {
  424. InitSoftBed(softbed);
  425. InitReplaceMents(softbed);
  426. foreach (var mx in softbed.mxList)
  427. {
  428. InitMxReplaceMents(softbed, mx);
  429. }
  430. }
  431. private void InitSoftBed(u_softbed softbed)
  432. {
  433. var dept = Cache.GetData<int, u_dept, DeptMapping>(softbed.deptid);
  434. softbed.moneyrate = softbed.moneyrate <= 0 ? 1 : softbed.moneyrate;
  435. softbed.commission = softbed.commission <= 0 ? 1 : softbed.commission;
  436. softbed.taxrate = softbed.taxrate <= 0 ? 1 : softbed.taxrate;
  437. softbed.other_rate = softbed.other_rate <= 0 ? 1 : softbed.other_rate;
  438. softbed.dept_profitrate = softbed.dept_profitrate <= 0 ? 1 : softbed.dept_profitrate;
  439. // 检查佣金是否小于1
  440. if (softbed.commission < 1)
  441. {
  442. throw new LJCommonException("佣金点数不能小于1!");
  443. }
  444. // 检查税率是否小于1
  445. if (softbed.taxrate < 1)
  446. {
  447. throw new LJCommonException("税率不能小于1!");
  448. }
  449. // 检查额外点数是否小于1
  450. if (softbed.other_rate < 1)
  451. {
  452. throw new LJCommonException("税率不能小于1!");
  453. }
  454. // 检查部门利润率是否为0
  455. if (softbed.dept_profitrate == 0)
  456. {
  457. throw new LJCommonException("部门利润率不能为0!");
  458. }
  459. if(softbed.is_template == 1)
  460. {
  461. // 使用模板报价
  462. softbed.template_id = 0;
  463. softbed.template_code = string.Empty;
  464. softbed.template_name = string.Empty;
  465. }
  466. }
  467. private void InitReplaceMents(u_softbed softbed)
  468. {
  469. //AddKeyValue("不含税出厂价", "【车间成本】*(【工厂利润率】+【外销加点】)",0);
  470. //AddKeyValue("部门不含税价", "【不含税出厂价】/【部门利润率】/( 1 - (【佣金点数】- 1))*【额外点数】", 0);
  471. //AddKeyValue("税金", "【部门不含税价】* (【税率】-1)", 0);
  472. //AddKeyValue("部门含税价", "【部门不含税价】*【税率】", 0);
  473. //AddKeyValue("外币价", "【部门含税价】/【汇率】", 0);
  474. //// 初始变量
  475. //AddKeyValue("部门利润率", string.Empty,softbed.dept_profitrate);
  476. //AddKeyValue("佣金点数", string.Empty, softbed.commission);
  477. //AddKeyValue("额外点数", string.Empty, softbed.other_rate);
  478. //AddKeyValue("额外费用", string.Empty, softbed.extras_cost);
  479. ////AddKeyValue("FOB", softbed.fob);
  480. //AddKeyValue("汇率", string.Empty, softbed.moneyrate);
  481. //AddKeyValue("税率", string.Empty, softbed.taxrate);
  482. }
  483. private void InitMxReplaceMents(u_softbed softbed,u_softbed_mx mx)
  484. {
  485. //AddKeyValue("下料长", string.Empty,mx.cutting_length);
  486. //AddKeyValue("下料宽", string.Empty, mx.cutting_width);
  487. //AddKeyValue("下料数量", string.Empty, mx.cutting_qty);
  488. //AddKeyValue("用料量", string.Empty, mx.useqty);
  489. //AddKeyValue("损耗率", string.Empty, mx.loss_rate);
  490. //AddKeyValue("材料单价", string.Empty, mx.price);
  491. //AddKeyValue("成本单价", string.Empty, mx.cost_price);
  492. }
  493. #region 通用公式
  494. private CalculateFormula formula = new CalculateFormula();
  495. #endregion
  496. }
  497. }