Browse Source

支持客户得到审批结果

master
yashen 9 years ago
parent
commit
894885fa8c
4 changed files with 31 additions and 13 deletions
  1. +4
    -3
      B3WeChat/B3WeChat.csproj
  2. +4
    -0
      B3WeChat/BO/ApproveMessage.cs
  3. +22
    -10
      B3WeChat/Rpcs/ApproveMessageRpc.cs
  4. +1
    -0
      B3WeChat/Rpcs/WeChatUserRpc.cs

+ 4
- 3
B3WeChat/B3WeChat.csproj View File

@ -36,6 +36,10 @@
<HintPath>..\..\..\tsref\Debug\Forks.EnterpriseServices.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="forks.json, Version=1.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\forks.json.dll</HintPath>
</Reference>
<Reference Include="Forks.Utils, Version=4.0.0.0, Culture=neutral, PublicKeyToken=7254430f49d10aae, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\tsref\Debug\Forks.Utils.dll</HintPath>
@ -126,9 +130,6 @@
<Compile Include="WeiChatObjs\AuthorizationCodeResponse.cs" />
<Compile Include="WeiChatObjs\BaseResponse.cs" />
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.


+ 4
- 0
B3WeChat/BO/ApproveMessage.cs View File

@ -49,9 +49,13 @@ namespace BWP.B3WeChat.BO
[LogicName("审批结果")]
public NamedValue<> ApproveResult { get; set; }
[LogicName("审批时间")]
public DateTime? ApproveTime { get; set; }
[LogicName("审批意见")]
public string ApproveComment { get; set; }
public string OpenID { get; set; }
}
}

+ 22
- 10
B3WeChat/Rpcs/ApproveMessageRpc.cs View File

@ -53,22 +53,34 @@ namespace BWP.B3WeChat.Rpcs
}
/// <summary>
/// 返回消息状态
/// </summary>
/// <param name="messageID"></param>
/// <returns></returns>
[Rpc]
public static short QueryMessageState(string messageID)
public static Dictionary<string, short> QueryApproveResult(string[] messageIDList)
{
if (messageIDList.Length == 0)
{
return new Dictionary<string, short>(0);
}
var query = new DQueryDom(new JoinAlias(typeof(ApproveMessage)));
query.Where.Conditions.Add(DQCondition.EQ("ID", messageID));
query.Where.Conditions.Add(DQCondition.InList(DQExpression.Field("ID"),
messageIDList.Select((item) => DQExpression.Value(item)).ToArray()));
query.Columns.Add(DQSelectColumn.Field("ID"));
query.Columns.Add(DQSelectColumn.Field("ApproveResult"));
query.Range = SelectRange.Top(1);
var state = query.EExecuteScalar<NamedValue<>?>() ?? .;
return state.Value;
var dic = query.EExecuteList<string, NamedValue<>>()
.ToDictionary((item) => item.Item1, (item) => item.Item2.Value);
foreach (var messasgeID in messageIDList)
{
if (!dic.ContainsKey(messasgeID))
{
dic.Add(messasgeID, ..Value);
}
}
return dic;
}
[Rpc]
public static void Delete(string messageID)
{


+ 1
- 0
B3WeChat/Rpcs/WeChatUserRpc.cs View File

@ -26,6 +26,7 @@ namespace BWP.B3WeChat.Rpcs
var query = new DmoQuery(typeof(ApproveMessage));
query.Where.Conditions.Add(DQCondition.EQ("OpenID", "DEBUG"));
query.OrderBy.Expressions.Add(DQOrderByExpression.Create("CreateTime", true));
return query.EExecuteList().Cast<ApproveMessage>().ToArray();
}


Loading…
Cancel
Save