| | |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | |
| | | /** |
| | | * 缴费id |
| | | */ |
| | |
| | | /** |
| | | * 是否缴款0否1是 |
| | | */ |
| | | @ApiModelProperty("是否缴款") |
| | | @ApiModelProperty("是否缴款0否1是") |
| | | private Long payStatus; |
| | | |
| | | @ApiModelProperty("缴费类型1个人 2团体") |
| | | private Long payType; |
| | | |
| | | |
| | | @ApiModelProperty("订单编号") |
| | | private String orderNo; |
| | | |
| | | @ApiModelProperty("财政订单编号") |
| | | private String orderId; |
| | | |
| | | @ApiModelProperty("财政缴款凭证") |
| | | private String fileData; |
| | | |
| | | @ApiModelProperty("财政缴费状态0未缴费1缴费中2完成缴费") |
| | | private Long govPayStatus; |
| | | /** |
| | | * 删除标志(0代表存在2代表删除) |
| | | */ |
| | |
| | | public void setPayType(Long payType) { |
| | | this.payType = payType; |
| | | } |
| | | |
| | | public String getOrderNo() { |
| | | return orderNo; |
| | | } |
| | | |
| | | public void setOrderNo(String orderNo) { |
| | | this.orderNo = orderNo; |
| | | } |
| | | |
| | | public String getOrderId() { |
| | | return orderId; |
| | | } |
| | | |
| | | public void setOrderId(String orderId) { |
| | | this.orderId = orderId; |
| | | } |
| | | |
| | | public String getFileData() { |
| | | return fileData; |
| | | } |
| | | |
| | | public void setFileData(String fileData) { |
| | | this.fileData = fileData; |
| | | } |
| | | |
| | | public Long getGovPayStatus() { |
| | | return govPayStatus; |
| | | } |
| | | |
| | | public void setGovPayStatus(Long govPayStatus) { |
| | | this.govPayStatus = govPayStatus; |
| | | } |
| | | |
| | | } |
| | |
| | | import com.gkhy.exam.pay.mapper.NonCoalPayStudentMapper; |
| | | import com.gkhy.exam.pay.service.NonCoalPayStudentService; |
| | | import com.ruoyi.common.exception.ServiceException; |
| | | import com.ruoyi.common.utils.RandomUtil; |
| | | import com.ruoyi.common.utils.SecurityUtils; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import org.springframework.stereotype.Service; |
| | |
| | | checkSameData(nonCoalPayStudent); |
| | | NonCoalPay nonCoalPay = checkNonCoalPay(nonCoalPayStudent.getNonCoalPayId()); |
| | | nonCoalPayStudent.setPayType(nonCoalPay.getPayPersonType().longValue()); |
| | | nonCoalPayStudent.setOrderNo(RandomUtil.generateOrderNumber()); |
| | | nonCoalPayStudent.setGovPayStatus(0L); |
| | | nonCoalPayStudent.setCreateBy(SecurityUtils.getUsername()); |
| | | return nonCoalPayStudentMapper.insertNonCoalPayStudent(nonCoalPayStudent); |
| | | } |
| | |
| | | checkData(nonCoalPayStudent.getId()); |
| | | checkSameData(nonCoalPayStudent); |
| | | nonCoalPayStudent.setPayType(null); |
| | | nonCoalPayStudent.setOrderNo(null); |
| | | nonCoalPayStudent.setUpdateBy(SecurityUtils.getUsername()); |
| | | return nonCoalPayStudentMapper.updateNonCoalPayStudent(nonCoalPayStudent); |
| | | } |
| | |
| | | stu1.setName(stu.getName()); |
| | | stu1.setIdCard(stu.getIdCard()); |
| | | stu1.setPhone(stu.getPhone()); |
| | | stu1.setGovPayStatus(0L); |
| | | stu1.setOrderNo(RandomUtil.generateOrderNumber()); |
| | | stu1.setSex(StudentSex.BOY.getStatus().equals(stu.getSex().trim()) ? 0L : 1L); |
| | | nonCoalPayStudentMapper.insertNonCoalPayStudent(stu1); |
| | | successNum++; |
| | |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="payType" column="pay_type"/> |
| | | <result property="orderNo" column="order_no"/> |
| | | <result property="orderId" column="order_id"/> |
| | | <result property="fileData" column="file_data"/> |
| | | <result property="govPayStatus" column="gov_pay_status"/> |
| | | </resultMap> |
| | | |
| | | <sql id="selectNonCoalPayStudentVo"> |
| | |
| | | create_by, |
| | | create_time, |
| | | del_flag, |
| | | pay_type |
| | | pay_type, |
| | | order_no, |
| | | order_id, |
| | | file_data, |
| | | gov_pay_status |
| | | from non_coal_pay_student |
| | | </sql> |
| | | |
| | |
| | | <if test="sex != null">sex,</if> |
| | | <if test="payCode != null">pay_code,</if> |
| | | <if test="payType != null">pay_type,</if> |
| | | <if test="orderNo != null and orderNo != '' ">order_no,</if> |
| | | <if test="payStatus != null">pay_status,</if> |
| | | <if test="updateBy != null">update_by,</if> |
| | | <if test="updateTime != null">update_time,</if> |
| | |
| | | <if test="sex != null">#{sex},</if> |
| | | <if test="payCode != null">#{payCode},</if> |
| | | <if test="payType != null">#{payType},</if> |
| | | <if test="orderNo != null and orderNo != '' ">#{orderNo},</if> |
| | | <if test="payStatus != null">#{payStatus},</if> |
| | | <if test="updateBy != null">#{updateBy},</if> |
| | | <if test="updateTime != null">#{updateTime},</if> |
| | |
| | | <if test="idCard != null and idCard != ''">id_card = #{idCard},</if> |
| | | <if test="phone != null and phone != ''">phone = #{phone},</if> |
| | | <if test="sex != null">sex = #{sex},</if> |
| | | <if test="orderId != null and orderId != ''">order_id = #{orderId},</if> |
| | | <if test="fileData != null and fileData != ''">file_data = #{fileData},</if> |
| | | <if test="govPayStatus != null">gov_pay_status = #{govPayStatus},</if> |
| | | <if test="payType != null">pay_type = #{payType},</if> |
| | | <if test="payCode != null">pay_code = #{payCode},</if> |
| | | <if test="payStatus != null">pay_status = #{payStatus},</if> |
| | |
| | | package com.ruoyi.common.utils; |
| | | |
| | | |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.Random; |
| | | import java.util.concurrent.atomic.AtomicInteger; |
| | | |
| | | public class RandomUtil { |
| | | /** |
| | | * 字符串池 |
| | | */ |
| | | private static String[] STR_ARR = new String[] { "a", "b", "c", "d", "e", |
| | | private static String[] STR_ARR = new String[]{"a", "b", "c", "d", "e", |
| | | "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", |
| | | "s", "t", "u", "v", "w", "x", "y", "z", "A", "B", "C", "D", "E", |
| | | "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", |
| | | "S", "T", "U", "V", "W", "X", "Y", "Z", "1", "2", "3", "4", "5", |
| | | "6", "7", "8", "9", "0" }; |
| | | "6", "7", "8", "9", "0"}; |
| | | |
| | | /** |
| | | * |
| | | * 根据指定的长度生成的含有大小写字母及数字的字符串 |
| | | * |
| | | * @param length |
| | | * 指定的长度 |
| | | * @param length 指定的长度 |
| | | * @return 按照指定的长度生成的含有大小写字母及数字的字符串 |
| | | */ |
| | | public static String generateRandomString(int length) { |
| | |
| | | public static void main(String[] args) { |
| | | String s = generateRandomString(26); |
| | | System.out.println(s); |
| | | System.out.println(generateOrderNumber()); |
| | | |
| | | } |
| | | |
| | | private static final AtomicInteger SEQUENCE = new AtomicInteger(0); |
| | | private static final int MAX_SEQUENCE = 99999;// 5位数的序列号 |
| | | private static final String ORDER_PER = "SN"; |
| | | |
| | | public static synchronized String generateOrderNumber() { |
| | | String datePart = new SimpleDateFormat("yyyyMMddhhmm").format(new Date()); |
| | | int sequencePart = SEQUENCE.getAndIncrement() % MAX_SEQUENCE; |
| | | String sequenceStr = String.format("%05d", sequencePart); // 保证序列号是5位数,不足的前面补0 |
| | | |
| | | return ORDER_PER + datePart + sequenceStr; |
| | | } |
| | | |
| | | } |