diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/domain/ExpectationsEntity.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/domain/ExpectationsEntity.java index e4c49b08..b138f011 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/domain/ExpectationsEntity.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/domain/ExpectationsEntity.java @@ -74,4 +74,5 @@ public class ExpectationsEntity { private String nextCheckTime; + private Long companyId; } diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java index 10e3aa17..8d321c95 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/expectations/service/impl/ExpectationsServiceImpl.java @@ -4,6 +4,7 @@ import com.bonus.common.core.web.domain.AjaxResult; import com.bonus.material.expectations.domain.ExpectationsEntity; import com.bonus.material.expectations.mapper.ExpectationsMapper; import com.bonus.material.expectations.service.ExpectationsService; +import com.bonus.material.ma.service.ITypeService; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.ObjectUtils; import org.springframework.stereotype.Service; @@ -21,6 +22,8 @@ public class ExpectationsServiceImpl implements ExpectationsService { @Resource private ExpectationsMapper mapper; + @Resource + private ITypeService iTypeService; /** * 在库,在用列表 * @@ -30,6 +33,11 @@ public class ExpectationsServiceImpl implements ExpectationsService { @Override public List getExpectationsList(ExpectationsEntity entity) { try { + /** + * jsk + */ + Long companyId=iTypeService.getUserDeptId(); + entity.setCompanyId(companyId); List expectationsList = mapper.getExpectationsList(entity); if (entity != null && "2".equals(entity.getUseStatus())) { //在用设备列表 diff --git a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java index 0c4d62b0..a9b4f8a0 100644 --- a/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java +++ b/bonus-modules/bonus-material/src/main/java/com/bonus/material/ma/service/impl/MachineServiceImpl.java @@ -19,6 +19,7 @@ import com.bonus.material.ma.domain.MachineSynch; import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.domain.vo.MachineVo; import com.bonus.material.ma.domain.vo.SampleSync; +import com.bonus.material.ma.service.ITypeService; import com.bonus.material.purchase.config.RemoteConfig; import com.bonus.material.scrap.domain.ScrapApplyDetails; import com.bonus.material.scrap.mapper.ScrapApplyDetailsMapper; @@ -62,6 +63,9 @@ public class MachineServiceImpl implements IMachineService @Resource private LeaseApplyDetailsMapper leaseApplyDetailsMapper; + @Resource + private ITypeService iTypeService; + private final ReentrantLock lock = new ReentrantLock(true); /** @@ -117,6 +121,11 @@ public class MachineServiceImpl implements IMachineService public int insertMachine(Machine machine) { machine.setCreateTime(DateUtils.getNowDate()); + /** + * jsk + */ + Long companyId=iTypeService.getUserDeptId(); + machine.setCompanyId(companyId+""); return machineMapper.insertMachine(machine); } @@ -130,6 +139,11 @@ public class MachineServiceImpl implements IMachineService public AjaxResult updateMachine(Machine machine) { machine.setUpdateTime(DateUtils.getNowDate()); + /** + * jsk + */ + Long companyId=iTypeService.getUserDeptId(); + machine.setCompanyId(companyId+""); int result = machineMapper.updateMachine(machine); if (result > 0) { return success(HttpCodeEnum.SUCCESS.getMsg(), result); diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml index c68bbd71..63ddc517 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/expectations/ExpectationsMapper.xml @@ -32,6 +32,9 @@ mt1.type_name LIKE CONCAT('%', #{keyWord}, '%') ) + + AND mm.company_id=#{companyId} + GROUP BY mm.type_id, status @@ -152,6 +155,9 @@ mm.next_check_time < CURDATE() OR mm.next_check_time < DATE_ADD(CURDATE(), INTERVAL 30 DAY) ) + + AND mm.company_id=#{companyId} + AND ( bu.unit_name LIKE CONCAT('%', #{keyWord}, '%') OR diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml index b620c0ac..8ef29b59 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/MachineMapper.xml @@ -350,6 +350,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" assets_id = #{assetsId}, remark = #{remark}, machine_name = #{materialModel}, + company_id = #{companyId}, where ma_id = #{maId} diff --git a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/WarehousingMapper.xml b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/WarehousingMapper.xml index 67619a44..6de5cdf4 100644 --- a/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/WarehousingMapper.xml +++ b/bonus-modules/bonus-material/src/main/resources/mapper/material/ma/WarehousingMapper.xml @@ -163,6 +163,7 @@ out_fac_code, this_check_time, next_check_time, + company_id, create_time )values( #{typeId}, @@ -174,6 +175,7 @@ #{outFacCode}, #{thisCheckTime}, #{nextCheckTime}, + #{companyId}, sysdate() )