package com.qunzhixinxi.hnqz.admin;

import cn.hutool.json.JSONUtil;
import com.qunzhixinxi.hnqz.admin.entity.dto.EncryptedInput;
import com.qunzhixinxi.hnqz.admin.entity.dto.ExecSettlementDTO;
import com.qunzhixinxi.hnqz.admin.entity.dto.PickUpScorePackageDTO;
import com.qunzhixinxi.hnqz.admin.entity.dto.ScorePackageDTO;
import com.qunzhixinxi.hnqz.admin.entity.dto.ScorePackageSettleNoteDTO;
import com.qunzhixinxi.hnqz.admin.entity.dto.SettlementDTO;
import com.qunzhixinxi.hnqz.admin.entity.dto.TaxHelperAddMemberDTO;
import com.qunzhixinxi.hnqz.admin.entity.input.Record;
import com.qunzhixinxi.hnqz.admin.entity.input.TaskSettleBatch;
import com.qunzhixinxi.hnqz.admin.entity.input.TaskSettleInfo;
import com.qunzhixinxi.hnqz.admin.enums.ChannelEnum;
import com.qunzhixinxi.hnqz.admin.util.AESUtils;
import com.qunzhixinxi.hnqz.admin.util.RSAUtils;
import org.apache.commons.lang3.RandomStringUtils;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import javax.crypto.BadPaddingException;
import javax.crypto.IllegalBlockSizeException;
import javax.crypto.NoSuchPaddingException;
import java.io.UnsupportedEncodingException;
import java.security.InvalidKeyException;
import java.security.NoSuchAlgorithmException;
import java.security.NoSuchProviderException;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

@RunWith(SpringRunner.class)
@SpringBootTest
public class Test {

	private final String passwd = "123456";
	private final String serPublicKey = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAieuu+wKF1OqGYxNixsbf+4/1ZAnQ/0Z3zGTcXBY0RLg1rX8dr74htkL35T3XVZ2KRK+tjyLGASjHfDHCvnB9JY7/xZ0RcuTIoeFnULBQhq+ZUtOQgMqqjXUFP5lFlc97ClBGJHwloBWmdXonEHT00zlUeGXhc1a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gRknV44kkBsyK0t9D75yPkWUAIIAf56mkUnD6jTWa5do72CA64aRNgFIdzIDCW9tlzjqJJDYq2PVb3tvK+knn4aNjiTLdmnWnqO4ECoUMkX2Z3s0c5GPjY7eJaqPyYve4vECQkQicIqwaRwKBgDlyDsEx1tD7JzRAOEWtPGqmj3/SZGe4LdTUEIQjVbukq8z6YmzI/w2nBjH+iAYumwn62E2TvNfk5lgt4h+r87d9tprCAn83I4wMcEFFD/yAU1U8zhYmBJpkayiszcxsjntq4oDSBOm96NlZn4aur9GZYlRzojKfc0XofOgSczVFAoGAR/9O7Px4Jw53j+HLOcqoiKIyxwjtOBGGyDaanvAE+zeeH1zgtFwb+8CUaLdvhlgCk+JuYKgZ77LaTkgJTUjwgrW+BFkQqD+ObyEwvGZXGwFzTzJzp1mt0s4JYs7xZV0GufzUvVr8AtSY6BdWwu9NsF9+cv/xrG9+Jsk2KHBI2cUCgYBydvaydBd7b7Jp0k8ZgzHo4oYySmOGlAQLXnkcxAILagmXcbRvffAQIgDlogoAufyBFlPuaM6CNlgHeSoYuEYxgeHViE/bxB5hhoioPqHaJD+XqXRs/zYtp969HrJETtnU4Sbnr4Vexyos3VYglDhcD/I6mRll3jFfhhqPrnbVzw==";
	private final String signkey = "KugNsCL0vvhnsh0xYhj2Kba3U7qcaHe1";

