048 Medical Project-Module IV: Purchase order module-Purchase order acceptance (dao,service,action three floor)

Source: Internet
Author: User

Demand:

Before we put the purchase order to the supervision unit audit, the approval of the purchase order will be accepted. The supplier decides not to issue the purchase order.

As follows:

In this list is the Purchase Order Detail table, the data found here is only specific to the supplier's purchase order details, a region with only one supplier, there are several hospitals, each hospital has a lot of purchase orders. Then there is a supplier with several purchase orders. The supplier will have to look at the list of each purchase order to handle the data.

Let's write mapper first:

When we write SQL, we should refer to:

Mapper.xml as follows:

<!--List of purchase order drug details enquiry -    <SelectID= "Findyycgdmxlist"ParameterType= "Yycg.business.pojo.vo.YycgdQueryVo"Resulttype= "Yycg.business.pojo.vo.YycgdmxCustom">        <!--introduction of Paging header -        <includerefID= "Yycg.base.commonSql.page_start" />        Select Yycgdmx.id Yycgdmxid, Useryy.id Useryyid, USERYY.MC useryymc, YYCGD.BM yycgdbm, YYCGD.MC YYCGDMC, Yycgd.cjtime, (select info from dictinfo where typecode = ' 010 ' and Dictcode = yycgd.zt) YYCGDZTMC, Ypxx.id, YPXX.BM, YPXX.MC, YPXX.JX, Ypxx.gg, ypx X.zhxs, YPXX.SCQYMC, YPXX.SPMC, Ypxx.jyzt, (select info from Dictinfo whe Re ypxx.jyzt = dictcode and TypeCode = ' 003 ') JYZTMC, YYCGDMX.ZBJG, Yycgdmx.jyjg, YYCGD MX.CGL, Yycgdmx.cgje, Yycgdmx.cgzt, (select info from dictinfo where TypeCode =        ' 011 ' and dictcode = Yycgdmx.cgzt) CGZTMC, USERGYS.MC USERGYSMC, Usergys.id usergysid From yycgdmx${businessyear} yycgdmx, yycgd${businessyear} YYCGD, Useryy, Ypxx, Usergys W    Here Yycgdmx.yycgdid    = yycgd.id and Yycgd.useryyid = useryy.id and Yycgdmx.ypxxid = Ypxx.id and Yycgdmx.usergys         id = usergys.id<!--only check the drug details under a purchase order -        <includerefID= "Query_yycgdmx_where" />        <!--Purchase order Query conditions -        <includerefID= "Query_yycgd_where" />        <!--Drug search Conditions -        <includerefID= "Yycg.business.dao.mapper.YpxxMapperCustom.query_ypxx_where" />        <!--Pagination Trailer -        <includerefID= "Yycg.base.commonSql.page_end" />    </Select>

We've written about Findyycgdmxlistbefore. What we have to do this time is to expand the query condition so that the previous findyycgdmxlist can continue to be used.

    <!--total number of purchase list drug detail query lists -    <SelectID= "Findyycgdmxcount"ParameterType= "Yycg.business.pojo.vo.YycgdQueryVo"Resulttype= "int">Select COUNT (*) from yycgdmx${businessyear} yycgdmx, yycgd${businessyear} YYCGD, Useryy, Ypxx, usergys where Yycgdmx.yycgdid = yycgd.id and Yycgd.useryyid = Useryy.id and Yycgdmx.ypxx id = ypxx.id and yycgdmx.usergysid = Usergys.id<!--only check the drug details under a purchase order -        <includerefID= "Query_yycgdmx_where" />        <!--Purchase order Query conditions -        <includerefID= "Query_yycgd_where" />        <!--Drug search Conditions -        <includerefID= "Yycg.business.dao.mapper.YpxxMapperCustom.query_ypxx_where" />    </Select>
Findyycgdmxcount is the number of the corresponding check, used for paging.


The Service is as follows:

