123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- package cn.com.ty.lift.common.constants;
- /**
- * @author huangy
- * @date 2019-11-29
- * @description api常量
- */
- public class ApiConstants {
- /**
- * 处理结果 1:成功
- */
- public static final String RESULT_SUCCESS = "1";
- /**
- * 处理结果 0:失败
- */
- public static final String RESULT_ERROR = "0";
- /**
- * 没有数据 9:更新0件、没数据
- */
- public static final String RESULT_NO_DATA = "9";
- /**
- * 参数有误 2
- */
- public static final String RESULT_NO_PARAM = "2";
- /**
- * 程序异常
- */
- public static final String RESULT_EXCEPTION = "-1";
- /**
- * 当前用户
- */
- public static final String CURRENT_USER = "currentUser";
- /**
- * 当前用户id字段
- */
- public static final String CURRENT_USER_ID = "currentUserId";
- /**
- * 当前公司id
- */
- public static final String CURRENT_COMPANY_ID = "currentCompanyId";
- /**
- * 当前角色id
- */
- public static final String CURRENT_ROLE_ID = "currentRoleId";
- /**
- * 当前角色编码
- */
- public static final String CURRENT_ROLE_CODE = "currentRoleCode";
- /**
- * 当前权限路径
- */
- public static final String CURRENT_PERMISSION_URL = "currentPermissionUrl";
- /**
- * 当前用户类型
- */
- public static final String CURRENT_USER_TYPE = "currentUserType";
- /**
- * 访问类型 pc端访问
- */
- public static final int ACCESS_TYPE_PC = 0;
- /**
- * 访问类型 app端访问
- */
- public static final int ACCESS_TYPE_APP = 1;
- /**
- * 访问类型 公众号端访问
- */
- public static final int ACCESS_TYPE_PUBLIC = 2;
- /**
- * 访问类型 小程序端访问
- */
- public static final int ACCESS_TYPE_APPLETS = 3;
- /**
- * 已删除
- */
- public static final int DELETE_YES = 1;
- /**
- * 未删除
- */
- public static final int DELETE_NO = 0;
- /**
- * 菜单根节点父id
- */
- public static final Long ROOT_MENU_PARENT_ID = 0L;
- /**
- * 区域根节点父id
- */
- public static final String ROOT_AREA_PARENT_ID = "0";
- /**
- * 菜单父节点属性名
- */
- public static final String MENU_PARENT_ATTR = "parentId";
- /**
- * 区域
- */
- public static final String AREA_PARENT_ATTR = "parent";
- /**
- * 平台公司id
- */
- public static final Long PLATFORM_COMPANY_ID = 10086L;
- /**
- * 直梯
- */
- public static final String STRAIGHT_LADDER = "ZT";
- /**
- * 扶梯
- */
- public static final String STAIRCASE = "FT";
- /**
- * 用户常量
- */
- public interface UserConstants {
- /**
- * 超级管理员/平台管理员
- */
- int TYPE_SUPER_ADMIN = 0;
- /**
- * 平台管理员
- */
- int TYPE_PLATFORM_ADMIN = 1;
- /**
- * 企业管理员
- */
- int TYPE_ENTERPRISE_ADMIN = 2;
- /**
- * 普通用户
- */
- int TYPE_USER = 3;
- /**
- * 物管端用户
- */
- int PUBLIC_TYPE_USER = 4;
- /**
- * 专家标识-是
- */
- int IS_EXPERT = 1;
- /**
- * 专家表示否
- */
- int NOT_EXPERT = 0;
- /**
- * 验证码手机号
- */
- String SMS_CODE_MOBILE = "smsCodeMobile";
- /**
- * 用户手机号字段
- */
- String USER_INFO_MOBILE = "userInfoMobile";
- }
- /**
- * 企业常量
- */
- public interface CompanyConstants {
- /**
- * 未认证
- */
- int MAINTENANCE_NOT_CERTIFICATE = 0;
- /**
- * 已认证
- */
- int MAINTENANCE_PASS = 1;
- /**
- * 审核中
- */
- int MAINTENANCE_WAIT_CERTIFICATE = 2;
- /**
- * 认证失败
- */
- int MAINTENANCE_FAIL = 3;
- /**
- * 急修工-是
- */
- int REPAIR_YES = 1;
- /**
- * 急修工-否
- */
- int REPAIR_NO = 0;
- }
- /**
- * 申请常量
- */
- public interface ApplicationConstants {
- /**
- * 申请加入团队
- */
- int APPLY_TYPE_TEAM = 1;
- /**
- * 申请加入项目
- */
- int APPLY_TYPE_PROJECT = 2;
- /**
- * 用户认证通过
- */
- int APPLY_PASS = 1;
- /**
- * 用户待审核
- */
- int APPLY_WAIT = 2;
- /**
- * 用户审核不通过
- */
- int APPLY_FAIL = -1;
- }
- /**
- * 全局设置常量
- */
- public interface GlobalSetConstants {
- /**
- * 全局设置值:是
- */
- int VALUE_YES = 1;
- /**
- * 全局设置值:否
- */
- int VALUE_NO = 0;
- /**
- * 项目全局设置
- */
- int TYPE_PROJECT = 1;
- /**
- * 电梯保养全局设置
- */
- int TYPE_LIFT = 2;
- /**
- * 维保类型-维保工选择
- */
- int MT_WORK_CHOOSE = 1;
- /**
- * 维保类型-维保工文员选
- */
- int MT_CLERK_CHOOSE = 2;
- /**
- * 文员补录
- */
- int CLERK_ADD = 1;
- /**
- * 文员维保工均可补录
- */
- int CLERK_WORK_ADD = 2;
- /**
- * 项目组维保工是否能查看到项目的所有电梯,并接收该项目所有维保任务
- */
- String WORK_LIFT = "workLift";
- /**
- * 可同时签到保养的台量
- */
- String MT_SAME_UNITS = "sameUnits";
- /**
- * 维保类型选项
- */
- String MT_TYPE_OPTION = "typeOption";
- /**
- * 签退时,是否需要定位
- */
- String SIGN_OUT_LOCATE = "signLocate";
- /**
- * 保养单是否显示停梯时间和恢复时间
- */
- String SHOW_LIFT_TIME = "showTime";
- /**
- * 默认维保间隔
- */
- String MT_INTERVAL = "mtInterval";
- /**
- * 补录权限
- */
- String ADD_AUTHORITY = "addAuthority";
- }
- public interface DeviceModel {
- Integer Android = 1;
- Integer IOS = 2;
- Integer PC = 3;
- }
- public interface Faq {
- Integer TITLE_TYPE = 2;
- Integer ANSWER_TYPE = 3;
- }
- public interface Maintenance {
- Integer WAITING_MAINTENANCE = 0;//待保养
- Integer MAINTENANCE_DOING = 2;//保养中
- Integer COMPLETE = 1;//已完成
- Integer OVERDUE = -1;//超期
- Integer LAWS_STIPULATION_OVERDUE = 10;//自定义的法规超期,非数据库状态
- }
- //根据用户id和维保计划时间和状态查询用户那一天的各种类型维保任务(待保养/保养中/已完成/计划超期)
- public interface SQL {
- String QUERY_MAINTENANCE_PLAN_EVERYDAY =
- "select p.project_name projectName," +
- " l.registration_code registrationCode," +
- " l.device_position devicePosition," +
- " l.lift_type liftType," +
- " l.category category," +
- " ui.name workerName," +
- " mp.plan_date planDate" +
- " from maintenance_plan mp" +
- " left join lift l on mp.lift_id = l.id" +
- " left join user_info ui on mp.worker_id = ui.user_id" +
- " left join project p on mp.project_id = p.id" +
- " where mp.plan_date = #{planDate}" +
- " and mp.status = #{status}" +
- " and mp.project_id in (select project_id from project_user where user_id = #{userId})";
- String QUERY_MAINTENANCE_PLAN_EVERYDAY_OVERDUE =
- "select mp.status planStatus," +
- " l.id liftId," +
- " p.project_name projectName," +
- " l.registration_code registrationCode," +
- " l.device_position devicePosition," +
- " l.lift_type liftType," +
- " l.category category," +
- " ui.name name" +
- " from maintenance_plan mp" +
- " left join lift l on mp.lift_id = l.id" +
- " left join user_info ui on mp.worker_id = ui.user_id" +
- " left join project p on mp.project_id = p.id" +
- " where plan_date = #{planDate}" +
- " and TimeStampDiff(DAY, DATE_FORMAT(plan_date, '%Y%m%d'), DATE_FORMAT(work_date, '%Y%m%d')) > 15" +
- " and mp.project_id in (select project_id from project_user where user_id = #{userId})";
- //扫码,查询电梯信息
- String QUERY_LIFT_INFO_BY_LIFT_ID =
- "<script>" +
- "select l.id id," +
- " l.registration_code registrationCode," +
- " l.device_position devicePosition," +
- " p.project_name projectName," +
- " if(l.lift_type = 1, '直梯', '扶梯') liftType," +
- " ui.name workerName," +
- " ui.mobile workerMobile," +
- " p.project_status projectStatus" +
- " from project_lift_relevance plr" +
- " left join lift l on plr.lift_id = l.id" +
- " left join project p on plr.project_id = p.id" +
- " left join user_info ui on plr.worker_id = ui.user_id" +
- " where l.id = #{liftId}" +
- " and p.project_status = '2'" +
- "</script>";
- //扫码,查询维保记录列表
- String QUERY_MAINTENANCE_RECORD_BY_LIFT_ID =
- "select mr.id recordId," +
- " mr.plan_date planDate," +
- " mr.work_date workDate," +
- " ui.name workerName," +
- " mr.maintenance_advice maintenanceAdvice," +
- " e.advice consumerAdvice," +
- " mr.status status," +
- " mr.lift_id liftId," +
- " mr.lift_type liftType" +
- " from maintenance_record mr" +
- " left join user_info ui on mr.worker_id = ui.user_id" +
- " left join evaluation e on mr.id = e.record_id and e.source = '1'" +
- " where mr.lift_id = #{liftId}" +
- " order by mr.work_date desc";
- //物管,根据用户id和月份,查询那一月每天的(待保养/保养中/已完成/计划超期/法规超期)的数量
- String QUERY_MAINTENANCE_PLAN_MONTH_TASK_NUM =
- "select DATE_FORMAT(plan_date, '%d') day, status status, count(status) count" +
- " from maintenance_plan" +
- " where project_id in (select project_id from project_user where user_id = #{userId})" +
- " and DATE_FORMAT(plan_date, '%Y-%m') = #{yearMonth}" +
- " group by plan_date, status";
- }
- }
|