Merge remote-tracking branch 'origin/master'
| | |
| | | <when test="equipmentIds != null and equipmentIds.size() > 0 "> |
| | | AND t2.equipment_code IN |
| | | <foreach collection="equipmentIds" item="equipmentId" index="index" open="(" close=")" separator=","> |
| | | {equipmentId} |
| | | #{equipmentId} |
| | | </foreach> |
| | | </when> |
| | | <otherwise> |
| | |
| | | mpq.update_by updateBy, |
| | | mpq.update_time updateTime |
| | | FROM mdc_process_quantity mpq LEFT JOIN mdc_standard_process_duration mspd ON mpq.standard_id = mspd.id |
| | | WHERE mpq.id = { id } |
| | | WHERE mpq.id = #{ id } |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | 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.GoodsShelves; |
| | | import org.jeecg.modules.tms.service.IGoodsShelvesService; |
| | | |
| | | 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: tms_goods_shelves |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-08 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Api(tags="tms_goods_shelves") |
| | | @RestController |
| | | @RequestMapping("/tms/goodsShelves") |
| | | @Slf4j |
| | | public class GoodsShelvesController extends JeecgController<GoodsShelves, IGoodsShelvesService> { |
| | | @Autowired |
| | | private IGoodsShelvesService goodsShelvesService; |
| | | |
| | | /** |
| | | * å页å表æ¥è¯¢ |
| | | * |
| | | * @param goodsShelves |
| | | * @param pageNo |
| | | * @param pageSize |
| | | * @param req |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "tms_goods_shelves-å页å表æ¥è¯¢") |
| | | @ApiOperation(value="tms_goods_shelves-å页å表æ¥è¯¢", notes="tms_goods_shelves-å页å表æ¥è¯¢") |
| | | @GetMapping(value = "/list") |
| | | public Result<IPage<GoodsShelves>> queryPageList(GoodsShelves goodsShelves, |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | Map<String, String[]> parameterMap = req.getParameterMap(); |
| | | Page<GoodsShelves> page = new Page<GoodsShelves>(pageNo, pageSize); |
| | | IPage<GoodsShelves> pageList = goodsShelvesService.queryPageList(page, parameterMap); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
| | | * |
| | | * @param goodsShelves |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "tms_goods_shelves-æ·»å ") |
| | | @ApiOperation(value="tms_goods_shelves-æ·»å ", notes="tms_goods_shelves-æ·»å ") |
| | | //@RequiresPermissions("org.jeecg.modules:tms_goods_shelves:add") |
| | | @PostMapping(value = "/add") |
| | | public Result<String> add(@RequestBody GoodsShelves goodsShelves) { |
| | | goodsShelvesService.save(goodsShelves); |
| | | return Result.OK("æ·»å æåï¼"); |
| | | } |
| | | |
| | | /** |
| | | * ç¼è¾ |
| | | * |
| | | * @param goodsShelves |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "tms_goods_shelves-ç¼è¾") |
| | | @ApiOperation(value="tms_goods_shelves-ç¼è¾", notes="tms_goods_shelves-ç¼è¾") |
| | | //@RequiresPermissions("org.jeecg.modules:tms_goods_shelves:edit") |
| | | @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) |
| | | public Result<String> edit(@RequestBody GoodsShelves goodsShelves) { |
| | | goodsShelvesService.updateById(goodsShelves); |
| | | return Result.OK("ç¼è¾æå!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idå é¤ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "tms_goods_shelves-éè¿idå é¤") |
| | | @ApiOperation(value="tms_goods_shelves-éè¿idå é¤", notes="tms_goods_shelves-éè¿idå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:tms_goods_shelves:delete") |
| | | @DeleteMapping(value = "/delete") |
| | | public Result<String> delete(@RequestParam(name="id",required=true) String id) { |
| | | goodsShelvesService.removeById(id); |
| | | return Result.OK("å 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * æ¹éå é¤ |
| | | * |
| | | * @param ids |
| | | * @return |
| | | */ |
| | | @AutoLog(value = "tms_goods_shelves-æ¹éå é¤") |
| | | @ApiOperation(value="tms_goods_shelves-æ¹éå é¤", notes="tms_goods_shelves-æ¹éå é¤") |
| | | //@RequiresPermissions("org.jeecg.modules:tms_goods_shelves:deleteBatch") |
| | | @DeleteMapping(value = "/deleteBatch") |
| | | public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) { |
| | | this.goodsShelvesService.removeByIds(Arrays.asList(ids.split(","))); |
| | | return Result.OK("æ¹éå 餿å!"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿idæ¥è¯¢ |
| | | * |
| | | * @param id |
| | | * @return |
| | | */ |
| | | //@AutoLog(value = "tms_goods_shelves-éè¿idæ¥è¯¢") |
| | | @ApiOperation(value="tms_goods_shelves-éè¿idæ¥è¯¢", notes="tms_goods_shelves-éè¿idæ¥è¯¢") |
| | | @GetMapping(value = "/queryById") |
| | | public Result<GoodsShelves> queryById(@RequestParam(name="id",required=true) String id) { |
| | | GoodsShelves goodsShelves = goodsShelvesService.getById(id); |
| | | if(goodsShelves==null) { |
| | | return Result.error("æªæ¾å°å¯¹åºæ°æ®"); |
| | | } |
| | | return Result.OK(goodsShelves); |
| | | } |
| | | |
| | | /** |
| | | * 导åºexcel |
| | | * |
| | | * @param request |
| | | * @param goodsShelves |
| | | */ |
| | | //@RequiresPermissions("org.jeecg.modules:tms_goods_shelves:exportXls") |
| | | @RequestMapping(value = "/exportXls") |
| | | public ModelAndView exportXls(HttpServletRequest request, GoodsShelves goodsShelves) { |
| | | return super.exportXls(request, goodsShelves, GoodsShelves.class, "tms_goods_shelves"); |
| | | } |
| | | |
| | | /** |
| | | * éè¿excel导å
¥æ°æ® |
| | | * |
| | | * @param request |
| | | * @param response |
| | | * @return |
| | | */ |
| | | //@RequiresPermissions("tms_goods_shelves:importExcel") |
| | | @RequestMapping(value = "/importExcel", method = RequestMethod.POST) |
| | | public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) { |
| | | return super.importExcel(request, response, GoodsShelves.class); |
| | | } |
| | | |
| | | } |
| | |
| | | import java.net.URLDecoder; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import org.jeecg.common.api.vo.CommonGenericTree; |
| | | import org.jeecg.common.api.vo.Result; |
| | | import org.jeecg.common.system.query.QueryGenerator; |
| | | import org.jeecg.common.util.oConvertUtils; |
| | |
| | | @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, |
| | | @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, |
| | | HttpServletRequest req) { |
| | | QueryWrapper<Warehouse> queryWrapper = QueryGenerator.initQueryWrapper(warehouse, req.getParameterMap()); |
| | | Map<String, String[]> parameterMap = req.getParameterMap(); |
| | | Page<Warehouse> page = new Page<Warehouse>(pageNo, pageSize); |
| | | IPage<Warehouse> pageList = warehouseService.page(page, queryWrapper); |
| | | IPage<Warehouse> pageList = warehouseService.queryPageList(page, parameterMap); |
| | | return Result.OK(pageList); |
| | | } |
| | | |
| | | @ApiOperation(value="tms_warehouse-å è½½æ å½¢ç»ææ°æ®", notes="tms_warehouse-å è½½æ å½¢ç»ææ°æ®") |
| | | @GetMapping(value = "/loadTree") |
| | | public Result<?> loadTree() { |
| | | List<CommonGenericTree<Warehouse>> treeList = warehouseService.loadTree(); |
| | | return Result.OK(treeList); |
| | | } |
| | | |
| | | /** |
| | | * æ·»å |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.tms.entity; |
| | | |
| | | import java.io.Serializable; |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.EqualsAndHashCode; |
| | | import lombok.experimental.Accessors; |
| | | |
| | | /** |
| | | * @Description: tms_goods_shelves |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-08 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Data |
| | | @TableName("tms_goods_shelves") |
| | | @Accessors(chain = true) |
| | | @EqualsAndHashCode(callSuper = false) |
| | | @ApiModel(value="tms_goods_shelves对象", description="tms_goods_shelves") |
| | | public class GoodsShelves implements Serializable { |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /**主é®*/ |
| | | @TableId(type = IdType.ASSIGN_ID) |
| | | @ApiModelProperty(value = "主é®") |
| | | private String id; |
| | | /**ä»åºç¼å·(å
³èåæ®µï¼åä»åºè¡¨id)*/ |
| | | @Excel(name = "ä»åºç¼å·", width = 15) |
| | | @ApiModelProperty(value = "ä»åºç¼å·") |
| | | private String warehouseId; |
| | | /**ä»åºç¼å·*/ |
| | | @TableField(exist = false) |
| | | private String warehouseNum; |
| | | /**ä»åºåç§°*/ |
| | | @TableField(exist = false) |
| | | private String warehouseName; |
| | | /**åºä½å·*/ |
| | | @Excel(name = "åºä½å·", width = 15) |
| | | @ApiModelProperty(value = "åºä½å·") |
| | | private String locationCode; |
| | | /**屿°*/ |
| | | @Excel(name = "屿°", width = 15) |
| | | @ApiModelProperty(value = "屿°") |
| | | private String storey; |
| | | /**ææ°*/ |
| | | @Excel(name = "ææ°", width = 15) |
| | | @ApiModelProperty(value = "ææ°") |
| | | private String arrange; |
| | | /**åæ°*/ |
| | | @Excel(name = "åæ°", width = 15) |
| | | @ApiModelProperty(value = "åæ°") |
| | | private String columnNumber; |
| | | /**æ ¼æ°(é»è®¤å¼ä¸º1)*/ |
| | | @Excel(name = "æ ¼æ°(é»è®¤å¼ä¸º1)", width = 15) |
| | | @ApiModelProperty(value = "æ ¼æ°(é»è®¤å¼ä¸º1)") |
| | | private String cellsNum; |
| | | /**è´§æ¶ç¼å·*/ |
| | | @Excel(name = "è´§æ¶ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "è´§æ¶ç¼å·") |
| | | private String shelfNumber; |
| | | /**è´§æ¶åç§°*/ |
| | | @Excel(name = "è´§æ¶åç§°", width = 15) |
| | | @ApiModelProperty(value = "è´§æ¶åç§°") |
| | | private String shelfName; |
| | | /**夿³¨*/ |
| | | @Excel(name = "夿³¨", width = 15) |
| | | @ApiModelProperty(value = "夿³¨") |
| | | private String remark; |
| | | /**ç§æ·å·*/ |
| | | @Excel(name = "ç§æ·å·", width = 15) |
| | | @ApiModelProperty(value = "ç§æ·å·") |
| | | private String tenantId; |
| | | /**å建人*/ |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createBy; |
| | | /**å建æ¶é´*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:ss") |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updateBy; |
| | | /**æ´æ°æ¶é´*/ |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:ss") |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updateTime; |
| | | } |
| | |
| | | import java.io.UnsupportedEncodingException; |
| | | import java.util.Date; |
| | | import java.math.BigDecimal; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.baomidou.mybatisplus.annotation.TableLogic; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.*; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | import org.jeecgframework.poi.excel.annotation.Excel; |
| | | import org.jeecg.common.aspect.annotation.Dict; |
| | |
| | | @Excel(name = "ç¶èç¹ç¼å·", width = 15) |
| | | @ApiModelProperty(value = "ç¶èç¹ç¼å·") |
| | | private String parentId; |
| | | /**ç¶èç¹ä»åºç¼å·*/ |
| | | @TableField(exist = false) |
| | | private String parentWarehouseId; |
| | | /**ç¶èç¹ä»åºåç§°*/ |
| | | @TableField(exist = false) |
| | | private String parentWarehouseName; |
| | | /**å±ç¤ºåºå·*/ |
| | | @Excel(name = "å±ç¤ºåºå·", width = 15) |
| | | @ApiModelProperty(value = "å±ç¤ºåºå·") |
| | |
| | | /**å建人*/ |
| | | @Excel(name = "å建人", width = 15) |
| | | @ApiModelProperty(value = "å建人") |
| | | private String createdBy; |
| | | private String createBy; |
| | | /**å建æ¶é´*/ |
| | | @Excel(name = "å建æ¶é´", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @Excel(name = "å建æ¶é´", width = 15, format = "yyyy-MM-dd HH:ss") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:ss") |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | private Date createdTime; |
| | | private Date createTime; |
| | | /**æ´æ°äºº*/ |
| | | @Excel(name = "æ´æ°äºº", width = 15) |
| | | @ApiModelProperty(value = "æ´æ°äºº") |
| | | private String updatedBy; |
| | | private String updateBy; |
| | | /**æ´æ°æ¶é´*/ |
| | | @Excel(name = "æ´æ°æ¶é´", width = 15, format = "yyyy-MM-dd") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd") |
| | | @Excel(name = "æ´æ°æ¶é´", width = 15, format = "yyyy-MM-dd HH:ss") |
| | | @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:ss") |
| | | @DateTimeFormat(pattern="yyyy-MM-dd HH:ss") |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | private Date updatedTime; |
| | | private Date updateTime; |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.tms.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.GoodsShelves; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | |
| | | /** |
| | | * @Description: tms_goods_shelves |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-08 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface GoodsShelvesMapper extends BaseMapper<GoodsShelves> { |
| | | |
| | | IPage<GoodsShelves> queryPageList(Page<GoodsShelves> page, |
| | | @Param(Constants.WRAPPER) Wrapper<GoodsShelves> queryWrapper); |
| | | } |
| | |
| | | |
| | | import java.util.List; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.Wrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Constants; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.jeecg.modules.tms.entity.Warehouse; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | |
| | | */ |
| | | public interface WarehouseMapper extends BaseMapper<Warehouse> { |
| | | |
| | | IPage<Warehouse> queryPageList(Page<Warehouse> page, |
| | | @Param(Constants.WRAPPER) Wrapper<Warehouse> queryWrapper); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.tms.mapper.GoodsShelvesMapper"> |
| | | |
| | | <select id="queryPageList" resultType="org.jeecg.modules.tms.entity.GoodsShelves"> |
| | | SELECT |
| | | t.id, |
| | | t.warehouse_id warehouseId, |
| | | p.warehouse_id warehouseNum, |
| | | p.warehouse_name warehouseName, |
| | | t.location_code locationCode, |
| | | t.storey storey, |
| | | t.arrange arrange, |
| | | t.column_number columnNumber, |
| | | t.cells_num cellsNum, |
| | | t.shelf_number shelfNumber, |
| | | t.shelf_name shelfName, |
| | | t.remark, |
| | | t.create_by createBy, |
| | | t.create_time createTime |
| | | FROM tms_goods_shelves t |
| | | LEFT JOIN tms_warehouse p on t.warehouse_id = p.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
| | |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="org.jeecg.modules.tms.mapper.WarehouseMapper"> |
| | | |
| | | <select id="queryPageList" resultType="org.jeecg.modules.tms.entity.Warehouse"> |
| | | SELECT |
| | | t.id, |
| | | t.warehouse_id warehouseId, |
| | | t.warehouse_name warehouseName, |
| | | t.parent_id parentId, |
| | | p.warehouse_id parentWarehouseId, |
| | | p.warehouse_name parentWarehouseName, |
| | | t.seq, |
| | | t.leaf_flag leafFlag, |
| | | t.status, |
| | | t.remark, |
| | | t.create_by createBy, |
| | | t.create_time createTime, |
| | | t.update_by updateBy, |
| | | t.update_time updateTime |
| | | FROM tms_warehouse t |
| | | LEFT JOIN tms_warehouse p on t.parent_id = p.id |
| | | ${ew.customSqlSegment} |
| | | </select> |
| | | </mapper> |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.tms.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.jeecg.modules.tms.entity.GoodsShelves; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: tms_goods_shelves |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-08 |
| | | * @Version: V1.0 |
| | | */ |
| | | public interface IGoodsShelvesService extends IService<GoodsShelves> { |
| | | |
| | | IPage<GoodsShelves> queryPageList(Page<GoodsShelves> page, Map<String, String[]> parameterMap); |
| | | } |
| | |
| | | package org.jeecg.modules.tms.service; |
| | | |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.jeecg.common.api.vo.CommonGenericTree; |
| | | import org.jeecg.modules.tms.entity.Warehouse; |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: tms_warehouse |
| | |
| | | */ |
| | | public interface IWarehouseService extends IService<Warehouse> { |
| | | |
| | | List<CommonGenericTree<Warehouse>> loadTree(); |
| | | |
| | | IPage<Warehouse> queryPageList(Page<Warehouse> page, Map<String, String[]> parameterMap); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package org.jeecg.modules.tms.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.jeecg.modules.tms.entity.GoodsShelves; |
| | | import org.jeecg.modules.tms.mapper.GoodsShelvesMapper; |
| | | import org.jeecg.modules.tms.service.IGoodsShelvesService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * @Description: tms_goods_shelves |
| | | * @Author: jeecg-boot |
| | | * @Date: 2025-05-08 |
| | | * @Version: V1.0 |
| | | */ |
| | | @Service |
| | | public class GoodsShelvesServiceImpl extends ServiceImpl<GoodsShelvesMapper, GoodsShelves> implements IGoodsShelvesService { |
| | | |
| | | @Override |
| | | public IPage<GoodsShelves> queryPageList(Page<GoodsShelves> page, Map<String, String[]> parameterMap) { |
| | | QueryWrapper<GoodsShelves> queryWrapper = Wrappers.query(); |
| | | String[] warehouseIds = parameterMap.get("warehouseId"); |
| | | if (warehouseIds != null && warehouseIds.length > 0) { |
| | | queryWrapper.eq("t.warehouse_id", warehouseIds[0]); |
| | | } |
| | | String[] warehouseNames = parameterMap.get("warehouseName"); |
| | | if (warehouseNames != null && warehouseNames.length > 0) { |
| | | queryWrapper.like("p.warehouse_name", warehouseNames[0]); |
| | | } |
| | | String[] locationCodes = parameterMap.get("locationCode"); |
| | | if (locationCodes != null && locationCodes.length > 0) { |
| | | queryWrapper.like("t.location_code", locationCodes[0]); |
| | | } |
| | | String[] shelfNumbers = parameterMap.get("shelfNumber"); |
| | | if (shelfNumbers != null && shelfNumbers.length > 0) { |
| | | queryWrapper.like("t.shelf_number", shelfNumbers[0]); |
| | | } |
| | | String[] beginTimes = parameterMap.get("beginTime"); |
| | | String[] endTimes = parameterMap.get("endTime"); |
| | | if (beginTimes != null && beginTimes.length > 0) { |
| | | queryWrapper.ge("t.create_time", beginTimes[0]); |
| | | } |
| | | if (endTimes != null && endTimes.length > 0) { |
| | | queryWrapper.le("t.create_time", endTimes[0]); |
| | | } |
| | | queryWrapper.orderByDesc("t.create_time"); |
| | | return this.baseMapper.queryPageList(page, queryWrapper); |
| | | } |
| | | } |
| | |
| | | package org.jeecg.modules.tms.service.impl; |
| | | |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.jeecg.common.api.vo.CommonGenericTree; |
| | | import org.jeecg.common.constant.CommonConstant; |
| | | import org.jeecg.common.util.StrUtils; |
| | | import org.jeecg.modules.tms.entity.Warehouse; |
| | | import org.jeecg.modules.tms.mapper.WarehouseMapper; |
| | | import org.jeecg.modules.tms.service.IWarehouseService; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
| | | |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @Description: tms_warehouse |
| | |
| | | @Service |
| | | public class WarehouseServiceImpl extends ServiceImpl<WarehouseMapper, Warehouse> implements IWarehouseService { |
| | | |
| | | @Override |
| | | public List<CommonGenericTree<Warehouse>> loadTree() { |
| | | List<Warehouse> warehouseList = list(new LambdaQueryWrapper<Warehouse>() |
| | | .eq(Warehouse::getStatus, CommonConstant.STATUS_1)); |
| | | return loadTree(warehouseList); |
| | | } |
| | | |
| | | @Override |
| | | public IPage<Warehouse> queryPageList(Page<Warehouse> page, Map<String, String[]> parameterMap) { |
| | | QueryWrapper<Warehouse> queryWrapper = Wrappers.query(); |
| | | String[] warehouseNames = parameterMap.get("warehouseName"); |
| | | if (warehouseNames != null && warehouseNames.length > 0) { |
| | | queryWrapper.like("t.warehouse_name", warehouseNames[0]); |
| | | } |
| | | String[] parentIds = parameterMap.get("parentId"); |
| | | if (parentIds != null && parentIds.length > 0) { |
| | | queryWrapper.eq("t.parent_id", parentIds[0]); |
| | | } |
| | | String[] beginTimes = parameterMap.get("beginTime"); |
| | | String[] endTimes = parameterMap.get("endTime"); |
| | | if (beginTimes != null && beginTimes.length > 0) { |
| | | queryWrapper.ge("t.create_time", beginTimes[0]); |
| | | } |
| | | if (endTimes != null && endTimes.length > 0) { |
| | | queryWrapper.le("t.create_time", endTimes[0]); |
| | | } |
| | | queryWrapper.orderByAsc("t.seq"); |
| | | return this.baseMapper.queryPageList(page, queryWrapper); |
| | | } |
| | | |
| | | private List<CommonGenericTree<Warehouse>> loadTree(List<Warehouse> warehouseList) { |
| | | Warehouse warehouse = new Warehouse(); |
| | | List<CommonGenericTree<Warehouse>> list = new ArrayList<>(); |
| | | Map<String, CommonGenericTree<Warehouse>> map = new HashMap<>(); |
| | | CommonGenericTree<Warehouse> node = new CommonGenericTree<>();//æå¨åå»ºæ ¹èç¹ |
| | | node.setKey("-1"); |
| | | node.setTitle("èªå®æç"); |
| | | node.setRField1(""); |
| | | node.setRField2(""); |
| | | node.setEntity(new Warehouse() |
| | | .setId("-1") |
| | | .setWarehouseId("-1") |
| | | .setWarehouseName("èªå®æç") |
| | | .setLeafFlag("2")); |
| | | list.add(node); |
| | | if (CollectionUtils.isNotEmpty(warehouseList)) { |
| | | CommonGenericTree<Warehouse> tcNode; |
| | | for (Warehouse wh : warehouseList) { |
| | | if (StrUtils.isBlankOrNull(wh.getParentId()) || wh.getParentId().equals("-1")) { |
| | | tcNode = new CommonGenericTree<>(); |
| | | tcNode.setKey(wh.getId()); |
| | | tcNode.setTitle(wh.getWarehouseId() + "/" + wh.getWarehouseName()); |
| | | tcNode.setParentId(node.getKey()); |
| | | tcNode.setIcon(""); |
| | | tcNode.setType(1); |
| | | tcNode.setValue(wh.getWarehouseName()); |
| | | //tcNode.setDisabled(CommonConstant.STATUS_0.equals(wh.getStatus()) ? true : false); |
| | | tcNode.setRField1(wh.getWarehouseId()); |
| | | tcNode.setRField2(getBaseParent(wh.getId(), 0).getWarehouseId()); |
| | | tcNode.setEntity(wh); |
| | | node.addChildren(tcNode); |
| | | map.put(wh.getId(), tcNode); |
| | | } |
| | | } |
| | | CommonGenericTree<Warehouse> childNode; |
| | | for (Warehouse wh : warehouseList) { |
| | | Warehouse child = wh; |
| | | if (map.containsKey(child.getParentId())) { |
| | | if (StrUtils.isBlankOrNull(wh.getParentId()) || wh.getParentId().equals("-1")) { |
| | | warehouse = wh; |
| | | } else { |
| | | tcNode = map.get(child.getParentId()); |
| | | childNode = new CommonGenericTree<>(); |
| | | childNode.setKey(wh.getId()); |
| | | childNode.setTitle(wh.getWarehouseId() + "/" + wh.getWarehouseName()); |
| | | childNode.setParentId(wh.getParentId()); |
| | | childNode.setIcon(""); |
| | | childNode.setType(0); |
| | | childNode.setValue(wh.getWarehouseName()); |
| | | //childNode.setDisabled(CommonConstant.STATUS_0.equals(wh.getStatus()) ? true : false); |
| | | childNode.setRField1(wh.getWarehouseId()); |
| | | childNode.setRField2(getBaseParent(wh.getId(), 0).getWarehouseId()); |
| | | childNode.setEntity(wh); |
| | | tcNode.addChildren(childNode); |
| | | map.put(child.getId(), childNode); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | return list; |
| | | } |
| | | |
| | | public Warehouse getBaseParent(String id, int index) { |
| | | Warehouse warehouse = null; |
| | | if (index < 99) { |
| | | warehouse = getById(id); |
| | | if (StrUtils.isNotBlankOrNull(warehouse.getParentId())) { |
| | | if (!warehouse.getParentId().equals("-1")) { |
| | | warehouse = getBaseParent(warehouse.getParentId(), index++); |
| | | } |
| | | } |
| | | } |
| | | return warehouse; |
| | | } |
| | | } |