package com.xzx.gc.user.controller; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import com.xzx.gc.common.Result; import com.xzx.gc.common.constant.CommonEnum; import com.xzx.gc.common.constant.Constants; import com.xzx.gc.common.dto.log.OperationAppLog; import com.xzx.gc.common.request.BaseController; import com.xzx.gc.common.utils.BusinessUtil; import com.xzx.gc.entity.UserGatherApply; import com.xzx.gc.entity.UserGatherInfo; import com.xzx.gc.model.IdDTO; import com.xzx.gc.model.user.UserGatherAuditParam; import com.xzx.gc.model.user.UserGatherListParDTO; import com.xzx.gc.user.service.UserGatherApplyService; import com.xzx.gc.user.service.UserGatherInfoService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.RequestBody; import org.springframework.web.bind.annotation.RestController; import javax.servlet.http.HttpServletRequest; import java.util.List; @RestController @Validated @Slf4j @Api(tags = "集货员管理") public class UserGatherController extends BaseController { @Autowired private UserGatherInfoService userGatherInfoService; @Autowired private UserGatherApplyService userGatherApplyService; @PostMapping(value = {"/userGather/find"}) @ApiOperation(value = "根据ID查询集货员") public Result find(HttpServletRequest request, @RequestBody IdDTO idDTO) { UserGatherInfo byId = userGatherInfoService.findById(idDTO.getId()); UserGatherApply byRelationId = userGatherApplyService.findByRelationId(idDTO.getId()); byId.setApplyInfo(byRelationId); return Result.success(byId); } @PostMapping(value = {"/admin/front/userGather/list"}) @ApiOperation(value = "查询集货员列表") public Result> list(HttpServletRequest request, @RequestBody UserGatherListParDTO userGatherListParDTO) { PageHelper.startPage(userGatherListParDTO.getPageNo(),userGatherListParDTO.getPageSize()); List list= userGatherInfoService.list(userGatherListParDTO); return Result.success(new PageInfo<>(list)); } @PostMapping(value = {"/admin/front/userGather/delete"}) @ApiOperation(value = "删除集货员") public Result delete(HttpServletRequest request, @RequestBody IdDTO idDTO) { userGatherInfoService.deleteById(idDTO.getId()); OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) .methodName(Constants.USER_MODUL_NAME).operateAction("删除集货员-"+idDTO.getId()).build(); mqUtil.sendApp(build); return Result.success(); } }