From 0be0f02a23158694e6c72d899b75670283a5fcf1 Mon Sep 17 00:00:00 2001 From: 6c <420680616@qq.com> Date: 星期三, 07 五月 2025 09:23:03 +0800 Subject: [PATCH] 移动端-应用 --- src/main/java/com/product/mobile/core/service/CommonMVCService.java | 53 ++++++++++------- src/main/java/com/product/mobile/core/service/ApplicationsService.java | 16 ++-- src/main/java/com/product/mobile/core/config/MobileCoreCode.java | 3 src/main/java/com/product/mobile/core/controller/CommonMVCController.java | 53 ++++++++++++----- 4 files changed, 78 insertions(+), 47 deletions(-) diff --git a/src/main/java/com/product/mobile/core/config/MobileCoreCode.java b/src/main/java/com/product/mobile/core/config/MobileCoreCode.java index 1d5a8e8..fa2453c 100644 --- a/src/main/java/com/product/mobile/core/config/MobileCoreCode.java +++ b/src/main/java/com/product/mobile/core/config/MobileCoreCode.java @@ -29,10 +29,11 @@ GET_FACE_FIELD_FAIL("鑾峰彇琛ㄥ崟瀛楁澶辫触", "008"), GET_FACE_CONFIG_FAIL("鑾峰彇琛ㄥ崟閰嶇疆澶辫触", "009"), - + SIGN_IN_REPEAT_FAIL("鑰冨嫟鎵撳崱澶辫触:閲嶅鎵撳崱", "010"), SIGN_IN_FAIL("鑰冨嫟鎵撳崱澶辫触", "011"), GET_DATA_FAIL("鑾峰彇鏁版嵁澶辫触", "012"), + GET_MVC_PAGE_INFO_FAIL("鑾峰彇椤甸潰淇℃伅澶辫触", "013"), ; MobileCoreCode(String text, String code) { diff --git a/src/main/java/com/product/mobile/core/controller/CommonMVCController.java b/src/main/java/com/product/mobile/core/controller/CommonMVCController.java index 209dde8..b7a8649 100644 --- a/src/main/java/com/product/mobile/core/controller/CommonMVCController.java +++ b/src/main/java/com/product/mobile/core/controller/CommonMVCController.java @@ -1,26 +1,21 @@ package com.product.mobile.core.controller; -import javax.servlet.http.HttpServletRequest; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RequestMethod; -import org.springframework.web.bind.annotation.RestController; - import com.product.admin.service.PublicService; import com.product.core.config.CoreConst; import com.product.core.controller.support.AbstractBaseController; -import com.product.core.entity.DataTableEntity; import com.product.core.entity.FieldSetEntity; import com.product.core.entity.RequestParameterEntity; import com.product.core.exception.BaseException; import com.product.core.spring.context.SpringMVCContextHolder; import com.product.mobile.core.config.MobileCoreCode; import com.product.mobile.core.service.CommonMVCService; -import com.product.mobile.core.service.NavBarManagerService; -import com.product.mobile.core.service.SignInService; import com.product.module.sys.version.ApiVersion; -import com.product.org.admin.config.CmnCode; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RequestMethod; +import org.springframework.web.bind.annotation.RestController; + +import javax.servlet.http.HttpServletRequest; /** * 鎵嬫満绔�氱敤鏌ヨ @@ -54,7 +49,7 @@ String flow_detail_uuid=commonMVCService.getApproveDetailUUID(fse.getTableName(),fse.getString("uuid")); if(flow_detail_uuid==null) { FieldSetEntity fs=publicService.getFieldSetEntity(fse, true); - + return this.result_OK_List(fs); }else { return this.OK_Add(flow_detail_uuid); @@ -62,14 +57,14 @@ } catch (BaseException e) { return this.error(e); } catch (Exception e) { - + return this.error(MobileCoreCode.GET_DATA_FAIL); } } /** * 鍔犺浇MVC锛屽寘鎷紝褰撳墠鎸夐挳锛屾寜閽搷浣滅晫闈紝鐣岄潰鍚庨潰鐨勬洿鎸夐挳 * ///鏌ュ嚭MVC涓寜閽搷浣滅殑鐣岄潰锛岀晫闈㈠悗闈㈢殑鎵�鏈夋寜閽� - * + * * @param request * @return */ @@ -94,7 +89,7 @@ } /** * 鎵ц绉诲姩绔�佹潵鐨勮〃杈惧紡鍒版暟鎹簱涓墽琛岋紝寰楀埌缁撴灉杩斿洖 - * + * * @param request * @return */ @@ -117,5 +112,31 @@ return this.error(MobileCoreCode.GET_ROUTER_FAIL); } } - + + /** + * 鏍规嵁鎸夐挳uuid鎵惧埌杩炴帴鐨勭涓�涓〉闈� + * + * @param request + * @return + */ + @RequestMapping(value = "/get-next-page-info/{version}", method = RequestMethod.POST) + @ApiVersion(1) + public String getNextPageByButtonUUID(HttpServletRequest request) { + try { + FieldSetEntity fse = null; + Object bean = request.getAttribute(CoreConst.API_POST_REQUEST_DATA); + if (bean != null) { + RequestParameterEntity reqp = (RequestParameterEntity) bean; + fse = reqp.getFormData(); + } + return OK_List(commonMVCService.getNextPageByButtonUUID(fse)); + } catch (BaseException e) { + SpringMVCContextHolder.getSystemLogger().error(e); + e.printStackTrace(); + return error(e); + } catch (Exception e) { + e.printStackTrace(); + return error(MobileCoreCode.GET_MVC_PAGE_INFO_FAIL); + } + } } diff --git a/src/main/java/com/product/mobile/core/service/ApplicationsService.java b/src/main/java/com/product/mobile/core/service/ApplicationsService.java index f78c3c2..7ba69b2 100644 --- a/src/main/java/com/product/mobile/core/service/ApplicationsService.java +++ b/src/main/java/com/product/mobile/core/service/ApplicationsService.java @@ -1,14 +1,13 @@ package com.product.mobile.core.service; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.stereotype.Component; - 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.service.support.AbstractBaseService; import com.product.util.BaseUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; /** * 鎵嬫満绔紝鑾峰彇鐢ㄦ埛鎵�鏈夊簲鐢� @@ -33,28 +32,29 @@ }else { } + final String TEMP_TABLE = "temp_table"; DataTableEntity dTableEntity = new DataTableEntity(); - FieldSetEntity moudel1=new FieldSetEntity(); + FieldSetEntity moudel1=new FieldSetEntity(TEMP_TABLE); moudel1.setValue("name", "琛屾斂绠$悊"); moudel1.setValue("uuid", "adasdgddddfadfs"); - FieldSetEntity moudel2=new FieldSetEntity(); + FieldSetEntity moudel2=new FieldSetEntity(TEMP_TABLE); moudel2.setValue("name", "椤圭洰绠$悊"); moudel2.setValue("uuid", "adasdgddddfadfs"); dTableEntity.addFieldSetEntity(moudel1); dTableEntity.addFieldSetEntity(moudel2); DataTableEntity f1=new DataTableEntity(); - FieldSetEntity function1=new FieldSetEntity(); + FieldSetEntity function1=new FieldSetEntity(TEMP_TABLE); function1.setValue("name","瀹㈡埛绠$悊"); function1.setValue("icon","cc"); function1.setValue("path","/asdfwasss"); function1.setValue("uuid","asdfkldsjfelsdfdsf"); - FieldSetEntity function2=new FieldSetEntity(); + FieldSetEntity function2=new FieldSetEntity(TEMP_TABLE); function2.setValue("name","鎶ヨ〃绠$悊"); function2.setValue("icon","cc"); function2.setValue("path","/asdfwasss"); function2.setValue("uuid","asdfkldsjfelsdfdsf"); - FieldSetEntity function3=new FieldSetEntity(); + FieldSetEntity function3=new FieldSetEntity(TEMP_TABLE); function3.setValue("name","鍏枃绠$悊"); function3.setValue("icon","cc"); function3.setValue("path","/asdfwasss"); diff --git a/src/main/java/com/product/mobile/core/service/CommonMVCService.java b/src/main/java/com/product/mobile/core/service/CommonMVCService.java index e43226a..5dfb8f5 100644 --- a/src/main/java/com/product/mobile/core/service/CommonMVCService.java +++ b/src/main/java/com/product/mobile/core/service/CommonMVCService.java @@ -1,28 +1,17 @@ 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; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Component; + +import java.text.SimpleDateFormat; /** * 鎵嬫満绔紝鑾峰彇鐢ㄦ埛鎵�鏈夊簲鐢� @@ -32,7 +21,7 @@ @Component public class CommonMVCService extends AbstractBaseService{ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //鍒跺畾杈撳嚭鏍煎紡 - + @Autowired public BaseDao baseDao; /** @@ -41,7 +30,7 @@ * @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; @@ -53,14 +42,14 @@ * 鏌ュ嚭MVC涓寜閽搷浣滅殑鐣岄潰锛岀晫闈㈠悗闈㈢殑鎵�鏈夋寜閽� * @param button 鏈夊彲鑳芥槸绫诲瀷锛屾湁鍙兘鏄痷uid * @param table - * @param functionUuid + * @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"); @@ -73,7 +62,7 @@ } } FieldSetEntity page=null; - + if(!StringUtils.isEmpty(functionUuid)) { //鏍规嵁鎸夐挳绫诲瀷鏌ュ嚭鎸夐挳uuid if(StringUtils.isEmpty(buttonUuid)&& !StringUtils.isEmpty(buttonType) ) { @@ -95,7 +84,7 @@ if(!DataTableEntity.isEmpty(d)) { page=d.getFieldSetEntity(0);//鍙栫涓�鏉� }else { - + } } if(page!=null) { @@ -124,4 +113,24 @@ FieldSetEntity fs=baseDao.getFieldSetBySQL(sql, null, false); return fs; } + + /** + * 鏍规嵁鎸夐挳uuid鎵惧埌杩炴帴鐨勭涓�涓〉闈� + * @param fse + * @return + */ + public FieldSetEntity getNextPageByButtonUUID(FieldSetEntity fse) { + String buttonUUID = fse.getUUID(); + StringBuilder sql = new StringBuilder(128); + sql.append("\nSELECT p.flow_uuid type_code,p.flow_title"); + sql.append("\nFROM product_sys_mvc_page p"); + sql.append("\nINNER JOIN product_sys_link l ON p.uuid=l.line_to"); + sql.append("\nWHERE l.line_from=?"); + sql.append("\nORDER BY p.id DESC"); + DataTableEntity nextPageDte = baseDao.listTable(sql.toString(), new Object[]{buttonUUID}); + if (DataTableEntity.isEmpty(nextPageDte)) { + throw new BaseException(MobileCoreCode.GET_MVC_PAGE_INFO_FAIL); + } + return nextPageDte.getFieldSetEntity(0); + } } -- Gitblit v1.9.2