diff --git a/Ewide.NbzsZheliban/Entity/Extends/H5IndexPrjModel.cs b/Ewide.NbzsZheliban/Entity/Extends/H5IndexPrjModel.cs index 8fa420e..f9800d4 100644 --- a/Ewide.NbzsZheliban/Entity/Extends/H5IndexPrjModel.cs +++ b/Ewide.NbzsZheliban/Entity/Extends/H5IndexPrjModel.cs @@ -57,6 +57,7 @@ namespace Ewide.NbzsZheliban.Entity.Extends /// 区域 /// public string Area { get; set; } + public string Name { get; set; } [Newtonsoft.Json.JsonIgnore] public string AreaID { get; set; } /// diff --git a/Ewide.NbzsZheliban/Service/DataService.cs b/Ewide.NbzsZheliban/Service/DataService.cs index 4eae559..0cd2c4c 100644 --- a/Ewide.NbzsZheliban/Service/DataService.cs +++ b/Ewide.NbzsZheliban/Service/DataService.cs @@ -113,7 +113,7 @@ namespace Ewide.NbzsZheliban.Service //调查表集合 var list_dcbs = list_zz_dcb.Concat(list_fzz_dcb); //项目列表 - var list_projects = await db.Ado.SqlQueryAsync("select a.ID Prjid,a.area,a.AreaID,a.HouseAcquisitionDepartment as zsbm,a.CollectDecisionNo1 as year,(isnull(a.CollectDecisionNoHeadName,'')+'['+cast(a.CollectDecisionNo1 as varchar)+']'+ isnull(cast(a.CollectDecisionNo2 as varchar),'')+'号') zsjdh,dbo.get_current_state(a.ID) CurrentState from Projects a where ID in ('" + string.Join("','", list_dcbs.Select(p => p.PrjId)) + "') "); + var list_projects = await db.Ado.SqlQueryAsync("select a.ID Prjid,a.area,a.AreaID,a.HouseAcquisitionDepartment as zsbm,a.CollectDecisionNo1 as year,(isnull(a.CollectDecisionNoHeadName,'')+'['+cast(a.CollectDecisionNo1 as varchar)+']'+ isnull(cast(a.CollectDecisionNo2 as varchar),'')+'号') zsjdh,dbo.get_current_state(a.ID) CurrentState,NAME from Projects a where ID in ('" + string.Join("','", list_dcbs.Select(p => p.PrjId)) + "') "); //分户评估 var InvestigateTableID_param = "'" + string.Join("','", list_dcbs.Select(p => p.dcbId)) + "'"; var list_fhpgs = await db.Ado.SqlQueryAsync("select d.id,e.ProjectId as PrjId ,d.AssessmentNo,e.HouseAddress,d.countValue,e.id dcbId,d.CreateTime,d.CreateUserName from InvestigateTable_Assessment d inner join InvestigateTable e on d.InvestigateTableId=e.ID where d.InvestigateTableID in ( " + InvestigateTableID_param + " ) union all select d.id,e.ProjectId as PrjId ,AssessmentNo, e.HouseAddress, d.countValue,e.id dcbId,d.CreateTime,d.CreateUserName from NonInvestigateTable_Assessment d inner join NonResidentialInvestigateTable e on d.NonInvestigateTableID = e.ID where d.NonInvestigateTableID in ( " + InvestigateTableID_param + " ) ;"); @@ -198,7 +198,6 @@ namespace Ewide.NbzsZheliban.Service }).FirstAsync(); return entity; } - /// /// 协议详细 /// @@ -206,7 +205,7 @@ namespace Ewide.NbzsZheliban.Service /// [HttpPost("/agreement/info")] [Microsoft.AspNetCore.Authorization.AllowAnonymous] - public IActionResult AgreementInfo([FromBody] JObject args) + public async Task AgreementInfo([FromBody] JObject args) { var ticket = args.GetJsonValue("ticket", isThrowExp: true); var id = args.GetJsonGuidValue("id", isThrowExp: true); @@ -231,9 +230,44 @@ namespace Ewide.NbzsZheliban.Service } if (string.IsNullOrEmpty(XyFile)) throw Oops.Oh("未上传附件"); - var filePath = App.Configuration["nbzs_file_path"] + XyFile; - return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = new FileInfo(filePath).Name }; + var filePath = App.Configuration["nbzs_domain"] + XyFile; + return filePath; } + ///// + ///// 协议详细 + ///// + ///// + ///// + //[HttpPost("/agreement/info")] + //[Microsoft.AspNetCore.Authorization.AllowAnonymous] + //public IActionResult AgreementInfo([FromBody] JObject args) + //{ + // var ticket = args.GetJsonValue("ticket", isThrowExp: true); + // var id = args.GetJsonGuidValue("id", isThrowExp: true); + // JObject userInfoObj = GetInfoByTicket(ticket); + // var XyFile = ""; + // //住宅 + // var entity_zz = db.Queryable().Where(p => p.ID == id).Select(p => new { p.ID, p.XyFile }).First(); + // if (entity_zz != null) + // { + // XyFile = entity_zz.XyFile; + // } + // //非住宅 + // else + // { + // var entity_fzz = db.Queryable().Where(p => p.ID == id).Select(p => new { p.ID, p.XyFile }).First(); + // if (entity_fzz != null) + // { + // XyFile = entity_fzz.XyFile; + // } + // else + // throw Oops.Oh("ID错误"); + // } + // if (string.IsNullOrEmpty(XyFile)) + // throw Oops.Oh("未上传附件"); + // var filePath = App.Configuration["nbzs_file_path"] + XyFile; + // return new FileStreamResult(new FileStream(filePath, FileMode.Open), "application/octet-stream") { FileDownloadName = new FileInfo(filePath).Name }; + //} /// /// 分布评估详细 /// diff --git a/Ewide.NbzsZheliban/bin/Debug/net5.0/Ewide.NbzsZheliban.dll b/Ewide.NbzsZheliban/bin/Debug/net5.0/Ewide.NbzsZheliban.dll index a153e27..1985898 100644 Binary files a/Ewide.NbzsZheliban/bin/Debug/net5.0/Ewide.NbzsZheliban.dll and b/Ewide.NbzsZheliban/bin/Debug/net5.0/Ewide.NbzsZheliban.dll differ diff --git a/Ewide.NbzsZheliban/bin/Debug/net5.0/Ewide.NbzsZheliban.pdb b/Ewide.NbzsZheliban/bin/Debug/net5.0/Ewide.NbzsZheliban.pdb index f30c14e..31f5a67 100644 Binary files a/Ewide.NbzsZheliban/bin/Debug/net5.0/Ewide.NbzsZheliban.pdb and b/Ewide.NbzsZheliban/bin/Debug/net5.0/Ewide.NbzsZheliban.pdb differ diff --git a/Ewide.NbzsZheliban/bin/Debug/net5.0/ref/Ewide.NbzsZheliban.dll b/Ewide.NbzsZheliban/bin/Debug/net5.0/ref/Ewide.NbzsZheliban.dll index 0ca52f1..aa6215c 100644 Binary files a/Ewide.NbzsZheliban/bin/Debug/net5.0/ref/Ewide.NbzsZheliban.dll and b/Ewide.NbzsZheliban/bin/Debug/net5.0/ref/Ewide.NbzsZheliban.dll differ diff --git a/Ewide.NbzsZheliban/bin/Release/net5.0/Ewide.NbzsZheliban.dll b/Ewide.NbzsZheliban/bin/Release/net5.0/Ewide.NbzsZheliban.dll index f4a9c5f..8772497 100644 Binary files a/Ewide.NbzsZheliban/bin/Release/net5.0/Ewide.NbzsZheliban.dll and b/Ewide.NbzsZheliban/bin/Release/net5.0/Ewide.NbzsZheliban.dll differ diff --git a/Ewide.NbzsZheliban/bin/Release/net5.0/Ewide.NbzsZheliban.pdb b/Ewide.NbzsZheliban/bin/Release/net5.0/Ewide.NbzsZheliban.pdb index edd1542..e2a26a0 100644 Binary files a/Ewide.NbzsZheliban/bin/Release/net5.0/Ewide.NbzsZheliban.pdb and b/Ewide.NbzsZheliban/bin/Release/net5.0/Ewide.NbzsZheliban.pdb differ diff --git a/Ewide.NbzsZheliban/bin/Release/net5.0/ref/Ewide.NbzsZheliban.dll b/Ewide.NbzsZheliban/bin/Release/net5.0/ref/Ewide.NbzsZheliban.dll index 67c5fb7..e29af55 100644 Binary files a/Ewide.NbzsZheliban/bin/Release/net5.0/ref/Ewide.NbzsZheliban.dll and b/Ewide.NbzsZheliban/bin/Release/net5.0/ref/Ewide.NbzsZheliban.dll differ diff --git a/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.csproj.AssemblyReference.cache b/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.csproj.AssemblyReference.cache index f5e894a..14d34b4 100644 Binary files a/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.csproj.AssemblyReference.cache and b/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.csproj.AssemblyReference.cache differ diff --git a/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.dll b/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.dll index a153e27..1985898 100644 Binary files a/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.dll and b/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.dll differ diff --git a/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.pdb b/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.pdb index f30c14e..31f5a67 100644 Binary files a/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.pdb and b/Ewide.NbzsZheliban/obj/Debug/net5.0/Ewide.NbzsZheliban.pdb differ diff --git a/Ewide.NbzsZheliban/obj/Debug/net5.0/ref/Ewide.NbzsZheliban.dll b/Ewide.NbzsZheliban/obj/Debug/net5.0/ref/Ewide.NbzsZheliban.dll index 0ca52f1..aa6215c 100644 Binary files a/Ewide.NbzsZheliban/obj/Debug/net5.0/ref/Ewide.NbzsZheliban.dll and b/Ewide.NbzsZheliban/obj/Debug/net5.0/ref/Ewide.NbzsZheliban.dll differ diff --git a/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.csproj.AssemblyReference.cache b/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.csproj.AssemblyReference.cache index 39420ca..e933950 100644 Binary files a/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.csproj.AssemblyReference.cache and b/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.csproj.AssemblyReference.cache differ diff --git a/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.dll b/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.dll index f4a9c5f..8772497 100644 Binary files a/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.dll and b/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.dll differ diff --git a/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.pdb b/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.pdb index edd1542..e2a26a0 100644 Binary files a/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.pdb and b/Ewide.NbzsZheliban/obj/Release/net5.0/Ewide.NbzsZheliban.pdb differ diff --git a/Ewide.NbzsZheliban/obj/Release/net5.0/ref/Ewide.NbzsZheliban.dll b/Ewide.NbzsZheliban/obj/Release/net5.0/ref/Ewide.NbzsZheliban.dll index 67c5fb7..e29af55 100644 Binary files a/Ewide.NbzsZheliban/obj/Release/net5.0/ref/Ewide.NbzsZheliban.dll and b/Ewide.NbzsZheliban/obj/Release/net5.0/ref/Ewide.NbzsZheliban.dll differ diff --git a/FrontCode2/sunshine_levy/src/assets/img/zspg.png b/FrontCode2/sunshine_levy/src/assets/img/zspg.png index b94cbb3..d2a21ed 100644 Binary files a/FrontCode2/sunshine_levy/src/assets/img/zspg.png and b/FrontCode2/sunshine_levy/src/assets/img/zspg.png differ diff --git a/FrontCode2/sunshine_levy/src/assets/img/zsxy.png b/FrontCode2/sunshine_levy/src/assets/img/zsxy.png index 6cdfac7..cc5daa0 100644 Binary files a/FrontCode2/sunshine_levy/src/assets/img/zsxy.png and b/FrontCode2/sunshine_levy/src/assets/img/zsxy.png differ diff --git a/FrontCode2/sunshine_levy/src/views/index.vue b/FrontCode2/sunshine_levy/src/views/index.vue index 68e1f0a..d848764 100644 --- a/FrontCode2/sunshine_levy/src/views/index.vue +++ b/FrontCode2/sunshine_levy/src/views/index.vue @@ -362,7 +362,7 @@ export default { pageJump(id) { this.$router.push({ name: "policyInfo", - params: { ticket: this.ticket, id: id } + params: { ticket: this.ticket, id: id }, }); }, setZwUserAplus(Userid, userName) { @@ -388,13 +388,15 @@ export default { ZWJSBridge.onReady(() => { console.log("初始化完成后,执行bridge方法"); ZWJSBridge.getUserType() - .then(result1 => { - console.log(result1); + .then((result1) => { + console.log("getUserType():" + JSON.stringify(result1)); + console.log("result1.userType:" + result1.userType); //经纬度 ZWJSBridge.getLocation() - .then(result2 => { - console.log(result2); - debugger; + .then((result2) => { + console.log("getLocation():" + JSON.stringify(result2)); + console.log("result2.longitude:" + result2.longitude); + console.log("result2.latitude:" + result2.latitude); aplus_queue.push({ action: "aplus.sendPV", arguments: [ diff --git a/FrontCode2/sunshine_levy/src/views/pdf/pdf.vue b/FrontCode2/sunshine_levy/src/views/pdf/pdf.vue index 3dd3181..9465436 100644 --- a/FrontCode2/sunshine_levy/src/views/pdf/pdf.vue +++ b/FrontCode2/sunshine_levy/src/views/pdf/pdf.vue @@ -8,6 +8,9 @@ 保存到相册 + 测试2 + 测试3 + 测试4 @@ -16,19 +19,29 @@ import pdf from "vue-pdf"; import $ from "jquery"; import html2canvas from "html2canvas"; -import axios from "axios"; +// import axios from "axios"; import request from "@/common/util"; +import { mgop } from "@aligov/jssdk-mgop"; export default { components: { - pdf + pdf, }, data() { return { - url: "" + url: "", }; }, created() { this.onInit(); + console.log("pdf"); + }, + mounted() { + // 截图 + html2canvas(this.$refs.PDF).then((canvas) => { + canvas.id = "mycanvas"; + const base64 = canvas.toDataURL("image/png"); + jquery("a").prop("href", base64); + }); }, methods: { onInit() { @@ -38,11 +51,11 @@ export default { method: "post", data: { ticket: window.sessionStorage.getItem("ticket"), - id: "C655515B-FD91-48F2-BD79-EAABAFB7077C" + id: "C655515B-FD91-48F2-BD79-EAABAFB7077C", }, headers: { "Content-Type": "application/json; charset=UTF-8" }, - responseType: "arraybuffer" //一定要设置响应类型,否则页面会是空白pdf - }).then(result => { + responseType: "arraybuffer", //一定要设置响应类型,否则页面会是空白pdf + }).then((result) => { const binaryData = []; binaryData.push(result.data); //获取blob链接 @@ -54,32 +67,38 @@ export default { // this.handlePrint(pdfUrl); // } }); - // axios({ - // method: "post", - // url: "http://10.19.94.9:7099/api/agreement/info", - // responseType: "blob", - // data: { - // ticket: "8a1188557bda7894017bed584f803119-ticket", - // id: "C655515B-FD91-48F2-BD79-EAABAFB7077C", - // }, - // }).then((res) => { - // debugger; - // console.log(res); - // if (!res) { - // return; - // } - // let blob = new Blob([res.data], { - // type: "application/octet-stream", - // }); - // let url = window.URL.createObjectURL(blob); - // let link = document.createElement("a"); - // link.style.display = "none"; - // link.href = url; - // document.body.appendChild(link); - // link.click(); - // }); + mgop({ + api: "mgop.kykj.houseexpropriat.getagreementinfo", + host: "https://mapi.zjzwfw.gov.cn/", + dataType: "JSON", + type: "POST", + data: { + ticket: "8a1189377bdad67c017bf66039d76376-ticket", + id: "C655515B-FD91-48F2-BD79-EAABAFB7077C", + }, + appKey: "es4b8zmz+2001833218+dehllx", + onSuccess: (result) => { + console.log("pdf.vue页面请求pdf文件:", result); + if (result.data && result.data.success == true) { + console.log("result.data.data:", result.data.data); + this.url = result.data.data; + // const binaryData = []; + // binaryData.push(result.data); + // //获取blob链接 + // this.url = window.URL.createObjectURL( + // new Blob(binaryData, { type: "application/pdf" }) + // ); + // if (pdfUrl) { + // this.handlePrint(pdfUrl); + // } + } + }, + onFail: (err) => { + console.log("用户无数据,不展示"); + }, + }); }, - handlePrint(pdf) { + handlePrint() { if (document.getElementById("print-iframe")) { document.body.removeChild(document.getElementById("print-iframe")); } @@ -88,7 +107,7 @@ export default { if (!iframe) { iframe = document.createElement("IFRAME"); let doc = null; - iframe.setAttribute("src", pdf); + iframe.setAttribute("src", this.url); iframe.setAttribute("id", "print-iframe"); document.body.appendChild(iframe); doc = iframe.contentWindow.document; @@ -100,8 +119,37 @@ export default { onLoadData() { // console.log(this.$route.params); // this.url = this.$route.params.url; - } - } + }, + savePdf() { + ZWJSBridge.onReady(() => { + console.log("初始化完成后,执行bridge方法-savePdf"); + ZWJSBridge.saveImage({ + url: this.url, + }) + .then((result) => { + console.log("saveImage()成功:" + JSON.stringify(result)); + }) + .catch((error) => { + console.log("saveImage()失败:" + JSON.stringify(result)); + console.log(error); + }); + }); + }, + testdownload4() { + ZWJSBridge.onReady(() => { + console.log("初始化完成后,执行bridge方法-testdownload4"); + ZWJSBridge.openLink({ + url: this.url, + }) + .then((result) => { + console.log("testdownload4():" + result); + }) + .catch((error) => { + console.log(error); + }); + }); + }, + }, };