예제 #1
0
        /// <summary>
        /// 查看用户信息
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        public async Task <TData <ViewUserInfor> > ViewUserEntity(long id)
        {
            TData <ViewUserInfor> obj = new TData <ViewUserInfor>();

            obj.SetDefault();
            try
            {
                TData <UserEntity> user = await GetEntity(id);

                if (user.Tag == 1)
                {
                    ViewUserInfor viewObj = new ViewUserInfor();
                    ClassValueCopierHelper.Copy(viewObj, user.Data);

                    obj.Data = viewObj;
                    obj.Tag  = 1;
                    LogHelper.Info("【ViewUserEntity】 viewObj:" + JsonHelper.SerializeObject(viewObj));
                }
                else
                {
                    obj.Message = "用户不存在";
                }
            }
            catch (Exception ex)
            {
                LogHelper.Info("【ViewUserEntity】 ex:" + ex.ToString());
            }
            return(obj);
        }
예제 #2
0
        public async Task <TData <string> > SaveForm(CustWorkSheetParam modelParam, OperatorInfo opuser)
        {
            TData <string> obj = new TData <string>();

            obj.SetDefault();
            try
            {
                CustWorkSheetEntity entity = new CustWorkSheetEntity();
                long num = 0;
                long.TryParse(modelParam.Id, out num);
                entity.Id = num;

                /*
                 * if (!entity.Id.IsNullOrZero())
                 * {
                 *  entity =await custWorkSheetService.GetEntity(entity.Id.Value) ;
                 * }*/

                ClassValueCopierHelper.Copy(entity, modelParam);

                #region 补充数据
                TerInforEntity ter = await new TerInforBLL().GetEntityByNumber(modelParam.TerNumber);
                if (ter != null)
                {
                    entity.TerId = ter.Id.Value;
                }
                else
                {
                    obj.Message = "设备编号不存在";
                    return(obj);
                }

                num = 0;
                long.TryParse(modelParam.DoManId, out num);
                entity.DoManId = num;


                int saleNum = 0;
                int.TryParse(modelParam.Step, out saleNum);
                entity.Step = saleNum;

                if (entity.Id.IsNullOrZero())
                {
                    entity.BaseCreatorId  = long.Parse(opuser.UserIdStr);
                    entity.BaseCreateTime = DateTime.Now;
                }
                entity.BaseModifyTime = DateTime.Now;
                entity.BaseModifierId = long.Parse(opuser.UserIdStr);
                #endregion

                obj = await SaveForm(entity, opuser);
            }
            catch (Exception ex)
            {
                LogHelper.Info("【SaveForm】ex:" + ex.ToString());
            }
            return(obj);
        }
예제 #3
0
        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        public async Task <TData <string> > RegUser(RegUserParam entity)
        {
            TData <string> obj = new TData <string>();

            try
            {
                obj.SetDefault();

                UserEntity userParent = await GetUserEnity(long.Parse(entity.TJCode));

                LogHelper.Info("【RegUser】 userParent:" + JsonHelper.SerializeObject(userParent));
                if (userParent != null)
                {
                    TData <DepartmentEntity> department = await new DepartmentBLL().GetDefaultEndtity();
                    LogHelper.Info("【RegUser】 department:" + JsonHelper.SerializeObject(department));
                    if (department.Tag == 1)
                    {
                        TData <RoleEntity> roleEntity = await new RoleBLL().GetUserRole();
                        LogHelper.Info("【RegUser】 roleEntity:" + JsonHelper.SerializeObject(roleEntity));
                        if (roleEntity.Tag == 1)
                        {
                            UserEntity userEntity = new UserEntity();
                            ClassValueCopierHelper.Copy(userEntity, entity);

                            userEntity.DepartmentId = department.Data.Id;
                            userEntity.RoleIds      = roleEntity.Data.Id + "";

                            userEntity.ParentId   = userParent.Id;
                            userEntity.ParentTxt  = userParent.ParentTxt;
                            userEntity.UserStatus = 1;

                            LogHelper.Info("【RegUser】 userEntity:" + JsonHelper.SerializeObject(userEntity));
                            obj = await SaveForm(userEntity);
                        }
                        else
                        {
                            obj.Message = roleEntity.Message;
                        }
                    }
                    else
                    {
                        obj.Message = department.Message;
                    }
                }
                else
                {
                    obj.Message = "推荐码不存在";
                }
            }
            catch (Exception ex)
            {
                LogHelper.Info("【RegUser】 ex:" + ex.ToString());
            }
            return(obj);
        }
예제 #4
0
        public async Task <TData <string> > SaveForm(TerStatusEntity entity)
        {
            TData <string> obj = new TData <string>();

            entity.BaseModifyTime = DateTime.Now;

            TerStatusEntity ter = await terStatusService.GetEntityByTerNumber(entity.TerNumber);

            if (ter == null)
            {
                ter = new TerStatusEntity();
                ter.SetDefault();

                entity.BaseCreateTime = DateTime.Now;
                entity.BaseVersion    = 0;

                TerInforEntity terInfor = await terInforBLL.GetEntityByNumber(entity.TerNumber);

                // LogHelper.Info(" terInfor:" + JsonHelper.SerializeObject(terInfor));
                if (terInfor != null)
                {
                    entity.TerId   = terInfor.Id;
                    entity.TerName = terInfor.TerName;
                }
                else
                {
                    obj.Tag     = 0;
                    obj.Message = "机器号不存在";
                    return(obj);
                }
            }
            else
            {
                entity.TerId   = ter.TerId;
                entity.TerName = ter.TerName;
                entity.BaseVersion++;
            }
            //LogHelper.Info(" entity:" + JsonHelper.SerializeObject(entity));
            ClassValueCopierHelper.Copy(ter, entity, true);
            // LogHelper.Info(" ter:"+JsonHelper.SerializeObject(ter));

            await terStatusService.SaveForm(ter);

            //修改设备状态

            await terInforBLL.ModifyStatusBusy(entity);

            obj.Data = entity.Id.ParseToString();
            obj.Tag  = 1;
            ;
            //ModifyStatusBusy
            return(obj);
        }
