username@email.com
2021-10-09 f33ece65bdfd7b8354bd5046d4b9d2d600643b0f
tijiao
15个文件已修改
6个文件已添加
960 ■■■■ 已修改文件
zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/AdmGoodsManageDTO.cs 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/DTO/AdmGoodsRecordDTO.cs 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/IServices/IAdmGoodsRecordService.cs 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/AdmGoodsManage.cs 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/AdmGoodsRecord.cs 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Model/zhengcaioaContext.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/AdmGoodsManageService.cs 4 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/AdmGoodsRecordService.cs 207 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/Services/DailyManagementService.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs 174 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs 18 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsRecordController.cs 125 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/admin/AdmTongxunluController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Controllers/admin/AdmZhanghaomimaController.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Startup.cs 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml 138 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Index.cshtml 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Liushuizhang.cshtml 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Index.cshtml 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
zhengcaioa/CommonToolsCore/AutoMapperConfigs.cs
@@ -270,6 +270,8 @@
            CreateMap<AdmZhanghaomima, AdmZhanghaomimaDTO>();
            CreateMap<AdmZhanghaomimaDTO, AdmZhanghaomima>();
            CreateMap<AdmGoodsRecord, AdmGoodsRecordDTO>();
            CreateMap<AdmGoodsRecordDTO, AdmGoodsRecord>();
        }
    }
zhengcaioa/DTO/AdmGoodsManageDTO.cs
@@ -23,6 +23,7 @@
        public decimal? GoodsCaozuo { get; set; }
        public string HaocaiStatus { get; set; }
        public string ISBN { get; set; }
    }
    public class AdmGoodsManageDTOSearch : SearchEntity
zhengcaioa/DTO/AdmGoodsRecordDTO.cs
New file
@@ -0,0 +1,43 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace DTO
{
    public class AdmGoodsRecordDTO
    {
        public string Id { get; set; }
        public string GoodsId { get; set; }
        public string GoodsName { get; set; }
        public string ISBN { get; set; }
        public string RecordTypeId { get; set; }
        public string RecordTypeName { get; set; }
        public decimal? GoodsNum { get; set; }
        public decimal? GoodsLeft { get; set; }
        public string OperationalMatters { get; set; }
        public string Remark { get; set; }
        public string RecStatus { get; set; }
        public string Creater { get; set; }
        public DateTime Createtime { get; set; }
        public string CreatetimeName { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
    }
    public class AdmGoodsRecordDTOSearch : SearchEntity
    {
        public string Createtime { get; set; }
        public string OperationalMatters { get; set; }
        public string RecordTypeId { get; set; }
        public string GoodsId { get; set; }
    }
}
zhengcaioa/IServices/IAdmGoodsRecordService.cs
New file
@@ -0,0 +1,20 @@
using DTO;
using System;
using System.Collections.Generic;
using System.Text;
namespace IServices
{
    public interface IAdmGoodsRecordService
    {
        ResultEntity save(AdmGoodsRecordDTO dto);
        AdmGoodsRecordDTO Get(string id);
        ResultDataEntity<AdmGoodsRecordDTO> SearchByPaging(AdmGoodsRecordDTOSearch searchEntity);
        ResultEntity ModifyStatus(string id, string userid);
        List<AdmGoodsRecordDTO> GetList();
    }
}
zhengcaioa/Model/AdmGoodsManage.cs
@@ -20,5 +20,8 @@
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
        public string HaocaiStatus { get; set; }
        public string ISBN { get; set; }
    }
}
zhengcaioa/Model/AdmGoodsRecord.cs
New file
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
#nullable disable
namespace zhengcaioa.Models
{
    public partial class AdmGoodsRecord
    {
        public string Id { get; set; }
        public string GoodsId { get; set; }
        public string RecordTypeId { get; set; }
        public decimal? GoodsNum { get; set; }
        public decimal? GoodsLeft { get; set; }
        public string OperationalMatters { get; set; }
        public string Remark { get; set; }
        public string RecStatus { get; set; }
        public string Creater { get; set; }
        public DateTime Createtime { get; set; }
        public string Modifier { get; set; }
        public DateTime Modifytime { get; set; }
    }
}
zhengcaioa/Model/zhengcaioaContext.cs
@@ -29,6 +29,7 @@
        public virtual DbSet<AdmAskCiZhi> AdmAskCiZhis { get; set; }
        public virtual DbSet<AdmAskcost> AdmAskcosts { get; set; }
        public virtual DbSet<AdmAskGood> AdmAskGoods { get; set; }
        public virtual DbSet<AdmGoodsRecord> AdmGoodsRecords { get; set; }
        public virtual DbSet<AdmAskJiaojie> AdmAskJiaojies { get; set; }
        public virtual DbSet<AdmAskJiaojieDtl> AdmAskJiaojieDtls { get; set; }
        public virtual DbSet<AdmAskLeave> AdmAskLeaves { get; set; }
