Commit 4778f8f0 authored by hanfeng's avatar hanfeng

修改实名认证

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