Browse Source

用户加入站点设置

jz.kai 2 years ago
parent
commit
b2d8998d39

+ 2 - 0
common/src/main/java/com/jpsoft/excellent/modules/sys/entity/User.java

@@ -38,4 +38,6 @@ public class User {
 	private String specialClassName;
 	private String areaId;
 	private String areaName;
+	private String stationId;
+	private String stationName;
 }

+ 1 - 1
common/src/main/resources/mapper/base/WorkStation.xml

@@ -81,7 +81,7 @@ id_,area_id,station_name,del_flag,create_time,create_by,update_time,update_by		f
 			LEFT JOIN base_area b ON a.area_id = b.id_
 		]]>
 		<where>
-			del_flag = 0
+			a.del_flag = 0
 			<if test="searchParams.areaId != null">
 				and a.area_id = #{searchParams.areaId}
 			</if>

+ 6 - 1
common/src/main/resources/mapper/sys/User.xml

@@ -17,6 +17,7 @@
         <result property="phone" column="phone_"/>
         <result property="specialClassId" column="special_class_id"/>
         <result property="areaId" column="area_id"/>
+        <result property="stationId" column="station_id"/>
     </resultMap>
     <insert id="insert" parameterType="com.jpsoft.excellent.modules.sys.entity.User">
         <!--
@@ -27,7 +28,7 @@
         <![CDATA[
 		insert into sys_user
 	    (id_,user_name,password_,real_name,create_time,update_time,
-	    del_flag,create_by,update_by,org_id,phone_,special_class_id,area_id)
+	    del_flag,create_by,update_by,org_id,phone_,special_class_id,area_id,station_id)
 		values
 		(
             #{id,jdbcType=VARCHAR}
@@ -43,6 +44,7 @@
             ,#{phone,jdbcType=VARCHAR}
             ,#{specialClassId,jdbcType=VARCHAR}
             ,#{areaId,jdbcType=VARCHAR}
+            ,#{stationId,jdbcType=VARCHAR}
 		)
 	]]>
     </insert>
@@ -88,6 +90,9 @@
             <if test="areaId!=null">
                 area_id=#{areaId,jdbcType=VARCHAR},
             </if>
+            <if test="stationId!=null">
+                station_id=#{stationId,jdbcType=VARCHAR},
+            </if>
         </set>
         where id_=#{id}
     </update>

+ 8 - 0
web/src/main/java/com/jpsoft/excellent/modules/sys/controller/UserController.java

@@ -4,8 +4,10 @@ import com.github.pagehelper.Page;
 import com.jpsoft.excellent.modules.base.dto.OptionsDTO;
 import com.jpsoft.excellent.modules.base.entity.Area;
 import com.jpsoft.excellent.modules.base.entity.Organization;
+import com.jpsoft.excellent.modules.base.entity.WorkStation;
 import com.jpsoft.excellent.modules.base.service.AreaService;
 import com.jpsoft.excellent.modules.base.service.OrganizationService;
+import com.jpsoft.excellent.modules.base.service.WorkStationService;
 import com.jpsoft.excellent.modules.common.dto.Sort;
 import com.jpsoft.excellent.modules.common.utils.DES3;
 import com.jpsoft.excellent.modules.common.utils.PojoUtils;
@@ -46,6 +48,8 @@ public class UserController {
     private AreaService areaService;
     @Autowired
     private DataDictionaryService dataDictionaryService;
+    @Autowired
+    private WorkStationService workStationService;
 
     @ApiOperation(value="创建空记录")
     @GetMapping("create")
@@ -310,6 +314,10 @@ public class UserController {
                     user.setAreaName(area.getName());
                 }
             }
+            WorkStation workStation = workStationService.get(user.getStationId());
+            if(workStation != null) {
+                user.setStationName(workStation.getStationName());
+            }
         }
 
         msgResult.setResult(true);