Commit 454eb4ff authored by 廖旭伟's avatar 廖旭伟

增加工行支付功能

parent d097da15
ALTER TABLE `mortals_xhx_business_license` ADD COLUMN `PermitPrintDate` varchar(32) DEFAULT '' COMMENT '签发日期';
\ No newline at end of file
ALTER TABLE `mortals_xhx_business_license` ADD COLUMN `PermitPrintDate` varchar(32) DEFAULT '' COMMENT '签发日期';
ALTER TABLE `mortals_xhx_apply_log` ADD COLUMN `charge` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否需要收费',
ADD COLUMN `amount` int(8) NOT NULL DEFAULT '0' COMMENT '收费金额(单位:分)';
ALTER TABLE `mortals_xhx_print_wait_queue` ADD COLUMN `charge` tinyint(2) NOT NULL DEFAULT '0' COMMENT '是否需要收费0否1是',
ADD COLUMN `amount` int(8) NOT NULL DEFAULT '0' COMMENT '收费金额(单位:分)',
ADD COLUMN `paystatus` tinyint(2) NOT NULL DEFAULT '0' COMMENT '支付状态0未支付1已支付';
ALTER TABLE `mortals_xhx_print_log` ADD COLUMN `faceUrl` varchar(255) COMMENT '取件人人脸信息',
ADD COLUMN `signUrl` varchar(255) COMMENT '取件人签名信息',
ADD COLUMN `printQueueId` bigint(20) COMMENT '打印队列ID';
-- ----------------------------
-- 支付请求表
-- ----------------------------
DROP TABLE IF EXISTS `mortals_xhx_pay_requst`;
CREATE TABLE mortals_xhx_pay_requst(
`id` bigint(20) AUTO_INCREMENT COMMENT '序号,主键,自增长',
`applyId` bigint(20) COMMENT '申请ID',
`printQueueId` bigint(20) COMMENT '打印队列ID',
`orderNum` varchar(64) NOT NULL COMMENT '支付订单编号',
`amount` int(8) NOT NULL DEFAULT '0' COMMENT '订单金额(单位:分)',
`orderDate` datetime NOT NULL COMMENT '订单日期',
`qrcodeUrl` varchar(255) COMMENT '支付二维码',
`payExpire` int(8) COMMENT '二维码有效时间单位秒',
`payStatus` tinyint(2) COMMENT '支付状态',
`createUserId` bigint(20) NOT NULL COMMENT '创建用户',
`createTime` datetime NOT NULL COMMENT '创建时间',
`updateUserId` bigint(20) COMMENT '更新用户',
`updateTime` datetime COMMENT '更新时间',
PRIMARY KEY (`id`)
,KEY `orderNum` (`orderNum`) USING BTREE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='支付请求';
ALTER TABLE `mortals_xhx_print_wait_queue` ADD COLUMN `orderNum` varchar(128) COMMENT '订单号';
\ No newline at end of file
......@@ -36,6 +36,7 @@
<profiles.redis.password></profiles.redis.password>
<profiles.redis.database>6</profiles.redis.database>
<profiles.filepath>d:/mortals/app/data/cpm</profiles.filepath>
<profiles.uploadUrl>http://192.168.0.98:17216/cpm/file/commonupload?prePath=/file/uploadfile</profiles.uploadUrl>
<profiles.queue.type>rabbitmq</profiles.queue.type>
<profiles.kafka.brokers>192.168.0.251:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>192.168.0.98</profiles.rabbitmq.host>
......@@ -76,7 +77,18 @@
<id>product</id>
<properties>
<profiles.active>product</profiles.active>
<profiles.server.port>19211</profiles.server.port>
<profiles.server.port>17216</profiles.server.port>
<profiles.datasource.uri>
<![CDATA[jdbc:mysql://localhost:3306/certificate?useUnicode=true&characterEncoding=utf8&useSSL=false&serverTimezone=Hongkong]]></profiles.datasource.uri>
<profiles.datasource.username>root</profiles.datasource.username>
<profiles.datasource.password>xjzwroot@2022</profiles.datasource.password>
<profiles.redis.uri>127.0.0.1</profiles.redis.uri>
<profiles.redis.port>6379</profiles.redis.port>
<profiles.redis.username></profiles.redis.username>
<profiles.redis.password></profiles.redis.password>
<profiles.redis.database>1</profiles.redis.database>
<profiles.filepath>C:/mortals/app/data</profiles.filepath>
<profiles.uploadUrl>ttp://221.237.182.106:8075/cpm/file/commonupload?prePath=/file/uploadfile</profiles.uploadUrl>
<profiles.queue.type>rabbitmq</profiles.queue.type>
<profiles.kafka.brokers>192.168.0.100:9092</profiles.kafka.brokers>
<profiles.rabbitmq.host>192.168.0.100</profiles.rabbitmq.host>
......@@ -184,6 +196,35 @@
<artifactId>javase</artifactId>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>icbc</groupId>
<artifactId>cop-io</artifactId>
<version>1.0.0</version>
<!--<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/icbc_lib/icbc-api-sdk-cop-io.jar</systemPath>-->
</dependency>
<dependency>
<groupId>icbc</groupId>
<artifactId>cop</artifactId>
<version>1.0.0</version>
<!--<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/icbc_lib/icbc-api-sdk-cop.jar</systemPath>-->
</dependency>
<dependency>
<groupId>icbc</groupId>
<artifactId>ca</artifactId>
<version>1.0.0</version>
<!--<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/icbc_lib/icbc-ca.jar</systemPath>-->
</dependency>
<dependency>
<groupId>icbc</groupId>
<artifactId>hsm</artifactId>
<version>1.0.0</version>
<!--<scope>system</scope>
<systemPath>${project.basedir}/src/main/resources/icbc_lib/hsm-software-share-1.0.5.jar</systemPath>-->
</dependency>
</dependencies>
<build>
......
......@@ -330,4 +330,38 @@ public class UserServiceImpl extends AbstractCRUDServiceImpl<UserDao, UserEntity
dao.update(sysUser);
return true;
}
public static void main(String[] args) throws Exception {
String pss = "WCX@18011533818";
String pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
pss = "CL@18108005449";
pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
pss = "YP@13881954990";
pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
pss = "HXZ@18113088186";
pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
pss = "WQ@13086665623";
pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
pss = "YLP@15883305603";
pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
pss = "YR@13609450909";
pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
pss = "ZZY@15802871365";
pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
pss = "CKL@18834108727";
pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
pss = "WQ@19936078114";
pwd = SecurityUtil.md5DoubleEncoding(pss);
System.out.println(pss+"__"+pwd);
}
}
\ No newline at end of file
package com.mortals.xhx.busiz.icbc;
import com.alibaba.fastjson.JSON;
import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.IcbcApiException;
import com.icbc.api.IcbcConstants;
import com.icbc.api.request.CardbusinessQrcodeQrgenerateRequestV1;
import com.icbc.api.request.QrcodeGenerateRequestV2;
import com.icbc.api.response.CardbusinessQrcodeQrgenerateResponseV1;
import com.icbc.api.response.QrcodeGenerateResponseV2;
public class QrcodeGenerateTest {
//1、网关公钥
protected static final String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMpjaWjngB4E3ATh+G1DVAmQnIpiPEFAEDqRfNGAVvvH35yDetqewKi0l7OEceTMN1C6NPym3zStvSoQayjYV+eIcZERkx31KhtFu9clZKgRTyPjdKMIth/wBtPKjL/5+PYalLdomM4ONthrPgnkN4x4R0+D4+EBpXo8gNiAFsNwIDAQAB";
//2、appid
protected static final String APP_ID = "10000000000003219401";
//3、密钥对认证方式,公钥在API平台登记,此处为私钥
protected static final String MY_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCrlSRQ9qe9rXduyQka0UE0mqLNtMqNWJlq3aD11tAh96KoM+yReJVC8vd1/25ANnM3oIEht7daB1LBZRx41DlJ95bdsxLtuIQ3ENGcUQSUv3dP/YtKoXxjWmo7E1UGNWZP3/PK48SKxFdP0lM69MtA4/flLpOAX8cqHYWRYsquG8GdskL5qrw0msPo2ooBa70Zdgp/IoSty/+1bqU5j5MjXDB8fb9dlqItmSkuGo/EqE1I+GycmVFX7hhQlXRQSOU0hsBEqrcjsBkg7ZQAJLd06eRnz2tr6zMskLMXL3juxOnxZfIbDQlvY0P3IGjpusYiSoO0erdiuhscRoKL0f3FAgMBAAECggEACurD3e+RBQAG/oJbCnJFpaewc8nXg2kfkHhGgq3Rc1UoFm9V/ibVHxE0zooF2p8Rnfif5A8mODEJbRWrsJfBh2PHR8GE6EwvrriVZaPqrd4wJLjwm7ss82iwI/nFv03hfck1ip4LBiXvmjwQdfVXrgAd6IlEnaE6cQMM2bnBRJTpH4gQGfFIdG71Tn5Q7qukwyTPBFlu1ocaRy+nqVAnjnwXlR7cqBcBZplvNmzWaNBrKnuoIp2U9GGifvbeN5MevNeSVfbIbe1siU33UpO0w1/TwmfztYFtxVp5TjbOw5SNW7RidNSh4vLFLep3kUm1trkD5VIrXpGSsxhyeDj5BwKBgQDDf0oVCVH3UTKmDKcF8DHEAgmwYmmVD6voh9rY/56iPR4EzH95vjBye0F9aiYAk22y2ebNimnBgWzgGTs+lrFldUc0lXR2H+NMmhVc8OWnoa4E4fF5xFHMbWE/m9o204BsiS3tnxE16d5ozfWTSPvfDhr5bZ+JOhwYXFVgaML4wwKBgQDgryk4/+LpEP8hKGx7tVi+1QBkZWeroIC8TvLf7OIkmsAoHRUX4JljkU1wpvwcU4cUgqTLXr19HX2NwwKXJkSb6y/Wp1tFPPIbm5hrakp4Z1w4HqGeMWs3ckZxgXHo6KuVUxMJ4kpN53ueaTEL5OqNn2bJcKvYNr3BTepN8N+G1wKBgQC8TV349zo5Ir/LSwKR6LK2nlPgzlnuVuL5nenA/C47DO1eJ+9dP0EA9BG3kEe8ZETUcagrMHf/B//rtsHm3lVOaXFFh/NeWAai4QNUu0Apf8TTNSJXbC5x3qU+FItSJdRcNqHDcGSubm5ouoEg9bqNNdPrjpiNICixmjYuH5o06wKBgBqJ9geKigXXgRssiCvQjsvzotk49RbbnXkgpiV2+Hs0YDAcx0oLuHJ/TjNZNfwujY0JpWd0KFOn8RWWjC7IUWBNVlg3altySHKkXUuKwYMZSlZCn/psgeqJr/JmRMsq+GFp75zCQt6S0hIzAJ0UC/RweJagnVurk5xKlLtiETT/AoGAfTh49Y2caLLv1IyjezLJdJ3fi/vhG1iKAsReRVhXuB+jcSlNEbadwRkIqemssExq3B2MR0+eOsqR/wJkx6WNH6UGIRC6MEXQCZTghSVhWAiNefvVRN7961e7NgwlABaftUn+07e3sb56RXluzWlUO/8fnQgJleh8u+5TmW5pqpY=";
public static void main(String[] args) throws Exception {
//签名类型为RSA2时,需传入appid,私钥和网关公钥,签名类型使用定值IcbcConstants.SIGN_TYPE_RSA2,其他参数使用缺省值
// DefaultIcbcClient client = new DefaultIcbcClient(APP_ID, IcbcConstants.SIGN_TYPE_RSA2, MY_PRIVATE_KEY, APIGW_PUBLIC_KEY);
//
// QrcodeGenerateRequestV2 request = new QrcodeGenerateRequestV2();
//
// //4、根据测试环境和生产环境替换相应ip和端口
// request.setServiceUrl("https://gw.open.icbc.com.cn/api/cardbusiness/qrcode/qrgenerate/V1");
//
// //5、请对照接口文档用bizContent.setxxx()方法对业务上送数据进行赋值
// QrcodeGenerateRequestV2.QrcodeGenerateRequestV2Biz bizContent = new QrcodeGenerateRequestV2.QrcodeGenerateRequestV2Biz();
// bizContent.setMerId("440286510152"); //商户编号
// bizContent.setStoreCode("440286510152"); //e生活档案编号
// bizContent.setOutTradeNo("ZHL777O15002039"); //商户系统订单号
// bizContent.setOrderAmt("1"); //订单总金额(单位:分)
// bizContent.setTradeDate("20241205"); //商户订单生成日期,格式是yyyyMMdd
// bizContent.setTradeTime("150026"); //商户订单生成时间,格式是HHmmss
// bizContent.setAttach("abcdefg"); //商户附加数据,最多21个汉字字符 该字段非必输项
// bizContent.setPayExpire("1200"); //二维码有效期(单位:秒),必须小于24小时
// bizContent.setNotifyUrl("127.0.0.1"); //商户接收支付成功通知消息URL,当notify_flag为1时必输
// bizContent.setTporderCreateIp("127.0.0.1"); //商户订单生成的机器IP
// bizContent.setSpFlag("0"); //扫码后是否需要跳转分行(0:否,1:是,默认值0),该字段非必输项
// bizContent.setNotifyFlag("0"); //商户是否开启通知接口(0:否,1:是,默认值0)
// request.setBizContent(bizContent);
//
// QrcodeGenerateResponseV2 response = new QrcodeGenerateResponseV2();
// try {
// response = client.execute(request, "msgId");//msgId消息通讯唯一编号,要求每次调用独立生成,APP级唯一
// if (response.isSuccess()) {
// //6、业务成功处理,请根据接口文档用response.getxxx()获取同步返回的业务数据
// System.out.println("ReturnCode:"+response.getReturnCode());
// System.out.println("response:" + response);
// } else {
// //失败
// System.out.println("ReturnCode:" + response.getReturnCode());
// System.out.println("ReturnMsg:" + response.getReturnMsg());
// }
// } catch (IcbcApiException e) {
// e.printStackTrace();
// }
DefaultIcbcClient client = new DefaultIcbcClient(APP_ID, IcbcConstants.SIGN_TYPE_RSA2, MY_PRIVATE_KEY, APIGW_PUBLIC_KEY);
CardbusinessQrcodeQrgenerateRequestV1 request = new CardbusinessQrcodeQrgenerateRequestV1();
request.setServiceUrl("https://gw.open.icbc.com.cn/api/cardbusiness/qrcode/qrgenerate/V1");
CardbusinessQrcodeQrgenerateRequestV1.CardbusinessQrcodeQrgenerateRequestV1Biz bizContent = new CardbusinessQrcodeQrgenerateRequestV1.CardbusinessQrcodeQrgenerateRequestV1Biz();
request.setBizContent(bizContent);
bizContent.setMerId("440286510152");
//bizContent.setStoreCode("440286510152");
bizContent.setOutTradeNo("ZHL177O15002040");
bizContent.setOrderAmt("1");
bizContent.setTradeDate("20241205");
bizContent.setTradeTime("155526");
bizContent.setTporderCreateIp("127.0.0.1");
bizContent.setNotifyFlag("0");
bizContent.setPayExpire("1200");
CardbusinessQrcodeQrgenerateResponseV1 response;
try {
response = client.execute(request, System.currentTimeMillis() + "");//msgId消息通讯唯一编号,要求每次调用独立生成,APP级唯一
if (response.getReturnCode() == 0) {
// 6、业务成功处理,请根据接口文档用response.getxxx()获取同步返回的业务数据
System.out.println("ReturnCode:" + response.getReturnCode());
System.out.println("response:" + JSON.toJSONString(response));
} else {
// 失败
System.out.println("response:" + JSON.toJSONString(response));
System.out.println("ReturnCode:" + response.getReturnCode());
System.out.println("ReturnMsg:" + response.getReturnMsg());
}
} catch (IcbcApiException e) {
e.printStackTrace();
}
}
}
package com.mortals.xhx.busiz.icbc;
import com.alibaba.fastjson.JSON;
import com.icbc.api.DefaultIcbcClient;
import com.icbc.api.IcbcApiException;
import com.icbc.api.IcbcConstants;
import com.icbc.api.request.MybankPayQrcodeScannedPaystatusRequestV2;
import com.icbc.api.response.MybankPayQrcodeScannedPaystatusResponseV2;
public class QrcodePaystatusTest {
//1、网关公钥
protected static final String APIGW_PUBLIC_KEY = "MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCMpjaWjngB4E3ATh+G1DVAmQnIpiPEFAEDqRfNGAVvvH35yDetqewKi0l7OEceTMN1C6NPym3zStvSoQayjYV+eIcZERkx31KhtFu9clZKgRTyPjdKMIth/wBtPKjL/5+PYalLdomM4ONthrPgnkN4x4R0+D4+EBpXo8gNiAFsNwIDAQAB";
//2、appid
protected static final String APP_ID = "10000000000003219401";
//3、密钥对认证方式,公钥在API平台登记,此处为私钥
protected static final String MY_PRIVATE_KEY = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCrlSRQ9qe9rXduyQka0UE0mqLNtMqNWJlq3aD11tAh96KoM+yReJVC8vd1/25ANnM3oIEht7daB1LBZRx41DlJ95bdsxLtuIQ3ENGcUQSUv3dP/YtKoXxjWmo7E1UGNWZP3/PK48SKxFdP0lM69MtA4/flLpOAX8cqHYWRYsquG8GdskL5qrw0msPo2ooBa70Zdgp/IoSty/+1bqU5j5MjXDB8fb9dlqItmSkuGo/EqE1I+GycmVFX7hhQlXRQSOU0hsBEqrcjsBkg7ZQAJLd06eRnz2tr6zMskLMXL3juxOnxZfIbDQlvY0P3IGjpusYiSoO0erdiuhscRoKL0f3FAgMBAAECggEACurD3e+RBQAG/oJbCnJFpaewc8nXg2kfkHhGgq3Rc1UoFm9V/ibVHxE0zooF2p8Rnfif5A8mODEJbRWrsJfBh2PHR8GE6EwvrriVZaPqrd4wJLjwm7ss82iwI/nFv03hfck1ip4LBiXvmjwQdfVXrgAd6IlEnaE6cQMM2bnBRJTpH4gQGfFIdG71Tn5Q7qukwyTPBFlu1ocaRy+nqVAnjnwXlR7cqBcBZplvNmzWaNBrKnuoIp2U9GGifvbeN5MevNeSVfbIbe1siU33UpO0w1/TwmfztYFtxVp5TjbOw5SNW7RidNSh4vLFLep3kUm1trkD5VIrXpGSsxhyeDj5BwKBgQDDf0oVCVH3UTKmDKcF8DHEAgmwYmmVD6voh9rY/56iPR4EzH95vjBye0F9aiYAk22y2ebNimnBgWzgGTs+lrFldUc0lXR2H+NMmhVc8OWnoa4E4fF5xFHMbWE/m9o204BsiS3tnxE16d5ozfWTSPvfDhr5bZ+JOhwYXFVgaML4wwKBgQDgryk4/+LpEP8hKGx7tVi+1QBkZWeroIC8TvLf7OIkmsAoHRUX4JljkU1wpvwcU4cUgqTLXr19HX2NwwKXJkSb6y/Wp1tFPPIbm5hrakp4Z1w4HqGeMWs3ckZxgXHo6KuVUxMJ4kpN53ueaTEL5OqNn2bJcKvYNr3BTepN8N+G1wKBgQC8TV349zo5Ir/LSwKR6LK2nlPgzlnuVuL5nenA/C47DO1eJ+9dP0EA9BG3kEe8ZETUcagrMHf/B//rtsHm3lVOaXFFh/NeWAai4QNUu0Apf8TTNSJXbC5x3qU+FItSJdRcNqHDcGSubm5ouoEg9bqNNdPrjpiNICixmjYuH5o06wKBgBqJ9geKigXXgRssiCvQjsvzotk49RbbnXkgpiV2+Hs0YDAcx0oLuHJ/TjNZNfwujY0JpWd0KFOn8RWWjC7IUWBNVlg3altySHKkXUuKwYMZSlZCn/psgeqJr/JmRMsq+GFp75zCQt6S0hIzAJ0UC/RweJagnVurk5xKlLtiETT/AoGAfTh49Y2caLLv1IyjezLJdJ3fi/vhG1iKAsReRVhXuB+jcSlNEbadwRkIqemssExq3B2MR0+eOsqR/wJkx6WNH6UGIRC6MEXQCZTghSVhWAiNefvVRN7961e7NgwlABaftUn+07e3sb56RXluzWlUO/8fnQgJleh8u+5TmW5pqpY=";
public static void main(String[] args) {
DefaultIcbcClient client = new DefaultIcbcClient(APP_ID, IcbcConstants.SIGN_TYPE_RSA2, MY_PRIVATE_KEY, APIGW_PUBLIC_KEY);
MybankPayQrcodeScannedPaystatusRequestV2 request = new MybankPayQrcodeScannedPaystatusRequestV2();
//4、根据测试环境和生产环境替换相应ip和端口
request.setServiceUrl("https://gw.open.icbc.com.cn/api/mybank/pay/qrcode/scanned/paystatus/V2");
//5、请对照接口文档用bizContent.setxxx()方法对业务上送数据进行赋值
MybankPayQrcodeScannedPaystatusRequestV2.MybankPayQrcodeScannedPaystatusRequestV2Biz bizContent = new MybankPayQrcodeScannedPaystatusRequestV2.MybankPayQrcodeScannedPaystatusRequestV2Biz();
bizContent.setMerId("440286510152"); //商户编号
bizContent.setOutTradeNo("ZHL177O15002040"); //外部订单号
bizContent.setTradeDate("20241205"); //交易日期 格式:YYYYMMDD
bizContent.setOrderId("");
request.setBizContent(bizContent);
MybankPayQrcodeScannedPaystatusResponseV2 response;
try {
response = client.execute(request, System.currentTimeMillis() + "");//msgId消息通讯唯一编号,要求每次调用独立生成,APP级唯一
if (response.getReturnCode() == 0) {
// 6、业务成功处理,请根据接口文档用response.getxxx()获取同步返回的业务数据
System.out.println("response:" + JSON.toJSONString(response));
System.out.println("ReturnCode:"+response.getReturnCode());
} else {
// 失败
System.out.println("response:" + JSON.toJSONString(response));
System.out.println("ReturnCode:"+response.getReturnCode());
System.out.println("ReturnMsg:"+response.getReturnMsg());
}
} catch (IcbcApiException e) {
e.printStackTrace();
}
}
}
package com.mortals.xhx.common.formdesign.component;
import cn.hutool.core.text.StrSplitter;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists;
......@@ -30,8 +31,13 @@ public class DesignCheckboxComponent extends DesignComponent {
@Override
public ListItem buildDefaultComponent(ComponentCons cons) {
CheckboxListItem columnsItem = new CheckboxListItem();
List<String> keys = StrSplitter.split(cons.getVal(), "_", true, true);
columnsItem.setId(cons.getVal());
columnsItem.set_id(cons.getVal());
if(keys.size()>3) {
columnsItem.setId(keys.get(0) + "_" + keys.get(1) + "_" + keys.get(2));
columnsItem.set_id(keys.get(0) + "_" + keys.get(1) + "_" + keys.get(2));
}
columnsItem.setCompType("checkbox");
columnsItem.setCompName(cons.getLabel());
columnsItem.setCompIcon("checkbox");
......@@ -53,7 +59,8 @@ public class DesignCheckboxComponent extends DesignComponent {
columnsItem.setSpan(24);
columnsItem.setOptionType("default");
columnsItem.setDataType("static");
columnsItem.setAction("https://www.fastmock.site/mock/51715c0157535b99010bde55f2df33c8/formDesigner/api/options");
//columnsItem.setAction("https://www.fastmock.site/mock/51715c0157535b99010bde55f2df33c8/formDesigner/api/options");
columnsItem.setAction("");
columnsItem.setClearable(false);
columnsItem.setValue(Lists.newArrayList());
columnsItem.setRules(Lists.newArrayList());
......
package com.mortals.xhx.common.formdesign.component;
import cn.hutool.core.text.StrSplitter;
import com.google.common.collect.Lists;
import cn.hutool.core.util.IdUtil;
......@@ -10,6 +11,7 @@ import com.mortals.xhx.common.pdu.gen.*;
import com.mortals.xhx.common.pdu.gen.component.ComponentCons;
import java.util.ArrayList;
import java.util.List;
/**
* 输入框组件
......@@ -29,6 +31,11 @@ public class DesignInputComponent extends DesignComponent {
ListItem columnsItem = new ListItem();
columnsItem.setId(cons.getVal());
columnsItem.set_id(cons.getVal());
List<String> keys = StrSplitter.split(cons.getVal(), "_", true, true);
if(keys.size()>3) {
columnsItem.setId(keys.get(0) + "_" + keys.get(1) + "_" + keys.get(2));
columnsItem.set_id(keys.get(0) + "_" + keys.get(1) + "_" + keys.get(2));
}
columnsItem.setCompType("input");
columnsItem.setCompName(cons.getLabel());
columnsItem.setCompIcon("input");
......@@ -54,6 +61,7 @@ public class DesignInputComponent extends DesignComponent {
columnsItem.setAppend("");
columnsItem.setPrepend("");
columnsItem.setLayout("colItem");
columnsItem.setValue(cons.getDefaultValue());
return columnsItem;
}
......
package com.mortals.xhx.common.formdesign.component;
import cn.hutool.core.text.StrSplitter;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.google.common.collect.Lists;
......@@ -34,6 +35,11 @@ public class DesignSelectComponent extends DesignComponent {
ListItem columnsItem = new ListItem();
columnsItem.setId(cons.getVal());
columnsItem.set_id(cons.getVal());
List<String> keys = StrSplitter.split(cons.getVal(), "_", true, true);
if(keys.size()>3) {
columnsItem.setId(keys.get(0) + "_" + keys.get(1) + "_" + keys.get(2));
columnsItem.set_id(keys.get(0) + "_" + keys.get(1) + "_" + keys.get(2));
}
columnsItem.setCompType("select");
columnsItem.setCompName(cons.getLabel());
columnsItem.setCompIcon("select");
......@@ -52,7 +58,8 @@ public class DesignSelectComponent extends DesignComponent {
columnsItem.setGutter(15);
columnsItem.setSpan(24);
columnsItem.setDataType("static");
columnsItem.setAction("https://www.fastmock.site/mock/51715c0157535b99010bde55f2df33c8/formDesigner/api/options");
//columnsItem.setAction("https://www.fastmock.site/mock/51715c0157535b99010bde55f2df33c8/formDesigner/api/options");
columnsItem.setAction("");
columnsItem.setClearable(false);
columnsItem.setRules(Lists.newArrayList());
columnsItem.setLayout("colItem");
......
......@@ -32,4 +32,6 @@ public class ComponentCons {
private String uploadFileUrl;
private String defaultValue;
}
......@@ -412,7 +412,7 @@ public class QrCodeUtil {
// BufferedImage barCode = QrCodeUtil.getBarCode("123456789123456789");
// BufferedImage bufferedImage = QrCodeUtil.insertWords(barCode, "891234567891234567");
// ImageIO.write(bufferedImage,"png",new File("D:\\mortals\\app\\data\\test\\123.png"));
QrCodeUtil.generateQrCodeFile("https://pics7.baidu.com/feed/cc11728b4710b9127b860294afb21408934522f4.jpeg@f_auto?token=6ef8230f0103fcd054294bff35ff9292","D:\\mortals\\app\\data\\test\\789.png");
QrCodeUtil.generateQrCodeFile("https://qr.95516.com/01020001/wcqr?f=ICBCqr&X=5&T=3&P=13&I=37148139e896f1bea1b6e07dfeb131dc&N=ae6bcfa465ba4e0860d95cb6908823f3&L=4f288ba1f8d36ce284ea719473e21d1a55fd7c16cb5927d02fa321944eeb4a928e08cb9d9aae06ad346842fcccf4248e","D:\\mortals\\app\\data\\1789.png");
}
......
package com.mortals.xhx.common.utils;
import org.apache.commons.codec.binary.Base64;
import java.security.Key;
import java.security.KeyFactory;
import java.security.KeyPair;
import java.security.KeyPairGenerator;
import java.security.PrivateKey;
import java.security.PublicKey;
import java.security.SecureRandom;
import java.security.Signature;
import java.security.spec.KeySpec;
import java.security.spec.PKCS8EncodedKeySpec;
import java.security.spec.X509EncodedKeySpec;
import java.util.ArrayList;
import javax.crypto.Cipher;
public final class RSAUtils {
private static final String KEY_ALGORITHM = "RSA";
private static final int KEY_SIZE = 2048;//设置长度
public static final String SIGNATURE_ALGORITHM = "SHA256withRSA";
public static final String RSA_TYPE = "RSA/ECB/PKCS1Padding";
private final static String PUBLIC_KEY_NAME = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvJWHTWgcfPjzWTt1OAUAvOnd8N/ITzP+Xe1PY2fMhFNzmRV9a78fAZ5C6ynFzsQGJNffvlw4HoB6HsUWmGymkR9950hqXXiMpbNoQ4MqEtxPKx1Blusp3E8tJ9ABzrSat4/PfkQ+Iw9t5sHQhSFt2kJCD7KUw9gW8hVMnQTngMlgvt1U9ozj7tBdQMRduk/KkA1G/ZxvYWb5ZcFb0PeHoUDuEr6HXOycxm6cRZBjly97IrfUCEemKKKPmjacntaP+pgS0cc9jWIYAeMhhjmRa7hY2pn6Q3mSiq+V9ruUnKQOlyLcQ1Y1wrfOydo0e/3jAzoLeJR8uWUnZQcxmnuzUwIDAQAB";
private final static String PRIVATE_KEY_NAME = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQC8lYdNaBx8+PNZO3U4BQC86d3w38hPM/5d7U9jZ8yEU3OZFX1rvx8BnkLrKcXOxAYk19++XDgegHoexRaYbKaRH33nSGpdeIyls2hDgyoS3E8rHUGW6yncTy0n0AHOtJq3j89+RD4jD23mwdCFIW3aQkIPspTD2BbyFUydBOeAyWC+3VT2jOPu0F1AxF26T8qQDUb9nG9hZvllwVvQ94ehQO4Svodc7JzGbpxFkGOXL3sit9QIR6Yooo+aNpye1o/6mBLRxz2NYhgB4yGGOZFruFjamfpDeZKKr5X2u5ScpA6XItxDVjXCt87J2jR7/eMDOgt4lHy5ZSdlBzGae7NTAgMBAAECggEAHX4/Ml5xciQXHuH7I584rdLfiH/fGm/1vKfUDiZaKGnKvurK+jJiPYUMTy3xxzQGB/YRAnr2teJ+9tf5AC6h4DluHeFH7UVgrbuAt2pIhrmY0hPZwaoWmmNxmvPfjH3XYpTlrQgsNZyAoiG2pFOFlChfn4fc10Iw2Hx3RmlRcWUId9dx742nDxTKjRgvTkk+epjFw2Ey02B222N6oyY3uEEgXHp/1cs53I25iaj5eni8L8BXmGogNF9uPpp8eEHTwp+YCn1sPHe4nZDnPm+ExMU92LcbTCkaeesFpD+ifbyAT8eGvZfOXsa+R3zGDEakFPgpY9flbz9QgydSYTnkaQKBgQDb+zfvZfOUajXSeqDhMDWtWlPsrtgu7Eryueh87gLSoVZGFH851vYCMkAj62PNo++F1ZPJJ+XOsHvaiW6hrXXgrmKU7F/QL6DLjMxhS6KzQ67KMbYVe56ilLfcW8sFdmGXK78+f5Q0zD8/bRFpvsjPU3VqLIYZbRq6YXZAB0FzmQKBgQDbdkHunNw7tJzmKsOtiECiXYSxT4eD98sh/LOEZG1JM0w84J2h6aTwLg/FdWYKnkkrs4HyWvaDZbo3rld7l6p9qFCM0VLUAuDBQRyTQxmRAhwZgcpHlRRuOwqH9P/NMfLwZnXS6ZJS7BPm6bb7iuY3U2XPHfEbrGICjQ4m0xLxywKBgQDA4+XGO4V8bC1JpFGRY+6NVRkl/qJ9cqC9eZqMgT9kZif6R1rP4tfQUTPAy1S2KruKhR6TUjLGLCZOGBg0GJ+2JfM3VpUlPb4m/gzwe5vsyLppfXGGIOGW+gTGao74+TbVkXyeVswkB7yl5wNP0ATRFwNr2CK2BN9c8rz3o+UWcQKBgQCgEQjVuKMJCRrG5boC/7XktsDpclAs+La3+1AT6AutsDSS0mEmjvs2EuJ96rqaVAiaTzsgQSg7fh7sLcSw6FX5gKH/k00ORWsYiR0Ga5JiKV/FWtzmiN116Kotr4xDZYMDxDd7tdB7mqSJbz1/CjgPckx3XCdXP8vcgHUp7BmNMQKBgFRZbnts4P+z+hgA8sjxYB7F2TXS6mcJJrBvXE0fi2XWn61M7NR3KBBH7rJ1tZG5AyIDuZf0/3boAtilrc+2dkpivqmuhHupjwxCZRIT0AqhndoAFuUTaLxkRHRrrzufvf04MjMKljQxbCnStCKf686G5Sii1DZ9dOuoc95vcjtN";
private final static String SERVICE_PUBLIC_KEY_NAME = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEApXrOQ8d9wUvSDLqeS+QbrL6FMg5qKeB9PDnUkvXG71xUUSxTW4uIDggzm3v9OXTYRt3yZEvr2WNJuvLy6xtBn/sMbP9vVnp1Q6KcXCH8pWnHjziS/Wv2cwjYWMVEOj0vICtiwei7G9oulgzBRnO8k8kIeqxrDLwHC9w2/Zh6R39f49xqIo2iHIiVSGObNEqS9NkGbKVPR1WlVzB2VKGc4tsciWYagi98OZwMuvz29Ums0yiG06HlUSAhAWEb+qKeoT4e3/DtXRbu8fXEF4EzjR0X4O6sS3PdwKpKkIlih99IdbnJ0jL8ALqhgV6NXEe/az4+I5WHM7lzviLVWfxIIQIDAQAB";
/**
* 生成公、私钥
* 根据需要返回String或byte[]类型
* @return
*/
public static ArrayList<String> createRSAKeys(){
ArrayList<String> array = new ArrayList<>();
try {
KeyPairGenerator keyPairGenerator = KeyPairGenerator.getInstance(KEY_ALGORITHM);
keyPairGenerator.initialize(KEY_SIZE, new SecureRandom());
KeyPair keyPair = keyPairGenerator.generateKeyPair();
PublicKey publicKey = keyPair.getPublic();
PrivateKey privateKey = keyPair.getPrivate();
//获取公、私钥值
String publicKeyValue = Base64.encodeBase64String(publicKey.getEncoded());
String privateKeyValue = Base64.encodeBase64String(privateKey.getEncoded());
//存入
array.add(publicKeyValue);
array.add(privateKeyValue);
//Log.e(" >>> ",publicKeyValue);
//Log.e(" >>> ",privateKeyValue);
} catch (Exception e) {
e.printStackTrace();
}
return array;
}
//获取本地RSA公钥
public static PublicKey getPublicKey() {
try {
return getPublicKey(PUBLIC_KEY_NAME);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
//获取本地RSA公钥
public static String getPublicKeyString() {
try {
return PUBLIC_KEY_NAME;
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
//获取服务器RSA公钥
public static PublicKey getServicePublicKey() {
try {
return getPublicKey(SERVICE_PUBLIC_KEY_NAME);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
//获取RSA公钥 根据钥匙字段
public static PublicKey getPublicKey(String key) {
try {
byte[] byteKey = Base64.decodeBase64(key);
X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(byteKey);
KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
return keyFactory.generatePublic(x509EncodedKeySpec);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
//获取RSA私钥 根据钥匙字段
private static PrivateKey getPrivateKey(String key) {
try {
byte[] byteKey = Base64.decodeBase64(key);
PKCS8EncodedKeySpec pkcs8EncodedKeySpec = new PKCS8EncodedKeySpec(byteKey);
KeyFactory keyFactory = KeyFactory.getInstance(KEY_ALGORITHM);
return keyFactory.generatePrivate(pkcs8EncodedKeySpec);
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
//本地RSA私钥 签名
public static String sign(String requestData){
String signature = null;
byte[] signed = null;
try {
// Log.e("=0== 签名前 >>>",requestData);
PrivateKey privateKey = getPrivateKey(PRIVATE_KEY_NAME);
Signature Sign = Signature.getInstance(SIGNATURE_ALGORITHM);
Sign.initSign(privateKey);
Sign.update(requestData.getBytes());
signed = Sign.sign();
signature = Base64.encodeBase64String(signed);
} catch (Exception e) {
e.printStackTrace();
}
return signature;
}
//公钥验证签名 base64签名 signature 签名内容requestData
public static boolean verifySign(String requestData, String signature){
boolean verifySignSuccess = false;
try {
PublicKey publicKey = getServicePublicKey();
Signature verifySign = Signature.getInstance(SIGNATURE_ALGORITHM);
verifySign.initVerify(publicKey);
verifySign.update(requestData.getBytes());
verifySignSuccess = verifySign.verify(Base64.decodeBase64(signature));
System.out.println(" >>> "+verifySignSuccess);
} catch (Exception e) {
e.printStackTrace();
}
return verifySignSuccess;
}
public static String encrypt(String clearText) {
String encryptedBase64 = "";
try {
Key key = getServicePublicKey();
final Cipher cipher = Cipher.getInstance(RSA_TYPE);
cipher.init(Cipher.ENCRYPT_MODE, key);
//
byte[] encryptedBytes = cipher.doFinal(clearText.getBytes("UTF-8"));
encryptedBase64 = Base64.encodeBase64String(encryptedBytes);
} catch (Exception e) {
e.printStackTrace();
}
return encryptedBase64;
}
public static String decrypt(String encryptedBase64) {
String decryptedString = "";
try {
Key key = getPrivateKey(PRIVATE_KEY_NAME);
final Cipher cipher = Cipher.getInstance(RSA_TYPE);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] encryptedBytes = Base64.decodeBase64(encryptedBase64);
byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
decryptedString = new String(decryptedBytes);
} catch (Exception e) {
e.printStackTrace();
}
return decryptedString;
}
}
\ No newline at end of file
......@@ -276,7 +276,7 @@ public class CertificateApi extends BaseJsonBodyController {
String busiDesc = "API接口保存打印记录";
int code=1;
try {
printWaitQueueService.doPrint(printLogPdu.getWaitQueueId(),printLogPdu.getPrintStatus(),printLogPdu.getStatusRemark());
printWaitQueueService.doPrint(printLogPdu.getWaitQueueId(),printLogPdu.getPrintStatus(),printLogPdu.getStatusRemark(),printLogPdu.getFaceUrl(),printLogPdu.getSignUrl());
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
......
......@@ -14,5 +14,7 @@ public class PrintListPdu {
private String pickerName;
private Long siteId;
/** 打印对立ID */
private Long printQueueId;
}
......@@ -10,4 +10,12 @@ public class PrintLogPdu {
private Integer printStatus;
/** 结果描述 */
private String statusRemark;
/**
* 取件人人脸信息
*/
private String faceUrl;
/**
* 取件人签名信息
*/
private String signUrl;
}
......@@ -110,6 +110,10 @@ public class CertificateCatalogTemplateServiceImpl extends AbstractCRUDServiceIm
cons.setVal(val);
cons.setEl(item.variable());
cons.setUploadFileUrl(uploadUrl);
if(keys.size()>3){
String value = keys.get(3);
cons.setDefaultValue(value);
}
if (type.equalsIgnoreCase(ComponentEnum.DYNAMIC_TABLE.getValue())) {
HashSet<String> dhs = new HashSet<>(); //去除重复标签
......
......@@ -24,6 +24,8 @@ import com.mortals.xhx.module.certificate.pdu.PrintSettingPdu;
import com.mortals.xhx.module.certificate.service.CertificateCatalogService;
import com.mortals.xhx.module.certificate.service.CertificateClassifyService;
import com.mortals.xhx.module.certificate.service.DeviceClassifyService;
import com.mortals.xhx.module.pay.model.PayRequstEntity;
import com.mortals.xhx.module.pay.service.PayRequstService;
import com.mortals.xhx.module.record.model.ApplyLogEntity;
import com.mortals.xhx.module.record.model.PrintWaitQueueEntity;
import com.mortals.xhx.module.record.model.PrintWaitQueueQuery;
......@@ -33,6 +35,8 @@ import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
......@@ -52,6 +56,8 @@ public class CertificatePrintController extends BaseJsonBodyController {
private PrintWaitQueueService printWaitQueueService;
@Autowired
private DeviceClassifyService deviceClassifyService;
@Autowired
private PayRequstService payRequstService;
@PostMapping({"setting/info"})
public Rest<Object> list(@RequestBody PrintSettingPdu settingPdu) {
......@@ -128,7 +134,7 @@ public class CertificatePrintController extends BaseJsonBodyController {
String busiDesc = "保存打印记录";
int code=1;
try {
printWaitQueueService.doPrint(printLogPdu.getWaitQueueId(),printLogPdu.getPrintStatus(),printLogPdu.getStatusRemark());
printWaitQueueService.doPrint(printLogPdu.getWaitQueueId(),printLogPdu.getPrintStatus(),printLogPdu.getStatusRemark(),printLogPdu.getFaceUrl(),printLogPdu.getSignUrl());
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
......@@ -222,4 +228,84 @@ public class CertificatePrintController extends BaseJsonBodyController {
return ret;
}
/**
* 生成支付二维码
*/
@PostMapping({"qrcode/generate"})
@UnAuth
public Rest<Object> QrcodeGenerate(@RequestBody PrintListPdu pdu) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "生成支付二维码";
int code=1;
try {
PrintWaitQueueEntity printWaitQueueEntity = printWaitQueueService.get(pdu.getPrintQueueId());
if(printWaitQueueEntity.getCharge()==1){
PayRequstEntity payRequstEntity = payRequstService.generatePayQrcode(printWaitQueueEntity,this.getRequestIP(this.request));
if(payRequstEntity!=null) {
Map<String,Object> data = new HashMap<>();
data.put("qrcode",payRequstEntity.getQrcodeUrl());
data.put("orderNo",payRequstEntity.getOrderNum());
BigDecimal aB = new BigDecimal(payRequstEntity.getAmount());
data.put("amountDouble",aB.divide(new BigDecimal(100),2, RoundingMode.HALF_UP).doubleValue());
model.put("data", data);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
}else {
code=-1;
model.put("message_info", "支付二维码生成失败");
}
}else {
code=-1;
model.put("message_info", "无需支付");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
/**
* 支付状态
*/
@PostMapping({"qrcode/payStatus"})
@UnAuth
public Rest<Object> paystatus(@RequestBody PrintListPdu pdu) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "查询支付状态";
int code=1;
try {
PrintWaitQueueEntity printWaitQueueEntity = printWaitQueueService.get(pdu.getPrintQueueId());
if(printWaitQueueEntity.getCharge()==1){
String payStatus = payRequstService.qrcodePaystatus(printWaitQueueEntity);
if(StringUtils.isNotEmpty(payStatus)) {
model.put("data", payStatus);
model.put("message_info", busiDesc + "成功");
this.recordSysLog(this.request, busiDesc + " 【成功】");
}else {
code=-1;
model.put("message_info", "支付状态查询失败");
}
}else {
code=-1;
model.put("message_info", "无需支付");
}
} catch (Exception var9) {
code = -1;
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setDict(model.get("dict"));
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
}
package com.mortals.xhx.module.pay.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.pay.model.PayRequstEntity;
import java.util.List;
/**
* 支付请求Dao
* 支付请求 DAO接口
*
* @author zxfei
* @date 2024-12-12
*/
public interface PayRequstDao extends ICRUDDao<PayRequstEntity,Long>{
}
package com.mortals.xhx.module.pay.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.pay.dao.PayRequstDao;
import com.mortals.xhx.module.pay.model.PayRequstEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 支付请求DaoImpl DAO接口
*
* @author zxfei
* @date 2024-12-12
*/
@Repository("payRequstDao")
public class PayRequstDaoImpl extends BaseCRUDDaoMybatis<PayRequstEntity,Long> implements PayRequstDao {
}
package com.mortals.xhx.module.pay.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.pay.model.vo.PayRequstVo;
import lombok.Data;
/**
* 支付请求实体对象
*
* @author zxfei
* @date 2024-12-12
*/
@Data
public class PayRequstEntity extends PayRequstVo {
private static final long serialVersionUID = 1L;
/**
* 申请ID
*/
private Long applyId;
/**
* 打印队列ID
*/
private Long printQueueId;
/**
* 支付订单编号
*/
private String orderNum;
/**
* 订单金额(单位:分)
*/
private Integer amount;
/**
* 订单日期
*/
private Date orderDate;
/**
* 支付二维码
*/
private String qrcodeUrl;
/**
* 二维码有效时间单位秒
*/
private Integer payExpire;
/**
* 支付状态
*/
private Integer payStatus;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof PayRequstEntity) {
PayRequstEntity tmp = (PayRequstEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.applyId = null;
this.printQueueId = null;
this.orderNum = "";
this.amount = 0;
this.orderDate = null;
this.qrcodeUrl = "";
this.payExpire = 0;
this.payStatus = 0;
}
}
\ No newline at end of file
package com.mortals.xhx.module.pay.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.pay.model.PayRequstEntity;
import java.util.ArrayList;
import java.util.List;
import lombok.Data;
import com.mortals.framework.annotation.Excel;
import java.math.BigDecimal;
import java.util.Date;
/**
* 支付请求视图对象
*
* @author zxfei
* @date 2024-12-12
*/
@Data
public class PayRequstVo extends BaseEntityLong {
/** 序号,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.pay.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.pay.model.PayRequstEntity;
import com.mortals.xhx.module.pay.dao.PayRequstDao;
import com.mortals.xhx.module.record.model.PrintWaitQueueEntity;
/**
* PayRequstService
*
* 支付请求 service接口
*
* @author zxfei
* @date 2024-12-12
*/
public interface PayRequstService extends ICRUDService<PayRequstEntity,Long>{
PayRequstDao getDao();
/**
* 生成支付二维码
* @param printWaitQueueEntity
* @return
*/
PayRequstEntity generatePayQrcode(PrintWaitQueueEntity printWaitQueueEntity,String ip);
/**
* 支付状态查询
* @param printWaitQueueEntity
* @return
*/
String qrcodePaystatus(PrintWaitQueueEntity printWaitQueueEntity);
}
\ No newline at end of file
package com.mortals.xhx.module.pay.service.impl;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.RandomUtil;
import cn.hutool.crypto.SecureUtil;
import com.mortals.framework.util.DateUtils;
import com.mortals.xhx.common.utils.QrCodeUtil;
import com.mortals.xhx.common.utils.StringUtils;
import com.mortals.xhx.module.pay.model.PayRequstQuery;
import com.mortals.xhx.module.record.model.PrintWaitQueueEntity;
import com.mortals.xhx.module.record.model.PrintWaitQueueQuery;
import com.mortals.xhx.module.record.service.PrintWaitQueueService;
import com.mortals.xhx.pay.ICBCPayUtil;
import org.springframework.beans.BeanUtils;
import java.io.File;
import java.util.Date;
import java.util.function.Function;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import com.mortals.framework.service.impl.AbstractCRUDServiceImpl;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.Context;
import com.mortals.xhx.module.pay.dao.PayRequstDao;
import com.mortals.xhx.module.pay.model.PayRequstEntity;
import com.mortals.xhx.module.pay.service.PayRequstService;
import lombok.extern.slf4j.Slf4j;
/**
* PayRequstService
* 支付请求 service实现
*
* @author zxfei
* @date 2024-12-12
*/
@Service("payRequstService")
@Slf4j
public class PayRequstServiceImpl extends AbstractCRUDServiceImpl<PayRequstDao, PayRequstEntity, Long> implements PayRequstService {
@Autowired
private PrintWaitQueueService printWaitQueueService;
@Value("${upload.path}")
private String filePath;
@Override
public PayRequstEntity generatePayQrcode(PrintWaitQueueEntity printWaitQueueEntity,String ip) {
PayRequstEntity temp = this.selectOne(new PayRequstQuery().printQueueId(printWaitQueueEntity.getId()).orderNum(printWaitQueueEntity.getOrderNum()));
if(temp!=null){
Long payExpire = System.currentTimeMillis() - temp.getOrderDate().getTime();
if(payExpire < temp.getPayExpire()*1000L && temp.getPayStatus()==0){
return temp;
}
}
Date orderDate = new Date();
String orderNo = DateUtils.getDateTime(new Date(), "yyyyMMddHHmmss") + RandomUtil.randomString("0123456789", 4);
String qrcode = ICBCPayUtil.QrcodeGenerate(orderNo, printWaitQueueEntity.getAmount(), orderDate, ip);
if (qrcode != null) {
String rootPath = this.filePath.endsWith("/") ? this.filePath : this.filePath + "/";
String filePath = rootPath + "file/qrcode/pay/";
String qrcodeName = orderNo + ".png";
File pathDir = new File(filePath);
if (!pathDir.exists()) {
pathDir.mkdirs();
}
String imagepath = filePath + qrcodeName;
QrCodeUtil.generateQrCodeFile(qrcode, imagepath);
PayRequstEntity payRequstEntity = new PayRequstEntity();
payRequstEntity.initAttrValue();
payRequstEntity.setAmount(printWaitQueueEntity.getAmount());
payRequstEntity.setApplyId(printWaitQueueEntity.getApplyId());
payRequstEntity.setOrderDate(orderDate);
payRequstEntity.setPayExpire(120);
payRequstEntity.setPrintQueueId(printWaitQueueEntity.getId());
payRequstEntity.setOrderNum(orderNo);
payRequstEntity.setQrcodeUrl("/file/qrcode/pay/" + qrcodeName);
payRequstEntity.setCreateTime(orderDate);
payRequstEntity.setCreateUserId(1L);
this.dao.insert(payRequstEntity);
PrintWaitQueueEntity updateP = new PrintWaitQueueEntity();
updateP.setId(printWaitQueueEntity.getId());
updateP.setOrderNum(orderNo);
printWaitQueueService.update(updateP);
return payRequstEntity;
}
return null;
}
@Override
public String qrcodePaystatus(PrintWaitQueueEntity printWaitQueueEntity) {
PayRequstEntity payRequstEntity = this.selectOne(new PayRequstQuery().printQueueId(printWaitQueueEntity.getId()).orderNum(printWaitQueueEntity.getOrderNum()));
if(payRequstEntity!=null){
String payStatus = ICBCPayUtil.qrcodePaystatus(payRequstEntity.getOrderNum(),payRequstEntity.getOrderDate());
//交易结果标志:0:支付中请稍后查询,1:支付成功,2:支付失败,3:已撤销,4:撤销中请稍后查询,5:已全额退款,6:已部分退款,7:退款中请稍后查询
if(StringUtils.isNotEmpty(payStatus)){
payRequstEntity.setPayStatus(Integer.valueOf(payStatus));
payRequstEntity.setUpdateTime(new Date());
this.dao.update(payRequstEntity);
printWaitQueueEntity.setPaystatus(Integer.valueOf(payStatus));
printWaitQueueService.update(printWaitQueueEntity);
}
return payStatus;
}
return null;
}
public static void main(String[] args) {
String orderNo = DateUtils.getDateTime(new Date(),"yyyyMMddHHmmss") + "_"+RandomUtil.randomString("0123456789",4);
System.out.println(orderNo);
}
}
\ No newline at end of file
package com.mortals.xhx.module.pay.web;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.base.system.param.service.ParamService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import com.mortals.framework.model.Context;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.mortals.framework.web.BaseCRUDJsonBodyMappingController;
import com.mortals.xhx.module.pay.model.PayRequstEntity;
import com.mortals.xhx.module.pay.service.PayRequstService;
import org.apache.commons.lang3.ArrayUtils;
import com.mortals.framework.util.StringUtils;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import com.alibaba.fastjson.JSONObject;
import java.util.Arrays;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import static com.mortals.framework.ap.SysConstains.*;
import com.mortals.xhx.common.code.*;
/**
*
* 支付请求
*
* @author zxfei
* @date 2024-12-12
*/
@RestController
@RequestMapping("pay/requst")
public class PayRequstController extends BaseCRUDJsonBodyMappingController<PayRequstService,PayRequstEntity,Long> {
@Autowired
private ParamService paramService;
public PayRequstController(){
super.setModuleDesc( "支付请求");
}
@Override
protected void init(Map<String, Object> model, Context context) {
//this.addDict(model, "payStatus", PayStatusEnum.getEnumMap());
super.init(model, context);
}
}
\ No newline at end of file
package com.mortals.xhx.module.record.model;
import java.math.RoundingMode;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
......@@ -11,7 +15,7 @@ import lombok.Data;
* 证照申请实体对象
*
* @author zxfei
* @date 2023-07-05
* @date 2024-12-12
*/
@Data
public class ApplyLogEntity extends ApplyLogVo {
......@@ -129,6 +133,25 @@ public class ApplyLogEntity extends ApplyLogVo {
* 手机号码
*/
private String mobile;
/**
* 是否需要收费
*/
private Integer charge;
/**
* 收费金额(单位:分)
*/
private Integer amount;
// public Integer getAmount() {
// return amount;
// }
//
// public void setAmount(Integer amount) {
// this.amount = amount;
// BigDecimal aB = new BigDecimal(amount);
// this.setAmountDouble(aB.divide(new BigDecimal(100),2, RoundingMode.HALF_UP).doubleValue());
// }
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -146,61 +169,36 @@ public class ApplyLogEntity extends ApplyLogVo {
}
public void initAttrValue(){
this.recordId = -1L;
this.catalogId = -1L;
this.catalogCode = "";
this.catalogName = "";
this.certificateCode = "";
this.certificateName = "";
this.issueTime = null;
this.pickerName = "";
this.pickerIDCardNo = "";
this.holderType = 1;
this.holderIdType = 1;
this.holderName = "";
this.holderIDCardNo = "";
this.enterpriseName = "";
this.validityStart = null;
this.validityEnd = null;
this.privateID = "";
this.certificateUrl = "";
this.previewUrl = "";
this.formContent = "";
this.formTemplate = "";
this.generateStatus = 1;
this.operType = 1;
this.recordStatus = 0;
this.siteId = -1L;
this.templateId = -1L;
this.templateName = "";
this.mobile = "";
this.charge = 0;
this.amount = 0;
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ import com.mortals.xhx.module.record.model.ApplyLogEntity;
* 证照申请查询对象
*
* @author zxfei
* @date 2023-07-05
* @date 2024-12-12
*/
public class ApplyLogQuery extends ApplyLogEntity {
/** 开始 序号,主键,自增长 */
......@@ -300,6 +300,36 @@ public class ApplyLogQuery extends ApplyLogEntity {
/** 手机号码排除列表 */
private List <String> mobileNotList;
/** 开始 是否需要收费 */
private Integer chargeStart;
/** 结束 是否需要收费 */
private Integer chargeEnd;
/** 增加 是否需要收费 */
private Integer chargeIncrement;
/** 是否需要收费列表 */
private List <Integer> chargeList;
/** 是否需要收费排除列表 */
private List <Integer> chargeNotList;
/** 开始 收费金额(单位:分) */
private Integer amountStart;
/** 结束 收费金额(单位:分) */
private Integer amountEnd;
/** 增加 收费金额(单位:分) */
private Integer amountIncrement;
/** 收费金额(单位:分)列表 */
private List <Integer> amountList;
/** 收费金额(单位:分)排除列表 */
private List <Integer> amountNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<ApplyLogQuery> orConditionList;
......@@ -1952,6 +1982,168 @@ public class ApplyLogQuery extends ApplyLogEntity {
this.mobileNotList = mobileNotList;
}
/**
* 获取 开始 是否需要收费
* @return chargeStart
*/
public Integer getChargeStart(){
return this.chargeStart;
}
/**
* 设置 开始 是否需要收费
* @param chargeStart
*/
public void setChargeStart(Integer chargeStart){
this.chargeStart = chargeStart;
}
/**
* 获取 结束 是否需要收费
* @return $chargeEnd
*/
public Integer getChargeEnd(){
return this.chargeEnd;
}
/**
* 设置 结束 是否需要收费
* @param chargeEnd
*/
public void setChargeEnd(Integer chargeEnd){
this.chargeEnd = chargeEnd;
}
/**
* 获取 增加 是否需要收费
* @return chargeIncrement
*/
public Integer getChargeIncrement(){
return this.chargeIncrement;
}
/**
* 设置 增加 是否需要收费
* @param chargeIncrement
*/
public void setChargeIncrement(Integer chargeIncrement){
this.chargeIncrement = chargeIncrement;
}
/**
* 获取 是否需要收费
* @return chargeList
*/
public List<Integer> getChargeList(){
return this.chargeList;
}
/**
* 设置 是否需要收费
* @param chargeList
*/
public void setChargeList(List<Integer> chargeList){
this.chargeList = chargeList;
}
/**
* 获取 是否需要收费
* @return chargeNotList
*/
public List<Integer> getChargeNotList(){
return this.chargeNotList;
}
/**
* 设置 是否需要收费
* @param chargeNotList
*/
public void setChargeNotList(List<Integer> chargeNotList){
this.chargeNotList = chargeNotList;
}
/**
* 获取 开始 收费金额(单位:分)
* @return amountStart
*/
public Integer getAmountStart(){
return this.amountStart;
}
/**
* 设置 开始 收费金额(单位:分)
* @param amountStart
*/
public void setAmountStart(Integer amountStart){
this.amountStart = amountStart;
}
/**
* 获取 结束 收费金额(单位:分)
* @return $amountEnd
*/
public Integer getAmountEnd(){
return this.amountEnd;
}
/**
* 设置 结束 收费金额(单位:分)
* @param amountEnd
*/
public void setAmountEnd(Integer amountEnd){
this.amountEnd = amountEnd;
}
/**
* 获取 增加 收费金额(单位:分)
* @return amountIncrement
*/
public Integer getAmountIncrement(){
return this.amountIncrement;
}
/**
* 设置 增加 收费金额(单位:分)
* @param amountIncrement
*/
public void setAmountIncrement(Integer amountIncrement){
this.amountIncrement = amountIncrement;
}
/**
* 获取 收费金额(单位:分)
* @return amountList
*/
public List<Integer> getAmountList(){
return this.amountList;
}
/**
* 设置 收费金额(单位:分)
* @param amountList
*/
public void setAmountList(List<Integer> amountList){
this.amountList = amountList;
}
/**
* 获取 收费金额(单位:分)
* @return amountNotList
*/
public List<Integer> getAmountNotList(){
return this.amountNotList;
}
/**
* 设置 收费金额(单位:分)
* @param amountNotList
*/
public void setAmountNotList(List<Integer> amountNotList){
this.amountNotList = amountNotList;
}
/**
* 设置 序号,主键,自增长
* @param id
......@@ -2909,6 +3101,114 @@ public class ApplyLogQuery extends ApplyLogEntity {
return this;
}
/**
* 设置 是否需要收费
* @param charge
*/
public ApplyLogQuery charge(Integer charge){
setCharge(charge);
return this;
}
/**
* 设置 开始 是否需要收费
* @param chargeStart
*/
public ApplyLogQuery chargeStart(Integer chargeStart){
this.chargeStart = chargeStart;
return this;
}
/**
* 设置 结束 是否需要收费
* @param chargeEnd
*/
public ApplyLogQuery chargeEnd(Integer chargeEnd){
this.chargeEnd = chargeEnd;
return this;
}
/**
* 设置 增加 是否需要收费
* @param chargeIncrement
*/
public ApplyLogQuery chargeIncrement(Integer chargeIncrement){
this.chargeIncrement = chargeIncrement;
return this;
}
/**
* 设置 是否需要收费
* @param chargeList
*/
public ApplyLogQuery chargeList(List<Integer> chargeList){
this.chargeList = chargeList;
return this;
}
/**
* 设置 是否需要收费
* @param chargeNotList
*/
public ApplyLogQuery chargeNotList(List<Integer> chargeNotList){
this.chargeNotList = chargeNotList;
return this;
}
/**
* 设置 收费金额(单位:分)
* @param amount
*/
public ApplyLogQuery amount(Integer amount){
setAmount(amount);
return this;
}
/**
* 设置 开始 收费金额(单位:分)
* @param amountStart
*/
public ApplyLogQuery amountStart(Integer amountStart){
this.amountStart = amountStart;
return this;
}
/**
* 设置 结束 收费金额(单位:分)
* @param amountEnd
*/
public ApplyLogQuery amountEnd(Integer amountEnd){
this.amountEnd = amountEnd;
return this;
}
/**
* 设置 增加 收费金额(单位:分)
* @param amountIncrement
*/
public ApplyLogQuery amountIncrement(Integer amountIncrement){
this.amountIncrement = amountIncrement;
return this;
}
/**
* 设置 收费金额(单位:分)
* @param amountList
*/
public ApplyLogQuery amountList(List<Integer> amountList){
this.amountList = amountList;
return this;
}
/**
* 设置 收费金额(单位:分)
* @param amountNotList
*/
public ApplyLogQuery amountNotList(List<Integer> amountNotList){
this.amountNotList = amountNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
......@@ -2,6 +2,9 @@ package com.mortals.xhx.module.record.model;
import java.util.Date;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
......@@ -11,7 +14,7 @@ import lombok.Data;
* 证照打印记录实体对象
*
* @author zxfei
* @date 2023-07-05
* @date 2024-12-12
*/
@Data
public class PrintLogEntity extends PrintLogVo {
......@@ -89,6 +92,18 @@ public class PrintLogEntity extends PrintLogVo {
* 手机号码
*/
private String mobile;
/**
* 取件人人脸信息
*/
private String faceUrl;
/**
* 取件人签名信息
*/
private String signUrl;
/**
* 打印队列ID
*/
private Long printQueueId;
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -106,41 +121,26 @@ public class PrintLogEntity extends PrintLogVo {
}
public void initAttrValue(){
this.catalogId = -1L;
this.catalogCode = "";
this.catalogName = "";
this.certificateName = "";
this.certificateCode = "";
this.enterpriseName = "";
this.holderName = "";
this.holderIDCardNo = "";
this.pickerName = "";
this.pickerIDCardNo = "";
this.printStatus = 1;
this.printDate = null;
this.statusRemark = "";
this.deviceId = -1L;
this.siteId = -1L;
this.templateId = -1L;
this.templateName = "";
this.mobile = "";
this.faceUrl = "";
this.signUrl = "";
this.printQueueId = null;
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@ import com.mortals.xhx.module.record.model.PrintLogEntity;
* 证照打印记录查询对象
*
* @author zxfei
* @date 2023-07-05
* @date 2024-12-12
*/
public class PrintLogQuery extends PrintLogEntity {
/** 开始 序号,主键,自增长 */
......@@ -208,6 +208,31 @@ public class PrintLogQuery extends PrintLogEntity {
/** 手机号码排除列表 */
private List <String> mobileNotList;
/** 取件人人脸信息 */
private List<String> faceUrlList;
/** 取件人人脸信息排除列表 */
private List <String> faceUrlNotList;
/** 取件人签名信息 */
private List<String> signUrlList;
/** 取件人签名信息排除列表 */
private List <String> signUrlNotList;
/** 开始 打印队列ID */
private Long printQueueIdStart;
/** 结束 打印队列ID */
private Long printQueueIdEnd;
/** 增加 打印队列ID */
private Long printQueueIdIncrement;
/** 打印队列ID列表 */
private List <Long> printQueueIdList;
/** 打印队列ID排除列表 */
private List <Long> printQueueIdNotList;
/** OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4) */
private List<PrintLogQuery> orConditionList;
......@@ -1344,6 +1369,151 @@ public class PrintLogQuery extends PrintLogEntity {
this.mobileNotList = mobileNotList;
}
/**
* 获取 取件人人脸信息
* @return faceUrlList
*/
public List<String> getFaceUrlList(){
return this.faceUrlList;
}
/**
* 设置 取件人人脸信息
* @param faceUrlList
*/
public void setFaceUrlList(List<String> faceUrlList){
this.faceUrlList = faceUrlList;
}
/**
* 获取 取件人人脸信息
* @return faceUrlNotList
*/
public List<String> getFaceUrlNotList(){
return this.faceUrlNotList;
}
/**
* 设置 取件人人脸信息
* @param faceUrlNotList
*/
public void setFaceUrlNotList(List<String> faceUrlNotList){
this.faceUrlNotList = faceUrlNotList;
}
/**
* 获取 取件人签名信息
* @return signUrlList
*/
public List<String> getSignUrlList(){
return this.signUrlList;
}
/**
* 设置 取件人签名信息
* @param signUrlList
*/
public void setSignUrlList(List<String> signUrlList){
this.signUrlList = signUrlList;
}
/**
* 获取 取件人签名信息
* @return signUrlNotList
*/
public List<String> getSignUrlNotList(){
return this.signUrlNotList;
}
/**
* 设置 取件人签名信息
* @param signUrlNotList
*/
public void setSignUrlNotList(List<String> signUrlNotList){
this.signUrlNotList = signUrlNotList;
}
/**
* 获取 开始 打印队列ID
* @return printQueueIdStart
*/
public Long getPrintQueueIdStart(){
return this.printQueueIdStart;
}
/**
* 设置 开始 打印队列ID
* @param printQueueIdStart
*/
public void setPrintQueueIdStart(Long printQueueIdStart){
this.printQueueIdStart = printQueueIdStart;
}
/**
* 获取 结束 打印队列ID
* @return $printQueueIdEnd
*/
public Long getPrintQueueIdEnd(){
return this.printQueueIdEnd;
}
/**
* 设置 结束 打印队列ID
* @param printQueueIdEnd
*/
public void setPrintQueueIdEnd(Long printQueueIdEnd){
this.printQueueIdEnd = printQueueIdEnd;
}
/**
* 获取 增加 打印队列ID
* @return printQueueIdIncrement
*/
public Long getPrintQueueIdIncrement(){
return this.printQueueIdIncrement;
}
/**
* 设置 增加 打印队列ID
* @param printQueueIdIncrement
*/
public void setPrintQueueIdIncrement(Long printQueueIdIncrement){
this.printQueueIdIncrement = printQueueIdIncrement;
}
/**
* 获取 打印队列ID
* @return printQueueIdList
*/
public List<Long> getPrintQueueIdList(){
return this.printQueueIdList;
}
/**
* 设置 打印队列ID
* @param printQueueIdList
*/
public void setPrintQueueIdList(List<Long> printQueueIdList){
this.printQueueIdList = printQueueIdList;
}
/**
* 获取 打印队列ID
* @return printQueueIdNotList
*/
public List<Long> getPrintQueueIdNotList(){
return this.printQueueIdNotList;
}
/**
* 设置 打印队列ID
* @param printQueueIdNotList
*/
public void setPrintQueueIdNotList(List<Long> printQueueIdNotList){
this.printQueueIdNotList = printQueueIdNotList;
}
/**
* 设置 序号,主键,自增长
* @param id
......@@ -2007,6 +2177,98 @@ public class PrintLogQuery extends PrintLogEntity {
return this;
}
/**
* 设置 取件人人脸信息
* @param faceUrl
*/
public PrintLogQuery faceUrl(String faceUrl){
setFaceUrl(faceUrl);
return this;
}
/**
* 设置 取件人人脸信息
* @param faceUrlList
*/
public PrintLogQuery faceUrlList(List<String> faceUrlList){
this.faceUrlList = faceUrlList;
return this;
}
/**
* 设置 取件人签名信息
* @param signUrl
*/
public PrintLogQuery signUrl(String signUrl){
setSignUrl(signUrl);
return this;
}
/**
* 设置 取件人签名信息
* @param signUrlList
*/
public PrintLogQuery signUrlList(List<String> signUrlList){
this.signUrlList = signUrlList;
return this;
}
/**
* 设置 打印队列ID
* @param printQueueId
*/
public PrintLogQuery printQueueId(Long printQueueId){
setPrintQueueId(printQueueId);
return this;
}
/**
* 设置 开始 打印队列ID
* @param printQueueIdStart
*/
public PrintLogQuery printQueueIdStart(Long printQueueIdStart){
this.printQueueIdStart = printQueueIdStart;
return this;
}
/**
* 设置 结束 打印队列ID
* @param printQueueIdEnd
*/
public PrintLogQuery printQueueIdEnd(Long printQueueIdEnd){
this.printQueueIdEnd = printQueueIdEnd;
return this;
}
/**
* 设置 增加 打印队列ID
* @param printQueueIdIncrement
*/
public PrintLogQuery printQueueIdIncrement(Long printQueueIdIncrement){
this.printQueueIdIncrement = printQueueIdIncrement;
return this;
}
/**
* 设置 打印队列ID
* @param printQueueIdList
*/
public PrintLogQuery printQueueIdList(List<Long> printQueueIdList){
this.printQueueIdList = printQueueIdList;
return this;
}
/**
* 设置 打印队列ID
* @param printQueueIdNotList
*/
public PrintLogQuery printQueueIdNotList(List<Long> printQueueIdNotList){
this.printQueueIdNotList = printQueueIdNotList;
return this;
}
/**
* 获取 OR条件集合,列表项之间是OR,项内容之间是AND,如:(list[0].1 and list[0].2) or (list[1].3 and list[1].4)
* @return orConditionList
......
package com.mortals.xhx.module.record.model;
import java.util.List;
import java.util.ArrayList;
import java.math.BigDecimal;
import cn.hutool.core.date.DateUtil;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.mortals.framework.annotation.Excel;
import com.mortals.framework.model.BaseEntityLong;
......@@ -10,12 +13,16 @@ import lombok.Data;
* 证照打印记录实体对象
*
* @author zxfei
* @date 2023-07-05
* @date 2024-12-17
*/
@Data
public class PrintWaitQueueEntity extends PrintWaitQueueVo {
private static final long serialVersionUID = 1L;
/**
* 站点id
*/
private Long siteId;
/**
* 证照档案ID
*/
......@@ -36,6 +43,14 @@ public class PrintWaitQueueEntity extends PrintWaitQueueVo {
* 目录名称
*/
private String catalogName;
/**
* 证照目录模板ID
*/
private Long templateId;
/**
* 证照模板名称
*/
private String templateName;
/**
* 证照名称
*/
......@@ -81,21 +96,25 @@ public class PrintWaitQueueEntity extends PrintWaitQueueVo {
*/
private Integer total;
/**
* 站点id
* 手机号码
*/
private Long siteId;
private String mobile;
/**
* 证照目录模板ID
* 是否需要收费0否1是
*/
private Long templateId;
private Integer charge;
/**
* 证照模板名称
* 收费金额(单位:分)
*/
private String templateName;
private Integer amount;
/**
* 手机号码
* 支付状态0未支付1已支付
*/
private String mobile;
private Integer paystatus;
/**
* 订单号
*/
private String orderNum;
@Override
public int hashCode() {
return this.getId().hashCode();
......@@ -113,45 +132,29 @@ public class PrintWaitQueueEntity extends PrintWaitQueueVo {
}
public void initAttrValue(){
this.siteId = -1L;
this.recordId = -1L;
this.applyId = -1L;
this.catalogId = -1L;
this.catalogCode = "";
this.catalogName = "";
this.templateId = -1L;
this.templateName = "";
this.certificateName = "";
this.certificateCode = "";
this.enterpriseName = "";
this.holderName = "";
this.holderIDCardNo = "";
this.pickerName = "";
this.pickerIDCardNo = "";
this.previewUrl = "";
this.certificateUrl = "";
this.printStatus = 0;
this.total = 1;
this.siteId = -1L;
this.templateId = -1L;
this.templateName = "";
this.mobile = "";
this.charge = 0;
this.amount = 0;
this.paystatus = 0;
this.orderNum = "";
}
}
\ No newline at end of file
......@@ -15,10 +15,13 @@ import java.util.List;
*/
@Data
public class ApplyLogVo extends BaseEntityLong {
/** 查询条件 */
private String query;
/** 操作类型名称 */
private String operTypeName;
/** 收费金额 */
private Double amountDouble;
}
\ No newline at end of file
......@@ -27,5 +27,5 @@ public interface PrintWaitQueueService extends ICRUDService<PrintWaitQueueEntity
* 打印文件
* @param id
*/
void doPrint(Long id,int printStatus,String statusRemark);
void doPrint(Long id,int printStatus,String statusRemark,String faceUrl,String signUrl);
}
\ No newline at end of file
......@@ -16,7 +16,9 @@ import com.deepoove.poi.plugin.table.MultipleRowTableRenderPolicy;
import com.deepoove.poi.util.RegexUtils;
import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.icbc.api.request.MsySaleDetailQueryRequestV1;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.util.DataUtil;
import com.mortals.xhx.base.system.upload.service.UploadService;
import com.mortals.xhx.base.system.user.model.UserEntity;
import com.mortals.xhx.base.system.user.service.UserService;
......@@ -48,6 +50,8 @@ import org.springframework.web.multipart.MultipartFile;
import sun.misc.BASE64Decoder;
import java.io.*;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
......@@ -113,6 +117,16 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
return query;
}
@Override
protected void findAfter(ApplyLogEntity params, PageInfo pageInfo, Context context, List<ApplyLogEntity> list) throws AppException {
if(CollectionUtils.isNotEmpty(list)){
list.forEach(item->{
BigDecimal aB = new BigDecimal(item.getAmount());
item.setAmountDouble(aB.divide(new BigDecimal(100),2, RoundingMode.HALF_UP).doubleValue());
});
}
}
@Override
protected void validData(ApplyLogEntity entity, Context context) throws AppException {
if(StringUtils.isEmpty(entity.getCertificateCode())){
......@@ -127,21 +141,21 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
if(entity.getHolderType()==null){
throw new AppException("持有者类型不能为空");
}
if(entity.getHolderIdType()==null){
throw new AppException("持有者证件类型不能为空");
}
if(StringUtils.isEmpty(entity.getHolderIDCardNo())){
throw new AppException("持有者证件号码不能为空");
}
if(StringUtils.isEmpty(entity.getPrivateID())){
throw new AppException("专网ID不能为空");
}
if(StringUtils.isEmpty(entity.getEnterpriseName())){
throw new AppException("企业名称不能为空");
}
if(StringUtils.isEmpty(entity.getHolderName())){
throw new AppException("持有者姓名不能为空");
}
// if(entity.getHolderIdType()==null){
// throw new AppException("持有者证件类型不能为空");
// }
// if(StringUtils.isEmpty(entity.getHolderIDCardNo())){
// throw new AppException("持有者证件号码不能为空");
// }
// if(StringUtils.isEmpty(entity.getPrivateID())){
// throw new AppException("专网ID不能为空");
// }
// if(StringUtils.isEmpty(entity.getEnterpriseName())){
// throw new AppException("企业名称不能为空");
// }
// if(StringUtils.isEmpty(entity.getHolderName())){
// throw new AppException("持有者姓名不能为空");
// }
// if(StringUtils.isEmpty(entity.getOriFormContent())){
// throw new AppException("正本表单不能为空");
// }
......@@ -151,6 +165,19 @@ public class ApplyLogServiceImpl extends AbstractCRUDServiceImpl<ApplyLogDao, Ap
if(entity.getTemplateId()==null){
throw new AppException("目录模板ID不能为空");
}
if(entity.getAmountDouble()!=null){
Double amountD = entity.getAmountDouble()*100;
Integer amount = new BigDecimal(amountD).intValue();;
entity.setAmount(amount);
if(amount>0) {
entity.setCharge(1);
}else {
entity.setCharge(0);
}
}else {
entity.setCharge(0);
entity.setAmount(0);
}
super.validData(entity, context);
}
......
......@@ -60,6 +60,6 @@ token:
head: mortal
upload:
path: @profiles.filepath@
url: http://192.168.0.98:17216/cpm/file/commonupload?prePath=/file/uploadfile
url: @profiles.uploadUrl@
qrcode:
url: http://rhpt.scjg.chengdu.gov.cn:8091/adap/spjy/process/generateQrCode.do?dto.applyId=
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment