Commit 4778f8f0 authored by hanfeng's avatar hanfeng

修改实名认证

parent c7ee4031
package com.xxfc.platform.app.entity;
import java.io.Serializable;
import java.math.BigInteger;
import javax.persistence.*;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
......@@ -94,7 +95,7 @@ public class AppVersion implements Serializable {
*/
@Column(name = "crt_time")
@ApiModelProperty(value = "版本上传时间", hidden = true )
private Long crtTime;
private BigInteger crtTime;
/**
* 是否删除;0-正常;1-删除
......
......@@ -5,12 +5,15 @@ import com.github.pagehelper.PageInfo;
import com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken;
import com.github.wxiaoqi.security.common.constant.RestCode;
import com.github.wxiaoqi.security.common.msg.ObjectRestResponse;
import com.github.wxiaoqi.security.common.util.EntityUtils;
import com.github.wxiaoqi.security.common.util.process.ResultCode;
import com.github.wxiaoqi.security.common.util.process.SystemConfig;
import com.xxfc.platform.app.vo.appVersionQuery;
import com.xxfc.platform.vehicle.common.RestResponse;
import com.xxfc.platform.vehicle.constant.RedisKey;
import io.swagger.annotations.ApiOperation;
import lombok.extern.log4j.Log4j;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.io.FileUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.ibatis.session.RowBounds;
......@@ -38,6 +41,7 @@ import tk.mybatis.mapper.weekend.WeekendSqls;
import java.io.File;
import java.io.IOException;
import java.math.BigInteger;
import java.util.List;
import java.util.concurrent.TimeUnit;
......@@ -49,6 +53,7 @@ import java.util.concurrent.TimeUnit;
* @date 2019-06-24 10:34:00
*/
@Service
@Slf4j
public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
@Value("${app.uploadPath}")
......@@ -59,6 +64,7 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
private RedisTemplate redisTemplate;
public static final DateTimeFormatter DEFAULT_DATE_TIME_FORMATTER = DateTimeFormat.forPattern("yyyy-MM-dd");
private AppVersion entity;
public ObjectRestResponse getVersion(String version,Integer type){
......@@ -125,9 +131,12 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
*/
public ResponseEntity<byte[]> downloadInstallationPackage(String realFileRelPath) throws Exception{
String filePath = uploadPath + realFileRelPath;
File file = new File(filePath);//新建一个文件
HttpHeaders headers = new HttpHeaders();//http头信息
String downloadFileName = new String(file.getName());//设置编码
//新建一个文件
File file = new File(filePath);
//http头信息
HttpHeaders headers = new HttpHeaders();
//设置编码
String downloadFileName = new String(file.getName());
headers.setContentDispositionFormData("attachment", downloadFileName);
headers.setContentType(MediaType.APPLICATION_OCTET_STREAM);
return new ResponseEntity<byte[]>(FileUtils.readFileToByteArray(file),headers, HttpStatus.CREATED);
......@@ -137,11 +146,14 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
* 添加版本信息
* @param appVersion
*/
@Transactional
@Transactional(rollbackFor = Exception.class)
public void insertAppVersion(AppVersion appVersion) {
appVersion.setDownloadSwitch(0);
if ( appVersion.getDownloadSwitch()==null){
appVersion.setDownloadSwitch(1);
}
insertSelective(appVersion);
}
public AppVersion get(Integer id) {
if (id==null) {
throw new IllegalArgumentException("Parameter is null");
......@@ -164,17 +176,21 @@ public class AppVersionBiz extends BaseBiz<AppVersionMapper,AppVersion> {
*/
public void remove(Integer id) {
AppVersion appVersion = new AppVersion();
appVersion.setId(id);
appVersion.setIsDel(1);
Example example = Example.builder(AppVersion.class)
.where(WeekendSqls.<AppVersion>custom().andEqualTo(AppVersion::getId,id))
.build();
mapper.updateByExampleSelective(appVersion,example);
mapper.updateByPrimaryKeySelective(appVersion);
// mapper.updateByExampleSelective(appVersion,example);
}
public PageInfo<AppVersion> getAll(appVersionQuery query) {
PageHelper.startPage(query.getPage(),query.getLimit());
List<AppVersion> appVersionList = mapper.getAllByquery(query);
return PageInfo.of(appVersionList);
}
@Override
public int insertSelectiveRe(AppVersion entity) {
entity.setCrtTime(BigInteger.valueOf(System.currentTimeMillis()));
return mapper.insertSelective(entity);
}
}
\ No newline at end of file
......@@ -7,7 +7,7 @@
<select id="getAllByquery" parameterType="com.xxfc.platform.app.vo.appVersionQuery"
resultType="com.xxfc.platform.app.entity.AppVersion">
select * from app_version
where 1=1
where is_del=0
<if test="versionName !=null and versionName != ''">
and version_name like concat('%',#{versionName},'%')
</if>
......@@ -19,6 +19,6 @@
<if test="content != null and content != ''">
and content like concat('%',#{content},'%')
</if>
order by crt_time desc
</select>
</mapper>
\ No newline at end of file
......@@ -79,11 +79,11 @@ public class IdInformation implements Serializable {
@JsonFormat(pattern = "yyyyMMdd",timezone="GMT+8")
private Date expirationDate;
/**
* 认证方式
*/
@Column(name = "authentication_methods")
private Integer authenticationMethods;
// /**
// * 认证方式
// */
// @Column(name = "authentication_methods")
// private Integer authenticationMethods;
/**
*创建时间
......
......@@ -48,9 +48,12 @@ public class CertificationController {
MQServiceBiZ mqServiceBiZ;
/**
* 实名认证
* @param idInformation
* @param request
* @return
*/
@PostMapping("/app/certificate")
public ObjectRestResponse certificate(@RequestBody IdInformation idInformation, HttpServletRequest request) {
......
......@@ -406,6 +406,7 @@ public class CertificationService {
Example exa = new Example(IdInformation.class);
Example.Criteria criteria = exa.createCriteria();
criteria.andEqualTo("idNumber",idInformation.getIdNumber());
criteria.andEqualTo("userLonginId",idInformation.getUserLonginId());
List<IdInformation> idInformations = idInformationMapper.selectByExample(exa);
if (CollectionUtils.isEmpty(idInformations)) {
idInformation.setCrtTime(new Date());
......
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