|
@@ -2,10 +2,19 @@ package com.abcsz.litigationcase.service.impl;
|
|
|
|
|
|
import com.abcsz.litigationcase.dao.entity.UserEntity;
|
|
import com.abcsz.litigationcase.dao.entity.UserEntity;
|
|
import com.abcsz.litigationcase.dao.mapper.UserMapper;
|
|
import com.abcsz.litigationcase.dao.mapper.UserMapper;
|
|
|
|
+import com.abcsz.litigationcase.domain.ro.UserQueryRo;
|
|
|
|
+import com.abcsz.litigationcase.domain.ro.UserRo;
|
|
|
|
+import com.abcsz.litigationcase.domain.vo.PublicVo;
|
|
|
|
+import com.abcsz.litigationcase.domain.vo.UseQueryVo;
|
|
import com.abcsz.litigationcase.service.UserService;
|
|
import com.abcsz.litigationcase.service.UserService;
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
+import java.util.Date;
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* <p>
|
|
* <p>
|
|
* 用户的模块权限表 服务实现类
|
|
* 用户的模块权限表 服务实现类
|
|
@@ -14,7 +23,160 @@ import org.springframework.stereotype.Service;
|
|
* @author shengqianlei
|
|
* @author shengqianlei
|
|
* @since 2022-04-21
|
|
* @since 2022-04-21
|
|
*/
|
|
*/
|
|
|
|
+@Slf4j
|
|
@Service
|
|
@Service
|
|
public class UserServiceIml extends ServiceImpl<UserMapper, UserEntity> implements UserService {
|
|
public class UserServiceIml extends ServiceImpl<UserMapper, UserEntity> implements UserService {
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
+ private UserMapper userMapper;
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public UseQueryVo userQuery(UserQueryRo ro) {
|
|
|
|
+ return null;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public PublicVo userInsert(UserRo ro) {
|
|
|
|
+ log.info("用户信息新增....");
|
|
|
|
+ PublicVo publicVo = new PublicVo();
|
|
|
|
+
|
|
|
|
+ try
|
|
|
|
+ {
|
|
|
|
+ /* 查询该用户是否已经存在 */
|
|
|
|
+ QueryWrapper<UserEntity> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
+ queryWrapper1.eq("user_identity",ro.getUserIdentity());
|
|
|
|
+ queryWrapper1.eq("del_flag", 0);
|
|
|
|
+ UserEntity userEntity = userMapper.selectOne(queryWrapper1);
|
|
|
|
+ if(userEntity !=null){
|
|
|
|
+ publicVo.setRetCode("Y001");
|
|
|
|
+ publicVo.setRetMsg("该用户已存在,请勿重复新增");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(ro.getIsAbc()==0 && ro.getBankId() == null){
|
|
|
|
+ publicVo.setRetCode("Y002");
|
|
|
|
+ publicVo.setRetMsg("行内人员请输入所属银行信息");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(ro.getIsAbc()==1 && ro.getLawFirmId() ==null){
|
|
|
|
+ publicVo.setRetCode("Y003");
|
|
|
|
+ publicVo.setRetMsg("行外人员请输入所属事务所信息");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+ UserEntity userEntity1 = new UserEntity();
|
|
|
|
+ userEntity1.setUserAccount(ro.getUserAccount());
|
|
|
|
+ userEntity1.setUserPassword(ro.getUserPassword());
|
|
|
|
+ userEntity1.setUserName(ro.getUserName());
|
|
|
|
+ userEntity1.setUserIdentity(ro.getUserIdentity());
|
|
|
|
+ userEntity1.setUserTel(ro.getUserTel());
|
|
|
|
+ userEntity1.setUserEmail(ro.getUserEmail());
|
|
|
|
+ userEntity1.setIsAbc(ro.getIsAbc());
|
|
|
|
+ userEntity1.setLawFirmId(ro.getLawFirmId());
|
|
|
|
+ userEntity1.setModuleConfigure(ro.getModuleConfigure());
|
|
|
|
+ userEntity1.setPermitConfigure(ro.getPermitConfigure());
|
|
|
|
+ userEntity1.setUserDescripe(ro.getUserDescripe());
|
|
|
|
+ userEntity1.setCreateTime(new Date());
|
|
|
|
+ userEntity1.setUpdateTime(new Date());
|
|
|
|
+ userEntity1.setTxtHold1(ro.getTxtHold1());
|
|
|
|
+ userEntity1.setTxtHold2(ro.getTxtHold2());
|
|
|
|
+ userEntity1.setDelFlag(ro.getDelFlag());
|
|
|
|
+ int count1 = userMapper.insert(userEntity1);
|
|
|
|
+ if(count1 != 1){
|
|
|
|
+ publicVo.setRetCode("S001");
|
|
|
|
+ publicVo.setRetMsg("用户新增失败,请重新添加");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ } catch (Exception e) {
|
|
|
|
+ log.error(e.getMessage() + "****" +e.getStackTrace());
|
|
|
|
+ publicVo.setRetCode("X001");
|
|
|
|
+ publicVo.setRetMsg("系统异常");
|
|
|
|
+ log.error(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+ publicVo.setRetCode("0000");
|
|
|
|
+ publicVo.setRetMsg("交易成功");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public PublicVo userModify(UserRo ro) {
|
|
|
|
+ log.info("用户信息修改(包括删除)...");
|
|
|
|
+ PublicVo publicVo = new PublicVo();
|
|
|
|
+
|
|
|
|
+ try {
|
|
|
|
+ /* 查询该用户是否存在 */
|
|
|
|
+ QueryWrapper<UserEntity> queryWrapper1 = new QueryWrapper<>();
|
|
|
|
+ queryWrapper1.eq("user_identity", ro.getUserIdentity());
|
|
|
|
+ queryWrapper1.eq("del_flag", 0);
|
|
|
|
+ UserEntity userEntity1 = userMapper.selectOne(queryWrapper1);
|
|
|
|
+ if (userEntity1 == null) {
|
|
|
|
+ publicVo.setRetCode("Y001");
|
|
|
|
+ publicVo.setRetMsg("该用户不存在,请先新增");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(ro.getIsAbc()==0 && ro.getBankId() == null){
|
|
|
|
+ publicVo.setRetCode("Y002");
|
|
|
|
+ publicVo.setRetMsg("行内人员请输入所属银行信息");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if(ro.getIsAbc()==1 && ro.getLawFirmId() ==null){
|
|
|
|
+ publicVo.setRetCode("Y003");
|
|
|
|
+ publicVo.setRetMsg("行外人员请输入所属事务所信息");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ UserEntity userEntity2 = new UserEntity();
|
|
|
|
+ userEntity2.setUserAccount(ro.getUserAccount());
|
|
|
|
+ userEntity2.setUserPassword(ro.getUserPassword());
|
|
|
|
+ userEntity2.setUserName(ro.getUserName());
|
|
|
|
+ userEntity2.setUserIdentity(ro.getUserIdentity());
|
|
|
|
+ userEntity2.setUserTel(ro.getUserTel());
|
|
|
|
+ userEntity2.setUserEmail(ro.getUserEmail());
|
|
|
|
+ userEntity2.setIsAbc(ro.getIsAbc());
|
|
|
|
+ userEntity2.setLawFirmId(ro.getLawFirmId());
|
|
|
|
+ userEntity2.setModuleConfigure(ro.getModuleConfigure());
|
|
|
|
+ userEntity2.setPermitConfigure(ro.getPermitConfigure());
|
|
|
|
+ userEntity2.setUserDescripe(ro.getUserDescripe());
|
|
|
|
+ userEntity2.setUpdateTime(new Date());
|
|
|
|
+ userEntity2.setTxtHold1(ro.getTxtHold1());
|
|
|
|
+ userEntity2.setTxtHold2(ro.getTxtHold2());
|
|
|
|
+ userEntity2.setDelFlag(ro.getDelFlag());
|
|
|
|
+ QueryWrapper<UserEntity> queryWrapper2 = new QueryWrapper<>();
|
|
|
|
+ queryWrapper2.eq("user_identity", ro.getUserIdentity());
|
|
|
|
+ queryWrapper2.eq("del_flag", 0);
|
|
|
|
+ int count1 = userMapper.update(userEntity2,queryWrapper2);
|
|
|
|
+ if(count1 != 1){
|
|
|
|
+ publicVo.setRetCode("S001");
|
|
|
|
+ publicVo.setRetMsg("用户更新失败,请重新更新");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ catch (Exception e){
|
|
|
|
+ log.error(e.getMessage() + "****" +e.getStackTrace());
|
|
|
|
+ publicVo.setRetCode("X001");
|
|
|
|
+ publicVo.setRetMsg("系统异常");
|
|
|
|
+ log.error(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ publicVo.setRetCode("0000");
|
|
|
|
+ publicVo.setRetMsg("交易成功");
|
|
|
|
+ log.info(publicVo.getRetCode() + "****" + publicVo.getRetMsg());
|
|
|
|
+ return publicVo;
|
|
|
|
+ }
|
|
}
|
|
}
|