public IActionResult Update([FromBody] CustomerLinkUpdateDto parm)
        {
            var userSession = _tokenManager.GetSessionInfo();

            if (string.IsNullOrEmpty(parm.ID))
            {
                //从 Dto 映射到 实体
                var company = parm.Adapt <uf_khxx_dt1>().ToCreate(_tokenManager.GetSessionInfo());

                return(toResponse(_customerlinkService.Add(company)));
            }
            else
            {
                return(toResponse(_customerlinkService.Update(m => m.ID == parm.ID, m => new uf_khxx_dt1()
                {
                    lxr = parm.lxr,
                    bm = parm.bm,
                    zw = parm.zw,
                    zj = parm.zj,
                    sj = parm.sj,
                    yx = parm.yx,
                    bz = parm.bz,
                    UpdateTime = DateTime.Now
                })));
            }
        }
        public IActionResult Update([FromBody] CustomerUpdateDto parm)
        {
            if (_customerService.Any(m => m.bm == parm.zzmc))
            {
                return(toResponse(StatusCodeType.Error, $"客户组织名称{parm.zzmc} 已存在,不能重复!"));
            }

            var userSession = _tokenManager.GetSessionInfo();

            _customerService.Update(m => m.ID == parm.ID, m => new uf_khxx()
            {
                zzmc       = parm.zzmc,
                UpdateTime = DateTime.Now
            });

            //删除联系人
            string[] ids = parm.CustomerLinkList.Where(x => !string.IsNullOrEmpty(x.ID)).Select(x => x.ID).ToArray();
            _customerlinkService.Delete(m => m.ParentUID == parm.ID && !ids.Contains(m.ID));
            //修改联系人信息
            foreach (var link in parm.CustomerLinkList)
            {
                //判断是否是新增
                if (string.IsNullOrEmpty(link.ID))
                {
                    var customerlink = link.Adapt <uf_khxx_dt1>().ToCreate(_tokenManager.GetSessionInfo());
                    _customerlinkService.Add(customerlink);
                }
                else
                {
                    _customerlinkService.Update(m => m.ID == link.ID, m => new uf_khxx_dt1()
                    {
                        lxr        = link.lxr,
                        bm         = link.bm,
                        zw         = link.zw,
                        zj         = link.zj,
                        sj         = link.sj,
                        yx         = link.yx,
                        bz         = link.bz,
                        UpdateTime = DateTime.Now
                    });
                }
            }

            return(toResponse("更新成功"));
        }