Commit 0c46d11b authored by 廖旭伟's avatar 廖旭伟

电子表单小程序相关接口

parent 30dc6949
Pipeline #2967 canceled with stages
package com.mortals.xhx.common.utils;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.util.Base64Utils;
import javax.crypto.Cipher;
import javax.crypto.spec.IvParameterSpec;
import javax.crypto.spec.SecretKeySpec;
/**
* AES加密工具类
*
*/
public class AESUtil {
/**
* 日志相关
*/
private static final Logger LOGGER = LoggerFactory.getLogger(AESUtil.class);
/**
* 编码
*/
private static final String ENCODING = "UTF-8";
/**
* 算法定义
*/
private static final String AES_ALGORITHM = "AES";
/**
* 指定填充方式
*/
private static final String CIPHER_PADDING = "AES/ECB/PKCS5Padding";
private static final String CIPHER_CBC_PADDING = "AES/CBC/PKCS5Padding";
/**
* 偏移量(CBC中使用,增强加密算法强度)
*/
private static final String IV_SEED = "tdrdadq59tbss5n7";
/**
* AES加密
* @param content 待加密内容
* @param aesKey 密码
* @return
*/
public static String encrypt(String content, String aesKey){
if(StringUtils.isBlank(content)){
LOGGER.info("AES encrypt: the content is null!");
return null;
}
//判断秘钥是否为16位
if(StringUtils.isNotBlank(aesKey) && aesKey.length() == 16){
try {
//对密码进行编码
byte[] bytes = aesKey.getBytes(ENCODING);
//设置加密算法,生成秘钥
SecretKeySpec skeySpec = new SecretKeySpec(bytes, AES_ALGORITHM);
// "算法/模式/补码方式"
Cipher cipher = Cipher.getInstance(CIPHER_PADDING);
//选择加密
cipher.init(Cipher.ENCRYPT_MODE, skeySpec);
//根据待加密内容生成字节数组
byte[] encrypted = cipher.doFinal(content.getBytes(ENCODING));
//返回base64字符串
return Base64Utils.encodeToString(encrypted);
} catch (Exception e) {
LOGGER.info("AES encrypt exception:" + e.getMessage());
throw new RuntimeException(e);
}
}else {
LOGGER.info("AES encrypt: the aesKey is null or error!");
return null;
}
}
/**
* 解密
*
* @param content 待解密内容
* @param aesKey 密码
* @return
*/
public static String decrypt(String content, String aesKey){
if(StringUtils.isBlank(content)){
LOGGER.info("AES decrypt: the content is null!");
return null;
}
//判断秘钥是否为16位
if(StringUtils.isNotBlank(aesKey) && aesKey.length() == 16){
try {
//对密码进行编码
byte[] bytes = aesKey.getBytes(ENCODING);
//设置解密算法,生成秘钥
SecretKeySpec skeySpec = new SecretKeySpec(bytes, AES_ALGORITHM);
// "算法/模式/补码方式"
Cipher cipher = Cipher.getInstance(CIPHER_PADDING);
//选择解密
cipher.init(Cipher.DECRYPT_MODE, skeySpec);
//先进行Base64解码
byte[] decodeBase64 = Base64Utils.decodeFromString(content);
//根据待解密内容进行解密
byte[] decrypted = cipher.doFinal(decodeBase64);
//将字节数组转成字符串
return new String(decrypted, ENCODING);
} catch (Exception e) {
LOGGER.info("AES decrypt exception:" + e.getMessage());
throw new RuntimeException(e);
}
}else {
LOGGER.info("AES decrypt: the aesKey is null or error!");
return null;
}
}
/**
* AES_CBC加密
*
* @param content 待加密内容
* @param aesKey 密码
* @return
*/
public static String encryptCBC(String content, String aesKey){
if(StringUtils.isBlank(content)){
LOGGER.info("AES_CBC encrypt: the content is null!");
return null;
}
//判断秘钥是否为16位
if(StringUtils.isNotBlank(aesKey) && aesKey.length() == 16){
try {
//对密码进行编码
byte[] bytes = aesKey.getBytes(ENCODING);
//设置加密算法,生成秘钥
SecretKeySpec skeySpec = new SecretKeySpec(bytes, AES_ALGORITHM);
// "算法/模式/补码方式"
Cipher cipher = Cipher.getInstance(CIPHER_CBC_PADDING);
//偏移
IvParameterSpec iv = new IvParameterSpec(IV_SEED.getBytes(ENCODING));
//选择加密
cipher.init(Cipher.ENCRYPT_MODE, skeySpec, iv);
//根据待加密内容生成字节数组
byte[] encrypted = cipher.doFinal(content.getBytes(ENCODING));
//返回base64字符串
return Base64Utils.encodeToString(encrypted);
} catch (Exception e) {
LOGGER.info("AES_CBC encrypt exception:" + e.getMessage());
throw new RuntimeException(e);
}
}else {
LOGGER.info("AES_CBC encrypt: the aesKey is null or error!");
return null;
}
}
/**
* AES_CBC解密
*
* @param content 待解密内容
* @param aesKey 密码
* @return
*/
public static String decryptCBC(String content, String aesKey){
if(StringUtils.isBlank(content)){
LOGGER.info("AES_CBC decrypt: the content is null!");
return null;
}
//判断秘钥是否为16位
if(StringUtils.isNotBlank(aesKey) && aesKey.length() == 16){
try {
//对密码进行编码
byte[] bytes = aesKey.getBytes(ENCODING);
//设置解密算法,生成秘钥
SecretKeySpec skeySpec = new SecretKeySpec(bytes, AES_ALGORITHM);
//偏移
IvParameterSpec iv = new IvParameterSpec(IV_SEED.getBytes(ENCODING));
// "算法/模式/补码方式"
Cipher cipher = Cipher.getInstance(CIPHER_CBC_PADDING);
//选择解密
cipher.init(Cipher.DECRYPT_MODE, skeySpec, iv);
//先进行Base64解码
byte[] decodeBase64 = Base64Utils.decodeFromString(content);
//根据待解密内容进行解密
byte[] decrypted = cipher.doFinal(decodeBase64);
//将字节数组转成字符串
return new String(decrypted, ENCODING);
} catch (Exception e) {
LOGGER.info("AES_CBC decrypt exception:" + e.getMessage());
throw new RuntimeException(e);
}
}else {
LOGGER.info("AES_CBC decrypt: the aesKey is null or error!");
return null;
}
}
public static void main(String[] args) {
// AES支持三种长度的密钥:128位、192位、256位。
// 代码中这种就是128位的加密密钥,16字节 * 8位/字节 = 128位。
String random = "0000000671595991";
// System.out.println("随机key:" + random);
// System.out.println();
//
// System.out.println("---------加密---------");
// String aesResult = encrypt("511181198903042414", random);
// System.out.println("aes加密结果:" + aesResult);
// System.out.println();
//
// System.out.println("---------解密---------");
// String decrypt = decrypt(aesResult, random);
// System.out.println("aes解密结果:" + decrypt);
// System.out.println();
//
//
System.out.println("--------AES_CBC加密解密---------");
String cbcResult = encryptCBC("511181198903042414", random);
System.out.println("aes_cbc加密结果:" + cbcResult);
System.out.println(cbcResult);
System.out.println("R2tB6mi08cAZytixt0nANWQJxrr4pwpjsBVpQ82I4JM=");
System.out.println("---------解密CBC---------");
String cbcDecrypt = decryptCBC("R2tB6mi08cAZytixt0nANWQJxrr4pwpjsBVpQ82I4JM=", random);
System.out.println("aes解密结果:" + cbcDecrypt);
System.out.println();
}
}
package com.mortals.xhx.common.utils;
import cn.hutool.http.HttpRequest;
import cn.hutool.http.HttpResponse;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSONObject;
import lombok.extern.slf4j.Slf4j;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.nio.Buffer;
import java.nio.ByteBuffer;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.StandardOpenOption;
import java.util.HashMap;
import java.util.Locale;
/**
* 微信扫码二维码生成器
*/
@Slf4j
public class WXCreateQRCodeUtil {
private static String ACCESS_TOKEN = "access_token";
private static String ACCESS_TOKEN_URL = "https://api.weixin.qq.com/cgi-bin/token?grant_type=client_credential&appid=%s&secret=%s";
private static String CREATE_QRCODE_URL = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode?access_token=%s";
/***
*
* @param path
* @param appID
* @param appSecret
* @param qRCodeFilePath
*/
public static String createWeiXinQRCode(String path,String appID,String appSecret,String qRCodeFilePath){
String accessTokenUrl = String.format(ACCESS_TOKEN_URL,appID,appSecret);
try {
String rsp = HttpUtil.get(accessTokenUrl,new HashMap<>());
// System.out.println("获取token:");
// System.out.println(rsp);
JSONObject jsonObject = JSONObject.parseObject(rsp);
if(jsonObject.containsKey(ACCESS_TOKEN)){
String accessToken = jsonObject.getString(ACCESS_TOKEN);
String createwxaqrcode = String.format(CREATE_QRCODE_URL,accessToken);
HashMap<String, Object> paramsMap = new HashMap<>();
paramsMap.put("path",path);
paramsMap.put("width",430);
HttpResponse response = HttpRequest.post(createwxaqrcode).body(JSONObject.toJSONString(paramsMap)).execute();
// 获取响应状态码
int status = response.getStatus();
if(status==200) {
// 获取响应的字节流
InputStream inputStream = response.bodyStream();
saveImageFromInputStream(inputStream, qRCodeFilePath);
return qRCodeFilePath;
}else {
log.info("请求微信二维码创建失败,失败响应:{}",response.body());
return null;
}
}else {
log.info("获取微信ACCESS_TOKEN失败");
return null;
}
}catch (Exception e){
log.info("创建二维码发生异常:{}",e.getMessage());
return null;
}
}
public static void saveImageFromInputStream(InputStream inputStream, String outputPath) throws IOException {
try (FileOutputStream outputStream = new FileOutputStream(outputPath)) {
byte[] buffer = new byte[1024];
int bytesRead;
while ((bytesRead = inputStream.read(buffer)) != -1) {
outputStream.write(buffer, 0, bytesRead);
}
}
}
// public static void main(String[] args) {
// String ss = createQRCode("/pages/index/index?query=123","wxd3d6df0ebaf88f98","fe4c83e34f89956960aa0f1f9e8f38b1");
//
// System.out.println(ss);
// }
}
...@@ -75,6 +75,30 @@ public class DatumInfoFieldEntity extends DatumInfoFieldVo { ...@@ -75,6 +75,30 @@ public class DatumInfoFieldEntity extends DatumInfoFieldVo {
* 身份证号 * 身份证号
*/ */
private String idCard; private String idCard;
/**
* 微信openid
*/
private String openId;
/**
* 手机号码
*/
private String mobile;
/**
* 事项id
*/
private Long matterId;
/**
* 事项名称
*/
private String matterName;
/**
* 材料id
*/
private Long materialId;
/**
* 材料名称
*/
private String materialName;
@Override @Override
public int hashCode() { public int hashCode() {
return this.getId().hashCode(); return this.getId().hashCode();
...@@ -106,5 +130,11 @@ public class DatumInfoFieldEntity extends DatumInfoFieldVo { ...@@ -106,5 +130,11 @@ public class DatumInfoFieldEntity extends DatumInfoFieldVo {
this.fieldOrderNo = 0; this.fieldOrderNo = 0;
this.remark = ""; this.remark = "";
this.idCard = ""; this.idCard = "";
this.idCard = "";
this.mobile = "";
this.matterId = null;
this.matterName = "";
this.materialId = null;
this.materialName = "";
} }
} }
\ No newline at end of file
package com.mortals.xhx.module.h5;
import cn.hutool.http.HttpUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.annotation.UnAuth;
import com.mortals.framework.common.Rest;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.model.OrderCol;
import com.mortals.framework.model.PageInfo;
import com.mortals.framework.model.Result;
import com.mortals.framework.service.IUser;
import com.mortals.framework.util.DataUtil;
import com.mortals.framework.util.StringUtils;
import com.mortals.framework.web.BaseJsonBodyController;
import com.mortals.xhx.common.code.YesNoEnum;
import com.mortals.xhx.feign.base.pdu.SitePdu;
import com.mortals.xhx.feign.rsp.ApiResp;
import com.mortals.xhx.module.h5.pdu.MobileCodePdu;
import com.mortals.xhx.module.user.model.UserFillHistoryEntity;
import com.mortals.xhx.module.user.service.UserFillHistoryService;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections4.CollectionUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.util.*;
/**
* 终端访问接口
*/
@RestController
@RequestMapping("terminal/h5")
@Slf4j
public class TerminalController extends BaseJsonBodyController {
/** php接口访问地址 */
@Value("${server.php:http://112.19.80.237:8090}")
private String phpServer;
@Autowired
private UserFillHistoryService userFillHistoryService;
/**
* 发送手机验证码
* @param pdu
* @return
*/
@PostMapping({"mobile/code/send"})
@UnAuth
public Rest<Object> msgCodeSend(@RequestBody MobileCodePdu pdu) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "获取手机验证码";
int code = 1;
try {
String url = phpServer + "/wechat/homebase/msgCode";
String resp = HttpUtil.createPost(url).header("siteid",pdu.getSiteId()).form("phone",pdu.getPhone()).execute().body();
JSONObject jsonObject = JSONObject.parseObject(resp);
if(jsonObject.getIntValue("code")==1){
model.put("message_info", busiDesc + "成功");
}else {
code = -1;
model.put("message_info", jsonObject.getString("msg"));
}
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
model.put("message_info", "手机验证码接口调用异常");
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
/**
* 验证手机号
* @param pdu
* @return
*/
@PostMapping({"mobile/code/check"})
@UnAuth
public Rest<Object> msgCodeCheck(@RequestBody MobileCodePdu pdu) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "校验手机验证码";
int code = 1;
try {
String url = phpServer + "/wechat/homebase/checkMsgCode";
Map<String, Object> paramsMap = new HashMap<>();
paramsMap.put("phone",pdu.getPhone());
paramsMap.put("code",pdu.getCode());
String resp = HttpUtil.createPost(url).header("siteid",pdu.getSiteId()).form(paramsMap).execute().body();
JSONObject jsonObject = JSONObject.parseObject(resp);
if(jsonObject.getIntValue("code")==1){
model.put("message_info", busiDesc + "成功");
}else {
code = -1;
model.put("message_info", jsonObject.getString("msg"));
}
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
model.put("message_info", "手机验证码校验接口调用异常");
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
/**
* 获取我的填单列表
* @param query
* @return
*/
@PostMapping({"fill/history/list"})
@UnAuth
public Rest<Object> historyList(@RequestBody UserFillHistoryEntity query) {
Rest<Object> ret = new Rest();
Map<String, Object> model = new HashMap();
String busiDesc = "填单设备终端用户获取填单记录列表";
int code = 1;
try {
if(StringUtils.isNotEmpty(query.getMobile())||StringUtils.isNotEmpty(query.getIdCard())) {
PageInfo pageInfo = this.buildPageInfo(query);
this.buildPermisionSql(query);
Result<UserFillHistoryEntity> result = userFillHistoryService.find(query, pageInfo, this.getContext());
model.put("data", result.getList());
model.put("pageInfo", result.getPageInfo());
this.parsePageInfo(model, result.getPageInfo());
model.put("message_info", busiDesc + "成功");
}else {
throw new AppException("请输入手机号码或者身份证号码");
}
this.recordSysLog(this.request, busiDesc + " 【成功】");
} catch (Exception var9) {
code = -1;
model.put("message_info", "填单设备终端用户获取填单记录列表异常");
this.doException(this.request, busiDesc, model, var9);
}
ret.setCode(code);
ret.setData(model);
ret.setMsg(model.get("message_info") == null ? "" : model.remove("message_info").toString());
return ret;
}
protected PageInfo buildPageInfo(UserFillHistoryEntity query) {
PageInfo pageInfo = new PageInfo();
if (!ObjectUtils.isEmpty(query) && !ObjectUtils.isEmpty(query.getPage())) {
pageInfo.setCurrPage(query.getPage());
}
if (!ObjectUtils.isEmpty(query) && !ObjectUtils.isEmpty(query.getSize())) {
pageInfo.setPrePageResult(query.getSize());
}
if (ObjectUtils.isEmpty(query.getOrderColList())) {
query.setOrderColList(Arrays.asList(new OrderCol("id", "desc")));
}
return pageInfo;
}
protected void parsePageInfo(Map<String, Object> model, PageInfo pageInfo) {
model.put("total", pageInfo.getTotalResult());
model.put("per_page", pageInfo.getPrePageResult());
model.put("current_page", pageInfo.getCurrPage());
model.put("last_page", pageInfo.getTotalPage());
model.put("pageInfo", pageInfo);
}
protected void buildPermisionSql(UserFillHistoryEntity query) {
String sql = (String)this.request.getAttribute("DATA_PERMISSION_SEARCH_SQL");
if (!ObjectUtils.isEmpty(sql)) {
query.setPermissionSql(sql);
}
}
public static void main(String[] args) {
try {
String url = "http://192.168.0.98:8090" + "/wechat/homebase/msgCode";
Map<String, String> header = new HashMap<>();
header.put("siteid","1");
Map<String, String> paramsMap = new HashMap<>();
paramsMap.put("phone","kYaxRIs67vzhGBdE6Vz74g==");
String resp = resp = cn.hutool.http.HttpUtil.createPost(url).header("siteid","1").form("phone","kYaxRIs67vzhGBdE6Vz74g==").execute().body();
System.out.println("==============================");
System.out.println(resp);
}catch (Exception e){
}
}
}
package com.mortals.xhx.module.h5.pdu;
import lombok.Data;
@Data
public class MobileCodePdu {
/**手机号码 加密后*/
private String phone;
/**验证码*/
private String code;
private String siteId;
}
package com.mortals.xhx.module.h5.pdu;
import lombok.Data;
@Data
public class WechatInfo {
/** 加密后的身份证号码 */
private String enidcard;
/** 加密后的姓名 */
private String enname;
/** 加密后的手机号码 */
private String enphone;
private String openid;
}
package com.mortals.xhx.module.h5.utils;
import com.alibaba.fastjson.JSONObject;
import com.mortals.framework.exception.AppException;
import com.mortals.framework.util.HttpUtil;
import com.mortals.xhx.module.h5.pdu.WechatInfo;
import java.util.HashMap;
import java.util.Map;
public class WechatInfoUtil {
public static WechatInfo getWxInfo(String url, String authtoken) {
try {
Map<String, String> headerMap = new HashMap<>();
headerMap.put("Authtoken",authtoken);
Map<String, String> paramsMap = new HashMap<>();
String resp = HttpUtil.doPost(url, headerMap,paramsMap);
JSONObject jsonObject = JSONObject.parseObject(resp);
if(jsonObject.getIntValue("code")==1){
WechatInfo wechatInfo = JSONObject.parseObject(jsonObject.getString("data"),WechatInfo.class);
return wechatInfo;
}else {
throw new AppException("用户没有实名信息");
}
}catch (Exception e) {
throw new AppException(e.getMessage());
}
}
}
package com.mortals.xhx.module.user.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.user.model.SearchHistoryEntity;
import java.util.List;
/**
* 用户搜索历史记录Dao
* 用户搜索历史记录 DAO接口
*
* @author zxfei
* @date 2025-06-08
*/
public interface SearchHistoryDao extends ICRUDDao<SearchHistoryEntity,Long>{
}
package com.mortals.xhx.module.user.dao;
import com.mortals.framework.dao.ICRUDDao;
import com.mortals.xhx.module.user.model.UserFillHistoryEntity;
import java.util.List;
/**
* 用户填单记录Dao
* 用户填单记录 DAO接口
*
* @author zxfei
* @date 2025-06-08
*/
public interface UserFillHistoryDao extends ICRUDDao<UserFillHistoryEntity,Long>{
}
package com.mortals.xhx.module.user.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.user.dao.SearchHistoryDao;
import com.mortals.xhx.module.user.model.SearchHistoryEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 用户搜索历史记录DaoImpl DAO接口
*
* @author zxfei
* @date 2025-06-08
*/
@Repository("searchHistoryDao")
public class SearchHistoryDaoImpl extends BaseCRUDDaoMybatis<SearchHistoryEntity,Long> implements SearchHistoryDao {
}
package com.mortals.xhx.module.user.dao.ibatis;
import org.springframework.stereotype.Repository;
import com.mortals.xhx.module.user.dao.UserFillHistoryDao;
import com.mortals.xhx.module.user.model.UserFillHistoryEntity;
import java.util.Date;
import com.mortals.framework.dao.ibatis.BaseCRUDDaoMybatis;
import java.util.List;
/**
* 用户填单记录DaoImpl DAO接口
*
* @author zxfei
* @date 2025-06-08
*/
@Repository("userFillHistoryDao")
public class UserFillHistoryDaoImpl extends BaseCRUDDaoMybatis<UserFillHistoryEntity,Long> implements UserFillHistoryDao {
}
package com.mortals.xhx.module.user.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;
import com.mortals.xhx.module.user.model.vo.SearchHistoryVo;
import lombok.Data;
/**
* 用户搜索历史记录实体对象
*
* @author zxfei
* @date 2025-06-08
*/
@Data
public class SearchHistoryEntity extends SearchHistoryVo {
private static final long serialVersionUID = 1L;
/**
* 微信openid
*/
@Excel(name = "微信openid")
private String openId;
/**
* 身份证号码
*/
private String idCard;
/**
* 手机号码
*/
private String mobile;
/**
* 搜索内容
*/
private String content;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof SearchHistoryEntity) {
SearchHistoryEntity tmp = (SearchHistoryEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.openId = "";
this.idCard = "";
this.mobile = "";
this.content = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.user.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;
import com.mortals.xhx.module.user.model.vo.UserFillHistoryVo;
import lombok.Data;
/**
* 用户填单记录实体对象
*
* @author zxfei
* @date 2025-06-08
*/
@Data
public class UserFillHistoryEntity extends UserFillHistoryVo {
private static final long serialVersionUID = 1L;
/**
* 微信openid
*/
@Excel(name = "微信openid")
private String openId;
/**
* 身份证号码
*/
private String idCard;
/**
* 手机号码
*/
private String mobile;
/**
* 事项id
*/
private Long matterId;
/**
* 事项名称
*/
private String matterName;
/**
* 材料id
*/
private Long materialId;
/**
* 材料名称
*/
private String materialName;
/**
* 预览地址
*/
private String preViewPath;
/**
* 提交的表单
*/
private String formContent;
/**
* 合成doc后地址
*/
private String docPath;
/**
* 表单值
*/
private String formValue;
@Override
public int hashCode() {
return this.getId().hashCode();
}
@Override
public boolean equals(Object obj) {
if (obj == null) return false;
if (obj instanceof UserFillHistoryEntity) {
UserFillHistoryEntity tmp = (UserFillHistoryEntity) obj;
if (this.getId() == tmp.getId()) {
return true;
}
}
return false;
}
public void initAttrValue(){
this.openId = "";
this.idCard = "";
this.mobile = "";
this.matterId = null;
this.matterName = "";
this.materialId = null;
this.materialName = "";
this.preViewPath = "";
this.formContent = "";
this.docPath = "";
this.formValue = "";
}
}
\ No newline at end of file
package com.mortals.xhx.module.user.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.user.model.SearchHistoryEntity;
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 2025-06-08
*/
@Data
public class SearchHistoryVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.user.model.vo;
import com.mortals.framework.model.BaseEntityLong;
import com.mortals.xhx.module.user.model.UserFillHistoryEntity;
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 2025-06-08
*/
@Data
public class UserFillHistoryVo extends BaseEntityLong {
/** 主键ID,主键,自增长列表 */
private List <Long> idList;
}
\ No newline at end of file
package com.mortals.xhx.module.user.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.user.model.SearchHistoryEntity;
import com.mortals.xhx.module.user.dao.SearchHistoryDao;
/**
* SearchHistoryService
*
* 用户搜索历史记录 service接口
*
* @author zxfei
* @date 2025-06-08
*/
public interface SearchHistoryService extends ICRUDService<SearchHistoryEntity,Long>{
SearchHistoryDao getDao();
}
\ No newline at end of file
package com.mortals.xhx.module.user.service;
import com.mortals.framework.service.ICRUDService;
import com.mortals.xhx.module.user.model.UserFillHistoryEntity;
import com.mortals.xhx.module.user.dao.UserFillHistoryDao;
/**
* UserFillHistoryService
*
* 用户填单记录 service接口
*
* @author zxfei
* @date 2025-06-08
*/
public interface UserFillHistoryService extends ICRUDService<UserFillHistoryEntity,Long>{
UserFillHistoryDao getDao();
}
\ No newline at end of file
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