guoyujia 1 year ago
parent
commit
1b42892cc4

+ 2 - 0
src/main/java/cn/ezhizao/project/business/controller/BizDayworkController.java

@@ -64,6 +64,8 @@ public class BizDayworkController extends BaseController {
      */
      */
     @PostMapping("/listItem")
     @PostMapping("/listItem")
     public TableDataInfo listItem(@RequestBody BizDayworkItem bizDayworkItem) throws NoSuchFieldException, IllegalAccessException {
     public TableDataInfo listItem(@RequestBody BizDayworkItem bizDayworkItem) throws NoSuchFieldException, IllegalAccessException {
+        final String tenantId = request.getHeader("tenantId");
+        bizDayworkItem.setTenantId(Long.valueOf(tenantId));
         startPage();
         startPage();
         //查询批次报工信息列表
         //查询批次报工信息列表
         List<BizDayworkItem> itemList = bizDayworkService.getItemList(bizDayworkItem);
         List<BizDayworkItem> itemList = bizDayworkService.getItemList(bizDayworkItem);

+ 2 - 1
src/main/java/cn/ezhizao/project/business/controller/BizProductionPlanDetailSubDetailController.java

@@ -71,8 +71,9 @@ public class BizProductionPlanDetailSubDetailController extends BaseController {
     @GetMapping("/getDept")
     @GetMapping("/getDept")
     public AjaxResult getDept() throws NoSuchFieldException, IllegalAccessException {
     public AjaxResult getDept() throws NoSuchFieldException, IllegalAccessException {
         // Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
         // Long userId = SecurityUtils.getLoginUser().getUser().getUserId();
+        final String tenantId = request.getHeader("tenantId");
         Long userId = 265L;
         Long userId = 265L;
-        List<SysDeptUser> deptUserList = deptUserService.query().eq("user_id", userId).list();
+        List<SysDeptUser> deptUserList = deptUserService.query().eq("user_id", userId).eq("tenant_id",tenantId).list();
         List<Long> ids = new ArrayList<>();
         List<Long> ids = new ArrayList<>();
         for (SysDeptUser item : deptUserList
         for (SysDeptUser item : deptUserList
         ) {
         ) {

+ 2 - 1
src/main/java/cn/ezhizao/project/business/controller/BizResourceAllocationController.java

@@ -106,7 +106,8 @@ public class BizResourceAllocationController extends BaseController
     @PutMapping
     @PutMapping
     public AjaxResult edit(@RequestBody BizResourceAllocation bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException
     public AjaxResult edit(@RequestBody BizResourceAllocation bizResourceAllocation) throws NoSuchFieldException, IllegalAccessException
     {
     {
-        setTenantId(bizResourceAllocation);
+        final String tenantId = request.getHeader("tenantId");
+        bizResourceAllocation.setTenantId(Long.valueOf(tenantId));
         return toAjax(bizResourceAllocationService.updateById(bizResourceAllocation));
         return toAjax(bizResourceAllocationService.updateById(bizResourceAllocation));
     }
     }
 
 

+ 5 - 1
src/main/java/cn/ezhizao/project/business/controller/ProductionTaskController.java

@@ -6,6 +6,7 @@ import cn.ezhizao.framework.web.controller.BaseController;
 
 
 import java.util.*;
 import java.util.*;
 import javax.annotation.Resource;
 import javax.annotation.Resource;
+import javax.servlet.http.HttpServletRequest;
 
 
 import cn.ezhizao.project.business.service.IBizProductionPlanDetailSubDetailEquipmentService;
 import cn.ezhizao.project.business.service.IBizProductionPlanDetailSubDetailEquipmentService;
 import cn.ezhizao.project.business.service.IBizProductionPlanDetailSubDetailService;
 import cn.ezhizao.project.business.service.IBizProductionPlanDetailSubDetailService;
@@ -34,13 +35,16 @@ public class ProductionTaskController extends BaseController {
 
 
     @Resource
     @Resource
     private IBizProductionPlanDetailSubDetailEquipmentService productionPlanDetailSubDetailEquipmentService;
     private IBizProductionPlanDetailSubDetailEquipmentService productionPlanDetailSubDetailEquipmentService;
+    @Resource
+    HttpServletRequest request;
 
 
     /**
     /**
      * 获取工段长添加的投产信息,数据表是 biz_production_plan_detail_sub_detail
      * 获取工段长添加的投产信息,数据表是 biz_production_plan_detail_sub_detail
      */
      */
     @GetMapping(value = "/getSubDetails")
     @GetMapping(value = "/getSubDetails")
     private TableDataInfo getSubDetails(BizProductionPlanDetailSubDetail data) {
     private TableDataInfo getSubDetails(BizProductionPlanDetailSubDetail data) {
-
+        final String tenantId = request.getHeader("tenantId");
+        data.setTenantId(Long.valueOf(tenantId));
         // 获取工段长添加的投产数据【biz_production_plan_detail_sub_detail】,并分页显示
         // 获取工段长添加的投产数据【biz_production_plan_detail_sub_detail】,并分页显示
         // 根据【产品描述】,获取投产数据【biz_production_plan_detail_sub_detail】列表,并分页显示
         // 根据【产品描述】,获取投产数据【biz_production_plan_detail_sub_detail】列表,并分页显示
         startPage();
         startPage();

+ 1 - 0
src/main/resources/mybatis/business/BizDayworkMapper.xml

@@ -63,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             t1.deleted = 0
             t1.deleted = 0
             <if test="dayworkId != null and dayworkId != 0"> AND t1.daywork_id = #{dayworkId}</if>
             <if test="dayworkId != null and dayworkId != 0"> AND t1.daywork_id = #{dayworkId}</if>
+            <if test="tenantId != null  and tenantId != 0"> AND t1.tenant_id = #{tenantId}</if>
         </trim>
         </trim>
         ORDER BY t1.create_time DESC
         ORDER BY t1.create_time DESC
     </select>
     </select>

+ 1 - 1
src/main/resources/mybatis/business/BizProductionPlanDetailSubDetailMapper.xml

@@ -41,7 +41,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             t1.deleted = 0
             t1.deleted = 0
             <if test="keywords != null and keywords != ''"> AND t2.description LIKE CONCAT('%', #{keywords}, '%')</if>
             <if test="keywords != null and keywords != ''"> AND t2.description LIKE CONCAT('%', #{keywords}, '%')</if>
             <if test="deptId !=null and deptId !=''"> AND t1.dept_id = #{deptId}</if>
             <if test="deptId !=null and deptId !=''"> AND t1.dept_id = #{deptId}</if>
-
+            <if test="tenantId != null  and tenantId != 0"> AND t1.tenant_id = #{tenantId}</if>
         </trim>
         </trim>
         ORDER BY t1.create_time DESC
         ORDER BY t1.create_time DESC
     </select>
     </select>

+ 1 - 0
src/main/resources/mybatis/business/BizResourceAllocationMapper.xml

@@ -16,6 +16,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
         <trim prefix=" WHERE" suffix="" suffixOverrides="AND">
             l.deleted = 0
             l.deleted = 0
             <if test="deptUserId != null "> AND l.dept_user_id = #{deptUserId}</if>
             <if test="deptUserId != null "> AND l.dept_user_id = #{deptUserId}</if>
+            <if test="tenantId != null  and tenantId != 0"> AND l.tenant_id = #{tenantId}</if>
         </trim>
         </trim>
     </select>
     </select>