fanxw 2 meses atrás
pai
commit
5521f2dd6e

+ 4 - 0
pom.xml

@@ -54,6 +54,10 @@
54
 			<artifactId>commons-lang3</artifactId>
54
 			<artifactId>commons-lang3</artifactId>
55
 			<version>3.7</version>
55
 			<version>3.7</version>
56
 		</dependency>
56
 		</dependency>
57
+		<dependency>  
58
+		    <groupId>org.springframework.boot</groupId>  
59
+		    <artifactId>spring-boot-starter-security</artifactId>  
60
+		</dependency>
57
 
61
 
58
 		<!-- swagger2 -->
62
 		<!-- swagger2 -->
59
 		<dependency>
63
 		<dependency>

+ 24 - 0
src/main/java/com/chinaitop/depot/WebSecurityConfig.java

@@ -0,0 +1,24 @@
1
+package com.chinaitop.depot;
2
+
3
+import org.springframework.context.annotation.Configuration;
4
+import org.springframework.security.config.annotation.web.builders.HttpSecurity;
5
+import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
6
+import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
7
+
8
+@Configuration
9
+@EnableWebSecurity
10
+public class WebSecurityConfig 
11
+extends WebSecurityConfigurerAdapter 
12
+{
13
+
14
+	@Override
15
+    protected void configure(HttpSecurity http) throws Exception {
16
+		http.authorizeRequests()
17
+		.antMatchers("/**")
18
+		.permitAll() //允许所有用户访问所有资源
19
+        .and()
20
+        .csrf().disable(); // 禁用CSRF(防止伪造的跨域攻击)
21
+
22
+        super.configure(http);
23
+    }
24
+}

+ 1 - 0
src/main/java/com/chinaitop/depot/device/controller/DSblxxjyController.java

