package com.ruoyi.common.constants;

import java.util.HashMap;
import java.util.Map;

public class WgzAndBgtMessageConstant {
	// 公共常量
	public static final  String USERTYPE_SYSTEM = "0"; //系统
	public static final  String USERTYPE_WGZ = "1"; //务工者
	public static final  String USERTYPE_BGT = "2";	//包工头

	public static final  String LARGE_APPLY = "0"; //大类型-报名
	public static final  String LARGE_SALARY = "1"; //大类型-工资
	public static final  String LARGE_OTHER = "2";	//大类型-其它
	public static final  String SMALL_CARD = "0"; //小类型-补卡
	public static final  String SMALL_SYSTEM = "1"; //小类型-系统


	/**
	 * =====================================================务工者=====================================================
	 * =====================================================务工者=====================================================
	 * =====================================================务工者=====================================================
	 */

	/**
	 * 系统给务工者提示
	 */
	//【报名申请】1-2
	public static final String WGZ_SYSTEM_HEADLINE_APPLY = "您已申请【%s】项目！";
	public static final String WGZ_SYSTEM_SUBHEADING_APPLY = "您已成功申请到【%s】项目,请耐心等待回复！";
	//【取消报名】3-4
	public static final String WGZ_SYSTEM_HEADLINE_APPLY_CANCEL = "您已申请取消【%s】项目！";
	public static final String WGZ_SYSTEM_SUBHEADING_APPLY_CANCEL = "您已成功取消【%s】项目,祝您早日找到心仪的工作！";
	//【拒绝报名】5-6
	public static final String WGZ_SYSTEM_HEADLINE_APPLY_REFUSE = "您已回拒【%s】项目！";
	public static final String WGZ_SYSTEM_SUBHEADING_APPLY_REFUSE = "您已成功拒绝【%s】项目,祝您早日找到心仪的工作！";
	//【确认报名】7-8
	public static final String WGZ_SYSTEM_HEADLINE_APPLY_AFFIRM = "您已成功进入【%s】项目！";
	public static final String WGZ_SYSTEM_SUBHEADING_APPLY_AFFIRM = "您已成功进入【%s】项目,祝你平平安安赚大钱！";
	//【补卡申请】9-10
	public static final String WGZ_SYSTEM_HEADLINE_REISSUEACARD = "您已申请了【%s】项目，【%s】的补卡操作！";
	public static final String WGZ_SYSTEM_SUBHEADING_REISSUEACARD = "您已成功发起了【%s】的补卡申请，请耐心等待回复！";
	//【工资结算】11-12
	public static final String WGZ_SYSTEM_HEADLINE_PAYCALCULATION = "您正在申请【%s】项目,为期【%s】天的工资结算操作！";
	public static final String WGZ_SYSTEM_SUBHEADING_PAYCALCULATION = "您已成功发起为期【%s】天，金额为【%s】的工资结算操作，请耐心等待回复！";
	/**
	 * 务工者给包工头提示
	 */
	//【报名】1-2
	public static final String WGZ_HEADLINE_APPLY = "务工者【%s】正在向你申请【%s】的岗位！";
	public static final String WGZ__SUBHEADING_APPLY = "务工者【%s】正在向你申请【%s】岗位，您可点击查看更多信息！";
	//【拒绝报名】3-4
	public static final String WGZ_HEADLINE_APPLY_REFUSE = "务工者【%s】已委婉的回拒了您提供的【%s】岗位！";
	public static final String WGZ__SUBHEADING_APPLY_REFUSE = "务工者【%s】已委婉的回拒了您提供的【%s】岗位，并祝你做大做强！";
	//【确认报名】5-6
	public static final String WGZ_HEADLINE_APPLY_AFFIRM = "务工者【%s】已成功加入了您团队！";
	public static final String WGZ__SUBHEADING_APPLY_AFFIRM = "务工者【%s】已同意进入了您提供的【%s】岗位！";
	//【补卡申请】7-8
	public static final String WGZ_HEADLINE_REISSUEACARD = "务工者【%s】正在向你发起补卡申请！";
	public static final String WGZ__SUBHEADING_REISSUEACARD = "务工者【%s】向你发起【%s】的补卡申请操作！";
	//【工资结算】9-10
	public static final String WGZ_HEADLINE_PAYCALCULATION = "务工者【%s】正在向你发起工资结算！";
	public static final String WGZ__SUBHEADING_PAYCALCULATION = "务工者【%s】向你发起为期【%s】天，金额为【%s】圆整的工资结算操作！";

