Commit 3e9bfd94 by qwmqiuwenmin

fix

parent 86c916c2
...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.api.service; ...@@ -2,6 +2,8 @@ package com.gic.haoban.manage.api.service;
import java.util.List; 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.common.utils.HaobanResponse;
import com.gic.haoban.manage.api.dto.DepartmentDTO; import com.gic.haoban.manage.api.dto.DepartmentDTO;
...@@ -45,4 +47,21 @@ public interface DepartmentApiService { ...@@ -45,4 +47,21 @@ public interface DepartmentApiService {
*/ */
HaobanResponse recycle(String departmentId); HaobanResponse recycle(String departmentId);
/**
* 根据参数查询
* @param pageInfo
* @param wxEnterpriseId
* @param keyword
* @param storeFlag
* @param recycleFlag
* @return
*/
Page<DepartmentDTO> pageDepartmentByParams(BasePageInfo pageInfo, String wxEnterpriseId, String keyword,
Integer storeFlag, Integer recycleFlag);
/**
* 回收站恢复
* @param departmentId
*/
HaobanResponse repairRecycle(String departmentId);
} }
...@@ -5,6 +5,7 @@ import java.util.List; ...@@ -5,6 +5,7 @@ import java.util.List;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment; import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.github.pagehelper.Page;
public interface DepartmentMapper { public interface DepartmentMapper {
int deleteByPrimaryKey(String departmentId); int deleteByPrimaryKey(String departmentId);
...@@ -24,4 +25,7 @@ public interface DepartmentMapper { ...@@ -24,4 +25,7 @@ public interface DepartmentMapper {
int selectMaxSort(@Param("parentDepartmentId")String parentDepartmentId); int selectMaxSort(@Param("parentDepartmentId")String parentDepartmentId);
TabHaobanDepartment selectByRelatedId(@Param("relatedId")String relatedId); TabHaobanDepartment selectByRelatedId(@Param("relatedId")String relatedId);
Page<TabHaobanDepartment> pageDepartmentByParams(@Param("wxEnterpriseId")String wxEnterpriseId, @Param("keyword")String keyword,
@Param("storeFlag")Integer storeFlag, @Param("recycleFlag")Integer recycleFlag);
} }
\ No newline at end of file
...@@ -2,9 +2,9 @@ package com.gic.haoban.manage.service.service; ...@@ -2,9 +2,9 @@ package com.gic.haoban.manage.service.service;
import java.util.List; import java.util.List;
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.service.entity.TabHaobanDepartment; import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.github.pagehelper.Page;
public interface DepartmentService { public interface DepartmentService {
...@@ -22,4 +22,8 @@ public interface DepartmentService { ...@@ -22,4 +22,8 @@ public interface DepartmentService {
void recycle(String departmentId); void recycle(String departmentId);
Page<TabHaobanDepartment> pageDepartmentByParams(String wxEnterpriseId, String keyword, Integer storeFlag, Integer recycleFlag);
void repairRecycle(String departmentId);
} }
...@@ -13,6 +13,7 @@ import com.gic.haoban.manage.api.dto.DepartmentDTO; ...@@ -13,6 +13,7 @@ import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.service.dao.mapper.DepartmentMapper; import com.gic.haoban.manage.service.dao.mapper.DepartmentMapper;
import com.gic.haoban.manage.service.entity.TabHaobanDepartment; import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.service.DepartmentService; import com.gic.haoban.manage.service.service.DepartmentService;
import com.github.pagehelper.Page;
@Service @Service
public class DepartmentServiceImpl implements DepartmentService { public class DepartmentServiceImpl implements DepartmentService {
...@@ -86,4 +87,21 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -86,4 +87,21 @@ public class DepartmentServiceImpl implements DepartmentService {
mapper.updateByPrimaryKeySelective(tab); mapper.updateByPrimaryKeySelective(tab);
} }
@Override
public Page<TabHaobanDepartment> pageDepartmentByParams(String wxEnterpriseId, String keyword, Integer storeFlag, Integer recycleFlag) {
return mapper.pageDepartmentByParams(wxEnterpriseId,keyword,storeFlag,recycleFlag);
}
@Override
public void repairRecycle(String departmentId) {
TabHaobanDepartment tab = mapper.selectByPrimaryKey(departmentId);
if(tab != null) {
tab.setRecycleFlag(0);
tab.setUpdateTime(new Date());
}
mapper.updateByPrimaryKeySelective(tab);
}
} }
...@@ -7,8 +7,11 @@ import org.apache.commons.lang3.StringUtils; ...@@ -7,8 +7,11 @@ import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import com.gic.api.base.commons.Page;
import com.gic.commons.util.EntityUtil; import com.gic.commons.util.EntityUtil;
import com.gic.haoban.base.api.common.BasePageInfo;
import com.gic.haoban.common.utils.HaobanResponse; 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.common.utils.StringUtil;
import com.gic.haoban.manage.api.dto.DepartmentDTO; import com.gic.haoban.manage.api.dto.DepartmentDTO;
import com.gic.haoban.manage.api.service.DepartmentApiService; import com.gic.haoban.manage.api.service.DepartmentApiService;
...@@ -16,6 +19,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanDepartment; ...@@ -16,6 +19,7 @@ import com.gic.haoban.manage.service.entity.TabHaobanDepartment;
import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated; import com.gic.haoban.manage.service.entity.TabHaobanStaffDepartmentRelated;
import com.gic.haoban.manage.service.service.DepartmentService; import com.gic.haoban.manage.service.service.DepartmentService;
import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService; import com.gic.haoban.manage.service.service.StaffDepartmentRelatedService;
import com.github.pagehelper.PageHelper;
@Service @Service
public class DepartmentApiServiceImpl implements DepartmentApiService { public class DepartmentApiServiceImpl implements DepartmentApiService {
...@@ -115,4 +119,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService { ...@@ -115,4 +119,20 @@ public class DepartmentApiServiceImpl implements DepartmentApiService {
return hr; return hr;
} }
@Override
public Page<DepartmentDTO> pageDepartmentByParams(BasePageInfo pageInfo, String wxEnterpriseId, String keyword,
Integer storeFlag, Integer recycleFlag) {
PageHelper.startPage(pageInfo.getPageNum(), pageInfo.getPageSize());
return PageUtil.changePageHelperToCurrentPage(departmentService.pageDepartmentByParams(wxEnterpriseId,keyword,storeFlag,recycleFlag),DepartmentDTO.class);
}
@Override
public HaobanResponse repairRecycle(String departmentId) {
HaobanResponse hr = new HaobanResponse();
hr.setErrorCode(0);
departmentService.repairRecycle(departmentId);
return hr;
}
} }
...@@ -9,9 +9,11 @@ import org.springframework.web.bind.annotation.RequestMapping; ...@@ -9,9 +9,11 @@ import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.gic.api.base.commons.Page;
import com.gic.enterprise.api.dto.StoreDTO; import com.gic.enterprise.api.dto.StoreDTO;
import com.gic.enterprise.api.service.DepartmentService; import com.gic.enterprise.api.service.DepartmentService;
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.Constant; import com.gic.haoban.base.api.common.Constant;
import com.gic.haoban.common.utils.AuthRequestUtil; import com.gic.haoban.common.utils.AuthRequestUtil;
import com.gic.haoban.common.utils.HaobanResponse; import com.gic.haoban.common.utils.HaobanResponse;
...@@ -213,10 +215,22 @@ public class DepartmentContoller extends WebBaseController{ ...@@ -213,10 +215,22 @@ public class DepartmentContoller extends WebBaseController{
@RequestMapping("department-recycle-list") @RequestMapping("department-recycle-list")
public HaobanResponse departmentRecycleList(String keyWrod,String storeFlag) { public HaobanResponse departmentRecycleList(String keyword,Integer storeFlag,BasePageInfo pageInfo) {
LoginVO login = (LoginVO) AuthRequestUtil.getAppLoginUser(); LoginVO login = (LoginVO) AuthRequestUtil.getAppLoginUser();
String wxEnterpriseId = login.getWxEnterpriseId(); String wxEnterpriseId = login.getWxEnterpriseId();
Integer recycleFlag = 1;
Page<DepartmentDTO> page = departmentApiService.pageDepartmentByParams(pageInfo,wxEnterpriseId,keyword,storeFlag,recycleFlag);
return resultResponse(HaoBanErrCode.ERR_1,page);
}
@RequestMapping("department-repair")
public HaobanResponse departmentRepair(String departmentId) {
DepartmentDTO dto = departmentApiService.selectById(departmentId);
if(dto == null || dto.getStatusFlag() == 0) {
return resultResponse(HaoBanErrCode.ERR_10003);
}
departmentApiService.repairRecycle(departmentId);
return resultResponse(HaoBanErrCode.ERR_1); return resultResponse(HaoBanErrCode.ERR_1);
} }
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
<context:component-scan base-package="com.gic.haoban" /> <context:component-scan base-package="com.gic.haoban" />
<!-- 应用名称 --> <!-- 应用名称 -->
<dubbo:application name="haoban-apps-web"/> <dubbo:application name="haoban-manage3-web"/>
<dubbo:protocol name="dubbo" port="30009"/> <dubbo:protocol name="dubbo" port="30009"/>
<!-- 使用zookeeper注册中心暴露服务地址 --> <!-- 使用zookeeper注册中心暴露服务地址 -->
......
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