【ssi】增删改查六操作小框架(八)
生活随笔
收集整理的這篇文章主要介紹了
【ssi】增删改查六操作小框架(八)
小編覺得挺不錯的,現(xiàn)在分享給大家,幫大家做個參考.
(七)Struts_admin.xml
<!-- 2012年07月31日 atip-15 異議信息管理action 團長 -->??<action name="dissent_*" method="{1}" class="dissentAction">
????<result name="success" type="json" />
??</action>
七、復雜應用實例清單
下述清單中是一個復雜應用的實例。代碼位于svn://10.10.114.15/netsale/code/ATIP3/branches/atip-11/src/java/com/sinosig/atip/punishiment包下。完整代碼中有比較充分的注釋,此清單只提供主要的功能代碼。紅色字體是類名,藍色字體是方法名。(一)Action
public class InnerPunishAction extends SimplePagedAction<InnerPunishment> {????protected String checkForSeachSingleInfo(InnerPunishment param) {
??????if (null != param.getPunishId()) {
????????return CheckUtil.CHECKSUCCESS();
??????} else {
????????return "請選擇一條數(shù)據(jù)進行操作!";
??????}
????}
??}
(二)Service
public class InnerPunishServiceImpl extends??????AbstractPagedInfoServImpl<InnerPunishment> implements
??????InnerPunishService {
????public Integer queryCount(InnerPunishment param) throws SAABException {
??????return dao.getCountByQuery("innerPunish.queryTotalCount", param);
????}
??
??protected InnerPunishment parseMap(Map<String, Object> map) {
??????InnerPunishment inner = new InnerPunishment();
??
??????BigDecimal punishId = (BigDecimal) map.get("PUNISHID");
??????if (null != punishId) {
????????inner.setPunishId(punishId.intValue());
??????}
??
??????String temp = (String) map.get("DISPATCHUNIT");
??????if (StringUtils.isNotBlank(temp)) {
????????inner.setDispatchUnit(temp);
??????}
??
??????temp = (String) map.get("PENALTYNUMBER");
??????if (StringUtils.isNotBlank(temp)) {
????????inner.setPenaltyNumber(temp);
??????}
??
??????Date dispatchDate = (Date) map.get("DISPATCHDATE");
??????if (null != dispatchDate) {
????????inner.setDispatchDate(dispatchDate);
??????}
??????inner.setSubList(queryPunishSubList(inner));
??????return inner;
????}
??
????public InnerPunishment querySingleData(String statementId,
????????InnerPunishment param) throws SAABException {
??????param.setPunishmentType("01");
??????InnerPunishment result = (InnerPunishment) dao.getObjectByQuery(
??????????"innerPunish.queryById", param);
??????result.setSubList(queryPunishSubList(result));
??????return result;
????}
??
????private List<BLPunishmentSub> queryPunishSubList(InnerPunishment param) {
??
??????List<BLPunishmentSub> subList = new ArrayList<BLPunishmentSub>();
??
??????try {
????????subList = dao.getObjectsByQuery("innerPunish.querySubByPunishID",
????????????param);
??????} catch (SAABException e) {
????????// 如果發(fā)生異常,僅記錄日志。關聯(lián)子表設置為空表
????????logger.error("關聯(lián)查詢內(nèi)部處罰管理信息子表時發(fā)生異常。參數(shù)是:" + param + ",異常是:" + e
????????????+ ",異常原因是:" + e.getCause() + ",異常信息是:" + e.getMessage());
??????}
??
??????return subList;
????}
??}
轉載于:https://blog.51cto.com/winters1224/1029928
總結
以上是生活随笔為你收集整理的【ssi】增删改查六操作小框架(八)的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: WPF DatePicker 默认显示当
- 下一篇: 你不得不知道的Visual Studio