@@ -418,6 +419,59 @@
                entity.Property(e => e.Tittle)
                    .HasMaxLength(50)
                    .HasColumnName("tittle");
            });
            modelBuilder.Entity<AdmGoodsRecord>(entity =>
            {
                entity.ToTable("adm_goods_record");
                entity.Property(e => e.Id).HasMaxLength(50);
                entity.Property(e => e.Creater)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("creater")
                    .HasDefaultValueSql("('1')");
                entity.Property(e => e.Createtime)
                    .HasColumnType("datetime")
                    .HasColumnName("createtime")
                    .HasDefaultValueSql("(getdate())");
                entity.Property(e => e.GoodsId)
                    .HasMaxLength(50)
                    .HasColumnName("goodsId");
                entity.Property(e => e.GoodsLeft)
                    .HasColumnType("numeric(18, 2)")
                    .HasColumnName("goods_left");
                entity.Property(e => e.GoodsNum)
                    .HasColumnType("numeric(18, 2)")
                    .HasColumnName("goods_num");
                entity.Property(e => e.Modifier)
                    .IsRequired()
                    .HasMaxLength(50)
                    .HasColumnName("modifier")
                    .HasDefaultValueSql("('1')");
                entity.Property(e => e.Modifytime)
                    .HasColumnType("datetime")
                    .HasColumnName("modifytime")
                    .HasDefaultValueSql("(getdate())");
                entity.Property(e => e.OperationalMatters).HasMaxLength(500);
                entity.Property(e => e.RecStatus)
                    .IsRequired()
                    .HasMaxLength(1)
                    .HasColumnName("rec_status")
                    .HasDefaultValueSql("('A')");
                entity.Property(e => e.RecordTypeId).HasMaxLength(50);
                entity.Property(e => e.Remark).HasMaxLength(500);
            });
            modelBuilder.Entity<AdmAskJiaojie>(entity =>
@@ -1780,6 +1834,10 @@
                    .HasColumnName("goods_name")
                    .HasComment("物品名称");
                entity.Property(e => e.ISBN)
                  .HasMaxLength(500)
                  .HasColumnName("ISBN");
                entity.Property(e => e.GoodsNum)
                    .HasColumnType("numeric(18, 2)")
                    .HasColumnName("goods_num")
zhengcaioa/Services/AdmGoodsManageService.cs
@@ -50,6 +50,8 @@
                    updateproject.ClassifyId = entity.ClassifyId;
                    updateproject.GoodsName = entity.GoodsName;
                    updateproject.ISBN = entity.ISBN;
                    if (entity.GoodsPrice.HasValue)
                    {
                        updateproject.GoodsPrice = entity.GoodsPrice;
@@ -171,7 +173,7 @@
                             GoodsStatus = a.GoodsStatus,
                             HaocaiStatus = a.HaocaiStatus,
                             GoodsName = a.GoodsName,
                             ISBN = a.ISBN,
zhengcaioa/Services/AdmGoodsRecordService.cs
New file
@@ -0,0 +1,207 @@
using AutoMapper;
using DTO;
using IServices;
using Microsoft.EntityFrameworkCore;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using zhengcaioa.Models;
namespace Services
{
    public class AdmGoodsRecordService: IAdmGoodsRecordService
    {
        private readonly zhengcaioaContext _context;
        private readonly IMapper _mapper;
        public AdmGoodsRecordService(zhengcaioaContext context, IMapper mapper)
        {
            _context = context;
            _mapper = mapper;
        }
        public ResultEntity save(AdmGoodsRecordDTO dto)
        {
            ResultEntity resultEntity = new ResultEntity();
            try
            {
                var AdmGoodsRecord = _mapper.Map<AdmGoodsRecord>(dto);
                if (String.IsNullOrEmpty(AdmGoodsRecord.Id))
                {
                    AdmGoodsRecord.Id = Guid.NewGuid().ToString();
                    dto.Id = AdmGoodsRecord.Id;
                    _context.AdmGoodsRecords.Add(AdmGoodsRecord);
                }
                else
                {
                    var updatepltRole = _context.AdmGoodsRecords.Find(AdmGoodsRecord.Id);
                    updatepltRole.GoodsId = AdmGoodsRecord.GoodsId;
                    updatepltRole.RecordTypeId = AdmGoodsRecord.RecordTypeId;
                    updatepltRole.GoodsNum = AdmGoodsRecord.GoodsNum;
                    updatepltRole.GoodsLeft = AdmGoodsRecord.GoodsLeft;
                    updatepltRole.OperationalMatters = AdmGoodsRecord.OperationalMatters;
                    updatepltRole.Remark = AdmGoodsRecord.Remark;
                    updatepltRole.RecStatus = AdmGoodsRecord.RecStatus;
                    // updatepltRole.Creater = pltRole.Creater;
                    //updatepltRole.Createtime = pltRole.Createtime;
                    updatepltRole.Modifier = AdmGoodsRecord.Modifier;
                    updatepltRole.Modifytime = AdmGoodsRecord.Modifytime;
                }
                _context.SaveChanges();
                resultEntity.ReturnID = AdmGoodsRecord.Id;
                resultEntity.Result = true;
            }
            catch (Exception ex)
            {
                resultEntity.Result = false;
                resultEntity.Message = "保存失败,请联系管理员";
            }
            return resultEntity;
        }
        public AdmGoodsRecordDTO Get(string id)
        {
            var entity = _context.AdmGoodsRecords.Find(id);
            if (entity.RecStatus != "A")
            {
                entity = new AdmGoodsRecord();
            }
            var AdmGoodsRecordDTO = _mapper.Map<AdmGoodsRecordDTO>(entity);
            return AdmGoodsRecordDTO;
        }
        public ResultDataEntity<AdmGoodsRecordDTO> SearchByPaging(AdmGoodsRecordDTOSearch searchEntity)
        {
            ResultDataEntity<AdmGoodsRecordDTO> data = new ResultDataEntity<AdmGoodsRecordDTO>();
            var listCode = (from a in _context.SysCodeDtls
                            join b in _context.SysCodes
                            on a.CodeId equals b.Id
                            where a.RecStatus == "A"
                                          && b.RecStatus == "A"
                            select new CodeDataEntity()
                            {
                                CodeId = b.Id,
                                CodeTable = b.CodeTable,
                                CodeField = b.CodeField,
                                CodeSn = a.CodeSn,
                                Comments = a.Comments,
                                Contents = a.Contents,
                                RecStatus = a.RecStatus,
                                Sort = a.Sort
                            }
                     );
            DateTime XdTimestart = DateTime.Now;
            DateTime XdTimeend = DateTime.Now;
            if (!string.IsNullOrWhiteSpace(searchEntity.Createtime))
            {
                string[] XdTimes = searchEntity.Createtime.Split("|");
                DateTime.TryParse(XdTimes[0], out XdTimestart);
                DateTime.TryParse(XdTimes[1], out XdTimeend);
                XdTimeend = XdTimeend.AddDays(1);
            }
            var query = (from a in _context.AdmGoodsRecords//.Where(x => x.RecStatus == "A")
                         join z in _context.AdmGoodsManages on a.GoodsId equals z.Id
                         join c in listCode.Where(x => x.CodeTable == "adm_goods_record" && x.CodeField == "RecordTypeId")
                        on a.RecordTypeId equals c.CodeSn
                         where a.RecStatus == "A"
                           && (string.IsNullOrWhiteSpace(searchEntity.Createtime) || (a.Createtime >= XdTimestart && a.Createtime <= XdTimeend))
                               && (string.IsNullOrWhiteSpace(searchEntity.OperationalMatters) || a.OperationalMatters.Contains(searchEntity.OperationalMatters.Trim()))
                                        && (string.IsNullOrWhiteSpace(searchEntity.RecordTypeId) || a.RecordTypeId == searchEntity.RecordTypeId.Trim())
                                             && (string.IsNullOrWhiteSpace(searchEntity.GoodsId) || a.GoodsId == searchEntity.GoodsId.Trim())
                         select new AdmGoodsRecordDTO
                         {
                             Id = a.Id,
                             RecordTypeId = a.RecordTypeId,
                             RecordTypeName = c.Comments,
                             GoodsId = a.GoodsId,
                             GoodsName = z.GoodsName,
                             OperationalMatters = a.OperationalMatters,
                             Remark = a.Remark,
                             CreatetimeName = a.Createtime.ToString("yyyy-MM-dd HH:mm:ss"),
                             Creater = a.Creater,
                             Createtime = a.Createtime,
                             Modifier = a.Modifier,
                             Modifytime = a.Modifytime,
                             RecStatus = a.RecStatus,
                             GoodsNum = a.GoodsNum ?? 0,
                             GoodsLeft = a.GoodsLeft ?? 0,
                         }).OrderByDescending(x => x.Createtime).ToList();
            //if (searchEntity.totalrows == 0)
            searchEntity.totalrows = query.Count();
            var rolelist = query.Skip((searchEntity.page - 1) * searchEntity.rows).Take(searchEntity.rows).ToList();
            data.LoadData(searchEntity, rolelist);
            return data;
        }
        public ResultEntity ModifyStatus(string id, string userid)
        {
            ResultEntity result = new ResultEntity();
            result.Result = true;
            var model = _context.AdmGoodsRecords.Find(id);
            if (model != null)
            {
                model.RecStatus = "D";
                model.Modifier = userid;
                model.Modifytime = DateTime.Now;
                _context.SaveChanges();
            }
            return result;
        }
        /// <summary>
        /// 获取所有有效角色
        /// </summary>
        /// <returns></returns>
        public List<AdmGoodsRecordDTO> GetList()
        {
            var listPosition = _context.AdmGoodsRecords.Where(r => r.RecStatus == "A").ToList();
            var list = _mapper.Map<List<AdmGoodsRecordDTO>>(listPosition);
            return list;
        }
    }
}
zhengcaioa/Services/DailyManagementService.cs
@@ -64,7 +64,7 @@
                          UserId = b.UserName,
                          Intention = a.Intention                          
                          
                      }).ToList();
                      }).OrderByDescending(x=>x.InTime).ToList();
            ResultDataEntity<AdmHoldPhoneDTO> data = new ResultDataEntity<AdmHoldPhoneDTO>();
            if (search.totalrows == 0)
                search.totalrows = dt.Count();
