From da537f966a079b5562955147ed58599c4494abb5 Mon Sep 17 00:00:00 2001 From: hongchao <3228015117@qq.com> Date: Fri, 9 Jan 2026 09:57:24 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8F=E6=BA=90=E6=9D=83=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../bonus/common/biz/domain/BmStorageLog.java | 2 ++ .../controller/BmStorageLogController.java | 6 ++++ .../controller/BmUnitPersonController.java | 3 ++ .../controller/BmUnitTypeController.java | 6 ++++ .../material/basic/domain/BmProject.java | 2 ++ .../bonus/material/basic/domain/BmUnit.java | 2 ++ .../material/basic/domain/BmUnitType.java | 2 ++ .../common/controller/SelectController.java | 16 +++++++++ .../material/common/domain/dto/SelectDto.java | 2 ++ .../service/impl/SelectServiceImpl.java | 30 ++++++++++------- .../ma/controller/MachineController.java | 19 ++++++++++- .../ma/controller/SupplierInfoController.java | 10 ++++++ .../ma/controller/TypeController.java | 9 ++++- .../material/ma/domain/MachineSynch.java | 2 ++ .../bonus/material/ma/mapper/TypeMapper.java | 2 +- .../material/ma/service/ITypeService.java | 4 +-- .../ma/service/impl/TypeServiceImpl.java | 11 ++++--- .../controller/ScrapReasonController.java | 12 +++++++ .../material/scrap/domain/ScrapReason.java | 2 ++ .../SltAgreementInfoController.java | 12 +++++-- .../warehouse/mapper/WhHouseSetMapper.java | 3 +- .../warehouse/service/IWhHouseSetService.java | 2 +- .../service/impl/WhHouseSetServiceImpl.java | 4 +-- .../material/basic/BmStorageLogMapper.xml | 6 ++-- .../material/basic/BmUnitUnitMapper.xml | 3 ++ .../mapper/material/common/SelectMapper.xml | 33 +++++++++++++++++-- .../mapper/material/ma/MachineMapper.xml | 16 +++++++-- .../mapper/material/ma/TypeMapper.xml | 13 +++++--- .../material/scrap/ScrapReasonMapper.xml | 9 +++++ .../settlement/SltAgreementInfoMapper.xml | 8 ++++- .../material/warehouse/WhHouseSetMapper.xml | 1 + 31 files changed, 212 insertions(+), 40 deletions(-) diff --git a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/BmStorageLog.java b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/BmStorageLog.java index 657ac432..5779309f 100644 --- a/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/BmStorageLog.java +++ b/bonus-common-biz/src/main/java/com/bonus/common/biz/domain/BmStorageLog.java @@ -139,6 +139,8 @@ public class BmStorageLog extends BaseEntity @ApiModelProperty(value = "操作人") private String creator; + private Long companyId; + // Getters and Setters public BigDecimal getPreStoreNum() { return preStoreNum == null ? BigDecimal.ZERO : preStoreNum; diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmStorageLogController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmStorageLogController.java index 25f4c4e7..7f7f7648 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmStorageLogController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmStorageLogController.java @@ -5,6 +5,7 @@ import javax.servlet.http.HttpServletResponse; import com.bonus.common.log.enums.OperaType; import com.bonus.common.security.annotation.InnerAuth; import com.bonus.material.common.annotation.PreventRepeatSubmit; +import com.bonus.material.ma.service.ITypeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -38,6 +39,9 @@ public class BmStorageLogController extends BaseController @Autowired private IBmStorageLogService bmStorageLogService; + @Autowired + private ITypeService typeService; + /** * 查询库存日志列表 */ @@ -46,6 +50,8 @@ public class BmStorageLogController extends BaseController @GetMapping("/list") public TableDataInfo list(BmStorageLog bmStorageLog) { + Long deptId = typeService.getUserDeptId(); + bmStorageLog.setCompanyId(deptId); startPage(); List list = bmStorageLogService.selectBmStorageLogList(bmStorageLog); return getDataTable(list); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmUnitPersonController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmUnitPersonController.java index 909e19ef..81dedf55 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmUnitPersonController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmUnitPersonController.java @@ -5,6 +5,7 @@ import com.bonus.common.core.web.page.TableDataInfo; import com.bonus.common.log.enums.OperaType; import com.bonus.material.basic.domain.BmUnit; import com.bonus.material.common.annotation.PreventRepeatSubmit; +import com.bonus.material.ma.service.ITypeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.factory.annotation.Autowired; @@ -16,6 +17,7 @@ import com.bonus.material.basic.service.IBmUnitPersonService; import com.bonus.common.core.web.controller.BaseController; import com.bonus.common.core.web.domain.AjaxResult; +import javax.annotation.Resource; import java.util.List; /** @@ -32,6 +34,7 @@ public class BmUnitPersonController extends BaseController @Autowired private IBmUnitPersonService bmUnitPersonService; + /** * 查询往来单位绑定管理列表 */ diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmUnitTypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmUnitTypeController.java index 3030a2d4..487acc9b 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmUnitTypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/controller/BmUnitTypeController.java @@ -14,6 +14,7 @@ import com.bonus.material.basic.domain.BmUnit; import com.bonus.material.basic.domain.BmUnitType; import com.bonus.material.basic.service.IBmUnitTypeService; import com.bonus.material.common.annotation.PreventRepeatSubmit; +import com.bonus.material.ma.service.ITypeService; import com.bonus.system.api.domain.SysDictData; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -41,6 +42,9 @@ public class BmUnitTypeController extends BaseController @Autowired private IBmUnitTypeService bmUnitTypeService; + @Autowired + private ITypeService typeService; + @RequiresPermissionsOrInnerAuth(innerAuth = @InnerAuth, requiresPermissions = @RequiresPermissions("system:dict:list")) @GetMapping("/list") @SysLog(title = "字典管理", businessType = OperaType.QUERY,logType = 0,module = "系统管理->字典管理") @@ -66,6 +70,8 @@ public class BmUnitTypeController extends BaseController @PostMapping("/export") public void export(HttpServletResponse response, BmUnitType bmUnitType) { + Long deptId = typeService.getUserDeptId(); + bmUnitType.setCompanyId(deptId); List list = bmUnitTypeService.selectBmUnitTypeDataList(bmUnitType); ExcelUtil util = new ExcelUtil(BmUnitType.class); util.exportExcel(response, list, "单位类型管理数据"); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmProject.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmProject.java index ad94b291..9bcbb778 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmProject.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmProject.java @@ -194,4 +194,6 @@ public class BmProject extends BaseEntity @Excel(name = "是否结算",readConverterExp = "0=未结算,1=已结算") @ApiModelProperty(value = "是否结算工程") private Integer isSlt; + + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnit.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnit.java index d1bc627a..f61aeeef 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnit.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnit.java @@ -113,4 +113,6 @@ public class BmUnit extends BaseEntity @ApiModelProperty(value = "工程名称") private String projectName; + + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnitType.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnitType.java index 776b787b..093d34d6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnitType.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/basic/domain/BmUnitType.java @@ -63,4 +63,6 @@ public class BmUnitType @Excel(name = "创建时间") private String createTime; + + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java index 2f635dd7..b5fd64c6 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/controller/SelectController.java @@ -9,6 +9,7 @@ import com.bonus.material.basic.mapper.BmUnitMapper; import com.bonus.material.clz.domain.vo.MaterialRetainedEquipmentInfo; import com.bonus.material.common.domain.dto.SelectDto; import com.bonus.material.common.service.SelectService; +import com.bonus.material.ma.service.ITypeService; import com.bonus.material.materialStation.domain.ProAuthorizeInfo; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; @@ -31,6 +32,11 @@ public class SelectController { @Resource(name = "SelectService") private SelectService service; + @Resource + private ITypeService typeService; + + + /** * 获取分公司下拉选 * @param bean @@ -83,6 +89,8 @@ public class SelectController { @ApiOperation(value = "往来单位下拉选,过滤掉班组类型") @PostMapping("getUnitListFilterTeam") public AjaxResult getUnitListFilterTeam(@RequestBody BmUnit bmUnit) { + Long deptId = typeService.getUserDeptId(); + bmUnit.setCompanyId(deptId); bmUnit.setEnableFilterTeam(true); return service.getUnitList(bmUnit); } @@ -222,12 +230,16 @@ public class SelectController { @ApiOperation(value = "设备类型树") @PostMapping("getDeviceTypeTree") public AjaxResult getDeviceTypeTree(@RequestBody SelectDto dto){ + Long deptId = typeService.getUserDeptId(); + dto.setCompanyId(deptId); return service.getDeviceTypeTree(dto); } @ApiOperation(value = "设备类型树") @PostMapping("getDeviceTypeTreeTwo") public AjaxResult getDeviceTypeTreeTwo(@RequestBody SelectDto dto){ + Long deptId = typeService.getUserDeptId(); + dto.setCompanyId(deptId); return service.getDeviceTypeTreeTwo(dto); } @@ -341,6 +353,8 @@ public class SelectController { @PostMapping("getLintTypeList") public AjaxResult getLintTypeList(@RequestBody BmProject bmProject) { try { + Long deptId = typeService.getUserDeptId(); + bmProject.setCompanyId(deptId); return service.getLintTypeList(bmProject); } catch (Exception e) { log.error("获取施工类型信息异常", e); @@ -352,6 +366,8 @@ public class SelectController { @PostMapping("getMaterialTypeList") public AjaxResult getMaterialTypeList(@RequestBody BmProject bmProject) { try { + Long deptId = typeService.getUserDeptId(); + bmProject.setCompanyId(deptId); return service.getMaterialTypeList(bmProject); } catch (Exception e) { log.error("获取物资类型信息异常", e); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java index e18955c5..9dddea2d 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/domain/dto/SelectDto.java @@ -49,4 +49,6 @@ public class SelectDto { private Long proId; private Long userId; + + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java index bc202328..509f01e0 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/common/service/impl/SelectServiceImpl.java @@ -18,6 +18,7 @@ import com.bonus.material.common.domain.vo.SelectVo; import com.bonus.material.common.mapper.SelectMapper; import com.bonus.material.common.service.SelectService; import com.bonus.material.ma.domain.Type; +import com.bonus.material.ma.service.ITypeService; import com.bonus.material.materialStation.domain.ProAuthorizeInfo; import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.CollectionUtils; @@ -38,6 +39,9 @@ public class SelectServiceImpl implements SelectService { @Resource(name = "SelectMapper") private SelectMapper mapper; + + @Resource + private ITypeService typeService; /** * 单位下拉类型树 * @param bmUnit @@ -65,9 +69,9 @@ public class SelectServiceImpl implements SelectService { // 步骤2: 判断是否开启过滤 long step2Start = System.currentTimeMillis(); - if (Objects.nonNull(bmUnit) && Objects.nonNull(bmUnit.getEnableFilter()) && bmUnit.getEnableFilter()) { - bmUnit.setDeptId(thisLoginUserDeptId); - } +// if (Objects.nonNull(bmUnit) && Objects.nonNull(bmUnit.getEnableFilter()) && bmUnit.getEnableFilter()) { +// bmUnit.setDeptId(thisLoginUserDeptId); +// } if (CollectionUtils.isNotEmpty(userRoles)) { // 技术员只查询项目部类型的单位,固定传值36(项目部类型) if (userRoles.contains("jsy")) { @@ -156,15 +160,17 @@ public class SelectServiceImpl implements SelectService { return AjaxResult.success(bmProjects); } - // 获取登陆用户的组织ID - Long thisLoginUserDeptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); - if (null == thisLoginUserDeptId || 0 == thisLoginUserDeptId) { - return AjaxResult.success(Collections.emptyList()); - } - // 判断是否开启过滤 - if (Objects.nonNull(bmProject) && Objects.nonNull(bmProject.getEnableFilter()) && bmProject.getEnableFilter()) { - bmProject.setDeptId(thisLoginUserDeptId); - } + Long deptId = typeService.getUserDeptId(); + bmProject.setDeptId(deptId); +// // 获取登陆用户的组织ID +// Long thisLoginUserDeptId = SecurityUtils.getLoginUser().getSysUser().getDeptId(); +// if (null == thisLoginUserDeptId || 0 == thisLoginUserDeptId) { +// return AjaxResult.success(Collections.emptyList()); +// } +// // 判断是否开启过滤 +// if (Objects.nonNull(bmProject) && Objects.nonNull(bmProject.getEnableFilter()) && bmProject.getEnableFilter()) { +// bmProject.setDeptId(thisLoginUserDeptId); +// } List groupList = new ArrayList<>(); List list = new ArrayList<>(); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MachineController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MachineController.java index ed936e9a..02d273f5 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MachineController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/MachineController.java @@ -14,6 +14,8 @@ import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.domain.vo.MachineExportVo; import com.bonus.material.ma.domain.vo.MachineVo; import com.bonus.material.ma.domain.vo.SampleSync; +import com.bonus.material.ma.service.ITypeKeeperService; +import com.bonus.material.ma.service.ITypeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.beans.BeanUtils; @@ -47,6 +49,11 @@ public class MachineController extends BaseController { @Autowired private IMachineService machineService; + @Autowired + private ITypeService typeService; + + + /** * 查询机具设备管理列表 */ @@ -54,6 +61,8 @@ public class MachineController extends BaseController { //@RequiresPermissions("ma:machine:list") @GetMapping("/list") public TableDataInfo list(Machine machine) { + Long deptId = typeService.getUserDeptId(); + machine.setCompanyId(String.valueOf(deptId)); if (machine.getPrefix() == null) { startPage(); } @@ -78,6 +87,8 @@ public class MachineController extends BaseController { //@RequiresPermissions("ma:machine:typeList") @GetMapping("/getTypeList") public AjaxResult list(Type type) { + Long deptId = typeService.getUserDeptId(); + type.setCompanyId(deptId); return machineService.selectByTypeList(type); } @@ -90,6 +101,8 @@ public class MachineController extends BaseController { @SysLog(title = "机具设备管理", businessType = OperaType.EXPORT, logType = 1, module = "仓储管理->导出机具设备管理") @PostMapping("/export") public void export(HttpServletResponse response, Machine machine) { + Long deptId = typeService.getUserDeptId(); + machine.setCompanyId(String.valueOf(deptId)); List list = machineService.selectMachineList(machine); List exportVos = list.stream() .map(machineVo -> { @@ -319,6 +332,8 @@ public class MachineController extends BaseController { @PreventRepeatSubmit @PostMapping("/synchReport") public AjaxResult synchReport(@RequestBody Machine machine) { + Long deptId = typeService.getUserDeptId(); + machine.setCompanyId(String.valueOf(deptId)); return machineService.synchReport(machine); } @@ -330,7 +345,9 @@ public class MachineController extends BaseController { //@RequiresPermissions("ma:machine:list") @GetMapping("/getSynchList") public TableDataInfo getSynchList(MachineSynch machine) { - startPage(); + Long deptId = typeService.getUserDeptId(); + machine.setCompanyId(deptId); + startPage(); List list = machineService.selectSynchList(machine); return getDataTable(list); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java index 63ad7e39..8d4c64c4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/SupplierInfoController.java @@ -5,6 +5,7 @@ import javax.annotation.Resource; import javax.servlet.http.HttpServletResponse; import com.bonus.common.log.enums.OperaType; import com.bonus.material.common.annotation.PreventRepeatSubmit; +import com.bonus.material.ma.service.ITypeService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.springframework.web.bind.annotation.GetMapping; @@ -36,6 +37,9 @@ public class SupplierInfoController extends BaseController { @Resource private ISupplierInfoService supplierInfoService; + @Resource + private ITypeService typeService; + /** * 查询物资厂家管理列表 */ @@ -43,6 +47,8 @@ public class SupplierInfoController extends BaseController { //@RequiresPermissions("ma:info:list") @GetMapping("/list") public TableDataInfo list(SupplierInfo supplierInfo) { + Long deptId = typeService.getUserDeptId(); + supplierInfo.setCompanyId(String.valueOf(deptId)); startPage(); List list = supplierInfoService.selectSupplierInfoList(supplierInfo); return getDataTable(list); @@ -68,6 +74,8 @@ public class SupplierInfoController extends BaseController { @SysLog(title = "物资厂家管理", businessType = OperaType.EXPORT, logType = 1,module = "物资管理->导出物资厂家管理") @PostMapping("/export") public void export(HttpServletResponse response, SupplierInfo supplierInfo) { + Long deptId = typeService.getUserDeptId(); + supplierInfo.setCompanyId(String.valueOf(deptId)); List list = supplierInfoService.selectSupplierInfoList(supplierInfo); ExcelUtil util = new ExcelUtil<>(SupplierInfo.class); util.exportExcel(response, list, "物资厂家管理数据"); @@ -93,6 +101,8 @@ public class SupplierInfoController extends BaseController { @PostMapping public AjaxResult add(@RequestBody SupplierInfo supplierInfo) { try { + Long deptId = typeService.getUserDeptId(); + supplierInfo.setCompanyId(String.valueOf(deptId)); return supplierInfoService.insertSupplierInfo(supplierInfo); } catch (Exception e) { return error("系统错误, " + e.getMessage()); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java index 13f4bf88..0ebe3011 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/controller/TypeController.java @@ -86,6 +86,8 @@ public class TypeController extends BaseController { @SysLog(title = "物资类型管理", businessType = OperaType.EXPORT, module = "仓储管理->导出物资类型") @PostMapping("/export") public void export(HttpServletResponse response, MaTypeVo maTypeVo) { + Long deptId = typeService.getUserDeptId(); + maTypeVo.setCompanyId(deptId); List parentIds = typeService.selectParentId(maTypeVo); ExcelUtil util = new ExcelUtil<>(MaTypeVo.class); /*for (Integer parentId : parentIds) { @@ -114,6 +116,8 @@ public class TypeController extends BaseController { @ApiOperation(value = "根据左列表类型id查询右表格") @GetMapping("/getListByMaType") public AjaxResult getListByMaType(MaTypeVo maTypeVo) { + Long deptId = typeService.getUserDeptId(); + maTypeVo.setCompanyId(deptId); List parentIds = typeService.selectParentId(maTypeVo); if (CollectionUtils.isEmpty(parentIds)) { return AjaxResult.success(new ArrayList<>()); @@ -225,7 +229,8 @@ public class TypeController extends BaseController { @GetMapping("/getMaTypeTreeSelect") public AjaxResult getMaTypeTreeSelect(@RequestParam(required = false, defaultValue = "", value = "typeName") String typeName, @RequestParam(required = false, defaultValue = "", value = "parentId") String parentId) { - return typeService.getMaTypeTreeSelect(typeName, parentId); + Long deptId = typeService.getUserDeptId(); + return typeService.getMaTypeTreeSelect(typeName, parentId,deptId); } @@ -277,6 +282,8 @@ public class TypeController extends BaseController { @SysLog(title = "物资类型管理", businessType = OperaType.INSERT, module = "仓储管理->新增物资类型") @PostMapping public AjaxResult add(@RequestBody Type type) { + Long deptId = typeService.getUserDeptId(); + type.setCompanyId(deptId); return toAjax(typeService.insertType(type)); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/MachineSynch.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/MachineSynch.java index bf8255fb..4b16b941 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/MachineSynch.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/domain/MachineSynch.java @@ -163,4 +163,6 @@ public class MachineSynch extends BaseEntity { private String result; private int parentId; + + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java index e7e2f922..c3811833 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/mapper/TypeMapper.java @@ -67,7 +67,7 @@ public interface TypeMapper { * 物资类型树形结构 */ - List selectMaTypeTree(); + List selectMaTypeTree(Long deptId); /** * 查询物资类型列表 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java index 742e4edc..23c39c48 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/ITypeService.java @@ -108,9 +108,9 @@ public interface ITypeService { */ AjaxResult deleteTypeByTypeId(Long typeId); - List getMaTypeTree(String typeName, String parentId); + List getMaTypeTree(String typeName, String parentId,Long deptId); - AjaxResult getMaTypeTreeSelect(String typeName,String parentId); + AjaxResult getMaTypeTreeSelect(String typeName,String parentId,Long deptId); /** * 构建前端所需要树结构 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java index b198f4d1..ecc536f4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/TypeServiceImpl.java @@ -567,6 +567,7 @@ public class TypeServiceImpl implements ITypeService { WhHouseSet whHouseSet = new WhHouseSet(); whHouseSet.setHouseId(type.getHouseId()); whHouseSet.setTypeId(newTypeId); + whHouseSet.setCompanyId(type.getCompanyId()); houseSetService.insertWhHouseSet(whHouseSet); } // 根据patentId查询库管及维修员id集合 @@ -747,8 +748,8 @@ public class TypeServiceImpl implements ITypeService { @Override - public List getMaTypeTree(String typeName, String parentId) { - List maTypes = typeMapper.selectMaTypeTree(); + public List getMaTypeTree(String typeName, String parentId,Long deptId) { + List maTypes = typeMapper.selectMaTypeTree(deptId); if (CollectionUtils.isNotEmpty(maTypes)) { // 根据typeId查询子集数量 for (Type type : maTypes) { @@ -769,11 +770,11 @@ public class TypeServiceImpl implements ITypeService { } @Override - public AjaxResult getMaTypeTreeSelect(String typeName, String parentId) { + public AjaxResult getMaTypeTreeSelect(String typeName, String parentId,Long deptId) { // 1.顶级节点及子节点数据全部查询完毕 - List maTypeList = this.getMaTypeTree(typeName, parentId); + List maTypeList = this.getMaTypeTree(typeName, parentId,deptId); // 2.查询所有的仓库配置 - List whHouseSets = houseSetService.selectListByMaType(null); + List whHouseSets = houseSetService.selectListByMaType(null,deptId); // 2.1 定义最终接口返回集合 List treeSelectResultList = new ArrayList<>(); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/controller/ScrapReasonController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/controller/ScrapReasonController.java index 6807ebe6..a99bd322 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/controller/ScrapReasonController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/controller/ScrapReasonController.java @@ -6,6 +6,7 @@ import javax.servlet.http.HttpServletResponse; import com.bonus.common.core.utils.StringUtils; import com.bonus.common.log.enums.OperaType; import com.bonus.material.common.annotation.PreventRepeatSubmit; +import com.bonus.material.ma.service.ITypeService; import com.bonus.material.scrap.domain.ScrapReason; import com.bonus.material.scrap.service.IScrapReasonService; import io.swagger.annotations.Api; @@ -42,6 +43,9 @@ public class ScrapReasonController extends BaseController { @Autowired private IScrapReasonService scrapReasonService; + @Autowired + private ITypeService typeService; + /** * 查询二级类型下拉框列表 */ @@ -49,6 +53,8 @@ public class ScrapReasonController extends BaseController { @RequiresPermissions("scrap:reason:list") @GetMapping("/levelTwolist") public AjaxResult levelTwolist(ScrapReason scrapReason) { + Long deptId = typeService.getUserDeptId(); + scrapReason.setCompanyId(deptId); List list = scrapReasonService.levelTwolist(scrapReason); return success(list); } @@ -60,6 +66,8 @@ public class ScrapReasonController extends BaseController { @RequiresPermissions("scrap:reason:list") @GetMapping("/levelThreelist") public AjaxResult levelThreelist(ScrapReason scrapReason) { + Long deptId = typeService.getUserDeptId(); + scrapReason.setCompanyId(deptId); List list = scrapReasonService.levelThreelist(scrapReason); return success(list); } @@ -88,6 +96,8 @@ public class ScrapReasonController extends BaseController { @RequiresPermissions("scrap:reason:list") @GetMapping("/list") public TableDataInfo list(ScrapReason scrapReason) { + Long deptId = typeService.getUserDeptId(); + scrapReason.setCompanyId(deptId); startPage(); List list = scrapReasonService.selectScrapReasonList(scrapReason); return getDataTable(list); @@ -103,6 +113,8 @@ public class ScrapReasonController extends BaseController { @SysLog(title = "报废原因管理", businessType = OperaType.EXPORT, module = "报废原因管理->导出报废原因管理列表") @PostMapping("/export") public void export(HttpServletResponse response, ScrapReason scrapReason) { + Long deptId = typeService.getUserDeptId(); + scrapReason.setCompanyId(deptId); List list = scrapReasonService.selectScrapReasonList(scrapReason); ExcelUtil util = new ExcelUtil(ScrapReason.class); util.exportExcel(response, list, "报废原因数据"); diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/domain/ScrapReason.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/domain/ScrapReason.java index 2d72b06b..9096e0ac 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/domain/ScrapReason.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/scrap/domain/ScrapReason.java @@ -77,4 +77,6 @@ public class ScrapReason extends BaseEntity { @ApiModelProperty(value = "备注") private String remark; + private Long companyId; + } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java index b60fe400..3110c56f 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/settlement/controller/SltAgreementInfoController.java @@ -38,6 +38,7 @@ import com.bonus.material.basic.domain.report.DownloadRequest; import com.bonus.material.common.annotation.PreventRepeatSubmit; import com.bonus.material.common.domain.dto.SelectDto; import com.bonus.material.common.utils.DocxUtil; +import com.bonus.material.ma.service.ITypeService; import com.bonus.material.part.domain.PartLeaseInfo; import com.bonus.material.settlement.domain.*; import com.bonus.material.settlement.domain.dto.ExportProgressManager; @@ -110,6 +111,11 @@ public class SltAgreementInfoController extends BaseController { @Autowired private ExportProgressManager exportProgressManager; + @Autowired + private ITypeService typeService; + + + private static final Map downloadProgressMap = new ConcurrentHashMap<>(); /** * 查询结算信息列表 @@ -131,6 +137,8 @@ public class SltAgreementInfoController extends BaseController { public AjaxResult getSltAgreementInfo4Project(SltAgreementInfo bean) { Integer pageIndex = Convert.toInt(ServletUtils.getParameter("pageNum"), 1); Integer pageSize = Convert.toInt(ServletUtils.getParameter("pageSize"), 10); + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); // int loginUserHasSettlementPermission = sltAgreementInfoService.checkLoginUserHasSettlementPermission(); // if (bean != null) { // bean.setSettlementType(loginUserHasSettlementPermission); @@ -1599,9 +1607,9 @@ public class SltAgreementInfoController extends BaseController { @ApiOperation(value = "结算审批列表") @GetMapping("/getSltList") public TableDataInfo getSltList(SltAgreementInfo bean) { + Long deptId = typeService.getUserDeptId(); + bean.setCompanyId(deptId); startPage(); - - List list = sltAgreementInfoService.getSltList(bean); return getDataTable(list); } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseSetMapper.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseSetMapper.java index 128dae9f..cff18b50 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseSetMapper.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/mapper/WhHouseSetMapper.java @@ -2,6 +2,7 @@ package com.bonus.material.warehouse.mapper; import java.util.List; import com.bonus.material.warehouse.domain.WhHouseSet; +import org.apache.ibatis.annotations.Param; /** * 仓库货架配置Mapper接口 @@ -32,7 +33,7 @@ public interface WhHouseSetMapper * 根据物资类型id查询机具列表 * @param typeId 物资类型id */ - List selectListByMaType(Long typeId); + List selectListByMaType(@Param("typeId") Long typeId, @Param("deptId") Long deptId); /** * 新增仓库货架配置 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseSetService.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseSetService.java index 0d384784..76f0d3bb 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseSetService.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/IWhHouseSetService.java @@ -27,7 +27,7 @@ public interface IWhHouseSetService */ public List selectWhHouseSetList(WhHouseSet whHouseSet); - List selectListByMaType(Long typeId); + List selectListByMaType(Long typeId,Long deptId); /** * 新增仓库货架配置 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseSetServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseSetServiceImpl.java index dff1857a..fdfd48c4 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseSetServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/warehouse/service/impl/WhHouseSetServiceImpl.java @@ -46,8 +46,8 @@ public class WhHouseSetServiceImpl implements IWhHouseSetService @Override - public List selectListByMaType(Long typeId) { - return whHouseSetMapper.selectListByMaType(typeId); + public List selectListByMaType(Long typeId,Long deptId) { + return whHouseSetMapper.selectListByMaType(typeId,deptId); } ; diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmStorageLogMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmStorageLogMapper.xml index 67989a83..8fe58a2f 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmStorageLogMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmStorageLogMapper.xml @@ -56,14 +56,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND mt.del_flag = '0' LEFT JOIN ma_type mt1 ON mt.parent_id = mt1.type_id AND mt1.del_flag = '0' - + where 1=1 and bs.model_title like concat('%', #{modelTitle}, '%') and mt.type_id = #{typeId} - + + and mt.company_id = #{companyId} + ORDER BY bs.create_time DESC diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmUnitUnitMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmUnitUnitMapper.xml index 5b2162e0..bad1db6b 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmUnitUnitMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/basic/BmUnitUnitMapper.xml @@ -25,6 +25,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND dict_label like concat('%', #{dictLabel}, '%') + + AND company_id = #{companyId} + order by dict_sort asc diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml index 4c2f4083..52ce15e5 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/common/SelectMapper.xml @@ -40,6 +40,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.type_id = #{typeId} + + AND bu.dept_id = #{companyId} + + + UNION @@ -73,6 +78,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.type_id = #{typeId} + + AND bu.dept_id = #{companyId} + UNION SELECT @@ -105,6 +113,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.type_id = #{typeId} + + AND bu.dept_id = #{companyId} + ) ff ORDER BY LEVEL @@ -144,6 +155,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" WHERE mm.ma_code is not null and mm.ma_status in (1) GROUP BY mt.type_id) AS subquery0 ON subquery0.type_id = mt.type_id WHERE mt.del_flag = '0' + + AND mt.company_id = #{companyId} + AND mt.level IN ('1','2') @@ -397,6 +411,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.type_id = #{typeId} + + AND bu.dept_id = #{companyId} + SELECT unit_id AS unitId, @@ -409,6 +426,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND bu.type_id = #{typeId} + + AND bu.dept_id = #{companyId} + @@ -1011,6 +1031,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" AND mt.level IN ('1','2','3','4') + + AND mt.company_id = #{companyId} + @@ -1343,8 +1366,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" type_name as typeName FROM ma_type - WHERE - del_flag='0' + WHERE 1=1 + + and company_id = #{companyId} + + and del_flag='0' and parent_id='0' @@ -1214,6 +1219,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" or su.nick_name like concat('%', #{keyWord}, '%') ) + + and mci.company_id = #{companyId} + order by mci.create_time desc @@ -1264,12 +1272,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" insert into ma_check_info( ex_code, create_by, - create_time + create_time, + company_id ) values( #{reportNum}, #{userId}, - NOW() + NOW(), + #{companyId} ) diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml index 6fe776b5..047e8649 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/TypeMapper.xml @@ -219,7 +219,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" and mt2.type_id is not null and mhs.house_id = #{houseId} and mhs.del_flag = 0 - + and mt2.company_id = #{companyId} and mhs.company_id = #{companyId} @@ -261,6 +261,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" sampling_ratio, is_enter, jiJu_type, + company_id, #{typeName}, @@ -298,6 +299,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" #{samplingRatio}, #{isEnter}, #{jiJuType}, + #{companyId}, @@ -379,7 +381,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_type mt1 on mt1.type_id=mt2.parent_id left join wh_house_set whs on mt1.type_id=whs.type_id where mt3.del_flag = 0 and mt3.level = 3 - + and mt3.company_id = #{deptId} UNION select @@ -389,7 +391,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_type mt1 on mt1.type_id=mt2.parent_id left join wh_house_set whs on mt1.type_id=whs.type_id where mt2.del_flag = 0 and mt2.level = 2 - + and mt2.company_id = #{deptId} UNION select @@ -398,7 +400,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" from ma_type mt1 left join wh_house_set whs on mt1.type_id=whs.type_id where mt1.del_flag = 0 and mt1.level = 1 - + and mt1.company_id = #{deptId} order by type_id @@ -1308,6 +1310,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" or m3.type_name like concat('%',#{type.keyword},'%') ) + + and m.company_id = #{type.companyId} + GROUP BY m.type_id ORDER BY m.sort_num ASC, diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/scrap/ScrapReasonMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/scrap/ScrapReasonMapper.xml index e4b06bde..240f46fc 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/scrap/ScrapReasonMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/scrap/ScrapReasonMapper.xml @@ -8,12 +8,18 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select type_id as parentId,type_name as parentName from ma_type mt where level = 2 and del_flag = 0 + + and mt.company_id = #{companyId} + @@ -34,6 +40,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" OR mt.type_name LIKE CONCAT('%',#{keyWord},'%') ) + + and mt.company_id = #{companyId} + diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml index 7e3395f5..4fd5e1ab 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/settlement/SltAgreementInfoMapper.xml @@ -263,6 +263,9 @@ and bai.agreement_code like concat('%',#{agreementCode},'%') + + and bai.company_id = #{companyId} + GROUP BY bai.agreement_id ) t @@ -687,12 +690,15 @@ and bp.pro_id = #{projectId} + + and bai.company_id = #{companyId} + and sas.slt_status = '1' - and ssas.slt_status = '2' + and sas.slt_status = '2' and sas.slt_status = '3' diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseSetMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseSetMapper.xml index fdbddf17..d286229a 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseSetMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/warehouse/WhHouseSetMapper.xml @@ -123,5 +123,6 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" left join ma_type mt2 on mt1.parent_id = mt2.type_id right join wh_house_info mhi on mhs.house_id = mhi.house_id where mhi.del_flag=0 + and mhs.company_id = #{deptId} \ No newline at end of file