| | |
| | | #endregion |
| | | |
| | | #region[模具清单新增编辑] |
| | | public static ToMessage AddUpdateMouldManger(string mouldcode, string mouldname, string mouldspec, string surplife, string resilife, string status, string mouldpart, string opertype, User us) |
| | | public static ToMessage AddUpdateMouldManger(string mouldcode, string mouldname, string mouldspec,string warehousecode,string location_code, string surplife, string resilife, string status, string mouldpart, string opertype, User us) |
| | | { |
| | | var sql = ""; |
| | | var dynamicParams = new DynamicParameters(); |
| | |
| | | if (opertype == "Add") |
| | | { |
| | | //写入模具清单表 |
| | | sql = @"insert into TMouldInfo(code,name,spec,status,surp_life,resi_life,lm_user,lm_date) |
| | | values(@code,@name,@spec,@status,@surp_life,@resi_life,@lm_user,@lm_date)"; |
| | | sql = @"insert into TMouldInfo(code,name,spec,status,surp_life,resi_life,lm_user,lm_date,warehousecode,location_code) |
| | | values(@code,@name,@spec,@status,@surp_life,@resi_life,@lm_user,@lm_date,@warehousecode,@location_code)"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | status = status, |
| | | surp_life = surplife, |
| | | resi_life = resilife, |
| | | warehousecode=warehousecode, |
| | | location_code=location_code, |
| | | lm_user = us.usercode, |
| | | lm_date = DateTime.Now.ToString() |
| | | } |
| | |
| | | { |
| | | //修改模具清单表 |
| | | sql = @"update TMouldInfo set name=@name,spec=@spec,status=@status, |
| | | surp_life=@surp_life,resi_life=@resi_life,lm_user=@lm_user,lm_date=@lm_date where code=@code"; |
| | | surp_life=@surp_life,resi_life=@resi_life,lm_user=@lm_user,lm_date=@lm_date,warehousecode=@warehousecode,location_code=@location_code where code=@code"; |
| | | list.Add(new |
| | | { |
| | | str = sql, |
| | |
| | | status = status, |
| | | surp_life = surplife, |
| | | resi_life = resilife, |
| | | warehousecode = warehousecode, |
| | | location_code = location_code, |
| | | lm_user = us.usercode, |
| | | lm_date = DateTime.Now.ToString() |
| | | } |
| | |
| | | string search = ""; |
| | | try |
| | | { |
| | | dynamicParams.Add("@mouldcode", mouldcode); |
| | | if (opendate != "" && opendate != null) |
| | | { |
| | | search += "and AA.operdate between @opendate and @closedate "; |
| | |
| | | } |
| | | // --------------查询指定数据-------------- |
| | | var total = 0; //总条数 |
| | | var sql = @"select * from ( |
| | | var sql = @"select top 100 percent AA.*,U.username as operusername from ( |
| | | select '点检' as opertype,chk_user as operuser,chk_date as operdate,chk_result as operresult |
| | | from TMouldchk_Proc_Main where mould_code='001' |
| | | from TMouldchk_Proc_Main where mould_code=@mouldcode |
| | | union all |
| | | select '保养' as opertype,maint_user as operuser,maint_date as operdate,maint_result as operresult |
| | | from TMouldmaint_Proc_Main where mould_code='001' |
| | | from TMouldmaint_Proc_Main where mould_code=@mouldcode |
| | | union all |
| | | select '待维修' as opertype,request_person as operuser,request_date as operdate,'维修申请' as operresult |
| | | from TMould_RepairRequest where mould_code='001' |
| | | from TMould_RepairRequest where mould_code=@mouldcode |
| | | union all |
| | | select '已维修' as opertype,repair_person as operuser,repair_date as operdate,'维修完成' as operresult |
| | | from TMould_RepairRequest A |
| | | inner join TMould_Repair B on A.docu_code=B.source_wo |
| | | where A.mould_code='001' and B.repair_person<>'' |
| | | where A.mould_code=@mouldcode and B.repair_person<>'' |
| | | union all |
| | | select '已验证' as opertype,verify_person as operuser,verify_date as operdate,B.verify_result as operresult |
| | | from TMould_RepairRequest A |
| | | inner join TMould_Repair B on A.docu_code=B.source_wo |
| | | where A.mould_code='001' and B.verify_person<>'' |
| | | where A.mould_code=@mouldcode and B.verify_person<>'' |
| | | union all |
| | | select '已上机' as opertype,lm_user as operuser,lm_date as operdate,eqp_code as operresult |
| | | from TMould_UpDownReord where mould_code='001' and type='UP' |
| | | from TMould_UpDownReord where mould_code=@mouldcode and type='UP' |
| | | union all |
| | | select '已下机' as opertype,lm_user as operuser,lm_date as operdate,eqp_code as operresult |
| | | from TMould_UpDownReord where mould_code='001' and type='DOWN' |
| | | from TMould_UpDownReord where mould_code=@mouldcode and type='DOWN' |
| | | union all |
| | | select '已入库' as opertype,lm_user as operuser,lm_date as operdate,warehouse_code as operresult |
| | | from TMould_InOutReord where mould_code='001' and type='IN' |
| | | from TMould_InOutReord where mould_code=@mouldcode and type='IN' |
| | | union all |
| | | select '已出库' as opertype,lm_user as operuser,lm_date as operdate,warehouse_code as operresult |
| | | from TMould_InOutReord where mould_code='001' and type='OUT' |
| | | from TMould_InOutReord where mould_code=@mouldcode and type='OUT' |
| | | union all |
| | | select '已外借' as opertype,lm_user as operuser,lm_date as operdate,description as operresult |
| | | from TMould_LendOutReord where mould_code='001' and type='OUT' |
| | | from TMould_LendOutReord where mould_code=@mouldcode and type='OUT' |
| | | union all |
| | | select '已归还' as opertype,lm_user as operuser,lm_date as operdate,description as operresult |
| | | from TMould_LendOutReord where mould_code='001' and type='IN' |
| | | ) as AA where 1=1 "+search+" order by AA.operdate desc "; |
| | | from TMould_LendOutReord where mould_code=@mouldcode and type='IN' |
| | | ) as AA |
| | | left join TUser U on AA.operuser=U.usercode |
| | | where 1=1 " + search+" order by AA.operdate desc "; |
| | | var data = DapperHelper.GetPageList<object>(sql, dynamicParams, prop, order, startNum, endNum, out total); |
| | | mes.code = "200"; |
| | | mes.message = "查询成功!"; |