Home > Net >  Trouble to help me have a look at what went wrong?
Trouble to help me have a look at what went wrong?

Time:05-16

Public JsonResult MaterialApplicationList (int userId, int status)//bill of materials list
{
Bool isuser=new DAL. UserDAL () isuserLvelApp (userId. The ToString (), "" material application, 1);
if (! Isuser)
{
Return a Json (new {code="3", MSG=$" you have no legal power "}, JsonRequestBehavior. AllowGet);
}
Var query=new BLL. Tb_materialApplication () getlist (userId, status);
If (query!=null & amp; & Query. Count> 0)
{
Return a Json (new {code="1", MSG="successful", data=https://bbs.csdn.net/topics/query}, JsonRequestBehavior. AllowGet);
}
Return a Json (new {code="0", MSG="fail"}, JsonRequestBehavior. AllowGet);
}
[HttpPost]
Public JsonResult MaterialOutboundAdd (int userId, string projectId)
{

Bool isuser=new DAL. UserDAL () isuserLvelApp (userId. The ToString (), "" material application, 1);
if (! Isuser)
{
Return a Json (new {code="3", MSG=$" you have no legal power "}, JsonRequestBehavior. AllowGet);
}
# region read listing in the table of content into inventory to
The BLL. Tb_materialApplication BLL=new BLL. Tb_materialApplication ();
The BLL. MaterialStockBLL _bll=new BLL. MaterialStockBLL ();
Var query=the BLL. Getlist (userId, 0).

If (query!=null & amp; & Query. Count & gt; 0)
{
String ckid=$" CL - {HttpUtil. GetTimeStamp ()} ";
The foreach (var item in the query)
{
String materialGuid=Guid. NewGuid (). The ToString ();
Var MPT=new TB_MaterialStock
{
Guid=materialGuid,
MaterialId=item MaterialId,
ProjectId=item. ProjectId,
MaterialPrice=0,
MaterialPriceTotal=0,
SellingPrice=0,
SellingPriceTotal=0,
The State=2,//outbound
Few=item. Few,
UserId=item userGuId,
MaterialNum=item number,
Ckid=ckid,
UpCheck=0
};
Resucode result=_bll. Add (MPT);
{
The BLL. UpdateStatus (result. The code, the item id, ckid, result, MSG, materialGuid);
}
}
The BLL. BillAdd (userId, ckid);//listing generates
# region information push template to reviewers
int id=userId;
Var the userinfo=new BLL. UserBLL () GetModel (id);
Var query1=new DAL. LocationDAL () GetModelProject (projectId);
Var _mpt=new BLL. CheckWorkLeaveBLL () SendCksend ();

If (_mpt!=null & amp; & _mpt. Count & gt; 0)
{
The foreach (var item in _mpt)
{
WxSendClass mptsend=new WxSendClass ();
Mptsend. TemplateId="u0uISfZd8d - LRoTby_SInJ6TToyTm2KHe_Rp_K2BE7Y";
Mptsend. First="application materials audit notice";
Mptsend. UserId= the userinfo. FullName + "material application;
Mptsend. Explain= query1. ProjectName + "approval";
Mptsend. Third=DateTime. Now. The ToString ();
Mptsend. Remark="project has the new materials in the application, please login the background review";
Mptsend. Url="";
Mptsend. Openid=item. Openid;
New BLL. Wxmsg (.) FwSendMsg (mptsend, new BLL WxAccessTokenBLL () AccessTokenShows ());
}
}
# endregion
Return Json (new {code="1", MSG="bill of materials submitted to success, waiting for audit"}, JsonRequestBehavior. AllowGet);
}
Return Json (new {code=1, MSG=list "no data"}, JsonRequestBehavior. AllowGet);

I added the red part is, normal is good can push messages before, I cannot push the news, and these have great god help to look at, thank you

CodePudding user response:

WxSendClass what thing is this, don't understand this, can't analysis

CodePudding user response:

Error post ah,,,,

CodePudding user response:

From the point of the code, you don't have a judge whether the userinfo is empty,,
  •  Tags:  
  • C#
  • Related