ApiConstants.java 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  1. package cn.com.ty.lift.common.constants;
  2. /**
  3. * @author huangy
  4. * @date 2019-11-29
  5. * @description api常量
  6. */
  7. public class ApiConstants {
  8. /**
  9. * 处理结果 1:成功
  10. */
  11. public static final String RESULT_SUCCESS = "1";
  12. /**
  13. * 处理结果 0:失败
  14. */
  15. public static final String RESULT_ERROR = "0";
  16. /**
  17. * 没有数据 9:更新0件、没数据
  18. */
  19. public static final String RESULT_NO_DATA = "9";
  20. /**
  21. * 参数有误 2
  22. */
  23. public static final String RESULT_NO_PARAM = "2";
  24. /**
  25. * 程序异常
  26. */
  27. public static final String RESULT_EXCEPTION = "-1";
  28. /**
  29. * 当前用户
  30. */
  31. public static final String CURRENT_USER = "currentUser";
  32. /**
  33. * 当前用户id字段
  34. */
  35. public static final String CURRENT_USER_ID = "currentUserId";
  36. /**
  37. * 当前公司id
  38. */
  39. public static final String CURRENT_COMPANY_ID = "currentCompanyId";
  40. /**
  41. * 当前角色id
  42. */
  43. public static final String CURRENT_ROLE_ID = "currentRoleId";
  44. /**
  45. * 当前角色编码
  46. */
  47. public static final String CURRENT_ROLE_CODE = "currentRoleCode";
  48. /**
  49. * 当前权限路径
  50. */
  51. public static final String CURRENT_PERMISSION_URL = "currentPermissionUrl";
  52. /**
  53. * 当前用户类型
  54. */
  55. public static final String CURRENT_USER_TYPE = "currentUserType";
  56. /**
  57. * 访问类型 pc端访问
  58. */
  59. public static final int ACCESS_TYPE_PC = 0;
  60. /**
  61. * 访问类型 app端访问
  62. */
  63. public static final int ACCESS_TYPE_APP = 1;
  64. /**
  65. * 访问类型 公众号端访问
  66. */
  67. public static final int ACCESS_TYPE_PUBLIC = 2;
  68. /**
  69. * 访问类型 小程序端访问
  70. */
  71. public static final int ACCESS_TYPE_APPLETS = 3;
  72. /**
  73. * 已删除
  74. */
  75. public static final int DELETE_YES = 1;
  76. /**
  77. * 未删除
  78. */
  79. public static final int DELETE_NO = 0;
  80. /**
  81. * 菜单根节点父id
  82. */
  83. public static final Long ROOT_MENU_PARENT_ID = 0L;
  84. /**
  85. * 区域根节点父id
  86. */
  87. public static final String ROOT_AREA_PARENT_ID = "0";
  88. /**
  89. * 菜单父节点属性名
  90. */
  91. public static final String MENU_PARENT_ATTR = "parentId";
  92. /**
  93. * 区域
  94. */
  95. public static final String AREA_PARENT_ATTR = "parent";
  96. /**
  97. * 平台公司id
  98. */
  99. public static final Long PLATFORM_COMPANY_ID = 10086L;
  100. /**
  101. * 直梯
  102. */
  103. public static final String STRAIGHT_LADDER = "ZT";
  104. /**
  105. * 扶梯
  106. */
  107. public static final String STAIRCASE = "FT";
  108. /**
  109. * 用户常量
  110. */
  111. public interface UserConstants {
  112. /**
  113. * 超级管理员/平台管理员
  114. */
  115. int TYPE_SUPER_ADMIN = 0;
  116. /**
  117. * 平台管理员
  118. */
  119. int TYPE_PLATFORM_ADMIN = 1;
  120. /**
  121. * 企业管理员
  122. */
  123. int TYPE_ENTERPRISE_ADMIN = 2;
  124. /**
  125. * 普通用户
  126. */
  127. int TYPE_USER = 3;
  128. /**
  129. * 物管端用户
  130. */
  131. int PUBLIC_TYPE_USER = 4;
  132. /**
  133. * 专家标识-是
  134. */
  135. int IS_EXPERT = 1;
  136. /**
  137. * 专家表示否
  138. */
  139. int NOT_EXPERT = 0;
  140. /**
  141. * 验证码手机号
  142. */
  143. String SMS_CODE_MOBILE = "smsCodeMobile";
  144. /**
  145. * 用户手机号字段
  146. */
  147. String USER_INFO_MOBILE = "userInfoMobile";
  148. }
  149. /**
  150. * 企业常量
  151. */
  152. public interface CompanyConstants {
  153. /**
  154. * 未认证
  155. */
  156. int MAINTENANCE_NOT_CERTIFICATE = 0;
  157. /**
  158. * 已认证
  159. */
  160. int MAINTENANCE_PASS = 1;
  161. /**
  162. * 审核中
  163. */
  164. int MAINTENANCE_WAIT_CERTIFICATE = 2;
  165. /**
  166. * 认证失败
  167. */
  168. int MAINTENANCE_FAIL = 3;
  169. /**
  170. * 急修工-是
  171. */
  172. int REPAIR_YES = 1;
  173. /**
  174. * 急修工-否
  175. */
  176. int REPAIR_NO = 0;
  177. }
  178. /**
  179. * 申请常量
  180. */
  181. public interface ApplicationConstants {
  182. /**
  183. * 申请加入团队
  184. */
  185. int APPLY_TYPE_TEAM = 1;
  186. /**
  187. * 申请加入项目
  188. */
  189. int APPLY_TYPE_PROJECT = 2;
  190. /**
  191. * 用户认证通过
  192. */
  193. int APPLY_PASS = 1;
  194. /**
  195. * 用户待审核
  196. */
  197. int APPLY_WAIT = 2;
  198. /**
  199. * 用户审核不通过
  200. */
  201. int APPLY_FAIL = -1;
  202. }
  203. /**
  204. * 全局设置常量
  205. */
  206. public interface GlobalSetConstants {
  207. /**
  208. * 全局设置值:是
  209. */
  210. int VALUE_YES = 1;
  211. /**
  212. * 全局设置值:否
  213. */
  214. int VALUE_NO = 0;
  215. /**
  216. * 项目全局设置
  217. */
  218. int TYPE_PROJECT = 1;
  219. /**
  220. * 电梯保养全局设置
  221. */
  222. int TYPE_LIFT = 2;
  223. /**
  224. * 维保类型-维保工选择
  225. */
  226. int MT_WORK_CHOOSE = 1;
  227. /**
  228. * 维保类型-维保工文员选
  229. */
  230. int MT_CLERK_CHOOSE = 2;
  231. /**
  232. * 文员补录
  233. */
  234. int CLERK_ADD = 1;
  235. /**
  236. * 文员维保工均可补录
  237. */
  238. int CLERK_WORK_ADD = 2;
  239. /**
  240. * 项目组维保工是否能查看到项目的所有电梯,并接收该项目所有维保任务
  241. */
  242. String WORK_LIFT = "workLift";
  243. /**
  244. * 可同时签到保养的台量
  245. */
  246. String MT_SAME_UNITS = "sameUnits";
  247. /**
  248. * 维保类型选项
  249. */
  250. String MT_TYPE_OPTION = "typeOption";
  251. /**
  252. * 签退时,是否需要定位
  253. */
  254. String SIGN_OUT_LOCATE = "signLocate";
  255. /**
  256. * 保养单是否显示停梯时间和恢复时间
  257. */
  258. String SHOW_LIFT_TIME = "showTime";
  259. /**
  260. * 默认维保间隔
  261. */
  262. String MT_INTERVAL = "mtInterval";
  263. /**
  264. * 补录权限
  265. */
  266. String ADD_AUTHORITY = "addAuthority";
  267. }
  268. public interface DeviceModel {
  269. Integer Android = 1;
  270. Integer IOS = 2;
  271. Integer PC = 3;
  272. }
  273. public interface Faq {
  274. Integer TITLE_TYPE = 2;
  275. Integer ANSWER_TYPE = 3;
  276. }
  277. public interface Maintenance {
  278. Integer WAITING_MAINTENANCE = 0;//待保养
  279. Integer MAINTENANCE_DOING = 2;//保养中
  280. Integer COMPLETE = 1;//已完成
  281. Integer OVERDUE = -1;//超期
  282. Integer LAWS_STIPULATION_OVERDUE = 10;//自定义的法规超期,非数据库状态
  283. }
  284. //根据用户id和维保计划时间和状态查询用户那一天的各种类型维保任务(待保养/保养中/已完成/计划超期)
  285. public interface SQL {
  286. String QUERY_MAINTENANCE_PLAN_EVERYDAY =
  287. "select p.project_name projectName," +
  288. " l.registration_code registrationCode," +
  289. " l.device_position devicePosition," +
  290. " l.lift_type liftType," +
  291. " l.category category," +
  292. " ui.name workerName," +
  293. " mp.plan_date planDate" +
  294. " from maintenance_plan mp" +
  295. " left join lift l on mp.lift_id = l.id" +
  296. " left join user_info ui on mp.worker_id = ui.user_id" +
  297. " left join project p on mp.project_id = p.id" +
  298. " where mp.plan_date = #{planDate}" +
  299. " and mp.status = #{status}" +
  300. " and mp.project_id in (select project_id from project_user where user_id = #{userId})";
  301. String QUERY_MAINTENANCE_PLAN_EVERYDAY_OVERDUE =
  302. "select mp.status planStatus," +
  303. " l.id liftId," +
  304. " p.project_name projectName," +
  305. " l.registration_code registrationCode," +
  306. " l.device_position devicePosition," +
  307. " l.lift_type liftType," +
  308. " l.category category," +
  309. " ui.name name" +
  310. " from maintenance_plan mp" +
  311. " left join lift l on mp.lift_id = l.id" +
  312. " left join user_info ui on mp.worker_id = ui.user_id" +
  313. " left join project p on mp.project_id = p.id" +
  314. " where plan_date = #{planDate}" +
  315. " and TimeStampDiff(DAY, DATE_FORMAT(plan_date, '%Y%m%d'), DATE_FORMAT(work_date, '%Y%m%d')) > 15" +
  316. " and mp.project_id in (select project_id from project_user where user_id = #{userId})";
  317. //扫码,查询电梯信息
  318. String QUERY_LIFT_INFO_BY_LIFT_ID =
  319. "<script>" +
  320. "select l.id id," +
  321. " l.registration_code registrationCode," +
  322. " l.device_position devicePosition," +
  323. " p.project_name projectName," +
  324. " if(l.lift_type = 1, '直梯', '扶梯') liftType," +
  325. " ui.name workerName," +
  326. " ui.mobile workerMobile," +
  327. " p.project_status projectStatus" +
  328. " from project_lift_relevance plr" +
  329. " left join lift l on plr.lift_id = l.id" +
  330. " left join project p on plr.project_id = p.id" +
  331. " left join user_info ui on plr.worker_id = ui.user_id" +
  332. " where l.id = #{liftId}" +
  333. " and p.project_status = '2'" +
  334. "</script>";
  335. //扫码,查询维保记录列表
  336. String QUERY_MAINTENANCE_RECORD_BY_LIFT_ID =
  337. "select mr.id recordId," +
  338. " mr.plan_date planDate," +
  339. " mr.work_date workDate," +
  340. " ui.name workerName," +
  341. " mr.maintenance_advice maintenanceAdvice," +
  342. " e.advice consumerAdvice," +
  343. " mr.status status," +
  344. " mr.lift_id liftId," +
  345. " mr.lift_type liftType" +
  346. " from maintenance_record mr" +
  347. " left join user_info ui on mr.worker_id = ui.user_id" +
  348. " left join evaluation e on mr.id = e.record_id and e.source = '1'" +
  349. " where mr.lift_id = #{liftId}" +
  350. " order by mr.work_date desc";
  351. //物管,根据用户id和月份,查询那一月每天的(待保养/保养中/已完成/计划超期/法规超期)的数量
  352. String QUERY_MAINTENANCE_PLAN_MONTH_TASK_NUM =
  353. "select DATE_FORMAT(plan_date, '%d') day, status status, count(status) count" +
  354. " from maintenance_plan" +
  355. " where project_id in (select project_id from project_user where user_id = #{userId})" +
  356. " and DATE_FORMAT(plan_date, '%Y-%m') = #{yearMonth}" +
  357. " group by plan_date, status";
  358. }
  359. }