Browse Source

修改用户信息扩展表数据结构

qxp192083 4 years ago
parent
commit
9f3554fd66

+ 3 - 1
suishenbang-admin/src/main/resources/static/css/login.css

@@ -47,9 +47,11 @@ body.signin {
 }
 
 .signinpanel {
+    height: 85%;
 	width:100%;
 	position: absolute;
-	top: 30%;
+	top: 10%;
+    display: flex;
 }
 .signinpanel .logopanel {
 	float:none;

+ 7 - 7
suishenbang-admin/src/main/resources/templates/login.html

@@ -31,7 +31,7 @@
         </div>
     </div>
     <div class="signinpanel">
-        <div class="row">
+        <div class="row" style="margin: auto;width: 100%;">
             <!--<div class="col-sm-7">
                 <div class="signin-info">
                     <div class="logopanel m-b">
@@ -42,18 +42,18 @@
 
                 </div>
             </div>-->
-            <div class="col-md-3 col-md-offset-8">
+            <div class="col-md-3 col-md-offset-7">
                 <form id="signupForm">
-                    <h4 class="no-margins" style="color: black">欢迎登录</h4>
+                    <h4 class="no-margins" style="color: black">欢迎登录</h4>
                     <input type="text"     name="username" class="form-control uname"     placeholder="用户名" value=""    />
                     <input type="password" name="password" class="form-control pword"     placeholder="密码"   value="" />
 					<div class="row m-t" th:if="${captchaEnabled==true}">
-						<div class="col-xs-6">
-						    <input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5" autocomplete="off">
+						<div class="col-xs-7">
+						    <input type="text" name="validateCode" class="form-control code" placeholder="验证码" maxlength="5" autocomplete="off" style="width: 110%">
 						</div>
-						<div class="col-xs-6">
+						<div class="col-xs-5">
 							<a href="javascript:void(0);" title="点击更换验证码">
-								<img th:src="@{captcha/captchaImage(type=${captchaType})}" class="imgcode" width="85%"/>
+								<img th:src="@{captcha/captchaImage(type=${captchaType})}" class="imgcode" style="height:35px;width: 100%;"/>
 							</a>
 						</div>
 					</div>

+ 9 - 3
suishenbang-admin/src/main/resources/templates/system/user/user.html

@@ -46,6 +46,12 @@
 										<option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
 									</select>
 								</li>
+                                <li>
+                                    用户级别:<select name="sysUserExt.salesLevel" th:with="type=${@dict.getType('sales_level')}">
+                                    <option value="">所有</option>
+                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
+                                </select>
+                                </li>
 								<li class="select-time">
 									<label>创建时间: </label>
 									<input type="text" class="time-input" id="startTime" placeholder="开始时间" name="params[beginTime]"/>
@@ -158,18 +164,18 @@
 		        	}
 		        },
 		         {
-		             field: 'sysUserSalesExt.salesLevel',
+		             field: 'sysUserExt.salesLevel',
 		             title: '销售人员等级',
                      formatter: function(value, row, index) {
                          return $.table.selectDictLabel(salesLevelDict, value);
                      }
 		         },
                 {
-                    field: 'sysUserSalesExt.orgName',
+                    field: 'sysUserExt.orgName',
                     title: '组织名称'
                 },
                 {
-                    field: 'sysUserSalesExt.orgCode',
+                    field: 'sysUserExt.orgCode',
                     title: '组织code'
                 },
 		        {

+ 3 - 3
suishenbang-api/src/main/java/com/dgtly/api/controller/SysUserController.java

@@ -7,7 +7,7 @@ import com.dgtly.common.core.domain.ParameterObject;
 import com.dgtly.common.core.domain.ResultType;
 import com.dgtly.common.utils.security.EncryptPassWordClass;
 import com.dgtly.system.domain.SysUser;
-import com.dgtly.system.service.ISysUserSalesExtService;
+import com.dgtly.system.service.ISysUserExtService;
 import com.dgtly.wxportal.domain.WxQyUser;
 import com.dgtly.system.service.ISysUserService;
 import com.dgtly.wxportal.service.IWxQyUserService;
@@ -32,7 +32,7 @@ public class SysUserController extends ApiBaseController {
     @Autowired
     private ISysUserService sysUserService;
     @Autowired
-    private ISysUserSalesExtService userSalesExtService;
+    private ISysUserExtService userExtService;
 
 
     @ApiOperation(value = "绑定微信用户和系统用户",
@@ -120,7 +120,7 @@ public class SysUserController extends ApiBaseController {
         ParameterObject obj =  getParameterObject();
         obj.checkParameterNotNull("bossEmployeeId");
         String bossEmployeeId =obj.getString("bossEmployeeId");
-        List<String> list = userSalesExtService.selectEmployeeIdsByBossEmployeeId(bossEmployeeId);
+        List<String> list = userExtService.selectEmployeeIdsByBossEmployeeId(bossEmployeeId);
         return list.size()>0?AjaxResult.success().putKV("list",list):AjaxResult.error(ResultType.NUll);
     }
 

+ 21 - 21
suishenbang-sync/suishenbang-sync-common/src/main/java/com/dgtly/sync/service/impl/AnalysisSysUserService.java

@@ -16,7 +16,7 @@ import com.dgtly.sync.service.IAnalysisSysUserService;
 import com.dgtly.sync.service.ISyncLogService;
 import com.dgtly.system.domain.SysDictData;
 import com.dgtly.system.domain.SysUser;
-import com.dgtly.system.domain.SysUserSalesExt;
+import com.dgtly.system.domain.SysUserExt;
 import com.dgtly.system.service.ISysConfigService;
 import com.dgtly.system.service.ISysDictDataService;
 import com.dgtly.system.service.ISysUserService;
@@ -117,10 +117,10 @@ public class AnalysisSysUserService implements IAnalysisSysUserService {
                     String sex = ""+(Integer.parseInt(m.getSex())-1);
                     user.setSex(sex);
                     user.setRoleIds(roleIds);
-                    SysUserSalesExt userSalesExt = new SysUserSalesExt();
-                    userSalesExt.setBossEmployeeId(m.getBossEmployeeId());
-                    userSalesExt.setBossName(m.getBossName());
-                    userSalesExt.setSapEmployeeId(m.getSapEmployeeId());
+                    SysUserExt userExt = new SysUserExt();
+                    userExt.setBossEmployeeId(m.getBossEmployeeId());
+                    userExt.setBossName(m.getBossName());
+                    userExt.setSapEmployeeId(m.getSapEmployeeId());
 
                     if (m.getStatus() == 0) {
                         user.setStatus("1");
@@ -132,7 +132,7 @@ public class AnalysisSysUserService implements IAnalysisSysUserService {
 
 
                     if (loginNameList.contains(user.getLoginName())) {
-                        user.setSysUserSalesExt(userSalesExt);
+                        user.setSysUserExt(userExt);
                         sysUserService.updateUserInfoAndSalesExt(user);
                     } else {
 
@@ -143,13 +143,13 @@ public class AnalysisSysUserService implements IAnalysisSysUserService {
                         String fildCode = "";
                         if(m.getStext6()!=null){
                             if(empSet.contains(m.getEmployeePostName())){
-                                userSalesExt.setSalesLevel("emp_level");
-                                userSalesExt.setOrgName(m.getStext6());
+                                userExt.setSalesLevel("emp_level");
+                                userExt.setOrgName(m.getStext6());
                                 fildName = "Org6name";
                                 fildCode = "Org6code";
                             }else if(subofficeSet.contains(m.getEmployeePostName())){
-                                userSalesExt.setSalesLevel("suboffice_level");
-                                userSalesExt.setOrgName(m.getStext6());
+                                userExt.setSalesLevel("suboffice_level");
+                                userExt.setOrgName(m.getStext6());
                                 fildName = "Org6name";
                                 fildCode = "Org6code";
                             }else{
@@ -157,8 +157,8 @@ public class AnalysisSysUserService implements IAnalysisSysUserService {
                             }
                         }else if(m.getStext5()!=null){
                             if(officeSet.contains(m.getEmployeePostName())){
-                                userSalesExt.setSalesLevel("suboffice_level");
-                                userSalesExt.setOrgName(m.getStext5());
+                                userExt.setSalesLevel("suboffice_level");
+                                userExt.setOrgName(m.getStext5());
                                 fildName = "Org5name";
                                 fildCode = "Org5code";
                             }else{
@@ -166,8 +166,8 @@ public class AnalysisSysUserService implements IAnalysisSysUserService {
                             }
                         }else if(m.getStext4()!=null){
                             if(saledeptSet.contains(m.getEmployeePostName())){
-                                userSalesExt.setSalesLevel("office_level");
-                                userSalesExt.setOrgName(m.getStext4());
+                                userExt.setSalesLevel("office_level");
+                                userExt.setOrgName(m.getStext4());
                                 fildName = "Org4name";
                                 fildCode = "Org4code";
                             } else{
@@ -175,8 +175,8 @@ public class AnalysisSysUserService implements IAnalysisSysUserService {
                             }
                         }else if(m.getStext3()!=null){
                             if(companySet.contains(m.getEmployeePostName())){
-                                userSalesExt.setSalesLevel("office_level");
-                                userSalesExt.setOrgName(m.getStext3());
+                                userExt.setSalesLevel("office_level");
+                                userExt.setOrgName(m.getStext3());
                                 fildName = "Org3name";
                                 fildCode = "Org3code";
                             } else{
@@ -188,20 +188,20 @@ public class AnalysisSysUserService implements IAnalysisSysUserService {
 
 
 
-                        if(userSalesExt.getOrgName()!=null){
-                            Map<String,String> map=  metaDiySalesorgtreeMapper.selectSalesorgByName(fildName,fildCode,userSalesExt.getOrgName());
+                        if(userExt.getOrgName()!=null){
+                            Map<String,String> map=  metaDiySalesorgtreeMapper.selectSalesorgByName(fildName,fildCode,userExt.getOrgName());
                             if(map!=null && map.containsKey("orgcode")){
-                                userSalesExt.setOrgCode(map.get("orgcode"));
+                                userExt.setOrgCode(map.get("orgcode"));
                             }
                         }
-                        if(userSalesExt.getOrgCode()==null){
+                        if(userExt.getOrgCode()==null){
                             throw new NotFountOrgCodeException(m);
                         }
                         //修改密码并加密
                         user.setPassword(m.getLoginName());
                         user.setSalt(ShiroSaltUtil.randomSalt());
                         user.setPassword(EncryptPassWordClass.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
-                        user.setSysUserSalesExt(userSalesExt);
+                        user.setSysUserExt(userExt);
                         sysUserService.insertUserAndSalesExt(user);
                         successCount++;
 

+ 5 - 5
suishenbang-system/src/main/java/com/dgtly/system/domain/SysUser.java

@@ -103,7 +103,7 @@ public class SysUser extends BaseEntity
     private String isBindingWx;
 
     /** 用户销售信息扩展 */
-    private SysUserSalesExt  sysUserSalesExt;
+    private SysUserExt  sysUserExt;
 
 
     //    /** 所属销售组织等级 详见字典(sales_level) */
@@ -409,12 +409,12 @@ public class SysUser extends BaseEntity
         this.isBindingWx = isBindingWx;
     }
 
-    public SysUserSalesExt getSysUserSalesExt() {
-        return sysUserSalesExt;
+    public SysUserExt getSysUserExt() {
+        return sysUserExt;
     }
 
-    public void setSysUserSalesExt(SysUserSalesExt sysUserSalesExt) {
-        this.sysUserSalesExt = sysUserSalesExt;
+    public void setSysUserExt(SysUserExt sysUserExt) {
+        this.sysUserExt = sysUserExt;
     }
 
 

+ 2 - 2
suishenbang-system/src/main/java/com/dgtly/system/domain/SysUserSalesExt.java

@@ -6,12 +6,12 @@ import com.dgtly.common.annotation.Excel;
 import com.dgtly.common.core.domain.BaseEntity;
 
 /**
- * 用户销售信息扩展对象 sys_user_sales_ext
+ * 用户信息扩展对象 sys_user_ext
  * 
  * @author qxp
  * @date 2020-07-29
  */
-public class SysUserSalesExt extends BaseEntity
+public class SysUserExt extends BaseEntity
 {
     private static final long serialVersionUID = 1L;
 

+ 13 - 13
suishenbang-system/src/main/java/com/dgtly/system/mapper/SysUserSalesExtMapper.java

@@ -1,6 +1,6 @@
 package com.dgtly.system.mapper;
 
-import com.dgtly.system.domain.SysUserSalesExt;
+import com.dgtly.system.domain.SysUserExt;
 import java.util.List;
 
 /**
@@ -9,7 +9,7 @@ import java.util.List;
  * @author qxp
  * @date 2020-07-29
  */
-public interface SysUserSalesExtMapper 
+public interface SysUserExtMapper
 {
     /**
      * 查询用户销售信息扩展
@@ -17,23 +17,23 @@ public interface SysUserSalesExtMapper
      * @param userId 用户销售信息扩展ID
      * @return 用户销售信息扩展
      */
-    public SysUserSalesExt selectSysUserSalesExtById(Long userId);
+    public SysUserExt selectSysUserExtById(Long userId);
 
     /**
      * 查询用户销售信息扩展列表
      * 
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 用户销售信息扩展集合
      */
-    public List<SysUserSalesExt> selectSysUserSalesExtList(SysUserSalesExt sysUserSalesExt);
+    public List<SysUserExt> selectSysUserExtList(SysUserExt sysUserExt);
 
     /**
      * 新增用户销售信息扩展
      * 
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 结果
      */
-    public int insertSysUserSalesExt(SysUserSalesExt sysUserSalesExt);
+    public int insertSysUserExt(SysUserExt sysUserExt);
 
     /**
      * 根据领导EmployeeId查询所有下属用户id
@@ -46,10 +46,10 @@ public interface SysUserSalesExtMapper
     /**
      * 修改用户销售信息扩展
      * 
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 结果
      */
-    public int updateSysUserSalesExt(SysUserSalesExt sysUserSalesExt);
+    public int updateSysUserExt(SysUserExt sysUserExt);
 
     /**
      * 删除用户销售信息扩展
@@ -57,7 +57,7 @@ public interface SysUserSalesExtMapper
      * @param userId 用户销售信息扩展ID
      * @return 结果
      */
-    public int deleteSysUserSalesExtById(Long userId);
+    public int deleteSysUserExtById(Long userId);
 
     /**
      * 批量删除用户销售信息扩展
@@ -65,13 +65,13 @@ public interface SysUserSalesExtMapper
      * @param userIds 需要删除的数据ID
      * @return 结果
      */
-    public int deleteSysUserSalesExtByIds(String[] userIds);
+    public int deleteSysUserExtByIds(String[] userIds);
 
     /**
      * 插入或更新用户销售信息扩展
      *
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 结果
      */
-    public int insertOrUpSysUserSalesExt(SysUserSalesExt sysUserSalesExt);
+    public int insertOrUpSysUserExt(SysUserExt sysUserExt);
 }

+ 11 - 11
suishenbang-system/src/main/java/com/dgtly/system/service/ISysUserSalesExtService.java

@@ -1,6 +1,6 @@
 package com.dgtly.system.service;
 
-import com.dgtly.system.domain.SysUserSalesExt;
+import com.dgtly.system.domain.SysUserExt;
 import java.util.List;
 
 /**
@@ -9,7 +9,7 @@ import java.util.List;
  * @author qxp
  * @date 2020-07-29
  */
-public interface ISysUserSalesExtService 
+public interface ISysUserExtService
 {
 
 
@@ -19,23 +19,23 @@ public interface ISysUserSalesExtService
      * @param userId 用户销售信息扩展ID
      * @return 用户销售信息扩展
      */
-    public SysUserSalesExt selectSysUserSalesExtById(Long userId);
+    public SysUserExt selectSysUserExtById(Long userId);
 
     /**
      * 查询用户销售信息扩展列表
      * 
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 用户销售信息扩展集合
      */
-    public List<SysUserSalesExt> selectSysUserSalesExtList(SysUserSalesExt sysUserSalesExt);
+    public List<SysUserExt> selectSysUserExtList(SysUserExt sysUserExt);
 
     /**
      * 新增用户销售信息扩展
      * 
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 结果
      */
-    public int insertSysUserSalesExt(SysUserSalesExt sysUserSalesExt);
+    public int insertSysUserExt(SysUserExt sysUserExt);
 
     /**
      * 根据领导EmployeeId查询所有下属用户EmployeeId
@@ -48,10 +48,10 @@ public interface ISysUserSalesExtService
     /**
      * 修改用户销售信息扩展
      * 
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 结果
      */
-    public int updateSysUserSalesExt(SysUserSalesExt sysUserSalesExt);
+    public int updateSysUserExt(SysUserExt sysUserExt);
 
     /**
      * 批量删除用户销售信息扩展
@@ -59,7 +59,7 @@ public interface ISysUserSalesExtService
      * @param ids 需要删除的数据ID
      * @return 结果
      */
-    public int deleteSysUserSalesExtByIds(String ids);
+    public int deleteSysUserExtByIds(String ids);
 
     /**
      * 删除用户销售信息扩展信息
@@ -67,5 +67,5 @@ public interface ISysUserSalesExtService
      * @param userId 用户销售信息扩展ID
      * @return 结果
      */
-    public int deleteSysUserSalesExtById(Long userId);
+    public int deleteSysUserExtById(Long userId);
 }

+ 21 - 21
suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysUserSalesExtServiceImpl.java

@@ -3,9 +3,9 @@ package com.dgtly.system.service.impl;
 import java.util.List;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
-import com.dgtly.system.mapper.SysUserSalesExtMapper;
-import com.dgtly.system.domain.SysUserSalesExt;
-import com.dgtly.system.service.ISysUserSalesExtService;
+import com.dgtly.system.mapper.SysUserExtMapper;
+import com.dgtly.system.domain.SysUserExt;
+import com.dgtly.system.service.ISysUserExtService;
 import com.dgtly.common.core.text.Convert;
 
 /**
@@ -15,10 +15,10 @@ import com.dgtly.common.core.text.Convert;
  * @date 2020-07-29
  */
 @Service
-public class SysUserSalesExtServiceImpl implements ISysUserSalesExtService 
+public class SysUserExtServiceImpl implements ISysUserExtService
 {
     @Autowired
-    private SysUserSalesExtMapper sysUserSalesExtMapper;
+    private SysUserExtMapper sysUserExtMapper;
 
     /**
      * 查询用户销售信息扩展
@@ -27,33 +27,33 @@ public class SysUserSalesExtServiceImpl implements ISysUserSalesExtService
      * @return 用户销售信息扩展
      */
     @Override
-    public SysUserSalesExt selectSysUserSalesExtById(Long userId)
+    public SysUserExt selectSysUserExtById(Long userId)
     {
-        return sysUserSalesExtMapper.selectSysUserSalesExtById(userId);
+        return sysUserExtMapper.selectSysUserExtById(userId);
     }
 
     /**
      * 查询用户销售信息扩展列表
      * 
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 用户销售信息扩展
      */
     @Override
-    public List<SysUserSalesExt> selectSysUserSalesExtList(SysUserSalesExt sysUserSalesExt)
+    public List<SysUserExt> selectSysUserExtList(SysUserExt sysUserExt)
     {
-        return sysUserSalesExtMapper.selectSysUserSalesExtList(sysUserSalesExt);
+        return sysUserExtMapper.selectSysUserExtList(sysUserExt);
     }
 
     /**
      * 新增用户销售信息扩展
      * 
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 结果
      */
     @Override
-    public int insertSysUserSalesExt(SysUserSalesExt sysUserSalesExt)
+    public int insertSysUserExt(SysUserExt sysUserExt)
     {
-        return sysUserSalesExtMapper.insertSysUserSalesExt(sysUserSalesExt);
+        return sysUserExtMapper.insertSysUserExt(sysUserExt);
     }
 
     /**
@@ -64,19 +64,19 @@ public class SysUserSalesExtServiceImpl implements ISysUserSalesExtService
      */
     @Override
     public List<String> selectEmployeeIdsByBossEmployeeId(String bossEmployeeId) {
-        return sysUserSalesExtMapper.selectEmployeeIdsByBossEmployeeId(bossEmployeeId);
+        return sysUserExtMapper.selectEmployeeIdsByBossEmployeeId(bossEmployeeId);
     }
 
     /**
      * 修改用户销售信息扩展
      * 
-     * @param sysUserSalesExt 用户销售信息扩展
+     * @param sysUserExt 用户销售信息扩展
      * @return 结果
      */
     @Override
-    public int updateSysUserSalesExt(SysUserSalesExt sysUserSalesExt)
+    public int updateSysUserExt(SysUserExt sysUserExt)
     {
-        return sysUserSalesExtMapper.updateSysUserSalesExt(sysUserSalesExt);
+        return sysUserExtMapper.updateSysUserExt(sysUserExt);
     }
 
     /**
@@ -86,9 +86,9 @@ public class SysUserSalesExtServiceImpl implements ISysUserSalesExtService
      * @return 结果
      */
     @Override
-    public int deleteSysUserSalesExtByIds(String ids)
+    public int deleteSysUserExtByIds(String ids)
     {
-        return sysUserSalesExtMapper.deleteSysUserSalesExtByIds(Convert.toStrArray(ids));
+        return sysUserExtMapper.deleteSysUserExtByIds(Convert.toStrArray(ids));
     }
 
     /**
@@ -98,8 +98,8 @@ public class SysUserSalesExtServiceImpl implements ISysUserSalesExtService
      * @return 结果
      */
     @Override
-    public int deleteSysUserSalesExtById(Long userId)
+    public int deleteSysUserExtById(Long userId)
     {
-        return sysUserSalesExtMapper.deleteSysUserSalesExtById(userId);
+        return sysUserExtMapper.deleteSysUserExtById(userId);
     }
 }

+ 7 - 7
suishenbang-system/src/main/java/com/dgtly/system/service/impl/SysUserServiceImpl.java

@@ -50,7 +50,7 @@ public class SysUserServiceImpl implements ISysUserService
 
 
     @Autowired
-    private SysUserSalesExtMapper userSalesExtMapper;
+    private SysUserExtMapper userExtMapper;
 
 
 
@@ -206,9 +206,9 @@ public class SysUserServiceImpl implements ISysUserService
         insertUserPost(user);
         // 新增用户与角色管理
         insertUserRole(user);
-        SysUserSalesExt userSalesExt = user.getSysUserSalesExt();
-        userSalesExt.setUserId(user.getUserId());
-        userSalesExtMapper.insertOrUpSysUserSalesExt(userSalesExt);
+        SysUserExt userExt = user.getSysUserExt();
+        userExt.setUserId(user.getUserId());
+        userExtMapper.insertOrUpSysUserExt(userExt);
         return rows;
     }
 
@@ -258,9 +258,9 @@ public class SysUserServiceImpl implements ISysUserService
     public int updateUserInfoAndSalesExt(SysUser user) {
         // 删除用户与角色关联
         SysUser u =  userMapper.selectUserByLoginName(user.getLoginName());
-        SysUserSalesExt userSalesExt = user.getSysUserSalesExt();
-        userSalesExt.setUserId(u.getUserId());
-        userSalesExtMapper.insertOrUpSysUserSalesExt(userSalesExt);
+        SysUserExt userExt = user.getSysUserExt();
+        userExt.setUserId(u.getUserId());
+        userExtMapper.insertOrUpSysUserExt(userExt);
         return userMapper.updateUser(user);
     }
 

+ 8 - 4
suishenbang-system/src/main/resources/mapper/system/SysUserMapper.xml

@@ -31,7 +31,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <!--<result property="orgCode"      column="org_code"     />-->
 		<association property="dept"    column="dept_id" javaType="SysDept" resultMap="deptResult" />
 		<association property="company"    column="company_id" javaType="SysCompany" resultMap="companyResult" />
-        <association property="sysUserSalesExt"    column="user_id" javaType="SysUserSalesExt" resultMap="SysUserSalesExtResult" />
+        <association property="sysUserExt"    column="user_id" javaType="SysUserExt" resultMap="SysUserExtResult" />
         <collection  property="roles"   javaType="java.util.List"        resultMap="RoleResult" />
 
 	</resultMap>
@@ -59,7 +59,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<result property="status"       column="role_status"    />
 	</resultMap>
 
-    <resultMap id="SysUserSalesExtResult" type="SysUserSalesExt" >
+    <resultMap id="SysUserExtResult" type="SysUserExt" >
         <result property="userId"    column="user_id"    />
         <result property="orgCode"    column="org_code"    />
         <result property="salesLevel"    column="sales_level"    />
@@ -81,7 +81,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 			 left join sys_company c on u.company_id = c.id
 			 left join sys_user_role ur on u.user_id = ur.user_id
 			 left join sys_role r on r.role_id = ur.role_id
-			 left join sys_user_sales_ext suse on suse.user_id = u.user_id
+			 left join sys_user_ext suse on suse.user_id = u.user_id
     </sql>
 	
 	<select id="selectUserList" parameterType="SysUser" resultMap="SysUserResult">
@@ -94,7 +94,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		from sys_user u
 		left join sys_dept d on u.dept_id = d.dept_id
 		left join sys_company c on u.company_id = c.id
-        left join sys_user_sales_ext suse on suse.user_id = u.user_id
+        left join sys_user_ext suse on suse.user_id = u.user_id
         left join (select sys_user_id, count(userId) as count1 from wx_qy_user group by sys_user_id) wqu on wqu.sys_user_id = u.user_id
 		where u.del_flag = '0'
 		<if test="loginName != null and loginName != ''">
@@ -103,6 +103,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 		<if test="status != null and status != ''">
 			AND u.status = #{status}
 		</if>
+        <if test="sysUserExt != null and sysUserExt.salesLevel !=null
+        and sysUserExt.salesLevel != ''">
+            AND suse.sales_level = #{sysUserExt.salesLevel}
+        </if>
 		<if test="phonenumber != null and phonenumber != ''">
 			AND u.phonenumber like concat('%', #{phonenumber}, '%')
 		</if>

+ 20 - 20
suishenbang-system/src/main/resources/mapper/system/SysUserSalesExtMapper.xml

@@ -2,9 +2,9 @@
 <!DOCTYPE mapper
 PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
-<mapper namespace="com.dgtly.system.mapper.SysUserSalesExtMapper">
+<mapper namespace="com.dgtly.system.mapper.SysUserExtMapper">
     
-    <resultMap type="SysUserSalesExt" id="SysUserSalesExtResult">
+    <resultMap type="SysUserExt" id="SysUserExtResult">
         <result property="userId"    column="user_id"    />
         <result property="orgCode"    column="org_code"    />
         <result property="salesLevel"    column="sales_level"    />
@@ -14,12 +14,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="bossName"    column="boss_name"    />
     </resultMap>
 
-    <sql id="selectSysUserSalesExtVo">
-        select user_id, org_code, sales_level, org_name, sap_employee_id, boss_employee_id, boss_name from sys_user_sales_ext
+    <sql id="selectSysUserExtVo">
+        select user_id, org_code, sales_level, org_name, sap_employee_id, boss_employee_id, boss_name from sys_user_ext
     </sql>
 
-    <select id="selectSysUserSalesExtList" parameterType="SysUserSalesExt" resultMap="SysUserSalesExtResult">
-        <include refid="selectSysUserSalesExtVo"/>
+    <select id="selectSysUserExtList" parameterType="SysUserExt" resultMap="SysUserExtResult">
+        <include refid="selectSysUserExtVo"/>
         <where>  
             <if test="orgCode != null  and orgCode != ''"> and org_code = #{orgCode}</if>
             <if test="salesLevel != null  and salesLevel != ''"> and sales_level = #{salesLevel}</if>
@@ -30,13 +30,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         </where>
     </select>
     
-    <select id="selectSysUserSalesExtById" parameterType="Long" resultMap="SysUserSalesExtResult">
-        <include refid="selectSysUserSalesExtVo"/>
+    <select id="selectSysUserExtById" parameterType="Long" resultMap="SysUserExtResult">
+        <include refid="selectSysUserExtVo"/>
         where user_id = #{userId}
     </select>
         
-    <insert id="insertSysUserSalesExt" parameterType="SysUserSalesExt">
-        insert into sys_user_sales_ext
+    <insert id="insertSysUserExt" parameterType="SysUserExt">
+        insert into sys_user_ext
         <trim prefix="(" suffix=")" suffixOverrides=",">
             <if test="userId != null ">user_id,</if>
             <if test="orgCode != null  and orgCode != ''">org_code,</if>
@@ -57,8 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
          </trim>
     </insert>
 
-    <update id="updateSysUserSalesExt" parameterType="SysUserSalesExt">
-        update sys_user_sales_ext
+    <update id="updateSysUserExt" parameterType="SysUserExt">
+        update sys_user_ext
         <trim prefix="SET" suffixOverrides=",">
             <if test="orgCode != null  and orgCode != ''">org_code = #{orgCode},</if>
             <if test="salesLevel != null  and salesLevel != ''">sales_level = #{salesLevel},</if>
@@ -70,21 +70,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         where user_id = #{userId}
     </update>
 
-    <delete id="deleteSysUserSalesExtById" parameterType="Long">
-        delete from sys_user_sales_ext where user_id = #{userId}
+    <delete id="deleteSysUserExtById" parameterType="Long">
+        delete from sys_user_ext where user_id = #{userId}
     </delete>
 
-    <delete id="deleteSysUserSalesExtByIds" parameterType="String">
-        delete from sys_user_sales_ext where user_id in 
+    <delete id="deleteSysUserExtByIds" parameterType="String">
+        delete from sys_user_ext where user_id in
         <foreach item="userId" collection="array" open="(" separator="," close=")">
             #{userId}
         </foreach>
     </delete>
 
-    <insert id="insertOrUpSysUserSalesExt"  useGeneratedKeys="true" keyProperty="userId" keyColumn="user_id"
-            parameterType="SysUserSalesExt">
+    <insert id="insertOrUpSysUserExt"  useGeneratedKeys="true" keyProperty="userId" keyColumn="user_id"
+            parameterType="SysUserExt">
         insert INTO
-        sys_user_sales_ext
+        sys_user_ext
         <trim prefix="(" suffix=")" suffixOverrides=",">
             user_id,
             <if test="orgCode != null  and orgCode != ''">org_code,</if>
@@ -116,7 +116,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
 
     <select id="selectEmployeeIdsByBossEmployeeId" parameterType="String" resultType="String">
         select sap_employee_id
-        from sys_user_sales_ext
+        from sys_user_ext
         where boss_employee_id = #{bossEmployeeId,}
     </select>