zhengcaioa/zhengcaioa/Controllers/BusinessOrder/CooperOrderController.cs
@@ -40,7 +40,10 @@
        private readonly IFiMemberService _fiMemberService;
        private readonly IConfiguration _configuration;
        private readonly IHttpClientFactory _clientFactory;
        private readonly IAskService _askService;
        private readonly IAskService _askService;
        private readonly IAdmGoodsRecordService _admGoodsRecordService;
        private readonly IAdmGoodsManageService _admGoodsManageService;
        public CooperOrderController(ILogger<CooperOrderController> logger, ILiaotianService liaotianService, IUserService userService, ICooperOrderService cooperOrderService
@@ -48,7 +51,10 @@
            , IFiServiceService fiServiceService, IFiMemberService fiMemberService
            , IConfiguration configuration
            , IHttpClientFactory clientFactory
            , IAskService askService)
            , IAskService askService
            , IAdmGoodsRecordService admGoodsRecordService
            , IAdmGoodsManageService admGoodsManageService
            )
        {
            _logger = logger;
            _liaotianService = liaotianService;
@@ -63,6 +69,8 @@
            _configuration = configuration;
            _clientFactory = clientFactory;
            _askService = askService;
            _admGoodsRecordService = admGoodsRecordService;
            _admGoodsManageService = admGoodsManageService;
        }
        [CheckLogin]