	// 创建积分包
	@org.junit.Test
	public void test1() throws Exception {

		ScorePackageDTO scorePackageDTO = new ScorePackageDTO();
		scorePackageDTO.setDeptId(1611890620);
		scorePackageDTO.setName("挂号单号:" + RandomStringUtils.randomAlphabetic(16));
		scorePackageDTO.setMemberAmount(1);
		scorePackageDTO.setChannel(ChannelEnum.TAX_HELPER);
		scorePackageDTO.setToType(4);
		scorePackageDTO.setTaskType(32);
		scorePackageDTO.setPackageType(5);
		scorePackageDTO.setPackageCategory(2);
		scorePackageDTO.setPickUpScope(1);
		scorePackageDTO.setDescription("15715700008");
		String info = JSONUtil.toJsonStr(scorePackageDTO);

		String encrypt = AESUtils.encrypt(info, passwd);
		String ePwd = RSAUtils.encrypt(passwd,serPublicKey);
		String edigest = RSAUtils.sign(signkey,cliPrivateKey);
		System.out.println("加密信息："+encrypt);
		System.out.println("加密密码："+ePwd);
		System.out.println("摘要："+edigest);

		EncryptedInput input = new EncryptedInput();
		input.setAppId("1611890620");
		input.setCharset("UTF-8");
		input.setFormat("JSON");
		input.setEncryptedInfo(encrypt);
		input.setPassword(ePwd);
		input.setDigest(edigest);
		input.setSignType("RSA");
		input.setTimestamp(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));

