| | |
| | | import org.jeecg.modules.mes.service.IMesProductionOrderService; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import java.util.Arrays; |
| | | |
| | | /** |
| | | * @Description: SAPç产订å |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-04 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="SAPç产订å") |
| | | * @Description: SAPç产订å |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-07-04 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags = "SAPç产订å") |
| | | @RestController |
| | | @RequestMapping("/mesproductionwork/mesProductionOrder") |
| | | @RequestMapping("/mes/productionOrder") |
| | | @Slf4j |
| | | public class MesProductionOrderController extends JeecgController<MesProductionOrder, IMesProductionOrderService> { |
| | | @Autowired |
| | | private IMesProductionOrderService mesProductionOrderService; |
| | | @Autowired |
| | | private IMesProductionOrderService mesProductionOrderService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param mesProductionOrder |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "SAPç产订å-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="SAPç产订å-å页å表æ¥è¯¢", notes="SAPç产订å-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<MesProductionOrder>> queryPageList(MesProductionOrder mesProductionOrder, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<MesProductionOrder> queryWrapper = QueryGenerator.initQueryWrapper(mesProductionOrder, req.getParameterMap()); |
| | | Page<MesProductionOrder> page = new Page<MesProductionOrder>(pageNo, pageSize); |
| | | IPage<MesProductionOrder> pageList = mesProductionOrderService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param mesProductionOrder |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "SAPç产订å-å页å表æ¥è¯¢", notes = "SAPç产订å-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<MesProductionOrder>> queryPageList(MesProductionOrder mesProductionOrder, |
| | | @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, |
| | | @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<MesProductionOrder> queryWrapper = QueryGenerator.initQueryWrapper(mesProductionOrder, req.getParameterMap()); |
| | | Page<MesProductionOrder> page = new Page<MesProductionOrder>(pageNo, pageSize); |
| | | IPage<MesProductionOrder> pageList = mesProductionOrderService.page(page, queryWrapper); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param mesProductionOrder |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "SAPç产订å-æ·»å ") |
| | | @ApiOperation(value="SAPç产订å-æ·»å ", notes="SAPç产订å-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_production_order:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody MesProductionOrder mesProductionOrder) { |
| | | mesProductionOrderService.save(mesProductionOrder); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param mesProductionOrder |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "SAPç产订å-ç¼è¾") |
| | | @ApiOperation(value = "SAPç产订å-ç¼è¾", notes = "SAPç产订å-ç¼è¾") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT, RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody MesProductionOrder mesProductionOrder) { |
| | | mesProductionOrderService.updateById(mesProductionOrder); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param mesProductionOrder |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "SAPç产订å-ç¼è¾") |
| | | @ApiOperation(value="SAPç产订å-ç¼è¾", notes="SAPç产订å-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_production_order:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody MesProductionOrder mesProductionOrder) { |
| | | mesProductionOrderService.updateById(mesProductionOrder); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "SAPç产订å-éè¿idå é¤") |
| | | @ApiOperation(value="SAPç产订å-éè¿idå é¤", notes="SAPç产订å-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_production_order:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | mesProductionOrderService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "SAPç产订å-æ¹éå é¤") |
| | | @ApiOperation(value="SAPç产订å-æ¹éå é¤", notes="SAPç产订å-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:mes_production_order:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.mesProductionOrderService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "SAPç产订å-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="SAPç产订å-éè¿idæ¥è¯¢", notes="SAPç产订å-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<MesProductionOrder> queryById(@RequestParam(name="id",required=true) String id) { |
| | | MesProductionOrder mesProductionOrder = mesProductionOrderService.getById(id); |
| | | if(mesProductionOrder==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(mesProductionOrder); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param mesProductionOrder |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:mes_production_order:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, MesProductionOrder mesProductionOrder) { |
| | | return super.exportXls(request, mesProductionOrder, MesProductionOrder.class, "SAPç产订å"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("mes_production_order:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, MesProductionOrder.class); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "SAPç产订å-éè¿idæ¥è¯¢", notes = "SAPç产订å-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<MesProductionOrder> queryById(@RequestParam(name = "id", required = true) String id) { |
| | | MesProductionOrder mesProductionOrder = mesProductionOrderService.getById(id); |
| | | if (mesProductionOrder == null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(mesProductionOrder); |
| | | } |
| | | } |