@@ -616,19 +624,82 @@
            ResultEntity resultEntity = new ResultEntity();
            resultEntity.Result = false;
            CooperOrderDTO dto = _cooperOrderService.Get(id);
            if(dto.ShouliStatus != "1")
            using (TransactionScope scope = new TransactionScope())
            {
                resultEntity.Result = false;
                resultEntity.Message = "只有已下单状态的订单才能受理";
                return new JsonResult(resultEntity);
                CooperOrderDTO dto = _cooperOrderService.Get(id);
                if (dto.ShouliStatus != "1")
                {
                    resultEntity.Result = false;
                    resultEntity.Message = "只有已下单状态的订单才能受理";
                    return new JsonResult(resultEntity);
                }
                if (dto.OrderType == "01")
                {
                    var shi = _fiBookService.Get(dto.OrderType1);
                    if (string.IsNullOrEmpty(shi.Id))
                    {
                        resultEntity.Result = false;
                        resultEntity.Message = "未找到该商品";
                        return new JsonResult(resultEntity);
                    }
                    var admGoodsManageDTOs = _admGoodsManageService.GetList().Where(x => x.ISBN == shi.BookNo).FirstOrDefault();
                    if (admGoodsManageDTOs == null)
                    {
                        resultEntity.Result = false;
                        resultEntity.Message = "没有找到该商品";
                        return new JsonResult(resultEntity);
                    }
                    else if (!admGoodsManageDTOs.GoodsLeft.HasValue)
                    {
                        resultEntity.Result = false;
                        resultEntity.Message = "该商品没有库存";
                        return new JsonResult(resultEntity);
                    }
                    else if (admGoodsManageDTOs.GoodsLeft.Value < dto.OrderNum)
                    {
                        resultEntity.Result = false;
                        resultEntity.Message = "该商品库存不足";
                        return new JsonResult(resultEntity);
                    }
                    var left = admGoodsManageDTOs.GoodsLeft - dto.OrderNum;
                    admGoodsManageDTOs.GoodsLeft = left;
                    resultEntity = _admGoodsManageService.save(admGoodsManageDTOs);
                    AdmGoodsRecordDTO dto1 = new AdmGoodsRecordDTO();
                    dto1.GoodsId = admGoodsManageDTOs.Id;
                    dto1.GoodsNum = dto.OrderNum;
                    dto1.GoodsLeft = admGoodsManageDTOs.GoodsLeft;
                    dto1.RecordTypeId = "02";
                    dto1.RecStatus = "A";
                    dto1.Creater = curentuser.Id;
                    dto1.Createtime = DateTime.Now;
                    dto1.Modifier = curentuser.Id;
                    dto1.Modifytime = DateTime.Now;
                    dto1.OperationalMatters = "订单:" + dto.OrderNo + " 购买书籍";
                    resultEntity = _admGoodsRecordService.save(dto1);
                }
                dto.Shoulier = curentuser.Id;
                dto.Shoulitime = DateTime.Now;
                dto.ShouliStatus = "2";
                resultEntity = _cooperOrderService.shouli(dto);
                scope.Complete();
            }
            dto.Shoulier = curentuser.Id;
            dto.Shoulitime = DateTime.Now;
            dto.ShouliStatus = "2";
              resultEntity = _cooperOrderService.shouli(dto);
            return new JsonResult(resultEntity);
        }
@@ -676,24 +747,69 @@
            ResultEntity resultEntity = new ResultEntity();
            resultEntity.Result = false;
            CooperOrderDTO dto = _cooperOrderService.Get(Chedanid);
            if (dto.ShouliStatus != "2")
            using (TransactionScope scope = new TransactionScope())
            {
                resultEntity.Result = false;
                resultEntity.Message = "只有受理状态的订单才能撤单";
                return new JsonResult(resultEntity);
                CooperOrderDTO dto = _cooperOrderService.Get(Chedanid);
                if (dto.ShouliStatus != "2")
                {
                    resultEntity.Result = false;
                    resultEntity.Message = "只有受理状态的订单才能撤单";
                    return new JsonResult(resultEntity);
                }
                if (dto.OrderType == "01")
                {
                    var shi = _fiBookService.Get(dto.OrderType1);
                    if (string.IsNullOrEmpty(shi.Id))
                    {
                        resultEntity.Result = false;
                        resultEntity.Message = "未找到该商品";
                        return new JsonResult(resultEntity);
                    }
                    var admGoodsManageDTOs = _admGoodsManageService.GetList().Where(x => x.ISBN == shi.BookNo).FirstOrDefault();
                    if (admGoodsManageDTOs == null)
                    {
                        resultEntity.Result = false;
                        resultEntity.Message = "没有找到该商品";
                        return new JsonResult(resultEntity);
                    }
                    var left = admGoodsManageDTOs.GoodsLeft + dto.OrderNum;
                    admGoodsManageDTOs.GoodsLeft = left;
                    resultEntity = _admGoodsManageService.save(admGoodsManageDTOs);
                    AdmGoodsRecordDTO dto1 = new AdmGoodsRecordDTO();
                    dto1.GoodsId = admGoodsManageDTOs.Id;
                    dto1.GoodsNum = dto.OrderNum;
                    dto1.GoodsLeft = admGoodsManageDTOs.GoodsLeft;
                    dto1.RecordTypeId = "01";
                    dto1.RecStatus = "A";
                    dto1.Creater = curentuser.Id;
                    dto1.Createtime = DateTime.Now;
                    dto1.Modifier = curentuser.Id;
                    dto1.Modifytime = DateTime.Now;
                    dto1.OperationalMatters = "订单:" + dto.OrderNo + " 撤单";
                    resultEntity = _admGoodsRecordService.save(dto1);
                }
                dto.Chedaner = curentuser.Id;
                dto.Chedantime = DateTime.Now;
                dto.ChedanStatus = "A";
                dto.Chedan = Price;
                dto.ShouliStatus = "0";
                resultEntity = _cooperOrderService.chedan(dto);
                scope.Complete();
            }
            dto.Chedaner = curentuser.Id;
            dto.Chedantime = DateTime.Now;
            dto.ChedanStatus = "A";
            dto.Chedan = Price;
            dto.ShouliStatus = "0";
            resultEntity = _cooperOrderService.chedan(dto);
            return new JsonResult(resultEntity);
        }
        [CheckLogin]
