| | |
| | | GET_FACE_FIELD_FAIL("获取表单字段失败", "008"), |
| | | |
| | | GET_FACE_CONFIG_FAIL("获取表单配置失败", "009"), |
| | | |
| | | |
| | | SIGN_IN_REPEAT_FAIL("考勤打卡失败:重复打卡", "010"), |
| | | SIGN_IN_FAIL("考勤打卡失败", "011"), |
| | | GET_DATA_FAIL("获取数据失败", "012"), |
| | | APP_ADMIN_VERSION_CHECK_NOT_CODE("未获取到APP版本号", "013"), |
| | | GET_MVC_PAGE_INFO_FAIL("获取页面信息失败", "013"), |
| | | APP_ADMIN_VERSION_CHECK_NOT_CODE("未获取到APP版本号", "014"), |
| | | ; |
| | | |
| | | MobileCoreCode(String text, String code) { |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 手机端通用查询 |
| | |
| | | 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); |
| | |
| | | } catch (BaseException e) { |
| | | return this.error(e); |
| | | } catch (Exception e) { |
| | | |
| | | |
| | | return this.error(MobileCoreCode.GET_DATA_FAIL); |
| | | } |
| | | } |
| | | /** |
| | | * 加载MVC,包括,当前按钮,按钮操作界面,界面后面的更按钮 |
| | | * ///查出MVC中按钮操作的界面,界面后面的所有按钮 |
| | | * |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | } |
| | | /** |
| | | * 执行移动端送来的表达式到数据库中执行,得到结果返回 |
| | | * |
| | | * |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 手机端,获取用户所有应用 |
| | |
| | | }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"); |
| | |
| | | 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; |
| | | |
| | | /** |
| | | * 手机端,获取用户所有应用 |
| | |
| | | @Component |
| | | public class CommonMVCService extends AbstractBaseService{ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); //制定输出格式 |
| | | |
| | | |
| | | @Autowired |
| | | public BaseDao baseDao; |
| | | /** |
| | |
| | | * @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; |
| | |
| | | * 查出MVC中按钮操作的界面,界面后面的所有按钮 |
| | | * @param button 有可能是类型,有可能是uuid |
| | | * @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"); |
| | |
| | | } |
| | | } |
| | | FieldSetEntity page=null; |
| | | |
| | | |
| | | if(!StringUtils.isEmpty(functionUuid)) { |
| | | //根据按钮类型查出按钮uuid |
| | | if(StringUtils.isEmpty(buttonUuid)&& !StringUtils.isEmpty(buttonType) ) { |
| | |
| | | if(!DataTableEntity.isEmpty(d)) { |
| | | page=d.getFieldSetEntity(0);//取第一条 |
| | | }else { |
| | | |
| | | |
| | | } |
| | | } |
| | | if(page!=null) { |
| | |
| | | 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); |
| | | } |
| | | } |
| | |
| | | package com.product.mobile.core.service; |
| | | |
| | | import com.product.admin.config.CmnConst; |
| | | import com.product.admin.service.PublicService; |
| | | import com.product.common.lang.StringUtils; |
| | | import com.product.core.dao.BaseDao; |
| | | import com.product.core.entity.DataTableEntity; |
| | | import com.product.core.entity.FieldSetEntity; |
| | |
| | | */ |
| | | public DataTableEntity listReadMessage(FieldSetEntity fse) { |
| | | ArrayList <Object> ps= new ArrayList<Object>(); |
| | | String readType = StringUtils.isEmpty(fse.getString("read")) ? "1" : fse.getString("read"); |
| | | ps.add(readType); |
| | | ps.add(SpringMVCContextHolder.getCurrentUserId()); |
| | | StringBuilder f=new StringBuilder(); |
| | | if(fse.getString("type")!=null) { |
| | | f.append(" and SUBSTRING(m.message_type,1,1)=?"); |
| | | ps.add(fse.getString("type")); |
| | | } |
| | | if(fse.getString("key")!=null) { |
| | | if(!StringUtils.isEmpty(fse.getString("key"))) { |
| | | f.append( " and (title like concat('%',?,'%') or content like concat('%',?,'%') or user_name like concat('%',?,'%') ) "); |
| | | ps.add(fse.getString("key")); |
| | | ps.add(fse.getString("key")); |
| | |
| | | sql.append("\nselect m.uuid,m.title,m.content,m.send_user_id,mu.user_name send_user_name,m.send_time,m.message_type,ifnull(m.url,'') url,source_table,source_uuid,thumbnail_img "); |
| | | sql.append("\nfrom product_sys_message m"); |
| | | sql.append("\nleft join product_sys_users mu on mu.user_id=m.send_user_id "); |
| | | sql.append("\ninner join product_sys_message_user u on u.message_uuid=m.uuid and u.read_type=1 and u.user_id=? ").append(f); |
| | | sql.append("\ninner join product_sys_message_user u on u.message_uuid=m.uuid and ifnull(u.read_type, 0)=? and u.user_id=? ").append(f); |
| | | sql.append("\norder by m.send_time desc"); |
| | | DataTableEntity dte = baseDao.listTable(sql.toString(), ps.toArray(), fse.getInteger(CmnConst.PAGESIZE), fse.getInteger(CmnConst.CPAGE)); |
| | | dte.getMeta().addAliasTable("product_sys_message", "m"); |
| | |
| | | * @return |
| | | */ |
| | | public DataTableEntity getTypeMessage(Object type,int read) { |
| | | |
| | | |
| | | ArrayList<Object> ps= new ArrayList<Object>(); |
| | | ps.add(SpringMVCContextHolder.getCurrentUserId()); |
| | | ps.add(read); |
| | |
| | | DataTableEntity dte = baseDao.listTable(sql.toString(),ps.toArray(),Integer.MAX_VALUE, 1); |
| | | return dte; |
| | | } |
| | | |
| | | |
| | | } |