@@ -99,6 +99,7 @@ public class DSblxxjyController {
99
             // 生成设备器材编码
99
             // 生成设备器材编码
100
             if (StringUtils.isBlank(dSbxxsjy.getSbbh())) {
100
             if (StringUtils.isBlank(dSbxxsjy.getSbbh())) {
101
                 dSbxxsjy.setSbbh(GeneratingEncodUtils.gotSbbh(dSbxxsjy.getSzdwdm()));
101
                 dSbxxsjy.setSbbh(GeneratingEncodUtils.gotSbbh(dSbxxsjy.getSzdwdm()));
102
+                dSbxxsjy.setCreateTime(new Date());
102
                 sblxxjyService.save(dSbxxsjy); // 新增
103
                 sblxxjyService.save(dSbxxsjy); // 新增
103
             } else {
104
             } else {
104
                 sblxxjyService.update(dSbxxsjy); // 修改
105
                 sblxxjyService.update(dSbxxsjy); // 修改

+ 27 - 4
src/main/java/com/chinaitop/depot/device/mapper/DSbxxsjyMapper.xml

@@ -64,6 +64,8 @@
64
     <result column="shsj" property="shsj" jdbcType="DATE" />
64
     <result column="shsj" property="shsj" jdbcType="DATE" />
65
     <result column="jddw" property="jddw" jdbcType="VARCHAR" />
65
     <result column="jddw" property="jddw" jdbcType="VARCHAR" />
66
     <result column="jdsj" property="jdsj" jdbcType="VARCHAR" />
66
     <result column="jdsj" property="jdsj" jdbcType="VARCHAR" />
67
+    <result column="create_time" property="createTime" jdbcType="TIMESTAMP" />
68
+    <result column="sbyqid" property="sbyqid" jdbcType="INTEGER" />
67
   </resultMap>
69
   </resultMap>
68
   <sql id="Example_Where_Clause" >
70
   <sql id="Example_Where_Clause" >
69
     <where >
71
     <where >
@@ -129,7 +131,7 @@
129
     creator_code, create_date, refresher, refresher_code, refresh_time, remark, sfba, 
131
     creator_code, create_date, refresher, refresher_code, refresh_time, remark, sfba, 
130
     szdwmc, szdwdm, jszt, sbsl, jscs, sblx, mqzt, sfzc, ccbm, sbbm, qyrq, ssfl, jg_id, 
132
     szdwmc, szdwdm, jszt, sbsl, jscs, sblx, mqzt, sfzc, ccbm, sbbm, qyrq, ssfl, jg_id, 
131
     fzd, sbdwmc, zcbh, scrq, rkrq, sbflbh, pzr, cgr, wxdh, bxqx, sblxbh, sbazr, shrmc, 
133
     fzd, sbdwmc, zcbh, scrq, rkrq, sbflbh, pzr, cgr, wxdh, bxqx, sblxbh, sbazr, shrmc, 
132
-    shyj, shsj, jddw, jdsj
134
+    shyj, shsj, jddw, jdsj, create_time, sbyqid
133
   </sql>
135
   </sql>
134
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.device.model.DSbxxsjyExample" >
136
   <select id="selectByExample" resultMap="BaseResultMap" parameterType="com.chinaitop.depot.device.model.DSbxxsjyExample" >
135
     select
137
     select
@@ -169,7 +171,7 @@
169
       zcbh, scrq, rkrq, sbflbh, 
171
       zcbh, scrq, rkrq, sbflbh, 
170
       pzr, cgr, wxdh, bxqx, 
172
       pzr, cgr, wxdh, bxqx, 
171
       sblxbh, sbazr, shrmc, 
173
       sblxbh, sbazr, shrmc, 
172
-      shyj, shsj, jddw, jdsj)
174
+      shyj, shsj, jddw, jdsj, create_time, sbyqid)
173
     values (#{sbbh,jdbcType=VARCHAR}, #{sbyqmc,jdbcType=VARCHAR}, #{kddm,jdbcType=VARCHAR}, 
175
     values (#{sbbh,jdbcType=VARCHAR}, #{sbyqmc,jdbcType=VARCHAR}, #{kddm,jdbcType=VARCHAR}, 
174
       #{sbggxh,jdbcType=VARCHAR}, #{sbms,jdbcType=VARCHAR}, #{sbzt,jdbcType=VARCHAR}, 
176
       #{sbggxh,jdbcType=VARCHAR}, #{sbms,jdbcType=VARCHAR}, #{sbzt,jdbcType=VARCHAR}, 
175
       #{sbfl,jdbcType=VARCHAR}, #{sccj,jdbcType=VARCHAR}, #{cgjg,jdbcType=VARCHAR}, #{sbglz,jdbcType=VARCHAR}, 
177
       #{sbfl,jdbcType=VARCHAR}, #{sccj,jdbcType=VARCHAR}, #{cgjg,jdbcType=VARCHAR}, #{sbglz,jdbcType=VARCHAR}, 
@@ -187,7 +189,8 @@
187
       #{zcbh,jdbcType=VARCHAR}, #{scrq,jdbcType=DATE}, #{rkrq,jdbcType=DATE}, #{sbflbh,jdbcType=VARCHAR}, 
189
       #{zcbh,jdbcType=VARCHAR}, #{scrq,jdbcType=DATE}, #{rkrq,jdbcType=DATE}, #{sbflbh,jdbcType=VARCHAR}, 
188
       #{pzr,jdbcType=VARCHAR}, #{cgr,jdbcType=VARCHAR}, #{wxdh,jdbcType=VARCHAR}, #{bxqx,jdbcType=VARCHAR}, 
190
       #{pzr,jdbcType=VARCHAR}, #{cgr,jdbcType=VARCHAR}, #{wxdh,jdbcType=VARCHAR}, #{bxqx,jdbcType=VARCHAR}, 
189
       #{sblxbh,jdbcType=VARCHAR}, #{sbazr,jdbcType=VARCHAR}, #{shrmc,jdbcType=VARCHAR}, 
191
       #{sblxbh,jdbcType=VARCHAR}, #{sbazr,jdbcType=VARCHAR}, #{shrmc,jdbcType=VARCHAR}, 
190
-      #{shyj,jdbcType=VARCHAR}, #{shsj,jdbcType=DATE}, #{jddw,jdbcType=VARCHAR}, #{jdsj,jdbcType=VARCHAR})
192
+      #{shyj,jdbcType=VARCHAR}, #{shsj,jdbcType=DATE}, #{jddw,jdbcType=VARCHAR}, #{jdsj,jdbcType=VARCHAR},
193
+      #{createTime,jdbcType=TIMESTAMP}, #{sbyqid,jdbcType=INTEGER})
191
   </insert>
194
   </insert>
192
   <insert id="insertSelective" parameterType="com.chinaitop.depot.device.model.DSbxxsjy" >
195
   <insert id="insertSelective" parameterType="com.chinaitop.depot.device.model.DSbxxsjy" >
193
     insert into d_sbxxsjy
196
     insert into d_sbxxsjy
@@ -378,6 +381,12 @@
378
       <if test="jdsj != null">
381
       <if test="jdsj != null">
379
         jdsj,
382
         jdsj,
380
       </if>
383
       </if>
384
+      <if test="createTime != null">
385
+        create_time,
386
+      </if>
387
+      <if test="sbyqid != null">
388
+        sbyqid,
389
+      </if>
381
     </trim>
390
     </trim>
382
     <trim prefix="values (" suffix=")" suffixOverrides="," >
391
     <trim prefix="values (" suffix=")" suffixOverrides="," >
383
       <if test="sbbh != null" >
392
       <if test="sbbh != null" >
@@ -566,6 +575,12 @@
566
       <if test="jdsj != null">
575
       <if test="jdsj != null">
567
         #{jdsj,jdbcType=VARCHAR},
576
         #{jdsj,jdbcType=VARCHAR},
568
       </if>
577
       </if>
578
+      <if test="createTime != null">
579
+        #{createTime,jdbcType=TIMESTAMP},
580
+      </if>
581
+      <if test="sbyqid != null">
582
+        #{sbyqid,jdbcType=INTEGER},
583
+      </if>
569
     </trim>
584
     </trim>
570
   </insert>
585
   </insert>
571
   <select id="countByExample" parameterType="com.chinaitop.depot.device.model.DSbxxsjyExample" resultType="java.lang.Integer" >
586
   <select id="countByExample" parameterType="com.chinaitop.depot.device.model.DSbxxsjyExample" resultType="java.lang.Integer" >
@@ -763,6 +778,12 @@
763
       <if test="record.jdsj != null">
778
       <if test="record.jdsj != null">
764
         jdsj = #{record.jdsj,jdbcType=VARCHAR},
779
         jdsj = #{record.jdsj,jdbcType=VARCHAR},
765
       </if>
780
       </if>
781
+      <if test="record.createTime != null">
782
+        create_time = #{record.createTime,jdbcType=TIMESTAMP},
783
+      </if>
784
+      <if test="record.sbyqid != null">
785
+        sbyqid = #{record.sbyqid,jdbcType=INTEGER},
786
+      </if>
766
     </set>
787
     </set>
767
     <if test="_parameter != null" >
788
     <if test="_parameter != null" >
768
       <include refid="Update_By_Example_Where_Clause" />
789
       <include refid="Update_By_Example_Where_Clause" />
@@ -831,7 +852,9 @@
831
       shyj = #{record.shyj,jdbcType=VARCHAR},
852
       shyj = #{record.shyj,jdbcType=VARCHAR},
832
       shsj = #{record.shsj,jdbcType=DATE},
853
       shsj = #{record.shsj,jdbcType=DATE},
833
       jddw = #{record.jddw,jdbcType=VARCHAR},
854
       jddw = #{record.jddw,jdbcType=VARCHAR},
834
-      jdsj = #{record.jdsj,jdbcType=VARCHAR}
855
+      jdsj = #{record.jdsj,jdbcType=VARCHAR},
856
+      create_time = #{record.createTime,jdbcType=TIMESTAMP},
857
+      sbyqid = #{record.sbyqid,jdbcType=INTEGER}
835
     <if test="_parameter != null" >
858
     <if test="_parameter != null" >
836
       <include refid="Update_By_Example_Where_Clause" />
859
       <include refid="Update_By_Example_Where_Clause" />
837
     </if>
860
     </if>

+ 39 - 1
src/main/java/com/chinaitop/depot/device/model/DSbxxsjy.java

@@ -127,9 +127,15 @@ public class DSbxxsjy {
127
 
127
 
128
     private String jddw;
128
     private String jddw;
129
 
129
 
130
-    @JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
130
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern="yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
131
     private Date jdsj;
131
     private Date jdsj;
132
 
132
 
133
+    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
134
+    private Date createTime;
135
+
136
+    //设备仪器id
137
+    private Integer sbyqid;
138
+
133
     /**
139
     /**
134
      * 设备编号
140
      * 设备编号
135
      * @return sbbh 设备编号
141
      * @return sbbh 设备编号
@@ -1122,4 +1128,36 @@ public class DSbxxsjy {
1122
 		this.jdsj = jdsj;
1128
 		this.jdsj = jdsj;
1123
 	}
1129
 	}
1124
 
1130
 
1131
+	/**
1132
+	 * 创建时间
1133
+	 * @return
1134
+	 */
1135
+	public Date getCreateTime() {
1136
+		return createTime;
1137
+	}
1138
+
1139
+	/**
1140
+	 * 创建时间
1141
+	 * @param createTime
1142
+	 */
1143
+	public void setCreateTime(Date createTime) {
1144
+		this.createTime = createTime;
1145
+	}
1146
+
1147
+	/**
1148
+	 * 设备仪器ID
1149
+	 * @return
1150
+	 */
1151
+	public Integer getSbyqid() {
1152
+		return sbyqid;
1153
+	}
1154
+
1155
+	/**
1156
+	 * 设备仪器ID
1157
+	 * @param sbyqid
1158
+	 */
1159
+	public void setSbyqid(Integer sbyqid) {
1160
+		this.sbyqid = sbyqid;
1161
+	}
1162
+
1125
 }
1163
 }

+ 1 - 1
src/main/java/com/chinaitop/depot/device/service/impl/StorageJsglServiceImpl.java

@@ -94,7 +94,7 @@ public class StorageJsglServiceImpl implements StorageJsglService {
94
 		} else {
94
 		} else {
95
 			updateStorageJsgl(storageJsgl);
95
 			updateStorageJsgl(storageJsgl);
96
 		}
96
 		}
97
-		if ("1".equals(storageJsgl.getDataStatus())) {
97
+		if ("1".equals(storageJsgl.getDataStatus()) && "1".equals(storageJsgl.getYwlx())) {
98
 			depotBusinessFeignService.updateYjssl(Integer.parseInt(storageJsgl.getHtid()), storageJsgl.getBcjssl().toString());
98
 			depotBusinessFeignService.updateYjssl(Integer.parseInt(storageJsgl.getHtid()), storageJsgl.getBcjssl().toString());
99
 		}
99
 		}
100
 	}
