Merge remote-tracking branch 'origin/wtest'

master
wangwei 2 years ago
commit d5a8a5e1fb

@ -1,6 +1,7 @@
package com.glxp.api.controller.auth;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.StrUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.AuthRuleAnnotation;
@ -22,7 +23,10 @@ import com.glxp.api.service.auth.DeptUserService;
import com.glxp.api.service.auth.InvWarehouseService;
import com.glxp.api.service.system.SystemParamConfigService;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import javax.validation.Valid;
@ -210,6 +214,7 @@ public class DeptController {
deptEntity.setPcode(deptEntity.getPcode());
}
deptEntity.setUpdateTime(new Date());
deptEntity.setId(IdUtil.getSnowflakeNextId());
boolean b = deptService.insertInvWarehouse(deptEntity);
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);

@ -77,6 +77,11 @@ public class DeptUserController {
FilterDeptUserReqeust filterDeptUserReqeust = new FilterDeptUserReqeust();
filterDeptUserReqeust.setUserId(deptUserEntity.getUserId());
List<DeptUserEntity> deptUserEntities = deptUserService.selectDeptUser(filterDeptUserReqeust);
for (int i=0;i<deptUserEntities.size();i++){
if(deptUserEntities.get(i).getDeptId()==1){
deptUserEntities.remove(deptUserEntities.get(i));
}
}
if( deptUserEntities != null && deptUserEntities.size()>1){
return ResultVOUtils.error(500,"该用户已绑定多个部门,不能移除!");
}

@ -3,6 +3,7 @@ package com.glxp.api.controller.auth;
import cn.dev33.satoken.annotation.SaCheckPermission;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil;
import com.github.pagehelper.PageInfo;
import com.glxp.api.annotation.Log;
@ -176,6 +177,7 @@ public class SysUserController extends BaseController {
}
authAdmin.setCustomerId(curUser.getCustomerId());
authAdmin.setLastModifyTime(new Date());
authAdmin.setId(IdUtil.getSnowflakeNextId());
boolean b = userService.insertAuthAdmin(authAdmin);
authAdmin = userService.findByUserName(authAdmin.getUserName());
if (!b) {

@ -66,10 +66,10 @@
</select>
<insert id="insertAuthAdmin" keyProperty="id" parameterType="com.glxp.api.entity.auth.AuthAdmin">
INSERT INTO auth_user( userName, passWord, lastLoginIp, lastLoginTime, createTime, userFlag
INSERT INTO auth_user( id,userName, passWord, lastLoginIp, lastLoginTime, createTime, userFlag
, employeeName, CustomerId, lastModifyTime, locDeptCode, locInvCode, comments)
values
(#{userName},
(#{id}, #{userName},
<choose>
<when test="passWord != null">
#{passWord},

@ -196,9 +196,10 @@
parameterType="com.glxp.api.entity.auth.DeptEntity">
replace
INTO auth_dept
(pid, code, `name`, advanceType, isDefault,
(id,pid, code, `name`, advanceType, isDefault,
status, updateTime, remark,`level`,pcode,spUse, thirdId, thirdId1, thirdId2, thirdId3, thirdId4)
values (
#{id},
#{pid},
#{code},
#{name},

Loading…
Cancel
Save