New file |
| | |
| | | package com.example.erp.controller.pp; |
| | | |
| | | import cn.dev33.satoken.annotation.SaCheckPermission; |
| | | import com.example.erp.common.Constants; |
| | | import com.example.erp.common.Result; |
| | | import com.example.erp.entity.pp.BasicDataProduce; |
| | | import com.example.erp.entity.pp.FlowCard; |
| | | import com.example.erp.exception.ServiceException; |
| | | import com.example.erp.service.pp.BasicDateProduceService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | | |
| | | @Api(value="基础数据controller",tags={"基础数据操作接口"}) |
| | | @RequestMapping("/basicDataProduce") |
| | | public class BasicDataProduceController { |
| | | @Autowired |
| | | BasicDateProduceService basicDateProduceService; |
| | | @ApiOperation("查询工序接口") |
| | | @PostMapping ("/selectProcess") |
| | | public Result selectProcess() { |
| | | return Result.seccess(basicDateProduceService.selectProcessSv()); |
| | | } |
| | | |
| | | @ApiOperation("查询所有基础数据接口") |
| | | @SaCheckPermission("selectProductionBasicData.search") |
| | | @PostMapping ("/selectBasic") |
| | | public Result selectBasic() { |
| | | return Result.seccess(basicDateProduceService.selectBasicSv()); |
| | | } |
| | | |
| | | @ApiOperation("根据Id查询对应基础数据接口") |
| | | @PostMapping ("/openSelectId/{id}") |
| | | public Result openSelectId( |
| | | @PathVariable String id){ |
| | | return Result.seccess(basicDateProduceService.openSelectIdSv(id)); |
| | | |
| | | } |
| | | |
| | | @ApiOperation("删除基础数据接口") |
| | | @SaCheckPermission("selectProductionBasicData.delete") |
| | | @PostMapping("/deleteBasic/{id}") |
| | | public Result deleteBasic(@PathVariable String id){ |
| | | if(basicDateProduceService.deleteBasicSv(id)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"删除失败!"); |
| | | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("修改基础数据接口") |
| | | @PostMapping("/updateBasic/{id}/{process}/{name}/{type}") |
| | | public Result updateBasic(@PathVariable String id, |
| | | @PathVariable String process, |
| | | @PathVariable String name, |
| | | @PathVariable String type){ |
| | | if(basicDateProduceService.updateBasicSv(id,process,name,type)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"修改失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("班组基础数据添加接口") |
| | | @SaCheckPermission("addTeamGroup.add") |
| | | @PostMapping("/saveTeamGroup") |
| | | public Result saveTeamGroup( @RequestBody Map<String,Object> object){ |
| | | if(basicDateProduceService.saveTeamGroupSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("次破类型基础数据添加接口") |
| | | @SaCheckPermission("addBreakageType.add") |
| | | @PostMapping("/saveBreakageType") |
| | | public Result saveBreakageType( @RequestBody Map<String,Object> object){ |
| | | if(basicDateProduceService.saveBreakageTypeSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | @ApiOperation("次破原因基础数据添加接口") |
| | | @SaCheckPermission("addBreakageReason.add") |
| | | @PostMapping("/saveBreakageReason") |
| | | public Result saveBreakageReason( @RequestBody Map<String,Object> object){ |
| | | if(basicDateProduceService.saveBreakageReasonSv(object)){ |
| | | return Result.seccess(); |
| | | }else { |
| | | throw new ServiceException(Constants.Code_500,"保存失败"); |
| | | |
| | | } |
| | | } |
| | | |
| | | } |