예제 #5
0
        public async Task <TData <string> > SaveForm(OrderMoneyReceiptParam modelParam, OperatorInfo opuser)
        {
            TData <string> obj = new TData <string>();

            obj.SetDefault();
            try
            {
                OrderMoneyReceiptEntity entity = new OrderMoneyReceiptEntity();
                ClassValueCopierHelper.Copy(entity, modelParam);

                #region 补充数据
                long num = 0;
                long.TryParse(modelParam.Id, out num);
                entity.Id = num;

                num = 0;
                long.TryParse(modelParam.SaleManId, out num);
                entity.SaleManId = num;

                num = 0;
                long.TryParse(modelParam.CompanyId, out num);
                entity.CompanyId = num;

                if (entity.Id.IsNullOrZero())
                {
                    entity.BaseCreatorId  = long.Parse(opuser.UserIdStr);
                    entity.BaseCreateTime = DateTime.Now;
                }
                entity.BaseModifyTime = DateTime.Now;
                entity.BaseModifierId = long.Parse(opuser.UserIdStr);
                #endregion

                obj = await SaveForm(entity);
            }
            catch (Exception ex)
            {
                LogHelper.Info("【SaveForm】ex:" + ex.ToString());
            }
            return(obj);
        }
예제 #6
0
        //WishUserParam
        public async Task <TData <string> > SaveForm(WishUserParam entity, OperatorInfo user)
        {
            TData <string> obj = new TData <string>();

            obj.SetDefault();

            #region 检测短信验证码
            obj = new SmsCodeBLL().CheckSms(entity.MobilePhone, entity.SmsCode);
            #endregion
            if (obj.Tag == 1)
            {
                #region 封装数据
                WishUserEntity wishModel = new WishUserEntity();
                ClassValueCopierHelper.Copy(wishModel, entity);
                wishModel.TuiJianUserId  = long.Parse(user.UserIdStr);
                wishModel.TuiJianUserTxt = user.RealName;
                wishModel.SrcFlag        = "1";
                #endregion

                obj = await SaveForm(wishModel);
            }
            return(obj);
        }
예제 #7
0
        public async Task <TData <string> > SaveForm(OrderTerIssueParam modelParam, OperatorInfo opuser)
        {
            TData <string> obj = new TData <string>();

            obj.SetDefault();
            try
            {
                OrderTerIssueEntity entity = new OrderTerIssueEntity();

                long num = 0;
                long.TryParse(modelParam.Id, out num);
                entity.Id = num;

                if (!entity.Id.IsNullOrZero())
                {
                    TData <OrderTerIssueEntity> tdata = await GetEntity(num);

                    entity = tdata.Data;
                }

                ClassValueCopierHelper.Copy(entity, modelParam);

                #region 补充数据
                num = 0;
                long.TryParse(modelParam.Id, out num);
                entity.Id = num;

                num = 0;
                long.TryParse(modelParam.MaterielId, out num);
                entity.MaterielId = num;


                num = 0;
                long.TryParse(modelParam.SaleId, out num);
                entity.SaleId = num;


                int saleNum = 0;
                int.TryParse(modelParam.SaleNum, out saleNum);
                entity.SaleNum = saleNum;

                decimal money = 0;
                decimal.TryParse(modelParam.SalePrice, out money);
                entity.SalePrice = money;

                money = 0;
                decimal.TryParse(modelParam.FactMoney, out money);
                entity.FactMoney = money;


                money = 0;
                decimal.TryParse(modelParam.SrcPrice, out money);
                entity.SrcPrice = money;

                saleNum = 0;
                int.TryParse(modelParam.TakeType, out saleNum);
                entity.TakeType = saleNum;

                saleNum = 0;
                int.TryParse(modelParam.ShenHeStatus, out saleNum);
                entity.ShenHeStatus = saleNum;

                num = 0;
                long.TryParse(modelParam.ShenHeManId, out num);
                entity.ShenHeManId = num;

                num = 0;
                long.TryParse(modelParam.SentManId, out num);
                entity.SentManId = num;

                if (entity.Id.IsNullOrZero())
                {
                    entity.BaseCreatorId  = long.Parse(opuser.UserIdStr);
                    entity.BaseCreateTime = DateTime.Now;
                }
                entity.ReciveAddress  = modelParam.ReciveZone + modelParam.ReciveAddre;
                entity.BaseModifyTime = DateTime.Now;
                entity.BaseModifierId = long.Parse(opuser.UserIdStr);
                #endregion

                LogHelper.Info("【SaveForm】entity:" + JsonHelper.SerializeObject(entity));
                obj = await SaveForm(entity, opuser);
            }
            catch (Exception ex)
            {
                LogHelper.Info("【SaveForm】ex:" + ex.ToString());
            }
            return(obj);
        }