		String json = JSONUtil.toJsonStr(input);
		System.out.println(json);
	}

	// 接收包
	@org.junit.Test
	public void test2() throws Exception {

		PickUpScorePackageDTO pickUpScorePackageDTO = new PickUpScorePackageDTO();
		pickUpScorePackageDTO.setDeptId(1611890620);
		pickUpScorePackageDTO.setUsername("15715700008");
		pickUpScorePackageDTO.setPackageId(1689);
		String info = JSONUtil.toJsonStr(pickUpScorePackageDTO);

		String encrypt = AESUtils.encrypt(info, passwd);
		String ePwd = RSAUtils.encrypt(passwd,serPublicKey);
		String edigest = RSAUtils.sign(signkey,cliPrivateKey);
		System.out.println("加密信息："+encrypt);
		System.out.println("加密密码："+ePwd);
		System.out.println("摘要："+edigest);

		EncryptedInput input = new EncryptedInput();
		input.setAppId("1611890620");
		input.setCharset("UTF-8");
		input.setFormat("JSON");
		input.setEncryptedInfo(encrypt);
		input.setPassword(ePwd);
		input.setDigest(edigest);
		input.setSignType("RSA");
		input.setTimestamp(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));

		String json = JSONUtil.toJsonStr(input);
		System.out.println(json);
	}

	// 上传证据链
	@org.junit.Test
	public void test3() throws Exception {

		TaskSettleBatch taskSettleBatch = new TaskSettleBatch();
		taskSettleBatch.setPackageId(1689);
		taskSettleBatch.setScorePackageStatusId(1313);
		taskSettleBatch.setDeptId(1611890620);
		List<TaskSettleInfo> taskSettleInfoList = new ArrayList<>();
		TaskSettleInfo t1 =new TaskSettleInfo();
		t1.setMobile("15715700008");
		t1.setMemberName("测试8");
		Record record1 = new Record();
		record1.setTemp1(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp2(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp3(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp4(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp5("100.45");
		record1.setTemp6(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp7(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp9(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp8(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp10(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp11(RandomStringUtils.randomAlphanumeric(8));
		record1.setTemp12(RandomStringUtils.randomAlphanumeric(8));
		Record.RecordExt ext1 = new Record.RecordExt();
		ext1.setProjectSn(record1.getTemp3());
		ext1.setAmount("100.45");
		ext1.setInvoiceType(12);
		ext1.setInvoiceCategory("健康咨询服务费");
		record1.setRecordExt(ext1);

		Record record2 = new Record();
		record2.setTemp1(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp2(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp3(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp4(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp5("110.45");
		record2.setTemp6(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp7(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp9(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp8(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp10(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp11(RandomStringUtils.randomAlphanumeric(8));
		record2.setTemp12(RandomStringUtils.randomAlphanumeric(8));
		Record.RecordExt ext2 = new Record.RecordExt();
		ext2.setProjectSn(record2.getTemp3());
		ext2.setAmount("110.45");
		ext2.setInvoiceType(12);
		ext2.setInvoiceCategory("健康咨询服务费");
		record2.setRecordExt(ext2);
		List<Record> records = new ArrayList<>();
		records.add(record1);
		records.add(record2);

		t1.setRecordList(records);
		taskSettleInfoList.add(t1);

		taskSettleBatch.setTaskSettleInfoList(taskSettleInfoList);


		String info = JSONUtil.toJsonStr(taskSettleBatch);

		// 上传证据链
		// String info = "{\"packageId\":1673,\"scorePackageStatusId\":1301,\"deptId\":1611890620,\"taskSettleInfoList\":[{\"mobile\":\"15715700008\",\"memberName\":\"测试8\",\"recordList\":[{\"recordExt\":{\"projectSn\":\"12345667\",\"invoiceName\":\"专业技术服务\",\"amount\":2000},\"temp1\":\"222121\",\"temp2\":\"111121\",\"temp3\":\"10101\",\"temp4\":\"999\",\"temp5\":\"888\",\"temp6\":\"777\",\"temp7\":\"666\",\"temp8\":\"555\",\"temp9\":\"444\",\"temp10\":\"3333\",\"temp11\":\"2222\",\"temp12\":\"1111\"},{\"recordExt\":{\"projectSn\":\"12345668\",\"invoiceName\":\"专业技术服务\",\"amount\":3000},\"temp1\":\"222a121\",\"temp2\":\"11a1121\",\"temp3\":\"10a101\",\"temp4\":\"9a99\",\"temp5\":\"8a88\",\"temp6\":\"77a7\",\"temp7\":\"66a6\",\"temp8\":\"5a55\",\"temp9\":\"44a4\",\"temp10\":\"3a333\",\"temp11\":\"22a22\",\"temp12\":\"111a1\"}]}]}";
		// String info = "{\"scorePackageStatusId\":\"1291\",\"taskSettleInfoList\":[{\"recordList\":[{\"temp11\":\"总剂量: 1剂。每天1剂。一剂1次。\",\"temp12\":\"没有补充\",\"temp13\":\"中药剂型\",\"temp10\":[{\"drug_name\":\"艾叶\",\"num\":\"3g\"},{\"drug_name\":\"浙贝母\",\"num\":\"33g\"},{\"drug_name\":\"白芷\",\"num\":\"8g\"},{\"drug_name\":\"制川乌\",\"num\":\"2g\"}],\"recordExt\":{\"amount\":236,\"invoiceName\":\"营销服务费\",\"projectSn\":\"1663\"},\"temp2\":\"刘荣华\",\"temp3\":\"WW1623913541770e0e65cdc11e8\",\"temp1\":\"问问一天\",\"temp6\":\"测试\",\"temp7\":\"无\",\"temp4\":\"2021-06-10 10:00:50\",\"temp5\":\"2.36\",\"temp8\":\"董莉\",\"temp9\":\"好护士\"}],\"mobile\":\"18020504691\",\"memberName\":\"问问一天\"}],\"packageId\":\"1663\",\"deptId\":1611890620}";
		// 预结算
		// String info = "{\"mobile\":\"15715700008\",\"deptId\":1611890620,\"packageId\":1673,\"settleNoteId\":453,\"channel\":\"TAX_HELPER\",\"invoiceType\":\"2\",\"invoiceCategory\":\"专业技术服务\",\"taskId\":0,\"amount\":3000}";
		// 结算
		// String info = "{\"deptId\":\"1611890620\",\"mobile\":\"15715700008\",\"packageId\":\"1646\",\"settlementDTOList\":[{\"taskId\":0,\"settleNoteId\":436,\"amount\":2000}],\"amount\":2000,\"subjectType\":\"1\"}";
		// String info = "{\"deptId\":\"1611890620\",\"mobile\":\"15715700008\",\"packageId\":\"1673\",\"settlementDTOList\":[{\"taskId\":0,\"settleNoteId\":452,\"amount\":2000},{\"taskId\":0,\"settleNoteId\":453,\"amount\":3000}],\"amount\":5000,\"subjectType\":\"1\"}";
		String encrypt = AESUtils.encrypt(info, passwd);
		String ePwd = RSAUtils.encrypt(passwd,serPublicKey);
		String edigest = RSAUtils.sign(signkey,cliPrivateKey);
		System.out.println("加密信息："+encrypt);
		System.out.println("加密密码："+ePwd);
		System.out.println("摘要："+edigest);

		EncryptedInput input = new EncryptedInput();
		input.setAppId("1611890620");
		input.setCharset("UTF-8");
		input.setFormat("JSON");
		input.setEncryptedInfo(encrypt);
		input.setPassword(ePwd);
		input.setDigest(edigest);
		input.setSignType("RSA");
		input.setTimestamp(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));

		String json = JSONUtil.toJsonStr(input);
		System.out.println(json);
	}

	// 预结算
	@org.junit.Test
	public void test4() throws Exception {
		ScorePackageSettleNoteDTO scorePackageSettleNoteDTO = new ScorePackageSettleNoteDTO();
		scorePackageSettleNoteDTO.setPackageId(1689);
		scorePackageSettleNoteDTO.setAmount("110.45");
		scorePackageSettleNoteDTO.setChannel(ChannelEnum.TAX_HELPER);
		scorePackageSettleNoteDTO.setSettleNoteId(458);
		scorePackageSettleNoteDTO.setTaskId(152972);
		scorePackageSettleNoteDTO.setInvoiceType(12);
		scorePackageSettleNoteDTO.setDeptId(1611890620);
		scorePackageSettleNoteDTO.setMobile("15715700008");
		scorePackageSettleNoteDTO.setInvoiceCategory("健康服务咨询费");
		String info = JSONUtil.toJsonStr(scorePackageSettleNoteDTO);

		String encrypt = AESUtils.encrypt(info, passwd);
		String ePwd = RSAUtils.encrypt(passwd,serPublicKey);
		String edigest = RSAUtils.sign(signkey,cliPrivateKey);
		System.out.println("加密信息："+encrypt);
		System.out.println("加密密码："+ePwd);
		System.out.println("摘要："+edigest);

		EncryptedInput input = new EncryptedInput();
		input.setAppId("1611890620");
		input.setCharset("UTF-8");
		input.setFormat("JSON");
		input.setEncryptedInfo(encrypt);
		input.setPassword(ePwd);
		input.setDigest(edigest);
		input.setSignType("RSA");
		input.setTimestamp(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));

		String json = JSONUtil.toJsonStr(input);
		System.out.println(json);
	}

	// 结算结算
	@org.junit.Test
	public void test5() throws Exception {
		ExecSettlementDTO execSettlementDTO = new ExecSettlementDTO();
		execSettlementDTO.setAmount("210.90");
		execSettlementDTO.setPackageId(1689);
		execSettlementDTO.setDeptId(1611890620);
		execSettlementDTO.setSubjectType("1");
		execSettlementDTO.setMobile("15715700008");
		SettlementDTO settlementDTO1 = new SettlementDTO();
		settlementDTO1.setAmount("100.45");
		settlementDTO1.setTaskId(152972);
		settlementDTO1.setSettleNoteId(457);
		SettlementDTO settlementDTO2 = new SettlementDTO();
		settlementDTO2.setAmount("110.45");
		settlementDTO2.setTaskId(152973);
		settlementDTO2.setSettleNoteId(458);
		execSettlementDTO.setSettlementDTOList(Arrays.asList(settlementDTO1,settlementDTO2));
		String info = JSONUtil.toJsonStr(execSettlementDTO);

		String encrypt = AESUtils.encrypt(info, passwd);
		String ePwd = RSAUtils.encrypt(passwd,serPublicKey);
		String edigest = RSAUtils.sign(signkey,cliPrivateKey);
		System.out.println("加密信息："+encrypt);
		System.out.println("加密密码："+ePwd);
		System.out.println("摘要："+edigest);

		EncryptedInput input = new EncryptedInput();
		input.setAppId("1611890620");
		input.setCharset("UTF-8");
		input.setFormat("JSON");
		input.setEncryptedInfo(encrypt);
		input.setPassword(ePwd);
		input.setDigest(edigest);
		input.setSignType("RSA");
		input.setTimestamp(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));

		String json = JSONUtil.toJsonStr(input);
		System.out.println(json);
	}

	@org.junit.Test
	public void test6() throws Exception{
		TaxHelperAddMemberDTO taxHelperAddMemberDTO = new TaxHelperAddMemberDTO();
		taxHelperAddMemberDTO.setIdNumber("360502198206216415");
		taxHelperAddMemberDTO.setDeptId(1611890620);
		taxHelperAddMemberDTO.setType(12);
		taxHelperAddMemberDTO.setUsername("15715700010");

		String info = JSONUtil.toJsonStr(taxHelperAddMemberDTO);

		String encrypt = AESUtils.encrypt(info, passwd);
		String ePwd = RSAUtils.encrypt(passwd,serPublicKey);
		String edigest = RSAUtils.sign(signkey,cliPrivateKey);
		System.out.println("加密信息："+encrypt);
		System.out.println("加密密码："+ePwd);
		System.out.println("摘要："+edigest);

		EncryptedInput input = new EncryptedInput();
		input.setAppId("1611890620");
		input.setCharset("UTF-8");
		input.setFormat("JSON");
		input.setEncryptedInfo(encrypt);
		input.setPassword(ePwd);
		input.setDigest(edigest);
		input.setSignType("RSA");
		input.setTimestamp(LocalDateTime.now().toEpochSecond(ZoneOffset.of("+8")));

		String json = JSONUtil.toJsonStr(input);
		System.out.println(json);
	}


}
