Commit 12a7410d by zhouxiao

添加指掌纹文件上传功能

parent 8b9a1faf
#?\u5B9E\u4F53bean\u76EE\u5F55 #?\u5B9E\u4F53bean\u76EE\u5F55
mybatis.type-aliases-package=com.finger.domain mybatis.type-aliases-package=com.finger.domain
#?\u6307\u5B9Asql\u6620\u5C04\u6587\u4EF6 #?\u6307\u5B9Asql\u6620\u5C04\u6587\u4EF6
mybatis.mapperLocations=classpath:mapper/*.xml mybatis.mapperLocations=classpath*:mybatis/fingerconfig/*.xml
#\u6570\u636E\u6E90\u914D\u7F6E #\u6570\u636E\u6E90\u914D\u7F6E
spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver spring.datasource.driver-class-name=com.mysql.cj.jdbc.Driver
......
...@@ -2,34 +2,77 @@ ...@@ -2,34 +2,77 @@
<!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.mapper.fingerAnalysis.fingerConfigMapper"> <mapper namespace="com.mapper.fingerAnalysis.fingerConfigMapper">
<!-- 采集设备表 --> <!-- 采集设备表 -->
<!-- 查询采集设备信息 --> <select id="queryzwsbInfo" parameterType="com.finger.domain.fingerconfig" resultType="com.finger.domain.fingerconfig">
select a.xxzjbh,a.sfzctxzw,a.sfzczwzl,a.dqjkbb,a.cjqswz,
a.cjtxdx,a.txzdz,a.sbxlh,a.sbjksm,a.cjfs,a.tpgs,a.cclj,
b.sfzqpjzwtx,b.sfzygdcj,b.sfsxgdcj,b.bbjk,b.jksm,c.sytdh,
c.zwhgfs,c.bjtcld,c.txlx,c.mld,c.dbd,d.gdzwjxyz,d.gdpmtyrz,
d.zdtqtz from ( select xxzjbh,sfzctxzw,sfzczwzl,dqjkbb,cjqswz,
cjtxdx,txzdz,sbxlh,sbjksm,cjfs,tpgs,cclj from cjsb where 1=1
<if test="sbxlh != null and sbxlh != '' ">
and sbxlh=#{sbxlh, jdbcType=VARCHAR}
</if>
<if test="cjfs != null and cjfs != '' ">
and cjfs=#{cjfs, jdbcType=VARCHAR}
</if>
<if test="dqjkbb != null and dqjkbb != '' ">
and dqjkbb=#{dqjkbb, jdbcType=VARCHAR}
</if>
<if test="xxzjbh != null and xxzjbh != '' ">
and xxzjbh = #{xxzjbh, jdbcType=VARCHAR}
</if>
) a,
(select xxzjbh,sfzctxzw,sfzczwzl,sfzqpjzwtx,
sfzygdcj,sfsxgdcj,bbjk,jksm from jkxx where 1=1
<if test="xxzjbh != null and xxzjbh != '' ">
and xxzjbh=#{xxzjbh,jdbcType=VARCHAR}
</if>
<if test="bbjk != null and bbjk != '' ">
and bbjk=#{bbjk,jdbcType=VARCHAR}
</if>) b,
(select xxzjbh,sytdh,zwhgfs,bjtcld,txlx,mld,dbd from cssz where 1=1
<if test="xxzjbh != null and xxzjbh != '' ">
and xxzjbh=#{sbxlh,jdbcType=VARCHAR}
</if>
) c,
(select xxzjbh,gdzwjxyz,gdpmtyrz,zdtqtz from zwjc where 1=1
<if test="xxzjbh != null and xxzjbh != '' ">
and xxzjbh=#{sbxlh,jdbcType=VARCHAR}
</if>
) d where 1=1 and a.xxzjbh = b.xxzjbh and b.xxzjbh=c.xxzjbh
and c.xxzjbh = d.xxzjbh
</select>
<!-- 查询采集设备信息 -->
<select id="querycjsb" parameterType="com.finger.domain.fingerconfig" resultType="com.finger.domain.fingerconfig"> <select id="querycjsb" parameterType="com.finger.domain.fingerconfig" resultType="com.finger.domain.fingerconfig">
select xxzjbh,sfzctxzw,sfzczwzl,jkbb,cjqswz, select xxzjbh,sfzctxzw,sfzczwzl,dqjkbb,cjqswz,
cjtxdx,txzdz,sbxlh,jksm,cjfs,tpgs,cclj from cjsb where 1=1 cjtxdx,txzdz,sbxlh,sbjksm,cjfs,tpgs,cclj from cjsb where 1=1
<if test="sbxlh != null and sbxlh != '' "> <if test="sbxlh != null and sbxlh != '' ">
and sbxlh=#{sbxlh,jdbcType=VARCHAR} and sbxlh=#{sbxlh, jdbcType=VARCHAR}
</if> </if>
<if test="cjfs != null and cjfs != '' "> <if test="cjfs != null and cjfs != '' ">
and cjfs=#{cjfs,jdbcType=VARCHAR} and cjfs=#{cjfs, jdbcType=VARCHAR}
</if>
<if test="dqjkbb != null and dqjkbb != '' ">
and dqjkbb=#{dqjkbb, jdbcType=VARCHAR}
</if> </if>
<if test="jkbb != null and jkbb != '' "> <if test="xxzjbh != null and xxzjbh != '' ">
and jkbb=#{jkbb,jdbcType=VARCHAR} and xxzjbh = #{xxzjbh, jdbcType=VARCHAR}
</if> </if>
</select> </select>
<!-- 存储采集设备信息 --> <!-- 存储采集设备信息 -->
<insert id="savecjsb" parameterType="com.finger.domain.fingerconfig"> <insert id="savecjsb" parameterType="com.finger.domain.fingerconfig">
insert into cjsb(xxzjbh,sfzctxzw,sfzczwzl,jkbb,cjqswz,cjtxdx,txzdz,sbxlh,jksm,cjfs,tpgs,cclj) insert into cjsb(xxzjbh,sfzctxzw,sfzczwzl,dqjkbb,cjqswz,cjtxdx,txzdz,sbxlh,sbjksm,cjfs,tpgs,cclj)
values (#{xxzjbh, jdbcType=VARCHAR}, values (#{xxzjbh, jdbcType=VARCHAR},
#{sfzctxzw, jdbcType=VARCHAR}, #{sfzctxzw, jdbcType=VARCHAR},
#{sfzczwzl, jdbcType=VARCHAR}, #{sfzczwzl, jdbcType=VARCHAR},
#{jkbb, jdbcType=VARCHAR}, #{dqjkbb, jdbcType=VARCHAR},
#{cjqswz, jdbcType=VARCHAR}, #{cjqswz, jdbcType=VARCHAR},
#{cjtxdx, jdbcType=VARCHAR}, #{cjtxdx, jdbcType=VARCHAR},
#{txzdz, jdbcType=VARCHAR}, #{txzdz, jdbcType=VARCHAR},
#{sbxlh, jdbcType=VARCHAR}, #{sbxlh, jdbcType=VARCHAR},
#{jksm, jdbcType=VARCHAR}, #{sbjksm, jdbcType=VARCHAR},
#{cjfs, jdbcType=VARCHAR}), #{cjfs, jdbcType=VARCHAR},
#{tpgs, jdbcType=VARCHAR}), #{tpgs, jdbcType=VARCHAR},
#{cclj, jdbcType=VARCHAR}) #{cclj, jdbcType=VARCHAR})
</insert> </insert>
<!-- 修改采集设备信息 --> <!-- 修改采集设备信息 -->
...@@ -39,16 +82,16 @@ ...@@ -39,16 +82,16 @@
<if test="sfzctxzw == null or sfzctxzw == ''">sfzctxzw=NULL, </if> <if test="sfzctxzw == null or sfzctxzw == ''">sfzctxzw=NULL, </if>
<if test="sfzczwzl != null and sfzczwzl != ''" >sfzczwzl = #{sfzczwzl,jdbcType=VARCHAR},</if> <if test="sfzczwzl != null and sfzczwzl != ''" >sfzczwzl = #{sfzczwzl,jdbcType=VARCHAR},</if>
<if test="sfzczwzl == null or sfzczwzl == ''">sfzczwzl=NULL, </if> <if test="sfzczwzl == null or sfzczwzl == ''">sfzczwzl=NULL, </if>
<if test="jkbb != null and jkbb != ''" >sfzctxzw = #{jkbb,jdbcType=VARCHAR},</if> <if test="dqjkbb != null and dqjkbb != ''" >dqjkbb = #{dqjkbb,jdbcType=VARCHAR},</if>
<if test="jkbb == null or jkbb == ''">jkbb=NULL, </if> <if test="dqjkbb == null or dqjkbb == ''">dqjkbb=NULL, </if>
<if test="cjqswz != null and cjqswz != ''" >cjqswz = #{cjqswz,jdbcType=VARCHAR},</if> <if test="cjqswz != null and cjqswz != ''" >cjqswz = #{cjqswz,jdbcType=VARCHAR},</if>
<if test="cjqswz == null or cjqswz == ''">cjqswz=NULL, </if> <if test="cjqswz == null or cjqswz == ''">cjqswz=NULL, </if>
<if test="cjtxdx != null and cjtxdx != ''" >cjtxdx = #{cjtxdx,jdbcType=VARCHAR},</if> <if test="cjtxdx != null and cjtxdx != ''" >cjtxdx = #{cjtxdx,jdbcType=VARCHAR},</if>
<if test="cjtxdx == null or cjtxdx == ''">cjtxdx=NULL, </if> <if test="cjtxdx == null or cjtxdx == ''">cjtxdx=NULL, </if>
<if test="txzdz != null and txzdz != ''" >txzdz = #{txzdz,jdbcType=VARCHAR},</if> <if test="txzdz != null and txzdz != ''" >txzdz = #{txzdz,jdbcType=VARCHAR},</if>
<if test="txzdz == null or txzdz == ''">txzdz=NULL, </if> <if test="txzdz == null or txzdz == ''">txzdz=NULL, </if>
<if test="jksm != null and jksm != ''" >jksm = #{jksm,jdbcType=VARCHAR},</if> <if test="sbjksm != null and sbjksm != ''" >sbjksm = #{sbjksm,jdbcType=VARCHAR},</if>
<if test="jksm == null or jksm == ''">jksm=NULL, </if> <if test="sbjksm == null or sbjksm == ''">sbjksm=NULL, </if>
<if test="cjfs != null and cjfs != ''" >cjfs = #{cjfs,jdbcType=VARCHAR},</if> <if test="cjfs != null and cjfs != ''" >cjfs = #{cjfs,jdbcType=VARCHAR},</if>
<if test="cjfs == null or cjfs == ''">cjfs=NULL,</if> <if test="cjfs == null or cjfs == ''">cjfs=NULL,</if>
<if test="tpgs != null and tpgs != ''" >tpgs = #{tpgs,jdbcType=VARCHAR},</if> <if test="tpgs != null and tpgs != ''" >tpgs = #{tpgs,jdbcType=VARCHAR},</if>
...@@ -61,29 +104,25 @@ ...@@ -61,29 +104,25 @@
<!-- 接口信息表 --> <!-- 接口信息表 -->
<!-- 存储接口信息 --> <!-- 存储接口信息 -->
<insert id="savejkxx" parameterType="com.finger.domain.fingerconfig"> <insert id="savejkxx" parameterType="com.finger.domain.fingerconfig">
insert into jkxx(xxzjbh,glbh,sfzctxzw,sfzczwzl,sfzqpjzwtx,sfzygdcj,sfsxgdcj,jkbb,jksm) insert into jkxx(xxzjbh,sfzctxzw,sfzczwzl,sfzqpjzwtx,sfzygdcj,sfsxgdcj,bbjk,jksm)
values (#{xxzjbh, jdbcType=VARCHAR}, values (#{xxzjbh, jdbcType=VARCHAR},
#{glbh, jdbcType=VARCHAR},
#{sfzctxzw, jdbcType=VARCHAR}, #{sfzctxzw, jdbcType=VARCHAR},
#{sfzczwzl, jdbcType=VARCHAR}, #{sfzczwzl, jdbcType=VARCHAR},
#{sfzqpjzwtx, jdbcType=VARCHAR}, #{sfzqpjzwtx, jdbcType=VARCHAR},
#{sfzygdcj, jdbcType=VARCHAR}, #{sfzygdcj, jdbcType=VARCHAR},
#{sfsxgdcj, jdbcType=VARCHAR}, #{sfsxgdcj, jdbcType=VARCHAR},
#{jkbb, jdbcType=VARCHAR}, #{bbjk, jdbcType=VARCHAR},
#{jksm, jdbcType=VARCHAR} #{jksm, jdbcType=VARCHAR})
</insert> </insert>
<!-- 查询接口信息 --> <!-- 查询接口信息 -->
<select id="queryjkxx" parameterType="com.finger.domain.fingerconfig" resultType="com.finger.domain.fingerconfig"> <select id="queryjkxx" parameterType="com.finger.domain.fingerconfig" resultType="com.finger.domain.fingerconfig">
select xxzjbh,glbh,sfzctxzw,sfzczwzl,sfzqpjzwtx, select xxzjbh,sfzctxzw,sfzczwzl,sfzqpjzwtx,
sfzygdcj,sfsxgdcj,jkbb,jksm from jkxx where 1=1 sfzygdcj,sfsxgdcj,bbjk,jksm from jkxx where 1=1
<if test="glbh != null and glbh != '' ">
and glbh=#{glbh,jdbcType=VARCHAR}
</if>
<if test="xxzjbh != null and xxzjbh != '' "> <if test="xxzjbh != null and xxzjbh != '' ">
and xxzjbh=#{xxzjbh,jdbcType=VARCHAR} and xxzjbh=#{xxzjbh,jdbcType=VARCHAR}
</if> </if>
<if test="jkbb != null and jkbb != '' "> <if test="bbjk != null and bbjk != '' ">
and jkbb=#{jkbb,jdbcType=VARCHAR} and bbjk=#{bbjk,jdbcType=VARCHAR}
</if> </if>
</select> </select>
<!-- 修改接口信息 --> <!-- 修改接口信息 -->
...@@ -103,40 +142,34 @@ ...@@ -103,40 +142,34 @@
<if test="txzdz == null or txzdz == ''">txzdz=NULL, </if> <if test="txzdz == null or txzdz == ''">txzdz=NULL, </if>
<if test="jksm != null and jksm != ''" >jksm = #{jksm,jdbcType=VARCHAR},</if> <if test="jksm != null and jksm != ''" >jksm = #{jksm,jdbcType=VARCHAR},</if>
<if test="jksm == null or jksm == ''">jksm=NULL, </if> <if test="jksm == null or jksm == ''">jksm=NULL, </if>
<if test="jkbb != null and jkbb != ''" >jkbb = #{jkbb,jdbcType=VARCHAR}</if> <if test="bbjk != null and bbjk != ''" >bbjk = #{bbjk,jdbcType=VARCHAR}</if>
<if test="jkbb == null or jkbb == ''">jkbb=NULL</if> <if test="bbjk == null or bbjk == ''">bbjk=NULL</if>
where glbh=#{glbh,jdbcType=VARCHAR} and xxzjbh=#{xxzjbh,jdbcType=VARCHAR} where 1=1 and xxzjbh=#{xxzjbh,jdbcType=VARCHAR}
</update> </update>
<!-- 参数设置表 --> <!-- 参数设置表 -->
<!-- 存储参数设置信息 --> <!-- 存储参数设置信息 -->
<insert id="savecssz" parameterType="com.finger.domain.fingerconfig"> <insert id="savecssz" parameterType="com.finger.domain.fingerconfig">
insert into cssz(xxzjbh,glbh,sytdh,zwhgfs,bjtcld,txlx,mld,dbd) insert into cssz(xxzjbh,sytdh,zwhgfs,bjtcld,txlx,mld,dbd)
values (#{xxzjbh, jdbcType=VARCHAR}, values (#{xxzjbh, jdbcType=VARCHAR},
#{glbh, jdbcType=VARCHAR},
#{sytdh, jdbcType=VARCHAR}, #{sytdh, jdbcType=VARCHAR},
#{zwhgfs, jdbcType=VARCHAR}, #{zwhgfs, jdbcType=VARCHAR},
#{bjtcld, jdbcType=VARCHAR}, #{bjtcld, jdbcType=VARCHAR},
#{txlx, jdbcType=VARCHAR}, #{txlx, jdbcType=VARCHAR},
#{mld, jdbcType=VARCHAR}, #{mld, jdbcType=VARCHAR},
#{dbd, jdbcType=VARCHAR} #{dbd, jdbcType=VARCHAR})
</insert> </insert>
<!-- 查询参数设置信息 --> <!-- 查询参数设置信息 -->
<select id="querycssz" parameterType="com.finger.domain.fingerconfig" resultType="com.finger.domain.fingerconfig"> <select id="querycssz" parameterType="com.finger.domain.fingerconfig" resultType="com.finger.domain.fingerconfig">
select xxzjbh,glbh,sytdh,zwhgfs,bjtcld,txlx,mld,dbd from cssz where 1=1 select xxzjbh,sytdh,zwhgfs,bjtcld,txlx,mld,dbd from cssz where 1=1
<if test="xxzjbh != null and xxzjbh != '' "> <if test="xxzjbh != null and xxzjbh != '' ">
and xxzjbh=#{sbxlh,jdbcType=VARCHAR} and xxzjbh=#{sbxlh,jdbcType=VARCHAR}
</if> </if>
<if test="glbh != null and glbh != '' ">
and glbh=#{cjfs,jdbcType=VARCHAR}
</if>
</select> </select>
<!-- 修改参数设置信息 --> <!-- 修改参数设置信息 -->
<update id="editcssz" parameterType="com.finger.domain.fingerconfig"> <update id="editcssz" parameterType="com.finger.domain.fingerconfig">
update cssz set update cssz set
<if test="xxzjbh != null and xxzjbh != ''" >xxzjbh = #{xxzjbh,jdbcType=VARCHAR},</if> <if test="xxzjbh != null and xxzjbh != ''" >xxzjbh = #{xxzjbh,jdbcType=VARCHAR},</if>
<if test="xxzjbh == null or xxzjbh == ''">xxzjbh=NULL, </if> <if test="xxzjbh == null or xxzjbh == ''">xxzjbh=NULL, </if>
<if test="glbh != null and glbh != ''" >glbh = #{glbh,jdbcType=VARCHAR},</if>
<if test="glbh == null or glbh == ''">glbh=NULL, </if>
<if test="sytdh != null and sytdh != ''" >sytdh = #{sytdh,jdbcType=VARCHAR},</if> <if test="sytdh != null and sytdh != ''" >sytdh = #{sytdh,jdbcType=VARCHAR},</if>
<if test="sytdh == null or sytdh == ''">sytdh=NULL, </if> <if test="sytdh == null or sytdh == ''">sytdh=NULL, </if>
<if test="zwhgfs != null and zwhgfs != ''" >zwhgfs = #{zwhgfs,jdbcType=VARCHAR},</if> <if test="zwhgfs != null and zwhgfs != ''" >zwhgfs = #{zwhgfs,jdbcType=VARCHAR},</if>
...@@ -149,27 +182,23 @@ ...@@ -149,27 +182,23 @@
<if test="mld == null or mld == ''">mld=NULL, </if> <if test="mld == null or mld == ''">mld=NULL, </if>
<if test="dbd != null and dbd != ''" >dbd = #{dbd,jdbcType=VARCHAR}</if> <if test="dbd != null and dbd != ''" >dbd = #{dbd,jdbcType=VARCHAR}</if>
<if test="dbd == null or dbd == ''">dbd=NULL</if> <if test="dbd == null or dbd == ''">dbd=NULL</if>
where glbh=#{glbh,jdbcType=VARCHAR} and xxzjbh=#{xxzjbh,jdbcType=VARCHAR} where 1=1 and xxzjbh=#{xxzjbh,jdbcType=VARCHAR}
</update> </update>
<!-- 指纹检查表 --> <!-- 指纹检查表 -->
<!-- 存储指纹检查信息 --> <!-- 存储指纹检查信息 -->
<insert id="savezwjc" parameterType="com.finger.domain.fingerconfig"> <insert id="savezwjc" parameterType="com.finger.domain.fingerconfig">
insert into zwjc(xxzjbh,glbh,gdzwjxyz,gdpmtyrz,zdtqtz) insert into zwjc(xxzjbh,gdzwjxyz,gdpmtyrz,zdtqtz)
values (#{xxzjbh, jdbcType=VARCHAR}, values (#{xxzjbh, jdbcType=VARCHAR},
#{glbh, jdbcType=VARCHAR},
#{gdzwjxyz, jdbcType=VARCHAR}, #{gdzwjxyz, jdbcType=VARCHAR},
#{gdpmtyrz, jdbcType=VARCHAR}, #{gdpmtyrz, jdbcType=VARCHAR},
#{zdtqtz, jdbcType=VARCHAR} #{zdtqtz, jdbcType=VARCHAR})
</insert> </insert>
<!-- 根据指纹检查信息 --> <!-- 根据指纹检查信息 -->
<select id="queryzwjc" parameterType="com.finger.domain.fingerconfig" resultType="com.finger.domain.fingerconfig"> <select id="queryzwjc" parameterType="com.finger.domain.fingerconfig" resultType="com.finger.domain.fingerconfig">
select xxzjbh,glbh,gdzwjxyz,gdpmtyrz,zdtqtz from zwjc where 1=1 select xxzjbh,gdzwjxyz,gdpmtyrz,zdtqtz from zwjc where 1=1
<if test="xxzjbh != null and xxzjbh != '' "> <if test="xxzjbh != null and xxzjbh != '' ">
and xxzjbh=#{sbxlh,jdbcType=VARCHAR} and xxzjbh=#{sbxlh,jdbcType=VARCHAR}
</if> </if>
<if test="glbh != null and glbh != '' ">
and glbh=#{cjfs,jdbcType=VARCHAR}
</if>
</select> </select>
<!-- 修改指纹检查信息 --> <!-- 修改指纹检查信息 -->
<update id="editzwjc" parameterType="com.finger.domain.fingerconfig"> <update id="editzwjc" parameterType="com.finger.domain.fingerconfig">
...@@ -180,6 +209,6 @@ ...@@ -180,6 +209,6 @@
<if test="gdpmtyrz == null or gdpmtyrz == ''">gdpmtyrz=NULL, </if> <if test="gdpmtyrz == null or gdpmtyrz == ''">gdpmtyrz=NULL, </if>
<if test="zdtqtz != null and zdtqtz != ''" >zdtqtz = #{zdtqtz,jdbcType=VARCHAR}</if> <if test="zdtqtz != null and zdtqtz != ''" >zdtqtz = #{zdtqtz,jdbcType=VARCHAR}</if>
<if test="zdtqtz == null or zdtqtz == ''">zdtqtz=NULL</if> <if test="zdtqtz == null or zdtqtz == ''">zdtqtz=NULL</if>
where glbh=#{glbh,jdbcType=VARCHAR} and xxzjbh=#{xxzjbh,jdbcType=VARCHAR} where 1=1 and xxzjbh=#{xxzjbh,jdbcType=VARCHAR}
</update> </update>
</mapper> </mapper>
\ No newline at end of file
...@@ -123,6 +123,20 @@ ...@@ -123,6 +123,20 @@
<scope>system</scope> <scope>system</scope>
<systemPath>${project.basedir}/lib/dom4j-1.6.1.jar</systemPath> <systemPath>${project.basedir}/lib/dom4j-1.6.1.jar</systemPath>
</dependency> </dependency>
<!-- lombok start -->
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.10</version>
<scope>provided</scope>
<optional>true</optional>
</dependency>
<!-- lombok end -->
<dependency>
<groupId>cn.novelweb</groupId>
<artifactId>tool-all</artifactId>
<version>1.3.16</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.finger.controller;
import com.common.buildFingerUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest;
/**
* Created by founder on 2021/8/20.
*/
@Controller
public class dealFingerImgConfig {
@RequestMapping("test4")
@ResponseBody
public String querytest(){
return "success2";
}
@RequestMapping("dealImgStr")
@ResponseBody
public String ImgStrToModelStr(HttpServletRequest request){
String str="";
String rollimgstr = request.getParameter("rollimgstr");
String plaimimgstr = request.getParameter("plaimimgstr");
if(!"".equals(rollimgstr) && rollimgstr != null && !"null".equals(rollimgstr)) {
str = buildFingerUtil.Sbase2Tbase64str(rollimgstr);
}
if(!"".equals(plaimimgstr) && plaimimgstr != null && !"null".equals(plaimimgstr)) {
str = buildFingerUtil.Sbase2Tbase64str(plaimimgstr);;
}
return str;
}
}
package com.finger.controller; package com.finger.controller;
import com.common.buildFingerUtil;
import com.finger.domain.collectInfoMsg; import com.finger.domain.collectInfoMsg;
import com.finger.domain.descriptiveMsg; import com.finger.domain.descriptiveMsg;
import com.finger.domain.fingerImageMsg; import com.finger.domain.fingerImageMsg;
...@@ -14,10 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody; ...@@ -14,10 +15,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.ArrayList; import java.util.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/** /**
* Created by zhouxiao on 2021/7/2. * Created by zhouxiao on 2021/7/2.
...@@ -27,16 +25,13 @@ public class fingerImgController { ...@@ -27,16 +25,13 @@ public class fingerImgController {
@Autowired @Autowired
public fingerImgService fingerImgService; public fingerImgService fingerImgService;
@RequestMapping("test")
@ResponseBody
public String querytest(){
return "success";
}
@RequestMapping("test1") @RequestMapping("test1")
@ResponseBody @ResponseBody
public String querytest1(){ public String querytest1(){
return "终于成功了"; return "终于成功了";
} }
@RequestMapping("saveFingerImg") @RequestMapping("saveFingerImg")
@ResponseBody @ResponseBody
public String saveFingerImg(HttpServletRequest request){ public String saveFingerImg(HttpServletRequest request){
...@@ -191,4 +186,5 @@ public class fingerImgController { ...@@ -191,4 +186,5 @@ public class fingerImgController {
Object[] os = JSONArray.fromObject(listos).toArray(); Object[] os = JSONArray.fromObject(listos).toArray();
return os; return os;
} }
} }
package com.uploader.controller;
import cn.hutool.crypto.SecureUtil;
import cn.novelweb.tool.http.Result;
import cn.novelweb.tool.upload.file.FileInfo;
import cn.novelweb.tool.upload.local.LocalUpload;
import cn.novelweb.tool.upload.local.pojo.UploadFileParam;
import com.alibaba.fastjson.JSONArray;
import io.swagger.annotations.ApiOperation;
import lombok.SneakyThrows;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest;
import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
/**
* @program: toolupload
* @description: 本地上传文件、妙传、断点续传样例-demo
* @author: Dai Yuanchuan
* @create: 2019-10-30 08:24
**/
@CrossOrigin
@RestController
@Slf4j
@RequestMapping(value = "/uploader")
public class UploadDemoController {
private static Logger log = LoggerFactory.getLogger(UploadDemoController.class);
static {
// 修改文件上传的默认路径(如果需要用到的话)
UploadDemoController uc = new UploadDemoController();
LocalUpload.defaultPath = uc.getuploadpath();
}
@SneakyThrows
@RequestMapping(value = "slicing-upload", method = RequestMethod.GET)
public synchronized Result<JSONArray> checkSlicingUploader(UploadParam param) throws Exception {
return LocalUpload.checkFileMd5(param.getIdentifier(), param.getFilename());
}
@SneakyThrows
@ApiOperation(value = "文件上传", notes = "参数:文件[<span style=\"color: red;\">大文件请获取上传token直接对接到七牛云服务器</span>]")
@PostMapping(value = "slicing-upload", consumes = "multipart/*", headers = "content-type=multipart/form-data", produces = "application/json;charset=UTF-8")
public synchronized Result<FileInfo> slicingUploader(UploadParam param, HttpServletRequest request) throws Exception {
String md5 = SecureUtil.md5(param.getFilename());
System.out.println("md5===="+md5);
System.out.println("LocalUpload.defaultPath===="+LocalUpload.defaultPath);
System.out.println("File.separatorChar===="+File.separatorChar);
System.out.println("param.getFilename()===="+param.getFilename());
File file = new File(LocalUpload.defaultPath + File.separatorChar + md5 + File.separatorChar + param.getFilename());
if (file.exists()) {
return Result.ok();
}
UploadFileParam uploadFileParam = UploadFileParam.builder()
.id(param.getIdentifier())
.chunks(param.getTotalChunks())
.chunk(param.getChunkNumber() - 1)
.size(param.getCurrentChunkSize())
.name(param.getFilename())
.file(param.getFile())
.md5(md5)
.build();
return LocalUpload.fragmentFileUploader(uploadFileParam, param.getChunkSize(), request);
}
public String getuploadpath(){
Properties properties = new Properties();
InputStream inputStream = this.getClass().getClassLoader().getResourceAsStream("founder_zwcj.properties");
try {
properties.load(inputStream);
} catch (IOException e) {
e.printStackTrace();
}
String basePath = properties.getProperty("uploadfiles");
return basePath;
}
}
package com.uploader.controller;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.web.multipart.MultipartFile;
/**
* <p>分片上传参数</p>
* <p>2021-02-02 10:27</p>
*
* @author Dan
**/
@NoArgsConstructor
@AllArgsConstructor
@Builder
@Data
@ApiModel(value = "分片上传参数")
@JsonInclude(JsonInclude.Include.NON_NULL)
public class UploadParam {
@ApiModelProperty(value = "当前块的次序,第一个块是 1,注意不是从 0 开始的")
private Integer chunkNumber;
@ApiModelProperty(value = "分块大小,根据 totalSize 和这个值你就可以计算出总共的块数。注意最后一块的大小可能会比这个要大")
private Long chunkSize;
@ApiModelProperty(value = "当前块的大小,实际大小")
private Integer currentChunkSize;
@ApiModelProperty(value = "文件总大小。")
private Long totalSize;
@ApiModelProperty(value = "每个文件的唯一标示")
private String identifier;
@ApiModelProperty(value = "文件名")
private String filename;
@ApiModelProperty(value = "文件夹上传的时候文件的相对路径属性(如果上传的是文件夹)")
private String relativePath;
@ApiModelProperty(value = "文件被分成块的总数")
private Integer totalChunks;
@ApiModelProperty(value = "当前文件的分片对象", required = true)
private MultipartFile file;
public Integer getChunkNumber() {
return chunkNumber;
}
public void setChunkNumber(Integer chunkNumber) {
this.chunkNumber = chunkNumber;
}
public Long getChunkSize() {
return chunkSize;
}
public void setChunkSize(Long chunkSize) {
this.chunkSize = chunkSize;
}
public Integer getCurrentChunkSize() {
return currentChunkSize;
}
public void setCurrentChunkSize(Integer currentChunkSize) {
this.currentChunkSize = currentChunkSize;
}
public Long getTotalSize() {
return totalSize;
}
public void setTotalSize(Long totalSize) {
this.totalSize = totalSize;
}
public String getIdentifier() {
return identifier;
}
public void setIdentifier(String identifier) {
this.identifier = identifier;
}
public String getFilename() {
return filename;
}
public void setFilename(String filename) {
this.filename = filename;
}
public String getRelativePath() {
return relativePath;
}
public void setRelativePath(String relativePath) {
this.relativePath = relativePath;
}
public Integer getTotalChunks() {
return totalChunks;
}
public void setTotalChunks(Integer totalChunks) {
this.totalChunks = totalChunks;
}
public MultipartFile getFile() {
return file;
}
public void setFile(MultipartFile file) {
this.file = file;
}
}
server.port=9003
#?\u5B9E\u4F53bean\u76EE\u5F55 #?\u5B9E\u4F53bean\u76EE\u5F55
mybatis.type-aliases-package=com.finger.domain mybatis.type-aliases-package=com.finger.domain
#?\u6307\u5B9Asql\u6620\u5C04\u6587\u4EF6 #?\u6307\u5B9Asql\u6620\u5C04\u6587\u4EF6
...@@ -10,3 +11,7 @@ spring.datasource.username=root ...@@ -10,3 +11,7 @@ spring.datasource.username=root
spring.datasource.password=123456 spring.datasource.password=123456
spring.datasource.druid.test-on-borrow=true spring.datasource.druid.test-on-borrow=true
spring.datasource.druid.test-while-idle=true spring.datasource.druid.test-while-idle=true
# \u8BBE\u7F6E\u6587\u4EF6\u4E0A\u4F20\u5927\u5C0F
spring.servlet.multipart.max-file-size = 20MB
spring.servlet.multipart.max-request-size = 20MB
\ No newline at end of file
path =F://test//xzzw path =F://test//xzzw
xmlpath=F://test//xzzwb xmlpath=F://test//xzzwb
uploadfiles=F://test//files
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