Browse Source

20250417

master
qiezi 10 months ago
parent
commit
6ed09b8f5c
  1. 16
      src/main/java/com/heai/modules/board/controller/InventoryController.java
  2. 3
      src/main/java/com/heai/modules/board/service/BoardService.java
  3. 7
      src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java
  4. 5
      src/main/java/com/heai/modules/taskmanage/dao/TaskDetailDao.java
  5. 72
      src/main/resources/mapper/taskmanage/TaskDatailDao.xml

16
src/main/java/com/heai/modules/board/controller/InventoryController.java

@ -1,14 +1,12 @@
package com.heai.modules.board.controller; package com.heai.modules.board.controller;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heai.common.utils.R; import com.heai.common.utils.R;
import com.heai.modules.board.entity.Inventory; import com.heai.modules.board.entity.Inventory;
import com.heai.modules.board.service.BoardService; import com.heai.modules.board.service.BoardService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.bind.annotation.*;
import java.util.List; import java.util.List;
@ -19,9 +17,11 @@ public class InventoryController {
@Autowired @Autowired
private BoardService boardService; private BoardService boardService;
@PostMapping
private R inventory(@RequestBody Inventory inventory) {
List<Inventory> list = boardService.queryPartInventory(inventory);
return R.ok().put("rows",list);
@PostMapping("/{no}/{size}")
private R inventory(@RequestBody Inventory inventory,
@PathVariable Integer no,
@PathVariable Integer size) {
IPage<Inventory> page = boardService.queryPartInventory(no,size,inventory);
return R.ok().put("rows",page.getRecords()).put("total",page.getTotal());
} }
} }

3
src/main/java/com/heai/modules/board/service/BoardService.java

@ -1,6 +1,7 @@
package com.heai.modules.board.service; package com.heai.modules.board.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.heai.modules.board.entity.BIBoardAddressData; import com.heai.modules.board.entity.BIBoardAddressData;
import com.heai.modules.board.entity.Inventory; import com.heai.modules.board.entity.Inventory;
import com.heai.modules.board.entity.ViewKanbanCODelNotifyData; import com.heai.modules.board.entity.ViewKanbanCODelNotifyData;
@ -271,5 +272,5 @@ public interface BoardService {
boolean isPackingWorkCenter(String site,String workCenterNo); boolean isPackingWorkCenter(String site,String workCenterNo);
List<Inventory> queryPartInventory(Inventory inventory);
IPage<Inventory> queryPartInventory(int no,int size,Inventory inventory);
} }

7
src/main/java/com/heai/modules/board/service/impl/BoardServiceImpl.java

@ -2,6 +2,8 @@ package com.heai.modules.board.service.impl;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heai.common.utils.DateUtil; import com.heai.common.utils.DateUtil;
import com.heai.common.utils.WeekUtil; import com.heai.common.utils.WeekUtil;
import com.heai.modules.app.annotation.LoginUser; import com.heai.modules.app.annotation.LoginUser;
@ -794,7 +796,7 @@ public class BoardServiceImpl implements BoardService {
} }
@Override @Override
public List<Inventory> queryPartInventory(Inventory inventory) {
public IPage<Inventory> queryPartInventory(int no, int size, Inventory inventory) {
SysUserEntity loginUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); SysUserEntity loginUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal();
if (Objects.nonNull(loginUser)){ if (Objects.nonNull(loginUser)){
inventory.setLoginUser(loginUser.getUsername()); inventory.setLoginUser(loginUser.getUsername());
@ -809,6 +811,7 @@ public class BoardServiceImpl implements BoardService {
inventory.getEndExpiredDate().setMinutes(59); inventory.getEndExpiredDate().setMinutes(59);
inventory.getEndExpiredDate().setSeconds(59); inventory.getEndExpiredDate().setSeconds(59);
} }
return baseMapper.queryPartInventory(inventory);
Page<Inventory> page = new Page<>(no, size);
return baseMapper.queryPartInventory(page,inventory);
} }
} }

5
src/main/java/com/heai/modules/taskmanage/dao/TaskDetailDao.java

@ -2,11 +2,14 @@ package com.heai.modules.taskmanage.dao;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heai.modules.board.entity.Inventory; import com.heai.modules.board.entity.Inventory;
import com.heai.modules.taskmanage.entity.TaskDetailEntity; import com.heai.modules.taskmanage.entity.TaskDetailEntity;
import com.heai.modules.taskmanage.vo.TaskDetailVo; import com.heai.modules.taskmanage.vo.TaskDetailVo;
import com.heai.modules.taskmanage.vo.TaskListVo; import com.heai.modules.taskmanage.vo.TaskListVo;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@ -48,5 +51,5 @@ public interface TaskDetailDao extends BaseMapper<TaskDetailEntity> {
*/ */
List<TaskDetailVo> taskDetailReportList(TaskListVo params); List<TaskDetailVo> taskDetailReportList(TaskListVo params);
List<Inventory> queryPartInventory(Inventory inventory);
IPage<Inventory> queryPartInventory(@Param("page") Page<Inventory> page,@Param("params") Inventory inventory);
} }

72
src/main/resources/mapper/taskmanage/TaskDatailDao.xml

@ -220,14 +220,14 @@
T.PartNo, T.PartNo,
P.PartDescription, P.PartDescription,
P.Spec, P.Spec,
<if test="summaryType != null and summaryType >= 1">
<if test="params.summaryType != null and params.summaryType >= 1">
T.WarehouseID, T.WarehouseID,
</if> </if>
P.UMID, P.UMID,
<if test="summaryType != null and summaryType >= 2">
<if test="params.summaryType != null and params.summaryType >= 2">
T.LocationID, T.LocationID,
</if> </if>
<if test="summaryType != null and summaryType >= 3">
<if test="params.summaryType != null and params.summaryType >= 3">
T.BatchNo, T.BatchNo,
</if> </if>
min(T.FirstInDate) as FirstInDate, min(T.FirstInDate) as FirstInDate,
@ -256,64 +256,64 @@
Part as P Part as P
where T.Site = P.Site where T.Site = P.Site
and T.PartNo = P.PartNo and T.PartNo = P.PartNo
<if test="loginUser != null and loginUser != ''">
and T.Site in (Select Site from AccessSite where upper(UserID) = #{loginUser})
<if test="params.loginUser != null and params.loginUser != ''">
and T.Site in (Select Site from AccessSite where upper(UserID) = #{params.loginUser})
</if> </if>
<if test="partNo != null and partNo != ''">
and T.PartNo like #{partNo}
<if test="params.partNo != null and params.partNo != ''">
and T.PartNo like #{params.partNo}
</if> </if>
<if test="partDescription != null and partDescription != ''">
and P.PartDescription like #{partDescription}
<if test="params.partDescription != null and params.partDescription != ''">
and P.PartDescription like #{params.partDescription}
</if> </if>
<if test="spec != null and spec != ''">
and P.Spec like #{spec}
<if test="params.spec != null and params.spec != ''">
and P.Spec like #{params.spec}
</if> </if>
<if test="site != null and site != ''">
and T.Site = #{site}
<if test="params.site != null and params.site != ''">
and T.Site = #{params.site}
</if> </if>
<if test="partType != null and partType != ''">
and P.PartType like #{partType}
<if test="params.partType != null and params.partType != ''">
and P.PartType like #{params.partType}
</if> </if>
<if test="warehouseId != null and warehouseId != ''">
and T.WarehouseID = #{warehouseId}
<if test="params.warehouseId != null and params.warehouseId != ''">
and T.WarehouseID = #{params.warehouseId}
</if> </if>
<if test="locationId != null and locationId != '' and summaryType != null and summaryType >= 2">
and T.LocationID = #{locationId}
<if test="params.locationId != null and params.locationId != '' and params.summaryType != null and params.summaryType >= 2">
and T.LocationID = #{params.locationId}
</if> </if>
<if test="batchNo != null and batchNo != '' and summaryType != null and summaryType >= 3">
and T.BatchNo = #{batchNo}
<if test="params.batchNo != null and params.batchNo != '' and params.summaryType != null and params.summaryType >= 3">
and T.BatchNo = #{params.batchNo}
</if> </if>
<if test="familyId != null and familyId != ''">
and P.FamilyID like #{familyId}
<if test="params.familyId != null and params.familyId != ''">
and P.FamilyID like #{params.familyId}
</if> </if>
<if test="familyName != null and familyName != ''">
and dbo.Get_PartFamilyDesc(P.Site, P.FamilyID) like #{familyName}
<if test="params.familyName != null and params.familyName != ''">
and dbo.Get_PartFamilyDesc(P.Site, P.FamilyID) like #{params.familyName}
</if> </if>
<if test="startFirstInDate != null">
and T.FirstInDate >= #{startFirstInDate}
<if test="params.startFirstInDate != null">
and T.FirstInDate >= #{params.startFirstInDate}
</if> </if>
<if test="endFirstInDate != null">
and #{endFirstInDate} >= T.FirstInDate
<if test="params.endFirstInDate != null">
and #{params.endFirstInDate} >= T.FirstInDate
</if> </if>
<if test="startExpiredDate != null">
and T.ExpiredDate >= #{startExpiredDate}
<if test="params.startExpiredDate != null">
and T.ExpiredDate >= #{params.startExpiredDate}
</if> </if>
<if test="endExpiredDate != null">
and #{endExpiredDate} >= T.ExpiredDate
<if test="params.endExpiredDate != null">
and #{params.endExpiredDate} >= T.ExpiredDate
</if> </if>
group by group by
T.Site, T.Site,
T.PartNo, T.PartNo,
P.PartDescription, P.PartDescription,
P.Spec, P.Spec,
<if test="summaryType != null and summaryType >= 1">
<if test="params.summaryType != null and params.summaryType >= 1">
T.WarehouseID, T.WarehouseID,
</if> </if>
P.UMID, P.UMID,
<if test="summaryType != null and summaryType >= 2">
<if test="params.summaryType != null and params.summaryType >= 2">
T.LocationID, T.LocationID,
</if> </if>
<if test="summaryType != null and summaryType >= 3">
<if test="params.summaryType != null and params.summaryType >= 3">
T.BatchNo, T.BatchNo,
</if> </if>
P.Site, P.Site,

Loading…
Cancel
Save