隨筆 - 23  文章 - 3  trackbacks - 0
          <2006年4月>
          2627282930311
          2345678
          9101112131415
          16171819202122
          23242526272829
          30123456

          常用鏈接

          留言簿(1)

          隨筆檔案

          搜索

          •  

          最新評(píng)論

          閱讀排行榜

          評(píng)論排行榜

          public class EmployUnitBaseInfo
          {???
          ?
          ??? private long ID; //用人單位系統(tǒng)編號(hào)---邏輯主鍵
          ??? private String unitCode; //用人單位代號(hào)--業(yè)務(wù)主鍵
          }
          1、??? 使用邏輯主鍵,分頁(yè)比較方便
          2、??? 有可能unitcode會(huì)改變,用id可以保證當(dāng)unitcode改變時(shí),這個(gè)實(shí)體還存在

          {C5A4CCF8-A282-4700-A5F3-FA6A5246D9F2}0.jpg

          在頁(yè)面上必須返回workpost + demandid,,
          pojo 中的demand類(lèi)如下:只有以下屬性的setter和getter
          ??? private String usedNeedNum;
          ??? private int unitId;
          ??? private String demandInfo;
           private long ID;
          ??? private String needNum;
          ??? private String position;
          必須再添加一個(gè)屬性demandInfo,
          而在另一個(gè)畢業(yè)生申報(bào)中又要如圖上操作,,如何在service層向頁(yè)面層傳遞這些信息(測(cè)試程序員(剩2需求數(shù)))
           public class DemandServiceImpl
          ??? extends BaseServiceImpl implements DemandService{
          ??? public List getDemandList(int unitId)
          ??? {
          ????????? long demandId;
          ????????? int needNum;
          ????????? int usedNeedNum;
          ????????? int lastNum;
          ?????????
          ????????? String demandInfo;
          ????????? TRealDemandDAOImpl dao = (TRealDemandDAOImpl) this.getBaseDAO();
          ????????? List list = dao.getSpareDemandByUnitId(unitId);
          ????????? Iterator it = list.iterator();
          ????????? while(it.hasNext())
          ????????? {
          ????????????? TRealDemand demand = (TRealDemand) it.next();
          ????????????? demandId = demand.getID();
          ????????????? needNum =? Integer.parseInt(demand.getNeedNum());?
          ????????????? usedNeedNum = Integer.parseInt(demand.getUsedNeedNum());
          ????????????? if(needNum>usedNeedNum)
          ????????????? {
          ????????????????? lastNum = usedNeedNum-needNum;
          ????????????????? demandInfo = demand.getPosition()+" 剩 " + lastNum +" 需求數(shù) ";
          ????????????? }
          ?????????????
          ????????? }
          ????????? return list;
          ??? }
          }

          在action層再通過(guò)以下代碼向頁(yè)面?zhèn)鬟f數(shù)據(jù):

          DemandService demandService = (DemandService) this.getBean("DemandService");
          ?request.setAttribute("demandList",demandService.findDemandListByUnitId(unitInfo.getID()));



          4、注意DemandServiceImpl 是實(shí)現(xiàn)類(lèi),DemandService 是interface
          DemandService demandService = (DemandService) this.getBean("DemandService");
          和DemandServiceImpl demandService = (DemandServiceImpl) this.getBean("DemandService");

          雖然兩個(gè)的操作一樣,但是demandService是接口但可以執(zhí)行相應(yīng)的操作,起到黑箱子的作用。

          5、記得在action中添加一個(gè)實(shí)體時(shí),要通過(guò)idcard取得sex和birthday的屬性加到內(nèi)存中(表相對(duì)應(yīng)的pojo)

          posted on 2006-04-21 10:36 aimy 閱讀(100) 評(píng)論(0)  編輯  收藏

          只有注冊(cè)用戶(hù)登錄后才能發(fā)表評(píng)論。


          網(wǎng)站導(dǎo)航:
           
          主站蜘蛛池模板: 古丈县| 泰宁县| 蓝山县| 淳化县| 石屏县| 九江县| 菏泽市| 社会| 泰顺县| 东宁县| 晋宁县| 东方市| 祥云县| 申扎县| 库尔勒市| 信丰县| 苍梧县| 工布江达县| 嘉荫县| 合肥市| 南和县| 凉山| 清涧县| 卢氏县| 四子王旗| 新平| 万山特区| 兰考县| 黔西| 海门市| 拉萨市| 含山县| 嘉黎县| 七台河市| 沙坪坝区| 博野县| 固安县| 河津市| 马鞍山市| 安远县| 孝感市|