zhengcaioa/zhengcaioa/Controllers/admin/AdmAskController.cs
@@ -30,6 +30,7 @@
        private readonly ICooperatecustomCustomerService _cooperatecustomCustomerService;
        private readonly IIntentionCustomerService _intentionCustomerService;
        private readonly IHrPositionService _hrPositionService;
        private readonly IAdmGoodsRecordService _admGoodsRecordService;
        public AdmAskController(ILogger<AdmAskController> logger, IAskService askService, IHrDeptService hrDeptService, IWfRunProcessService wfRunProcessService
            , IWfHistoryService wfHistoryService, IWfNeeddeelService wfNeeddeelService
@@ -39,7 +40,8 @@
            , IAdmBreakPrecedentService aAdmBreakPrecedentService
            , ICooperatecustomCustomerService cooperatecustomCustomerService
            , IIntentionCustomerService intentionCustomerService
            , IHrPositionService hrPositionService)
            , IHrPositionService hrPositionService
            , IAdmGoodsRecordService admGoodsRecordService)
        {
            _logger = logger;
            _hrDeptService = hrDeptService;
@@ -54,6 +56,7 @@
            _cooperatecustomCustomerService = cooperatecustomCustomerService;
            _intentionCustomerService = intentionCustomerService;
            _hrPositionService = hrPositionService;
            _admGoodsRecordService = admGoodsRecordService;
        }
        public IActionResult Askcost(string id = "")
@@ -277,6 +280,19 @@
                        resultEntity.Message = "物品剩余数量不足";
                        return new JsonResult(resultEntity);
                    }
                    AdmGoodsRecordDTO dto = new AdmGoodsRecordDTO();
                    dto.GoodsId = admGoodsManageDTO.Id;
                    dto.GoodsNum = admAskGoodDTO.Shuliang.Value;
                    dto.GoodsLeft = admGoodsManageDTO.GoodsLeft;
                    dto.RecordTypeId = "02";
                    dto.RecStatus = "A";
                    dto.Creater = curentuser.Id;
                    dto.Createtime = DateTime.Now;
                    dto.Modifier = curentuser.Id;
                    dto.Modifytime = DateTime.Now;
                    dto.OperationalMatters = admAskGoodDTO.Tittle;
                    resultEntity = _admGoodsRecordService.save(dto);
                }
zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsManageController.cs
@@ -29,15 +29,18 @@
        private readonly IAdmGoodsManageService _admGoodsManageService;
        private readonly IAdmGoodsClassifyService _admGoodsClassifyService;
        private readonly IPltPageService _pltPageService;
        private readonly IAdmGoodsRecordService _admGoodsRecordService;
        public AdmGoodsManageController(ILogger<AdmGoodsManageController> logger, ILiaotianService liaotianService, IAdmGoodsManageService admGoodsManageService, IAdmGoodsClassifyService admGoodsClassifyService, IPltPageService pltPageService)
        public AdmGoodsManageController(ILogger<AdmGoodsManageController> logger, ILiaotianService liaotianService, IAdmGoodsManageService admGoodsManageService, IAdmGoodsClassifyService admGoodsClassifyService, IPltPageService pltPageService
            , IAdmGoodsRecordService admGoodsRecordService)
        {
            _logger = logger;
            _liaotianService = liaotianService;
            _admGoodsManageService = admGoodsManageService;
            _admGoodsClassifyService = admGoodsClassifyService;
            _pltPageService = pltPageService;
            _admGoodsRecordService = admGoodsRecordService;
        }
@@ -268,6 +271,19 @@
                }
                AdmGoodsRecordDTO dto = new AdmGoodsRecordDTO();
                dto.GoodsId = savedata.Id;
                dto.GoodsNum = data.GoodsCaozuo;
                dto.GoodsLeft = savedata.GoodsLeft;
                dto.RecordTypeId = "02";
                dto.RecStatus = "A";
                dto.Creater = curentuser.Id;
                dto.Createtime = DateTime.Now;
                dto.Modifier = curentuser.Id;
                dto.Modifytime = DateTime.Now;
                dto.OperationalMatters = curentuser.UserName + ":出库";
                resultEntity = _admGoodsRecordService.save(dto);
                data.Modifier = curentuser.Id;
