|
|
@@ -30,16 +30,19 @@ namespace Winsoft.GOV.XF.WebApi.WXCore.Controllers
|
|
|
AssetsService _assetsService;
|
|
|
ImagesService _imagesService;
|
|
|
XFApiService _xfApiService;
|
|
|
+ WXApiService _wxApiService;
|
|
|
public BundleController(IOptions<SenparcWeixinSetting> senparcWeixinSetting,
|
|
|
ILoggerFactory loggerFactory, UsersService usersService,
|
|
|
BundlesService bundlesService, AssetsService assetsService,
|
|
|
- ImagesService imagesService, XFApiService xfApiService) : base(senparcWeixinSetting, loggerFactory)
|
|
|
+ ImagesService imagesService, XFApiService xfApiService,
|
|
|
+ WXApiService wxApiService) : base(senparcWeixinSetting, loggerFactory)
|
|
|
{
|
|
|
_usersService = usersService;
|
|
|
_bundlesService = bundlesService;
|
|
|
_assetsService = assetsService;
|
|
|
_imagesService = imagesService;
|
|
|
_xfApiService = xfApiService;
|
|
|
+ _wxApiService = wxApiService;
|
|
|
}
|
|
|
// GET: api/values
|
|
|
[HttpGet("{id}")]
|
|
|
@@ -86,6 +89,22 @@ namespace Winsoft.GOV.XF.WebApi.WXCore.Controllers
|
|
|
return Ok(b);
|
|
|
}
|
|
|
|
|
|
+ [HttpGet("QueryEvaluate/{id}")]
|
|
|
+ [Produces(typeof(EvaluateModel))]
|
|
|
+ [WeixinInternalRequest("访问被拒绝,请通过微信客户端访问!", "nofilter")]
|
|
|
+ [WXOAuthCheck(appId: null, oauthCallbackUrl: "api/Auth")]
|
|
|
+ public async Task<IActionResult> QueryEvaluate(string id)
|
|
|
+ {
|
|
|
+ Bundle b = await _bundlesService.Get(id);
|
|
|
+ if (b == null)
|
|
|
+ return BadRequest();
|
|
|
+ string msg;
|
|
|
+ EvaluateModel e = await _xfApiService.QueryEvaluate(b.SearchCode, m => msg = m);
|
|
|
+ if (e == null)
|
|
|
+ return BadRequest();
|
|
|
+ return Ok(e);
|
|
|
+ }
|
|
|
+
|
|
|
//[HttpGet("reply/{id}")]
|
|
|
//[Produces(typeof(Bundle))]
|
|
|
//[WeixinInternalRequest("访问被拒绝,请通过微信客户端访问!", "nofilter")]
|
|
|
@@ -110,7 +129,6 @@ namespace Winsoft.GOV.XF.WebApi.WXCore.Controllers
|
|
|
// return Ok(b);
|
|
|
//}
|
|
|
|
|
|
-
|
|
|
[HttpGet("bySearchCode/{searchCode}")]
|
|
|
[Produces(typeof(Bundle))]
|
|
|
[WeixinInternalRequest("访问被拒绝,请通过微信客户端访问!", "nofilter")]
|
|
|
@@ -177,23 +195,23 @@ namespace Winsoft.GOV.XF.WebApi.WXCore.Controllers
|
|
|
// return Ok(r);
|
|
|
//}
|
|
|
|
|
|
- [HttpGet("queryEvaluate/{id}")]
|
|
|
- [Produces(typeof(EvaluateModel))]
|
|
|
- [WeixinInternalRequest("访问被拒绝,请通过微信客户端访问!", "nofilter")]
|
|
|
- [WXOAuthCheck(appId: null, oauthCallbackUrl: "api/Auth")]
|
|
|
- public async Task<IActionResult> IsEvaluate(string id)
|
|
|
- {
|
|
|
- string failsMessage = String.Empty;
|
|
|
- if (String.IsNullOrEmpty(id))
|
|
|
- return BadRequest("此信访信件不正确");
|
|
|
- Bundle b = await _bundlesService.Get(id);
|
|
|
- if (b == null && String.IsNullOrEmpty(b.SearchCode))
|
|
|
- return BadRequest("此信访信件异常");
|
|
|
- //if (!await _xfApiService.IsEvaluate(b.LetterId, m => failsMessage = m))
|
|
|
- // return BadRequest("还不能对此信件的办理结果评价");
|
|
|
- EvaluateModel r = await _xfApiService.QueryEvaluate(b.SearchCode, m => failsMessage = m);
|
|
|
- return Ok(r);
|
|
|
- }
|
|
|
+ //[HttpGet("IsEvaluate/{id}")]
|
|
|
+ //[Produces(typeof(EvaluateModel))]
|
|
|
+ //[WeixinInternalRequest("访问被拒绝,请通过微信客户端访问!", "nofilter")]
|
|
|
+ //[WXOAuthCheck(appId: null, oauthCallbackUrl: "api/Auth")]
|
|
|
+ //public async Task<IActionResult> IsEvaluate(string id)
|
|
|
+ //{
|
|
|
+ // string failsMessage = String.Empty;
|
|
|
+ // if (String.IsNullOrEmpty(id))
|
|
|
+ // return BadRequest("此信访信件不正确");
|
|
|
+ // Bundle b = await _bundlesService.Get(id);
|
|
|
+ // if (b == null && String.IsNullOrEmpty(b.SearchCode))
|
|
|
+ // return BadRequest("此信访信件异常");
|
|
|
+ // if (!await _xfApiService.IsEvaluate(b.LetterId, m => failsMessage = m))
|
|
|
+ // return BadRequest("还不能对此信件的办理结果评价");
|
|
|
+ // //EvaluateModel r = await _xfApiService.QueryEvaluate(b.SearchCode, m => failsMessage = m);
|
|
|
+ // return Ok(r);
|
|
|
+ //}
|
|
|
|
|
|
[HttpGet("all")]
|
|
|
[Produces(typeof(IEnumerable<Bundle>))]
|
|
|
@@ -300,7 +318,8 @@ namespace Winsoft.GOV.XF.WebApi.WXCore.Controllers
|
|
|
await _bundlesService.Add(value);
|
|
|
if (await _xfApiService.PostLetter(value, HttpContext.Request.Cookies["BaseUrl"], e => failsMessage = e))
|
|
|
{
|
|
|
-
|
|
|
+ await _xfApiService.PostAssets(value);
|
|
|
+ await _wxApiService.Notify(value.OpenID, String.Format("感谢您的来信,请记住您的信件查询码。通过查询码,您可以在浙江政务服务网上查询该信件的受理情况。同样,您可以在我们丽水微信端的12345政务咨询投诉举报平台上的“结果查询”中,查看信件的受理情况。\n查询码:{0}", value.SearchCode));
|
|
|
return Ok();
|
|
|
}
|
|
|
await _bundlesService.Delete(value);
|