public bool obOrderUpload(List <string> billNos) { var token = CommonToken.GetToken(); var http = new ArrowInterface.ArrowInterface(); var Helper = new OracleDBHelper(); var uploadParamRepository = new DefaultRepository <ObOrderUploadParam>(DBTypeEnums.ORACLE); var lhobounorderRepository = new DefaultRepository <LH_OUTBOUNDORDER>(DBTypeEnums.ORACLE); Dictionary <string, CompareEnum> compare = new Dictionary <string, CompareEnum>(); compare.Add("LHODONO", CompareEnum.In); var pars = uploadParamRepository.SelectWithWhere(new { LHODONO = billNos }, compare, null); List <string> errors = new List <string>(); pars.ForEach(p => { try { var result = http.obOrderUpload(token.Token, p); if (result.Success) { var sql = "UPDATE LH_OUTBOUNDORDER SET FSTATUS=:FSTATUS WHERE lhodoID=:lhodoID"; lhobounorderRepository.Execute(sql, new { FSTATUS = 7, lhodoID = p.lhodoID }, null); } else { errors.Add($"单据【{p.lhodoID}】车牌同步失败"); } } catch (OracleException e) { var message = string.Format($"单据【{p.lhodoID}】车牌上传结果更新失败"); Common_Arrow.LogHelper.Info(message); Common_Arrow.LogHelper.Error(e); } }); if (errors.Count > 0) { throw new Exception(string.Join("\r\n", errors)); } return(true); }
public string AuditionICPOBILL(string userId, List <string> billnos, AuditEnums auditType) { ICPOBILLAuditor auditor = new ICPOBILLAuditor(userId, auditType); var repository = new DefaultRepository <ICPOBILLMODEL>(DBTypeEnums.ORACLE); var compare = new Dictionary <string, CompareEnum>(); compare.Add("FBILLNO", CompareEnum.In); var bills = repository.SelectWithWhere(new { FBILLNO = billnos }, compare); var result = new StringBuilder(); foreach (var b in bills) { var msg = auditor.AuditBILL(b, auditType); result.Append(msg); } return(result.ToString()); }
public string CheckOption(List <string> billNos, AuditEnums auditType) { var compare = new Dictionary <string, CompareEnum>(); compare.Add("FBILLNO", CompareEnum.In); var bills = repository.SelectWithWhere(new { FBILLNO = billNos }, compare); string msg = ""; if (bills != null && bills.Count > 0) { ICPOBILLStatus billStatus; bills.ForEach(p => { Enum.TryParse(p.FSTATUS.ToString(), out billStatus); if (!CheckOption(billStatus, auditType)) { msg += $"【{billStatus}】状态的单据【{p.FBILLNO}】不能进行【{auditType}】操作"; } }); } return(msg); }