@@ -339,6 +355,18 @@
                    savedata.GoodsLeft = data.GoodsCaozuo;
                }
                AdmGoodsRecordDTO dto = new AdmGoodsRecordDTO();
                dto.GoodsId = savedata.Id;
                dto.GoodsNum = data.GoodsCaozuo;
                dto.GoodsLeft = savedata.GoodsLeft;
                dto.RecordTypeId = "01";
                dto.RecStatus = "A";
                dto.Creater = curentuser.Id;
                dto.Createtime = DateTime.Now;
                dto.Modifier = curentuser.Id;
                dto.Modifytime = DateTime.Now;
                dto.OperationalMatters = curentuser.UserName+":入库";
                resultEntity = _admGoodsRecordService.save(dto);
@@ -366,5 +394,33 @@
            ViewData["curentuser"] = curentuser;
            return new JsonResult(_admGoodsManageService.ModifyStatus(Id, curentuser.Id));
        }
        public IActionResult Liushuizhang(string id)
        {
            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);
            ViewData["ActionInfo"] = actionlist;
            ViewBag.RecordTypeId = _liaotianService.GetSYScode("adm_goods_record", "RecordTypeId").Select(x => new { code = x.CodeSn, label = x.Comments }).ToList();
            ViewBag.id = id;
            return View();
        }
        public IActionResult GetListLiushuizhang(AdmGoodsRecordDTOSearch search)
        {
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
            return new JsonResult(_admGoodsRecordService.SearchByPaging(search));
        }
    }
}
zhengcaioa/zhengcaioa/Controllers/admin/AdmGoodsRecordController.cs
New file
@@ -0,0 +1,125 @@
using DTO;
using IServices;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Transactions;
using zhengcaioa.IService;
using zhengcaioa.Models;
namespace zhengcaioa.Controllers.admin
{
    public class AdmGoodsRecordController : Controller
    {
        private readonly ILogger<AdmGoodsRecordController> _logger;
        private readonly IAdmGoodsRecordService _admGoodsRecordService;
        private readonly ILiaotianService _liaotianService;
        private readonly IAdmGoodsManageService _admGoodsManageService;
        public AdmGoodsRecordController(ILogger<AdmGoodsRecordController> logger, IAdmGoodsRecordService admGoodsRecordService, ILiaotianService liaotianService
            , IAdmGoodsManageService admGoodsManageService)
        {
            _logger = logger;
            _liaotianService = liaotianService;
            _admGoodsRecordService = admGoodsRecordService;
            _admGoodsManageService = admGoodsManageService;
        }
        //出库接口
        public IActionResult BookChuKu([FromBody] AdmGoodsRecordDTO dto)
        {
            ReturnMsg<List<ProjectDTO>> returnMsg = new ReturnMsg<List<ProjectDTO>>();
            returnMsg.code = 2;
            if (string.IsNullOrEmpty(dto.ISBN))
            {
                    returnMsg.code = 2;
                    returnMsg.error = "没有ISBN";
                    returnMsg.count = 0;
                    return new JsonResult(returnMsg);
            }
            var admGoodsManageDTOs = _admGoodsManageService.GetList().Where(x=>x.ISBN == dto.ISBN).FirstOrDefault();
            if (admGoodsManageDTOs==null)
            {
                    returnMsg.code = 2;
                    returnMsg.error = "没有找到该商品";
                    returnMsg.count = 0;
                    return new JsonResult(returnMsg);
            }
            else if(!admGoodsManageDTOs.GoodsLeft.HasValue )
            {
                returnMsg.code = 2;
                returnMsg.error = "该商品没有库存";
                returnMsg.count = 0;
                return new JsonResult(returnMsg);
            }
            else if (admGoodsManageDTOs.GoodsLeft.Value< dto.GoodsNum)
            {
                returnMsg.code = 2;
                returnMsg.error = "该商品库存不足";
                returnMsg.count = 0;
                return new JsonResult(returnMsg);
            }
            try
            {
                using (TransactionScope scope = new TransactionScope())
                {
                    var left = admGoodsManageDTOs.GoodsLeft - dto.GoodsNum;
                    dto.GoodsId = admGoodsManageDTOs.Id;
                    dto.GoodsLeft = left;
                    dto.RecordTypeId = "02";
                    admGoodsManageDTOs.GoodsLeft = left;
                    var resultEntity = _admGoodsManageService.save(admGoodsManageDTOs);
                    dto.RecStatus = "A";
                    if (String.IsNullOrEmpty(dto.Id))
                    {
                        dto.Creater = "1";
                        dto.Createtime = DateTime.Now;
                    }
                    dto.Modifier = "1";
                    dto.Modifytime = DateTime.Now;
                    resultEntity = _admGoodsRecordService.save(dto);
                    returnMsg.code = 1;
                    returnMsg.count = 0;
                    returnMsg.returnObj = null;
                    scope.Complete();
                }
            }
            catch (Exception ex)
            {
                returnMsg.code = 2;
                returnMsg.error = "没有获取到token";
                returnMsg.count = 0;
            }
            return new JsonResult(returnMsg);
        }
    }
}
zhengcaioa/zhengcaioa/Controllers/admin/AdmTongxunluController.cs
@@ -86,7 +86,7 @@
        {
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
            search.Creater = curentuser.Id;
            //search.Creater = curentuser.Id;
            //JsonResult jsonResult =   new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
            return new JsonResult(_admTongxunluService.SearchByPaging(search));
        }