100
 	}

+ 7 - 2
src/main/resources/bootstrap.yml

@@ -9,7 +9,7 @@ mybatis:
9
 eureka:
9
 eureka:
10
   client:
10
   client:
11
     service-url:
11
     service-url:
12
-      defaultZone: http://localhost:9001/eureka/
12
+      defaultZone: http://tj_admin:Admin_1234@${eureka.instance.hostname}:9001/eureka/
13
   instance:
13
   instance:
14
     hostname: 172.16.0.16
14
     hostname: 172.16.0.16
15
     prefer-ip-address: true
15
     prefer-ip-address: true
@@ -18,6 +18,11 @@ eureka:
18
     # 告知服务端30秒还未收到心跳的话,就将该服务移除列表(默认90s)
18
     # 告知服务端30秒还未收到心跳的话,就将该服务移除列表(默认90s)
19
     lease-expiration-duration-in-seconds: 30
19
     lease-expiration-duration-in-seconds: 30
20
     status-page-url: http://${eureka.instance.hostname}:${server.port}/swagger-ui.html
20
     status-page-url: http://${eureka.instance.hostname}:${server.port}/swagger-ui.html
21
+
22
+management:
23
+  server:
24
+    port: -1
25
+
21
 spring:
26
 spring:
22
   application:
27
   application:
23
     name: depot-device
28
     name: depot-device
@@ -54,4 +59,4 @@ spring:
54
     date-format: yyyy-MM-dd
59
     date-format: yyyy-MM-dd
55
     time-zone: GMT+8
60
     time-zone: GMT+8
56
 web:
61
 web:
57
-  upload-path: /home/depot/depot-web/apache-tomcat-8.0.53/webapps/ROOT/WEB-INF/classes/static
62
+  upload-path: /home/depot/depot-web/depot-file