|
|
|
@ -9,7 +9,10 @@ import com.heai.modules.production.entity.ReworkRecord; |
|
|
|
import com.heai.modules.production.entity.ReworkRecordData; |
|
|
|
import com.heai.modules.production.entity.SOScheduledRoutingOutData; |
|
|
|
import com.heai.modules.production.service.ReworkRecordService; |
|
|
|
import com.heai.modules.sys.entity.SysRoleEntity; |
|
|
|
import com.heai.modules.sys.entity.SysUserEntity; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.shiro.SecurityUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.transaction.annotation.Transactional; |
|
|
|
@ -104,11 +107,22 @@ public class ReworkRecordServiceImpl extends ServiceImpl<ReworkRecordMapper,Rewo |
|
|
|
|
|
|
|
@Override |
|
|
|
public void removeRework(ReworkRecord reworkRecord) { |
|
|
|
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
List<SysRoleEntity> checkUserRole=dailyPlanMapper.checkUserRole(currentUser.getUserId(),"管理员"); |
|
|
|
if(checkUserRole.size()==0){ |
|
|
|
throw new RuntimeException("该用户没有权限"); |
|
|
|
} |
|
|
|
lambdaUpdate().eq(ReworkRecord::getReworkNo,reworkRecord.getReworkNo()).remove(); |
|
|
|
} |
|
|
|
|
|
|
|
@Override |
|
|
|
public void cancelRework(ReworkRecord reworkRecord) { |
|
|
|
baseMapper.cancelRework(reworkRecord); |
|
|
|
SysUserEntity currentUser = (SysUserEntity) SecurityUtils.getSubject().getPrincipal(); |
|
|
|
List<SysRoleEntity> checkUserRole=dailyPlanMapper.checkUserRole(currentUser.getUserId(),"管理员"); |
|
|
|
if(checkUserRole.size()==0){ |
|
|
|
throw new RuntimeException("该用户没有权限"); |
|
|
|
} |
|
|
|
baseMapper.cancelRework(reworkRecord |
|
|
|
); |
|
|
|
} |
|
|
|
} |