Commit 69cd2acf by 李承祥

方法修改(药占比)

parent 95f75800
using AutoMapper;
using Newtonsoft.Json.Linq;
using Performance.DtoModels;
using Performance.EntityModels;
using Performance.Repository;
......@@ -266,10 +267,8 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
var chargeType = perforCofdrugpropRepository.GetEntities(t => t.AllotID == allotid)?.FirstOrDefault().ChargeType;
List<string> drugtype = new List<string>();
if (!string.IsNullOrEmpty(chargeType))
{
chargeType = chargeType.Replace("[", "").Replace("]", "").Replace("\"", "");
drugtype = chargeType.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
}
drugtype = JArray.Parse(chargeType).ToObject<List<string>>();
var drugData = datalist.Where(t => drugtype.Contains(t.TypeName)).GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
var allData = datalist.GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
......
using AutoMapper;
using Newtonsoft.Json.Linq;
using NPOI.SS.UserModel;
using Performance.DtoModels;
using Performance.Infrastructure;
......@@ -157,10 +158,8 @@ private List<CofDrugProp> GetDrugConfig(PerExcel excel, int allotid)
var chargeType = _perforCofdrugpropRepository.GetEntities(t => t.AllotID == allotid)?.FirstOrDefault().ChargeType;
List<string> drugtype = new List<string>();
if (!string.IsNullOrEmpty(chargeType))
{
chargeType = chargeType.Replace("[", "").Replace("]", "").Replace("\"", "");
drugtype = chargeType.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries).ToList();
}
drugtype = JArray.Parse(chargeType).ToObject<List<string>>();
var drugData = datalist.Where(t => drugtype.Contains(t.TypeName)).GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
var allData = datalist.GroupBy(t => t.AccountingUnit).Select(t => new { AccountingUnit = t.Key, SumValue = t.Sum(s => s.CellValue) });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment