Commit 4350ae1c by 陶湘宇

Merge commit '807eebdd' into develop

* commit '807eebdd':
  8小时后台-- 保单在线支付
parents d83f4fd3 807eebdd
...@@ -22,3 +22,6 @@ MODIFY COLUMN `lzyy` varchar(800) CHARACTER SET utf8 COLLATE utf8_general_ci NUL ...@@ -22,3 +22,6 @@ MODIFY COLUMN `lzyy` varchar(800) CHARACTER SET utf8 COLLATE utf8_general_ci NUL
ALTER TABLE yggl_main_emp` ALTER TABLE yggl_main_emp`
ADD COLUMN `zpgl_zj_id` int(11) NULL DEFAULT NULL COMMENT '职级字典id' AFTER `zpgl_gzdd_id`; ADD COLUMN `zpgl_zj_id` int(11) NULL DEFAULT NULL COMMENT '职级字典id' AFTER `zpgl_gzdd_id`;
ALTER TABLE `timer_test`.`insure_user`
ADD COLUMN `create_time` datetime(0) NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP(0) COMMENT '创建时间' AFTER `reason`;
...@@ -170,3 +170,30 @@ INSERT INTO `timer_test`.`qyzx_admin_menu`(`id`, `menu_code`, `menu_name`, `sort ...@@ -170,3 +170,30 @@ INSERT INTO `timer_test`.`qyzx_admin_menu`(`id`, `menu_code`, `menu_name`, `sort
ALTER TABLE `timer_test`.`insure_user` ALTER TABLE `timer_test`.`insure_user`
ADD COLUMN `reason` varchar(255) NULL COMMENT '批改原因' AFTER `apply_type`; ADD COLUMN `reason` varchar(255) NULL COMMENT '批改原因' AFTER `apply_type`;
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for insure_pay
-- ----------------------------
DROP TABLE IF EXISTS `insure_pay`;
CREATE TABLE `insure_pay` (
`id` int(11) NOT NULL COMMENT 'id',
`pay_status` int(11) NULL DEFAULT NULL COMMENT '1已支付 2未支付 3已超时',
`amount` double NULL DEFAULT NULL COMMENT '支付金额',
`pay_time` datetime(0) NULL DEFAULT NULL COMMENT '支付时间',
`end_time` datetime(0) NULL DEFAULT NULL COMMENT '超时时间',
`pay_serial_no` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '支付流水号',
`pay_type` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL COMMENT '支付类型',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8 COLLATE = utf8_general_ci COMMENT = '支付流水表' ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;
ALTER TABLE `insure_product`
ADD COLUMN `pay_type` int(11) NULL DEFAULT NULL COMMENT '1 在线支付 2预付款 3线下支付' AFTER `is_del`;
ALTER TABLE `insure_policy`
ADD COLUMN `policy_pay_type` int(11) NOT NULL DEFAULT 1 COMMENT '1在线支付 2预付款 3线下支付' AFTER `create_time`,
ADD COLUMN `pay_id` int(11) NULL DEFAULT NULL COMMENT 'insure_pay表的id' AFTER `policy_pay_type`;
...@@ -13,7 +13,17 @@ import java.util.List; ...@@ -13,7 +13,17 @@ import java.util.List;
@Data @Data
public class CallBack implements Serializable { public class CallBack implements Serializable {
private static final long serialVersionUID = 61499950876094044L; private static final long serialVersionUID = 61499950876094044L;
/**
* 0失败 1成功
* 保全复核回调:0代表核保失败,1代表核保成功,核保成功才可调用支付
* 保全批单回调:0代表保全失败,1代表保全成功
*/
private String status; private String status;
/**
* 1保全复核回调
* 2保全批单回调
*/
private String callback_type;
private String policy_status; private String policy_status;
private String err_msg; private String err_msg;
private String policy_no; private String policy_no;
......
package cn.timer.api.bean.insure;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Date;
/**
* 支付流水表
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-05-18 19:33:23
*/
@Entity
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "insure_pay")
@ApiModel("支付流水表")
public class InsurePay extends Model<InsurePay> {
private static final long serialVersionUID = 1L;
/**
* id
*/
@Id
@GeneratedValue
@TableId(type = IdType.AUTO)
@ApiModelProperty(value = "编号")
private Integer id;
/**
* 1已支付 2未支付 3已超时
*/
private Integer payStatus;
/**
* 支付金额
*/
private Double amount;
/**
* 支付时间
*/
private Date payTime;
/**
* 超时时间
*/
private Date endTime;
/**
* 支付流水号
*/
private String paySerialNo;
/**
* 支付类型
*/
private String payType;
private Integer policyId;
private String serialNumber;
/**
* 设置:id
*/
public void setId(Integer id) {
this.id = id;
}
/**
* 获取:id
*/
public Integer getId() {
return id;
}
/**
* 设置:1已支付 2未支付 3已超时
*/
public void setPayStatus(Integer payStatus) {
this.payStatus = payStatus;
}
/**
* 获取:1已支付 2未支付 3已超时
*/
public Integer getPayStatus() {
return payStatus;
}
/**
* 设置:支付金额
*/
public void setAmount(Double amount) {
this.amount = amount;
}
/**
* 获取:支付金额
*/
public Double getAmount() {
return amount;
}
/**
* 设置:支付时间
*/
public void setPayTime(Date payTime) {
this.payTime = payTime;
}
/**
* 获取:支付时间
*/
public Date getPayTime() {
return payTime;
}
/**
* 设置:超时时间
*/
public void setEndTime(Date endTime) {
this.endTime = endTime;
}
/**
* 获取:超时时间
*/
public Date getEndTime() {
return endTime;
}
/**
* 设置:支付流水号
*/
public void setPaySerialNo(String paySerialNo) {
this.paySerialNo = paySerialNo;
}
/**
* 获取:支付流水号
*/
public String getPaySerialNo() {
return paySerialNo;
}
/**
* 设置:支付类型
*/
public void setPayType(String payType) {
this.payType = payType;
}
/**
* 获取:支付类型
*/
public String getPayType() {
return payType;
}
}
...@@ -87,7 +87,7 @@ public class InsurePolicy extends Model<InsurePolicy> { ...@@ -87,7 +87,7 @@ public class InsurePolicy extends Model<InsurePolicy> {
*/ */
private String totalPremium; private String totalPremium;
/** /**
* 1-正常 * 1-正常 2-等待校验 3-失效 4支付中
*/ */
private String status; private String status;
/** /**
...@@ -117,4 +117,14 @@ public class InsurePolicy extends Model<InsurePolicy> { ...@@ -117,4 +117,14 @@ public class InsurePolicy extends Model<InsurePolicy> {
private Integer productId; private Integer productId;
/**
* 1在线支付 2预付款 3线下支付
*/
private Integer policyPayType;
/**
* insure_pay表的id
*/
private Integer payId;
} }
...@@ -70,6 +70,11 @@ public class InsureProduct extends Model<InsureProduct> { ...@@ -70,6 +70,11 @@ public class InsureProduct extends Model<InsureProduct> {
private Integer isDel; private Integer isDel;
/** /**
* 1 在线支付 2预付款 3线下支付
*/
private Integer payType;
/**
* 设置:id * 设置:id
*/ */
public void setId(Integer id) { public void setId(Integer id) {
......
package cn.timer.api.bean.insure;
import lombok.Data;
/**
* @Description 支付回调
* @Author wgd
* @Date 2022/5/17 15:26
*/
@Data
public class PayCallBack {
private String serial_number;
private String pay_status;
private String pay_serial_no;
private String pay_time;
private String amount;
private String pay_type;
}
package cn.timer.api.bean.insure;
import lombok.Data;
/**
* @Description TODO
* @Author wgd
* @Date 2022/5/20 18:34
*/
@Data
public class PolicyCallBack {
private String status;
private String policy_status;
private String err_msg;
private String policy_no;
private String serial_number;
private String quote_trans_id;
private String serial_no;
private String policy_file;
private String kit_url;
private String total_premium;
}
package cn.timer.api.controller.insure;
import cn.timer.api.bean.insure.InsurePay;
import cn.timer.api.bean.insure.InsurePolicy;
import cn.timer.api.dao.insure.InsureUserMapper;
import cn.timer.api.utils.Result;
import cn.timer.api.utils.ResultUtil;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
/**
* 支付流水表
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-05-18 19:33:23
*/
@RestController
@RequestMapping("/insurePay")
public class InsurePayController{
@Autowired
private InsureUserMapper insureUserMapper;
@Value("${insure.appid}")
private String appid;
@Value("${insure.secret}")
private String secret;
@Value("${insure.appidq}")
private String appidq;
@Value("${insure.secretq}")
private String secretq;
/*投保支付*/
@Value("${insure.toPayUrl}")
private String toPayUrl;
@GetMapping(value = "/cancelPayment")
@ApiOperation(value = "取消支付", httpMethod = "GET", notes = "取消支付")
public Result<Object> cancelPayment(@RequestParam(required = true,value = "policyId")Integer policyId){
InsurePolicy insurePolicy = InsurePolicy.builder().id(policyId).build().selectById();
if(insurePolicy==null){
return ResultUtil.error("保单不存在");
}
if("4".equals(insurePolicy.getStatus())){
return ResultUtil.error("保单不是未支付状态");
}
// String data = HttpUtils.sendGet(setParams())
return null;
};
}
package cn.timer.api.dao.insure;
import cn.timer.api.bean.insure.InsurePay;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.springframework.stereotype.Repository;
/**
* 支付流水表
*
* @author wgd
* @email 862422848@qq.com
* @date 2022-05-18 19:33:23
*/
@Repository
public interface InsurePayMapper extends BaseMapper<InsurePay> {
}
...@@ -38,6 +38,6 @@ public class InsureDto { ...@@ -38,6 +38,6 @@ public class InsureDto {
private String userName; private String userName;
private String idCardNo; private String idCardNo;
private String reason;/*批改原因*/ private String reason;/*批改原因*/
private Integer payType=1;/*支付方式 默认是在线支付*/
// private String // private String
} }
...@@ -40,5 +40,7 @@ public class PolicyDto { ...@@ -40,5 +40,7 @@ public class PolicyDto {
private String planId; private String planId;
private String categoryId; private String categoryId;
private String productId; private String productId;
private Integer policyPayType;
private Integer payId;
} }
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="cn.timer.api.dao.insure.InsurePayMapper">
<!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsurePay" id="insurePayMap">
<result property="id" column="id"/>
<result property="payStatus" column="pay_status"/>
<result property="amount" column="amount"/>
<result property="payTime" column="pay_time"/>
<result property="endTime" column="end_time"/>
<result property="paySerialNo" column="pay_serial_no"/>
<result property="payType" column="pay_type"/>
<result property="policyId" column="policy_id"/>
<result property="serialNumber" column="serial_number"/>
</resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsurePay">
select *
from insure_pay
where id = #{value}
</select>
<select id="queryList" resultType="cn.timer.api.bean.insure.InsurePay">
select * from insure_pay
<where>
<if test="id != null and id != ''">AND `id` = #{id}</if>
<if test="payStatus != null and payStatus != ''">AND `pay_status` = #{payStatus}</if>
<if test="amount != null and amount != ''">AND `amount` = #{amount}</if>
<if test="payTime != null and payTime != ''">AND `pay_time` = #{payTime}</if>
<if test="endTime != null and endTime != ''">AND `end_time` = #{endTime}</if>
<if test="paySerialNo != null and paySerialNo != ''">AND `pay_serial_no` = #{paySerialNo}</if>
<if test="payType != null and payType != ''">AND `pay_type` = #{payType}</if>
</where>
<choose>
<when test="sidx != null and sidx.trim() != ''">
order by ${sidx} ${order}
</when>
<otherwise>
order by id desc
</otherwise>
</choose>
<if test="offset != null and limit != null">
limit #{offset}, #{limit}
</if>
</select>
<select id="queryTotal" resultType="int">
select count(*) from insure_pay
<where>
<if test="id != null and id != ''">AND `id` = #{id}</if>
<if test="payStatus != null and payStatus != ''">AND `pay_status` = #{payStatus}</if>
<if test="amount != null and amount != ''">AND `amount` = #{amount}</if>
<if test="payTime != null and payTime != ''">AND `pay_time` = #{payTime}</if>
<if test="endTime != null and endTime != ''">AND `end_time` = #{endTime}</if>
<if test="paySerialNo != null and paySerialNo != ''">AND `pay_serial_no` = #{paySerialNo}</if>
<if test="payType != null and payType != ''">AND `pay_type` = #{payType}</if>
</where>
</select>
<insert id="save" parameterType="cn.timer.api.bean.insure.InsurePay">
insert into insure_pay
(`id`,
`pay_status`,
`amount`,
`pay_time`,
`end_time`,
`pay_serial_no`,
`pay_type`)
values (#{id},
#{payStatus},
#{amount},
#{payTime},
#{endTime},
#{paySerialNo},
#{payType})
</insert>
<insert id="saveSelective" parameterType="cn.timer.api.bean.insure.InsurePay">
insert into insure_pay
(
<if test="id != null">`id`</if>
<if test="payStatus != null">,`pay_status`</if>
<if test="amount != null">,`amount`</if>
<if test="payTime != null">,`pay_time`</if>
<if test="endTime != null">,`end_time`</if>
<if test="paySerialNo != null">,`pay_serial_no`</if>
<if test="payType != null">,`pay_type`</if>
)
values
(
<if test="id != null">#{id}</if>
<if test="payStatus != null">,#{payStatus}</if>
<if test="amount != null">,#{amount}</if>
<if test="payTime != null">,#{payTime}</if>
<if test="endTime != null">,#{endTime}</if>
<if test="paySerialNo != null">,#{paySerialNo}</if>
<if test="payType != null">,#{payType}</if>
)
</insert>
<insert id="saveList" parameterType="cn.timer.api.bean.insure.InsurePay">
insert into insure_pay
(
`id`,
`pay_status`,
`amount`,
`pay_time`,
`end_time`,
`pay_serial_no`,
`pay_type`
)
values
<foreach collection="list" item="item" index="index" separator=",">
(
#{item.id},
#{item.payStatus},
#{item.amount},
#{item.payTime},
#{item.endTime},
#{item.paySerialNo},
#{item.payType}
)
</foreach>
</insert>
<update id="update" parameterType="cn.timer.api.bean.insure.InsurePay">
update insure_pay
<set>
<if test="payStatus != null">`pay_status` = #{payStatus},</if>
<if test="amount != null">`amount` = #{amount},</if>
<if test="payTime != null">`pay_time` = #{payTime},</if>
<if test="endTime != null">`end_time` = #{endTime},</if>
<if test="paySerialNo != null">`pay_serial_no` = #{paySerialNo},</if>
<if test="payType != null">`pay_type` = #{payType}</if>
</set>
where id = #{id}
</update>
<delete id="delete">
delete
from insure_pay
where id = #{value}
</delete>
<delete id="deleteBatch">
delete from insure_pay where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
...@@ -23,6 +23,8 @@ ...@@ -23,6 +23,8 @@
<result property="orgCode" column="org_code"/> <result property="orgCode" column="org_code"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="updateTime" column="update_time"/> <result property="updateTime" column="update_time"/>
<result property="policyPayType" column="policy_pay_type"/>
<result property="payId" column="pa_id"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsurePolicy"> <select id="queryObject" resultType="cn.timer.api.bean.insure.InsurePolicy">
...@@ -244,7 +246,8 @@ ...@@ -244,7 +246,8 @@
sum(iu.price) AS totalPremium, sum(iu.price) AS totalPremium,
ip.update_time AS updateTime, ip.update_time AS updateTime,
ip.`status` as `status`, ip.`status` as `status`,
ip.org_code as orgCode ip.org_code as orgCode,
ip.pay_id as payId
FROM FROM
insure_policy ip insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id LEFT JOIN insure_user iu ON iu.policy_id = ip.id
...@@ -303,7 +306,9 @@ ...@@ -303,7 +306,9 @@
ip.org_code as orgCode, ip.org_code as orgCode,
iu.insured_name as insuredName, iu.insured_name as insuredName,
iu.benefit_basic_plan as benefitBasicPlan, iu.benefit_basic_plan as benefitBasicPlan,
iu.benefit_occupation_category as benefitOccupationCategory iu.benefit_occupation_category as benefitOccupationCategory,
ip.policy_pay_type as policyPayType,
ip.product_id as productId
FROM FROM
insure_policy ip insure_policy ip
LEFT JOIN insure_user iu ON iu.policy_id = ip.id LEFT JOIN insure_user iu ON iu.policy_id = ip.id
......
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.core.db.dao.InsureProductMapper"> <mapper namespace="cn.timer.api.dao.insure.InsureProductMapper">
<!-- 可根据自己的需求,是否要使用 --> <!-- 可根据自己的需求,是否要使用 -->
<resultMap type="cn.timer.api.bean.insure.InsureProduct" id="insureProductMap"> <resultMap type="cn.timer.api.bean.insure.InsureProduct" id="insureProductMap">
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<result property="type" column="type"/> <result property="type" column="type"/>
<result property="createTime" column="create_time"/> <result property="createTime" column="create_time"/>
<result property="isDel" column="is_del"/> <result property="isDel" column="is_del"/>
<result property="payType" column="pay_type"/>
</resultMap> </resultMap>
<select id="queryObject" resultType="cn.timer.api.bean.insure.InsureProduct"> <select id="queryObject" resultType="cn.timer.api.bean.insure.InsureProduct">
......
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