Merge remote-tracking branch 'origin/master'

master
郑明梁 2 years ago
commit b9e41a4e08

@ -12,6 +12,7 @@ import com.glxp.api.constant.BusinessType;
import com.glxp.api.controller.BaseController;
import com.glxp.api.entity.auth.AuthAdmin;
import com.glxp.api.entity.auth.DeptEntity;
import com.glxp.api.entity.auth.InvWarehouseEntity;
import com.glxp.api.entity.system.SystemParamConfigEntity;
import com.glxp.api.req.auth.FilterInvWarehouseRequest;
import com.glxp.api.req.system.DeleteRequest;
@ -315,4 +316,21 @@ public class DeptController extends BaseController {
return ResultVOUtils.success(byCode);
}
@AuthRuleAnnotation("")
@PostMapping("/spms/inv/warehouse/selectInvById")
public BaseResponse selectInvById(@RequestBody List<String> InvList) {
if (InvList.size() == 0) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL);
}
//先得到部门编码
List<String> String = deptService.selectByIdCode(InvList);
List<InvWarehouseEntity> list = invWarehouseService.selectInvById(String);
return ResultVOUtils.success(list);
}
}

@ -14,16 +14,15 @@ import com.glxp.api.req.auth.AuthUserSaveRequest;
import com.glxp.api.res.PageSimpleResponse;
import com.glxp.api.res.auth.AuthAdminResponse;
import com.glxp.api.res.auth.DeptUserResponse;
import com.glxp.api.service.auth.AuthAdminService;
import com.glxp.api.service.auth.CustomerInfoService;
import com.glxp.api.service.auth.DeptUserService;
import com.glxp.api.service.auth.ISysRoleService;
import com.glxp.api.service.auth.*;
import com.glxp.api.util.PasswordUtils;
import com.glxp.api.util.StreamUtils;
import com.glxp.api.common.enums.ResultEnum;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.util.StringUtils;
import lombok.RequiredArgsConstructor;
import org.codehaus.groovy.util.StringUtil;
import org.springframework.beans.BeanUtils;
import org.springframework.validation.BindingResult;
import org.springframework.validation.annotation.Validated;
@ -173,6 +172,12 @@ public class SysUserController extends BaseController {
}
authAdmin.setCustomerId(curUser.getCustomerId());
authAdmin.setLastModifyTime(new Date());
//先默认插入部门 仓库
//通过仓库找到对应部门
String pid = invWarehouseService.selectParentIdByCode(authUserSaveRequest.getLocInvCode());
authAdmin.setLocDeptCode(pid);
authAdmin.setLocInvCode(authUserSaveRequest.getLocInvCode());
boolean b = userService.insertAuthAdmin(authAdmin);
authAdmin = userService.findByUserName(authAdmin.getUserName());
if (!b) {
@ -205,6 +210,15 @@ public class SysUserController extends BaseController {
}
// 插入仓库
if (StringUtils.isNotBlank(authUserSaveRequest.getLocInvCode())) {
WarehouseUserEntity warehouseUserEntity = new WarehouseUserEntity();
warehouseUserEntity.setCode(authUserSaveRequest.getLocInvCode());
warehouseUserEntity.setUsername(authUserSaveRequest.getUserName());
warehouseUserEntity.setUserid(authAdmin.getId());
warehouseUserService.insert(warehouseUserEntity);
}
Map<String, Long> res = new HashMap<>();
res.put("id", authAdmin.getId());
return ResultVOUtils.success(res);
@ -214,6 +228,12 @@ public class SysUserController extends BaseController {
@Resource
DeptUserService deptUserService;
@Resource
WarehouseUserService warehouseUserService;
@Resource
InvWarehouseService invWarehouseService;
/**
*
*/

@ -17,6 +17,8 @@ public interface DeptDao {
List<DeptEntity> filterGroupInvWarehouse(FilterInvWarehouseRequest filterInvWarehouseRequest);
List<String> selectByIdCode(@Param("List") List<String> list);
boolean insertInvWarehouse(DeptEntity DeptEntity);
boolean updateInvWarehouse(DeptEntity DeptEntity);

@ -87,6 +87,8 @@ public interface InvWarehouseDao extends BaseMapperPlus<InvWarehouseDao, InvWare
*/
List<InvWarehouseEntity> selectInvListByUser(FilterInvWarehouseRequest filterInvWarehouseRequest);
List<InvWarehouseEntity> selectInvById( @Param("InvList") List<String> InvList);
/**
*
*

@ -34,6 +34,8 @@ public class AuthAdmin {
private String deptName;
private String warehouseName;
private List<SysRole> roles;
private Long[] roleIds;

@ -39,6 +39,8 @@ public class AuthAdminResponse {
private List<Long> roles;
private String dept;
private String deptName;
private String locInvCode;
private String warehouseName;
private List<Long> depts;

@ -10,7 +10,7 @@ import java.util.List;
public interface DeptService {
List<String> selectByIdCode(List<String> list);
DeptEntity findDefault(Boolean advaceType, Boolean isDefault);
DeptEntity selectMaxCode(FilterInvWarehouseRequest filterInvWarehouseRequest);

@ -83,4 +83,6 @@ public interface InvWarehouseService {
*/
List<InvWarehouseEntity> findInvListByUser(FilterInvWarehouseRequest filterInvWarehouseRequest);
String selectParentIdByCode( String invCode);
List<InvWarehouseEntity> selectInvById(List<String> InvList);
}

@ -70,4 +70,6 @@ public interface WarehouseUserService {
* @return
*/
Integer countUserBySubInvCode(String subInvCode);
boolean insert(WarehouseUserEntity warehouseUserEntity);
}

@ -22,6 +22,11 @@ public class DeptServiceImpl implements DeptService {
@Resource
DeptDao deptDao;
@Override
public List<String> selectByIdCode(List<String> list) {
return deptDao.selectByIdCode(list);
}
@Override
public DeptEntity findDefault(Boolean advaceType, Boolean isDefault) {
FilterInvWarehouseRequest filterInvWarehouseRequest = new FilterInvWarehouseRequest();

@ -231,4 +231,9 @@ public class InvWarehouseServiceImpl implements InvWarehouseService {
public String selectParentIdByCode(String invCode) {
return invWarehouseDao.selectParentIdByCode(invCode);
}
@Override
public List<InvWarehouseEntity> selectInvById(List<String> InvList) {
return invWarehouseDao.selectInvById(InvList);
}
}

@ -138,4 +138,9 @@ public class WarehouseUserServiceImpl implements WarehouseUserService {
public Integer countUserBySubInvCode(String subInvCode) {
return warehouseUserDao.countByCode(subInvCode);
}
@Override
public boolean insert(WarehouseUserEntity warehouseUserEntity) {
return warehouseUserDao.insert(warehouseUserEntity)>0;
}
}

@ -4,9 +4,10 @@
<mapper namespace="com.glxp.api.dao.auth.AuthAdminDao">
<select id="listAdminPage" parameterType="com.glxp.api.req.auth.FilterAuthUserRequest"
resultType="com.glxp.api.entity.auth.AuthAdmin">
SELECT auth_user.*, auth_dept.name deptName
SELECT auth_user.*, auth_dept.name deptName,auth_warehouse.name warehouseName
FROM auth_user
left join auth_dept on auth_user.locDeptCode = auth_dept.code
LEFT JOIN auth_warehouse on auth_user.locInvCode=auth_warehouse.code
<where>
<if test="ids != null and ids.size > 0">
AND id IN

@ -94,6 +94,21 @@
</select>
<select id="selectByIdCode"
resultType="java.lang.String">
SELECT code
FROM auth_dept
<where>
<if test="List != null and List.size() != 0">
and id in
<foreach collection="List" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
<select id="selectMaxCode" parameterType="com.glxp.api.req.auth.FilterInvWarehouseRequest"
resultType="com.glxp.api.entity.auth.DeptEntity">
select max(code) as code from auth_dept

@ -381,4 +381,17 @@
from auth_warehouse
where code = #{invCode}
</select>
<select id="selectInvById" resultType="com.glxp.api.entity.auth.InvWarehouseEntity">
select *
from auth_warehouse
<where>
<if test="InvList != null and InvList.size() != 0">
and parentId in
<foreach collection="InvList" item="item" open="(" separator="," close=")">
#{item}
</foreach>
</if>
</where>
</select>
</mapper>

Loading…
Cancel
Save