提交代码
This commit is contained in:
parent
5d690e99b4
commit
6e7bff7cdf
|
@ -10,3 +10,12 @@ alter table PreRun_SubInspectTermItem add SubcontractorRemark varchar(1000) NULL
|
|||
alter table PreRun_SubInspectTermItem add ContractorRemark varchar(1000) NULL--承包商备注
|
||||
alter table PreRun_SubInspectTermItem add SupervisionRemark varchar(1000) NULL--监理备注
|
||||
alter table PreRun_SubInspectTermItem add OwnerRemark varchar(1000) NULL--业主备注
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--Åàѵ¼Ç¼Ôö¼Ó¶þάÂë
|
||||
alter table EduTrain_TrainRecord add QRCodeUrl nvarchar(2000) null
|
||||
GO
|
|
@ -616,5 +616,116 @@ namespace BLL
|
|||
}
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 扫码获取培训记录
|
||||
/// <summary>
|
||||
/// 培训记录主表实体类
|
||||
/// </summary>
|
||||
public class EduTrainRecord {
|
||||
public string TrainTitle { get; set; }
|
||||
public string UnitsName { get; set; }
|
||||
public string TrainType { get; set; }
|
||||
public string TrainStartDate { get; set; }
|
||||
public string TeachHour { get; set; }
|
||||
public string TrainContent { get; set; }
|
||||
public List<EduTrain_TrainRecordDetailDto> ChildList { get; set; }
|
||||
}
|
||||
public class EduTrain_TrainRecordDetailDto {
|
||||
public string PersonName { get; set; }
|
||||
public string IdCard { get; set; }
|
||||
public string CheckScore { get; set; }
|
||||
public string CheckResult { get; set; }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 扫码获取培训记录
|
||||
/// </summary>
|
||||
/// <param name="TrainingId"></param>
|
||||
/// <returns></returns>
|
||||
public static EduTrainRecord getTestRecordByTestRecordIdQrCode(string TrainingId)
|
||||
{
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = from x in db.EduTrain_TrainRecord
|
||||
where x.TrainingId == TrainingId
|
||||
select new EduTrainRecord
|
||||
{
|
||||
TrainTitle=x.TrainTitle,
|
||||
UnitsName= getUnitNameByUnitids(x.UnitIds),
|
||||
TrainType= getTrainTypeNameByTrainTypeId(x.TrainTypeId),
|
||||
TrainStartDate = string.Format("{0:yyyy-MM-dd}", x.TrainStartDate),
|
||||
TeachHour=x.TeachHour.ToString(),
|
||||
TrainContent=x.TrainContent,
|
||||
ChildList=getChildEduTrainChild(x.TrainingId)
|
||||
};
|
||||
return getDataLists.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 根据单位id获取单位名称
|
||||
/// </summary>
|
||||
/// <param name="unitId"></param>
|
||||
/// <returns></returns>
|
||||
private static string getUnitNameByUnitids(string unitId) {
|
||||
if (!string.IsNullOrEmpty(unitId))
|
||||
{
|
||||
string unitNames = string.Empty;
|
||||
string[] unitIds = unitId.Split(',');
|
||||
foreach (var item in unitIds)
|
||||
{
|
||||
Model.Base_Unit unit = BLL.UnitService.GetUnitByUnitId(item);
|
||||
if (unit != null)
|
||||
{
|
||||
unitNames += unit.UnitName + ",";
|
||||
}
|
||||
}
|
||||
if (!string.IsNullOrEmpty(unitNames))
|
||||
{
|
||||
unitNames = unitNames.Substring(0, unitNames.LastIndexOf(","));
|
||||
}
|
||||
return unitNames;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private static string getPerIdCardByPersonId(string personId) {
|
||||
var pmodel = Funs.DB.SitePerson_Person.FirstOrDefault(x => x.PersonId == personId);
|
||||
if (pmodel != null)
|
||||
{
|
||||
return pmodel.IdentityCard;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
private static string getTrainTypeNameByTrainTypeId(string TrainTypeId) {
|
||||
if (!string.IsNullOrEmpty(TrainTypeId))
|
||||
{
|
||||
return BLL.TrainTypeService.GetTrainTypeById(TrainTypeId).TrainTypeName;
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
private static List<EduTrain_TrainRecordDetailDto> getChildEduTrainChild(string TrainingId) {
|
||||
using (Model.SGGLDB db = new Model.SGGLDB(Funs.ConnString))
|
||||
{
|
||||
var getDataLists = from x in db.View_EduTrain_TrainRecordDetail
|
||||
where x.TrainingId == TrainingId
|
||||
select new EduTrain_TrainRecordDetailDto
|
||||
{
|
||||
PersonName=x.PersonName,
|
||||
IdCard= getPerIdCardByPersonId(x.PersonId),
|
||||
CheckScore=x.CheckScore.ToString(),
|
||||
CheckResult=x.CheckResult==true?"合格":"不合格"
|
||||
|
||||
};
|
||||
return getDataLists.ToList();
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -46,11 +46,12 @@
|
|||
<Toolbars>
|
||||
<f:Toolbar ID="Toolbar2" Position="Top" runat="server" ToolbarAlign="Left">
|
||||
<Items>
|
||||
<f:RadioButtonList runat="server" ID="rbStates" Width="280px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged">
|
||||
<f:RadioButtonList runat="server" ID="rbStates" Width="320px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged">
|
||||
<f:RadioItem Text="全部" Value="-1" Selected="true" />
|
||||
<f:RadioItem Text="待提交" Value="0" />
|
||||
<f:RadioItem Text="待整改" Value="1" />
|
||||
<f:RadioItem Text="已完成" Value="2" />
|
||||
<f:RadioItem Text="待确认" Value="2" />
|
||||
<f:RadioItem Text="已确认" Value="3" />
|
||||
</f:RadioButtonList>
|
||||
<f:ToolbarSeparator runat="server"></f:ToolbarSeparator>
|
||||
<f:RadioButtonList runat="server" ID="rbType" Width="180px" AutoPostBack="true" OnSelectedIndexChanged="rbStates_SelectedIndexChanged">
|
||||
|
@ -153,11 +154,11 @@
|
|||
}
|
||||
|
||||
function onGridDataLoad(event) {
|
||||
this.mergeColumns(['CheckSpecialCode', 'CheckCount','CheckTime'], { depends: true });
|
||||
// this.mergeColumns(['CheckCount']);
|
||||
// this.mergeColumns(['CheckPersonName']);
|
||||
// this.mergeColumns(['CheckTime']);
|
||||
// this.mergeColumns(['FlowOperateName']);
|
||||
this.mergeColumns(['CheckSpecialCode', 'CheckCount', 'CheckTime'], { depends: true });
|
||||
// this.mergeColumns(['CheckCount']);
|
||||
// this.mergeColumns(['CheckPersonName']);
|
||||
// this.mergeColumns(['CheckTime']);
|
||||
// this.mergeColumns(['FlowOperateName']);
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
|
|
@ -60,7 +60,7 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
{
|
||||
string strSql = @"SELECT CheckSpecial.CheckSpecialId,CodeRecords.Code AS CheckSpecialCode,"
|
||||
+ @" CheckItemSet.CheckItemName,CheckSpecial.CheckTime,(CASE WHEN CheckSpecial.CheckType ='1' THEN '联合检查' ELSE '专项检查' END) AS CheckTypeName"
|
||||
+ @" ,(CASE WHEN CheckSpecial.States='2' THEN '已完成' WHEN CheckSpecial.States='1' THEN '待整改' ELSE '待提交' END) AS StatesName"
|
||||
+ @" ,(CASE WHEN CheckSpecial.States='2' THEN '待确认' WHEN CheckSpecial.States='3' THEN '已确认' WHEN CheckSpecial.States='1' THEN '待整改' ELSE '待提交' END) AS StatesName"
|
||||
+ @" FROM Check_CheckSpecial AS CheckSpecial "
|
||||
+ @" LEFT JOIN Sys_CodeRecords AS CodeRecords ON CheckSpecial.CheckSpecialId=CodeRecords.DataId "
|
||||
+ @" LEFT JOIN Technique_CheckItemSet AS CheckItemSet ON CheckItemSet.CheckItemSetId = CheckSpecial.CheckItemSetId where 1=1";
|
||||
|
@ -68,7 +68,7 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
strSql += " AND CheckSpecial.ProjectId = @ProjectId";
|
||||
listStr.Add(new SqlParameter("@ProjectId", this.ProjectId));
|
||||
|
||||
if (this.rbStates.SelectedValue!="-1")
|
||||
if (this.rbStates.SelectedValue != "-1")
|
||||
{
|
||||
strSql += " AND CheckSpecial.States = @States";
|
||||
listStr.Add(new SqlParameter("@States", this.rbStates.SelectedValue));
|
||||
|
@ -86,10 +86,10 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
listStr.Add(new SqlParameter("@CheckType", this.rbType.SelectedValue));
|
||||
}
|
||||
}
|
||||
if (this.drpSupCheckItemSet.SelectedValue!=BLL.Const._Null)
|
||||
if (this.drpSupCheckItemSet.SelectedValue != BLL.Const._Null)
|
||||
{
|
||||
strSql += " AND CheckSpecial.CheckItemSetId = @CheckItemSetId";
|
||||
listStr.Add(new SqlParameter("@CheckItemSetId", this.drpSupCheckItemSet.SelectedValue ));
|
||||
listStr.Add(new SqlParameter("@CheckItemSetId", this.drpSupCheckItemSet.SelectedValue));
|
||||
}
|
||||
if (!string.IsNullOrEmpty(this.txtStartTime.Text.Trim()))
|
||||
{
|
||||
|
@ -361,7 +361,8 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
uploadfilepath = rootPath + initTemplatePath;
|
||||
newUrl = uploadfilepath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".doc");
|
||||
//filePath = initTemplatePath.Replace(".doc", string.Format("{0:yyyy-MM}", DateTime.Now) + ".pdf");
|
||||
if (File.Exists(newUrl)) {
|
||||
if (File.Exists(newUrl))
|
||||
{
|
||||
File.Delete(newUrl);
|
||||
}
|
||||
File.Copy(uploadfilepath, newUrl);
|
||||
|
@ -398,7 +399,8 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
{
|
||||
if (checkSpecial != null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(checkSpecial.CheckItemSetId)) {
|
||||
if (!string.IsNullOrEmpty(checkSpecial.CheckItemSetId))
|
||||
{
|
||||
bookmarkSupCheckItemSet.Text = Technique_CheckItemSetService.GetCheckItemSetNameById(checkSpecial.CheckItemSetId);
|
||||
}
|
||||
|
||||
|
@ -410,7 +412,8 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
{
|
||||
if (checkSpecial != null)
|
||||
{
|
||||
if (checkSpecial.CheckTime.HasValue) {
|
||||
if (checkSpecial.CheckTime.HasValue)
|
||||
{
|
||||
bookmarkCheckDate.Text = string.Format("{0:yyyy-MM-dd}", checkSpecial.CheckTime);
|
||||
}
|
||||
|
||||
|
@ -598,7 +601,7 @@ namespace FineUIPro.Web.HSSE.Check
|
|||
builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;//水平居中对齐
|
||||
builder.CellFormat.Width = 250;
|
||||
builder.CellFormat.WrapText = true;
|
||||
builder.Write(string.IsNullOrEmpty(detail.CheckItemSetContent)?"": detail.CheckItemSetContent);
|
||||
builder.Write(string.IsNullOrEmpty(detail.CheckItemSetContent) ? "" : detail.CheckItemSetContent);
|
||||
|
||||
////处理结果
|
||||
//builder.InsertCell();
|
||||
|
|
|
@ -7,10 +7,12 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.Check {
|
||||
namespace FineUIPro.Web.HSSE.Check
|
||||
{
|
||||
|
||||
|
||||
public partial class CheckSpecial {
|
||||
public partial class CheckSpecial
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
runat="server" Text="查看" Icon="Find">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnQR" OnClick="btnQR_Click" EnablePostBack="true"
|
||||
runat="server" Text="二维码" Icon="Shading">
|
||||
runat="server" Text="二维码" Hidden="true" Icon="Shading">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuDelete" OnClick="btnMenuDelete_Click" EnablePostBack="true"
|
||||
Icon="Delete" ConfirmText="删除选中行?" ConfirmTarget="Parent" runat="server" Text="删除"
|
||||
|
|
|
@ -134,6 +134,9 @@
|
|||
<f:Menu ID="Menu1" runat="server">
|
||||
<f:MenuButton ID="btnMenuView" OnClick="btnMenuView_Click" Icon="Find" EnablePostBack="true"
|
||||
runat="server" Text="查看">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnQR" OnClick="btnQR_Click" EnablePostBack="true"
|
||||
runat="server" Text="二维码" Icon="Shading">
|
||||
</f:MenuButton>
|
||||
<f:MenuButton ID="btnMenuEdit" OnClick="btnMenuEdit_Click" EnablePostBack="true"
|
||||
runat="server" Icon="Pencil" Hidden="true" Text="编辑">
|
||||
|
|
|
@ -661,5 +661,21 @@ namespace FineUIPro.Web.HSSE.EduTrain
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查看二维码
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
protected void btnQR_Click(object sender, EventArgs e)
|
||||
{
|
||||
if (Grid1.SelectedRowIndexArray.Length == 0)
|
||||
{
|
||||
Alert.ShowInTop("请选择一条记录!", MessageBoxIcon.Warning);
|
||||
return;
|
||||
}
|
||||
|
||||
PageContext.RegisterStartupScript(Window1.GetShowReference(String.Format("~/Controls/SeeQRImage.aspx?TrainingId={0}&strCode={1}", Grid1.SelectedRowID, "trainRecord$" + Grid1.SelectedRowID), "二维码查看", 400, 400));
|
||||
}
|
||||
}
|
||||
}
|
|
@ -7,10 +7,12 @@
|
|||
// </自动生成>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace FineUIPro.Web.HSSE.EduTrain {
|
||||
namespace FineUIPro.Web.HSSE.EduTrain
|
||||
{
|
||||
|
||||
|
||||
public partial class TrainRecord {
|
||||
public partial class TrainRecord
|
||||
{
|
||||
|
||||
/// <summary>
|
||||
/// form1 控件。
|
||||
|
@ -246,6 +248,15 @@ namespace FineUIPro.Web.HSSE.EduTrain {
|
|||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnMenuView;
|
||||
|
||||
/// <summary>
|
||||
/// btnQR 控件。
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// 自动生成的字段。
|
||||
/// 若要进行修改,请将字段声明从设计器文件移到代码隐藏文件。
|
||||
/// </remarks>
|
||||
protected global::FineUIPro.MenuButton btnQR;
|
||||
|
||||
/// <summary>
|
||||
/// btnMenuEdit 控件。
|
||||
/// </summary>
|
||||
|
|
|
@ -128299,6 +128299,8 @@ namespace Model
|
|||
|
||||
private string _UnitWorkIds;
|
||||
|
||||
private string _QRCodeUrl;
|
||||
|
||||
private EntitySet<EduTrain_TrainRecordDetail> _EduTrain_TrainRecordDetail;
|
||||
|
||||
private EntityRef<Base_Project> _Base_Project;
|
||||
|
@ -128359,6 +128361,8 @@ namespace Model
|
|||
partial void OnCNProfessionalIdChanged();
|
||||
partial void OnUnitWorkIdsChanging(string value);
|
||||
partial void OnUnitWorkIdsChanged();
|
||||
partial void OnQRCodeUrlChanging(string value);
|
||||
partial void OnQRCodeUrlChanged();
|
||||
#endregion
|
||||
|
||||
public EduTrain_TrainRecord()
|
||||
|
@ -128843,6 +128847,26 @@ namespace Model
|
|||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.ColumnAttribute(Storage="_QRCodeUrl", DbType="NVarChar(2000)")]
|
||||
public string QRCodeUrl
|
||||
{
|
||||
get
|
||||
{
|
||||
return this._QRCodeUrl;
|
||||
}
|
||||
set
|
||||
{
|
||||
if ((this._QRCodeUrl != value))
|
||||
{
|
||||
this.OnQRCodeUrlChanging(value);
|
||||
this.SendPropertyChanging();
|
||||
this._QRCodeUrl = value;
|
||||
this.SendPropertyChanged("QRCodeUrl");
|
||||
this.OnQRCodeUrlChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Data.Linq.Mapping.AssociationAttribute(Name="FK_EduTrain_TrainDetail_EduTrain_Training", Storage="_EduTrain_TrainRecordDetail", ThisKey="TrainingId", OtherKey="TrainingId", DeleteRule="NO ACTION")]
|
||||
public EntitySet<EduTrain_TrainRecordDetail> EduTrain_TrainRecordDetail
|
||||
{
|
||||
|
|
|
@ -401,5 +401,27 @@ namespace WebAPI.Controllers
|
|||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region 扫码获取培训记录详情
|
||||
/// <summary>
|
||||
/// 扫码获取培训记录详情
|
||||
/// </summary>
|
||||
/// <param name="TrainingId"></param>
|
||||
/// <returns></returns>
|
||||
public Model.ResponeData getTestRecordByTestRecordIdQrCode(string TrainingId)
|
||||
{
|
||||
var responeData = new Model.ResponeData();
|
||||
try
|
||||
{
|
||||
responeData.data = APITestRecordService.getTestRecordByTestRecordIdQrCode(TrainingId);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
responeData.code = 0;
|
||||
responeData.message = ex.Message;
|
||||
}
|
||||
return responeData;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue