QueryAppService.cs 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Data.Entity;
  4. using System.Globalization;
  5. using System.Linq;
  6. using System.Linq.Dynamic.Core;
  7. using System.Reflection;
  8. using System.Text.RegularExpressions;
  9. using System.Threading.Tasks;
  10. using System.Web.Http.Results;
  11. using System.Web.Mvc;
  12. using System.Web.UI.WebControls;
  13. using System.Xml;
  14. using Abp.Application.Services;
  15. using Abp.Application.Services.Dto;
  16. using Abp.Auditing;
  17. using Abp.Authorization;
  18. using Abp.Domain.Repositories;
  19. using Abp.Extensions;
  20. using Abp.Linq;
  21. using Abp.Linq.Extensions;
  22. using Abp.Runtime.Caching;
  23. using IwbZero.AppServiceBase;
  24. using IwbZero.IdentityFramework;
  25. using IwbZero.Setting;
  26. using Microsoft.AspNet.Identity;
  27. using NPOI.SS.Formula.Functions;
  28. using ShwasherSys.BasicInfo;
  29. using ShwasherSys.BasicInfo.OutFactory;
  30. using ShwasherSys.BasicInfo.OutFactory.Dto;
  31. using ShwasherSys.BasicInfo.StoreHouseLocations.Dto;
  32. using ShwasherSys.Common.Dto;
  33. using ShwasherSys.CompanyInfo;
  34. using ShwasherSys.CompanyInfo.FixedAssetInfo.Dto;
  35. using ShwasherSys.CompanyInfo.MoldInfo.Dto;
  36. using ShwasherSys.CustomerInfo;
  37. using ShwasherSys.CustomerInfo.Dto;
  38. using ShwasherSys.Inspection;
  39. using ShwasherSys.Invoice;
  40. using ShwasherSys.Lambda;
  41. using ShwasherSys.NotificationInfo;
  42. using ShwasherSys.NotificationInfo.Dto;
  43. using ShwasherSys.Order;
  44. using ShwasherSys.OrderSendInfo;
  45. using ShwasherSys.PackageInfo;
  46. using ShwasherSys.ProductInfo;
  47. using ShwasherSys.ProductInfo.Dto;
  48. using ShwasherSys.ProductionOrderInfo;
  49. using ShwasherSys.ProductionOrderInfo.Dto;
  50. using ShwasherSys.ProductStoreInfo;
  51. using ShwasherSys.RmStore;
  52. using ShwasherSys.SemiProductStoreInfo;
  53. using TemplateInfo = ShwasherSys.Inspection.TemplateInfo;
  54. namespace ShwasherSys.Common
  55. {
  56. public interface IQueryAppService : IApplicationService
  57. {
  58. /// <summary>
  59. /// 查询外协厂商信息
  60. /// </summary>
  61. /// <param name="input"></param>
  62. /// <returns></returns>
  63. Task<PagedResultDto<OutFactoryDto>> GetOutFactory(IwbPagedRequestDto input);
  64. /// <summary>
  65. /// 查询客户信息
  66. /// </summary>
  67. /// <param name="input"></param>
  68. /// <returns></returns>
  69. Task<PagedResultDto<CustomerDto>> GetCustomer(IwbPagedRequestDto input);
  70. /// <summary>
  71. /// 查询半成品实时库存信息
  72. /// </summary>
  73. /// <param name="input"></param>
  74. /// <returns></returns>
  75. Task<PagedResultDto<ViewCurrentSemiStoreHouse>> GetCurrentSemiStore(IwbPagedRequestDto input);
  76. /// <summary>
  77. /// 查询半成品信息
  78. /// </summary>
  79. /// <param name="input"></param>
  80. /// <returns></returns>
  81. Task<PagedResultDto<SemiProductDto>> GetSemiProduct(IwbPagedRequestDto input);
  82. Task<string> GetSemiProductName(string id);
  83. Task<SemiProductDto> GetSingleSemiProduct(string input);
  84. /// <summary>
  85. /// 查询产品信息
  86. /// </summary>
  87. /// <param name="input"></param>
  88. /// <returns></returns>
  89. Task<PagedResultDto<ProductDto>> GetProduct(IwbPagedRequestDto input);
  90. Task<Product> GetProductById(EntityDto<string> input);
  91. Task<string> GetProductName(string id);
  92. /// <summary>
  93. /// 查询库位信息
  94. /// </summary>
  95. /// <param name="input"></param>
  96. /// <returns></returns>
  97. Task<PagedResultDto<StoreHouseLocationDto>> GetStoreHouseLocation(IwbPagedRequestDto input);
  98. Task<PagedResultDto<ProductionLogDto>> QueryProductionLog(IwbPagedRequestDto input);
  99. string GetDefualtProductByOrderNo(string orderNo);
  100. string GetDefaultProductByPartNo(string partNo,string orderNo);
  101. string QueryProductByCustomerAndPartNo(string partNo, string customerId) ;
  102. string GetDefualtProductByCustomerId(string customerId);
  103. Customer GetCustomerInfo(EntityDto<string> input);
  104. CustomerSend GetCustomerSendInfo(EntityDto<int> input);
  105. List<CustomerSendDto> GetCustomerSendDtoByCustomerId(CustomerSendDto customerId);
  106. List<SelectListItem> GetProductPropertyList(string pcPropertyName);
  107. List<CurrentProductStoreHouse> QueryStore(string productNo);
  108. List<CurrentProductStoreHouse> QueryStoreFilter(string productNo,string customerId);
  109. BulletinInfo GetBulletinInfo(EntityDto input);
  110. ShortMessage GetShortMsgDetailInfo(ShortMsgDetailDto input);
  111. Task<PagedResultDto<Product>> GetQueryCustomerDefaultProduct(IwbPagedRequestDto input);
  112. List<StoreHouse> QueryStoreHouse(int houseType=0);
  113. List<SelectListItem> QueryStoreHouseSelect(int houseType=0);
  114. string QueryStoreHouseSelectStr(int houseType = 0);
  115. List<ViewSemiEnterStore> QueryEnterStoresByPoNo(string productionOrderNo);
  116. Task<TemplateInfo> QueryTemplate(string tmpKey, int type);
  117. Task<List<Currency>> QueryAllCurrency();
  118. Task<List<CurrencyExchangeRate>> QueryCurrencyRate(string from,string to);
  119. Task<string> GetExpressNameById(int id);
  120. PagedResultDto<ViewEmployee> QueryEmployee(IwbPagedRequestDto input);
  121. Task<PagedResultDto<MoldDto>> QueryMold(IwbPagedRequestDto input);
  122. Task<PagedResultDto<FixedAssetDto>> QueryFixedAsset(IwbPagedRequestDto input);
  123. Task<PagedResultDto<ViewOrderSend>> QuerySendGood(IwbPagedRequestDto input);
  124. Task<PagedResultDto<ViewStickBill>> QueryInvoice(IwbPagedRequestDto input);
  125. Task<PagedResultDto<RmProduct>> GetRmProduct(IwbPagedRequestDto input);
  126. Task<PagedResultDto<ViewCurrentRmStoreHouse>> GetRmCurrentStore(IwbPagedRequestDto input);
  127. Task<PagedResultDto<ViewSemiEnterStore>> GetSemiEnterStoreCheckUnqualified(IwbPagedRequestDto input);
  128. Task<PagedResultDto<ProductPropertyDto>> GetProductProperty(IwbPagedRequestDto input);
  129. Task<string> CalcTaxPrice(int type, string input,string rate);
  130. Task<PagedResultDto<ViewOrderItems>> QueryOrderItem(IwbPagedRequestDto input);
  131. Task<OrderProductProcessDto> QueryOrderProductProcess(int orderItemId);
  132. #region 2023
  133. Task<PagedResultDto<ProductionOrderDto>> QueryProductionOrderDtoByProNo(PagedRequestDto input);
  134. Task<PagedResultDto<ViewCurrentProductStoreHouse>> QueryViewCurrentProductStoreHouseByProNo(
  135. PagedRequestDto input);
  136. Task<PagedResultDto<ViewCurrentSemiStoreHouse>> QueryViewCurrentSemiStoreHouseByProNo(PagedRequestDto input);
  137. #endregion
  138. }
  139. [AbpAuthorize,DisableAuditing]
  140. public class QueryAppService : ApplicationService, IQueryAppService
  141. {
  142. protected ICacheManager CacheManager { get; set; }
  143. protected new IIwbSettingManager SettingManager { get; set; }
  144. public QueryAppService(
  145. IRepository<Customer,string> customerRepository,
  146. IRepository<ViewCurrentSemiStoreHouse> currentSemiRepository,
  147. IRepository<SemiProducts, string> semiProductRepository,
  148. IRepository<Product, string> productRepository,
  149. IRepository<StoreHouseLocation> shlRepository,
  150. IIwbSettingManager settingManager,
  151. ICacheManager cacheManager, IRepository<CustomerDefaultProduct> customerDefaultProductRepository, IRepository<CustomerSend> customerSendRepository, IRepository<OrderHeader, string> orderHeaderRepository, IRepository<CurrentProductStoreHouse> currentProductStoreHouseRepository, IRepository<BulletinInfo> bulletinInfoRepository, IRepository<ShortMessage> shortMessageRepository, IRepository<ShortMsgDetail> shortMsgDetailRepository, IRepository<StoreHouse> storeHouseRepository, IRepository<ViewSemiEnterStore> viewSemiEnterStoreRepository, IRepository<OutFactory, string> outFactoryRepository, IRepository<TemplateInfo> templateInfoRepository, IRepository<Currency, string> currencyRepository, IRepository<CurrencyExchangeRate> currencyExchangeRateRepository, IRepository<ViewEmployee> viewEmployeeRepository, IRepository<RmProduct, string> rmRepository, IRepository<ViewCurrentRmStoreHouse, string> viewCurrentRmStoreHouseRepository, IRepository<ProductionLog> productionLogRepository, IRepository<CustomerDisabledProduct> customerDisabledProductRepository, IRepository<ExpressLogistics> expressRepository, IRepository<Mold> moldRepository, IRepository<FixedAsset> fixedAssetRepository, IRepository<ViewOrderSend> viewOrderSendRepository, IRepository<ViewStickBill, string> viewStickBillRepository, IRepository<ProductProperty> productPropertyRepository, IRepository<ViewOrderItems> viewOrderItemsRepository, IRepository<OrderProduction> orderProductionRepository, IRepository<ProductionOrder> productionOrderRepository, IRepository<PackageApply> packageApplyRepository, IRepository<ViewCurrentProductStoreHouse> viewCurrentProductStoreHouseRepository, IRepository<ViewCurrentSemiStoreHouse> viewCurrentSemiStoreHouseRepository)
  152. {
  153. CustomerRepository = customerRepository;
  154. CurrentSemiRepository = currentSemiRepository;
  155. SemiProductRepository = semiProductRepository;
  156. ProductRepository = productRepository;
  157. ShlRepository = shlRepository;
  158. CacheManager = cacheManager;
  159. CustomerDefaultProductRepository = customerDefaultProductRepository;
  160. CustomerSendRepository = customerSendRepository;
  161. OrderHeaderRepository = orderHeaderRepository;
  162. CurrentProductStoreHouseRepository = currentProductStoreHouseRepository;
  163. BulletinInfoRepository = bulletinInfoRepository;
  164. SettingManager = settingManager;
  165. ShortMessageRepository = shortMessageRepository;
  166. ShortMsgDetailRepository = shortMsgDetailRepository;
  167. StoreHouseRepository = storeHouseRepository;
  168. ViewSemiEnterStoreRepository = viewSemiEnterStoreRepository;
  169. OutFactoryRepository = outFactoryRepository;
  170. TemplateInfoRepository = templateInfoRepository;
  171. CurrencyRepository = currencyRepository;
  172. CurrencyExchangeRateRepository = currencyExchangeRateRepository;
  173. ViewEmployeeRepository = viewEmployeeRepository;
  174. RmRepository = rmRepository;
  175. ViewCurrentRmStoreHouseRepository = viewCurrentRmStoreHouseRepository;
  176. ProductionLogRepository = productionLogRepository;
  177. CustomerDisabledProductRepository = customerDisabledProductRepository;
  178. ExpressRepository = expressRepository;
  179. MoldRepository = moldRepository;
  180. FixedAssetRepository = fixedAssetRepository;
  181. ViewOrderSendRepository = viewOrderSendRepository;
  182. ViewStickBillRepository = viewStickBillRepository;
  183. ProductPropertyRepository = productPropertyRepository;
  184. ViewOrderItemsRepository = viewOrderItemsRepository;
  185. OrderProductionRepository = orderProductionRepository;
  186. ProductionOrderRepository = productionOrderRepository;
  187. PackageApplyRepository = packageApplyRepository;
  188. ViewCurrentProductStoreHouseRepository = viewCurrentProductStoreHouseRepository;
  189. ViewCurrentSemiStoreHouseRepository = viewCurrentSemiStoreHouseRepository;
  190. AsyncQueryableExecuter = NullAsyncQueryableExecuter.Instance;
  191. }
  192. protected IRepository<FixedAsset> FixedAssetRepository { get; }
  193. protected IRepository<Mold> MoldRepository { get; }
  194. protected IRepository<ExpressLogistics> ExpressRepository { get; }
  195. protected IRepository<ProductionLog> ProductionLogRepository { get; }
  196. protected IRepository<OutFactory, string> OutFactoryRepository { get; }
  197. protected IRepository<Customer, string> CustomerRepository { get; }
  198. protected IRepository<ViewCurrentSemiStoreHouse> CurrentSemiRepository { get; }
  199. protected IRepository<SemiProducts, string> SemiProductRepository { get; }
  200. protected IRepository<Product, string> ProductRepository { get; }
  201. public IRepository<StoreHouseLocation> ShlRepository { get; }
  202. protected IRepository<CustomerDefaultProduct> CustomerDefaultProductRepository { get; }
  203. protected IRepository<CustomerSend> CustomerSendRepository { get; }
  204. protected IRepository<OrderHeader, string> OrderHeaderRepository { get; }
  205. protected IRepository<CurrentProductStoreHouse> CurrentProductStoreHouseRepository { get; }
  206. protected IRepository<BulletinInfo> BulletinInfoRepository { get; }
  207. protected IRepository<ShortMessage> ShortMessageRepository { get; }
  208. protected IRepository<ShortMsgDetail> ShortMsgDetailRepository { get; }
  209. protected IRepository<StoreHouse> StoreHouseRepository { get; }
  210. protected IRepository<ViewSemiEnterStore> ViewSemiEnterStoreRepository { get; }
  211. protected IRepository<TemplateInfo> TemplateInfoRepository { get; }
  212. protected IRepository<Currency,string> CurrencyRepository { get; }
  213. protected IRepository<CurrencyExchangeRate> CurrencyExchangeRateRepository { get; }
  214. protected IRepository<ViewEmployee> ViewEmployeeRepository { get; }
  215. protected IRepository<RmProduct,string> RmRepository { get; }
  216. protected IRepository<ViewCurrentRmStoreHouse, string> ViewCurrentRmStoreHouseRepository { get; }
  217. protected IRepository<CustomerDisabledProduct> CustomerDisabledProductRepository { get; }
  218. protected IRepository<ViewOrderSend> ViewOrderSendRepository { get; }
  219. public IAsyncQueryableExecuter AsyncQueryableExecuter { get; set; }
  220. protected IRepository<ProductProperty> ProductPropertyRepository { get; }
  221. protected IRepository<ViewOrderItems> ViewOrderItemsRepository { get; }
  222. protected IRepository<OrderProduction> OrderProductionRepository { get; }
  223. protected IRepository<ProductionOrder> ProductionOrderRepository { get; }
  224. protected IRepository<PackageApply> PackageApplyRepository { get; }
  225. protected IRepository<ViewCurrentProductStoreHouse> ViewCurrentProductStoreHouseRepository { get; }
  226. protected IRepository<ViewCurrentSemiStoreHouse> ViewCurrentSemiStoreHouseRepository { get; }
  227. /// <summary>
  228. /// 查询快递名称
  229. /// </summary>
  230. /// <param name="id"></param>
  231. /// <returns></returns>
  232. public async Task<string> GetExpressNameById(int id)
  233. {
  234. var express = await ExpressRepository.FirstOrDefaultAsync(a => a.Id == id);
  235. return express?.ExpressName ?? "";
  236. }
  237. /// <summary>
  238. /// 查询外协厂商信息
  239. /// </summary>
  240. /// <param name="input"></param>
  241. /// <returns></returns>
  242. public async Task<PagedResultDto<OutFactoryDto>> GetOutFactory(IwbPagedRequestDto input)
  243. {
  244. var query = OutFactoryRepository.GetAll().Where(a => a.IsLock == "N");
  245. if (input.SearchList != null && input.SearchList.Count > 0)
  246. {
  247. List<LambdaObject> objList = new List<LambdaObject>();
  248. foreach (var o in input.SearchList)
  249. {
  250. if (o.KeyWords.IsNullOrEmpty())
  251. continue;
  252. object keyWords = o.KeyWords;
  253. objList.Add(new LambdaObject
  254. {
  255. FieldType = (LambdaFieldType)o.FieldType,
  256. FieldName = o.KeyField,
  257. FieldValue = keyWords,
  258. ExpType = (LambdaExpType)o.ExpType
  259. });
  260. }
  261. var exp = objList.GetExp<OutFactory>();
  262. query = query.Where(exp);
  263. }
  264. var totalCount = await query.CountAsync();
  265. query = query.OrderByDescending(i => i.TimeCreated);
  266. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  267. var entities = await query.ToListAsync();
  268. var dtos = new PagedResultDto<OutFactoryDto>(
  269. totalCount,
  270. entities.Select(ObjectMapper.Map<OutFactoryDto>).ToList()
  271. );
  272. return dtos;
  273. }
  274. /// <summary>
  275. /// 查询客户信息
  276. /// </summary>
  277. /// <param name="input"></param>
  278. /// <returns></returns>
  279. public async Task<PagedResultDto<CustomerDto>> GetCustomer(IwbPagedRequestDto input)
  280. {
  281. var query = CustomerRepository.GetAll().Where(a => a.IsLock == "N");
  282. if (input.SearchList != null && input.SearchList.Count > 0)
  283. {
  284. List<LambdaObject> objList = new List<LambdaObject>();
  285. foreach (var o in input.SearchList)
  286. {
  287. if (o.KeyWords.IsNullOrEmpty())
  288. continue;
  289. object keyWords = o.KeyWords;
  290. objList.Add(new LambdaObject
  291. {
  292. FieldType = (LambdaFieldType)o.FieldType,
  293. FieldName = o.KeyField,
  294. FieldValue = keyWords,
  295. ExpType = (LambdaExpType)o.ExpType
  296. });
  297. }
  298. var exp = objList.GetExp<Customer>();
  299. query = query.Where(exp);
  300. }
  301. var totalCount = await query.CountAsync();
  302. query = query.OrderByDescending(i => i.TimeCreated);
  303. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  304. var entities = await query.ToListAsync();
  305. var dtos = new PagedResultDto<CustomerDto>(
  306. totalCount,
  307. entities.Select(ObjectMapper.Map<CustomerDto>).ToList()
  308. );
  309. return dtos;
  310. }
  311. /// <summary>
  312. /// 查询半成品实时库存信息
  313. /// </summary>
  314. /// <param name="input"></param>
  315. /// <returns></returns>
  316. public async Task<PagedResultDto<ViewCurrentSemiStoreHouse>> GetCurrentSemiStore(IwbPagedRequestDto input)
  317. {
  318. var query = CurrentSemiRepository.GetAll();
  319. if (input.SearchList != null && input.SearchList.Count > 0)
  320. {
  321. List<LambdaObject> objList = new List<LambdaObject>();
  322. foreach (var o in input.SearchList)
  323. {
  324. if (o.KeyWords.IsNullOrEmpty())
  325. continue;
  326. object keyWords = o.KeyWords;
  327. objList.Add(new LambdaObject
  328. {
  329. FieldType = (LambdaFieldType)o.FieldType,
  330. FieldName = o.KeyField,
  331. FieldValue = keyWords,
  332. ExpType = (LambdaExpType)o.ExpType
  333. });
  334. }
  335. var exp = objList.GetExp<ViewCurrentSemiStoreHouse>();
  336. query = query.Where(exp);
  337. }
  338. query = query.Where(i => (i.ActualQuantity - i.FreezeQuantity) > 0);//过滤掉可用数量小于等于0
  339. var totalCount = await query.CountAsync();
  340. query = query.OrderByDescending(i => i.TimeCreated);
  341. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  342. var entities = await query.ToListAsync();
  343. var dtos = new PagedResultDto<ViewCurrentSemiStoreHouse>(totalCount,entities);
  344. return dtos;
  345. }
  346. /// <summary>
  347. /// 查询半成品信息
  348. /// </summary>
  349. /// <param name="input"></param>
  350. /// <returns></returns>
  351. public async Task<PagedResultDto<SemiProductDto>> GetSemiProduct(IwbPagedRequestDto input)
  352. {
  353. var query = SemiProductRepository.GetAll().Where(a => a.IsLock == "N");
  354. if (input.SearchList != null && input.SearchList.Count > 0)
  355. {
  356. List<LambdaObject> objList = new List<LambdaObject>();
  357. foreach (var o in input.SearchList)
  358. {
  359. if (o.KeyWords.IsNullOrEmpty())
  360. continue;
  361. object keyWords = o.KeyWords;
  362. //检查查询条件中带有规格且多个分割条件的
  363. ProductModelSearch.CheckModelGreaterOneFilter(o, ref keyWords);
  364. objList.Add(new LambdaObject
  365. {
  366. FieldType = (LambdaFieldType)o.FieldType,
  367. FieldName = o.KeyField,
  368. FieldValue = keyWords,
  369. ExpType = (LambdaExpType)o.ExpType
  370. });
  371. }
  372. var exp = objList.GetExp<SemiProducts>();
  373. query = query.Where(exp);
  374. }
  375. var totalCount = await query.CountAsync();
  376. query = query.OrderByDescending(i => i.TimeCreated);
  377. //query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  378. //var entities = await query.ToListAsync();
  379. string pattern = ProductModelSearch.GetModelGreaterOneReg(input.SearchList);
  380. List<SemiProducts> entities;
  381. //检查查询条件中带有规格且多个分割条件的
  382. if (!pattern.IsNullOrEmpty())
  383. {
  384. var es = query.ToList();
  385. es = es.Where(f => f.Model != null && Regex.IsMatch(f.Model, pattern)).ToList();
  386. totalCount = es.Count;
  387. entities = es.Skip(input.SkipCount).Take(input.MaxResultCount).ToList();
  388. }
  389. else
  390. {
  391. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  392. entities = await AsyncQueryableExecuter.ToListAsync(query);
  393. }
  394. var dtos = new PagedResultDto<SemiProductDto>(
  395. totalCount,
  396. entities.Select(ObjectMapper.Map<SemiProductDto>).ToList()
  397. );
  398. return dtos;
  399. }
  400. public async Task<SemiProductDto> GetSingleSemiProduct(string input)
  401. {
  402. var query = await SemiProductRepository.FirstOrDefaultAsync(i=>i.Id==input);
  403. return ObjectMapper.Map<SemiProductDto>(query);
  404. }
  405. public async Task<string> GetSemiProductName(string id)
  406. {
  407. var entity = await CacheManager.GetCache(ShwasherConsts.SemiProductCache)
  408. .GetAsync(id, () => SemiProductRepository.FirstOrDefaultAsync(i => i.Id == id));
  409. return entity?.SemiProductName ?? "";
  410. }
  411. public async Task<string> GetProductName(string id)
  412. {
  413. var entity = await CacheManager.GetCache(ShwasherConsts.FinshedProductCache)
  414. .GetAsync(id, () => ProductRepository.FirstOrDefaultAsync(i => i.Id == id));
  415. return entity?.ProductName ?? "";
  416. }
  417. /// <summary>
  418. /// 查询产品信息
  419. /// </summary>
  420. /// <param name="input"></param>
  421. /// <returns></returns>
  422. public async Task<PagedResultDto<ProductDto>> GetProduct(IwbPagedRequestDto input)
  423. {
  424. var query = ProductRepository.GetAll().Where(a => a.IsLock == "N");
  425. if (input.SearchList != null && input.SearchList.Count > 0)
  426. {
  427. List<LambdaObject> objList = new List<LambdaObject>();
  428. foreach (var o in input.SearchList)
  429. {
  430. if (o.KeyWords.IsNullOrEmpty())
  431. continue;
  432. object keyWords = o.KeyWords;
  433. //检查查询条件中带有规格且多个分割条件的
  434. ProductModelSearch.CheckModelGreaterOneFilter(o, ref keyWords);
  435. objList.Add(new LambdaObject
  436. {
  437. FieldType = (LambdaFieldType)o.FieldType,
  438. FieldName = o.KeyField,
  439. FieldValue = keyWords,
  440. ExpType = (LambdaExpType)o.ExpType
  441. });
  442. }
  443. var exp = objList.GetExp<Product>();
  444. query = query.Where(exp);
  445. }
  446. var totalCount = await query.CountAsync();
  447. query = !input.Sorting.IsNullOrWhiteSpace() ? query.OrderBy(input.Sorting) : query.OrderByDescending(i => i.TimeCreated);
  448. string pattern = ProductModelSearch.GetModelGreaterOneReg(input.SearchList);
  449. List<Product> entities;
  450. //检查查询条件中带有规格且多个分割条件的
  451. if (!pattern.IsNullOrEmpty())
  452. {
  453. var es = query.ToList();
  454. es = es.Where(f => f.Model != null && Regex.IsMatch(f.Model, pattern)).ToList();
  455. totalCount = es.Count;
  456. entities = es.Skip(input.SkipCount).Take(input.MaxResultCount).ToList();
  457. }
  458. else
  459. {
  460. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  461. entities = await AsyncQueryableExecuter.ToListAsync(query);
  462. }
  463. //query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  464. //var entities = await query.ToListAsync();
  465. var dtos = new PagedResultDto<ProductDto>(
  466. totalCount,
  467. entities.Select(ObjectMapper.Map<ProductDto>).ToList()
  468. );
  469. return dtos;
  470. }
  471. public async Task<Product> GetProductById(EntityDto<string> input)
  472. {
  473. return await ProductRepository.FirstOrDefaultAsync(input.Id);
  474. }
  475. /// <summary>
  476. /// 查询库位信息
  477. /// </summary>
  478. /// <param name="input"></param>
  479. /// <returns></returns>
  480. public async Task<PagedResultDto<StoreHouseLocationDto>> GetStoreHouseLocation(IwbPagedRequestDto input)
  481. {
  482. var query = ShlRepository.GetAll();
  483. if (input.SearchList != null && input.SearchList.Count > 0)
  484. {
  485. List<LambdaObject> objList = new List<LambdaObject>();
  486. foreach (var o in input.SearchList)
  487. {
  488. if (o.KeyWords.IsNullOrEmpty())
  489. continue;
  490. object keyWords = o.KeyWords;
  491. objList.Add(new LambdaObject
  492. {
  493. FieldType = (LambdaFieldType)o.FieldType,
  494. FieldName = o.KeyField,
  495. FieldValue = keyWords,
  496. ExpType = (LambdaExpType)o.ExpType
  497. });
  498. }
  499. var exp = objList.GetExp<StoreHouseLocation>();
  500. query = query.Where(exp);
  501. }
  502. var totalCount = await query.CountAsync();
  503. query = query.OrderByDescending(i => i.CreationTime);
  504. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  505. var entities = await query.ToListAsync();
  506. var dtos = new PagedResultDto<StoreHouseLocationDto>(
  507. totalCount,
  508. entities.Select(ObjectMapper.Map<StoreHouseLocationDto>).ToList()
  509. );
  510. return dtos;
  511. }
  512. /// <summary>
  513. /// 根据订单号查询当前客户默认的产品
  514. /// </summary>
  515. /// <param name="orderNo"></param>
  516. /// <returns></returns>
  517. public string GetDefualtProductByOrderNo(string orderNo)
  518. {
  519. var orderHeader = OrderHeaderRepository.Get(orderNo);
  520. return GetDefualtProductByCustomerId(orderHeader.CustomerId);
  521. }
  522. /// <summary>
  523. /// 根据订单号和零件号查询当前客户默认的产品
  524. /// </summary>
  525. /// <param name="partNo"></param>
  526. /// <param name="orderNo"></param>
  527. /// <returns></returns>
  528. public string GetDefaultProductByPartNo(string partNo,string orderNo)
  529. {
  530. var orderHeader = OrderHeaderRepository.Get(orderNo);
  531. var defaultProduct = CustomerDefaultProductRepository.FirstOrDefault(i => i.CustomerId == orderHeader.CustomerId&&i.PartNo== partNo);
  532. if (defaultProduct != null)
  533. {
  534. return defaultProduct.ProductNo;
  535. }
  536. return "";
  537. }
  538. /// <summary>
  539. /// 根据订单号和客户编码查询当前客户默认的产品
  540. /// </summary>
  541. /// <param name="partNo"></param>
  542. /// <param name="customerId"></param>
  543. /// <returns></returns>
  544. public string QueryProductByCustomerAndPartNo(string partNo, string customerId)
  545. {
  546. var defaultProduct = CustomerDefaultProductRepository.FirstOrDefault(i => i.CustomerId == customerId && i.PartNo == partNo);
  547. if (defaultProduct != null)
  548. {
  549. return defaultProduct.ProductNo;
  550. }
  551. return "";
  552. }
  553. /// <summary>
  554. /// 根据客户号查询当前客户默认的产品
  555. /// </summary>
  556. /// <param name="orderNo"></param>
  557. /// <returns></returns>
  558. public string GetDefualtProductByCustomerId(string customerId)
  559. {
  560. var defualtProducts = CustomerDefaultProductRepository.GetAll().Where(i => i.CustomerId == customerId);
  561. string lcRetval = "";
  562. foreach (var item in defualtProducts)
  563. {
  564. lcRetval += $"<option value=\"{item.ProductNo}\">{item.ProductNo}</option>";
  565. }
  566. return lcRetval;
  567. }
  568. public Customer GetCustomerInfo(EntityDto<string> input)
  569. {
  570. return CustomerRepository.FirstOrDefault(input.Id);
  571. }
  572. public CustomerSend GetCustomerSendInfo(EntityDto<int> input)
  573. {
  574. return CustomerSendRepository.FirstOrDefault(input.Id);
  575. }
  576. [DisableAuditing]
  577. public List<SelectListItem> GetProductPropertyList(string pcPropertyName)
  578. {
  579. var objList = new List<SelectListItem>();
  580. if (pcPropertyName.IsNullOrEmpty())
  581. {
  582. return objList;
  583. }
  584. var entitys = ProductRepository.GetAll().Where(i => i.IsLock == "N");
  585. var loPropertyInfo = typeof(Product).GetProperty(pcPropertyName,
  586. BindingFlags.GetProperty | BindingFlags.Instance | BindingFlags.Public);
  587. if (loPropertyInfo == null)
  588. {
  589. throw new ArgumentException($"{pcPropertyName} is not a property of type {typeof(Product)}.");
  590. }
  591. IQueryable<string> query = null;
  592. switch (pcPropertyName)
  593. {
  594. case "Material":
  595. query = entitys.Select(i => i.Material).Distinct();
  596. break;
  597. case "SurfaceColor":
  598. query = entitys.Select(i => i.SurfaceColor).Distinct();
  599. break;
  600. case "Rigidity":
  601. query = entitys.Select(i => i.Rigidity).Distinct();
  602. break;
  603. }
  604. if (query != null)
  605. {
  606. foreach (var product in query)
  607. {
  608. objList.Add(new SelectListItem()
  609. {
  610. Text = product,
  611. Value = product
  612. });
  613. }
  614. }
  615. return objList;
  616. }
  617. #region 库存记录查询
  618. public List<CurrentProductStoreHouse> QueryStore(string productNo)
  619. {
  620. if (string.IsNullOrEmpty(productNo))
  621. {
  622. CheckErrors(IwbIdentityResult.Failed("请求的产品编码不存在!"));
  623. }
  624. var entity = CurrentProductStoreHouseRepository.GetAll().Where(i => i.ProductNo == productNo && (i.Quantity > 0||i.ProductionOrderNo.StartsWith("VS"))).OrderByDescending(i => i.TimeLastMod);
  625. List<CurrentProductStoreHouse> productionOrder = new List<CurrentProductStoreHouse>();
  626. List<CurrentProductStoreHouse> hasProductionOrder = new List<CurrentProductStoreHouse>();
  627. if (entity.Any())
  628. {
  629. productionOrder = entity.Where(i => string.IsNullOrEmpty(i.ProductionOrderNo)).ToList();
  630. hasProductionOrder = entity.Where(i => !string.IsNullOrEmpty(i.ProductionOrderNo)).ToList();
  631. }
  632. productionOrder.AddRange(hasProductionOrder);
  633. return productionOrder;
  634. }
  635. public List<CurrentProductStoreHouse> QueryStoreFilter(string productNo,string customerId)
  636. {
  637. if (string.IsNullOrEmpty(productNo))
  638. {
  639. CheckErrors(IwbIdentityResult.Failed("请求的产品编码不存在!"));
  640. }
  641. var entity = CurrentProductStoreHouseRepository.GetAll().Where(i => i.ProductNo == productNo && (i.Quantity > 0 || i.ProductionOrderNo.StartsWith("VS"))&&i.InventoryCheckState!=2);
  642. var disabledOrderNo = CustomerDisabledProductRepository.GetAll().Where(i => i.CustomerNo == customerId)
  643. .Select(i => i.ProductOrderNo).Distinct();
  644. entity = entity.Where(i => !disabledOrderNo.Contains(i.ProductionOrderNo))
  645. .OrderByDescending(i => i.TimeLastMod);
  646. List<CurrentProductStoreHouse> productionOrder = new List<CurrentProductStoreHouse>();
  647. List<CurrentProductStoreHouse> hasProductionOrder = new List<CurrentProductStoreHouse>();
  648. if (entity.Any())
  649. {
  650. productionOrder = entity.Where(i => string.IsNullOrEmpty(i.ProductionOrderNo)&& i.Quantity>0).ToList();
  651. hasProductionOrder = entity.Where(i => !string.IsNullOrEmpty(i.ProductionOrderNo)&& i.Quantity>0).ToList();
  652. }
  653. productionOrder.AddRange(hasProductionOrder);
  654. return productionOrder;
  655. }
  656. #endregion
  657. public BulletinInfo GetBulletinInfo(EntityDto input)
  658. {
  659. var entity = BulletinInfoRepository.FirstOrDefault(i => i.Id == input.Id);
  660. return entity;
  661. }
  662. protected virtual void CheckErrors(IdentityResult identityResult)
  663. {
  664. identityResult.CheckErrors(LocalizationManager);
  665. }
  666. protected virtual void CheckErrors(String error)
  667. {
  668. var identityResult = IdentityResult.Failed(error);
  669. CheckErrors(identityResult);
  670. //identityResult.CheckErrors(LocalizationManager);
  671. }
  672. public ShortMessage GetShortMsgDetailInfo(ShortMsgDetailDto input)
  673. {
  674. var entity = ShortMessageRepository.FirstOrDefault(input.MsgID);
  675. var detailInfo = ShortMsgDetailRepository.FirstOrDefault(input.Id);
  676. detailInfo.IsRead = "Y";
  677. ShortMsgDetailRepository.UpdateAsync(detailInfo);
  678. return entity;
  679. }
  680. public List<CustomerSendDto> GetCustomerSendDtoByCustomerId(CustomerSendDto customerId)
  681. {
  682. var entities = CustomerSendRepository.GetAll().Where(i => i.CustomerId == customerId.CustomerId && i.IsLock == "N");
  683. return ObjectMapper.Map<List<CustomerSendDto>>(entities.ToList());
  684. }
  685. public async Task<PagedResultDto<Product>> GetQueryCustomerDefaultProduct(IwbPagedRequestDto input)
  686. {
  687. var query = ProductRepository.GetAll();
  688. query = query.Where(i => i.IsLock == "N");
  689. string lcCustomerId = "";
  690. if (input.SearchList != null && input.SearchList.Count > 0)
  691. {
  692. List<LambdaObject> objList = new List<LambdaObject>();
  693. foreach (var o in input.SearchList)
  694. {
  695. if (o.KeyWords.IsNullOrEmpty())
  696. continue;
  697. object keyWords = o.KeyWords;
  698. if (o.KeyField == "CustomerId" || o.KeyField == "customerId")
  699. {
  700. lcCustomerId = keyWords + "";
  701. continue;
  702. }
  703. objList.Add(new LambdaObject
  704. {
  705. FieldType = (LambdaFieldType)o.FieldType,
  706. FieldName = o.KeyField,
  707. FieldValue = keyWords,
  708. ExpType = (LambdaExpType)o.ExpType
  709. });
  710. }
  711. var exp = objList.GetExp<Product>();
  712. if (exp != null)
  713. {
  714. query = query.Where(exp);
  715. }
  716. }
  717. List<string> loNotContain = new List<string>();
  718. if (!lcCustomerId.IsNullOrEmpty())
  719. {
  720. var loDefualtProducts = CustomerDefaultProductRepository.GetAll().Where(i => i.CustomerId == lcCustomerId);
  721. foreach (CustomerDefaultProduct defaultProduct in loDefualtProducts)
  722. {
  723. loNotContain.Add(defaultProduct.ProductNo);
  724. }
  725. }
  726. if (loNotContain.Any())
  727. {
  728. query = query.Where(i => !loNotContain.Contains(i.Id));
  729. }
  730. var totalCount = query.Count();
  731. query = query.SortBy("Id");
  732. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  733. var entities = query.ToList();
  734. var dtos = new PagedResultDto<Product>(
  735. totalCount,
  736. entities
  737. );
  738. return dtos;
  739. }
  740. public async Task<PagedResultDto<ProductionLogDto>> QueryProductionLog(IwbPagedRequestDto input)
  741. {
  742. var query = ProductionLogRepository.GetAllIncluding(a=>a.EmployeeInfo);
  743. query = ApplyFilter<ProductionLog>(query,input);
  744. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  745. query = query.OrderBy(a=>a.CreationTime);
  746. query = _ApplyPaging(query, input);
  747. var entities = await AsyncQueryableExecuter.ToListAsync(query);
  748. var dtoList = new PagedResultDto<ProductionLogDto>(totalCount, entities.Select(a=>new ProductionLogDto
  749. {
  750. Id = a.Id,
  751. ProductionNo = a.ProductionNo,
  752. ProductOrderNo = a.ProductOrderNo,
  753. EmployeeId = a.EmployeeId,
  754. EmployeeNo = a.EmployeeInfo.No,
  755. EmployeeName = a.EmployeeInfo.Name,
  756. CarNo = a.CarNo,
  757. QuantityWeight = a.QuantityWeight,
  758. QuantityPcs = a.QuantityPcs,
  759. KgWeight = a.KgWeight,
  760. CreationTime = a.CreationTime
  761. }).ToList());
  762. return dtoList;
  763. }
  764. public List<StoreHouse> QueryStoreHouse(int houseType=0)
  765. {
  766. /*List<StoreHouse> result = CacheManager.GetCache(ShwasherConsts.StoreHouseCache).Get("All",
  767. () => { return StoreHouseRepository.GetAllList(i => i.IsLock == "N"); });*/
  768. var query = StoreHouseRepository.GetAll().Where(i => i.IsLock == "N" );
  769. if (houseType > 0)
  770. {
  771. query = query.Where(i => i.StoreHouseTypeId == houseType);
  772. }
  773. return query.ToList();
  774. }
  775. public List<SelectListItem> QueryStoreHouseSelect(int houseType=0)
  776. {
  777. var query = StoreHouseRepository.GetAll().Where(i => i.IsLock == "N");
  778. if (houseType > 0)
  779. {
  780. query = query.Where(i => i.StoreHouseTypeId == houseType);
  781. }
  782. List<SelectListItem> resultList = new List<SelectListItem>()
  783. {
  784. new SelectListItem()
  785. {
  786. Text = @"请选择仓库...",
  787. Value = "",
  788. Selected = true
  789. }
  790. };
  791. foreach (var entityHouse in query)
  792. {
  793. SelectListItem item = new SelectListItem()
  794. {
  795. Text = entityHouse.StoreHouseName,
  796. Value = entityHouse.Id.ToString()
  797. };
  798. resultList.Add(item);
  799. }
  800. return resultList;
  801. }
  802. public string QueryStoreHouseSelectStr(int houseType=0)
  803. {
  804. var query = StoreHouseRepository.GetAll().Where(i => i.IsLock == "N");
  805. if (houseType > 0)
  806. {
  807. query = query.Where(i => i.StoreHouseTypeId == houseType);
  808. }
  809. string str = "";// "<option data-type=\"\" value=\"\">请选择仓库...</option>";
  810. foreach (var l in query)
  811. {
  812. str += $"<option data-type=\"{l.StoreHouseTypeId}\" value=\"{l.Id}\">{l.StoreHouseName}</option>";
  813. }
  814. return str;
  815. }
  816. public List<ViewSemiEnterStore> QueryEnterStoresByPoNo(string productionOrderNo)
  817. {
  818. var entities = ViewSemiEnterStoreRepository.GetAllList(i => i.ProductionOrderNo == productionOrderNo);
  819. return entities;
  820. }
  821. public async Task<TemplateInfo> QueryTemplate(string tmpKey, int type)
  822. {
  823. var tmps =await TemplateInfoRepository.FirstOrDefaultAsync(i => i.TempKey == tmpKey && i.Type == type);
  824. return tmps;
  825. }
  826. public async Task<List<Currency>> QueryAllCurrency()
  827. {
  828. return await CurrencyRepository.GetAllListAsync();
  829. }
  830. public async Task<List<CurrencyExchangeRate>> QueryCurrencyRate(string from="", string to="")
  831. {
  832. if (from.IsNullOrEmpty()&&!to.IsNullOrEmpty())
  833. {
  834. return await CurrencyExchangeRateRepository.GetAllListAsync(i => i.ToCurrencyId == to);
  835. }
  836. else if (!from.IsNullOrEmpty() && to.IsNullOrEmpty())
  837. {
  838. return await CurrencyExchangeRateRepository.GetAllListAsync(i => i.FromCurrencyId == from );
  839. }
  840. else
  841. {
  842. return await CurrencyExchangeRateRepository.GetAllListAsync(i => i.FromCurrencyId == from && i.ToCurrencyId == to);
  843. }
  844. }
  845. public PagedResultDto<ViewEmployee> QueryEmployee(IwbPagedRequestDto input)
  846. {
  847. var query = ViewEmployeeRepository.GetAll();
  848. if (input.SearchList != null && input.SearchList.Count > 0)
  849. {
  850. List<LambdaObject> objList = new List<LambdaObject>();
  851. foreach (var o in input.SearchList)
  852. {
  853. if (o.KeyWords.IsNullOrEmpty())
  854. continue;
  855. object keyWords = o.KeyWords;
  856. objList.Add(new LambdaObject
  857. {
  858. FieldType = (LambdaFieldType)o.FieldType,
  859. FieldName = o.KeyField,
  860. FieldValue = keyWords,
  861. ExpType = (LambdaExpType)o.ExpType
  862. });
  863. }
  864. var exp = objList.GetExp<ViewEmployee>();
  865. if (exp != null)
  866. {
  867. query = query.Where(exp);
  868. }
  869. }
  870. var totalCount = query.Count();
  871. query = query.SortBy("No");
  872. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  873. var entities = query.ToList();
  874. var dtos = new PagedResultDto<ViewEmployee>(
  875. totalCount,
  876. entities
  877. );
  878. return dtos;
  879. }
  880. /// <summary>
  881. /// 查询模具信息
  882. /// </summary>
  883. /// <param name="input"></param>
  884. /// <returns></returns>
  885. public async Task<PagedResultDto<MoldDto>> QueryMold(IwbPagedRequestDto input)
  886. {
  887. var query = MoldRepository.GetAll();
  888. query = ApplyFilter(query,input);
  889. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  890. query = _ApplySorting(query, input);
  891. query = _ApplyPaging(query, input);
  892. var entities = await AsyncQueryableExecuter.ToListAsync(query);
  893. var dtoList = new PagedResultDto<MoldDto>(totalCount, entities.Select(ObjectMapper.Map<MoldDto>).ToList());
  894. return dtoList;
  895. }
  896. /// <summary>
  897. /// 查询模具信息
  898. /// </summary>
  899. /// <param name="input"></param>
  900. /// <returns></returns>
  901. public async Task<PagedResultDto<FixedAssetDto>> QueryFixedAsset(IwbPagedRequestDto input)
  902. {
  903. var query = FixedAssetRepository.GetAll();
  904. query = ApplyFilter(query,input);
  905. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  906. query = _ApplySorting(query, input);
  907. query = _ApplyPaging(query, input);
  908. var entities = await AsyncQueryableExecuter.ToListAsync(query);
  909. var dtoList = new PagedResultDto<FixedAssetDto>(totalCount, entities.Select(ObjectMapper.Map<FixedAssetDto>).ToList());
  910. return dtoList;
  911. }
  912. /// <summary>
  913. /// 查询发货明细信息
  914. /// </summary>
  915. /// <param name="input"></param>
  916. /// <returns></returns>
  917. public async Task<PagedResultDto<ViewOrderSend>> QuerySendGood(IwbPagedRequestDto input)
  918. {
  919. var query = ViewOrderSendRepository.GetAll().Where(a=>!string.IsNullOrEmpty(a.OrderSendBillNo));
  920. query = ApplyFilter(query,input);
  921. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  922. query = query.OrderByDescending(a=>a.OrderItemId);
  923. query = _ApplyPaging(query, input);
  924. var entities = await AsyncQueryableExecuter.ToListAsync(query);
  925. var dtoList = new PagedResultDto<ViewOrderSend>(totalCount, entities);
  926. return dtoList;
  927. }
  928. protected IRepository<ViewStickBill, string> ViewStickBillRepository { get; }
  929. /// <summary>
  930. /// 查询发票信息
  931. /// </summary>
  932. /// <param name="input"></param>
  933. /// <returns></returns>
  934. public async Task<PagedResultDto<ViewStickBill>> QueryInvoice(IwbPagedRequestDto input)
  935. {
  936. var query = ViewStickBillRepository.GetAll();
  937. query = ApplyFilter(query,input);
  938. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  939. query = query.OrderByDescending(a=>a.TimeCreated);
  940. query = _ApplyPaging(query, input);
  941. var entities = await AsyncQueryableExecuter.ToListAsync(query);
  942. var dtoList = new PagedResultDto<ViewStickBill>(totalCount, entities);
  943. return dtoList;
  944. }
  945. public async Task<PagedResultDto<RmProduct>> GetRmProduct(IwbPagedRequestDto input)
  946. {
  947. var query = RmRepository.GetAll();
  948. query = ApplyFilter<RmProduct>(query,input);
  949. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  950. query = _ApplySorting(query, input);
  951. query = _ApplyPaging(query, input);
  952. var entities = await AsyncQueryableExecuter.ToListAsync(query);
  953. var dtoList = new PagedResultDto<RmProduct>(totalCount, entities);
  954. return dtoList;
  955. }
  956. public async Task<PagedResultDto<ViewCurrentRmStoreHouse>> GetRmCurrentStore(IwbPagedRequestDto input)
  957. {
  958. var query = ViewCurrentRmStoreHouseRepository.GetAll();
  959. query = ApplyFilter<ViewCurrentRmStoreHouse>(query, input);
  960. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  961. query = _ApplySorting(query, input);
  962. query = _ApplyPaging(query, input);
  963. var entities = await AsyncQueryableExecuter.ToListAsync(query);
  964. var dtoList = new PagedResultDto<ViewCurrentRmStoreHouse>(totalCount, entities);
  965. return dtoList;
  966. }
  967. public async Task<PagedResultDto<ViewSemiEnterStore>> GetSemiEnterStoreCheckUnqualified(IwbPagedRequestDto input)
  968. {
  969. var checkState = EnterStoreApplyStatusEnum.UnChecked.ToInt() + "";
  970. var query = ViewSemiEnterStoreRepository.GetAll().Where(a => a.ApplyStatus == checkState);
  971. query = ApplyFilter<ViewSemiEnterStore>(query, input);
  972. var totalCount = query.Count();
  973. query = query.OrderByDescending(i => i.TimeCreated);
  974. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  975. var entities = await AsyncQueryableExecuter.ToListAsync(query);
  976. var dots = new PagedResultDto<ViewSemiEnterStore>(
  977. totalCount, entities
  978. );
  979. return dots;
  980. }
  981. /// <summary>
  982. /// 查询产品属性
  983. /// </summary>
  984. /// <param name="input"></param>
  985. /// <returns></returns>
  986. public async Task<PagedResultDto<ProductPropertyDto>> GetProductProperty(IwbPagedRequestDto input)
  987. {
  988. var query = ProductPropertyRepository.GetAll();
  989. query = ApplyFilter(query, input);
  990. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  991. query = _ApplySorting(query, input);
  992. query = _ApplyPaging(query, input);
  993. var entities = await AsyncQueryableExecuter.ToListAsync(query);
  994. var dtoList = new PagedResultDto<ProductPropertyDto>(totalCount, entities.Select(ObjectMapper.Map<ProductPropertyDto>).ToList());
  995. return dtoList;
  996. }
  997. /// <summary>
  998. /// 查询订单明细信息
  999. /// </summary>
  1000. /// <param name="input"></param>
  1001. /// <returns></returns>
  1002. public async Task<PagedResultDto<ViewOrderItems>> QueryOrderItem(IwbPagedRequestDto input)
  1003. {
  1004. var query = ViewOrderItemsRepository.GetAll();
  1005. query = ApplyFilter(query, input);
  1006. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  1007. query = query.OrderByDescending(a => a.SendDate);
  1008. string pattern = ProductModelSearch.GetModelGreaterOneReg(input.SearchList);
  1009. List<ViewOrderItems> entities;
  1010. //检查查询条件中带有规格且多个分割条件的
  1011. if (!pattern.IsNullOrEmpty())
  1012. {
  1013. var es = query.ToList();
  1014. es = es.Where(f => f.Model != null && Regex.IsMatch(f.Model, pattern)).ToList();
  1015. totalCount = es.Count;
  1016. entities = es.Skip(input.SkipCount).Take(input.MaxResultCount).ToList();
  1017. }
  1018. else
  1019. {
  1020. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  1021. entities = await AsyncQueryableExecuter.ToListAsync(query);
  1022. }
  1023. //query = _ApplyPaging(query, input);
  1024. //var entities = await AsyncQueryableExecuter.ToListAsync(query);
  1025. var dtoList = new PagedResultDto<ViewOrderItems>(totalCount, entities);
  1026. return dtoList;
  1027. }
  1028. public async Task<OrderProductProcessDto> QueryOrderProductProcess(int orderItemId)
  1029. {
  1030. OrderProductProcessDto result = new OrderProductProcessDto();
  1031. var rs = OrderProductionRepository.GetAllList(i => i.OrderItemId == orderItemId);
  1032. if (rs.Any())
  1033. {
  1034. var productionNoArr = rs.Select(i => i.ProductionOrderNo);
  1035. List<PackageApply> pas =
  1036. await PackageApplyRepository.GetAllListAsync(i => productionNoArr.Contains(i.ProductionOrderNo));
  1037. List<ProductionOrder> pos = await ProductionOrderRepository.GetAllListAsync(i => productionNoArr.Contains(i.ProductionOrderNo));
  1038. result.PackageApplyList = pas;
  1039. result.ProductionOrderList = pos;
  1040. }
  1041. return result;
  1042. }
  1043. protected IQueryable<T> ApplyFilter<T>(IQueryable<T> query, IwbPagedRequestDto input)
  1044. {
  1045. var pagedInput = input as IIwbPagedRequest;
  1046. if (pagedInput == null)
  1047. {
  1048. return query;
  1049. }
  1050. if (!string.IsNullOrEmpty(pagedInput.KeyWords))
  1051. {
  1052. object keyWords = pagedInput.KeyWords;
  1053. LambdaObject obj = new LambdaObject()
  1054. {
  1055. FieldType = (LambdaFieldType)pagedInput.FieldType,
  1056. FieldName = pagedInput.KeyField,
  1057. FieldValue = keyWords,
  1058. ExpType = (LambdaExpType)pagedInput.ExpType
  1059. };
  1060. var exp = obj.GetExp<T>();
  1061. query = exp != null ? query.Where(exp) : query;
  1062. }
  1063. if (pagedInput.SearchList != null && pagedInput.SearchList.Count > 0)
  1064. {
  1065. List<LambdaObject> objList = new List<LambdaObject>();
  1066. foreach (var o in pagedInput.SearchList)
  1067. {
  1068. if (string.IsNullOrEmpty(o.KeyWords))
  1069. continue;
  1070. object keyWords = o.KeyWords;
  1071. //检查查询条件中带有规格且多个分割条件的
  1072. ProductModelSearch.CheckModelGreaterOneFilter(o, ref keyWords);
  1073. objList.Add(new LambdaObject
  1074. {
  1075. FieldType = (LambdaFieldType)o.FieldType,
  1076. FieldName = o.KeyField,
  1077. FieldValue = keyWords,
  1078. ExpType = (LambdaExpType)o.ExpType
  1079. });
  1080. }
  1081. var exp = objList.GetExp<T>();
  1082. query = exp != null ? query.Where(exp) : query;
  1083. }
  1084. return query;
  1085. }
  1086. /// <summary>
  1087. /// 分页
  1088. /// </summary>
  1089. /// <param name="query">The query.</param>
  1090. /// <param name="input">The input.</param>
  1091. protected IQueryable<T> _ApplyPaging<T>(IQueryable<T> query, IwbPagedRequestDto input)
  1092. {
  1093. //Try to use paging if available
  1094. var pagedInput = input as IPagedResultRequest;
  1095. if (pagedInput != null)
  1096. {
  1097. return query.PageBy(pagedInput);
  1098. }
  1099. //Try to limit query result if available
  1100. var limitedInput = input as ILimitedResultRequest;
  1101. if (limitedInput != null)
  1102. {
  1103. return query.Take(limitedInput.MaxResultCount);
  1104. }
  1105. //No paging
  1106. return query;
  1107. }
  1108. /// <summary>
  1109. /// 排序
  1110. /// </summary>
  1111. /// <param name="query">The query.</param>
  1112. /// <param name="input">The input.</param>
  1113. protected IQueryable<T> _ApplySorting<T>(IQueryable<T> query, IwbPagedRequestDto input)
  1114. {
  1115. //Try to sort query if available
  1116. var sortInput = input as ISortedResultRequest;
  1117. if (sortInput != null)
  1118. {
  1119. if (!sortInput.Sorting.IsNullOrWhiteSpace())
  1120. {
  1121. return query.OrderBy(sortInput.Sorting);
  1122. }
  1123. }
  1124. //IQueryable.Task requires sorting, so we should sort if Take will be used.
  1125. if (input is ILimitedResultRequest)
  1126. {
  1127. return query.OrderBy("CreationTime DESC");
  1128. }
  1129. //No sorting
  1130. return query;
  1131. }
  1132. public async Task<string> CalcTaxPrice(int type, string input,string rate)
  1133. {
  1134. decimal result = 0;
  1135. try
  1136. {
  1137. decimal inputDec = Convert.ToDecimal(input);
  1138. decimal rateDec = Convert.ToDecimal(rate);
  1139. switch (type)
  1140. {
  1141. case 1:
  1142. result = inputDec / (1 + (rateDec / 100));
  1143. break;
  1144. case 2:
  1145. result = inputDec * (1 + (rateDec / 100));
  1146. break;
  1147. }
  1148. }
  1149. catch (Exception e)
  1150. {
  1151. result = 0;
  1152. }
  1153. return Convert.ToDouble(result).ToString("f3");
  1154. }
  1155. #region 2023
  1156. private void GetPropertiesNo(List<MultiSearchDto> searchList,ref string modelNo, ref string materialNo, ref string rigidityNo, ref string surfaceColorNo)
  1157. {
  1158. foreach (var o in searchList)
  1159. {
  1160. if (o.KeyWords.IsNullOrEmpty())
  1161. continue;
  1162. object keyWords = o.KeyWords;
  1163. if (o.KeyField?.ToLower() == "modelno")
  1164. {
  1165. modelNo = keyWords.ToString();
  1166. }
  1167. if (o.KeyField?.ToLower() == "materialno")
  1168. {
  1169. materialNo = keyWords.ToString();
  1170. }
  1171. if (o.KeyField?.ToLower() == "rigidityno")
  1172. {
  1173. rigidityNo = keyWords.ToString();
  1174. }
  1175. if (o.KeyField?.ToLower() == "surfacecolorno")
  1176. {
  1177. surfaceColorNo = keyWords.ToString();
  1178. }
  1179. }
  1180. }
  1181. public async Task<PagedResultDto<ProductionOrderDto>> QueryProductionOrderDtoByProNo(PagedRequestDto input)
  1182. {
  1183. var query = ProductionOrderRepository.GetAll();
  1184. var result = from u in query
  1185. join s in SemiProductRepository.GetAll() on u.SemiProductNo equals s.Id into l
  1186. from luq in l.DefaultIfEmpty()
  1187. select new ProductionOrderDto
  1188. {
  1189. Model = luq.Model ?? "",
  1190. CarNo = u.CarNo,
  1191. EnterQuantity = u.EnterQuantity,
  1192. Id = u.Id,
  1193. ProductionType = u.ProductionType,
  1194. OutsourcingFactory = u.OutsourcingFactory,
  1195. CreatorUserId = u.CreatorUserId,
  1196. IsChecked = u.IsChecked,
  1197. IsLock = u.IsLock,
  1198. Material = luq.Material ?? "",
  1199. PartNo = luq.PartNo ?? "",
  1200. PlanProduceDate = u.PlanProduceDate,
  1201. RawMaterials = u.RawMaterials,
  1202. SurfaceColor = luq.SurfaceColor ?? "",
  1203. Rigidity = luq.Rigidity ?? "",
  1204. Remark = u.Remark,
  1205. UserIDLastMod = u.UserIDLastMod,
  1206. TimeCreated = u.TimeCreated,
  1207. TimeLastMod = u.TimeLastMod,
  1208. Size = u.Size,
  1209. ProcessingType = u.ProcessingType,
  1210. ProcessingLevel = u.ProcessingLevel,
  1211. SourceProductionOrderNo = u.SourceProductionOrderNo,
  1212. StoveNo = u.StoveNo,
  1213. Quantity = u.Quantity,
  1214. ProductionOrderNo = u.ProductionOrderNo,
  1215. ProductionOrderStatus = u.ProductionOrderStatus,
  1216. SemiProductNo = u.SemiProductNo,
  1217. SemiProductName = luq.SemiProductName,
  1218. KgWeight = u.KgWeight,
  1219. EnterDate = u.EnterDate,
  1220. InspectDate = u.InspectDate,
  1221. HasExported = u.HasExported
  1222. };
  1223. var endState = ProductionOrderStatusEnum.End.ToInt();
  1224. result = result.Where(a => (a.ProductionOrderStatus != endState));
  1225. var searchList = input.SearchList;
  1226. if (searchList != null && searchList.Count > 0)
  1227. {
  1228. //List<LambdaObject> objList = new List<LambdaObject>();
  1229. string modelNo = "", materialNo = "", rigidityNo = "", surfaceColorNo = "";
  1230. GetPropertiesNo(searchList,ref modelNo, ref materialNo, ref rigidityNo, ref surfaceColorNo);
  1231. if (modelNo.IsNullOrEmpty())
  1232. {
  1233. CheckErrors("规格不能为空!");
  1234. }
  1235. //111,110,100,000
  1236. if ((materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty())||(!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty())|| (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()))
  1237. {
  1238. result = result.Where(i => i.SemiProductNo.StartsWith("s" + modelNo + materialNo + rigidityNo + surfaceColorNo));
  1239. }//101,001,011
  1240. else if((!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()))
  1241. {
  1242. result = result.Where(i => i.SemiProductNo.StartsWith("s" + modelNo + materialNo) && i.SemiProductNo.Contains(rigidityNo + surfaceColorNo));
  1243. }//010
  1244. else if (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty())
  1245. {
  1246. result = result.Where(i => i.SemiProductNo.StartsWith("s" + modelNo));
  1247. result = result.Where(i => i.SemiProductNo.Contains( rigidityNo));
  1248. }
  1249. }
  1250. var totalCount = await AsyncQueryableExecuter.CountAsync(result);
  1251. result = result.OrderByDescending(i => i.TimeCreated);
  1252. result = result.Skip(input.SkipCount).Take(input.MaxResultCount);
  1253. var dtos = new PagedResultDto<ProductionOrderDto>(
  1254. totalCount,
  1255. result.ToList()
  1256. );
  1257. return dtos;
  1258. }
  1259. public async Task<PagedResultDto<ViewCurrentProductStoreHouse>> QueryViewCurrentProductStoreHouseByProNo(PagedRequestDto input)
  1260. {
  1261. var query = ViewCurrentProductStoreHouseRepository.GetAll();
  1262. var searchList = input.SearchList;
  1263. if (searchList != null && searchList.Count > 0)
  1264. {
  1265. //List<LambdaObject> objList = new List<LambdaObject>();
  1266. //foreach (var o in searchList)
  1267. //{
  1268. // if (o.KeyWords.IsNullOrEmpty())
  1269. // continue;
  1270. // object keyWords = o.KeyWords;
  1271. // if (o.KeyField?.ToLower() == "productno")
  1272. // {
  1273. // query = query.Where(a => a.ProductNo.StartsWith(o.KeyWords));
  1274. // }
  1275. //}
  1276. string modelNo = "", materialNo = "", rigidityNo = "", surfaceColorNo = "";
  1277. GetPropertiesNo(searchList, ref modelNo, ref materialNo, ref rigidityNo, ref surfaceColorNo);
  1278. if (modelNo.IsNullOrEmpty())
  1279. {
  1280. CheckErrors("规格不能为空!");
  1281. }
  1282. //111,110,100,000
  1283. if ((materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()))
  1284. {
  1285. query = query.Where(i => i.ProductNo.StartsWith("s" + modelNo + materialNo + rigidityNo + surfaceColorNo));
  1286. }//101,001,011
  1287. else if ((!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()))
  1288. {
  1289. query = query.Where(i => i.ProductNo.StartsWith("s" + modelNo + materialNo) && i.ProductNo.Contains(rigidityNo + surfaceColorNo));
  1290. //query = query.Where(i => i.ProductNo.EndsWith(rigidityNo + surfaceColorNo));
  1291. }//010
  1292. else if (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty())
  1293. {
  1294. query = query.Where(i => i.ProductNo.StartsWith("s" + modelNo));
  1295. query = query.Where(i => i.ProductNo.Contains(rigidityNo));
  1296. }
  1297. }
  1298. query = query.Where(i => i.ActualQuantity > 0);
  1299. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  1300. query = query.OrderByDescending(i => i.TimeCreated);
  1301. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  1302. var dtos = new PagedResultDto<ViewCurrentProductStoreHouse>(
  1303. totalCount,
  1304. query.ToList()
  1305. );
  1306. return dtos;
  1307. }
  1308. public async Task<PagedResultDto<ViewCurrentSemiStoreHouse>> QueryViewCurrentSemiStoreHouseByProNo(PagedRequestDto input)
  1309. {
  1310. var query = ViewCurrentSemiStoreHouseRepository.GetAll();
  1311. var searchList = input.SearchList;
  1312. if (searchList != null && searchList.Count > 0)
  1313. {
  1314. //List<LambdaObject> objList = new List<LambdaObject>();
  1315. //foreach (var o in searchList)
  1316. //{
  1317. // if (o.KeyWords.IsNullOrEmpty())
  1318. // continue;
  1319. // object keyWords = o.KeyWords;
  1320. // if (o.KeyField?.ToLower() == "productno")
  1321. // {
  1322. // query = query.Where(a => a.SemiProductNo.StartsWith(o.KeyWords));
  1323. // }
  1324. //}
  1325. string modelNo = "", materialNo = "", rigidityNo = "", surfaceColorNo = "";
  1326. GetPropertiesNo(searchList, ref modelNo, ref materialNo, ref rigidityNo, ref surfaceColorNo);
  1327. if (modelNo.IsNullOrEmpty())
  1328. {
  1329. CheckErrors("规格不能为空!");
  1330. }
  1331. //111,110,100,000
  1332. if ((materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()) || (!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty()))
  1333. {
  1334. query = query.Where(i => i.SemiProductNo.StartsWith("s" + modelNo + materialNo + rigidityNo + surfaceColorNo));
  1335. }//101,001,011
  1336. else if ((!materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()) || (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && !surfaceColorNo.IsNullOrEmpty()))
  1337. {
  1338. query = query.Where(i => i.SemiProductNo.StartsWith("s" + modelNo + materialNo)&& i.SemiProductNo.Contains(rigidityNo + surfaceColorNo));
  1339. }//010
  1340. else if (materialNo.IsNullOrEmpty() && !rigidityNo.IsNullOrEmpty() && surfaceColorNo.IsNullOrEmpty())
  1341. {
  1342. query = query.Where(i => i.SemiProductNo.StartsWith("s" + modelNo));
  1343. query = query.Where(i => i.SemiProductNo.Contains(rigidityNo));
  1344. }
  1345. }
  1346. query = query.Where(i => i.ActualQuantity > 0);
  1347. var totalCount = await AsyncQueryableExecuter.CountAsync(query);
  1348. query = query.OrderByDescending(i => i.TimeCreated);
  1349. query = query.Skip(input.SkipCount).Take(input.MaxResultCount);
  1350. var dtos = new PagedResultDto<ViewCurrentSemiStoreHouse>(
  1351. totalCount,
  1352. query.ToList()
  1353. );
  1354. return dtos;
  1355. }
  1356. #endregion
  1357. }
  1358. }