ariesy 新增需求:

1.根据报错信息返回提示语
2.组织管理列表需求根据当前登录的用户选择的企业筛选
release
yefei 2 years ago
parent 6ae0a42566
commit 6cda572dac
  1. 4
      dxhy-admin/src/main/java/com/dxhy/admin/sys/controller/SysDeptController.java
  2. 9
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/SysDeptService.java
  3. 6
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SsoLoginServiceImpl.java
  4. 7
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysDeptServiceImpl.java
  5. 11
      dxhy-common/src/main/java/com/dxhy/common/constant/CommonConstants.java
  6. 3
      dxhy-common/src/main/java/com/dxhy/common/service/impl/DictdetaServciceImpl.java
  7. 14
      dxhy-erp/src/main/java/com/dxhy/erp/controller/SDNYMainProcessController.java

@ -45,14 +45,14 @@ public class SysDeptController extends AbstractController {
* 列表 * 列表
*/ */
@RequestMapping("/list") @RequestMapping("/list")
public ResponseEntity<?> list() { public ResponseEntity<?> list(@RequestBody long deptId) {
String company = ""; String company = "";
UserInfo userInfo = getUserInfo(); UserInfo userInfo = getUserInfo();
if (Long.parseLong(getUserId()) != Constant.SUPER_ADMIN && !userInfo.getCompany().contains(SysConfig.ZXQY)) { if (Long.parseLong(getUserId()) != Constant.SUPER_ADMIN && !userInfo.getCompany().contains(SysConfig.ZXQY)) {
company = userInfo.getCompany(); company = userInfo.getCompany();
} }
List<SysDeptEntity> deptList = sysDeptService.queryList(company); List<SysDeptEntity> deptList = sysDeptService.queryList(company,deptId);
log.info("树状信息:{}", JSON.toJSONString(deptList)); log.info("树状信息:{}", JSON.toJSONString(deptList));
return ResponseEntity.ok(R.ok().put("data", deptList)); return ResponseEntity.ok(R.ok().put("data", deptList));
} }

@ -22,6 +22,15 @@ public interface SysDeptService extends IService<SysDeptEntity> {
*/ */
List<SysDeptEntity> queryList(String company); List<SysDeptEntity> queryList(String company);
/**
* 根据集团编码获取部门信息
*
* @param company
* 集团编码
* @return 部门信息
*/
List<SysDeptEntity> queryList(String company,long parentId);
/** /**
* 根据集团编码获取用户关联信息 * 根据集团编码获取用户关联信息
* *

@ -58,6 +58,9 @@ public class SsoLoginServiceImpl implements SsoLoginService {
boolean insertRole = this.insertRole(user); boolean insertRole = this.insertRole(user);
// 保存用户信息 // 保存用户信息
boolean insertUser = this.insertUser(user); boolean insertUser = this.insertUser(user);
log.info("insertOrg = {},insertRole={},insertUser",insertOrg,insertRole,insertUser);
// 刷新用户缓存 // 刷新用户缓存
sysUserService.refreshCache(false, user.getUsername()); sysUserService.refreshCache(false, user.getUsername());
return insertOrg && insertUser && insertRole; return insertOrg && insertUser && insertRole;
@ -75,6 +78,7 @@ public class SsoLoginServiceImpl implements SsoLoginService {
sysUserService.saveUser(userEntity); sysUserService.saveUser(userEntity);
return true; return true;
} catch (Exception e) { } catch (Exception e) {
log.error("insertUser 报错信息为{}",e);
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }
@ -92,6 +96,7 @@ public class SsoLoginServiceImpl implements SsoLoginService {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
log.error("insertRole 报错信息为{}",e);
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }
@ -113,6 +118,7 @@ public class SsoLoginServiceImpl implements SsoLoginService {
} }
return true; return true;
} catch (Exception e) { } catch (Exception e) {
log.error("insertOrg 报错信息为{}",e);
e.printStackTrace(); e.printStackTrace();
return false; return false;
} }

@ -54,6 +54,13 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptDao, SysDeptEntity> i
return this.getChildPerms(deptList, parentId); return this.getChildPerms(deptList, parentId);
} }
@Override
public List<SysDeptEntity> queryList(String company, long parentId) {
DynamicContextHolder.push(DbConstant.BASICS_READ);
List<SysDeptEntity> deptList = baseMapper.queryList(company);
return this.getChildPerms(deptList, parentId);
}
/** /**
* 根据父节点的ID获取所有子节点 * 根据父节点的ID获取所有子节点
* *

@ -60,6 +60,17 @@ public class CommonConstants {
* 默认返回页面的错误信息 * 默认返回页面的错误信息
*/ */
public static final String MSG_ERR_PUSH_SDNY = "推送数据到sap失败!"; public static final String MSG_ERR_PUSH_SDNY = "推送数据到sap失败!";
/**
* 超时的错误信息
*/
public static final String CONNECT_TIMEOUT = "网络超时,请稍后重试!";
/**
* 空指针的错误信息
*/
public static final String NULL_POINTER_TIMEOUT = "系统错误,请稍后重试!";
/** /**
* 默认返回页面的成功信息 * 默认返回页面的成功信息
*/ */

@ -7,6 +7,7 @@ import java.util.stream.Collectors;
import javax.annotation.Resource; import javax.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -20,6 +21,7 @@ import com.dxhy.common.vo.DictdetaModel;
* @author jiaohongyang * @author jiaohongyang
*/ */
@Service("dictdetaServcice") @Service("dictdetaServcice")
@Slf4j
public class DictdetaServciceImpl implements DictdetaServcice { public class DictdetaServciceImpl implements DictdetaServcice {
@Resource @Resource
private RedisUtils redisUtils; private RedisUtils redisUtils;
@ -32,6 +34,7 @@ public class DictdetaServciceImpl implements DictdetaServcice {
@Override @Override
public String queryDictName(String type,String code) { public String queryDictName(String type,String code) {
log.info("type={},code={}",type,code);
String dictJson = redisUtils.get(RedisConstant.KEY_DICT + type); String dictJson = redisUtils.get(RedisConstant.KEY_DICT + type);
List<DictdetaModel> dictdetaModels = JSON.parseArray(dictJson, DictdetaModel.class); List<DictdetaModel> dictdetaModels = JSON.parseArray(dictJson, DictdetaModel.class);
Map<String, String> collect = dictdetaModels.stream().collect(Collectors.toMap(DictdetaModel::getDictcode, DictdetaModel::getDictname)); Map<String, String> collect = dictdetaModels.stream().collect(Collectors.toMap(DictdetaModel::getDictcode, DictdetaModel::getDictname));

@ -35,6 +35,7 @@ import java.math.BigDecimal;
import java.text.ParseException; import java.text.ParseException;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
import java.util.*; import java.util.*;
import java.util.concurrent.TimeoutException;
/** /**
* 山东能源查验主流程控制器 * 山东能源查验主流程控制器
@ -666,11 +667,20 @@ public class SDNYMainProcessController extends AbstractController {
} }
} }
} catch (Exception exception) { } catch (TimeoutException exception) {
log.error("同步SAP失败,报错信息为:{}", exception); log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace(); exception.printStackTrace();
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.CONNECT_TIMEOUT)));
} catch(NullPointerException exception){
log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace();
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.NULL_POINTER_TIMEOUT)));
} catch(Exception exception){
log.error("同步SAP失败,报错信息为:{}", exception);
exception.printStackTrace();
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_DEFAULT)));
} }
return ResponseEntity.ok(JSONObject.toJSONString(R.error(CommonConstants.MSG_ERR_PUSH_SDNY)));
} }

Loading…
Cancel
Save