¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.tms.controller; |
| | | |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | import java.util.stream.Collectors; |
| | | import java.io.IOException; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.net.URLDecoder; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | | import org.jeecg.modules.tms.entity.InStoreDetail; |
| | | import org.jeecg.modules.tms.entity.ToolsClassify; |
| | | import org.jeecg.modules.tms.service.IInStoreDetailService; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | |
| | | import org.jeecgframework.poi.excel.ExcelImportUtil; |
| | | import org.jeecgframework.poi.excel.def.NormalExcelConstants; |
| | | import org.jeecgframework.poi.excel.entity.ExportParams; |
| | | import org.jeecgframework.poi.excel.entity.ImportParams; |
| | | import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; |
| | | import org.jeecg.common.system.base.controller.JeecgController; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | import org.springframework.web.servlet.ModelAndView; |
| | | import com.alibaba.fastjson.JSON; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.jeecg.common.aspect.annotation.AutoLog; |
| | | |
| | | /** |
| | | * @Description: å
¥åºæç» |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-19 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="å
¥åºæç»") |
| | | @RestController |
| | | @RequestMapping("/tms/inStoreDetail") |
| | | @Slf4j |
| | | public class InStoreDetailController extends JeecgController<InStoreDetail, IInStoreDetailService> { |
| | | @Autowired |
| | | private IInStoreDetailService inStoreDetailService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param inStoreDetail |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param query |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "å
¥åºæç»-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="å
¥åºæç»-å页å表æ¥è¯¢", notes="å
¥åºæç»-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<?> findPageList(InStoreDetail inStoreDetail, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | @RequestParam Map<String, String> query) { |
| | | IPage<Map<String, Object>> pageList = inStoreDetailService.findPageList(pageNo, pageSize, query); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param inStoreDetail |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å
¥åºæç»-æ·»å ") |
| | | @ApiOperation(value="å
¥åºæç»-æ·»å ", notes="å
¥åºæç»-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody InStoreDetail inStoreDetail) { |
| | | inStoreDetailService.save(inStoreDetail); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param inStoreDetail |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å
¥åºæç»-ç¼è¾") |
| | | @ApiOperation(value="å
¥åºæç»-ç¼è¾", notes="å
¥åºæç»-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody InStoreDetail inStoreDetail) { |
| | | inStoreDetailService.updateById(inStoreDetail); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å
¥åºæç»-éè¿idå é¤") |
| | | @ApiOperation(value="å
¥åºæç»-éè¿idå é¤", notes="å
¥åºæç»-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | inStoreDetailService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "å
¥åºæç»-æ¹éå é¤") |
| | | @ApiOperation(value="å
¥åºæç»-æ¹éå é¤", notes="å
¥åºæç»-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.inStoreDetailService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "å
¥åºæç»-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="å
¥åºæç»-éè¿idæ¥è¯¢", notes="å
¥åºæç»-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<InStoreDetail> queryById(@RequestParam(name="id",required=true) String id) { |
| | | InStoreDetail inStoreDetail = inStoreDetailService.getById(id); |
| | | if(inStoreDetail==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(inStoreDetail); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param inStoreDetail |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:tms_in_store_detail:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, InStoreDetail inStoreDetail) { |
| | | return super.exportXls(request, inStoreDetail, InStoreDetail.class, "å
¥åºæç»"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("tms_in_store_detail:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, InStoreDetail.class); |
| | | } |
| | | |
| | | } |