	//务工者消息返回
	public static String wgzMessage(Map<String, String> mp, String type) {
		switch (type){
			//系统申请报名提示
			case "101":
				return String.format(WGZ_SYSTEM_HEADLINE_APPLY, mp.get("projectName"));
			case "102":
				return String.format(WGZ_SYSTEM_SUBHEADING_APPLY, mp.get("projectName"));
			//系统取消报名提示
			case "103":
				return String.format(WGZ_SYSTEM_HEADLINE_APPLY_CANCEL, mp.get("projectName"));
			case "104":
				return String.format(WGZ_SYSTEM_SUBHEADING_APPLY_CANCEL, mp.get("projectName"));
			//系统拒绝报名提示
			case "105":
				return String.format(WGZ_SYSTEM_HEADLINE_APPLY_REFUSE, mp.get("projectName"));
			case "106":
				return String.format(WGZ_SYSTEM_SUBHEADING_APPLY_REFUSE, mp.get("projectName"));
			//系统确认报名提示
			case "107":
				return String.format(WGZ_SYSTEM_HEADLINE_APPLY_AFFIRM, mp.get("projectName"));
			case "108":
				return String.format(WGZ_SYSTEM_SUBHEADING_APPLY_AFFIRM, mp.get("projectName"));
			//系统补卡申请提示
			case "109":
				return String.format(WGZ_SYSTEM_HEADLINE_REISSUEACARD, mp.get("projectName"),mp.get("data"));
			case "110":
				return String.format(WGZ_SYSTEM_SUBHEADING_REISSUEACARD, mp.get("projectName"));
			//系统工资结算申请提示
			case "111":
				return String.format(WGZ_SYSTEM_HEADLINE_PAYCALCULATION,mp.get("projectName"), mp.get("num"));
			case "112":
				return String.format(WGZ_SYSTEM_SUBHEADING_PAYCALCULATION, mp.get("num"),mp.get("money"));
			//务工者向包工头申请报名
			case "201":
				return String.format(WGZ_HEADLINE_APPLY, mp.get("userName"), mp.get("post"));
			case "202":
				return String.format(WGZ__SUBHEADING_APPLY, mp.get("userName"),mp.get("post"));
			//务工者向包工头拒绝报名
			case "203":
				return String.format(WGZ_HEADLINE_APPLY_REFUSE, mp.get("userName"), mp.get("post"));
			case "204":
				return String.format(WGZ__SUBHEADING_APPLY_REFUSE, mp.get("userName"),mp.get("post"));
			//务工者向包工头确认报名
			case "205":
				return String.format(WGZ_HEADLINE_APPLY_AFFIRM, mp.get("userName"));
			case "206":
				return String.format(WGZ__SUBHEADING_APPLY_AFFIRM, mp.get("userName"),mp.get("post"));
			//务工者向包工头发起补卡申请
			case "207":
				return String.format(WGZ_HEADLINE_REISSUEACARD, mp.get("userName"));
			case "208":
				return String.format(WGZ__SUBHEADING_REISSUEACARD, mp.get("userName"),mp.get("data"));
			//务工者向包工头发起工资结算
			case "209":
				return String.format(WGZ_HEADLINE_PAYCALCULATION, mp.get("userName"));
			case "210":
				return String.format(WGZ__SUBHEADING_PAYCALCULATION, mp.get("userName"),mp.get("num"),mp.get("money"));
			default:
				return "未知类型";
		}
	}