zhengcaioa/zhengcaioa/Controllers/admin/AdmZhanghaomimaController.cs
@@ -87,7 +87,7 @@
        {
            var curentuser = JsonConvert.DeserializeObject<PltUser>(HttpContext.Session.GetString("User"));
            ViewData["curentuser"] = curentuser;
            search.Creater = curentuser.Id;
            //search.Creater = curentuser.Id;
            //JsonResult jsonResult =   new JsonResult(_liaotianService.SearchByPaging(search), new Newtonsoft.Json.Serialization.DefaultContractResolver());
            return new JsonResult(_admZhanghaomimaService.SearchByPaging(search));
        }
zhengcaioa/zhengcaioa/Startup.cs
@@ -149,7 +149,8 @@
            services.AddScoped(typeof(IAdmZhanghaomimaService), typeof(AdmZhanghaomimaService));
            services.AddScoped(typeof(IAdmTongxunluService), typeof(AdmTongxunluService));
            services.AddScoped(typeof(IAskService), typeof(AskService));
            services.AddScoped(typeof(IAskService), typeof(AskService));
            services.AddScoped(typeof(IAdmGoodsRecordService), typeof(AdmGoodsRecordService));
            //zcweb
            services.AddScoped(typeof(IDtChannelArticleNewsService), typeof(DtChannelArticleNewsService)); 
zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Edit.cshtml
@@ -139,88 +139,92 @@
                                    <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">物品价格(元)<i class="red">*</i></label>
                                    <div class="col-sm-2 col-md-2" grouptype="Vdata">
                                        <input class="form-control" label="物品价格(元)" name="GoodsPrice" id="GoodsPrice" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.GoodsPrice" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                    </div>
                                    <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">物品数量<i class="red">*</i></label>
                                    <div class="col-sm-2 col-md-2" grouptype="Vdata">
                                        <input class="form-control" label="物品数量" name="GoodsNum" id="GoodsNum" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.GoodsNum" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                                    </div>
                                </div>*@
                            <div class="clearfix layer-area" style="padding-bottom:15px;">
                                @*@if (!string.IsNullOrWhiteSpace(Model.Id))
        {
            <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">剩余数量</label>
            <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">物品价格(元)<i class="red">*</i></label>
            <div class="col-sm-2 col-md-2" grouptype="Vdata">
                <input class="form-control" label="剩余数量" name="GoodsLeft" id="GoodsLeft" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.GoodsLeft" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                <input class="form-control" label="物品价格(元)" name="GoodsPrice" id="GoodsPrice" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.GoodsPrice" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
            </div>
        }*@
            <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">物品数量<i class="red">*</i></label>
            <div class="col-sm-2 col-md-2" grouptype="Vdata">
                <input class="form-control" label="物品数量" name="GoodsNum" id="GoodsNum" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.GoodsNum" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
            </div>
                                <label class="text-right col-sm-1 col-md-1 control-label">物品状态<i class="red">*</i></label>
                                <div class="col-sm-2 col-md-2">
                                    <select id="GoodsStatus" class="form-control" name="GoodsStatus" data-placeholder="选择 序列 ...">
                                        <option value="" hassubinfo="true">请选择</option>
                                        @foreach (var item in GoodsStatus)
                                        {
                                            @if (!item.CodeSn.Equals(Model.GoodsStatus))
        </div>*@
                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                    @*@if (!string.IsNullOrWhiteSpace(Model.Id))
            {
                <label grouptype="Vdata" class="text-right col-sm-1 col-md-1 control-label">剩余数量</label>
                <div class="col-sm-2 col-md-2" grouptype="Vdata">
                    <input class="form-control" label="剩余数量" name="GoodsLeft" id="GoodsLeft" labtype="txt" addvisible="true" editvisible="true" reg="" ismust="true" type="number" value="@Model.GoodsLeft" oninput="if(value.length>8)value=value.slice(0,18)" onkeyup="value=value.toString().match(/^\d+(?:\.\d{0,2})?/)">
                </div>
            }*@
                                    <label class="text-right col-sm-1 col-md-1 control-label">物品状态<i class="red">*</i></label>
                                    <div class="col-sm-2 col-md-2">
                                        <select id="GoodsStatus" class="form-control" name="GoodsStatus" data-placeholder="选择 序列 ...">
                                            <option value="" hassubinfo="true">请选择</option>
                                            @foreach (var item in GoodsStatus)
                                            {
                                                <option value="@item.CodeSn" hassubinfo="true">
                                                    @item.Comments
                                                </option>
                                            }
                                            else
                                            {
                                                <option value="@item.CodeSn" hassubinfo="true" selected="selected">
                                                    @item.Comments
                                                </option>
                                                @if (!item.CodeSn.Equals(Model.GoodsStatus))
                                                {
                                                    <option value="@item.CodeSn" hassubinfo="true">
                                                        @item.Comments
                                                    </option>
                                                }
                                                else
                                                {
                                                    <option value="@item.CodeSn" hassubinfo="true" selected="selected">
                                                        @item.Comments
                                                    </option>
                                                }
                                            }
                                        }
                                        </select>
                                    </div>
                                    </select>
                                    <label class="text-right col-sm-1 col-md-1 control-label">是否耗材<i class="red">*</i></label>
                                    <div class="col-sm-2 col-md-2">
                                        <select id="HaocaiStatus" class="form-control" name="HaocaiStatus" data-placeholder="选择 序列 ...">
                                            <option value="" hassubinfo="true">请选择</option>
                                            @foreach (var item in shifou)
                                            {
                                                @if (!item.CodeSn.Equals(Model.HaocaiStatus))
                                                {
                                                    <option value="@item.CodeSn" hassubinfo="true">
                                                        @item.Comments
                                                    </option>
                                                }
                                                else
                                                {
                                                    <option value="@item.CodeSn" hassubinfo="true" selected="selected">
                                                        @item.Comments
                                                    </option>
                                                }
                                            }
                                        </select>
                                    </div>
                                </div>
                                <label class="text-right col-sm-1 col-md-1 control-label">是否耗材<i class="red">*</i></label>
                                <div class="col-sm-2 col-md-2">
                                    <select id="HaocaiStatus" class="form-control" name="HaocaiStatus" data-placeholder="选择 序列 ...">
                                        <option value="" hassubinfo="true">请选择</option>
                                        @foreach (var item in shifou)
                                        {
                                            @if (!item.CodeSn.Equals(Model.HaocaiStatus))
                                            {
                                                <option value="@item.CodeSn" hassubinfo="true">
                                                    @item.Comments
                                                </option>
                                            }
                                            else
                                            {
                                                <option value="@item.CodeSn" hassubinfo="true" selected="selected">
                                                    @item.Comments
                                                </option>
                                            }
                                <div class="clearfix layer-area" style="padding-bottom:15px;">
                                        }
                                    <label class="text-right col-sm-1 col-md-1 control-label">ISBN</label>
                                    <div class="col-sm-2 col-md-2">
                                        <input id="ISBN" class="form-control" label="ISBN" name="ISBN" labtype="txt" addvisible="true" editvisible="true" maxlength="500" reg="" ismust="true" type="text" value="@Model.ISBN">
                                    </select>
                                    </div>
                                </div>
                            </div>
                            </div>
zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Index.cshtml
@@ -41,6 +41,12 @@
                    return "<a onclick=\"OpenWindow('出库','98%','100%', '/AdmGoodsManage/Chuku?id=" + rowObject.Id + "')\"  >出库</a>";
                }
            },
            {
                label: '出入库记录', name: 'Remark', labtype: 'txt', hidden: false,
                formatter: function (cellvalue, options, rowObject) {
                    return "<a onclick=\"OpenWindow('" + rowObject.GoodsName + "','98%','100%', '/AdmGoodsManage/Liushuizhang?id=" + rowObject.Id + "')\"  >出入库记录</a>";
                }
            },
        ];
        dataUrl = "/AdmGoodsManage/GetList";
        searchCol = [
zhengcaioa/zhengcaioa/Views/AdmGoodsManage/Liushuizhang.cshtml
New file
@@ -0,0 +1,69 @@
@{
    ViewBag.Title = "AdmGoodsManage";
    Layout = "~/Views/Shared/_Layout_Search.cshtml";
}
@section headerStyle{
    <script type="text/javascript">
        var RecordTypeId = '@Html.Raw(Newtonsoft.Json.JsonConvert.SerializeObject(ViewBag.RecordTypeId))';
        dataCol = [
            { label: 'id', name: 'Id', labtype: 'txt', hidden: true, width: 60},
            { label: '出入库', name: 'RecordTypeName', labtype: 'txt', hidden: false, width: 60 },
            { label: '物品', name: 'GoodsName', labtype: 'txt', hidden: false, width: 100 },
            { label: '数量', name: 'GoodsNum', labtype: 'txt', hidden: false, width: 60},
            { label: '剩余', name: 'GoodsLeft', labtype: 'txt', hidden: false, width: 60 },
            { label: '摘要', name: 'OperationalMatters', labtype: 'txt', hidden: false, width: 200},
            { label: '操作时间', name: 'CreatetimeName', labtype: 'txt', hidden: false, width: 100},
        ];
        dataUrl = "/AdmGoodsManage/GetListLiushuizhang?GoodsId=@ViewBag.id";
        searchCol = [
            { label: '操作时间', name: 'Createtime', labtype: 'datearea', hidden: false },
            { label: '出入库', name: 'RecordTypeId', labtype: 'combox', hidden: false, data: JSON.parse(RecordTypeId) },
            { label: '摘要', name: 'OperationalMatters', labtype: 'txt', hidden: false },
            //{ label: '收付款人', name: 'PaymentUnit', labtype: 'txt', hidden: false },
        ];
        var _afterSave = function (result) {
            if (result) {
                toastr.success("保存成功");
            } else {
                toastr.error("保存失败");
            }
        }
        var _afterDel = function (result) {
            if (result) {
                toastr.success("删除成功");
            } else {
                /**/
                toastr.error("删除成功");
        /**/
    }
}
    </script>
}
@section footerScripts{
    <script type="text/javascript">
    </script>
}
zhengcaioa/zhengcaioa/Views/AdmZhanghaomima/Index.cshtml
@@ -19,7 +19,7 @@
            {
                label: '产品项目', name: 'Chanpinxiangmu', labtype: 'txt', hidden: false, width: 100
            },
            { label: '账号', name: 'Zhanghao', labtype: 'txt', hidden: true, width: 100 },
            { label: '账号', name: 'Zhanghao', labtype: 'txt', hidden: false, width: 100 },
            { label: '密码', name: 'Mima', labtype: 'txt', hidden: false, width: 100 },
            { label: '密保', name: 'Mibao', labtype: 'txt', hidden: false, width: 100 },