@Override PublicList<yycgdmxcustom>finddisposeyycgdlist (String Usergysid, String year, Yycgdqueryvo Yycgdqueryvo)throwsException {Yycgdqueryvo= Yycgdqueryvo! =NULL? Yycgdqueryvo:NewYycgdqueryvo (); //suppliers are only allowed to inquire about the purchase of medicines they supply//set up Vendor IDYycgdmxcustom Yycgdmxcustom =Yycgdqueryvo.getyycgdmxcustom (); Yycgdmxcustom= Yycgdmxcustom! =NULL?Yycgdmxcustom:NewYycgdmxcustom ();        Yycgdmxcustom.setusergysid (USERGYSID); //purchase drug details status as "not confirmed delivery"String cgzt = "1";        Yycgdmxcustom.setcgzt (CGZT);        Yycgdqueryvo.setyycgdmxcustom (Yycgdmxcustom); //Purchase order approved for approvalString ZT = "3"; Yycgdcustom Yycgdcustom=Yycgdqueryvo.getyycgdcustom (); Yycgdcustom= Yycgdcustom! =NULL? Yycgdcustom:NewYycgdcustom ();        Yycgdcustom.setzt (ZT);        Yycgdqueryvo.setyycgdcustom (Yycgdcustom); //Set YearYycgdqueryvo.setbusinessyear (year); returnyycgdmappercustom.findyycgdmxlist (YYCGDQUERYVO); } @Override Public intFinddisposeyycgdcount (String Usergysid, String year, Yycgdqueryvo Yycgdqueryvo)throwsException {Yycgdqueryvo= Yycgdqueryvo! =NULL? Yycgdqueryvo:NewYycgdqueryvo (); //suppliers are only allowed to inquire about the purchase of medicines they supply//set up Vendor IDYycgdmxcustom Yycgdmxcustom =Yycgdqueryvo.getyycgdmxcustom (); Yycgdmxcustom= Yycgdmxcustom! =NULL?Yycgdmxcustom:NewYycgdmxcustom ();        Yycgdmxcustom.setusergysid (USERGYSID); //purchase drug details status as "not confirmed delivery"String cgzt = "1";        Yycgdmxcustom.setcgzt (CGZT);        Yycgdqueryvo.setyycgdmxcustom (Yycgdmxcustom); //Purchase order approved for approvalString ZT = "3"; Yycgdcustom Yycgdcustom=Yycgdqueryvo.getyycgdcustom (); Yycgdcustom= Yycgdcustom! =NULL? Yycgdcustom:NewYycgdcustom ();        Yycgdcustom.setzt (ZT);        Yycgdqueryvo.setyycgdcustom (Yycgdcustom); //Set YearYycgdqueryvo.setbusinessyear (year); returnYycgdmappercustom.findyycgdmxcount (YYCGDQUERYVO); }

Action Layer:

//Purchase Order Processing page@RequestMapping ("/DISPOSEYYCGD")     PublicString DISPOSEYYCGD (model model)throwsException {//Current yearModel.addattribute ("Year", Myutil.get_yyyy (Myutil.getdate ())); return"/BUSINESS/CGD/DISPOSEYYCGD"; }    //Purchase Order Acceptance list result set, JSON@RequestMapping ("/disposeyycgd_result")     Public@ResponseBody datagridresultinfo Disposeyycgd_result (//HttpSession Session,Activeuser Activeuser, String year,//yearYycgdqueryvo Yycgdqueryvo,//Query Criteria            intPageintRowsthrowsException {//Supplier IDString Usergysid = Activeuser.getsysid ();//Unit ID//Total number of lists        intTotal =Cgdservice.finddisposeyycgdcount (Usergysid, year, YYCGDQUERYVO); //Paging ParametersPagequery Pagequery =NewPagequery ();        Pagequery.setpageparams (total, rows, page); Yycgdqueryvo.setpagequery (pagequery);//Set Paging Parameters//Paged Query Listlist<yycgdmxcustom> list =cgdservice.finddisposeyycgdlist (Usergysid, year, YYCGDQUERYVO); Datagridresultinfo Datagridresultinfo=NewDatagridresultinfo ();        Datagridresultinfo.settotal (total);        Datagridresultinfo.setrows (list); returnDatagridresultinfo; }

Debug Pass.

048 Medical Project-Module IV: Purchase order module-Purchase order acceptance (dao,service,action three floor)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.