	/**
	 * =====================================================包工头=====================================================
	 * =====================================================包工头=====================================================
	 * =====================================================包工头=====================================================
	 */

	//模板
	public static final String BGT_SIGN_UP_APPLY_HEADLINE = "您申请的【%s】项目，已得到回复！";
	public static final String BGT_SIGN_UP_APPLY_SUBHEADING = "您申请的【%s】项目,审核人【%s】已%s！";
	public static final String BGT_PAY_APPLY_HEADLINE = "您【%s】项目工资申请已审批！";
	public static final String BGT_PAY_APPLY_SUBHEADING = "您申请的【%s】项目工资,审核人【%s】已%s！";
	public static final String BGT_LEAVE_APPLY_HEADLINE = "您【%s】项目的请假申请已审批！";
	public static final String BGT_LEAVE_APPLY_SUBHEADING = "您【%s】项目的请假申请,审核人【%s】已%s！";
	public static final String BGT_LEAVE_MAKE_UP_HEADLINE = "您【%s】项目的补卡申请已审批！";
	public static final String BGT_LEAVE_MAKE_UP_SUBHEADING = "您【%s】项目的补卡申请,审核人【%s】已%s！";
	public static final String BGT_LEAVE_EXIT_HEADLINE = "您已从【%s】项目退场！";
	public static final String BGT_LEAVE_EXIT_SUBHEADING_ONE = "您已被【%s】指定从【%s】项目退场！";
	public static final String BGT_LEAVE_EXIT_SUBHEADING_TWO = "【%s】项目已完结，自动退场！";

	//主副标志
	public static final String HEADLINE = "headline";          //主标题
	public static final String SUBHEADING = "subheading";      //副标题

	//消息类型
	public static final String BGT_LARGE = "3";    //大类型固定为3
	public static final String BGT_TYPE_SIGN_UP = "1";    //务工者报名
	public static final String BGT_TYPE_PAY = "2";        //付款
	public static final String BGT_TYPE_LEAVE = "3";      //请假
	public static final String BGT_TYPE_MAKE_UP = "4";    //补卡
	public static final String BGT_TYPE_EXIT = "5";       //退场

	//包工头消息返回
	public static Map<String,String> bgtMessage(Map<String, String> mp, String type,Boolean isPass) {
		Map<String, String> map = new HashMap<>();
		String pass = isPass ? "通过" : "拒绝";
		String projectName = mp.get("projectName");
		String auditor = mp.get("auditor");
		switch (type){
			case "1":
				map.put(HEADLINE, String.format(BGT_SIGN_UP_APPLY_HEADLINE, projectName));
				map.put(SUBHEADING, String.format(BGT_SIGN_UP_APPLY_SUBHEADING, projectName,auditor,pass));
				break;
			case "2":
				map.put(HEADLINE, String.format(BGT_PAY_APPLY_HEADLINE, projectName));
				map.put(SUBHEADING, String.format(BGT_PAY_APPLY_SUBHEADING, projectName,auditor,pass));
				break;
			case "3":
				map.put(HEADLINE, String.format(BGT_LEAVE_APPLY_HEADLINE, projectName));
				map.put(SUBHEADING, String.format(BGT_LEAVE_APPLY_SUBHEADING, projectName,auditor,pass));
				break;
			case "4":
				map.put(HEADLINE, String.format(BGT_LEAVE_MAKE_UP_HEADLINE, projectName));
				map.put(SUBHEADING, String.format(BGT_LEAVE_MAKE_UP_SUBHEADING, projectName,auditor,pass));
				break;
			case "5":
				map.put(HEADLINE, String.format(BGT_LEAVE_EXIT_HEADLINE, projectName));
				if(isPass){
					map.put(SUBHEADING, String.format(BGT_LEAVE_EXIT_SUBHEADING_ONE, auditor,projectName));
				}else {
					map.put(SUBHEADING, String.format(BGT_LEAVE_EXIT_SUBHEADING_TWO, projectName));
				}
				break;
			default:
				break;
		}
		return map;
	}



}
