123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198 |
- package com.steerinfo.dil.controller;
- import com.alibaba.fastjson.JSON;
- import com.steerinfo.dil.feign.ESFeign;
- import com.steerinfo.dil.model.RmsPersonnel;
- import com.steerinfo.dil.service.impl.RmsPersonnelServiceImpl;
- import com.steerinfo.dil.util.BaseRESTfulController;
- import com.steerinfo.dil.util.ColumnDataUtil;
- import com.steerinfo.dil.util.PageListAdd;
- import com.steerinfo.framework.controller.RESTfulResult;
- import com.steerinfo.framework.service.pagehelper.PageHelper;
- import io.swagger.annotations.ApiImplicitParam;
- import io.swagger.annotations.ApiImplicitParams;
- import io.swagger.annotations.ApiOperation;
- import org.springframework.beans.factory.annotation.Autowired;
- import org.springframework.web.bind.annotation.*;
- import java.math.BigDecimal;
- import java.util.HashMap;
- import java.util.List;
- import java.util.Map;
- @RestController
- @RequestMapping("/${api.version}/rmspersonnel")
- public class RmsPersonnelController extends BaseRESTfulController {
- @Autowired
- RmsPersonnelServiceImpl rmsPersonnelService;
- @Autowired
- ColumnDataUtil columnDataUtil;
- @Autowired
- ESFeign esFeign;
-
- @ApiOperation(value="展示人员信息", notes="分页查询")
- @ApiImplicitParams({
- @ApiImplicitParam(name = "pageNum", value = "查询页数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "pageSize", value = "每页记录数", required = false, dataType = "Integer"),
- @ApiImplicitParam(name = "apiId", value = "341", required = false, dataType = "BigDecimal"),
- })
-
- @PostMapping(value = "/getPersonnelList")
- public RESTfulResult getPersonnelList(@RequestBody(required = false) Map<String,Object> mapValue,
- Integer apiId,
- Integer pageNum,
- Integer pageSize,
- String con){
- PageHelper.startPage(pageNum, pageSize);
-
- List<Map<String, Object>> columnList = rmsPersonnelService.getPersonnelList(mapValue);
- PageListAdd data = columnDataUtil.tableColumnData(apiId,null,columnList);
- return success(data);
- }
-
- @ApiOperation(value="创建", notes="根据RmsPersonnel对象创建")
- @ApiImplicitParam(name = "rmsPersonnel", value = "详细实体rmsPersonnel", required = false, dataType = "RmsPersonnel")
- @PostMapping(value = "/insertPersonnel")
- public RESTfulResult insertPersonnel(@RequestBody(required = false) Map<String,Object> map){
- int result=rmsPersonnelService.insertPersonnel(map);
- if (result <= 0){
- return failed();
- }
- return success(result);
- }
-
- @ApiOperation(value="更新详细信息", notes="根据url的id来指定更新对象,并根据传过来的rmsPersonnel信息来更新详细信息")
- @ApiImplicitParams({
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal"),
- @ApiImplicitParam(name = "rmsPersonnel", value = "详细实体rmsPersonnel", required = true, dataType = "RmsPersonnel")
- })
- @PostMapping(value = "/updatePersonnel", produces = "application/json;charset=UTF-8")
- public RESTfulResult updatePersonnel(@RequestBody RmsPersonnel rmsPersonnel){
- int result=rmsPersonnelService.updatePersonnel(rmsPersonnel);
- return success(result);
- }
-
- @ApiOperation(value="删除", notes="根据url的id来指定删除对象")
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
-
- @PostMapping(value = "/deletePersonnel/{id}")
- public RESTfulResult deletePeronnel(@PathVariable ("id") BigDecimal id ){
- return success(rmsPersonnelService.deletePersonnel(id));
- }
-
- @ApiOperation(value="获取详细信息", notes="根据url的id来获取详细信息")
- @ApiImplicitParam(paramType = "path", name = "id", value = "ID", required = true, dataType = "BigDecimal")
- @PostMapping(value = "/getPersonnelById/{id}")
- public RESTfulResult getPersonnelById(@PathVariable("id") BigDecimal id){
- List<Map<String, Object>> list= rmsPersonnelService.getPersonnelById(id);
- System.out.println(list);
- return success(list);
- }
-
- @GetMapping("/getShipperId")
- public RESTfulResult getShipperId(){
- return success(rmsPersonnelService.getShipperId());
- }
-
- @GetMapping("/getSecondShipper")
- public RESTfulResult getSecondShipper() {
- return success(rmsPersonnelService.getSecondShipper());
- }
-
- @GetMapping("/getThirdShipper")
- public RESTfulResult getThirdShipper(@RequestParam Integer shipperId) {
- return success(rmsPersonnelService.getThirdShipper(new BigDecimal(shipperId)));
- }
-
- @PostMapping("/getShipperMap")
- public RESTfulResult getShipperMap(@RequestParam Integer shipperId) {
- return success(rmsPersonnelService.getShipperMap(new BigDecimal(shipperId)));
- }
- @PostMapping("/isInHere")
- public Integer isInHere(@RequestParam String personnelJobNumber) {
- Integer result = rmsPersonnelService.isInHere(personnelJobNumber);
- if (result != null && result.toString().length() != 0) {
- return 0;
- }
- else {
- return -1;
- }
- }
-
- @ApiOperation(value="创建", notes="RmsPersonnel对象创建")
- @PostMapping(value = "/addPersonnel")
- public RESTfulResult addPersonnel(@RequestBody(required = false) Map<String,Object> map){
- int result = rmsPersonnelService.addPersonnel(map);
- if (result <= 0){
- return failed();
- }
- return success(result);
- }
- }
|