Commit 9078ddd0 by qwmqiuwenmin

fix

parent cb82f8ca
......@@ -52,11 +52,6 @@
<artifactId>haoban-base-api</artifactId>
<version>${haoban-base-api}</version>
</dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-common</artifactId>
<version>${haoban-common}</version>
</dependency>
</dependencies>
<build>
......
package com.gic.haoban.manage.api.dto;
import javax.persistence.criteria.CriteriaBuilder;
import java.io.Serializable;
/**
......
......@@ -4,7 +4,7 @@ import java.util.List;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
public interface DepartmentApiService {
......@@ -47,19 +47,19 @@ public interface DepartmentApiService {
* @param department
* @return
*/
HaobanResponse add(DepartmentDTO department);
ServiceResponse add(DepartmentDTO department);
/**
* 修改部门
* @param department
* @return
*/
HaobanResponse edit(DepartmentDTO department);
ServiceResponse edit(DepartmentDTO department);
/**
* 删除部门
* @param departmentId
* @return
*/
HaobanResponse del(String departmentId);
ServiceResponse del(String departmentId);
/**
* 根据关联id 获取部门
* @param departId
......@@ -71,7 +71,7 @@ public interface DepartmentApiService {
* @param departmentId
* @return
*/
HaobanResponse recycle(String departmentId);
ServiceResponse recycle(String departmentId);
/**
* 根据参数查询
......@@ -88,7 +88,7 @@ public interface DepartmentApiService {
* 回收站恢复
* @param departmentId
*/
HaobanResponse repairRecycle(String departmentId,String parentId);
ServiceResponse repairRecycle(String departmentId,String parentId);
/**
* 获取根节点
* @param wxEnterpriseId
......@@ -132,13 +132,13 @@ public interface DepartmentApiService {
* @param departmentId
* @return
*/
HaobanResponse wxCallBackDel(String departmentId);
ServiceResponse wxCallBackDel(String departmentId);
/**
* 微信回调放回收站
* @param departmentId
* @return
*/
HaobanResponse wxCallBackrecycle(String departmentId);
ServiceResponse wxCallBackrecycle(String departmentId);
/**
* 判断节点下面有没有子节点
* @param departmentId
......@@ -149,6 +149,6 @@ public interface DepartmentApiService {
* gic回调删除部门
* @param departmentId
*/
HaobanResponse gicDel(String departmentId);
ServiceResponse gicDel(String departmentId);
}
......@@ -4,7 +4,7 @@ import java.util.List;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.GicClerkDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
......@@ -21,7 +21,7 @@ public interface StaffApiService {
public StaffDTO selectByNationcodeAndPhoneNumber(String wxEnterpriseId,String nationcode, String phoneNumber);
public HaobanResponse add(StaffDTO staff, String departmentIds);
public ServiceResponse add(StaffDTO staff, String departmentIds);
public List<StaffDepartmentRelatedDTO> listStaffDepartmentByStaffId(String staffId);
......
......@@ -7,7 +7,6 @@ import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.manage.api.dto.QywxCorpInfoSimpleDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO;
import com.github.pagehelper.Page;
public interface WxEnterpriseApiService {
......
......@@ -8,6 +8,7 @@ import java.util.Map;
import cn.hutool.core.collection.CollectionUtil;
import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.service.StaffApiService;
import org.apache.commons.collections.CollectionUtils;
......@@ -27,7 +28,6 @@ import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.contacts.manage.api.dto.SyncJsonColumnDTO;
......@@ -86,9 +86,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public HaobanResponse add(DepartmentDTO department) {
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(1);
public ServiceResponse add(DepartmentDTO department) {
ServiceResponse hr = new ServiceResponse();
hr.setCode(1);
//调微信的新增接口
String wxDepartmentId = "";
WxEnterpriseDTO enterpriseDTO = wxEnterpriseService.selectById(department.getWxEnterpriseId());
......@@ -112,7 +112,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
JSONResponse jp = qywxDepartmentApiService.createDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), dto);
logger.info("【部门新增】jp = {}",JSON.toJSONString(jp));
if(jp.getErrorCode() != 0) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("微信新增部门失败");
return hr;
}
......@@ -153,14 +153,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public HaobanResponse edit(DepartmentDTO department) {
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(1);
public ServiceResponse edit(DepartmentDTO department) {
ServiceResponse hr = new ServiceResponse();
hr.setCode(1);
hr.setResult(department);
//调微信的修改接口
TabHaobanDepartment tab = departmentService.selectById(department.getDepartmentId());
if(tab == null){
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("部门不存在");
return hr;
}
......@@ -179,7 +179,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
JSONResponse jp = qywxDepartmentApiService.updateDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), dto);
logger.info("【部门修改】jp={}",JSON.toJSONString(jp));
if(jp.getErrorCode() != 0) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("微信修改部门失败");
return hr;
}
......@@ -191,14 +191,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public HaobanResponse del(String departmentId) {
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(1);
public ServiceResponse del(String departmentId) {
ServiceResponse hr = new ServiceResponse();
hr.setCode(1);
List<TabHaobanDepartment> list = departmentService.listByParentId(departmentId);
logger.info("【部门删除】list.size={}",list.size());
if(!list.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在子部门,删除部门失败");
return hr;
}
......@@ -206,14 +206,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List<TabHaobanStaffDepartmentRelated> staffList = staffDepartmentService.listByDepartmentId(departmentId);
logger.info("【部门删除】staffList.size={}",staffList.size());
if(!staffList.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在成员,删除部门失败");
return hr;
}
//调微信的删除接口
TabHaobanDepartment department = departmentService.selectById(departmentId);
if(department == null){
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("不存在部门,删除部门失败");
return hr;
}
......@@ -223,7 +223,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if(application != null) {
JSONResponse jp = qywxDepartmentApiService.deleteDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), Integer.parseInt(department.getWxDepartmentId()));
if(jp.getErrorCode() != 0) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("微信删除部门失败");
return hr;
}
......@@ -235,14 +235,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public HaobanResponse wxCallBackDel(String departmentId){
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(1);
public ServiceResponse wxCallBackDel(String departmentId){
ServiceResponse hr = new ServiceResponse();
hr.setCode(1);
List<TabHaobanDepartment> list = departmentService.listByParentId(departmentId);
logger.info("【部门删除】list.size={}",list.size());
if(!list.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在子部门,删除部门失败");
return hr;
}
......@@ -250,7 +250,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List<TabHaobanStaffDepartmentRelated> staffList = staffDepartmentService.listByDepartmentId(departmentId);
logger.info("【部门删除】staffList.size={}",staffList.size());
if(!staffList.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在成员,删除部门失败");
return hr;
}
......@@ -265,14 +265,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public HaobanResponse recycle(String departmentId) {
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(1);
public ServiceResponse recycle(String departmentId) {
ServiceResponse hr = new ServiceResponse();
hr.setCode(1);
List<TabHaobanDepartment> list = departmentService.listByParentId(departmentId);
logger.info("【部门删除】list.size={}",list.size());
if(!list.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在子部门,删除部门失败");
return hr;
}
......@@ -280,7 +280,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List<TabHaobanStaffDepartmentRelated> staffList = staffDepartmentService.listByDepartmentId(departmentId);
logger.info("【部门删除】staffList.size={}",staffList.size());
if(!staffList.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在成员,删除部门失败");
return hr;
}
......@@ -292,7 +292,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if(application != null) {
JSONResponse jp = qywxDepartmentApiService.deleteDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), Integer.parseInt(department.getWxDepartmentId()));
if(jp.getErrorCode() != 0) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("微信删除部门失败");
return hr;
}
......@@ -304,14 +304,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public HaobanResponse wxCallBackrecycle(String departmentId) {
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(1);
public ServiceResponse wxCallBackrecycle(String departmentId) {
ServiceResponse hr = new ServiceResponse();
hr.setCode(1);
List<TabHaobanDepartment> list = departmentService.listByParentId(departmentId);
logger.info("【部门删除】list.size={}",list.size());
if(!list.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在子部门,删除部门失败");
return hr;
}
......@@ -319,7 +319,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List<TabHaobanStaffDepartmentRelated> staffList = staffDepartmentService.listByDepartmentId(departmentId);
logger.info("【部门删除】staffList.size={}",staffList.size());
if(!staffList.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在成员,删除部门失败");
return hr;
}
......@@ -336,9 +336,9 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public HaobanResponse repairRecycle(String departmentId,String parentId) {
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(0);
public ServiceResponse repairRecycle(String departmentId,String parentId) {
ServiceResponse hr = new ServiceResponse();
hr.setCode(0);
TabHaobanDepartment tab = departmentService.selectById(departmentId);
//调微信的新增接口
String wxDepartmentId = "";
......@@ -357,7 +357,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
JSONResponse jp = qywxDepartmentApiService.createDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), dto);
logger.info("【部门新增】jp = {}",JSON.toJSONString(jp));
if(jp.getErrorCode() != 0) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("微信新增部门失败");
return hr;
}
......@@ -491,6 +491,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
@Override
public void initwxDepartment(String corpid, String suiteid, String wxEnterpriseId) {
List<com.gic.wechat.api.dto.qywx.DepartmentDTO> list = this.qywxDepartmentApiService.listDepartment(corpid, suiteid, null);
logger.info("企业所有部门数据:{}", JSON.toJSONString(list));
if(CollectionUtils.isNotEmpty(list)){
this.addAllDepartment(list, 0, wxEnterpriseId, corpid, suiteid);
......@@ -509,7 +510,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if(parent != null){
level = parent.getLevel() + 1;
chainId = parent.getChainId() + Constant.ID_SEPARATOR + parent.getDepartmentId();
chainName = parent.getChainName() + Constant.NAME_SEPARATOR + parent.getChainName();
chainName = parent.getChainName() + Constant.NAME_SEPARATOR + parent.getDepartmentName();
pId = parent.getDepartmentId();
}
}
......@@ -551,14 +552,14 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
}
@Override
public HaobanResponse gicDel(String departmentId) {
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(1);
public ServiceResponse gicDel(String departmentId) {
ServiceResponse hr = new ServiceResponse();
hr.setCode(1);
List<TabHaobanDepartment> list = departmentService.listByParentId(departmentId);
logger.info("【部门删除】list.size={}",list.size());
if(!list.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在子部门,删除部门失败");
//return hr;
TabHaobanDepartment department = departmentService.selectById(departmentId);
......@@ -571,7 +572,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
List<TabHaobanStaffDepartmentRelated> staffList = staffDepartmentService.listByDepartmentId(departmentId);
logger.info("【部门删除】staffList.size={}",staffList.size());
if(!staffList.isEmpty()) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("存在成员,删除部门失败");
//return hr;
TabHaobanDepartment department = departmentService.selectById(departmentId);
......@@ -588,7 +589,7 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
if(application != null) {
JSONResponse jp = qywxDepartmentApiService.deleteDepartment(enterpriseDTO.getCorpid(), application.getSiteId(), Integer.parseInt(department.getWxDepartmentId()));
if(jp.getErrorCode() != 0) {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("微信删除部门失败");
return hr;
}
......
......@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.GicMessageDTO;
import com.gic.haoban.manage.api.dto.QywxCallBackDTO;
......@@ -105,12 +105,12 @@ public class MessageApiServiceImpl implements MessageApiService {
}
departmentDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId());
if(dto.getChangeType() == GicEditType.ADD.getCode()){
HaobanResponse response = this.departmentApiService.add(departmentDTO);
ServiceResponse response = this.departmentApiService.add(departmentDTO);
log.info("添加结果:{}", JSON.toJSONString(response));
}else if(dto.getChangeType() == GicEditType.UPDATE.getCode()){
TabHaobanDepartment department = this.departmentService.selectByRelatedId(dto.getId());
if(department == null){
HaobanResponse response = this.departmentApiService.add(departmentDTO);
ServiceResponse response = this.departmentApiService.add(departmentDTO);
log.info("添加结果:{}", JSON.toJSONString(response));
}else {
departmentDTO.setDepartmentId(department.getDepartmentId());
......
......@@ -33,7 +33,7 @@ import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.PageUtil;
import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.common.utils.UuidUtil;
......@@ -99,9 +99,9 @@ public class StaffApiServiceImpl implements StaffApiService {
}
@Override
public HaobanResponse add(StaffDTO staff, String departmentIds) {
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(1);
public ServiceResponse add(StaffDTO staff, String departmentIds) {
ServiceResponse hr = new ServiceResponse();
hr.setCode(1);
Integer activeFlag = staff.getActiveFlag();
staff.setActiveFlag(0);
Integer syncPostionFlag = staff.getSyncPostionFlag();
......@@ -142,8 +142,8 @@ public class StaffApiServiceImpl implements StaffApiService {
JSONResponse jp = qywxUserApiService.createWorkWxUser(userDTO, enterpriseDTO.getCorpid(), application.getSiteId());
logger.info("【店员新增】jp = {}",JSON.toJSONString(jp));
if(jp.getErrorCode() != 0) {
hr.setErrorCode(0);
hr.setDetailError("微信新增失败");
hr.setCode(0);
hr.setMessage("微信新增失败");
return hr;
}
staffService.add(tab);
......@@ -164,7 +164,7 @@ public class StaffApiServiceImpl implements StaffApiService {
staffDepartmentRelatedService.add(related);
}
}else {
hr.setErrorCode(0);
hr.setCode(0);
hr.setMessage("微信端新增失败");
}
hr.setResult(staffId);
......@@ -636,8 +636,8 @@ public class StaffApiServiceImpl implements StaffApiService {
isCodeExist.setClerkCode(null);
staffDepartmentRelatedMapper.updateByPrimaryKey(EntityUtil.changeEntityByJSON(TabHaobanStaffDepartmentRelated.class, isCodeExist));
}
HaobanResponse hr = this.add(staff, department.getDepartmentId());
if(hr.getErrorCode() == 1){
ServiceResponse hr = this.add(staff, department.getDepartmentId());
if(hr.getCode() == 1){
StaffDepartmentRelatedDTO staffRelated = this.getDepartmentIdAndStaffId(departmentId, hr.getResult().toString());
logger.info("【gic导购新增】staffRelated={}",JSON.toJSONString(staffRelated));
//绑定
......
......@@ -34,6 +34,7 @@ import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.base.api.common.PageResult;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.manage.web.anno.IgnoreLogin;
import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.common.utils.EntityUtil;
......@@ -185,8 +186,8 @@ public class DepartmentContoller extends WebBaseController{
department.setChainId(dto.getChainId() + Constant.ID_SEPARATOR + dto.getDepartmentId());
department.setIsStore(0);
department.setLevel(dto.getLevel() + 1);
HaobanResponse hr = departmentApiService.add(department);
if(hr.getErrorCode() != 1){
ServiceResponse hr = departmentApiService.add(department);
if(hr.getCode() != 1){
return resultResponse(HaoBanErrCode.ERR_DEFINE, hr.getMessage(), null, hr.getMessage());
}
......@@ -236,14 +237,14 @@ public class DepartmentContoller extends WebBaseController{
if(dto == null || dto.getStatusFlag() == 0) {
return resultResponse(HaoBanErrCode.ERR_10003);
}
HaobanResponse hr;
ServiceResponse hr;
if(StringUtils.isBlank(dto.getRelatedId())) {
hr = departmentApiService.del(departmentId);
}else {
hr = departmentApiService.recycle(departmentId);
}
if(hr.getErrorCode() == 0) {
if(hr.getCode() == 0) {
return resultResponse(HaoBanErrCode.ERR_0, hr.getMessage(),null,hr.getMessage());
}
return resultResponse(HaoBanErrCode.ERR_1);
......@@ -432,8 +433,8 @@ public class DepartmentContoller extends WebBaseController{
department.setRelatedId(departmentAddQO.getRelatedId());
department.setRelatedCode(storeCode);
department.setSort(maxSort - sort);
HaobanResponse hr = departmentApiService.add(department);
if(hr.getErrorCode() != 1) {
ServiceResponse hr = departmentApiService.add(department);
if(hr.getCode() != 1) {
continue;
}
DepartmentDTO departmentAdd = (DepartmentDTO) hr.getResult();
......@@ -473,7 +474,7 @@ public class DepartmentContoller extends WebBaseController{
logger.info("【部门修改】department={}",JSON.toJSONString(department));
handerSonDepartment(departmentQO.getCurrDepartment());
HaobanResponse hr = departmentApiService.edit(department);
ServiceResponse hr = departmentApiService.edit(department);
String sonDepartment = departmentQO.getChildren();
handler(sonDepartment,department.getDepartmentId());
......@@ -636,8 +637,8 @@ public class DepartmentContoller extends WebBaseController{
}
department.setRelatedId(departmentAddQO.getRelatedId());
department.setRelatedCode(storeCode);
HaobanResponse hr = departmentApiService.add(department);
if(hr.getErrorCode() != 1) {
ServiceResponse hr = departmentApiService.add(department);
if(hr.getCode() != 1) {
continue;
}
DepartmentDTO departmentAdd = (DepartmentDTO) hr.getResult();
......@@ -657,8 +658,8 @@ public class DepartmentContoller extends WebBaseController{
department.setChainId(dto.getChainId() + Constant.ID_SEPARATOR + dto.getDepartmentId());
department.setChainName(dto.getChainName() + Constant.NAME_SEPARATOR + dto.getDepartmentName());
department.setSort(departmentAddQO.getSort());
HaobanResponse hr = departmentApiService.edit(department);
if(hr.getErrorCode() != 1) {
ServiceResponse hr = departmentApiService.edit(department);
if(hr.getCode() != 1) {
continue;
}
DepartmentDTO departmentEdit = (DepartmentDTO) hr.getResult();
......@@ -711,8 +712,8 @@ public class DepartmentContoller extends WebBaseController{
}
staff.setSyncPostionFlag(1);
HaobanResponse hr = staffApiService.add(staff, departmentId);
if(hr.getErrorCode() == 1){
ServiceResponse hr = staffApiService.add(staff, departmentId);
if(hr.getCode() == 1){
StaffDepartmentRelatedDTO staffRelated = staffApiService.getDepartmentIdAndStaffId(departmentId, hr.getResult().toString());
StaffDepartmentRelatedDTO isCodeExist = staffApiService.getDepartmentIdAndCode(departmentId,clerkCode);
if(staffRelated != null && isCodeExist == null){
......@@ -766,7 +767,7 @@ public class DepartmentContoller extends WebBaseController{
public HaobanResponse departmentBatchDel(String departmentIds) {
String[] departmentIdArr = departmentIds.split(",");
for (String departmentId : departmentIdArr) {
HaobanResponse hr;
ServiceResponse hr;
hr = departmentApiService.del(departmentId);
}
......
......@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.PageResult;
import com.gic.haoban.base.api.common.ServiceResponse;
import com.gic.haoban.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.StaffDTO;
......@@ -64,9 +65,9 @@ public class StaffController extends WebBaseController{
if(staff != null) {
return resultResponse(HaoBanErrCode.ERR_10005);
}
HaobanResponse hr = staffApiService.add(staffDTO,departmentIds);
if(hr.getErrorCode() == 0){
return resultResponse(HaoBanErrCode.ERR_DEFINE, hr.getDetailError(), null, hr.getDetailError());
ServiceResponse hr = staffApiService.add(staffDTO,departmentIds);
if(hr.getCode() == 0){
return resultResponse(HaoBanErrCode.ERR_DEFINE, hr.getMessage(), null, hr.getMessage());
}
return resultResponse(HaoBanErrCode.ERR_1);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment