¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.product.mobile.core.service; |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import com.aspose.p6a2feef8.p995e1fda.pbdb106a0.b; |
| | | import com.product.common.lang.StringUtils; |
| | | import com.product.core.config.CoreConst; |
| | | import com.product.core.config.Global; |
| | | import com.product.core.dao.BaseDao; |
| | | import com.product.core.entity.DataTableEntity; |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.exception.BaseException; |
| | | import com.product.core.log.SystemLogger; |
| | | import com.product.core.service.support.AbstractBaseService; |
| | | import com.product.core.spring.context.SpringMVCContextHolder; |
| | | import com.product.mobile.core.config.MobileCoreCode; |
| | | import com.product.mobile.core.config.MobileCoreConst; |
| | | import com.product.module.sys.entity.SystemUser; |
| | | import com.product.util.BaseUtil; |
| | | |
| | | /** |
| | | * ææºç«¯ï¼è·åç¨æ·ææåºç¨ |
| | | * @author Administrator |
| | | * |
| | | */ |
| | | @Component |
| | | public class CommonMVCService extends AbstractBaseService{ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //å¶å®è¾åºæ ¼å¼ |
| | | |
| | | @Autowired |
| | | public BaseDao baseDao; |
| | | /** |
| | | * æ¥è¯¢æ°æ®æ°æ®æ¯å¦æèµ°å®¡æ¹æµç¨ |
| | | * @param table |
| | | * @param uuid |
| | | */ |
| | | public String getApproveDetailUUID(String table,String uuid) { |
| | | |
| | | DataTableEntity dt = getBaseDao().listTable("product_sys_flow_detail", " record_uuid=? and table_name=? ",new Object[]{uuid,table}); |
| | | if(dt.isEmpty()) { |
| | | return null; |
| | | }else { |
| | | return dt.getFieldSetEntity(0).getUUID(); |
| | | } |
| | | } |
| | | /** |
| | | * æ¥åºMVC䏿鮿ä½ççé¢ï¼çé¢åé¢çæææé® |
| | | * @param button æå¯è½æ¯ç±»åï¼æå¯è½æ¯uuid |
| | | * @param table |
| | | * @param functionUuid |
| | | * @return |
| | | * @throws BaseException |
| | | */ |
| | | public FieldSetEntity getPageButtons(FieldSetEntity fse) throws BaseException{ |
| | | |
| | | String buttonUuid=fse.getString("buttonUuid"); |
| | | |
| | | String table=fse.getString(CoreConst.SYSTEM_TABLE_NAME_LABEL); |
| | | if(table==null) table=fse.getTableName(); |
| | | String functionUuid=fse.getString("functionUuid"); |
| | | String buttonType=fse.getString("buttonType"); |
| | | if(StringUtils.isEmpty(functionUuid) && !StringUtils.isEmpty(table)) { |
| | | ///æ ¹æ®è¡¨å»æ¥åè½ï¼å¦æå¤ä¸ªï¼å第ä¸ä¸ª |
| | | FieldSetEntity f=baseDao.getFieldSetByFilter("product_sys_functions", "table_uuid=(select uuid from product_sys_datamodel_table where table_name=?) or table_uuid=? ", new String[] {table,table}, false); |
| | | if(!FieldSetEntity.isEmpty(f)) { |
| | | functionUuid=f.getUUID(); |
| | | } |
| | | } |
| | | FieldSetEntity page=null; |
| | | |
| | | if(!StringUtils.isEmpty(functionUuid)) { |
| | | //æ ¹æ®æé®ç±»åæ¥åºæé®uuid |
| | | if(StringUtils.isEmpty(buttonUuid)&& !StringUtils.isEmpty(buttonType) ) { |
| | | DataTableEntity d=baseDao.listTable("product_sys_function_buttons", " function_uuid=? and button_category_uuid=? ", new String[] {functionUuid,buttonType},"button_type"); |
| | | if(!DataTableEntity.isEmpty(d)) { |
| | | buttonUuid=d.getFieldSetEntity(0).getUUID();//åç¬¬ä¸æ¡ |
| | | } |
| | | } |
| | | //æ¥åºæé®å¯¹åºçé¢ï¼å¯è½æé®æå¤ä¸ªï¼å第ä¸ä¸ª |
| | | if(!StringUtils.isEmpty(buttonUuid)) { |
| | | StringBuilder b=new StringBuilder(); |
| | | b.append("select * from product_sys_mvc_page where function_uuid=? and uuid in (\r\n") |
| | | .append("select line_to from product_sys_link where function_uuid=? and line_from=?\r\n") |
| | | .append(" union all ") |
| | | .append("select line_to from product_sys_link where function_uuid=? and line_from=\r\n") |
| | | .append(" (select line_to mainUuid from product_sys_link where function_uuid=? and line_from=?) ") |
| | | .append(")"); |
| | | DataTableEntity d=baseDao.listTable(b.toString() , new String[] {functionUuid,functionUuid,buttonUuid,functionUuid,functionUuid,buttonUuid} ); |
| | | if(!DataTableEntity.isEmpty(d)) { |
| | | page=d.getFieldSetEntity(0);//åç¬¬ä¸æ¡ |
| | | }else { |
| | | |
| | | } |
| | | } |
| | | if(page!=null) { |
| | | //æ¥çé¢åçæææé® |
| | | StringBuilder b=new StringBuilder(); |
| | | b.append("select * from product_sys_function_buttons where function_uuid=? and uuid in(\r\n") |
| | | .append("select line_to from product_sys_link where function_uuid=? and line_from=?\r\n") |
| | | .append(")"); |
| | | DataTableEntity d=baseDao.listTable(b.toString() , new String[] {functionUuid,functionUuid,page.getUUID()} ); |
| | | page.addSubDataTable(d); |
| | | }else { |
| | | throw new BaseException(MobileCoreCode.GET_ROUTER_FAIL); |
| | | } |
| | | return page; |
| | | }else { |
| | | throw new BaseException(MobileCoreCode.GET_ROUTER_FAIL); |
| | | } |
| | | } |
| | | |
| | | } |