Commit 9078ddd0 by qwmqiuwenmin

fix

parent cb82f8ca
...@@ -52,11 +52,6 @@ ...@@ -52,11 +52,6 @@
<artifactId>haoban-base-api</artifactId> <artifactId>haoban-base-api</artifactId>
<version>${haoban-base-api}</version> <version>${haoban-base-api}</version>
</dependency> </dependency>
<dependency>
<groupId>com.gic</groupId>
<artifactId>haoban-common</artifactId>
<version>${haoban-common}</version>
</dependency>
</dependencies> </dependencies>
<build> <build>
......
package com.gic.haoban.manage.api.dto; package com.gic.haoban.manage.api.dto;
import javax.persistence.criteria.CriteriaBuilder;
import java.io.Serializable; import java.io.Serializable;
/** /**
......
...@@ -4,7 +4,7 @@ import java.util.List; ...@@ -4,7 +4,7 @@ import java.util.List;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; 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; import com.gic.haoban.manage.api.dto.DepartmentDTO;
public interface DepartmentApiService { public interface DepartmentApiService {
...@@ -47,19 +47,19 @@ public interface DepartmentApiService { ...@@ -47,19 +47,19 @@ public interface DepartmentApiService {
* @param department * @param department
* @return * @return
*/ */
HaobanResponse add(DepartmentDTO department); ServiceResponse add(DepartmentDTO department);
/** /**
* 修改部门 * 修改部门
* @param department * @param department
* @return * @return
*/ */
HaobanResponse edit(DepartmentDTO department); ServiceResponse edit(DepartmentDTO department);
/** /**
* 删除部门 * 删除部门
* @param departmentId * @param departmentId
* @return * @return
*/ */
HaobanResponse del(String departmentId); ServiceResponse del(String departmentId);
/** /**
* 根据关联id 获取部门 * 根据关联id 获取部门
* @param departId * @param departId
...@@ -71,7 +71,7 @@ public interface DepartmentApiService { ...@@ -71,7 +71,7 @@ public interface DepartmentApiService {
* @param departmentId * @param departmentId
* @return * @return
*/ */
HaobanResponse recycle(String departmentId); ServiceResponse recycle(String departmentId);
/** /**
* 根据参数查询 * 根据参数查询
...@@ -88,7 +88,7 @@ public interface DepartmentApiService { ...@@ -88,7 +88,7 @@ public interface DepartmentApiService {
* 回收站恢复 * 回收站恢复
* @param departmentId * @param departmentId
*/ */
HaobanResponse repairRecycle(String departmentId,String parentId); ServiceResponse repairRecycle(String departmentId,String parentId);
/** /**
* 获取根节点 * 获取根节点
* @param wxEnterpriseId * @param wxEnterpriseId
...@@ -132,13 +132,13 @@ public interface DepartmentApiService { ...@@ -132,13 +132,13 @@ public interface DepartmentApiService {
* @param departmentId * @param departmentId
* @return * @return
*/ */
HaobanResponse wxCallBackDel(String departmentId); ServiceResponse wxCallBackDel(String departmentId);
/** /**
* 微信回调放回收站 * 微信回调放回收站
* @param departmentId * @param departmentId
* @return * @return
*/ */
HaobanResponse wxCallBackrecycle(String departmentId); ServiceResponse wxCallBackrecycle(String departmentId);
/** /**
* 判断节点下面有没有子节点 * 判断节点下面有没有子节点
* @param departmentId * @param departmentId
...@@ -149,6 +149,6 @@ public interface DepartmentApiService { ...@@ -149,6 +149,6 @@ public interface DepartmentApiService {
* gic回调删除部门 * gic回调删除部门
* @param departmentId * @param departmentId
*/ */
HaobanResponse gicDel(String departmentId); ServiceResponse gicDel(String departmentId);
} }
...@@ -4,7 +4,7 @@ import java.util.List; ...@@ -4,7 +4,7 @@ import java.util.List;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; 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.GicClerkDTO;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO; import com.gic.haoban.manage.api.dto.StaffDepartmentRelatedDTO;
...@@ -21,7 +21,7 @@ public interface StaffApiService { ...@@ -21,7 +21,7 @@ public interface StaffApiService {
public StaffDTO selectByNationcodeAndPhoneNumber(String wxEnterpriseId,String nationcode, String phoneNumber); 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); public List<StaffDepartmentRelatedDTO> listStaffDepartmentByStaffId(String staffId);
......
...@@ -7,7 +7,6 @@ import com.gic.haoban.base.api.common.BasePageInfo; ...@@ -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.QywxCorpInfoSimpleDTO;
import com.gic.haoban.manage.api.dto.WxEnterpriseDTO; import com.gic.haoban.manage.api.dto.WxEnterpriseDTO;
import com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO; import com.gic.haoban.manage.api.dto.YwWxEnterpriseDTO;
import com.github.pagehelper.Page;
public interface WxEnterpriseApiService { public interface WxEnterpriseApiService {
......
...@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON; ...@@ -4,7 +4,7 @@ import com.alibaba.fastjson.JSON;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.commons.util.GICMQClientUtil; import com.gic.commons.util.GICMQClientUtil;
import com.gic.haoban.base.api.common.Constant; 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.DepartmentDTO;
import com.gic.haoban.manage.api.dto.GicMessageDTO; import com.gic.haoban.manage.api.dto.GicMessageDTO;
import com.gic.haoban.manage.api.dto.QywxCallBackDTO; import com.gic.haoban.manage.api.dto.QywxCallBackDTO;
...@@ -105,12 +105,12 @@ public class MessageApiServiceImpl implements MessageApiService { ...@@ -105,12 +105,12 @@ public class MessageApiServiceImpl implements MessageApiService {
} }
departmentDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId()); departmentDTO.setWxEnterpriseId(enterprise.getWxEnterpriseId());
if(dto.getChangeType() == GicEditType.ADD.getCode()){ if(dto.getChangeType() == GicEditType.ADD.getCode()){
HaobanResponse response = this.departmentApiService.add(departmentDTO); ServiceResponse response = this.departmentApiService.add(departmentDTO);
log.info("添加结果:{}", JSON.toJSONString(response)); log.info("添加结果:{}", JSON.toJSONString(response));
}else if(dto.getChangeType() == GicEditType.UPDATE.getCode()){ }else if(dto.getChangeType() == GicEditType.UPDATE.getCode()){
TabHaobanDepartment department = this.departmentService.selectByRelatedId(dto.getId()); TabHaobanDepartment department = this.departmentService.selectByRelatedId(dto.getId());
if(department == null){ if(department == null){
HaobanResponse response = this.departmentApiService.add(departmentDTO); ServiceResponse response = this.departmentApiService.add(departmentDTO);
log.info("添加结果:{}", JSON.toJSONString(response)); log.info("添加结果:{}", JSON.toJSONString(response));
}else { }else {
departmentDTO.setDepartmentId(department.getDepartmentId()); departmentDTO.setDepartmentId(department.getDepartmentId());
......
...@@ -33,7 +33,7 @@ import com.gic.enterprise.api.dto.StoreGroupDTO; ...@@ -33,7 +33,7 @@ import com.gic.enterprise.api.dto.StoreGroupDTO;
import com.gic.enterprise.api.service.StoreGroupService; import com.gic.enterprise.api.service.StoreGroupService;
import com.gic.enterprise.api.service.StoreService; import com.gic.enterprise.api.service.StoreService;
import com.gic.haoban.base.api.common.BasePageInfo; 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.PageUtil;
import com.gic.haoban.common.utils.StringUtil; import com.gic.haoban.common.utils.StringUtil;
import com.gic.haoban.common.utils.UuidUtil; import com.gic.haoban.common.utils.UuidUtil;
...@@ -99,9 +99,9 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -99,9 +99,9 @@ public class StaffApiServiceImpl implements StaffApiService {
} }
@Override @Override
public HaobanResponse add(StaffDTO staff, String departmentIds) { public ServiceResponse add(StaffDTO staff, String departmentIds) {
HaobanResponse hr = new HaobanResponse(); ServiceResponse hr = new ServiceResponse();
hr.setErrorCode(1); hr.setCode(1);
Integer activeFlag = staff.getActiveFlag(); Integer activeFlag = staff.getActiveFlag();
staff.setActiveFlag(0); staff.setActiveFlag(0);
Integer syncPostionFlag = staff.getSyncPostionFlag(); Integer syncPostionFlag = staff.getSyncPostionFlag();
...@@ -142,8 +142,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -142,8 +142,8 @@ public class StaffApiServiceImpl implements StaffApiService {
JSONResponse jp = qywxUserApiService.createWorkWxUser(userDTO, enterpriseDTO.getCorpid(), application.getSiteId()); JSONResponse jp = qywxUserApiService.createWorkWxUser(userDTO, enterpriseDTO.getCorpid(), application.getSiteId());
logger.info("【店员新增】jp = {}",JSON.toJSONString(jp)); logger.info("【店员新增】jp = {}",JSON.toJSONString(jp));
if(jp.getErrorCode() != 0) { if(jp.getErrorCode() != 0) {
hr.setErrorCode(0); hr.setCode(0);
hr.setDetailError("微信新增失败"); hr.setMessage("微信新增失败");
return hr; return hr;
} }
staffService.add(tab); staffService.add(tab);
...@@ -164,7 +164,7 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -164,7 +164,7 @@ public class StaffApiServiceImpl implements StaffApiService {
staffDepartmentRelatedService.add(related); staffDepartmentRelatedService.add(related);
} }
}else { }else {
hr.setErrorCode(0); hr.setCode(0);
hr.setMessage("微信端新增失败"); hr.setMessage("微信端新增失败");
} }
hr.setResult(staffId); hr.setResult(staffId);
...@@ -636,8 +636,8 @@ public class StaffApiServiceImpl implements StaffApiService { ...@@ -636,8 +636,8 @@ public class StaffApiServiceImpl implements StaffApiService {
isCodeExist.setClerkCode(null); isCodeExist.setClerkCode(null);
staffDepartmentRelatedMapper.updateByPrimaryKey(EntityUtil.changeEntityByJSON(TabHaobanStaffDepartmentRelated.class, isCodeExist)); staffDepartmentRelatedMapper.updateByPrimaryKey(EntityUtil.changeEntityByJSON(TabHaobanStaffDepartmentRelated.class, isCodeExist));
} }
HaobanResponse hr = this.add(staff, department.getDepartmentId()); ServiceResponse hr = this.add(staff, department.getDepartmentId());
if(hr.getErrorCode() == 1){ if(hr.getCode() == 1){
StaffDepartmentRelatedDTO staffRelated = this.getDepartmentIdAndStaffId(departmentId, hr.getResult().toString()); StaffDepartmentRelatedDTO staffRelated = this.getDepartmentIdAndStaffId(departmentId, hr.getResult().toString());
logger.info("【gic导购新增】staffRelated={}",JSON.toJSONString(staffRelated)); logger.info("【gic导购新增】staffRelated={}",JSON.toJSONString(staffRelated));
//绑定 //绑定
......
...@@ -34,6 +34,7 @@ import com.gic.enterprise.api.service.StoreService; ...@@ -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.BasePageInfo;
import com.gic.haoban.base.api.common.Constant; import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.base.api.common.PageResult; 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.anno.IgnoreLogin;
import com.gic.haoban.manage.web.auth.AuthRequestUtil; import com.gic.haoban.manage.web.auth.AuthRequestUtil;
import com.gic.haoban.common.utils.EntityUtil; import com.gic.haoban.common.utils.EntityUtil;
...@@ -185,8 +186,8 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -185,8 +186,8 @@ public class DepartmentContoller extends WebBaseController{
department.setChainId(dto.getChainId() + Constant.ID_SEPARATOR + dto.getDepartmentId()); department.setChainId(dto.getChainId() + Constant.ID_SEPARATOR + dto.getDepartmentId());
department.setIsStore(0); department.setIsStore(0);
department.setLevel(dto.getLevel() + 1); department.setLevel(dto.getLevel() + 1);
HaobanResponse hr = departmentApiService.add(department); ServiceResponse hr = departmentApiService.add(department);
if(hr.getErrorCode() != 1){ if(hr.getCode() != 1){
return resultResponse(HaoBanErrCode.ERR_DEFINE, hr.getMessage(), null, hr.getMessage()); return resultResponse(HaoBanErrCode.ERR_DEFINE, hr.getMessage(), null, hr.getMessage());
} }
...@@ -236,14 +237,14 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -236,14 +237,14 @@ public class DepartmentContoller extends WebBaseController{
if(dto == null || dto.getStatusFlag() == 0) { if(dto == null || dto.getStatusFlag() == 0) {
return resultResponse(HaoBanErrCode.ERR_10003); return resultResponse(HaoBanErrCode.ERR_10003);
} }
HaobanResponse hr; ServiceResponse hr;
if(StringUtils.isBlank(dto.getRelatedId())) { if(StringUtils.isBlank(dto.getRelatedId())) {
hr = departmentApiService.del(departmentId); hr = departmentApiService.del(departmentId);
}else { }else {
hr = departmentApiService.recycle(departmentId); 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_0, hr.getMessage(),null,hr.getMessage());
} }
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
...@@ -432,8 +433,8 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -432,8 +433,8 @@ public class DepartmentContoller extends WebBaseController{
department.setRelatedId(departmentAddQO.getRelatedId()); department.setRelatedId(departmentAddQO.getRelatedId());
department.setRelatedCode(storeCode); department.setRelatedCode(storeCode);
department.setSort(maxSort - sort); department.setSort(maxSort - sort);
HaobanResponse hr = departmentApiService.add(department); ServiceResponse hr = departmentApiService.add(department);
if(hr.getErrorCode() != 1) { if(hr.getCode() != 1) {
continue; continue;
} }
DepartmentDTO departmentAdd = (DepartmentDTO) hr.getResult(); DepartmentDTO departmentAdd = (DepartmentDTO) hr.getResult();
...@@ -473,7 +474,7 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -473,7 +474,7 @@ public class DepartmentContoller extends WebBaseController{
logger.info("【部门修改】department={}",JSON.toJSONString(department)); logger.info("【部门修改】department={}",JSON.toJSONString(department));
handerSonDepartment(departmentQO.getCurrDepartment()); handerSonDepartment(departmentQO.getCurrDepartment());
HaobanResponse hr = departmentApiService.edit(department); ServiceResponse hr = departmentApiService.edit(department);
String sonDepartment = departmentQO.getChildren(); String sonDepartment = departmentQO.getChildren();
handler(sonDepartment,department.getDepartmentId()); handler(sonDepartment,department.getDepartmentId());
...@@ -636,8 +637,8 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -636,8 +637,8 @@ public class DepartmentContoller extends WebBaseController{
} }
department.setRelatedId(departmentAddQO.getRelatedId()); department.setRelatedId(departmentAddQO.getRelatedId());
department.setRelatedCode(storeCode); department.setRelatedCode(storeCode);
HaobanResponse hr = departmentApiService.add(department); ServiceResponse hr = departmentApiService.add(department);
if(hr.getErrorCode() != 1) { if(hr.getCode() != 1) {
continue; continue;
} }
DepartmentDTO departmentAdd = (DepartmentDTO) hr.getResult(); DepartmentDTO departmentAdd = (DepartmentDTO) hr.getResult();
...@@ -657,8 +658,8 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -657,8 +658,8 @@ public class DepartmentContoller extends WebBaseController{
department.setChainId(dto.getChainId() + Constant.ID_SEPARATOR + dto.getDepartmentId()); department.setChainId(dto.getChainId() + Constant.ID_SEPARATOR + dto.getDepartmentId());
department.setChainName(dto.getChainName() + Constant.NAME_SEPARATOR + dto.getDepartmentName()); department.setChainName(dto.getChainName() + Constant.NAME_SEPARATOR + dto.getDepartmentName());
department.setSort(departmentAddQO.getSort()); department.setSort(departmentAddQO.getSort());
HaobanResponse hr = departmentApiService.edit(department); ServiceResponse hr = departmentApiService.edit(department);
if(hr.getErrorCode() != 1) { if(hr.getCode() != 1) {
continue; continue;
} }
DepartmentDTO departmentEdit = (DepartmentDTO) hr.getResult(); DepartmentDTO departmentEdit = (DepartmentDTO) hr.getResult();
...@@ -711,8 +712,8 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -711,8 +712,8 @@ public class DepartmentContoller extends WebBaseController{
} }
staff.setSyncPostionFlag(1); staff.setSyncPostionFlag(1);
HaobanResponse hr = staffApiService.add(staff, departmentId); ServiceResponse hr = staffApiService.add(staff, departmentId);
if(hr.getErrorCode() == 1){ if(hr.getCode() == 1){
StaffDepartmentRelatedDTO staffRelated = staffApiService.getDepartmentIdAndStaffId(departmentId, hr.getResult().toString()); StaffDepartmentRelatedDTO staffRelated = staffApiService.getDepartmentIdAndStaffId(departmentId, hr.getResult().toString());
StaffDepartmentRelatedDTO isCodeExist = staffApiService.getDepartmentIdAndCode(departmentId,clerkCode); StaffDepartmentRelatedDTO isCodeExist = staffApiService.getDepartmentIdAndCode(departmentId,clerkCode);
if(staffRelated != null && isCodeExist == null){ if(staffRelated != null && isCodeExist == null){
...@@ -766,7 +767,7 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -766,7 +767,7 @@ public class DepartmentContoller extends WebBaseController{
public HaobanResponse departmentBatchDel(String departmentIds) { public HaobanResponse departmentBatchDel(String departmentIds) {
String[] departmentIdArr = departmentIds.split(","); String[] departmentIdArr = departmentIds.split(",");
for (String departmentId : departmentIdArr) { for (String departmentId : departmentIdArr) {
HaobanResponse hr; ServiceResponse hr;
hr = departmentApiService.del(departmentId); hr = departmentApiService.del(departmentId);
} }
......
...@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSON; ...@@ -14,6 +14,7 @@ import com.alibaba.fastjson.JSON;
import com.gic.api.base.commons.Page; import com.gic.api.base.commons.Page;
import com.gic.haoban.base.api.common.BasePageInfo; import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.base.api.common.PageResult; 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.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO; import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.dto.StaffDTO; import com.gic.haoban.manage.api.dto.StaffDTO;
...@@ -64,9 +65,9 @@ public class StaffController extends WebBaseController{ ...@@ -64,9 +65,9 @@ public class StaffController extends WebBaseController{
if(staff != null) { if(staff != null) {
return resultResponse(HaoBanErrCode.ERR_10005); return resultResponse(HaoBanErrCode.ERR_10005);
} }
HaobanResponse hr = staffApiService.add(staffDTO,departmentIds); ServiceResponse hr = staffApiService.add(staffDTO,departmentIds);
if(hr.getErrorCode() == 0){ if(hr.getCode() == 0){
return resultResponse(HaoBanErrCode.ERR_DEFINE, hr.getDetailError(), null, hr.getDetailError()); return resultResponse(HaoBanErrCode.ERR_DEFINE, hr.getMessage(), null, hr.getMessage());
} }
return resultResponse(HaoBanErrCode.ERR_1); 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