From d4a6d65f5e449c3e5464aa18ae97bf8953987217 Mon Sep 17 00:00:00 2001
From: LR-20210131IOQH\Administrator <jackcold@163.com>
Date: 星期二, 10 八月 2021 15:44:14 +0800
Subject: [PATCH] Merge branch 'master' of http://47.108.235.38:8080/r/zhengcaioa

---
 zhengcaioa/zhengcaioa/Controllers/BusinessOrder/OrderBanciOrderController.cs |  324 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 324 insertions(+), 0 deletions(-)

diff --git a/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/OrderBanciOrderController.cs b/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/OrderBanciOrderController.cs
new file mode 100644
index 0000000..5d7e7ab
--- /dev/null
+++ b/zhengcaioa/zhengcaioa/Controllers/BusinessOrder/OrderBanciOrderController.cs
@@ -0,0 +1,324 @@
+锘縰sing System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using AutoMapper;
+using AngleSharp.Html.Parser;
+using DTO;
+using IServices;
+using Microsoft.AspNetCore.Http;
+using Microsoft.AspNetCore.Mvc;
+using Microsoft.Bot.Builder.Integration.AspNet.Core;
+using Microsoft.Extensions.Logging;
+using Newtonsoft.Json;
+using System.Net.Http;
+using System.Threading.Tasks;
+using zhengcaioa.Models;
+using zhengcaioa.IService;
+using CommonToolsCore;
+using Services;
+using System.Transactions;
+
+namespace zhengcaioa.Controllers.BusinessOrder
+{
+    public class OrderBanciOrderController : Controller
+    {
+        private readonly ILogger<OrderBanciOrderController> _logger;
+        private readonly ILiaotianService _liaotianService;
+        private readonly IOrderBanciService _orderBanciService;
+        private readonly IOrderBanciDtlService _orderBanciDtlService;
+        private readonly IOrderBanciOrderService _orderBanciOrderService;
+        private readonly IFiOrderrecievemoneyService _fiOrderrecievemoneyService;
+
+        public OrderBanciOrderController(ILogger<OrderBanciOrderController> logger, ILiaotianService liaotianService, IOrderBanciService orderBanciService, IOrderBanciDtlService orderBanciDtlService
+            ,IOrderBanciOrderService orderBanciOrderService
+            , IFiOrderrecievemoneyService fiOrderrecievemoneyService)
+        {
+            _logger = logger;
+            _liaotianService = liaotianService;
+            _orderBanciService = orderBanciService;
+            _orderBanciDtlService = orderBanciDtlService;
+            _fiOrderrecievemoneyService = fiOrderrecievemoneyService;
+        }
+
+        [CheckLogin]
+        public IActionResult Index()
+        {
+            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            ViewData["curentuser"] = curentuser;
+            List<ActionEntity> actionlist = new List<ActionEntity>();
+            ActionEntity actionEntity = new ActionEntity();
+            actionEntity.OpenType = 0;
+            actionEntity.ActionUrl = "";
+            actionEntity.ActionFun = "Search";
+            actionEntity.PageIco = "fa fa-search";
+            actionEntity.ActionName = "鏌ヨ";
+            actionlist.Add(actionEntity);
+            //ActionEntity actionEntity1 = new ActionEntity();
+            //actionEntity1.OpenType = 0;
+            //actionEntity1.ActionUrl = "";
+            //actionEntity1.ActionFun = "Add";
+            //actionEntity1.PageIco = "fa fa-plus";
+            //actionEntity1.ActionName = "鏂板";
+            //actionlist.Add(actionEntity1);
+            ActionEntity actionEntity3 = new ActionEntity();
+            actionEntity3.OpenType = 0;
+            actionEntity3.ActionUrl = "";
+            actionEntity3.ActionFun = "Print";
+            actionEntity3.PageIco = "fa fa-print";
+            actionEntity3.ActionName = "鎵撳嵃";
+            actionlist.Add(actionEntity3);
+
+
+            ActionEntity actionEntity4 = new ActionEntity();
+            actionEntity4.OpenType = 0;
+            actionEntity4.ActionUrl = "";
+            actionEntity4.ActionFun = "Duanxin";
+            actionEntity4.PageIco = "";
+            actionEntity4.ActionName = "鍙戦�佺煭淇�";
+            actionlist.Add(actionEntity4);
+
+            ViewData["ActionInfo"] = actionlist;
+
+            ViewBag.kechengleixing = _liaotianService.GetSYScode("order_banci_order", "kechengleixing_id").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
+
+
+
+            return View();
+
+        }
+        [CheckLogin]
+        public IActionResult GetList(OrderBanciOrderDTOSearch search)
+        {
+            //JsonResult jsonResult =   new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
+            return new JsonResult(_orderBanciOrderService.SearchByPaging(search));
+        }
+
+
+
+        [CheckLogin]
+        public IActionResult print(OrderBanciOrderDTOSearch search)
+        {
+            //JsonResult jsonResult =   new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
+            search.rows = 1000;
+            search.page = 1;
+            ViewBag.listLiaotianDTO = _orderBanciOrderService.SearchByPaging(search).DataList as List<OrderBanciOrderDTO>;
+
+
+
+            return View();
+        }
+
+        [CheckLogin]
+        public IActionResult Duanxin(string id = null)
+        {
+            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            ViewData["curentuser"] = curentuser;
+            ViewData["baifangid"] = id;
+
+
+
+            return View();
+        }
+
+        [CheckLogin]
+        public IActionResult Fasong(string neirong, string baifangid)
+        {
+            ResultEntity resultEntity = new ResultEntity();
+            resultEntity.Result = true;
+            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            ViewData["curentuser"] = curentuser;
+            List<OrderBanciOrderDTO> result = new List<OrderBanciOrderDTO>();
+
+            if (baifangid != null)
+            {
+                result = _orderBanciOrderService.GetList(baifangid.Split(","));
+            }
+            else
+            {
+                resultEntity.Result = false;
+                resultEntity.Message = "鏃犺仈绯讳汉鍙风爜";
+            }
+            string customename = "";
+            StringBuilder number = new StringBuilder(); ;
+            if (result != null && result.Count > 0)
+            {
+                for (int i = 0; i < result.Count; i++)
+                {
+                    number.Append(result[i].Lianxidianhua);
+                    customename += result[i].Xingming + ",";
+                    if (i != result.Count - 1)
+                    {
+                        number.Append(",");
+                    }
+                }
+            }
+            else
+            {
+                resultEntity.Result = false;
+                resultEntity.Message = "鏃犺仈绯讳汉";
+            }
+
+            string sss = SMSHelper.PushWToUserMES(number.ToString(), neirong);
+            if (int.Parse(sss) <= 0)
+            {
+                resultEntity.Result = false;
+                resultEntity.Message = "鐭俊鍙戦�佸け璐�";
+                return new JsonResult(resultEntity);
+            }
+           
+            _logger.LogInformation(curentuser.UserName + "鍙戦�佺煭淇$粰瀹㈡埛" + customename);
+            return new JsonResult(resultEntity);
+        }
+
+
+
+
+        /// <summary>
+        /// 淇濆瓨
+        /// </summary>
+        /// <param name="data">宀椾綅瀹炰綋绫诲璞�</param>
+        /// <returns></returns>
+        /// 
+        [HttpPost]
+        public IActionResult Save([FromBody] OrderBanciOrderDTO data)
+        {
+            //var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
+            //ViewData["curentuser"] = curentuser;
+            ReturnMsg<OrderBanciOrderDTO> returnMsg = new ReturnMsg<OrderBanciOrderDTO>();
+            returnMsg.code = 2;
+            try
+            {
+                using (TransactionScope scope = new TransactionScope())
+                {
+                    data.RecStatus = "A";
+                    if (String.IsNullOrEmpty(data.Id))
+                    {
+                        data.Creater = "1";
+                        data.Createtime = DateTime.Now;
+                    }
+                    data.Modifier = "1";
+                    data.Modifytime = DateTime.Now;
+
+                    OrderBanciOrderDTOSearch search = new OrderBanciOrderDTOSearch();
+                    search.page = 1;
+                    search.rows = 1000;
+                    search.BanciId = data.BanciId;
+                    ResultDataEntity<OrderBanciOrderDTO> resultDataEntity = _orderBanciOrderService.SearchByPaging(search);
+
+
+                    data.Baomingrenshu = search.totalrows + 1;
+                    data.Jine = resultDataEntity.DataList.Sum(x => x.Xuefei);
+                    data.Jine += data.Xuefei;
+                    ResultEntity resultEntity = _orderBanciOrderService.save(data);
+                    if (resultEntity.Result)
+                    {
+                        returnMsg.code = 1;
+                        returnMsg.count = 1;
+                        returnMsg.returnObj = data;
+                    }
+                    else
+                    {
+                        returnMsg.error = resultEntity.Message;
+                    }
+                    scope.Complete();
+                }
+            }
+            catch (Exception ex)
+            {
+                returnMsg.code = 2;
+                returnMsg.error = "娌℃湁鑾峰彇鍒皌oken";
+                returnMsg.count = 0;
+
+            }
+
+            return new JsonResult(returnMsg);
+        }
+
+
+
+        //鑾峰彇褰撳墠鐨勬姤鍚嶇殑浜烘暟
+        public IActionResult GetBaoMingRenShu([FromBody] OrderBanciOrderDTOSearch search)
+        {
+            ReturnMsg<List<OrderBanciOrderDTO>> returnMsg = new ReturnMsg<List<OrderBanciOrderDTO>>();
+            returnMsg.code = 2;
+            try
+            {
+                
+                search.page = 1;
+                search.rows = 1;
+                ResultDataEntity<OrderBanciOrderDTO> resultDataEntity = _orderBanciOrderService.SearchByPaging(search);
+
+                returnMsg.code = 1;
+                returnMsg.count = search.totalrows;
+                returnMsg.returnObj = resultDataEntity.DataList;
+
+            }
+            catch (Exception ex)
+            {
+                returnMsg.code = 2;
+                returnMsg.error = "娌℃湁鑾峰彇鍒皌oken";
+                returnMsg.count = 0;
+
+            }
+            return new JsonResult(returnMsg);
+        }
+
+
+        //鑾峰彇褰撳墠鐨勪笟鍔$被鍨�
+        public IActionResult GetBusinessType()
+        {
+            ReturnMsg<List<SysCodeDtl>> returnMsg = new ReturnMsg<List<SysCodeDtl>>();
+            returnMsg.code = 2;
+            try
+            {
+              var sysCodeDtls  = _liaotianService.GetSYScode("CooperVisit", "jtype");
+
+              
+
+                returnMsg.code = 1;
+                returnMsg.count = sysCodeDtls.Count;
+                returnMsg.returnObj = sysCodeDtls;
+
+            }
+            catch (Exception ex)
+            {
+                returnMsg.code = 2;
+                returnMsg.error = "娌℃湁鑾峰彇鍒皌oken";
+                returnMsg.count = 0;
+
+            }
+            return new JsonResult(returnMsg);
+        }
+
+
+        //鑾峰彇浼氬憳璁㈠崟淇℃伅锛屾敮浠樺畬鎴愮殑
+        public IActionResult GetOrderByHuiyuanId([FromBody] FiOrderrecievemoneyDTOSearch search)
+        {
+            ReturnMsg<List<FiOrderrecievemoneyDTO>> returnMsg = new ReturnMsg<List<FiOrderrecievemoneyDTO>>();
+            returnMsg.code = 2;
+            try
+            {
+
+                search.page = 1;
+                search.rows = 1;
+                search.Fkzt = "03";
+                ResultDataEntity<FiOrderrecievemoneyDTO> resultDataEntity = _fiOrderrecievemoneyService.SearchByPaging(search);
+
+                returnMsg.code = 1;
+                returnMsg.count = search.totalrows;
+                returnMsg.returnObj = resultDataEntity.DataList;
+
+            }
+            catch (Exception ex)
+            {
+                returnMsg.code = 2;
+                returnMsg.error = "娌℃湁鑾峰彇鍒皌oken";
+                returnMsg.count = 0;
+
+            }
+            return new JsonResult(returnMsg);
+        }
+
+    }
+}

--
Gitblit v1.9.1