|  |  |  | 
|---|
|  |  |  | package com.xzx.gc.user.controller; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import cn.hutool.core.collection.CollUtil; | 
|---|
|  |  |  | import cn.hutool.core.util.ObjectUtil; | 
|---|
|  |  |  | 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.entity.JhyInfo; | 
|---|
|  |  |  | import com.xzx.gc.entity.ScoreDetails; | 
|---|
|  |  |  | import com.xzx.gc.entity.ScoreOrder; | 
|---|
|  |  |  | import com.xzx.gc.model.JsonResult; | 
|---|
|  |  |  | import com.xzx.gc.user.dto.ExamineJwyDto; | 
|---|
|  |  |  | import com.xzx.gc.user.dto.JhyInfoListDto; | 
|---|
|  |  |  | import com.xzx.gc.user.mapper.JhyInfoMapper; | 
|---|
|  |  |  | import com.xzx.gc.user.service.JhyInfoService; | 
|---|
|  |  |  | import com.xzx.gc.user.vo.JhyInfoListVo; | 
|---|
|  |  |  | import io.swagger.annotations.Api; | 
|---|
|  |  |  | import io.swagger.annotations.ApiOperation; | 
|---|
|  |  |  | import io.swagger.annotations.ApiResponse; | 
|---|
|  |  |  | import io.swagger.annotations.ApiResponses; | 
|---|
|  |  |  | import lombok.extern.slf4j.Slf4j; | 
|---|
|  |  |  | import org.springframework.beans.factory.annotation.Autowired; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.PostMapping; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RequestBody; | 
|---|
|  |  |  | import org.springframework.web.bind.annotation.RestController; | 
|---|
|  |  |  | import tk.mybatis.mapper.entity.Example; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | import javax.servlet.http.HttpServletRequest; | 
|---|
|  |  |  | import java.util.List; | 
|---|
|  |  |  | import java.util.Map; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RestController | 
|---|
|  |  |  | @Api(tags = {"集物员--集物员管理"}) | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private JhyInfoService jhyInfoService; | 
|---|
|  |  |  | @Autowired | 
|---|
|  |  |  | private JhyInfoMapper jhyInfoMapper; | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @ApiOperation(value = "集货员信息列表") | 
|---|
|  |  |  | @ApiResponses( | 
|---|
|  |  |  | @ApiResponse(code = 200, message = "success", response = JhyInfoListVo.class) | 
|---|
|  |  |  | ) | 
|---|
|  |  |  | @PostMapping(value = Constants.ADMIN_VIEW_PREFIX + "/jhy/list.json") | 
|---|
|  |  |  | public JsonResult<Map<String, Object>> jhyList(@RequestBody JhyInfoListDto jhyInfoListDto) { | 
|---|
|  |  |  | return JsonResult.success(jhyInfoService.queryList(jhyInfoListDto)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | /** | 
|---|
|  |  |  | * 取消 | 
|---|
|  |  |  | */ | 
|---|
|  |  |  | @PostMapping(Constants.ADMIN_VIEW_PREFIX + "/jhy/examineJwy.json") | 
|---|
|  |  |  | @ApiOperation(value="集物员--审核", notes="test: 仅0有正确返回") | 
|---|
|  |  |  | public JsonResult examineJwy(@RequestBody ExamineJwyDto model, HttpServletRequest request) { | 
|---|
|  |  |  | long id = model.getId(); | 
|---|
|  |  |  | JhyInfo jhyInfo = jhyInfoMapper.selectByPrimaryKey(id); | 
|---|
|  |  |  | if(ObjectUtil.isEmpty(jhyInfo)){ | 
|---|
|  |  |  | return JsonResult.failMessage("当前记录不存在!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | Integer status = jhyInfo.getStatus(); | 
|---|
|  |  |  | if(1 != status){ | 
|---|
|  |  |  | return JsonResult.failMessage("当前不是待审核状态!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | jhyInfoService.examineJwy(model); | 
|---|
|  |  |  | OperationAppLog build = OperationAppLog.builder().appPrograme(CommonEnum.后台.getValue()).opreateName(getAdminName(request)) | 
|---|
|  |  |  | .methodName(Constants.SCORESHOP_MODUL_NAME).operateAction("集物员--审核-" + id).build(); | 
|---|
|  |  |  | mqUtil.sendApp(build); | 
|---|
|  |  |  | return  JsonResult.success("操作成功!"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|