tijian_tieying/web/dccdc.BLL/Collection.cs
2025-02-20 12:14:39 +08:00

68 lines
2.7 KiB
C#
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace dccdc.BLL
{
/// <summary>
/// 体检信息采集业务层代码
/// </summary>
public class Collection
{
public object getCollection(string num, string lx, Models.ERPUser erpUser,int jgid)
{
var djdal = new DAL.ProfessionalExamRegisterDal();
if (!djdal.isExist(num,jgid))
{
return new { State = 0, Message = "没有查到编号为:" + num + "的体检人员!" };
}
Models.ProfessionalExamRegisterModel regmodel = djdal.getModel(num,jgid);
if (regmodel != null)
{
regmodel.phone_path = ZWL.Common.ImgUtil.DocumentToBase64Str(regmodel.phone_path);
}
if (regmodel == null)
{
return new { State = 0, Message = "没有查到编号为:" + num + "的体检人员!" };
}
if (regmodel.payment == "未缴费")
{
return new { State = 0, Message = "编号为:" + num + "的体检人员未缴费!" };
}
if (regmodel.freezing_and_thawing == "冻结")
{
return new { State = 0, Message = "编号为:" + num + "的体检人员已冻结!" };
}
var processDal = new DAL.examination_processDal();
var proModel = processDal.getMode(num, lx);
if (processDal == null)
{
return new { State = 0, Message = "编号为:" + num + "的体检人员已不需要" + lx + "" };
}
if(proModel==null)
{
return new { State = 0, Message = "编号为:" + num + "的体检人员没有需要采集的数据!" };
}
if (proModel.is_complete!=null&&proModel.is_complete == "已完成")
{
return new { State = 0, Message = "编号为:" + num + "的体检人员请勿重复采集!" };
}
proModel.is_complete = "已完成";
proModel.complete_date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");
proModel.collect_doctor = erpUser.TrueName;
if (!processDal.updateCollection(proModel))
{
return new { State = 0, Message = "编号为:" + num + "的体检人员采集失败,请联系管理员!" };
}
var Rows = new DAL.professionalExam_project_resultDal().getResultCaiJi(int.Parse(regmodel.id));
return new { State = 1, Message = "采集成功!", regmodel = regmodel,Rows=Rows };
}
}
}