jsk ma_machine 检验预警权限改造

This commit is contained in:
jiask 2026-01-08 16:58:00 +08:00
parent 033019224b
commit b84d468e49
6 changed files with 32 additions and 0 deletions

View File

@ -74,4 +74,5 @@ public class ExpectationsEntity {
private String nextCheckTime; private String nextCheckTime;
private Long companyId;
} }

View File

@ -4,6 +4,7 @@ import com.bonus.common.core.web.domain.AjaxResult;
import com.bonus.material.expectations.domain.ExpectationsEntity; import com.bonus.material.expectations.domain.ExpectationsEntity;
import com.bonus.material.expectations.mapper.ExpectationsMapper; import com.bonus.material.expectations.mapper.ExpectationsMapper;
import com.bonus.material.expectations.service.ExpectationsService; import com.bonus.material.expectations.service.ExpectationsService;
import com.bonus.material.ma.service.ITypeService;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -21,6 +22,8 @@ public class ExpectationsServiceImpl implements ExpectationsService {
@Resource @Resource
private ExpectationsMapper mapper; private ExpectationsMapper mapper;
@Resource
private ITypeService iTypeService;
/** /**
* 在库在用列表 * 在库在用列表
* *
@ -30,6 +33,11 @@ public class ExpectationsServiceImpl implements ExpectationsService {
@Override @Override
public List<ExpectationsEntity> getExpectationsList(ExpectationsEntity entity) { public List<ExpectationsEntity> getExpectationsList(ExpectationsEntity entity) {
try { try {
/**
* jsk
*/
Long companyId=iTypeService.getUserDeptId();
entity.setCompanyId(companyId);
List<ExpectationsEntity> expectationsList = mapper.getExpectationsList(entity); List<ExpectationsEntity> expectationsList = mapper.getExpectationsList(entity);
if (entity != null && "2".equals(entity.getUseStatus())) { if (entity != null && "2".equals(entity.getUseStatus())) {
//在用设备列表 //在用设备列表

View File

@ -19,6 +19,7 @@ import com.bonus.material.ma.domain.MachineSynch;
import com.bonus.material.ma.domain.Type; import com.bonus.material.ma.domain.Type;
import com.bonus.material.ma.domain.vo.MachineVo; import com.bonus.material.ma.domain.vo.MachineVo;
import com.bonus.material.ma.domain.vo.SampleSync; 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.purchase.config.RemoteConfig;
import com.bonus.material.scrap.domain.ScrapApplyDetails; import com.bonus.material.scrap.domain.ScrapApplyDetails;
import com.bonus.material.scrap.mapper.ScrapApplyDetailsMapper; import com.bonus.material.scrap.mapper.ScrapApplyDetailsMapper;
@ -62,6 +63,9 @@ public class MachineServiceImpl implements IMachineService
@Resource @Resource
private LeaseApplyDetailsMapper leaseApplyDetailsMapper; private LeaseApplyDetailsMapper leaseApplyDetailsMapper;
@Resource
private ITypeService iTypeService;
private final ReentrantLock lock = new ReentrantLock(true); private final ReentrantLock lock = new ReentrantLock(true);
/** /**
@ -117,6 +121,11 @@ public class MachineServiceImpl implements IMachineService
public int insertMachine(Machine machine) public int insertMachine(Machine machine)
{ {
machine.setCreateTime(DateUtils.getNowDate()); machine.setCreateTime(DateUtils.getNowDate());
/**
* jsk
*/
Long companyId=iTypeService.getUserDeptId();
machine.setCompanyId(companyId+"");
return machineMapper.insertMachine(machine); return machineMapper.insertMachine(machine);
} }
@ -130,6 +139,11 @@ public class MachineServiceImpl implements IMachineService
public AjaxResult updateMachine(Machine machine) public AjaxResult updateMachine(Machine machine)
{ {
machine.setUpdateTime(DateUtils.getNowDate()); machine.setUpdateTime(DateUtils.getNowDate());
/**
* jsk
*/
Long companyId=iTypeService.getUserDeptId();
machine.setCompanyId(companyId+"");
int result = machineMapper.updateMachine(machine); int result = machineMapper.updateMachine(machine);
if (result > 0) { if (result > 0) {
return success(HttpCodeEnum.SUCCESS.getMsg(), result); return success(HttpCodeEnum.SUCCESS.getMsg(), result);

View File

@ -32,6 +32,9 @@
mt1.type_name LIKE CONCAT('%', #{keyWord}, '%') mt1.type_name LIKE CONCAT('%', #{keyWord}, '%')
) )
</if> </if>
<if test="companyId != null and companyId != ''">
AND mm.company_id=#{companyId}
</if>
GROUP BY GROUP BY
mm.type_id, mm.type_id,
status status
@ -152,6 +155,9 @@
mm.next_check_time &lt; CURDATE() mm.next_check_time &lt; CURDATE()
OR mm.next_check_time &lt; DATE_ADD(CURDATE(), INTERVAL 30 DAY) OR mm.next_check_time &lt; DATE_ADD(CURDATE(), INTERVAL 30 DAY)
) )
<if test="companyId != null and companyId != ''">
AND mm.company_id=#{companyId}
</if>
<if test="keyWord != null and keyWord != ''"> <if test="keyWord != null and keyWord != ''">
AND ( AND (
bu.unit_name LIKE CONCAT('%', #{keyWord}, '%') OR bu.unit_name LIKE CONCAT('%', #{keyWord}, '%') OR

View File

@ -350,6 +350,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="assetsId != null">assets_id = #{assetsId},</if> <if test="assetsId != null">assets_id = #{assetsId},</if>
<if test="remark != null">remark = #{remark},</if> <if test="remark != null">remark = #{remark},</if>
<if test="materialModel != null">machine_name = #{materialModel},</if> <if test="materialModel != null">machine_name = #{materialModel},</if>
<if test="companyId != null">company_id = #{companyId},</if>
</trim> </trim>
where ma_id = #{maId} where ma_id = #{maId}
</update> </update>

View File

@ -163,6 +163,7 @@
<if test="outFacCode != null and outFacCode != ''">out_fac_code,</if> <if test="outFacCode != null and outFacCode != ''">out_fac_code,</if>
<if test="thisCheckTime != null">this_check_time,</if> <if test="thisCheckTime != null">this_check_time,</if>
<if test="nextCheckTime != null">next_check_time,</if> <if test="nextCheckTime != null">next_check_time,</if>
<if test="companyId != null">company_id,</if>
create_time create_time
)values( )values(
<if test="typeId != null and typeId != ''">#{typeId},</if> <if test="typeId != null and typeId != ''">#{typeId},</if>
@ -174,6 +175,7 @@
<if test="outFacCode != null and outFacCode != ''">#{outFacCode},</if> <if test="outFacCode != null and outFacCode != ''">#{outFacCode},</if>
<if test="thisCheckTime != null">#{thisCheckTime},</if> <if test="thisCheckTime != null">#{thisCheckTime},</if>
<if test="nextCheckTime != null">#{nextCheckTime},</if> <if test="nextCheckTime != null">#{nextCheckTime},</if>
<if test="companyId != null">#{companyId},</if>
sysdate() sysdate()
) )
</insert> </insert>